Re: [Intel-gfx] [ [PATCH v2 01/10] drm/print: introduce new struct drm_device based WARN* macros

2020-01-22 Thread Jani Nikula
On Wed, 22 Jan 2020, Sean Paul  wrote:
> On Tue, Jan 14, 2020 at 10:49 PM Pankaj Bharadiya
>  wrote:
>>
>> Add new struct drm_device based WARN* macros. These are modeled after
>> the core kernel device based WARN* macros. These would be preferred
>> over the regular WARN* macros, where possible.
>>
>> 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.
>>
>> Signed-off-by: Pankaj Bharadiya 
>
> Acked-by: Sean Paul 

Maarten and Maxime also provided their acks on IRC. Thanks for the
review and acks, I've pushed this to a topic branch, sent the pull
request for drm-misc-next [1], and pulled the same to
drm-intel-next-queued [2] to unblock further work there.

BR,
Jani.


[1] http://lore.kernel.org/r/87eevrecnf@intel.com
[2] 7c7d5b1ce739 ("Merge tag 'topic/drm-warn-2020-01-22' of 
git://anongit.freedesktop.org/drm/drm-intel into drm-intel-next-queued")



>
>> ---
>>  include/drm/drm_print.h | 29 +
>>  1 file changed, 29 insertions(+)
>>
>> diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h
>> index 8f99d389792d..894a0b9437e2 100644
>> --- a/include/drm/drm_print.h
>> +++ b/include/drm/drm_print.h
>> @@ -553,4 +553,33 @@ void __drm_err(const char *format, ...);
>>  #define DRM_DEBUG_PRIME_RATELIMITED(fmt, ...)  \
>> DRM_DEV_DEBUG_PRIME_RATELIMITED(NULL, fmt, ##__VA_ARGS__)
>>
>> +/*
>> + * struct drm_device based WARNs
>> + *
>> + * drm_WARN*() acts like WARN*(), but with the key difference of
>> + * using device specific information so that we know from which device
>> + * warning is originating from.
>> + *
>> + * Prefer drm_device based drm_WARN* over regular WARN*
>> + */
>> +
>> +/* Helper for struct drm_device based WARNs */
>> +#define drm_WARN(drm, condition, format, arg...)   \
>> +   WARN(condition, "%s %s: " format,   \
>> +   dev_driver_string((drm)->dev),  \
>> +   dev_name((drm)->dev), ## arg)
>> +
>> +#define drm_WARN_ONCE(drm, condition, format, arg...)  \
>> +   WARN_ONCE(condition, "%s %s: " format,  \
>> +   dev_driver_string((drm)->dev),  \
>> +   dev_name((drm)->dev), ## arg)
>> +
>> +#define drm_WARN_ON(drm, x)\
>> +   drm_WARN((drm), (x), "%s",  \
>> +"drm_WARN_ON(" __stringify(x) ")")
>> +
>> +#define drm_WARN_ON_ONCE(drm, x)   \
>> +   drm_WARN_ONCE((drm), (x), "%s", \
>> + "drm_WARN_ON_ONCE(" __stringify(x) ")")
>> +
>>  #endif /* DRM_PRINT_H_ */
>> --
>> 2.23.0
>>
>> ___
>> Intel-gfx mailing list
>> Intel-gfx@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Jani Nikula, Intel Open Source Graphics Center
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [ [PATCH v2 01/10] drm/print: introduce new struct drm_device based WARN* macros

2020-01-22 Thread Sean Paul
On Tue, Jan 14, 2020 at 10:49 PM Pankaj Bharadiya
 wrote:
>
> Add new struct drm_device based WARN* macros. These are modeled after
> the core kernel device based WARN* macros. These would be preferred
> over the regular WARN* macros, where possible.
>
> 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.
>
> Signed-off-by: Pankaj Bharadiya 

Acked-by: Sean Paul 

> ---
>  include/drm/drm_print.h | 29 +
>  1 file changed, 29 insertions(+)
>
> diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h
> index 8f99d389792d..894a0b9437e2 100644
> --- a/include/drm/drm_print.h
> +++ b/include/drm/drm_print.h
> @@ -553,4 +553,33 @@ void __drm_err(const char *format, ...);
>  #define DRM_DEBUG_PRIME_RATELIMITED(fmt, ...)  \
> DRM_DEV_DEBUG_PRIME_RATELIMITED(NULL, fmt, ##__VA_ARGS__)
>
> +/*
> + * struct drm_device based WARNs
> + *
> + * drm_WARN*() acts like WARN*(), but with the key difference of
> + * using device specific information so that we know from which device
> + * warning is originating from.
> + *
> + * Prefer drm_device based drm_WARN* over regular WARN*
> + */
> +
> +/* Helper for struct drm_device based WARNs */
> +#define drm_WARN(drm, condition, format, arg...)   \
> +   WARN(condition, "%s %s: " format,   \
> +   dev_driver_string((drm)->dev),  \
> +   dev_name((drm)->dev), ## arg)
> +
> +#define drm_WARN_ONCE(drm, condition, format, arg...)  \
> +   WARN_ONCE(condition, "%s %s: " format,  \
> +   dev_driver_string((drm)->dev),  \
> +   dev_name((drm)->dev), ## arg)
> +
> +#define drm_WARN_ON(drm, x)\
> +   drm_WARN((drm), (x), "%s",  \
> +"drm_WARN_ON(" __stringify(x) ")")
> +
> +#define drm_WARN_ON_ONCE(drm, x)   \
> +   drm_WARN_ONCE((drm), (x), "%s", \
> + "drm_WARN_ON_ONCE(" __stringify(x) ")")
> +
>  #endif /* DRM_PRINT_H_ */
> --
> 2.23.0
>
> ___
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [ [PATCH v2 01/10] drm/print: introduce new struct drm_device based WARN* macros

2020-01-21 Thread Sam Ravnborg
On Tue, Jan 21, 2020 at 10:39:34AM +0200, Jani Nikula wrote:
> On Wed, 15 Jan 2020, Jani Nikula  wrote:
> > On Wed, 15 Jan 2020, Pankaj Bharadiya 
> >  wrote:
> >> Add new struct drm_device based WARN* macros. These are modeled after
> >> the core kernel device based WARN* macros. These would be preferred
> >> over the regular WARN* macros, where possible.
> >>
> >> 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.
> >>
> >> Signed-off-by: Pankaj Bharadiya 
> >
> > Reviewed-by: Jani Nikula 
> 
> All, I'd really appreciate acks or reviews on this one to unblock the
> rest. I think the patch is fine, but I'd like wider approval before
> merging.

Patch looks good:

Reviewed-by: Sam Ravnborg 

Sam
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [ [PATCH v2 01/10] drm/print: introduce new struct drm_device based WARN* macros

2020-01-21 Thread Jani Nikula
On Wed, 15 Jan 2020, Jani Nikula  wrote:
> On Wed, 15 Jan 2020, Pankaj Bharadiya 
>  wrote:
>> Add new struct drm_device based WARN* macros. These are modeled after
>> the core kernel device based WARN* macros. These would be preferred
>> over the regular WARN* macros, where possible.
>>
>> 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.
>>
>> Signed-off-by: Pankaj Bharadiya 
>
> Reviewed-by: Jani Nikula 

All, I'd really appreciate acks or reviews on this one to unblock the
rest. I think the patch is fine, but I'd like wider approval before
merging.

I'm thinking of putting this in a topic branch and merging to both
drm-intel-next-queued and drm-misc-next, so we can start converting i915
to use this.

BR,
Jani.


>
>> ---
>>  include/drm/drm_print.h | 29 +
>>  1 file changed, 29 insertions(+)
>>
>> diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h
>> index 8f99d389792d..894a0b9437e2 100644
>> --- a/include/drm/drm_print.h
>> +++ b/include/drm/drm_print.h
>> @@ -553,4 +553,33 @@ void __drm_err(const char *format, ...);
>>  #define DRM_DEBUG_PRIME_RATELIMITED(fmt, ...)   
>> \
>>  DRM_DEV_DEBUG_PRIME_RATELIMITED(NULL, fmt, ##__VA_ARGS__)
>>  
>> +/*
>> + * struct drm_device based WARNs
>> + *
>> + * drm_WARN*() acts like WARN*(), but with the key difference of
>> + * using device specific information so that we know from which device
>> + * warning is originating from.
>> + *
>> + * Prefer drm_device based drm_WARN* over regular WARN*
>> + */
>> +
>> +/* Helper for struct drm_device based WARNs */
>> +#define drm_WARN(drm, condition, format, arg...)\
>> +WARN(condition, "%s %s: " format,   \
>> +dev_driver_string((drm)->dev),  \
>> +dev_name((drm)->dev), ## arg)
>> +
>> +#define drm_WARN_ONCE(drm, condition, format, arg...)   
>> \
>> +WARN_ONCE(condition, "%s %s: " format,  \
>> +dev_driver_string((drm)->dev),  \
>> +dev_name((drm)->dev), ## arg)
>> +
>> +#define drm_WARN_ON(drm, x) \
>> +drm_WARN((drm), (x), "%s",  \
>> + "drm_WARN_ON(" __stringify(x) ")")
>> +
>> +#define drm_WARN_ON_ONCE(drm, x)\
>> +drm_WARN_ONCE((drm), (x), "%s", \
>> +  "drm_WARN_ON_ONCE(" __stringify(x) ")")
>> +
>>  #endif /* DRM_PRINT_H_ */

-- 
Jani Nikula, Intel Open Source Graphics Center
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [ [PATCH v2 01/10] drm/print: introduce new struct drm_device based WARN* macros

2020-01-15 Thread Jani Nikula
On Wed, 15 Jan 2020, Pankaj Bharadiya  
wrote:
> Add new struct drm_device based WARN* macros. These are modeled after
> the core kernel device based WARN* macros. These would be preferred
> over the regular WARN* macros, where possible.
>
> 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.
>
> Signed-off-by: Pankaj Bharadiya 

Reviewed-by: Jani Nikula 

> ---
>  include/drm/drm_print.h | 29 +
>  1 file changed, 29 insertions(+)
>
> diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h
> index 8f99d389792d..894a0b9437e2 100644
> --- a/include/drm/drm_print.h
> +++ b/include/drm/drm_print.h
> @@ -553,4 +553,33 @@ void __drm_err(const char *format, ...);
>  #define DRM_DEBUG_PRIME_RATELIMITED(fmt, ...)
> \
>   DRM_DEV_DEBUG_PRIME_RATELIMITED(NULL, fmt, ##__VA_ARGS__)
>  
> +/*
> + * struct drm_device based WARNs
> + *
> + * drm_WARN*() acts like WARN*(), but with the key difference of
> + * using device specific information so that we know from which device
> + * warning is originating from.
> + *
> + * Prefer drm_device based drm_WARN* over regular WARN*
> + */
> +
> +/* Helper for struct drm_device based WARNs */
> +#define drm_WARN(drm, condition, format, arg...) \
> + WARN(condition, "%s %s: " format,   \
> + dev_driver_string((drm)->dev),  \
> + dev_name((drm)->dev), ## arg)
> +
> +#define drm_WARN_ONCE(drm, condition, format, arg...)
> \
> + WARN_ONCE(condition, "%s %s: " format,  \
> + dev_driver_string((drm)->dev),  \
> + dev_name((drm)->dev), ## arg)
> +
> +#define drm_WARN_ON(drm, x)  \
> + drm_WARN((drm), (x), "%s",  \
> +  "drm_WARN_ON(" __stringify(x) ")")
> +
> +#define drm_WARN_ON_ONCE(drm, x) \
> + drm_WARN_ONCE((drm), (x), "%s", \
> +   "drm_WARN_ON_ONCE(" __stringify(x) ")")
> +
>  #endif /* DRM_PRINT_H_ */

-- 
Jani Nikula, Intel Open Source Graphics Center
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx