Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5903709imu; Wed, 30 Jan 2019 05:38:43 -0800 (PST) X-Google-Smtp-Source: ALg8bN42ny9lIFdIUYc9uw4R67JZWUqXRFyX8a24lkt5y+KQH2Z9Vu+QbMVV+ZZH+m2gzX9O4iyX X-Received: by 2002:a63:1b58:: with SMTP id b24mr27178137pgm.247.1548855523117; Wed, 30 Jan 2019 05:38:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548855523; cv=none; d=google.com; s=arc-20160816; b=VNHCR6aLJTM28tNC86d6pxRQtte0Wg6YiKBmMYRbmBtUU9nOBP86vMYlD9fQ9zSN1v +7Dbt8WPBYMUlgk0r7y+aTYleFKJWjVgeU1rZptGFtqFXZMRcjVEGWRNDGyDX5bvizZs LsCFA2MuZekg6RbU9sxEq0U8fO/8w2VLPSr5ta9HVqf6Y7jtPZexNAHxiYYeMZ9X+REj x26LqbTAYu6E0yZyJyQ+MTF3aTsAPDrdiJNfESnVglYSUj6HYO6/iWqCzA+EdJ9Kk2zZ TxCMAK7pJQMqfEqBmUR1wV0CSh36svOkxNZHiidRQvCgO/At53V3V+yWaajraiq8fkms NqJA== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=kFbF0FeQdzTBYlHXUUF6ycmN8fz5072JGBoOUv/RLLA=; b=wlnIj3ggdwM/CrN1sHiz03EwYxJfSdboWXXs37QUHBXkDJAqPJVGZp2f/9MVukaQyB x/p8YpgXvCV1LLvBqXWOXrl9GHZui55XxT5PZZGJCHOaUyjPvPDAb4vIEtVPdlSRsRGd 33GgO7KTf+5iJvqkVed1Q/JGenQQ+qgiwWQWl5GEH3a/kbUibM8v3HAVJrrJfIQlQux2 wr6kZuvy+Hxiug7ON/NfzJ4ZGhSQLxBsFUoAWnyPbfVxamAfFK0Z/8wog2VGPVh4G3su 29QZadJK4uQAcD/HtSv2RuEqFNiBEK6UpaTl135sIv1czAPwH8XQlEsuylsJqojhnVC+ Et4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=L22TyK+P; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c65si1606860pfa.148.2019.01.30.05.38.27; Wed, 30 Jan 2019 05:38:43 -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; dkim=pass header.i=@linaro.org header.s=google header.b=L22TyK+P; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731205AbfA3NgK (ORCPT + 99 others); Wed, 30 Jan 2019 08:36:10 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:51723 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725851AbfA3NgJ (ORCPT ); Wed, 30 Jan 2019 08:36:09 -0500 Received: by mail-wm1-f67.google.com with SMTP id b11so21675481wmj.1 for ; Wed, 30 Jan 2019 05:36:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=kFbF0FeQdzTBYlHXUUF6ycmN8fz5072JGBoOUv/RLLA=; b=L22TyK+Pp5MyMEIWLQ/6o4B19fMzOjUfQb45WtpQis4S5GiBj3sjAZMO9sR4hznDQr XVn7lMJkYd68xeX/M9qUQiOTa+2bxMRTUo9UrTA3J2DxvUa/ou5NTUrwTJqItDHlDLd7 vE1z8ISo55pjn8PAHQNoIj74zMaNu8tcL5lig= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=kFbF0FeQdzTBYlHXUUF6ycmN8fz5072JGBoOUv/RLLA=; b=VUmqt7Fgz7vvGG3H8ryglkE0PN9fBsGloXdAlN/6gbWm8tKgZpOx5M0YNNhNPgSUnr nkKNEfKsLVHrw1oCGdt0+wJutp770Dz+Ywlq3LqZs/EjJ3vkZxtn2BVVs++2DsCGBeEA D390wqcG6S1Ox2laWFWTA2k67LZzllJp5fk/JCEeemr3vmTG3Na7OmzKwIJav36cZ2rz YiB+yaoHl3oZSKfHUTmWzLiIH6wdHY7smWXykjtuFRZctLTEeqOoo09qVVP9ON+C8Kmg gaO11sjdYi0g0kMxfo6Gjn2jhv4lgINzVBk2jkVl7KgvYazbA623nWs2tLwrVzRP2bMh YeWw== X-Gm-Message-State: AJcUukcljwVamIsk3l1GOWsyX3rJfIS4xfqNUlX9xiJ5D2GBaILYa7ry 3Cm4oneq5saJoxzYD7dbZISzsg== X-Received: by 2002:a1c:19c2:: with SMTP id 185mr26252266wmz.8.1548855367053; Wed, 30 Jan 2019 05:36:07 -0800 (PST) Received: from dell ([2.27.35.198]) by smtp.gmail.com with ESMTPSA id f191sm2268436wmg.12.2019.01.30.05.36.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 30 Jan 2019 05:36:06 -0800 (PST) Date: Wed, 30 Jan 2019 13:36:05 +0000 From: Lee Jones To: Chen-Yu Tsai Cc: Thierry Reding , Daniel Thompson , Jingoo Han , linux-pwm@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Maxime Ripard , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] backlight: pwm_bl: Use gpiod_get_value_cansleep() to get initial state Message-ID: <20190130133605.GI4701@dell> References: <20190127145054.3770-1-wens@csie.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190127145054.3770-1-wens@csie.org> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 27 Jan 2019, 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: > > 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 > --- > drivers/video/backlight/pwm_bl.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Applied, thanks. -- Lee Jones [李琼斯] Linaro Services Technical Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog