From patchwork Thu Dec 6 03:31:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jingoo Han X-Patchwork-Id: 1843931 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 0A5AC3FCF2 for ; Thu, 6 Dec 2012 03:34:45 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TgSBm-0006Db-QB; Thu, 06 Dec 2012 03:31:54 +0000 Received: from mailout1.samsung.com ([203.254.224.24]) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TgSBi-0006D8-2C for linux-arm-kernel@lists.infradead.org; Thu, 06 Dec 2012 03:31:52 +0000 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MEL00LSKB4TT100@mailout1.samsung.com> for linux-arm-kernel@lists.infradead.org; Thu, 06 Dec 2012 12:31:41 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [203.254.230.49]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id E0.40.01231.D9110C05; Thu, 06 Dec 2012 12:31:41 +0900 (KST) X-AuditID: cbfee61a-b7fa66d0000004cf-a2-50c0119dc952 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 50.40.01231.D9110C05; Thu, 06 Dec 2012 12:31:41 +0900 (KST) Received: from DOJG1HAN02 ([12.23.120.99]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MEL005CWB4SDWH0@mmp1.samsung.com> for linux-arm-kernel@lists.infradead.org; Thu, 06 Dec 2012 12:31:41 +0900 (KST) From: Jingoo Han To: 'Andrew Morton' , 'LKML' Subject: [PATCH v5] backlight: corgi_lcd: Use gpio_set_value_cansleep() to avoid WARN_ON Date: Thu, 06 Dec 2012 12:31:40 +0900 Message-id: <000301cdd362$34d9d800$9e8d8800$%han@samsung.com> MIME-version: 1.0 X-Mailer: Microsoft Office Outlook 12.0 Thread-index: Ac3TYjSPVpbuKR7XQU6xECQkiN7XgA== Content-language: ko DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrHIsWRmVeSWpSXmKPExsVy+t8zQ925ggcCDHYck7TY9PgaqwOjx+Yl 9QGMUVw2Kak5mWWpRfp2CVwZn17cZi84JV/xeOdulgbGfpkuRk4OCQETiblNU9ggbDGJC/fW A9lcHEICyxglrt36zQhTtP/wdHaIxCJGidMPJrNCOIuZJN7OPsIOUsUmoCbx5cthMFtEIEKi ecYsZhCbWWAHk8T7izldjBwcwgJREtcbWEHCLAKqEhsOTgezeQVsJTZOnMcMYQtK/Jh8jwWi VUti/c7jTBC2vMTmNW+ZQcZICKhLPPqrC7FJT2Juy382iBIRiX0v3jFCjBeQ+Db5EAtEuazE pgPMIBdLCLSzS7Q/W8YM8ZekxMEVN1gmMIrNQrJ5FpLNs5BsnoVkxQJGllWMoqkFyQXFSem5 hnrFibnFpXnpesn5uZsYIZEitYNxZYPFIUYBDkYlHl7L6v0BQqyJZcWVuYcYJTiYlUR4z30G CvGmJFZWpRblxxeV5qQWH2L0Abp8IrOUaHI+MIrzSuINjY1NzExMTcwtTc1NcQgrifM2e6QE CAmkJ5akZqemFqQWwYxj4uCUamDU9xV69K48qslYe+3aeT13K2z3TXwrv2Yyn36eeNTM872R 6zQWMb5/9uq59Pwff62NLc3WcOeprS60ND26f/OJ9hcajdq7fsteFbVUvrLSMkTqYJGM0d8F gdMKrq19MfeTtcKyIxvZs4I07WSWPey7H/psidzx7VdsvunYW579pFodaueqduaUEktxRqKh FnNRcSIA4NVl/sECAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrLIsWRmVeSWpSXmKPExsVy+t9jAd25ggcCDDqXCVlsenyN1YHRY/OS +gDGqAZGm4zUxJTUIoXUvOT8lMy8dFsl7+B453hTMwNDXUNLC3MlhbzE3FRbJRefAF23zByg qUoKZYk5pUChgMTiYiV9O0wTQkPcdC1gGiN0fUOC4HqMDNBAwjrGjE8vbrMXnJKveLxzN0sD Y79MFyMnh4SAicT+w9PZIWwxiQv31rN1MXJxCAksYpQ4/WAyK4SzmEni7ewjYFVsAmoSX74c BrNFBCIkmmfMYgaxmQV2MEm8v5jTxcjBISwQJXG9gRUkzCKgKrHh4HQwm1fAVmLjxHnMELag xI/J91ggWrUk1u88zgRhy0tsXvOWGWSMhIC6xKO/uhCb9CTmtvxngygRkdj34h3jBEaBWUgm zUIyaRaSSbOQtCxgZFnFKJpakFxQnJSea6hXnJhbXJqXrpecn7uJERyHz6R2MK5ssDjEKMDB qMTDa1m9P0CINbGsuDL3EKMEB7OSCO+5z0Ah3pTEyqrUovz4otKc1OJDjD5Aj05klhJNzgem iLySeENjEzMjSyMzCyMTc3McwkrivM0eKQFCAumJJanZqakFqUUw45g4OKUaGL16DtvsS1Uz vaCtN+Povh3/O+Rm+HUn3Z4/m3+FsJt01caT7jIn1FV8bldFd03P2/k3Y82/wMjsiS27xfVe cvjXsP3YvUruCNOkXb82yW9ZlT8n8E5ETeBv17DaA/N3PIzSf8G038X8zm5nvYaWfz/87p2Y /tzj0qY8mQnTvA/tyNl0/WlQwC0lluKMREMt5qLiRACVbicO8AIAAA== X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121205_223150_674616_A1FD52D5 X-CRM114-Status: GOOD ( 12.22 ) X-Spam-Score: -7.5 (-------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-7.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [203.254.224.24 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 HDRS_LCASE Odd capitalization of message header 0.0 T_MANY_HDRS_LCASE Odd capitalization of multiple message headers Cc: 'Russell King - ARM Linux' , 'Florian Tobias Schandinat' , 'Marko Katic' , 'Jingoo Han' , 'Grant Likely' , 'Richard Purdie' , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Marko Katic Changing backlight intensity on an Akita (Sharp Zaurus C-1000) triggers WARN_ON message: WARNING: at drivers/gpio/gpiolib.c:1672 __gpio_set_value+0x38/0xa4() Modules linked in: Backtrace: [] (dump_backtrace+0x0/0x110) from [] (dump_stack+0x18/0x1c) r6:c0158fc8 r5:00000009 r4:00000000 r3:c03d4f70 [] (dump_stack+0x0/0x1c) from [] (warn_slowpath_common+0x54/0x6c) [] (warn_slowpath_common+0x0/0x6c) from [] (warn_slowpath_null+0x24/0x2c) r8:c38d5c00 r7:c03f82c0 r6:00000000 r5:000000d0 r4:c384e4fc r3:00000009 [] (warn_slowpath_null+0x0/0x2c) from [] (__gpio_set_value+0x38/0xa4) [] (__gpio_set_value+0x0/0xa4) from [] (corgi_bl_set_intensity+0x44/0x74) r7:c3933418 r6:c3933400 r5:c392cdf0 r4:0000002f [] (corgi_bl_set_intensity+0x0/0x74) from [] (corgi_bl_update_status+0x5c/0x64) r5:c03d31f0 r4:c3933400 [] (corgi_bl_update_status+0x0/0x64) from [] (corgi_lcd_probe+0x1a8/0x258) r4:c392cdf0 r3:c0169bc0 [] (corgi_lcd_probe+0x0/0x258) from [] (spi_drv_probe+0x20/0x24) r8:00000052 r7:c0192d9c r6:c03da6e8 r5:c38d5c34 r4:c38d5c00 [] (spi_drv_probe+0x0/0x24) from [] (driver_probe_device+0xb0/0x208) [] (driver_probe_device+0x0/0x208) from [] (__driver_attach+0x70/0x94) r6:c03da6e8 r5:c38d5c34 r4:c38d5c00 r3:00000000 [] (__driver_attach+0x0/0x94) from [] (bus_for_each_dev+0x54/0x90) r6:c03da6e8 r5:c3827e80 r4:00000000 r3:00000000 [] (bus_for_each_dev+0x0/0x90) from [] (driver_attach+0x20/0x28) r7:00000000 r6:c03e29ec r5:c3932980 r4:c03da6e8 [] (driver_attach+0x0/0x28) from [] (bus_add_driver+0xd4/0x22c) [] (bus_add_driver+0x0/0x22c) from [] (driver_register+0xa4/0x134) r8:00000052 r7:c03ea900 r6:c03c32ac r5:c03bdfc8 r4:c03da6e8 [] (driver_register+0x0/0x134) from [] (spi_register_driver+0x4c/0x60) [] (spi_register_driver+0x0/0x60) from [] (corgi_lcd_driver_init+0x14/0x1c) [] (corgi_lcd_driver_init+0x0/0x1c) from [] (do_one_initcall+0x9c/0x174) [] (do_one_initcall+0x0/0x174) from [] (kernel_init+0xf4/0x2a8) [] (kernel_init+0x0/0x2a8) from [] (ret_from_fork+0x14/0x24) ---[ end trace a863a63f242ee38c ]--- Akita machines have backlight controls hooked to a gpio expander chip, max7310 using i2c transfers which can sleep. In this case, pca953x_gpio_set_value() can be called to control gpio, and pca953x_setup_gpio() sets can_sleep flag. Therefore, gpio_set_value_cansleep() should be used in order to avoid WARN_ON on akita machines. Akita is the only exception in this case since other users of corgi_lcd access backlight gpio controls through a different gpio expander which does not set the can_sleep flag. Signed-off-by: Marko Katic Signed-off-by: Jingoo Han --- Change since v4: - use only gpio_set_value_cansleep() drivers/video/backlight/corgi_lcd.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/video/backlight/corgi_lcd.c b/drivers/video/backlight/corgi_lcd.c index e2e1b62..e323fcb 100644 --- a/drivers/video/backlight/corgi_lcd.c +++ b/drivers/video/backlight/corgi_lcd.c @@ -409,10 +409,10 @@ static int corgi_bl_set_intensity(struct corgi_lcd *lcd, int intensity) cont = !!(intensity & 0x20) ^ lcd->gpio_backlight_cont_inverted; if (gpio_is_valid(lcd->gpio_backlight_cont)) - gpio_set_value(lcd->gpio_backlight_cont, cont); + gpio_set_value_cansleep(lcd->gpio_backlight_cont, cont); if (gpio_is_valid(lcd->gpio_backlight_on)) - gpio_set_value(lcd->gpio_backlight_on, intensity); + gpio_set_value_cansleep(lcd->gpio_backlight_on, intensity); if (lcd->kick_battery) lcd->kick_battery();