Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp16348949rwd; Mon, 26 Jun 2023 08:51:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Hl9sfPvadVM9s1r5tNinHdotnRIFJf+u0yLQHKmM9rCc20ugC0gZTmOUmHJUwhWAIQZ5G X-Received: by 2002:a17:907:75ea:b0:991:d5ad:f1b1 with SMTP id jz10-20020a17090775ea00b00991d5adf1b1mr1753688ejc.47.1687794697535; Mon, 26 Jun 2023 08:51:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687794697; cv=none; d=google.com; s=arc-20160816; b=ReYjB49CdjHgYDRhIdMWBwIcd5+7Tj2WqMBemDbtrxsvBBAEJFMYp4dusqW5yuXVCG 3o5U+BaMm8zzbGT7VTu3nzq6aW6khDdK5rkFAHkwHnZTOV+4kknOLFF5PhhfZRoQSjC4 DEd6vPFav8LMGNNoc0RW2YxppB7xRbyIOq5nj8I1HBfCXPrCJ96+Tw7jL42AIr9zSJvH yC2PwedGZfnHXVbvUsk0C3c0t1Y8c8O3SveDt/c5+3PYXZvVzIHiZaQHpap6/gzKvW0B ePMWwkdmCe8WarK4nTBi+1WIvT9/WtmPwkhQDUzmPtU1Bhe1zXze+TnjJR2coklGRSuZ 74XQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=WjZZfX8eKwFEFxRFWJJm0j6ZAuxckirDsc4ZXvXcQWA=; fh=OJRe6sn0iTyFZMwJwgmQRECd7ck515wZabyCEMFHo4Y=; b=KZP5XSejMj8JtA60tI6lCIl+LU0bLNwpHwWExyjCX2uhMhrKRBYsVEPd5mOhb2wEik uULvybnkEFdSK2NGZFOpDfCmHg0PunGG3eckV7MCEy3Tw0zYeTr2VXnpdIh+sY6MIXK6 l6k78rC+LOKnrlUC4mgat1ZpklexokXDomplqW0gA9DoDU0wyz7x/HxzAppzhOz2KL32 dOo+uKyeQdIosiTXJI+yBAH+v0cKasBh2dZoV0kn240vYEjHs4UG4RkovlJuF4XIlpI0 3TAh8fPRkHkEU2s2hYTwdtwQ/EAHqQ0ozSf9SsZ0FzS6wMkvbpghc/DKB5Q4VXULBKCY reXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=acJeh38H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j18-20020a170906831200b00988a5cdbfa7si2776340ejx.889.2023.06.26.08.51.08; Mon, 26 Jun 2023 08:51:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=acJeh38H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231218AbjFZPa1 (ORCPT + 99 others); Mon, 26 Jun 2023 11:30:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230268AbjFZPaU (ORCPT ); Mon, 26 Jun 2023 11:30:20 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2DD02191 for ; Mon, 26 Jun 2023 08:30:19 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BEF6360ECF for ; Mon, 26 Jun 2023 15:30:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0083DC433C8; Mon, 26 Jun 2023 15:30:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687793418; bh=53scOIRiyUvo1bQ31bLWEAzYQBHJ1VAec+PK9RRAeNI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=acJeh38HK0X0EB2DCiG+ZL1pCaXWHFkUIlg7iMPP9YfXZ8LACO/k+FgE21pWrZw3u t6GnzFRUrPtvSI6B6DNHis8FhOzJOSMn64DamAJSfqc+xl4sGICxgLOyCihdLGpZ2p u2EoravVWawbrmd5KUHik4mQpq+GxF5tho8ebiDn5hcYDrybCUkOyRUH7NR0Cqjd/F zpytNn2pUJfmWBBebr6ONKc26tmWyrjmuJG8Hf5no0ZEnvNwaSnQmE3uQNGWNGoAOI eQOMYiGji49xM+3J/I0yX9jntxmNzYSz1ztiPpsO+GiM8TALb/TP8hTv7TSx28sg1z etZNMdmf+hTQw== Date: Mon, 26 Jun 2023 16:30:12 +0100 From: Lee Jones To: Mans Rullgard Cc: Daniel Thompson , Jingoo Han , Tomi Valkeinen , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] backlight: led_bl: take led_access lock when required Message-ID: <20230626153012.GB10378@google.com> References: <20230619160249.10414-1-mans@mansr.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230619160249.10414-1-mans@mansr.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 19 Jun 2023, Mans Rullgard wrote: > The led_access lock must be held when calling led_sysfs_enable() and > led_sysfs_disable(). This fixes warnings such as this: > > [ 2.432495] ------------[ cut here ]------------ > [ 2.437316] WARNING: CPU: 0 PID: 22 at drivers/leds/led-core.c:349 led_sysfs_disable+0x54/0x58 > [ 2.446105] Modules linked in: > [ 2.449218] CPU: 0 PID: 22 Comm: kworker/u2:1 Not tainted 6.3.8+ #1 > [ 2.456268] Hardware name: Generic AM3517 (Flattened Device Tree) > [ 2.462402] Workqueue: events_unbound deferred_probe_work_func > [ 2.468353] unwind_backtrace from show_stack+0x10/0x14 > [ 2.473632] show_stack from dump_stack_lvl+0x24/0x2c > [ 2.478759] dump_stack_lvl from __warn+0x9c/0xc4 > [ 2.483551] __warn from warn_slowpath_fmt+0x64/0xc0 > [ 2.488586] warn_slowpath_fmt from led_sysfs_disable+0x54/0x58 > [ 2.494567] led_sysfs_disable from led_bl_probe+0x20c/0x3b0 > [ 2.500305] led_bl_probe from platform_probe+0x5c/0xb8 > [ 2.505615] platform_probe from really_probe+0xc8/0x2a0 > [ 2.510986] really_probe from __driver_probe_device+0x88/0x19c > [ 2.516967] __driver_probe_device from driver_probe_device+0x30/0xcc > [ 2.523498] driver_probe_device from __device_attach_driver+0x94/0xc4 > [ 2.530090] __device_attach_driver from bus_for_each_drv+0x80/0xcc > [ 2.536437] bus_for_each_drv from __device_attach+0xf8/0x19c > [ 2.542236] __device_attach from bus_probe_device+0x8c/0x90 > [ 2.547973] bus_probe_device from deferred_probe_work_func+0x80/0xb0 > [ 2.554504] deferred_probe_work_func from process_one_work+0x228/0x4c0 > [ 2.561187] process_one_work from worker_thread+0x1fc/0x4d0 > [ 2.566925] worker_thread from kthread+0xb4/0xd0 > [ 2.571685] kthread from ret_from_fork+0x14/0x2c > [ 2.576446] Exception stack(0xd0079fb0 to 0xd0079ff8) > [ 2.581573] 9fa0: 00000000 00000000 00000000 00000000 > [ 2.589813] 9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > [ 2.598052] 9fe0: 00000000 00000000 00000000 00000000 00000013 00000000 > [ 2.604888] ---[ end trace 0000000000000000 ]--- > > > Signed-off-by: Mans Rullgard > --- > drivers/video/backlight/led_bl.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) Applied, thanks -- Lee Jones [李琼斯]