Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4c4e1596 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Merge tag 'for-usb-2013-08-15-step-2' of...

Merge tag 'for-usb-2013-08-15-step-2' of ra.kernel.org:/pub/scm/linux/kernel/git/sarah/xhci into work-next

Sarah writes:

xhci: Step 2 to fix usb-linus and usb-next.

Hi Greg,

This is the first of two steps to fix your usb-linus and usb-next trees.
As I mentioned, commit 4fae6f0f "USB:
handle LPM errors during device suspend correctly" was incorrectly added
to usb-next when it should have been added to usb-linus and marked for
stable.

Two port power off bug fixes touch the same code that patch touches, but
it's not easy to simply move commit 4fae6f0f patch to usb-linus because
commit 28e86165 "USB: refactor code for
enabling/disabling remote wakeup" also touched those code sections.

I propose a two step process to fix this:

1. Pull these four patches into usb-linus.

2. Revert commit 28e86165 from usb-next.
   Merge usb-linus into usb-next, and resolve the conflicts.

I will be sending pull requests for these steps.

This pull request is step two.

Sarah Sharp
parents bd479f29 5845c13a
Loading
Loading
Loading
Loading
+2 −12
Original line number Diff line number Diff line
@@ -3054,20 +3054,10 @@ int usb_port_suspend(struct usb_device *udev, pm_message_t msg)
		usb_set_device_state(udev, USB_STATE_SUSPENDED);
	}

	/*
	 * Check whether current status meets the requirement of
	 * usb port power off mechanism
	 */
	if (status == 0 && !udev->do_remote_wakeup && udev->persist_enabled) {
		enum pm_qos_flags_status pm_qos_stat;

		pm_qos_stat = dev_pm_qos_flags(&port_dev->dev,
				PM_QOS_FLAG_NO_POWER_OFF);
		if (pm_qos_stat != PM_QOS_FLAGS_ALL) {
		pm_runtime_put_sync(&port_dev->dev);
		port_dev->did_runtime_put = true;
	}
	}

	usb_mark_last_busy(hub->hdev);
	return status;
+5 −8
Original line number Diff line number Diff line
@@ -89,22 +89,19 @@ static int usb_port_runtime_resume(struct device *dev)
	retval = usb_hub_set_port_power(hdev, hub, port1, true);
	if (port_dev->child && !retval) {
		/*
		 * Wait for usb hub port to be reconnected in order to make
		 * the resume procedure successful.
		 * Attempt to wait for usb hub port to be reconnected in order
		 * to make the resume procedure successful.  The device may have
		 * disconnected while the port was powered off, so ignore the
		 * return status.
		 */
		retval = hub_port_debounce_be_connected(hub, port1);
		if (retval < 0) {
		if (retval < 0)
			dev_dbg(&port_dev->dev, "can't get reconnection after setting port  power on, status %d\n",
					retval);
			goto out;
		}
		usb_clear_port_feature(hdev, port1, USB_PORT_FEAT_C_ENABLE);

		/* Set return value to 0 if debounce successful */
		retval = 0;
	}

out:
	clear_bit(port1, hub->busy_bits);
	usb_autopm_put_interface(intf);
	return retval;
+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ static void xhci_plat_quirks(struct device *dev, struct xhci_hcd *xhci)
	 * here that the generic code does not try to make a pci_dev from our
	 * dev struct in order to setup MSI
	 */
	xhci->quirks |= XHCI_BROKEN_MSI;
	xhci->quirks |= XHCI_PLAT;
}

/* called during probe() after chip reset completes */
+6 −1
Original line number Diff line number Diff line
@@ -348,9 +348,14 @@ static void __maybe_unused xhci_msix_sync_irqs(struct xhci_hcd *xhci)
static int xhci_try_enable_msi(struct usb_hcd *hcd)
{
	struct xhci_hcd *xhci = hcd_to_xhci(hcd);
	struct pci_dev  *pdev = to_pci_dev(xhci_to_hcd(xhci)->self.controller);
	struct pci_dev  *pdev;
	int ret;

	/* The xhci platform device has set up IRQs through usb_add_hcd. */
	if (xhci->quirks & XHCI_PLAT)
		return 0;

	pdev = to_pci_dev(xhci_to_hcd(xhci)->self.controller);
	/*
	 * Some Fresco Logic host controllers advertise MSI, but fail to
	 * generate interrupts.  Don't even try to enable MSI.
+1 −0
Original line number Diff line number Diff line
@@ -1537,6 +1537,7 @@ struct xhci_hcd {
#define XHCI_SPURIOUS_REBOOT	(1 << 13)
#define XHCI_COMP_MODE_QUIRK	(1 << 14)
#define XHCI_AVOID_BEI		(1 << 15)
#define XHCI_PLAT		(1 << 16)
	unsigned int		num_active_eps;
	unsigned int		limit_active_eps;
	/* There are two roothubs to keep track of bus suspend info for */