[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <PH0PR11MB51913F2805FFB72B4454F5C0F1B3A@PH0PR11MB5191.namprd11.prod.outlook.com>
Date: Mon, 13 Nov 2023 13:30:58 +0000
From: "Li, Meng" <Meng.Li@...driver.com>
To: "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
"mathias.nyman@...ux.intel.com" <mathias.nyman@...ux.intel.com>,
"stern@...land.harvard.edu" <stern@...land.harvard.edu>,
"Basavaraj.Natikar@....com" <Basavaraj.Natikar@....com>,
"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] usb: hcd-pci: replace usb_hcd_irq() with
generic_handle_irq_safe() to avoid calltrace
Please discard this patch, I need to do further research.
Thanks,
LImeng
> -----Original Message-----
> From: Li, Meng <Meng.Li@...driver.com>
> Sent: Monday, November 13, 2023 11:01 AM
> To: gregkh@...uxfoundation.org; mathias.nyman@...ux.intel.com;
> stern@...land.harvard.edu; Basavaraj.Natikar@....com; linux-
> usb@...r.kernel.org; linux-kernel@...r.kernel.org
> Cc: Li, Meng <Meng.Li@...driver.com>
> Subject: [PATCH] usb: hcd-pci: replace usb_hcd_irq() with
> generic_handle_irq_safe() to avoid calltrace
>
> When running below to command to remove a PCIe-USB device, there is
> below caltrace reported in RT kernel.
> Call trace:
> ......
> __might_resched+0x160/0x1c0
> rt_spin_lock+0x38/0xb0
> xhci_irq+0x44/0x16d0
> usb_hcd_irq+0x38/0x5c
> usb_hcd_pci_remove+0x84/0x14c
> xhci_pci_remove+0x78/0xc0
> pci_device_remove+0x44/0xcc
> device_remove+0x54/0x8c
> device_release_driver_internal+0x1ec/0x260
> device_release_driver+0x20/0x30
> pci_stop_bus_device+0x8c/0xcc
> pci_stop_and_remove_bus_device_locked+0x28/0x44
> ......
> el0t_64_sync_handler+0xf4/0x120
> el0t_64_sync+0x18c/0x190
> This issue is introduced by commit c548795abe0d("USB: add check to detect
> host controller hardware removal"). Because in RT-kernel, spinlock that may
> cause sleep is invoked under irq disabled status. Therefore, replace
> usb_hcd_irq() function with
> generic_handle_irq_safe() to avoid calltrace
>
> Fixes: c548795abe0d ("USB: add check to detect host controller hardware
> removal")
> Cc: stable@...r.kernel.org
> Signed-off-by: Meng Li <Meng.Li@...driver.com>
> ---
> drivers/usb/core/hcd-pci.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c index
> ee3156f49533..3b5f7dccbe6a 100644
> --- a/drivers/usb/core/hcd-pci.c
> +++ b/drivers/usb/core/hcd-pci.c
> @@ -325,9 +325,7 @@ 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();
> - usb_hcd_irq(0, hcd);
> - local_irq_enable();
> + generic_handle_irq_safe(dev->irq);
>
> /* Note: dev_set_drvdata must be called while holding the rwsem */
> if (dev->class == CL_EHCI) {
> --
> 2.34.1
Powered by blists - more mailing lists