Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1008592yba; Thu, 4 Apr 2019 02:18:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqxDCyLH4Xo0uFQeBEaqvVTURz14tPuf/E5euunymRSWkQ/plXpK0K0E25Jfh3PRNxb4Lvr0 X-Received: by 2002:a62:5144:: with SMTP id f65mr4762519pfb.13.1554369524631; Thu, 04 Apr 2019 02:18:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554369524; cv=none; d=google.com; s=arc-20160816; b=fCh1j0ZQE9ivGqgcJkZiK9+MJZ8NnuAJzNc2QNK3qFd7sZEsLW0yMQcFWlRXuzDJ21 hiOTAzBizCCA5+OfaHVtlqsG+HmlnuCh7/ZbXitDh7qbQXFPVxMfj0CsDjFF1EUssWTY 33izabbT1s3xuG4tJEzdhqMloO+MFzMB8C1zuqHteBqJ+EEYbihjglGec6OyzEQhUUYD mCacxuNnQtlipHwlpT4TwRkFWigHmSr1z0rw9XHx/2yjscWbbOYBCoEyOBfrKSSn21iD pyM90cqOp/XrS8NMQeDDPTcc2y67T96Mt+cGwFzjeA9y5DE5CfhJnarYX+kSoaGWb5Qo x4GQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=MPcsmoW1zFJbKhYNooaDN2EQz+YJHYl0p2qov2T/lrI=; b=kl6hw1Of3D4/2OcPMW0qa7o1tWEa38UQAKACeZdGhBWXig2ukxHpnhs3SXrjs36ij+ l6u9laVgTUw5VAzbMHo+yFi+ePKIIfbpoytYFlipKEkSHjY7XRENv1vLKk0WctGiLOYA zbZJOBneof4L03Tr5XQema1QjvKUlSgq/qaswFYxouXbQVu3JBrBwMttsLYxPaNyk4hw Vnxx6jS+zDsLkPNGDVYY/Rg+JPT6Io1nb2uWnfnpbvyKpMt/0o3qcJwS7eG4y+p5hKt7 ey86a6/dOUmzvLTzQGlPL9zKiwkPJHs9P0j+Mp6CSX3z8vpZcnPr8wVsUVeJb3n2O8Mt Dk7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FQ7M6v3v; 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 l71si90982pge.428.2019.04.04.02.18.29; Thu, 04 Apr 2019 02:18:44 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b=FQ7M6v3v; 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 S2388087AbfDDJQi (ORCPT + 99 others); Thu, 4 Apr 2019 05:16:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:57810 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387645AbfDDJQg (ORCPT ); Thu, 4 Apr 2019 05:16:36 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 993872147C; Thu, 4 Apr 2019 09:16:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1554369395; bh=OMlM5rDQSOtZ9503yCEfUUGxAXftQ/4co5BtguhmHf0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FQ7M6v3vs//BWgPPz5nI+dCJYS31G54ID/JFcZdX7M72rxRHMaOjBkDc2UdIvUnoz ClHW1GEuGUkEFUrPNIvw+jSxQ5neWMap+5J5iT2jaXfhFZIXnNJEra/06L0O5SVasd mHcJ1XU7o9Y+jV7VzuDVA2FR+86ElaEHc9WgExf4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chen-Yu Tsai , Maxime Ripard , Daniel Thompson , Lee Jones , Sasha Levin Subject: [PATCH 5.0 192/246] backlight: pwm_bl: Use gpiod_get_value_cansleep() to get initial state Date: Thu, 4 Apr 2019 10:48:12 +0200 Message-Id: <20190404084625.907853643@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190404084619.236418459@linuxfoundation.org> References: <20190404084619.236418459@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 5.0-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit cec2b18832e26bc866bef2be22eff4e25bbc4034 ] gpiod_get_value() gives out a warning if access to the underlying gpiochip requires sleeping, which is common for I2C based chips: WARNING: CPU: 0 PID: 77 at drivers/gpio/gpiolib.c:2500 gpiod_get_value+0xd0/0x100 Modules linked in: CPU: 0 PID: 77 Comm: kworker/0:2 Not tainted 4.14.0-rc3-00589-gf32897915d48-dirty #90 Hardware name: Allwinner sun4i/sun5i Families Workqueue: events deferred_probe_work_func [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [] (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_probe+0x50/0xac) [] (platform_drv_probe) from [] (driver_probe_device+0x238/0x2e8) [] (driver_probe_device) from [] (bus_for_each_drv+0x44/0x94) [] (bus_for_each_drv) from [] (__device_attach+0xb0/0x114) [] (__device_attach) from [] (bus_probe_device+0x84/0x8c) [] (bus_probe_device) from [] (deferred_probe_work_func+0x50/0x14c) [] (deferred_probe_work_func) from [] (process_one_work+0x1ec/0x414) [] (process_one_work) from [] (worker_thread+0x2b0/0x5a0) [] (worker_thread) from [] (kthread+0x14c/0x154) [] (kthread) from [] (ret_from_fork+0x14/0x24) 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"). The only usage of gpiod_get_value() is during the probe stage, which is safe to sleep in. Switch to gpiod_get_value_cansleep(). Fixes: 0c9501f823a4 ("backlight: pwm_bl: Handle gpio that can sleep") Signed-off-by: Chen-Yu Tsai Acked-by: Maxime Ripard Acked-by: Daniel Thompson Signed-off-by: Lee Jones Signed-off-by: Sasha Levin --- drivers/video/backlight/pwm_bl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index feb90764a811..53b8ceea9bde 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c @@ -435,7 +435,7 @@ static int pwm_backlight_initial_power_state(const struct pwm_bl_data *pb) */ /* if the enable GPIO is disabled, do not enable the backlight */ - if (pb->enable_gpio && gpiod_get_value(pb->enable_gpio) == 0) + if (pb->enable_gpio && gpiod_get_value_cansleep(pb->enable_gpio) == 0) return FB_BLANK_POWERDOWN; /* The regulator is disabled, do not enable the backlight */ -- 2.19.1