mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Faisal Hassan <faisal.hassan@oss.qualcomm.com>
To: Thinh.Nguyen@synopsys.com, gregkh@linuxfoundation.org
Cc: linux-usb@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	krishna.kurapati@oss.qualcomm.com, peter.chen@oss.qualcomm.com,
	krzysztof.kozlowski@oss.qualcomm.com,
	Faisal Hassan <faisal.hassan@oss.qualcomm.com>,
	Sriram Dash <sriram.dash@oss.qualcomm.com>
Subject: [PATCH v5 06/11] usb: dwc3: Support resetting the xHCI host on system resume
Date: Mon, 23 Nov 2026 16:17:21 +0530	[thread overview]
Message-ID: <20261123104727.1539149-7-faisal.hassan@oss.qualcomm.com> (raw)
In-Reply-To: <20261123104727.1539149-1-faisal.hassan@oss.qualcomm.com>

Some platforms power the controller down during system suspend, which
leaves the xHCI host in a state that needs a full reset on resume.
xhci-plat can already be told to do that with the
"xhci-reset-on-resume-quirk" device property, which sets
XHCI_RESET_ON_RESUME.

Add an xhci_reset_on_resume field to struct dwc3_properties so that a
glue driver can request it, and pass it on to the xhci-plat device as
that property when the host is created.

Co-developed-by: Sriram Dash <sriram.dash@oss.qualcomm.com>
Signed-off-by: Sriram Dash <sriram.dash@oss.qualcomm.com>
Signed-off-by: Faisal Hassan <faisal.hassan@oss.qualcomm.com>
---
 drivers/usb/dwc3/core.c | 3 +++
 drivers/usb/dwc3/core.h | 3 +++
 drivers/usb/dwc3/glue.h | 2 ++
 drivers/usb/dwc3/host.c | 5 ++++-
 4 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index d9f4e4109abb..d782d5ef9c57 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -1697,6 +1697,9 @@ static void dwc3_get_software_properties(struct dwc3 *dwc,
 	if (properties->skip_phy_init)
 		dwc->skip_phy_init = true;
 
+	if (properties->xhci_reset_on_resume)
+		dwc->xhci_reset_on_resume = true;
+
 	dwc->gsbuscfg0_reqinfo = DWC3_GSBUSCFG0_REQINFO_UNSPECIFIED;
 
 	if (properties->gsbuscfg0_reqinfo !=
diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
index 1c8d441ea9f8..3cbe4eeb0a5a 100644
--- a/drivers/usb/dwc3/core.h
+++ b/drivers/usb/dwc3/core.h
@@ -1177,6 +1177,7 @@ struct dwc3_glue_ops {
  *	3	- Reserved
  * @dis_metastability_quirk: set to disable metastability quirk.
  * @dis_split_quirk: set to disable split boundary.
+ * @xhci_reset_on_resume: set to reset the xHCI host controller on system resume.
  * @enable_usb2_transceiver_delay: Set to insert a delay before the
  *			assertion of the TxValid signal during a HS Chirp.
  * @sys_wakeup: set if the device may do system wakeup.
@@ -1433,6 +1434,8 @@ struct dwc3 {
 	unsigned		dis_metastability_quirk:1;
 
 	unsigned		dis_split_quirk:1;
+	unsigned		xhci_reset_on_resume:1;
+
 	unsigned		enable_usb2_transceiver_delay:1;
 	unsigned		async_callbacks:1;
 	unsigned		sys_wakeup:1;
diff --git a/drivers/usb/dwc3/glue.h b/drivers/usb/dwc3/glue.h
index 72c5593e657a..028a4f8a4fac 100644
--- a/drivers/usb/dwc3/glue.h
+++ b/drivers/usb/dwc3/glue.h
@@ -15,11 +15,13 @@
  * @needs_full_reinit: indicate the controller may not remain power during system
  *			pm and need full initialization
  * @skip_phy_init: skip xHCI PHY initialization on host init
+ * @xhci_reset_on_resume: reset the xHCI host controller on system resume
  */
 struct dwc3_properties {
 	u32 gsbuscfg0_reqinfo;
 	unsigned needs_full_reinit:1;
 	unsigned skip_phy_init:1;
+	unsigned xhci_reset_on_resume:1;
 };
 
 #define DWC3_DEFAULT_PROPERTIES ((struct dwc3_properties){		\
diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c
index 3fb8be8be590..a9c81def13c2 100644
--- a/drivers/usb/dwc3/host.c
+++ b/drivers/usb/dwc3/host.c
@@ -130,7 +130,7 @@ static int dwc3_host_get_irq(struct dwc3 *dwc)
 
 int dwc3_host_init(struct dwc3 *dwc)
 {
-	struct property_entry	props[7];
+	struct property_entry	props[9];
 	struct platform_device	*xhci;
 	int			ret, irq;
 	int			prop_idx = 0;
@@ -177,6 +177,9 @@ int dwc3_host_init(struct dwc3 *dwc)
 	if (dwc->skip_phy_init)
 		props[prop_idx++] = PROPERTY_ENTRY_BOOL("xhci-skip-phy-init-quirk");
 
+	if (dwc->xhci_reset_on_resume)
+		props[prop_idx++] = PROPERTY_ENTRY_BOOL("xhci-reset-on-resume-quirk");
+
 	/**
 	 * WORKAROUND: dwc3 revisions <=3.00a have a limitation
 	 * where Port Disable command doesn't work.
-- 
2.34.1


  parent reply	other threads:[~2026-11-23 10:48 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23 10:47 [PATCH v5 00/11] usb: dwc3: qcom: Add firmware-managed resource support for SA8255P Faisal Hassan
2026-11-23 10:47 ` [PATCH v5 01/11] usb: dwc3: qcom: Distinguish PM and runtime suspend/resume paths Faisal Hassan
2026-11-26  7:40   ` Peter Chen
2026-11-23 10:47 ` [PATCH v5 02/11] usb: dwc3: qcom: Disarm wakeup IRQs on system suspend without wakeup Faisal Hassan
2026-11-26  7:44   ` Peter Chen
2026-11-23 10:47 ` [PATCH v5 03/11] usb: dwc3: qcom: Keep wakeup IRQ enable/disable balanced on failed resume Faisal Hassan
2026-11-26  8:37   ` Peter Chen
2026-11-26 17:31   ` Krishna Kurapati
2026-11-23 10:47 ` [PATCH v5 04/11] dt-bindings: usb: Add qcom,sa8255p-dwc3 for firmware-managed resources Faisal Hassan
2026-11-23 10:47 ` [PATCH v5 05/11] usb: host: xhci-plat: Support XHCI_RESET_ON_RESUME via device property Faisal Hassan
2026-11-23 10:47 ` Faisal Hassan [this message]
2026-11-23 10:47 ` [PATCH v5 07/11] usb: dwc3: qcom: Recover controller state after power loss in system suspend Faisal Hassan
2026-11-26  9:52   ` Peter Chen
2026-11-23 10:47 ` [PATCH v5 08/11] usb: dwc3: qcom: Restore VBUS override after system resume Faisal Hassan
2026-11-26  9:54   ` Peter Chen
2026-11-26 17:32   ` Krishna Kurapati
2026-11-23 10:47 ` [PATCH v5 09/11] usb: dwc3: qcom: Assert controller reset on remove and probe failure Faisal Hassan
2026-11-26  9:56   ` Peter Chen
2026-11-23 10:47 ` [PATCH v5 10/11] usb: dwc3: qcom: Support firmware-managed resource states for power management Faisal Hassan
2026-11-26 10:09   ` Peter Chen
2026-11-23 10:47 ` [PATCH v5 11/11] usb: dwc3: qcom: Enable VBUS override at probe for default peripheral role Faisal Hassan
2026-11-26 10:12   ` Peter Chen
2026-11-26 17:34   ` Krishna Kurapati

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261123104727.1539149-7-faisal.hassan@oss.qualcomm.com \
    --to=faisal.hassan@oss.qualcomm.com \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=krishna.kurapati@oss.qualcomm.com \
    --cc=krzysztof.kozlowski@oss.qualcomm.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=peter.chen@oss.qualcomm.com \
    --cc=sriram.dash@oss.qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®