Patch "usb: chipidea: wait controller resume finished for wakeup irq" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    usb: chipidea: wait controller resume finished for wakeup irq

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     usb-chipidea-wait-controller-resume-finished-for-wakeup-irq.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From 128d849074d05545becf86e713715ce7676fc074 Mon Sep 17 00:00:00 2001
From: Xu Yang <xu.yang_2@xxxxxxx>
Date: Thu, 28 Dec 2023 19:07:52 +0800
Subject: usb: chipidea: wait controller resume finished for wakeup irq

From: Xu Yang <xu.yang_2@xxxxxxx>

commit 128d849074d05545becf86e713715ce7676fc074 upstream.

After the chipidea driver introduce extcon for id and vbus, it's able
to wakeup from another irq source, in case the system with extcon ID
cable, wakeup from usb ID cable and device removal, the usb device
disconnect irq may come firstly before the extcon notifier while system
resume, so we will get 2 "wakeup" irq, one for usb device disconnect;
and one for extcon ID cable change(real wakeup event), current driver
treat them as 2 successive wakeup irq so can't handle it correctly, then
finally the usb irq can't be enabled. This patch adds a check to bypass
further usb events before controller resume finished to fix it.

Fixes: 1f874edcb731 ("usb: chipidea: add runtime power management support")
cc:  <stable@xxxxxxxxxxxxxxx>
Acked-by: Peter Chen <peter.chen@xxxxxxxxxx>
Signed-off-by: Xu Yang <xu.yang_2@xxxxxxx>
Signed-off-by: Li Jun <jun.li@xxxxxxx>
Link: https://lore.kernel.org/r/20231228110753.1755756-2-xu.yang_2@xxxxxxx
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/usb/chipidea/core.c |    7 +++++++
 1 file changed, 7 insertions(+)

--- a/drivers/usb/chipidea/core.c
+++ b/drivers/usb/chipidea/core.c
@@ -523,6 +523,13 @@ static irqreturn_t ci_irq_handler(int ir
 	u32 otgsc = 0;
 
 	if (ci->in_lpm) {
+		/*
+		 * If we already have a wakeup irq pending there,
+		 * let's just return to wait resume finished firstly.
+		 */
+		if (ci->wakeup_int)
+			return IRQ_HANDLED;
+
 		disable_irq_nosync(irq);
 		ci->wakeup_int = true;
 		pm_runtime_get(ci->dev);


Patches currently in stable-queue which might be from xu.yang_2@xxxxxxx are

queue-6.1/usb-phy-mxs-remove-config_usb_otg-condition-for-mxs_phy_is_otg_host.patch
queue-6.1/usb-chipidea-wait-controller-resume-finished-for-wakeup-irq.patch




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux