diff options
Diffstat (limited to 'drivers/usb/host')
| -rw-r--r-- | drivers/usb/host/Kconfig | 2 | ||||
| -rw-r--r-- | drivers/usb/host/xhci-hub.c | 5 | ||||
| -rw-r--r-- | drivers/usb/host/xhci-ring.c | 9 | ||||
| -rw-r--r-- | drivers/usb/host/xhci.c | 10 | 
4 files changed, 18 insertions, 8 deletions
| diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index 61b7817bd66b..03314f861bee 100644 --- a/drivers/usb/host/Kconfig +++ b/drivers/usb/host/Kconfig @@ -176,7 +176,7 @@ config USB_EHCI_HCD_AT91  config USB_EHCI_MSM  	tristate "Support for Qualcomm QSD/MSM on-chip EHCI USB controller" -	depends on ARCH_MSM +	depends on ARCH_MSM || ARCH_QCOM  	select USB_EHCI_ROOT_HUB_TT  	---help---  	  Enables support for the USB Host controller present on the diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c index 2b998c60faf2..aa79e8749040 100644 --- a/drivers/usb/host/xhci-hub.c +++ b/drivers/usb/host/xhci-hub.c @@ -22,6 +22,7 @@  #include <linux/slab.h> +#include <linux/device.h>  #include <asm/unaligned.h>  #include "xhci.h" @@ -1139,7 +1140,9 @@ int xhci_bus_suspend(struct usb_hcd *hcd)  		 * including the USB 3.0 roothub, but only if CONFIG_PM_RUNTIME  		 * is enabled, so also enable remote wake here.  		 */ -		if (hcd->self.root_hub->do_remote_wakeup) { +		if (hcd->self.root_hub->do_remote_wakeup +				&& device_may_wakeup(hcd->self.controller)) { +  			if (t1 & PORT_CONNECT) {  				t2 |= PORT_WKOC_E | PORT_WKDISC_E;  				t2 &= ~PORT_WKCONN_E; diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index d67ff71209f5..749fc68eb5c1 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -1433,8 +1433,11 @@ static void handle_cmd_completion(struct xhci_hcd *xhci,  		xhci_handle_cmd_reset_ep(xhci, slot_id, cmd_trb, cmd_comp_code);  		break;  	case TRB_RESET_DEV: -		WARN_ON(slot_id != TRB_TO_SLOT_ID( -				le32_to_cpu(cmd_trb->generic.field[3]))); +		/* SLOT_ID field in reset device cmd completion event TRB is 0. +		 * Use the SLOT_ID from the command TRB instead (xhci 4.6.11) +		 */ +		slot_id = TRB_TO_SLOT_ID( +				le32_to_cpu(cmd_trb->generic.field[3]));  		xhci_handle_cmd_reset_dev(xhci, slot_id, event);  		break;  	case TRB_NEC_GET_FW: @@ -3534,7 +3537,7 @@ static unsigned int xhci_get_burst_count(struct xhci_hcd *xhci,  		return 0;  	max_burst = urb->ep->ss_ep_comp.bMaxBurst; -	return roundup(total_packet_count, max_burst + 1) - 1; +	return DIV_ROUND_UP(total_packet_count, max_burst + 1) - 1;  }  /* diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 2b8d9a24af09..7436d5f5e67a 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -936,7 +936,7 @@ int xhci_suspend(struct xhci_hcd *xhci)   */  int xhci_resume(struct xhci_hcd *xhci, bool hibernated)  { -	u32			command, temp = 0; +	u32			command, temp = 0, status;  	struct usb_hcd		*hcd = xhci_to_hcd(xhci);  	struct usb_hcd		*secondary_hcd;  	int			retval = 0; @@ -1054,8 +1054,12 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)   done:  	if (retval == 0) { -		usb_hcd_resume_root_hub(hcd); -		usb_hcd_resume_root_hub(xhci->shared_hcd); +		/* Resume root hubs only when have pending events. */ +		status = readl(&xhci->op_regs->status); +		if (status & STS_EINT) { +			usb_hcd_resume_root_hub(hcd); +			usb_hcd_resume_root_hub(xhci->shared_hcd); +		}  	}  	/* |