From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751575AbdF0GYV (ORCPT ); Tue, 27 Jun 2017 02:24:21 -0400 Received: from muru.com ([72.249.23.125]:58976 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751492AbdF0GYP (ORCPT ); Tue, 27 Jun 2017 02:24:15 -0400 Date: Mon, 26 Jun 2017 23:24:09 -0700 From: Tony Lindgren To: Brian Norris Cc: Thomas Gleixner , Heiko Stuebner , Linus Walleij , linux-rockchip@lists.infradead.org, Julia Cartwright , LKML , linux-gpio@vger.kernel.org, John Keeping , linux-pm@vger.kernel.org, Doug Anderson , "Paul E. McKenney" , Peter Zijlstra , "David.Wu" , =?utf-8?B?J+m7hOa2myc=?= Subject: Re: [PATCH for 4.12] Revert "pinctrl: rockchip: avoid hardirq-unsafe functions in irq_chip" Message-ID: <20170627062409.GX3730@atomide.com> References: <20170517225634.GA11404@google.com> <20170527021900.GA119873@google.com> <20170623205911.GA143883@google.com> <20170627000622.GA63039@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170627000622.GA63039@google.com> User-Agent: Mutt/1.8.2 (2017-04-18) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Brian Norris [170626 17:06]: > So I agree that the above commit was problematic, and that you have > fixed that in your patch ("PM / wakeirq: Convert to SRCU"). But I > noticed there were other threads where people have complained about the > $subject patch also causing problems with drivers that call > disable_irq_nosync() from within an IRQ context. So I poked around with > one such driver that calls disable_irq_nosync() from its ISR [1], and > saw this: > > [ 14.524945] Bluetooth: : OOB Wake-on-BT configured at IRQ 56 > [ 14.531657] usbcore: registered new interface driver btusb > [ 18.973886] BUG: sleeping function called from invalid context at kernel/locking/mutex.c:238 > [ 18.987695] in_atomic(): 1, irqs_disabled(): 128, pid: 0, name: swapper/0 > [ 18.995282] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.12.0-rc6+ #1233 > [ 19.002669] Hardware name: Google Kevin (DT) > [ 19.007435] Call trace: > [ 19.010171] [] dump_backtrace+0x0/0x24c > [ 19.016202] [] show_stack+0x20/0x28 > [ 19.021846] [] dump_stack+0x90/0xb0 > [ 19.027488] [] ___might_sleep+0x10c/0x124 > [ 19.033713] [] __might_sleep+0x78/0x88 > [ 19.039647] [] mutex_lock+0x2c/0x64 > [ 19.045291] [] rockchip_irq_bus_lock+0x30/0x3c > [ 19.052003] [] __irq_get_desc_lock+0x78/0x98 > [ 19.058519] [] __disable_irq_nosync+0x38/0x80 > [ 19.065132] [] disable_irq_nosync+0x20/0x2c > [ 19.071555] [] btusb_oob_wake_handler+0x4c/0x68 [btusb] Hmm so how come drivers/bluetooth/btusb.c can't use the generic dev_pm_set_dedicated_wake_irq()? Can you please take a look? If there are issues remaining let's rather fix them so we can get rid of the custom tinkering of wake-up events in the drivers. Regards, Tony