From: sashiko-bot@kernel.org
To: "Krishna Kurapati" <krishna.kurapati@oss.qualcomm.com>
Cc: conor+dt@kernel.org, robh@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v4 2/2] usb: dwc3: qcom: Modify interrupt handling for eUSB2 Phy targets
Date: Thu, 09 Jul 2026 09:07:51 +0000 [thread overview]
Message-ID: <20260709090751.8D7F61F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260709-eusb2-interrupt-handling-v5-v4-2-d4f993925608@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Missing wakeup on disconnect for eUSB2 PHY targets in host mode.
--
--- Patch [2]: [PATCH v4 2/2] usb: dwc3: qcom: Modify interrupt handling for eUSB2 Phy targets ---
commit abfd7961b2abcf9ee261f91bb2feaa36f4706570
Author: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
usb: dwc3: qcom: Modify interrupt handling for eUSB2 Phy targets
This commit modifies the interrupt handling for eUSB2 PHY targets in host
mode. It updates the wakeup interrupt configuration based on device speed to
correctly detect remote wakeup signaling on the eD+ or eD- lines according
to the eUSB2 specification.
> diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
> index f43f73ac36ff1..65996d47da1f0 100644
> --- a/drivers/usb/dwc3/dwc3-qcom.c
> +++ b/drivers/usb/dwc3/dwc3-qcom.c
[ ... ]
> @@ -272,15 +273,23 @@ static void dwc3_qcom_disable_wakeup_irq(int irq)
> disable_irq_nosync(irq);
> }
>
> -static void dwc3_qcom_disable_port_interrupts(struct dwc3_qcom_port *port)
> +static void dwc3_qcom_disable_port_interrupts(struct dwc3_qcom *qcom, int port_index)
> {
> + struct dwc3_qcom_port *port = &qcom->ports[port_index];
> +
> dwc3_qcom_disable_wakeup_irq(port->qusb2_phy_irq);
>
> if (port->usb2_speed == USB_SPEED_LOW) {
> - dwc3_qcom_disable_wakeup_irq(port->dm_hs_phy_irq);
> + if (qcom->has_eusb2_phy)
> + dwc3_qcom_disable_wakeup_irq(port->dp_hs_phy_irq);
> + else
> + dwc3_qcom_disable_wakeup_irq(port->dm_hs_phy_irq);
> } else if ((port->usb2_speed == USB_SPEED_HIGH) ||
> (port->usb2_speed == USB_SPEED_FULL)) {
> - dwc3_qcom_disable_wakeup_irq(port->dp_hs_phy_irq);
> + if (qcom->has_eusb2_phy)
> + dwc3_qcom_disable_wakeup_irq(port->dm_hs_phy_irq);
[Severity: Medium]
Will this result in skipping the disconnect interrupt cleanup for eUSB2
PHY targets? It seems we only disable the single interrupt line used for
remote wakeup here, mirroring the omission of the disconnect interrupt in
the enable path.
> + else
> + dwc3_qcom_disable_wakeup_irq(port->dp_hs_phy_irq);
> } else {
> dwc3_qcom_disable_wakeup_irq(port->dp_hs_phy_irq);
> dwc3_qcom_disable_wakeup_irq(port->dm_hs_phy_irq);
[ ... ]
> @@ -303,12 +314,20 @@ static void dwc3_qcom_enable_port_interrupts(struct dwc3_qcom_port *port)
> */
>
> if (port->usb2_speed == USB_SPEED_LOW) {
> - dwc3_qcom_enable_wakeup_irq(port->dm_hs_phy_irq,
> - IRQ_TYPE_EDGE_FALLING);
> + if (qcom->has_eusb2_phy)
> + dwc3_qcom_enable_wakeup_irq(port->dp_hs_phy_irq,
> + IRQ_TYPE_EDGE_RISING);
> + else
> + dwc3_qcom_enable_wakeup_irq(port->dm_hs_phy_irq,
> + IRQ_TYPE_EDGE_FALLING);
> } else if ((port->usb2_speed == USB_SPEED_HIGH) ||
> (port->usb2_speed == USB_SPEED_FULL)) {
> - dwc3_qcom_enable_wakeup_irq(port->dp_hs_phy_irq,
> - IRQ_TYPE_EDGE_FALLING);
> + if (qcom->has_eusb2_phy)
> + dwc3_qcom_enable_wakeup_irq(port->dm_hs_phy_irq,
> + IRQ_TYPE_EDGE_RISING);
[Severity: Medium]
Does this setup miss wakeup events when a device is disconnected?
The standard USB configuration uses a falling edge to detect both remote
wakeup and disconnect (SE0 state). By using only a rising edge interrupt
to detect remote wakeup (K-state), it seems we fail to configure a falling
edge on the other line to detect device disconnect.
If an eUSB2 device is disconnected while the host is suspended, it appears
the controller will not wake up, leaving the host out of sync with the
physical port state.
> + else
> + dwc3_qcom_enable_wakeup_irq(port->dp_hs_phy_irq,
> + IRQ_TYPE_EDGE_FALLING);
> } else {
> dwc3_qcom_enable_wakeup_irq(port->dp_hs_phy_irq,
> IRQ_TYPE_EDGE_RISING);
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260709-eusb2-interrupt-handling-v5-v4-0-d4f993925608@oss.qualcomm.com?part=2
prev parent reply other threads:[~2026-07-09 9:07 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-09 8:52 [PATCH v4 0/2] Modify interrupt handling for eUSB2 Phy targets Krishna Kurapati
2026-07-09 8:52 ` [PATCH v4 1/2] dt-bindings: qcom,snps-dwc3: Add property indicating presence of eUSB2 phy Krishna Kurapati
2026-07-09 9:01 ` sashiko-bot
2026-07-09 13:47 ` Dmitry Baryshkov
2026-07-10 1:52 ` Thinh Nguyen
2026-07-10 7:16 ` Krzysztof Kozlowski
2026-07-10 7:19 ` Krzysztof Kozlowski
2026-07-10 21:02 ` Thinh Nguyen
2026-07-09 8:52 ` [PATCH v4 2/2] usb: dwc3: qcom: Modify interrupt handling for eUSB2 Phy targets Krishna Kurapati
2026-07-09 9:07 ` sashiko-bot [this message]
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=20260709090751.8D7F61F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=krishna.kurapati@oss.qualcomm.com \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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