From 7ab2ce33e3f481df046c56eedf10f41b8f3cf8bc Mon Sep 17 00:00:00 2001 From: Sarah Sharp Date: Fri, 29 Oct 2010 14:37:23 -0700 Subject: [PATCH] --- yaml --- r: 235442 b: refs/heads/master c: f9de8151877b4f01cc8e124b0e213a6c6c78d970 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/usb/host/xhci-hub.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index d35c5bf232e3..ac35d2611945 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d30b2a208108a0b0fdeae7006b8824d9be16ca96 +refs/heads/master: f9de8151877b4f01cc8e124b0e213a6c6c78d970 diff --git a/trunk/drivers/usb/host/xhci-hub.c b/trunk/drivers/usb/host/xhci-hub.c index 191ebc54cc7d..770f84cb7327 100644 --- a/trunk/drivers/usb/host/xhci-hub.c +++ b/trunk/drivers/usb/host/xhci-hub.c @@ -418,6 +418,10 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, wIndex--; status = 0; temp = xhci_readl(xhci, port_array[wIndex]); + if (temp == 0xffffffff) { + retval = -ENODEV; + break; + } xhci_dbg(xhci, "get port status, actual port %d status = 0x%x\n", wIndex, temp); /* FIXME - should we return a port status value like the USB @@ -492,6 +496,10 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, goto error; wIndex--; temp = xhci_readl(xhci, port_array[wIndex]); + if (temp == 0xffffffff) { + retval = -ENODEV; + break; + } temp = xhci_port_state_to_neutral(temp); /* FIXME: What new port features do we need to support? */ switch (wValue) { @@ -562,6 +570,10 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, goto error; wIndex--; temp = xhci_readl(xhci, port_array[wIndex]); + if (temp == 0xffffffff) { + retval = -ENODEV; + break; + } /* FIXME: What new port features do we need to support? */ temp = xhci_port_state_to_neutral(temp); switch (wValue) { @@ -677,6 +689,10 @@ int xhci_hub_status_data(struct usb_hcd *hcd, char *buf) /* For each port, did anything change? If so, set that bit in buf. */ for (i = 0; i < ports; i++) { temp = xhci_readl(xhci, port_array[i]); + if (temp == 0xffffffff) { + retval = -ENODEV; + break; + } if ((temp & mask) != 0 || (bus_state->port_c_suspend & 1 << i) || (bus_state->resume_done[i] && time_after_eq(