[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <HE1PR04MB14501B0EC65D993623D96A168B770@HE1PR04MB1450.eurprd04.prod.outlook.com>
Date: Wed, 20 Jun 2018 03:28:04 +0000
From: Peter Chen <peter.chen@....com>
To: Jia-Ju Bai <baijiaju1990@...il.com>,
"mathias.nyman@...el.com" <mathias.nyman@...el.com>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>
CC: "linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: RE: [BUG] usb: xhci: Two possible sleep-in-atomic-context bugs
>
> The driver may sleep with holding a spinlock.
> The function call paths (from bottom to top) in Linux-4.16.7 are:
>
> [FUNC] schedule
> drivers/base/power/runtime.c, 741: schedule in rpm_resume
> drivers/base/power/runtime.c, 1322: rpm_resume in pm_runtime_forbid
> drivers/usb/host/xhci-hub.c, 647: pm_runtime_forbid in xhci_enter_test_mode
> drivers/usb/host/xhci-hub.c, 632: _raw_spin_lock_irqsave in xhci_enter_test_mode
>
> [FUNC] schedule
> drivers/base/power/runtime.c, 570: schedule in rpm_suspend
> drivers/base/power/runtime.c, 434: rpm_suspend in rpm_idle
> drivers/base/power/runtime.c, 1343: rpm_idle in pm_runtime_allow
> drivers/usb/host/xhci-hub.c, 670: pm_runtime_allow in xhci_exit_test_mode
> drivers/usb/host/xhci-hub.c, 1387: xhci_exit_test_mode in xhci_hub_control
> drivers/usb/host/xhci-hub.c, 1038: _raw_spin_lock_irqsave in xhci_hub_control
>
> These bugs are found by my static analysis tool (DSAC-2) and checked by my code
> review.
>
I don't think runtime PM API is needed at xhci_hub_control since the controller should
be always active, Mathias, do you agree I delete pm_runtime_forbid and pm_runtime_allow
to fix this issue?
Peter
Powered by blists - more mailing lists