* [PATCH v5 0/5] Modify interrupt handling for eUSB2 Phy targets
@ 2026-07-23 10:39 Krishna Kurapati
2026-07-23 10:39 ` [PATCH v5 1/5] dt-bindings: phy: Add PHY_TYPE_EUSB2 definition Krishna Kurapati
` (4 more replies)
0 siblings, 5 replies; 7+ messages in thread
From: Krishna Kurapati @ 2026-07-23 10:39 UTC (permalink / raw)
To: Vinod Koul, Neil Armstrong, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Thinh Nguyen, Greg Kroah-Hartman
Cc: linux-phy, devicetree, linux-kernel, linux-arm-msm, linux-usb,
Krishna Kurapati
eUSB2 targets handle wakeup interrupts differently depending on device
speed when operating in host mode.
According to the eUSB2 specification, remote wakeup signaling in host
mode is detected via different data-line assertions based on the
connected device speed.
When a low-speed device is connected, the host repeater drives eD+ to
logic '1' upon detecting a K-state on the USB lines during remote wakeup
(eUSB2 specification, Section 5.5.14).
When a full-speed or high-speed device is connected, the host repeater
drives eD- to logic '1' upon detecting a K-state on the USB line during
remote wakeup (eUSB2 specification, Sections 5.5.15 and 5.5.18).
Since the eUSB2 PHY's "DP" and "DM" interrupt lines monitor the eD+ and
eD- line states, configure the wakeup interrupts accordingly
Add support for a new phy "type" attribute to be set by eusb2 phy drivers
and be read by consumers (in this case usb controller) and act accordingly
Changes in v5:
- Add support for phy "type" attribute and set it from m31 and snps eusb2
phy probes.
- Removed adding a new binding property
Link to v4:
https://lore.kernel.org/all/20260709-eusb2-interrupt-handling-v5-v4-0-d4f993925608@oss.qualcomm.com/
Changes in v4:
- Moved to using binding approach as suggested by Thinh
Link to v3:
https://lore.kernel.org/all/20260511094422.3561509-1-krishna.kurapati@oss.qualcomm.com/
Changes in v3:
- Removed multiple glymur-dwc3-mp pdata entries
- Replaced use of ternary operators with if-else
Link to v2:
https://lore.kernel.org/all/20260505194242.1947891-1-krishna.kurapati@oss.qualcomm.com/
Changes in v2:
- Updated commit message
- added supported eUSB2 targets
Link to v1:
https://lore.kernel.org/all/20260502095616.666938-1-krishna.kurapati@oss.qualcomm.com/
Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
---
Krishna Kurapati (5):
dt-bindings: phy: Add PHY_TYPE_EUSB2 definition
include: linux: phy: Add phy attribute "type" and associated helpers
phy: snps-eusb2: Set phy type to EUSB2
phy: qcom: m31-eusb2: Set phy type to EUSB2
usb: dwc3: qcom: Modify interrupt handling for eUSB2 Phy targets
drivers/phy/phy-snps-eusb2.c | 4 +++
drivers/phy/qualcomm/phy-qcom-m31-eusb2.c | 4 +++
drivers/usb/dwc3/dwc3-qcom.c | 53 +++++++++++++++++++++++++------
include/dt-bindings/phy/phy.h | 1 +
include/linux/phy/phy.h | 27 ++++++++++++++++
5 files changed, 79 insertions(+), 10 deletions(-)
---
base-commit: dc59e4fea9d83f03bad6bddf3fa2e52491777482
change-id: 20260718-eusb2-int-handling-v5-e2b7d2f58b73
Best regards,
--
Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v5 1/5] dt-bindings: phy: Add PHY_TYPE_EUSB2 definition
2026-07-23 10:39 [PATCH v5 0/5] Modify interrupt handling for eUSB2 Phy targets Krishna Kurapati
@ 2026-07-23 10:39 ` Krishna Kurapati
2026-07-23 10:39 ` [PATCH v5 2/5] include: linux: phy: Add phy attribute "type" and associated helpers Krishna Kurapati
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Krishna Kurapati @ 2026-07-23 10:39 UTC (permalink / raw)
To: Vinod Koul, Neil Armstrong, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Thinh Nguyen, Greg Kroah-Hartman
Cc: linux-phy, devicetree, linux-kernel, linux-arm-msm, linux-usb,
Krishna Kurapati
Add definition for EUSB2 phy type.
Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
---
include/dt-bindings/phy/phy.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/dt-bindings/phy/phy.h b/include/dt-bindings/phy/phy.h
index 979b5dfd8353..555a022c8c0b 100644
--- a/include/dt-bindings/phy/phy.h
+++ b/include/dt-bindings/phy/phy.h
@@ -24,6 +24,7 @@
#define PHY_TYPE_CPHY 11
#define PHY_TYPE_USXGMII 12
#define PHY_TYPE_XAUI 13
+#define PHY_TYPE_EUSB2 14
#define PHY_POL_NORMAL 0
#define PHY_POL_INVERT 1
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v5 2/5] include: linux: phy: Add phy attribute "type" and associated helpers
2026-07-23 10:39 [PATCH v5 0/5] Modify interrupt handling for eUSB2 Phy targets Krishna Kurapati
2026-07-23 10:39 ` [PATCH v5 1/5] dt-bindings: phy: Add PHY_TYPE_EUSB2 definition Krishna Kurapati
@ 2026-07-23 10:39 ` Krishna Kurapati
2026-07-23 10:39 ` [PATCH v5 3/5] phy: snps-eusb2: Set phy type to EUSB2 Krishna Kurapati
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Krishna Kurapati @ 2026-07-23 10:39 UTC (permalink / raw)
To: Vinod Koul, Neil Armstrong, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Thinh Nguyen, Greg Kroah-Hartman
Cc: linux-phy, devicetree, linux-kernel, linux-arm-msm, linux-usb,
Krishna Kurapati
In cases like USB High-speed phys which can be either USB2 or EUSB2, it is
required to know the type of phy (rather than the operating mode). Add
support to cache the PHY_TYPE and add the following helpers:
- phy_set_type() for the phy drivers (like m31_eusb2 or snps-eusb2) to
declare what type of PHY they are (in this case PHY_TYPE_EUSB2).
- phy_get_type() for the consumers (like USB controllers) to query the
type of phy connected to them.
Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
---
include/linux/phy/phy.h | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h
index ea47975e288a..038c2b58bbe1 100644
--- a/include/linux/phy/phy.h
+++ b/include/linux/phy/phy.h
@@ -21,6 +21,8 @@
#include <linux/phy/phy-lvds.h>
#include <linux/phy/phy-mipi-dphy.h>
+#include <dt-bindings/phy/phy.h>
+
struct phy;
enum phy_mode {
@@ -152,11 +154,13 @@ struct phy_ops {
* @bus_width: Data path width implemented by PHY
* @max_link_rate: Maximum link rate supported by PHY (units to be decided by producer and consumer)
* @mode: PHY mode
+ * @type: PHY type
*/
struct phy_attrs {
u32 bus_width;
u32 max_link_rate;
enum phy_mode mode;
+ int type;
};
/**
@@ -262,6 +266,20 @@ static inline enum phy_mode phy_get_mode(struct phy *phy)
{
return phy->attrs.mode;
}
+
+static inline int phy_get_type(struct phy *phy)
+{
+ if (phy)
+ return phy->attrs.type;
+
+ return PHY_NONE;
+}
+
+static inline void phy_set_type(struct phy *phy, int type)
+{
+ phy->attrs.type = type;
+}
+
int phy_reset(struct phy *phy);
int phy_calibrate(struct phy *phy);
int phy_notify_connect(struct phy *phy, int port);
@@ -393,6 +411,15 @@ static inline enum phy_mode phy_get_mode(struct phy *phy)
return PHY_MODE_INVALID;
}
+static inline int phy_get_type(struct phy *phy)
+{
+ return PHY_NONE;
+}
+
+static inline void phy_set_type(struct phy *phy, int type)
+{
+}
+
static inline int phy_reset(struct phy *phy)
{
if (!phy)
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v5 3/5] phy: snps-eusb2: Set phy type to EUSB2
2026-07-23 10:39 [PATCH v5 0/5] Modify interrupt handling for eUSB2 Phy targets Krishna Kurapati
2026-07-23 10:39 ` [PATCH v5 1/5] dt-bindings: phy: Add PHY_TYPE_EUSB2 definition Krishna Kurapati
2026-07-23 10:39 ` [PATCH v5 2/5] include: linux: phy: Add phy attribute "type" and associated helpers Krishna Kurapati
@ 2026-07-23 10:39 ` Krishna Kurapati
2026-07-23 10:39 ` [PATCH v5 4/5] phy: qcom: m31-eusb2: " Krishna Kurapati
2026-07-23 10:39 ` [PATCH v5 5/5] usb: dwc3: qcom: Modify interrupt handling for eUSB2 Phy targets Krishna Kurapati
4 siblings, 0 replies; 7+ messages in thread
From: Krishna Kurapati @ 2026-07-23 10:39 UTC (permalink / raw)
To: Vinod Koul, Neil Armstrong, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Thinh Nguyen, Greg Kroah-Hartman
Cc: linux-phy, devicetree, linux-kernel, linux-arm-msm, linux-usb,
Krishna Kurapati
USB controllers like DWC3 are agnostic of the kind of phy (USB2/eUSB2)
connected to it. Set the phy type to EUSB2 to let the controller know
the phy type when queried during its probe.
Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
---
drivers/phy/phy-snps-eusb2.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/phy/phy-snps-eusb2.c b/drivers/phy/phy-snps-eusb2.c
index f90bf7e95463..e139b17bcda5 100644
--- a/drivers/phy/phy-snps-eusb2.c
+++ b/drivers/phy/phy-snps-eusb2.c
@@ -13,6 +13,8 @@
#include <linux/regulator/consumer.h>
#include <linux/reset.h>
+#include <dt-bindings/phy/phy.h>
+
#define EXYNOS_USB_PHY_HS_PHY_CTRL_RST (0x0)
#define USB_PHY_RST_MASK GENMASK(1, 0)
#define UTMI_PORT_RST_MASK GENMASK(5, 4)
@@ -597,6 +599,8 @@ static int snps_eusb2_hsphy_probe(struct platform_device *pdev)
return PTR_ERR(generic_phy);
}
+ phy_set_type(generic_phy, PHY_TYPE_EUSB2);
+
dev_set_drvdata(dev, phy);
phy_set_drvdata(generic_phy, phy);
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v5 4/5] phy: qcom: m31-eusb2: Set phy type to EUSB2
2026-07-23 10:39 [PATCH v5 0/5] Modify interrupt handling for eUSB2 Phy targets Krishna Kurapati
` (2 preceding siblings ...)
2026-07-23 10:39 ` [PATCH v5 3/5] phy: snps-eusb2: Set phy type to EUSB2 Krishna Kurapati
@ 2026-07-23 10:39 ` Krishna Kurapati
2026-07-23 10:39 ` [PATCH v5 5/5] usb: dwc3: qcom: Modify interrupt handling for eUSB2 Phy targets Krishna Kurapati
4 siblings, 0 replies; 7+ messages in thread
From: Krishna Kurapati @ 2026-07-23 10:39 UTC (permalink / raw)
To: Vinod Koul, Neil Armstrong, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Thinh Nguyen, Greg Kroah-Hartman
Cc: linux-phy, devicetree, linux-kernel, linux-arm-msm, linux-usb,
Krishna Kurapati
USB controllers like DWC3 are agnostic of the kind of phy (USB2/eUSB2)
connected to it. Set the phy type to EUSB2 to let the controller know
the phy type when queried during its probe.
Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
---
drivers/phy/qualcomm/phy-qcom-m31-eusb2.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/phy/qualcomm/phy-qcom-m31-eusb2.c b/drivers/phy/qualcomm/phy-qcom-m31-eusb2.c
index 0bec8657149c..158c3a55ba56 100644
--- a/drivers/phy/qualcomm/phy-qcom-m31-eusb2.c
+++ b/drivers/phy/qualcomm/phy-qcom-m31-eusb2.c
@@ -16,6 +16,8 @@
#include <linux/reset.h>
#include <linux/slab.h>
+#include <dt-bindings/phy/phy.h>
+
#include <linux/regulator/consumer.h>
#define USB_PHY_UTMI_CTRL0 (0x3c)
@@ -277,6 +279,8 @@ static int m31eusb2_phy_probe(struct platform_device *pdev)
return dev_err_probe(dev, PTR_ERR(phy->phy),
"failed to create phy\n");
+ phy_set_type(phy->phy, PHY_TYPE_EUSB2);
+
ret = devm_regulator_bulk_get_const(dev, M31_EUSB_NUM_VREGS,
m31_eusb_phy_vregs, &phy->vregs);
if (ret)
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v5 5/5] usb: dwc3: qcom: Modify interrupt handling for eUSB2 Phy targets
2026-07-23 10:39 [PATCH v5 0/5] Modify interrupt handling for eUSB2 Phy targets Krishna Kurapati
` (3 preceding siblings ...)
2026-07-23 10:39 ` [PATCH v5 4/5] phy: qcom: m31-eusb2: " Krishna Kurapati
@ 2026-07-23 10:39 ` Krishna Kurapati
2026-07-23 11:31 ` sashiko-bot
4 siblings, 1 reply; 7+ messages in thread
From: Krishna Kurapati @ 2026-07-23 10:39 UTC (permalink / raw)
To: Vinod Koul, Neil Armstrong, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Thinh Nguyen, Greg Kroah-Hartman
Cc: linux-phy, devicetree, linux-kernel, linux-arm-msm, linux-usb,
Krishna Kurapati
eUSB2 targets handle wakeup interrupts differently depending on device
speed when operating in host mode.
According to the eUSB2 specification, remote wakeup signaling in host
mode is detected via different data-line assertions based on the
connected device speed.
When a low-speed device is connected, the host repeater drives eD+ to
logic '1' upon detecting a K-state on the USB lines during remote wakeup
(eUSB2 specification, Section 5.5.14).
When a full-speed or high-speed device is connected, the host repeater
drives eD- to logic '1' upon detecting a K-state on the USB line during
remote wakeup (eUSB2 specification, Sections 5.5.15 and 5.5.18).
Since the eUSB2 PHY's "DP" and "DM" interrupt lines monitor the eD+ and
eD- line states, query the phy type and configure the wakeup interrupts
accordingly.
Signed-off-by: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
---
drivers/usb/dwc3/dwc3-qcom.c | 53 +++++++++++++++++++++++++++++++++++---------
1 file changed, 43 insertions(+), 10 deletions(-)
diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
index f43f73ac36ff..4c559b97c627 100644
--- a/drivers/usb/dwc3/dwc3-qcom.c
+++ b/drivers/usb/dwc3/dwc3-qcom.c
@@ -85,6 +85,7 @@ struct dwc3_qcom {
struct icc_path *icc_path_apps;
enum usb_role current_role;
+ bool has_eusb2_phy;
};
#define to_dwc3_qcom(d) container_of((d), struct dwc3_qcom, dwc)
@@ -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);
+ 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);
@@ -289,8 +298,10 @@ static void dwc3_qcom_disable_port_interrupts(struct dwc3_qcom_port *port)
dwc3_qcom_disable_wakeup_irq(port->ss_phy_irq);
}
-static void dwc3_qcom_enable_port_interrupts(struct dwc3_qcom_port *port)
+static void dwc3_qcom_enable_port_interrupts(struct dwc3_qcom *qcom, int port_index)
{
+ struct dwc3_qcom_port *port = &qcom->ports[port_index];
+
dwc3_qcom_enable_wakeup_irq(port->qusb2_phy_irq, 0);
/*
@@ -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);
+ 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);
@@ -324,7 +343,7 @@ static void dwc3_qcom_disable_interrupts(struct dwc3_qcom *qcom)
int i;
for (i = 0; i < qcom->num_ports; i++)
- dwc3_qcom_disable_port_interrupts(&qcom->ports[i]);
+ dwc3_qcom_disable_port_interrupts(qcom, i);
}
static void dwc3_qcom_enable_interrupts(struct dwc3_qcom *qcom)
@@ -332,7 +351,7 @@ static void dwc3_qcom_enable_interrupts(struct dwc3_qcom *qcom)
int i;
for (i = 0; i < qcom->num_ports; i++)
- dwc3_qcom_enable_port_interrupts(&qcom->ports[i]);
+ dwc3_qcom_enable_port_interrupts(qcom, i);
}
static int dwc3_qcom_suspend(struct dwc3_qcom *qcom, bool wakeup)
@@ -617,6 +636,7 @@ static int dwc3_qcom_probe(struct platform_device *pdev)
int ret;
bool ignore_pipe_clk;
bool wakeup_source;
+ struct phy *phy;
qcom = devm_kzalloc(&pdev->dev, sizeof(*qcom), GFP_KERNEL);
if (!qcom)
@@ -683,6 +703,19 @@ static int dwc3_qcom_probe(struct platform_device *pdev)
if (ignore_pipe_clk)
dwc3_qcom_select_utmi_clk(qcom);
+ if (qcom->num_ports == 1)
+ phy = devm_phy_get(dev, "usb2-phy");
+ else
+ phy = devm_phy_get(dev, "usb2-0");
+
+ if (IS_ERR(phy)) {
+ if (PTR_ERR(phy) != -ENODEV)
+ return dev_err_probe(dev, PTR_ERR(phy),
+ "failed to get usb2 phy\n");
+ phy = NULL;
+ }
+ qcom->has_eusb2_phy = phy && (phy_get_type(phy) == PHY_TYPE_EUSB2);
+
qcom->mode = usb_get_dr_mode(dev);
if (qcom->mode == USB_DR_MODE_HOST) {
--
2.34.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v5 5/5] usb: dwc3: qcom: Modify interrupt handling for eUSB2 Phy targets
2026-07-23 10:39 ` [PATCH v5 5/5] usb: dwc3: qcom: Modify interrupt handling for eUSB2 Phy targets Krishna Kurapati
@ 2026-07-23 11:31 ` sashiko-bot
0 siblings, 0 replies; 7+ messages in thread
From: sashiko-bot @ 2026-07-23 11:31 UTC (permalink / raw)
To: Krishna Kurapati
Cc: linux-phy, conor+dt, robh, devicetree, vkoul, neil.armstrong,
olteanv
Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [High] Resource leak on devm_phy_get() error path in dwc3_qcom_probe().
- [High] Probe fails due to unhandled -ENOSYS when CONFIG_GENERIC_PHY is disabled.
- [Low] Comment describing DP/DM interrupt polarity contradicts new eUSB2 logic.
--
--- Patch [5]: [PATCH v5 5/5] usb: dwc3: qcom: Modify interrupt handling for eUSB2 Phy targets ---
commit e7aac8b655de03b8e81bfa727922960500cb9ae3
Author: Krishna Kurapati <krishna.kurapati@oss.qualcomm.com>
usb: dwc3: qcom: Modify interrupt handling for eUSB2 Phy targets
This commit modifies the interrupt handling logic in the DWC3 Qualcomm
driver to support eUSB2 PHY targets. It queries the PHY type during
probe and configures remote wakeup interrupt polarities based on the
eUSB2 specification for different device speeds.
> diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
> index f43f73ac36ff1..4c559b97c6276 100644
> --- a/drivers/usb/dwc3/dwc3-qcom.c
> +++ b/drivers/usb/dwc3/dwc3-qcom.c
[ ... ]
> @@ -289,8 +298,10 @@ static void dwc3_qcom_disable_port_interrupts(struct dwc3_qcom_port *port)
> dwc3_qcom_disable_wakeup_irq(port->ss_phy_irq);
> }
>
> -static void dwc3_qcom_enable_port_interrupts(struct dwc3_qcom_port *port)
> +static void dwc3_qcom_enable_port_interrupts(struct dwc3_qcom *qcom, int port_index)
> {
> + struct dwc3_qcom_port *port = &qcom->ports[port_index];
> +
> dwc3_qcom_enable_wakeup_irq(port->qusb2_phy_irq, 0);
>
> /*
> @@ -303,12 +314,20 @@ static void dwc3_qcom_enable_port_interrupts(struct dwc3_qcom_port *port)
> */
[Severity: Low]
This isn't a bug, but does this comment block need to be updated? The newly
added eUSB2 logic below configures these lines as rising edge, which
contradicts the behavior described in this comment.
>
> 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);
[ ... ]
> @@ -683,6 +703,19 @@ static int dwc3_qcom_probe(struct platform_device *pdev)
> if (ignore_pipe_clk)
> dwc3_qcom_select_utmi_clk(qcom);
>
> + if (qcom->num_ports == 1)
> + phy = devm_phy_get(dev, "usb2-phy");
> + else
> + phy = devm_phy_get(dev, "usb2-0");
> +
> + if (IS_ERR(phy)) {
> + if (PTR_ERR(phy) != -ENODEV)
[Severity: High]
If the kernel is compiled without CONFIG_GENERIC_PHY, devm_phy_get() will
return -ENOSYS. Since this check only ignores -ENODEV, will this cause the
probe to fail entirely for configurations without generic PHY support?
> + return dev_err_probe(dev, PTR_ERR(phy),
> + "failed to get usb2 phy\n");
[Severity: High]
Does this return directly without jumping to the clk_disable error label?
Earlier in dwc3_qcom_probe(), clk_bulk_prepare_enable() is called. If
devm_phy_get() fails with an error like -EPROBE_DEFER, will this leak the
clock prepare and enable counts?
> + phy = NULL;
> + }
> + qcom->has_eusb2_phy = phy && (phy_get_type(phy) == PHY_TYPE_EUSB2);
> +
> qcom->mode = usb_get_dr_mode(dev);
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260723-eusb2-int-handling-v5-v5-0-f32ea6c1a318@oss.qualcomm.com?part=5
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-07-23 11:31 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-23 10:39 [PATCH v5 0/5] Modify interrupt handling for eUSB2 Phy targets Krishna Kurapati
2026-07-23 10:39 ` [PATCH v5 1/5] dt-bindings: phy: Add PHY_TYPE_EUSB2 definition Krishna Kurapati
2026-07-23 10:39 ` [PATCH v5 2/5] include: linux: phy: Add phy attribute "type" and associated helpers Krishna Kurapati
2026-07-23 10:39 ` [PATCH v5 3/5] phy: snps-eusb2: Set phy type to EUSB2 Krishna Kurapati
2026-07-23 10:39 ` [PATCH v5 4/5] phy: qcom: m31-eusb2: " Krishna Kurapati
2026-07-23 10:39 ` [PATCH v5 5/5] usb: dwc3: qcom: Modify interrupt handling for eUSB2 Phy targets Krishna Kurapati
2026-07-23 11:31 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox