From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F829C2D0CE for ; Tue, 21 Jan 2020 08:39:43 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4C73222522 for ; Tue, 21 Jan 2020 08:39:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4C73222522 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 778AC6EBE7; Tue, 21 Jan 2020 08:39:42 +0000 (UTC) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id AA3FA6EBE7; Tue, 21 Jan 2020 08:39:41 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Jan 2020 00:39:41 -0800 X-IronPort-AV: E=Sophos;i="5.70,345,1574150400"; d="scan'208";a="219880620" Received: from jnikula-mobl3.fi.intel.com (HELO localhost) ([10.237.66.161]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Jan 2020 00:39:37 -0800 From: Jani Nikula To: Pankaj Bharadiya , daniel@ffwll.ch, sam@ravnborg.org, sudeep.dutt@intel.com, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Maarten Lankhorst , Maxime Ripard , David Airlie Subject: Re: [[Intel-gfx] [PATCH v2 01/10] drm/print: introduce new struct drm_device based WARN* macros In-Reply-To: <87y2u9jav8.fsf@intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20200115034455.17658-1-pankaj.laxminarayan.bharadiya@intel.com> <20200115034455.17658-2-pankaj.laxminarayan.bharadiya@intel.com> <87y2u9jav8.fsf@intel.com> Date: Tue, 21 Jan 2020 10:39:34 +0200 Message-ID: <87muahfbjt.fsf@intel.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: pankaj.laxminarayan.bharadiya@intel.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel