mbox series

[v6,0/7] drm: Introduce struct drm_device based WARN* and use them in i915

Message ID 20200205173419.1695-1-pankaj.laxminarayan.bharadiya@intel.com (mailing list archive)
Headers show
Series drm: Introduce struct drm_device based WARN* and use them in i915 | expand

Message

Pankaj Bharadiya Feb. 5, 2020, 5:34 p.m. UTC
Device specific dev_WARN and dev_WARN_ONCE macros available in kernel
include device information in the backtrace, so we know what device
the warnings originate from.

Similar to this, add new struct drm_device based drm_WARN* macros. These
macros include device information in the backtrace, so we know
what device the warnings originate from. Knowing the device specific
information in the backtrace would be helpful in development all
around.

This patch series aims to convert calls of WARN(), WARN_ON(),
WARN_ONCE() and WARN_ON_ONCE() in i915 driver to use the drm
device-specific variants automatically wherever struct device pointer
is available.

To do this, this patch series -
  - introduces new struct drm_device based WARN* macros
  - automatically converts WARN* with device specific dev_WARN*
    variants using coccinelle semantic patch scripts.

The goal is to convert all the calls of WARN* with drm_WARN* in i915,
but there are still cases where device pointer is not readily
available in some functions (or I missed them somehow) using WARN*
hence some manual churning is needed. Handle such remaining cases
separately later.

changes since v5:
   - rebase unmerged patches onto drm-tip
     (db0579be2554 drm-tip: 2020y-02m-05d-10h-51m-13s UTC integration manifest)

changes since v4:
   - Address Jani's comment
     - split major i915/display related conversions per file into
       seperate patches so that non conflicting patches can be
       merged.

changes since v3:
  - rebase pending unmerged patches on drm-tip
	(bc626bbb5b6e drm-tip: 2020y-01m-25d-14h-28m-41s UTC integration manifest)

changes since v2:
  - rebase pending unmerged patches on drm-tip

changes since v1:
  - Address Jani's review comments
    - Fix typo in comment of patch 0001
    - Get rid of helper functions
    - Split patches by directory

Changes since RFC at [1]
  - Introduce drm_WARN* macros and use them as suggested by Sam and Jani
  - Get rid of extra local variables

[1] https://patchwork.freedesktop.org/series/71668/


*** BLURB HERE ***

Pankaj Bharadiya (7):
  drm/i915/display/cdclk: Make WARN* drm specific where drm_priv ptr is
    available
  drm/i915/display/ddi: Make WARN* drm specific where drm_device ptr is
    available
  drm/i915/display/display: Make WARN* drm specific where drm_device ptr
    is available
  drm/i915/display/power: Make WARN* drm specific where drm_priv ptr is
    available
  drm/i915/display/dp: Make WARN* drm specific where drm_device ptr is
    available
  drm/i915/display/global_state: Make WARN* drm specific where
    drm_device ptr is available
  drm/i915/display/hdcp: Make WARN* drm specific where drm_priv ptr is
    available

 drivers/gpu/drm/i915/display/intel_cdclk.c    |  85 ++++---
 drivers/gpu/drm/i915/display/intel_ddi.c      |  92 ++++---
 drivers/gpu/drm/i915/display/intel_display.c  | 238 ++++++++++--------
 .../drm/i915/display/intel_display_power.c    | 174 +++++++------
 drivers/gpu/drm/i915/display/intel_dp.c       | 118 +++++----
 .../gpu/drm/i915/display/intel_global_state.c |   4 +-
 drivers/gpu/drm/i915/display/intel_hdcp.c     |  20 +-
 7 files changed, 417 insertions(+), 314 deletions(-)

Comments

Jani Nikula Feb. 19, 2020, 10:55 a.m. UTC | #1
On Wed, 05 Feb 2020, Patchwork <patchwork@emeril.freedesktop.org> wrote:
> == Series Details ==
>
> Series: drm: Introduce struct drm_device based WARN* and use them in i915 (rev6)
> URL   : https://patchwork.freedesktop.org/series/72035/
> State : failure
>
> == Summary ==
>
> Applying: drm/i915/display/cdclk: Make WARN* drm specific where drm_priv ptr is available
> Applying: drm/i915/display/ddi: Make WARN* drm specific where drm_device ptr is available
> Applying: drm/i915/display/display: Make WARN* drm specific where drm_device ptr is available
> Using index info to reconstruct a base tree...
> M	drivers/gpu/drm/i915/display/intel_display.c
> Falling back to patching base and 3-way merge...
> Auto-merging drivers/gpu/drm/i915/display/intel_display.c
> Applying: drm/i915/display/power: Make WARN* drm specific where drm_priv ptr is available
> Using index info to reconstruct a base tree...
> M	drivers/gpu/drm/i915/display/intel_display_power.c
> Falling back to patching base and 3-way merge...
> Auto-merging drivers/gpu/drm/i915/display/intel_display_power.c
> CONFLICT (content): Merge conflict in drivers/gpu/drm/i915/display/intel_display_power.c
> error: Failed to merge in the changes.
> hint: Use 'git am --show-current-patch' to see the failed patch
> Patch failed at 0004 drm/i915/display/power: Make WARN* drm specific where drm_priv ptr is available
> When you have resolved this problem, run "git am --continue".
> If you prefer to skip this patch, run "git am --skip" instead.
> To restore the original branch and stop patching, run "git am --abort".

Pankaj, please don't expect people to respond to your patches if they
don't apply...

BR,
Jani.
Pankaj Bharadiya Feb. 19, 2020, 11 a.m. UTC | #2
> -----Original Message-----
> From: Jani Nikula <jani.nikula@linux.intel.com>
> Sent: 19 February 2020 16:25
> To: Patchwork <patchwork@emeril.freedesktop.org>; Laxminarayan Bharadiya,
> Pankaj <pankaj.laxminarayan.bharadiya@intel.com>
> Cc: intel-gfx@lists.freedesktop.org
> Subject: Re: [Intel-gfx] ✗ Fi.CI.BUILD: failure for drm: Introduce struct
> drm_device based WARN* and use them in i915 (rev6)
> 
> On Wed, 05 Feb 2020, Patchwork <patchwork@emeril.freedesktop.org> wrote:
> > == Series Details ==
> >
> > Series: drm: Introduce struct drm_device based WARN* and use them in i915
> (rev6)
> > URL   : https://patchwork.freedesktop.org/series/72035/
> > State : failure
> >
> > == Summary ==
> >
> > Applying: drm/i915/display/cdclk: Make WARN* drm specific where
> > drm_priv ptr is available
> > Applying: drm/i915/display/ddi: Make WARN* drm specific where
> > drm_device ptr is available
> > Applying: drm/i915/display/display: Make WARN* drm specific where
> > drm_device ptr is available Using index info to reconstruct a base tree...
> > M	drivers/gpu/drm/i915/display/intel_display.c
> > Falling back to patching base and 3-way merge...
> > Auto-merging drivers/gpu/drm/i915/display/intel_display.c
> > Applying: drm/i915/display/power: Make WARN* drm specific where
> > drm_priv ptr is available Using index info to reconstruct a base tree...
> > M	drivers/gpu/drm/i915/display/intel_display_power.c
> > Falling back to patching base and 3-way merge...
> > Auto-merging drivers/gpu/drm/i915/display/intel_display_power.c
> > CONFLICT (content): Merge conflict in
> > drivers/gpu/drm/i915/display/intel_display_power.c
> > error: Failed to merge in the changes.
> > hint: Use 'git am --show-current-patch' to see the failed patch Patch
> > failed at 0004 drm/i915/display/power: Make WARN* drm specific where
> > drm_priv ptr is available When you have resolved this problem, run "git am --
> continue".
> > If you prefer to skip this patch, run "git am --skip" instead.
> > To restore the original branch and stop patching, run "git am --abort".
> 
> Pankaj, please don't expect people to respond to your patches if they don't
> apply...

Yes. I understand