I think the HC Reset only occurs from xhci_reset(). And warm port reset never occurs anywhere else. So seems reasonable to handle clearing the change bit in xhci_reset. Though I think the bit might be set some time after the HC indicates the HC Reset is done. I could clear them in handle_port_status() in that case. John > -----Original Message----- > From: Sarah Sharp [mailto:sarah.a.sharp@xxxxxxxxxxxxxxx] > Sent: Wednesday, May 05, 2010 6:53 PM > To: John Youn > Cc: linux-usb@xxxxxxxxxxxxxxx > Subject: Re: [PATCH] Clears the Warm Reset Change and Port Reset Change > bit in PORTSC. > > On Wed, May 05, 2010 at 05:30:05PM -0700, John Youn wrote: > > These bits will be set after we do a HC Reset and need to be cleared. > > (XHCI 14.19.1.2.3). > > How about doing this in xhci_reset()? Or make a function in xhci-hub.c > that > xhci_reset() can call? > > Out of curiosity, why did your HC get reset? I've actually never seen > the USB core reset the host controller, and I suspect the xHCI event > ring handler isn't properly letting the core know when something > catastrophic has happened (like getting events that don't match with > where the enqueue pointer is). > > Sarah Sharp > > > Signed-off-by: John Youn <johnyoun@xxxxxxxxxxxx> > > > > --- > > drivers/usb/host/xhci-hub.c | 17 +++++++++++++++++ > > 1 files changed, 17 insertions(+), 0 deletions(-) > > > > diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci- > hub.c > > index eac5b53..c75065d 100644 > > --- a/drivers/usb/host/xhci-hub.c > > +++ b/drivers/usb/host/xhci-hub.c > > @@ -272,6 +272,7 @@ int xhci_hub_status_data(struct usb_hcd *hcd, > char *buf) > > { > > unsigned long flags; > > u32 temp, status; > > + u32 clear; > > int i, retval; > > struct xhci_hcd *xhci = hcd_to_xhci(hcd); > > int ports; > > @@ -302,6 +303,22 @@ int xhci_hub_status_data(struct usb_hcd *hcd, > char *buf) > > buf[1] |= 1 << (i - 7); > > status = 1; > > } > > + /* FIXME: These are not supported yet in usbcore > > + * however they need to be cleared somewhere because > > + * they will be set when we do a HC Reset > > + * (XHCI 14.19.1.2.3). */ > > + if (temp & (PORT_WRC | PORT_RC)) { > > + clear = xhci_port_state_to_neutral(temp); > > + if (temp & PORT_WRC) { > > + clear |= PORT_WRC; > > + xhci_dbg(xhci, "Clearing PORT_WRC\n"); > > + } > > + if (temp & PORT_RC) { > > + clear |= PORT_RC; > > + xhci_dbg(xhci, "Clearing PORT_RC\n"); > > + } > > + xhci_writel(xhci, clear, addr); > > + } > > } > > spin_unlock_irqrestore(&xhci->lock, flags); > > return status ? retval : 0; > > -- > > 1.6.2.5 > > -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html