[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CH0PR12MB508943FCE2B0A5D218E3B966AC029@CH0PR12MB5089.namprd12.prod.outlook.com>
Date: Tue, 1 Mar 2022 19:18:38 +0000
From: Henry Lin <henryl@...dia.com>
To: Mathias Nyman <mathias.nyman@...ux.intel.com>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>
CC: Mathias Nyman <mathias.nyman@...el.com>,
"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] xhci: fix runtime PM imbalance in USB2 resume
> Maybe only call usb_hcd_end_port_resume() if xhci_irq() detected the device-initiated
> resume. i.e. set a value to resume_done[portnum] and called usb_hcd_start_port_resume()
> something like:
>
> @@ -1088,6 +1088,8 @@ static void xhci_get_usb2_port_status(struct xhci_port *port, u32 *status,
> if (link_state == XDEV_U2)
> *status |= USB_PORT_STAT_L1;
> if (link_state == XDEV_U0) {
> + if (bus_state->resume_done[portnum])
> + usb_hcd_end_port_resume(&port->rhub->hcd->self, portnum);
> bus_state->resume_done[portnum] = 0;
> clear_bit(portnum, &bus_state->resuming_ports);
This looks good. I can submit a new version based on this.
> Also xhci_bus_resume() only resumes ports that were forcefully suspended to U3 in xhci_bus_suspend().
> Could be worth checking why that device wasn't already in U3 when suspend reached xhci_bus_suspend().
It happens when we trigger USB device-initiated resume to bring system out of system suspend state.
For example, we can connect an USB2 external hub on root port and put system into suspend state. The USB2
external hub (the port it connects to) is in U3 after xhci_bus_suspend(). Once we connect a USB device
to downstream port of the USB2 external hub, the hub will trigger device initiated resume to wake up the
system. During system resume, XHCI controller will report the USB2 external hub is in RESUME state.
Thanks,
Henry
Powered by blists - more mailing lists