From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754700AbaLDUIz (ORCPT ); Thu, 4 Dec 2014 15:08:55 -0500 Received: from bh-25.webhostbox.net ([208.91.199.152]:43609 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751590AbaLDUIy (ORCPT ); Thu, 4 Dec 2014 15:08:54 -0500 Date: Thu, 4 Dec 2014 12:08:47 -0800 From: Guenter Roeck To: Nishanth Menon Cc: Jean Delvare , linux-kernel@vger.kernel.org, lm-sensors@lm-sensors.org, linux-omap@vger.kernel.org Subject: Re: [PATCH] hwmon: (gpio-fan) Allow usage of gpio operations that may sleep Message-ID: <20141204200847.GC16925@roeck-us.net> References: <1417712328-29831-1-git-send-email-nm@ti.com> <20141204190528.GA16925@roeck-us.net> <20141204194615.GA7975@kahuna> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20141204194615.GA7975@kahuna> User-Agent: Mutt/1.5.21 (2010-09-15) X-Authenticated_sender: guenter@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-CTCH-PVer: 0000001 X-CTCH-Spam: Unknown X-CTCH-VOD: Unknown X-CTCH-Flags: 0 X-CTCH-RefID: str=0001.0A020206.5480BF55.014D,ss=1,re=0.001,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0 X-CTCH-Score: 0.001 X-CTCH-ScoreCust: 0.000 X-CTCH-Rules: C_4847, X-CTCH-SenderID: linux@roeck-us.net X-CTCH-SenderID-Flags: 0 X-CTCH-SenderID-TotalMessages: 3 X-CTCH-SenderID-TotalSpam: 0 X-CTCH-SenderID-TotalSuspected: 0 X-CTCH-SenderID-TotalConfirmed: 0 X-CTCH-SenderID-TotalBulk: 0 X-CTCH-SenderID-TotalVirus: 0 X-CTCH-SenderID-TotalRecipients: 0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: mailgid no entry from get_relayhosts_entry X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 04, 2014 at 01:46:15PM -0600, Nishanth Menon wrote: > On 11:05-20141204, Guenter Roeck wrote: > > On Thu, Dec 04, 2014 at 10:58:47AM -0600, Nishanth Menon wrote: > > > Certain I2C based GPIO expanders could be used in sleepable context, > > > this results in: > > > [ 115.890569] ------------[ cut here ]------------ > > > [ 115.895422] WARNING: CPU: 0 PID: 1115 at drivers/gpio/gpiolib.c:1370 gpiod_set_raw_value+0x40/0x4c() > > > [ 115.905024] Modules linked in: > > > [ 115.908229] CPU: 0 PID: 1115 Comm: sh Tainted: G W 3.18.0-rc7-next-20141203-dirty #1 > > > [ 115.917461] Hardware name: Generic DRA74X (Flattened Device Tree) > > > [ 115.923876] [] (unwind_backtrace) from [] (show_stack+0x10/0x14) > > > [ 115.932013] [] (show_stack) from [] (dump_stack+0x78/0x94) > > > [ 115.939594] [] (dump_stack) from [] (warn_slowpath_common+0x7c/0xb4) > > > [ 115.948094] [] (warn_slowpath_common) from [] (warn_slowpath_null+0x1c/0x24) > > > [ 115.957315] [] (warn_slowpath_null) from [] (gpiod_set_raw_value+0x40/0x4c) > > > [ 115.966457] [] (gpiod_set_raw_value) from [] (set_fan_speed+0x4c/0x64) > > > [ 115.975145] [] (set_fan_speed) from [] (set_rpm+0x98/0xac) > > > [ 115.982742] [] (set_rpm) from [] (dev_attr_store+0x18/0x24) > > > [ 115.990426] [] (dev_attr_store) from [] (sysfs_kf_write+0x4c/0x50) > > > [ 115.998742] [] (sysfs_kf_write) from [] (kernfs_fop_write+0xbc/0x19c) > > > [ 116.007333] [] (kernfs_fop_write) from [] (vfs_write+0xb0/0x1a0) > > > [ 116.015461] [] (vfs_write) from [] (SyS_write+0x44/0x84) > > > [ 116.022881] [] (SyS_write) from [] (ret_fast_syscall+0x0/0x48) > > > [ 116.030833] ---[ end trace 3a0b636123acab82 ]--- > > > > > > So, switch over to sleepable GPIO operations as there is no mandatory > > > need for non-sleepable gpio operations in the fan driver. > > > > > > This allows the fan driver to be used with i2c based gpio expanders such > > > as palmas_gpio. > > > > > > Signed-off-by: Nishanth Menon > > > > Applied to hwmon-next. Do we need this in older kernels ? > > I have'nt had a need for it till recently.. in terms of the sleepable > get/set, it seems to have been introduced with > commit 7560fa60fcdcdb0da662f6a9fad9064b554ef46c > Author: David Brownell > Date: Tue Mar 4 14:28:27 2008 -0800 > gpio: and "no GPIO support here" stubs > > Guessing no one needed it so far.. so probably future should be good > enough, I think.. > Ok. We can still add it to -stable at a later time if the need arises. Guenter