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

Commit 98a4f1ff authored by Lan Tianyu's avatar Lan Tianyu Committed by Sarah Sharp
Browse files

usb: don't check pm qos NO_POWER_OFF flag in usb_port_suspend()

The pm qos NO_POWER_OFF flag is checked twice during usb device suspend
to see if the usb port power off condition is met. This is redundant and
also will prevent the port from being powered off if the NO_POWER_OFF
flag is changed to 1 from 0 after the device was already suspended.

More detail in the following link.
	http://marc.info/?l=linux-usb&m=136543949130865&w=2



This patch should be backported to kernels as old as 3.7, that
contain the commit f7ac7787 "usb/acpi:
Use ACPI methods to power off ports."

Signed-off-by: default avatarLan Tianyu <tianyu.lan@intel.com>
Signed-off-by: default avatarSarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable@vger.kernel.org
parent aa5ceae2
Loading
Loading
Loading
Loading
+2 −12
Original line number Diff line number Diff line
@@ -3043,20 +3043,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;