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 0C275C433E1 for ; Mon, 18 May 2020 17:03:41 +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 E1BC120826 for ; Mon, 18 May 2020 17:03:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E1BC120826 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 677566E116; Mon, 18 May 2020 17:03:40 +0000 (UTC) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 971916E116 for ; Mon, 18 May 2020 17:03:38 +0000 (UTC) IronPort-SDR: eqeRffkULN23vgmMqCyut2RnLw/VTzcENkbWI2BM2aE0eC34yVNC/pZh4OD3vtCRGHrNSmj/Pn WnKjAiB6ekzg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 May 2020 10:03:38 -0700 IronPort-SDR: pKtxDuWKX1oYAizRStGbvkJdLKNNCHg2tJSb/F0sX9Ke5ECDD66CKShy8scFV05EHzv05NbVTR 3BljPhTDViAg== X-IronPort-AV: E=Sophos;i="5.73,407,1583222400"; d="scan'208";a="439291692" Received: from ahermans-mobl.ger.corp.intel.com (HELO localhost) ([10.252.41.209]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 May 2020 10:03:24 -0700 From: Jani Nikula To: Daniel Thompson , Sam Ravnborg Subject: Re: [PATCH v2 06/16] backlight: improve backlight_device documentation In-Reply-To: <20200518160324.mak4mhgyrgdbr7ww@holly.lan> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20200517190139.740249-1-sam@ravnborg.org> <20200517190139.740249-7-sam@ravnborg.org> <20200518160324.mak4mhgyrgdbr7ww@holly.lan> Date: Mon, 18 May 2020 20:03:21 +0300 Message-ID: <87o8ql2n1i.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: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, Bjorn Andersson , Peter Ujfalusi , Thierry Reding , Lee Jones , Jonathan Corbet , Tomi Valkeinen , Russell King , Andy Gross , Uwe Kleine-Konig , linux-pwm@vger.kernel.org, Michael Hennerich , Bartlomiej Zolnierkiewicz , linux-arm-msm@vger.kernel.org, Support Opensource , Jingoo Han , Douglas Anderson , Thomas Zimmermann , patches@opensource.cirrus.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Mon, 18 May 2020, Daniel Thompson wrote: > On Sun, May 17, 2020 at 09:01:29PM +0200, Sam Ravnborg wrote: >> Improve the documentation for backlight_device and >> adapt it to kernel-doc style. >> >> Signed-off-by: Sam Ravnborg >> Cc: Lee Jones >> Cc: Daniel Thompson >> Cc: Jingoo Han >> --- >> include/linux/backlight.h | 81 ++++++++++++++++++++++++++++----------- >> 1 file changed, 58 insertions(+), 23 deletions(-) >> >> diff --git a/include/linux/backlight.h b/include/linux/backlight.h >> index 7f9cef299d6e..e2d72936bf05 100644 >> --- a/include/linux/backlight.h >> +++ b/include/linux/backlight.h >> @@ -14,21 +14,6 @@ >> #include >> #include >> >> -/* Notes on locking: >> - * >> - * backlight_device->ops_lock is an internal backlight lock protecting the >> - * ops pointer and no code outside the core should need to touch it. >> - * >> - * Access to update_status() is serialised by the update_lock mutex since >> - * most drivers seem to need this and historically get it wrong. >> - * >> - * Most drivers don't need locking on their get_brightness() method. >> - * If yours does, you need to implement it in the driver. You can use the >> - * update_lock mutex if appropriate. >> - * >> - * Any other use of the locks below is probably wrong. >> - */ >> - >> enum backlight_update_reason { >> BACKLIGHT_UPDATE_HOTKEY, >> BACKLIGHT_UPDATE_SYSFS, >> @@ -221,30 +206,80 @@ struct backlight_properties { >> enum backlight_scale scale; >> }; >> >> +/** >> + * struct backlight_device - backlight device data >> + * >> + * This structure holds all data required by a backlight device. >> + */ >> struct backlight_device { >> - /* Backlight properties */ >> + /** >> + * @props: >> + * > > As last patch. Why no brief descriptions? There are no "brief descriptions" in kernel-doc struct member inline markup. It would be possible to shorten this to: /** * @props: Backlight properties */ BR, Jani. > > >> + * Backlight properties >> + */ >> struct backlight_properties props; >> >> - /* Serialise access to update_status method */ >> + /** >> + * @update_lock: >> + * >> + * update_lock is an internal backlight lock that serialise access >> + * to the update_status() method. The iupdate_lock mutex shall not be used >> + * by backlight drivers. > > In addition to the typo this directly contradicts the advice in the > original "Notes on locking". > > A change this dramatic needs to be fully explaining in the patch > description. > > > Daniel. > > >> + */ >> struct mutex update_lock; >> >> - /* This protects the 'ops' field. If 'ops' is NULL, the driver that >> - registered this device has been unloaded, and if class_get_devdata() >> - points to something in the body of that driver, it is also invalid. */ >> + /** >> + * @ops_lock: >> + * >> + * ops_lock is an internal backlight lock that protects the ops pointer >> + * and is used around all accesses to ops and when the operations are >> + * invoked. The mutex shall not be used by backlight drivers. >> + */ >> struct mutex ops_lock; >> + >> + /** >> + * @ops: >> + * >> + * Pointer to the backlight operations. If ops is NULL, the driver that >> + * registered this device has been unloaded, and if class_get_devdata() >> + * points to something in the body of that driver, it is also invalid. >> + */ >> const struct backlight_ops *ops; >> >> - /* The framebuffer notifier block */ >> + /** >> + * @fb_notif: >> + * >> + * The framebuffer notifier block >> + */ >> struct notifier_block fb_notif; >> >> - /* list entry of all registered backlight devices */ >> + /** >> + * @entry: >> + * >> + * List entry of all registered backlight devices >> + */ >> struct list_head entry; >> >> + /** >> + * @dev: >> + * >> + * Parent device. >> + */ >> struct device dev; >> >> - /* Multiple framebuffers may share one backlight device */ >> + /** >> + * @fb_bl_on: >> + * >> + * Multiple fbdev's may share one backlight device. The fb_bl_on >> + * records the state of the individual fbdev. >> + */ >> bool fb_bl_on[FB_MAX]; >> >> + /** >> + * @use_count: >> + * >> + * The number of uses of fb_bl_on. >> + */ >> int use_count; >> }; >> >> -- >> 2.25.1 >> -- Jani Nikula, Intel Open Source Graphics Center _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel