From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755957AbdESPyJ (ORCPT ); Fri, 19 May 2017 11:54:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58676 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755230AbdESPyH (ORCPT ); Fri, 19 May 2017 11:54:07 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 421ACC00C7BB Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=williams@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 421ACC00C7BB Date: Fri, 19 May 2017 10:53:58 -0500 From: Clark Williams To: Nate Dailey Cc: , LKML Subject: Re: [PATCH] usb: Use _nort in usb_hcd_pci_remove Message-ID: <20170519105243.03700e87@tagon> In-Reply-To: <20170420180027.19316-1-nate.dailey@stratus.com> References: <20170420180027.19316-1-nate.dailey@stratus.com> Organization: Red Hat, Inc MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_//Wf=dmqdZyyJlP+Y/yEst2g"; protocol="application/pgp-signature" X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 19 May 2017 15:54:07 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Sig_//Wf=dmqdZyyJlP+Y/yEst2g Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Thu, 20 Apr 2017 14:00:27 -0400 Nate Dailey wrote: > A trip through usb_hcd_pci_remove produces: >=20 > BUG: sleeping function called from invalid context at kernel/locking/rtm= utex.c:993 > in_atomic(): 0, irqs_disabled(): 1, pid: 4752, name: bash > INFO: lockdep is turned off. > irq event stamp: 0 > hardirqs last enabled at (0): [< (null)>] (null) > hardirqs last disabled at (0): [] copy_process.part.36= +0x64d/0x2380 > softirqs last enabled at (0): [] copy_process.part.36= +0x64d/0x2380 > softirqs last disabled at (0): [< (null)>] (null) > CPU: 1 PID: 4752 Comm: bash Tainted: G W I 4.9.0debug-rt16+ #2 > Hardware name: Stratus ftServer 2700/G7LAY, BIOS BIOS Version 6.3:58 09/= 18/2014 > ffffc90006e5fbd0 ffffffff813d243a ffff88016ac0b240 0000000000001290 > ffffc90006e5fbf8 ffffffff810c6907 ffff8801682f45d0 ffff8801682f1000 > ffff8801682f45d0 ffffc90006e5fc18 ffffffff817dee44 ffff88016b2aee18 > Call Trace: > [] dump_stack+0x99/0xcf > [] ___might_sleep+0x137/0x210 > [] rt_spin_lock+0x24/0x60 > [] ehci_irq+0x2f/0x400 > [] ? pci_bus_read_config_word+0x99/0xb0 > [] usb_hcd_irq+0x26/0x40 > [] usb_hcd_pci_remove+0x50/0x170 > [] ehci_pci_remove+0x1a/0x20 > [] pci_device_remove+0x39/0xc0 > [] __device_release_driver+0x9a/0x150 > [] device_release_driver+0x23/0x30 > [] pci_stop_bus_device+0x8c/0xa0 > [] pci_stop_and_remove_bus_device_locked+0x1a/0x30 > [] remove_store+0x7c/0x90 > [] dev_attr_store+0x18/0x30 > [] sysfs_kf_write+0x44/0x60 > [] kernfs_fop_write+0x13c/0x1d0 > [] __vfs_write+0x37/0x160 > [] ? rcu_sync_lockdep_assert+0x12/0x60 > [] ? __sb_start_write+0x176/0x260 > [] ? vfs_write+0x184/0x1b0 > [] vfs_write+0xb5/0x1b0 > [] ? syscall_trace_enter+0x1d0/0x380 > [] SyS_write+0x58/0xc0 > [] do_syscall_64+0x7a/0x230 > [] entry_SYSCALL64_slow_path+0x25/0x25 >=20 > Repro via something like: >=20 > > echo 1 > /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/0000:02:01.0= /0000:3d:00.0/0000:3e:01.0/0000:66:00.0/remove =20 >=20 > Switching usb_hcd_pci_remove to use _nort variants prevents the BUG. >=20 > Signed-off-by: Nate Dailey > --- > drivers/usb/core/hcd-pci.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c > index 7859d738df41..e9e7307028bc 100644 > --- a/drivers/usb/core/hcd-pci.c > +++ b/drivers/usb/core/hcd-pci.c > @@ -341,9 +341,9 @@ void usb_hcd_pci_remove(struct pci_dev *dev) > * to test whether the controller hardware has been removed (e.g., > * cardbus physical eject). > */ > - local_irq_disable(); > + local_irq_disable_nort(); > usb_hcd_irq(0, hcd); > - local_irq_enable(); > + local_irq_enable_nort(); > =20 > /* Note: dev_set_drvdata must be called while holding the rwsem */ > if (dev->class =3D=3D CL_EHCI) { > --=20 > 2.11.0 >=20 > -- > To unsubscribe from this list: send the line "unsubscribe linux-rt-users"= in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html Should have CC'd lkml for a kernel patch (even RT related). Sorry I didn't = catch that earlier. Acked-by: Clark Williams --=20 The United States Coast Guard Ruining Natural Selection since 1790 --Sig_//Wf=dmqdZyyJlP+Y/yEst2g Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQIcBAEBCgAGBQJZHxUWAAoJEBO1XdB8U7hR7RkP/Ayockzg6/RVXqLQVNLOM6gl OJCJKAygYjPZFg+ls99T97Wx6kA61JwYAsdeQ6f92qS9zFpk+vCtvbsmauSrfqOi Q1ktaCzXoYpvv2iip87k8/xb+bFFeKATo0B5a4EH5wwGeQoyvHRLWvh68c8n/oZA exqvgMv9PCXTBGVa5zv9lP4ceIUibnhFTiO2MxTISEwm+YipEfIrkiLKxA2beVLW wSHyElKKWlZT8cAWkB6JmbnuKJ4H+lfbKo+03Cg6YDnfWaVuAR50plOTAX8lYnXv wD6mTmUCT2NXshtTF7Xw7WK9J9iXy0K63BbZfYGmROhtYHMOcqhIPx7BvWXx+2Jb XZPcajiddCgi53yPk/x66fzcyyemAreFxEKZPbDFL/yQfjvUFH5Jfx48H4Qe8In6 tta+W6pr2iCVs+Z5zPHOVjSQMKKF1+cYxBs3xPe1H/6Kc5Uph6pJHk3V358kKDNQ 8hn1U5h9ixlbDnelPUG2BVWvsVnS1g7spW37k5QIkVAK5013fpNyDNdshz29qYSz Zh8EZHzQB4Jn4BmQaN4uHeBrrlIHwWEhVggsrufvRcsPTOaPeiJ0TA8gUc84hsJ4 S6s6H3GWefoxvYGhgXERwRhSF1nv1BjxTaCi2P+YTu56HQI7dhYfdjzhXMprsyC/ 8yaZibVpyUdBbkiWBac6 =jpmJ -----END PGP SIGNATURE----- --Sig_//Wf=dmqdZyyJlP+Y/yEst2g--