Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3314306imu; Mon, 28 Jan 2019 02:40:17 -0800 (PST) X-Google-Smtp-Source: ALg8bN6bRGRD79I0CwGWajBQ+ZIYIivVZF/iUhZoOhTj4Ht4j0nz9mGMA5ylxQ488SN7AsN8BWFe X-Received: by 2002:a63:6b05:: with SMTP id g5mr18867783pgc.15.1548672017735; Mon, 28 Jan 2019 02:40:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548672017; cv=none; d=google.com; s=arc-20160816; b=XJvxET0Xs3ULHkCqRTGtUph1XCtDdLrY1TI7q6VgH3sHBfBCp9MO9ERw7F5C6IBiMJ BWpCz3K4EahnuvxUGrIrJy18Nc0w/13CJktX+KYgzacdK7GWOrAuAOu2rKLC9GpjUZrG V1EOkBGji2+sympDRhJBae/ZRBwkzWRUbzVY5q4W6riUJK1wENcVwtAudgUUWSKdSGIB Jl70BubPr3vL2Y6B4Y8XQ4k3Qky+NyYZp97axytNHFsH/vM5pBmCrmtycDLmKaK/F8AE uXKur5WvXOTQAg4V2Sghztw+MgMT4vUnYxSeQBzcmOxcz58RXTIZ7OkkyNunw2YI/G27 HQ/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=IB19ruJ/qyit9RP1tcqT2wm0pJGb4jkToh3E1MITUZ4=; b=pWsFlc6AZlcTk1kojTvXRRs0tUY+gLsAUArjkjIQOieRWbmwl8U13ozjYRfpM/mKyG HiD+f03/iJfUlZFyVCfFXzKJ8BIaWi6Vjjinm1LDM8p/eYHrOSwvlMn7uWNC4wWH4S8Y tLsBcsxuxIYaVaFoJewMLtBklcx9Wqaukt2IAcPuxXeNqhyLYGSYOBIsw98GodaXGjrC hRcch0EO8A5vJ0cjcFEEUvlUOhwqQT5gej5OwwZzJhWyGRndb+qCcBoo6meFpEjxi+A7 fO4OHxOQeJJNsn6SLTWB7oIGjWeOxPVXwQzq/tEn1NGoYSieZJF2r15z8vB6trefbyln yp2g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m39si32909280plg.315.2019.01.28.02.40.02; Mon, 28 Jan 2019 02:40:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726790AbfA1Kis (ORCPT + 99 others); Mon, 28 Jan 2019 05:38:48 -0500 Received: from mail.bootlin.com ([62.4.15.54]:50025 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726415AbfA1Kis (ORCPT ); Mon, 28 Jan 2019 05:38:48 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id 985722078F; Mon, 28 Jan 2019 11:38:44 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.2 Received: from localhost (aaubervilliers-681-1-87-206.w90-88.abo.wanadoo.fr [90.88.29.206]) by mail.bootlin.com (Postfix) with ESMTPSA id 61011206A6; Mon, 28 Jan 2019 11:38:34 +0100 (CET) Date: Mon, 28 Jan 2019 11:38:35 +0100 From: Maxime Ripard To: Chen-Yu Tsai Cc: Thierry Reding , Lee Jones , Daniel Thompson , Jingoo Han , linux-pwm@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] backlight: pwm_bl: Use gpiod_get_value_cansleep() to get initial state Message-ID: <20190128103835.ibgze6vbkk642dkv@flea> References: <20190127145054.3770-1-wens@csie.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="7z7natm2nbelfsf6" Content-Disposition: inline In-Reply-To: <20190127145054.3770-1-wens@csie.org> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --7z7natm2nbelfsf6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jan 27, 2019 at 10:50:54PM +0800, Chen-Yu Tsai wrote: > gpiod_get_value() gives out a warning if access to the underlying gpiochip > requires sleeping, which is common for I2C based chips: >=20 > WARNING: CPU: 0 PID: 77 at drivers/gpio/gpiolib.c:2500 gpiod_get_valu= e+0xd0/0x100 > Modules linked in: > CPU: 0 PID: 77 Comm: kworker/0:2 Not tainted 4.14.0-rc3-00589-gf32897= 915d48-dirty #90 > Hardware name: Allwinner sun4i/sun5i Families > Workqueue: events deferred_probe_work_func > [] (unwind_backtrace) from [] (show_stack+0x10/0x= 14) > [] (show_stack) from [] (dump_stack+0x88/0x9c) > [] (dump_stack) from [] (__warn+0xe8/0x100) > [] (__warn) from [] (warn_slowpath_null+0x20/0x28) > [] (warn_slowpath_null) from [] (gpiod_get_value+= 0xd0/0x100) > [] (gpiod_get_value) from [] (pwm_backlight_probe= +0x238/0x508) > [] (pwm_backlight_probe) from [] (platform_drv_pr= obe+0x50/0xac) > [] (platform_drv_probe) from [] (driver_probe_dev= ice+0x238/0x2e8) > [] (driver_probe_device) from [] (bus_for_each_dr= v+0x44/0x94) > [] (bus_for_each_drv) from [] (__device_attach+0x= b0/0x114) > [] (__device_attach) from [] (bus_probe_device+0x= 84/0x8c) > [] (bus_probe_device) from [] (deferred_probe_wor= k_func+0x50/0x14c) > [] (deferred_probe_work_func) from [] (process_on= e_work+0x1ec/0x414) > [] (process_one_work) from [] (worker_thread+0x2b= 0/0x5a0) > [] (worker_thread) from [] (kthread+0x14c/0x154) > [] (kthread) from [] (ret_from_fork+0x14/0x24) >=20 > This was missed in commit 0c9501f823a4 ("backlight: pwm_bl: Handle gpio > that can sleep"). The code was then moved to a separate function in > commit 7613c922315e ("backlight: pwm_bl: Move the checks for initial power > state to a separate function"). >=20 > The only usage of gpiod_get_value() is during the probe stage, which is > safe to sleep in. Switch to gpiod_get_value_cansleep(). >=20 > Fixes: 0c9501f823a4 ("backlight: pwm_bl: Handle gpio that can sleep") > Signed-off-by: Chen-Yu Tsai Acked-by: Maxime Ripard Maxime =20 --=20 Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com --7z7natm2nbelfsf6 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCXE7bqgAKCRDj7w1vZxhR xfndAP9l8ziOquk7/+im/vyCRkkkx8BUdtaHT/UNrJzybBggygD+KZOftP3cZ5As vpNwIM8ohyvw0yMrbuWWkz0rJvxKDA8= =tEBo -----END PGP SIGNATURE----- --7z7natm2nbelfsf6--