Skip to contentSkip to conversation

power: sequencing: Add support for Nvidia Tegra modem pwrseq

PATCH In review Svyatoslav Ryhel 4 participants 22 messages May 23 – May 29

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v2 cover power: sequencing: Add support for Nvidia Tegra modem pwrseq

Patchset implements support for the Tegra-specific modem powerseqence, which handles the registration and unregistration of the USB controller.

This patchset is a part of larger series aiming to bring XMM6260 modem support for Tegra devices:
https://lore.kernel.org/lkml/[email protected]/

---
Changes in v2:
- previous phy driver reshaped into pwrseq driver
---

Svyatoslav Ryhel (2):
dt-bindings: soc: tegra: Document Nvidia Tegra modem pwrseq
power: sequencing: Add support for Nvidia Tegra modem pwrseq

 .../soc/tegra/nvidia,tegra-modem-pwrseq.yaml  |  49 ++++
 drivers/power/sequencing/Kconfig              |  12 +
 drivers/power/sequencing/Makefile             |   1 +
 drivers/power/sequencing/pwrseq-tegra-modem.c | 209 ++++++++++++++++++
 4 files changed, 271 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/soc/tegra/nvidia,tegra-modem-pwrseq.yaml
 create mode 100644 drivers/power/sequencing/pwrseq-tegra-modem.c
Signature · 1 line
2.51.0
#1 lore raw

PATCH v2 1/2 dt-bindings: soc: tegra: Document Nvidia Tegra modem pwrseq

Document the Tegra modem pwseq used by various devices based on the Nvidia Tegra SoC, describing its usage. The power sequence provides interaction between the modem and SoC-specific interface configurations.

---
 .../soc/tegra/nvidia,tegra-modem-pwrseq.yaml  | 49 +++++++++++++++++++
 1 file changed, 49 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/soc/tegra/nvidia,tegra-modem-pwrseq.yaml
Documentation/devicetree/bindings/soc/tegra/nvidia,tegra-modem-pwrseq.yaml new file +49 -0
new file mode 100644
index 000000000000..3770fd6dc2cf
@@ -0,0 +1,49 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/soc/tegra/nvidia,tegra-modem-pwrseq.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Nvidia Tegra modem power sequence
+
+description:
+  A configuration sequence used in Tegra SoCs to provide proper interaction
+  between the application processor and the modem, as well as control over
+  one of the SoC's USB lines for the modem.
+
+maintainers:
+  - Svyatoslav Ryhel <[email protected]>
+
+properties:
+  compatible:
+    const: nvidia,tegra-modem-pwrseq
+
+  enable-gpios:
+    description: GPIO connected to the modem EINT1 pin
+    maxItems: 1
+
+  nvidia,usb-bus:
+    description:
+      Contains phandle pointing to the Host's USB controller
+    $ref: /schemas/types.yaml#/definitions/phandle
+
+  power-supply: true
+
+required:
+  - compatible
+  - nvidia,usb-bus
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    pwrseq-modem {
+        compatible = "nvidia,tegra-modem-pwrseq";
+
+        enable-gpios = <&gpio 165 GPIO_ACTIVE_HIGH>;
+        power-supply = <&vdd_3v3_vbat>;
+
+        nvidia,usb-bus = <&usb2>;
+    };
Signature · 1 line
2.51.0
#2 lore raw

Re: [PATCH v2 1/2] dt-bindings: soc: tegra: Document Nvidia Tegra modem pwrseq

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [High] Modeling a software power sequence as a virtual standalone device tree node, bypassing physical…

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Modeling a software power sequence as a virtual standalone device tree node, bypassing physical bus topology. --

commit 5baacde1b782878f582e887bcf988caf135487f5
Author: Svyatoslav Ryhel <[email protected]>

dt-bindings: soc: tegra: Document Nvidia Tegra modem pwrseq

This commit documents the Tegra modem power sequence configuration. It provides a node to manage interaction between the application processor and the modem, including control over the USB lines.

Quoted 5 lines
Documentation/devicetree/bindings/soc/tegra/nvidia,tegra-modem-pwrseq.yaml new file +0 -0
new file mode 100644
index 0000000000000..3770fd6dc2cf9

[ ... ]

Documentation/devicetree/bindings/soc/tegra/nvidia,tegra-modem-pwrseq.yaml line 28

Quoted 12 lines
Documentation/devicetree/bindings/soc/tegra/nvidia,tegra-modem-pwrseq.yaml new file +12 -0
+properties:
+  compatible:
+    const: nvidia,tegra-modem-pwrseq
+
+  enable-gpios:
+    description: GPIO connected to the modem EINT1 pin
+    maxItems: 1
+
+  nvidia,usb-bus:
+    description:
+      Contains phandle pointing to the Host's USB controller
+    $ref: /schemas/types.yaml#/definitions/phandle

[Severity: High]
Does this binding model a software power sequence rather than the physical hardware layout?

The device tree typically describes physical topology. Under standard bus architecture, would a USB-connected modem be modeled as a child node under the corresponding USB controller or hub port, including its required power-supplies and enable-gpios as properties of that physical child node?

By introducing a standalone virtual node that points backwards to the USB controller via the nvidia,usb-bus phandle, does this bypass the driver core's standard bus hierarchy and device link management?

Without a structural dependency established through device links, if the USB controller driver is unbound, could the power sequencer retain a dangling pointer to the USB bus device and trigger a use-after-free during the next enable or disable sequence?

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
#3 lore raw

Re: [PATCH v2 1/2] dt-bindings: soc: tegra: Document Nvidia Tegra modem pwrseq

In reply to Svyatoslav Ryhel
Quoted 7 lines · Svyatoslav Ryhel

Document the Tegra modem pwseq used by various devices based on the Nvidia Tegra SoC, describing its usage. The power sequence provides interaction between the modem and SoC-specific interface configurations.

---

...

Quoted 14 lines
Documentation/devicetree/bindings/soc/tegra/nvidia,tegra-modem-pwrseq.yaml new file +13 -1
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    pwrseq-modem {
+        compatible = "nvidia,tegra-modem-pwrseq";
+
+        enable-gpios = <&gpio 165 GPIO_ACTIVE_HIGH>;
+        power-supply = <&vdd_3v3_vbat>;
+
+        nvidia,usb-bus = <&usb2>;
+    };
--
Quoted 2 lines

2.51.0

I assume there's no such component as the tegra modem *pwrseq*? What is the relationship between this node and the "infineon,xmm6260" compatible node?

Bart

#4 lore raw

Re: [PATCH v2 1/2] dt-bindings: soc: tegra: Document Nvidia Tegra modem pwrseq

вт, 26 трав. 2026 р. о 12:51 Bartosz Golaszewski <[email protected]> пише:

Quoted 22 lines · Svyatoslav Ryhel
Quoted 7 lines

Document the Tegra modem pwseq used by various devices based on the Nvidia Tegra SoC, describing its usage. The power sequence provides interaction between the modem and SoC-specific interface configurations.

---

...

Quoted 10 lines
Documentation/devicetree/bindings/soc/tegra/nvidia,tegra-modem-pwrseq.yaml new file +10 -0
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    pwrseq-modem {
+        compatible = "nvidia,tegra-modem-pwrseq";
+
+        enable-gpios = <&gpio 165 GPIO_ACTIVE_HIGH>;
+        power-supply = <&vdd_3v3_vbat>;
Quoted 8 lines
Quoted 6 lines
Documentation/devicetree/bindings/soc/tegra/nvidia,tegra-modem-pwrseq.yaml new file +3 -1
+
+        nvidia,usb-bus = <&usb2>;
+    };
--

2.51.0

I assume there's no such component as the tegra modem *pwrseq*?

Hardware component, I assume no.

Quoted 3 lines

What is the relationship between this node and the "infineon,xmm6260" compatible node?

The xmm6260 has a phandle reference to it. Since there is consumer matching logic in the pwrseq driver I am leaning towards removing this node entirely. This patches is still in non-final stage and I would like to hear any opinions on the way to improving it.

Quoted 1 line

Bart

#5 lore raw

Re: [PATCH v2 1/2] dt-bindings: soc: tegra: Document Nvidia Tegra modem pwrseq

Quoted 34 lines · Svyatoslav Ryhel

вт, 26 трав. 2026 р. о 12:51 Bartosz Golaszewski <[email protected]> пише:

Quoted 22 lines · Svyatoslav Ryhel
Quoted 7 lines

Document the Tegra modem pwseq used by various devices based on the Nvidia Tegra SoC, describing its usage. The power sequence provides interaction between the modem and SoC-specific interface configurations.

---

...

Quoted 10 lines
Documentation/devicetree/bindings/soc/tegra/nvidia,tegra-modem-pwrseq.yaml new file +10 -0
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    pwrseq-modem {
+        compatible = "nvidia,tegra-modem-pwrseq";
+
+        enable-gpios = <&gpio 165 GPIO_ACTIVE_HIGH>;
+        power-supply = <&vdd_3v3_vbat>;
Quoted 8 lines
Quoted 6 lines
Documentation/devicetree/bindings/soc/tegra/nvidia,tegra-modem-pwrseq.yaml new file +3 -1
+
+        nvidia,usb-bus = <&usb2>;
+    };
--

2.51.0

I assume there's no such component as the tegra modem *pwrseq*?

Hardware component, I assume no.

Quoted 9 lines
Quoted 3 lines

What is the relationship between this node and the "infineon,xmm6260" compatible node?

The xmm6260 has a phandle reference to it. Since there is consumer matching logic in the pwrseq driver I am leaning towards removing this node entirely. This patches is still in non-final stage and I would like to hear any opinions on the way to improving it.

The node attached to the pwrseq provider device should represent a real hardware component. Are the enable-gpios and power-supply lines connected to the modem package? Is there an internal structure to it, like a PMIC to which these lines connect that controls the actual modem IC?

Bart

#6 lore raw

Re: [PATCH v2 1/2] dt-bindings: soc: tegra: Document Nvidia Tegra modem pwrseq

вт, 26 трав. 2026 р. о 14:14 Bartosz Golaszewski <[email protected]> пише:

Quoted 46 lines · Svyatoslav Ryhel
Quoted 34 lines

вт, 26 трав. 2026 р. о 12:51 Bartosz Golaszewski <[email protected]> пише:

Quoted 22 lines · Svyatoslav Ryhel
Quoted 7 lines

Document the Tegra modem pwseq used by various devices based on the Nvidia Tegra SoC, describing its usage. The power sequence provides interaction between the modem and SoC-specific interface configurations.

---

...

Quoted 10 lines
Documentation/devicetree/bindings/soc/tegra/nvidia,tegra-modem-pwrseq.yaml new file +10 -0
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    pwrseq-modem {
+        compatible = "nvidia,tegra-modem-pwrseq";
+
+        enable-gpios = <&gpio 165 GPIO_ACTIVE_HIGH>;
+        power-supply = <&vdd_3v3_vbat>;
Quoted 8 lines
Quoted 6 lines
Documentation/devicetree/bindings/soc/tegra/nvidia,tegra-modem-pwrseq.yaml new file +3 -1
+
+        nvidia,usb-bus = <&usb2>;
+    };
--

2.51.0

I assume there's no such component as the tegra modem *pwrseq*?

Hardware component, I assume no.

Quoted 9 lines
Quoted 3 lines

What is the relationship between this node and the "infineon,xmm6260" compatible node?

The xmm6260 has a phandle reference to it. Since there is consumer matching logic in the pwrseq driver I am leaning towards removing this node entirely. This patches is still in non-final stage and I would like to hear any opinions on the way to improving it.

Quoted 3 lines

The node attached to the pwrseq provider device should represent a real hardware component. Are the enable-gpios and power-supply lines connected to the modem package?

Yes, enable-gpio is connected to the modem and signals that USB is set and ready to work with the modem, while power-supply is an optional supply connected to the modem's vbus input.

Quoted 2 lines

Is there an internal structure to it, like a PMIC to which these lines connect that controls the actual modem IC?

Modem does have internal PMIC to power up all its components, but they are controlled by the modems internal firmware and are not accessible via any standard means.

Quoted 1 line

Bart

#7 lore raw

Re: [PATCH v2 1/2] dt-bindings: soc: tegra: Document Nvidia Tegra modem pwrseq

Quoted 48 lines · Svyatoslav Ryhel

вт, 26 трав. 2026 р. о 14:14 Bartosz Golaszewski <[email protected]> пише:

Quoted 46 lines · Svyatoslav Ryhel
Quoted 43 lines

вт, 26 трав. 2026 р. о 12:51 Bartosz Golaszewski <[email protected]> пише:

Quoted 22 lines · Svyatoslav Ryhel
Quoted 7 lines

Document the Tegra modem pwseq used by various devices based on the Nvidia Tegra SoC, describing its usage. The power sequence provides interaction between the modem and SoC-specific interface configurations.

---

...

Quoted 10 lines
Documentation/devicetree/bindings/soc/tegra/nvidia,tegra-modem-pwrseq.yaml new file +10 -0
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    pwrseq-modem {
+        compatible = "nvidia,tegra-modem-pwrseq";
+
+        enable-gpios = <&gpio 165 GPIO_ACTIVE_HIGH>;
+        power-supply = <&vdd_3v3_vbat>;
Quoted 8 lines
Quoted 6 lines
Documentation/devicetree/bindings/soc/tegra/nvidia,tegra-modem-pwrseq.yaml new file +3 -1
+
+        nvidia,usb-bus = <&usb2>;
+    };
--

2.51.0

I assume there's no such component as the tegra modem *pwrseq*?

Hardware component, I assume no.

Quoted 3 lines

What is the relationship between this node and the "infineon,xmm6260" compatible node?

The xmm6260 has a phandle reference to it. Since there is consumer matching logic in the pwrseq driver I am leaning towards removing this node entirely. This patches is still in non-final stage and I would like to hear any opinions on the way to improving it.

Quoted 8 lines
Quoted 3 lines

The node attached to the pwrseq provider device should represent a real hardware component. Are the enable-gpios and power-supply lines connected to the modem package?

Yes, enable-gpio is connected to the modem and signals that USB is set and ready to work with the modem, while power-supply is an optional supply connected to the modem's vbus input.

The modem is a hard-wired USB device? Do you implement it as a platform driver or a USB driver?

Is there a connector of any kind that could be used as the HW component represented by the pwrseq device?

Bart

#8 lore raw

Re: [PATCH v2 1/2] dt-bindings: soc: tegra: Document Nvidia Tegra modem pwrseq

вт, 26 трав. 2026 р. о 15:35 Bartosz Golaszewski <[email protected]> пише:

Quoted 54 lines · Svyatoslav Ryhel
Quoted 52 lines

вт, 26 трав. 2026 р. о 14:14 Bartosz Golaszewski <[email protected]> пише:

Quoted 49 lines · Svyatoslav Ryhel
Quoted 34 lines

вт, 26 трав. 2026 р. о 12:51 Bartosz Golaszewski <[email protected]> пише:

Quoted 22 lines · Svyatoslav Ryhel
Quoted 7 lines

Document the Tegra modem pwseq used by various devices based on the Nvidia Tegra SoC, describing its usage. The power sequence provides interaction between the modem and SoC-specific interface configurations.

---

...

Quoted 10 lines
Documentation/devicetree/bindings/soc/tegra/nvidia,tegra-modem-pwrseq.yaml new file +10 -0
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    pwrseq-modem {
+        compatible = "nvidia,tegra-modem-pwrseq";
+
+        enable-gpios = <&gpio 165 GPIO_ACTIVE_HIGH>;
+        power-supply = <&vdd_3v3_vbat>;
Quoted 8 lines
Quoted 6 lines
Documentation/devicetree/bindings/soc/tegra/nvidia,tegra-modem-pwrseq.yaml new file +3 -1
+
+        nvidia,usb-bus = <&usb2>;
+    };
--

2.51.0

I assume there's no such component as the tegra modem *pwrseq*?

Hardware component, I assume no.

Quoted 9 lines
Quoted 3 lines

What is the relationship between this node and the "infineon,xmm6260" compatible node?

The xmm6260 has a phandle reference to it. Since there is consumer matching logic in the pwrseq driver I am leaning towards removing this node entirely. This patches is still in non-final stage and I would like to hear any opinions on the way to improving it.

The node attached to the pwrseq provider device should represent a real hardware component. Are the enable-gpios and power-supply lines connected to the modem package?

Quoted 8 lines
Quoted 4 lines

Yes, enable-gpio is connected to the modem and signals that USB is set and ready to work with the modem, while power-supply is an optional supply connected to the modem's vbus input.

The modem is a hard-wired USB device? Do you implement it as a platform driver or a USB driver?

It is not a traditional USB device. XMM6260 is an embedded modem used in the Tegra phones, it is linked with the AP using USB line in HSIC mode. The driver is implemented as a platform device since it does not interacts with the exposed USB device directly, it just ensures that USB device is properly configured and is ready for IPC.

Quoted 2 lines

Is there a connector of any kind that could be used as the HW component represented by the pwrseq device?

I assume control over USB line is the HW base, but as I have said, I can integrate binding in the modem node itself, and pwrseq can get all it needs from the match. Pwrseq framework states "This framework is designed to abstract complex power-up sequences that are shared between multiple logical devices in the Linux kernel." it does not say that it must represent some specific hardware.

Using pwrseq allows modem driver to be SoC independent since USB line handling is moved into SoC specific power sequence, and this modem is used in Exynos and OMAP too with similar setup but they all have different USB controllers. Maybe you can point me where SoC specific USB controller handling can be implemented?

Quoted 2 lines

Bart

#9 lore raw

Re: [PATCH v2 1/2] dt-bindings: soc: tegra: Document Nvidia Tegra modem pwrseq

Quoted 24 lines · Svyatoslav Ryhel
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines

The node attached to the pwrseq provider device should represent a real hardware component. Are the enable-gpios and power-supply lines connected to the modem package?

Quoted 8 lines
Quoted 4 lines

Yes, enable-gpio is connected to the modem and signals that USB is set and ready to work with the modem, while power-supply is an optional supply connected to the modem's vbus input.

The modem is a hard-wired USB device? Do you implement it as a platform driver or a USB driver?

It is not a traditional USB device. XMM6260 is an embedded modem used in the Tegra phones, it is linked with the AP using USB line in HSIC mode. The driver is implemented as a platform device since it does not interacts with the exposed USB device directly, it just ensures that USB device is properly configured and is ready for IPC.

Quoted 2 lines

Is there a connector of any kind that could be used as the HW component represented by the pwrseq device?

Quoted 7 lines

I assume control over USB line is the HW base, but as I have said, I can integrate binding in the modem node itself, and pwrseq can get all it needs from the match. Pwrseq framework states "This framework is designed to abstract complex power-up sequences that are shared between multiple logical devices in the Linux kernel." it does not say that it must represent some specific hardware.

No, not at all. We just can't make up any imaginary, logical "pwrseq" devices and describe them in DT bindings.

Quoted 6 lines

Using pwrseq allows modem driver to be SoC independent since USB line handling is moved into SoC specific power sequence, and this modem is used in Exynos and OMAP too with similar setup but they all have different USB controllers. Maybe you can point me where SoC specific USB controller handling can be implemented?

I'm not sure I'm following. Can you rephrase or point me where OMAP and Samsung implement it?

Bart

#10 lore raw

Re: [PATCH v2 1/2] dt-bindings: soc: tegra: Document Nvidia Tegra modem pwrseq

вт, 26 трав. 2026 р. о 16:14 Bartosz Golaszewski <[email protected]> пише:

Quoted 34 lines · Svyatoslav Ryhel
Quoted 24 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines

The node attached to the pwrseq provider device should represent a real hardware component. Are the enable-gpios and power-supply lines connected to the modem package?

Quoted 8 lines
Quoted 4 lines

Yes, enable-gpio is connected to the modem and signals that USB is set and ready to work with the modem, while power-supply is an optional supply connected to the modem's vbus input.

The modem is a hard-wired USB device? Do you implement it as a platform driver or a USB driver?

It is not a traditional USB device. XMM6260 is an embedded modem used in the Tegra phones, it is linked with the AP using USB line in HSIC mode. The driver is implemented as a platform device since it does not interacts with the exposed USB device directly, it just ensures that USB device is properly configured and is ready for IPC.

Quoted 2 lines

Is there a connector of any kind that could be used as the HW component represented by the pwrseq device?

Quoted 7 lines

I assume control over USB line is the HW base, but as I have said, I can integrate binding in the modem node itself, and pwrseq can get all it needs from the match. Pwrseq framework states "This framework is designed to abstract complex power-up sequences that are shared between multiple logical devices in the Linux kernel." it does not say that it must represent some specific hardware.

Quoted 3 lines

No, not at all. We just can't make up any imaginary, logical "pwrseq" devices and describe them in DT bindings.

Ye, ye, sure, pwrseq framework is quite flexible and I am not stating this bindings is mandatory.

Quoted 10 lines
Quoted 6 lines

Using pwrseq allows modem driver to be SoC independent since USB line handling is moved into SoC specific power sequence, and this modem is used in Exynos and OMAP too with similar setup but they all have different USB controllers. Maybe you can point me where SoC specific USB controller handling can be implemented?

I'm not sure I'm following. Can you rephrase or point me where OMAP and Samsung implement it?

They did not.

The XMM6260 modem is used not only in the Tegra phones but in the OMAP and Exynos based too. Replicant tried to implement support locally with midas devices and they had some progress. From what I have seen generic implementation I am proposing will work with any of those 3 SoCs maybe with some slight tweaks, only part that is totally different and SoC specific is how USB controller used by the modem is handled (well and IPC but that is out of scope of this patchset anyway).

Obviously, non of the 3 vendors have submitted any mainline patches, everything is in the downstream forks. I have investigated a bit how this modem works on my Tegra phone and re-implemented it to work with mainline kernel (I don't have Exynos and OMAP devices to play with). I have come up with generic platform driver which handles modem configuration and a SoC specific part which performs USB controller bind/probe when modem is ready to handle the USB. ATM this SoC specific part is available and tested only for Tegra devices.

Quoted 1 line

Bart

#11 lore raw

Re: [PATCH v2 1/2] dt-bindings: soc: tegra: Document Nvidia Tegra modem pwrseq

Quoted 64 lines · Svyatoslav Ryhel

вт, 26 трав. 2026 р. о 16:14 Bartosz Golaszewski <[email protected]> пише:

Quoted 34 lines · Svyatoslav Ryhel
Quoted 24 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines

The node attached to the pwrseq provider device should represent a real hardware component. Are the enable-gpios and power-supply lines connected to the modem package?

Quoted 8 lines
Quoted 4 lines

Yes, enable-gpio is connected to the modem and signals that USB is set and ready to work with the modem, while power-supply is an optional supply connected to the modem's vbus input.

The modem is a hard-wired USB device? Do you implement it as a platform driver or a USB driver?

It is not a traditional USB device. XMM6260 is an embedded modem used in the Tegra phones, it is linked with the AP using USB line in HSIC mode. The driver is implemented as a platform device since it does not interacts with the exposed USB device directly, it just ensures that USB device is properly configured and is ready for IPC.

Quoted 2 lines

Is there a connector of any kind that could be used as the HW component represented by the pwrseq device?

Quoted 7 lines

I assume control over USB line is the HW base, but as I have said, I can integrate binding in the modem node itself, and pwrseq can get all it needs from the match. Pwrseq framework states "This framework is designed to abstract complex power-up sequences that are shared between multiple logical devices in the Linux kernel." it does not say that it must represent some specific hardware.

Quoted 3 lines

No, not at all. We just can't make up any imaginary, logical "pwrseq" devices and describe them in DT bindings.

Ye, ye, sure, pwrseq framework is quite flexible and I am not stating this bindings is mandatory.

Quoted 10 lines
Quoted 6 lines

Using pwrseq allows modem driver to be SoC independent since USB line handling is moved into SoC specific power sequence, and this modem is used in Exynos and OMAP too with similar setup but they all have different USB controllers. Maybe you can point me where SoC specific USB controller handling can be implemented?

I'm not sure I'm following. Can you rephrase or point me where OMAP and Samsung implement it?

They did not.

The XMM6260 modem is used not only in the Tegra phones but in the OMAP and Exynos based too. Replicant tried to implement support locally with midas devices and they had some progress. From what I have seen generic implementation I am proposing will work with any of those 3 SoCs maybe with some slight tweaks, only part that is totally different and SoC specific is how USB controller used by the modem is handled (well and IPC but that is out of scope of this patchset anyway).

Quoted 9 lines

Obviously, non of the 3 vendors have submitted any mainline patches, everything is in the downstream forks. I have investigated a bit how this modem works on my Tegra phone and re-implemented it to work with mainline kernel (I don't have Exynos and OMAP devices to play with). I have come up with generic platform driver which handles modem configuration and a SoC specific part which performs USB controller bind/probe when modem is ready to handle the USB. ATM this SoC specific part is available and tested only for Tegra devices.

Are you familiar with the PCI pwrctrl code that lives under drivers/pci/pwrctrl/? It seems to be solving a somewhat similar issue for PCI devices that are hardwired and powered externally. Maybe you could use some of that code for your USB use-case?

Bartosz

#12 lore raw

Re: [PATCH v2 1/2] dt-bindings: soc: tegra: Document Nvidia Tegra modem pwrseq

Quoted 75 lines · Bartosz Golaszewski
Quoted 64 lines · Svyatoslav Ryhel

вт, 26 трав. 2026 р. о 16:14 Bartosz Golaszewski <[email protected]> пише:

Quoted 34 lines · Svyatoslav Ryhel
Quoted 24 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines

The node attached to the pwrseq provider device should represent a real hardware component. Are the enable-gpios and power-supply lines connected to the modem package?

Quoted 8 lines
Quoted 4 lines

Yes, enable-gpio is connected to the modem and signals that USB is set and ready to work with the modem, while power-supply is an optional supply connected to the modem's vbus input.

The modem is a hard-wired USB device? Do you implement it as a platform driver or a USB driver?

It is not a traditional USB device. XMM6260 is an embedded modem used in the Tegra phones, it is linked with the AP using USB line in HSIC mode. The driver is implemented as a platform device since it does not interacts with the exposed USB device directly, it just ensures that USB device is properly configured and is ready for IPC.

Quoted 2 lines

Is there a connector of any kind that could be used as the HW component represented by the pwrseq device?

Quoted 7 lines

I assume control over USB line is the HW base, but as I have said, I can integrate binding in the modem node itself, and pwrseq can get all it needs from the match. Pwrseq framework states "This framework is designed to abstract complex power-up sequences that are shared between multiple logical devices in the Linux kernel." it does not say that it must represent some specific hardware.

Quoted 3 lines

No, not at all. We just can't make up any imaginary, logical "pwrseq" devices and describe them in DT bindings.

Ye, ye, sure, pwrseq framework is quite flexible and I am not stating this bindings is mandatory.

Quoted 10 lines
Quoted 6 lines

Using pwrseq allows modem driver to be SoC independent since USB line handling is moved into SoC specific power sequence, and this modem is used in Exynos and OMAP too with similar setup but they all have different USB controllers. Maybe you can point me where SoC specific USB controller handling can be implemented?

I'm not sure I'm following. Can you atrephrase or point me where OMAP and Samsung implement it?

They did not.

The XMM6260 modem is used not only in the Tegra phones but in the OMAP and Exynos based too. Replicant tried to implement support locally with midas devices and they had some progress. From what I have seen generic implementation I am proposing will work with any of those 3 SoCs maybe with some slight tweaks, only part that is totally different and SoC specific is how USB controller used by the modem is handled (well and IPC but that is out of scope of this patchset anyway).

Quoted 9 lines

Obviously, non of the 3 vendors have submitted any mainline patches, everything is in the downstream forks. I have investigated a bit how this modem works on my Tegra phone and re-implemented it to work with mainline kernel (I don't have Exynos and OMAP devices to play with). I have come up with generic platform driver which handles modem configuration and a SoC specific part which performs USB controller bind/probe when modem is ready to handle the USB. ATM this SoC specific part is available and tested only for Tegra devices.

Quoted 4 lines

Are you familiar with the PCI pwrctrl code that lives under drivers/pci/pwrctrl/? It seems to be solving a somewhat similar issue for PCI devices that are hardwired and powered externally. Maybe you could use some of that code for your USB use-case?

I pointed to PCI already:
https://lore.kernel.org/lkml/20260518-mustard-rabbit-of-ecstasy-eed3b6@quoll/

And emphasized to describe hardware, not drivers. This binding AGAIN describes drivers, so we did not move forward at all.

Best regards,
Krzysztof

#13 lore raw

Re: [PATCH v2 1/2] dt-bindings: soc: tegra: Document Nvidia Tegra modem pwrseq

ср, 27 трав. 2026 р. о 11:26 Krzysztof Kozlowski <[email protected]> пише:

Quoted 86 lines · Bartosz Golaszewski
Quoted 75 lines · Svyatoslav Ryhel
Quoted 64 lines

вт, 26 трав. 2026 р. о 16:14 Bartosz Golaszewski <[email protected]> пише:

Quoted 34 lines · Svyatoslav Ryhel
Quoted 24 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines

The node attached to the pwrseq provider device should represent a real hardware component. Are the enable-gpios and power-supply lines connected to the modem package?

Quoted 8 lines
Quoted 4 lines

Yes, enable-gpio is connected to the modem and signals that USB is set and ready to work with the modem, while power-supply is an optional supply connected to the modem's vbus input.

The modem is a hard-wired USB device? Do you implement it as a platform driver or a USB driver?

It is not a traditional USB device. XMM6260 is an embedded modem used in the Tegra phones, it is linked with the AP using USB line in HSIC mode. The driver is implemented as a platform device since it does not interacts with the exposed USB device directly, it just ensures that USB device is properly configured and is ready for IPC.

Quoted 2 lines

Is there a connector of any kind that could be used as the HW component represented by the pwrseq device?

Quoted 7 lines

I assume control over USB line is the HW base, but as I have said, I can integrate binding in the modem node itself, and pwrseq can get all it needs from the match. Pwrseq framework states "This framework is designed to abstract complex power-up sequences that are shared between multiple logical devices in the Linux kernel." it does not say that it must represent some specific hardware.

Quoted 3 lines

No, not at all. We just can't make up any imaginary, logical "pwrseq" devices and describe them in DT bindings.

Ye, ye, sure, pwrseq framework is quite flexible and I am not stating this bindings is mandatory.

Quoted 10 lines
Quoted 6 lines

Using pwrseq allows modem driver to be SoC independent since USB line handling is moved into SoC specific power sequence, and this modem is used in Exynos and OMAP too with similar setup but they all have different USB controllers. Maybe you can point me where SoC specific USB controller handling can be implemented?

I'm not sure I'm following. Can you atrephrase or point me where OMAP and Samsung implement it?

They did not.

The XMM6260 modem is used not only in the Tegra phones but in the OMAP and Exynos based too. Replicant tried to implement support locally with midas devices and they had some progress. From what I have seen generic implementation I am proposing will work with any of those 3 SoCs maybe with some slight tweaks, only part that is totally different and SoC specific is how USB controller used by the modem is handled (well and IPC but that is out of scope of this patchset anyway).

Quoted 9 lines

Obviously, non of the 3 vendors have submitted any mainline patches, everything is in the downstream forks. I have investigated a bit how this modem works on my Tegra phone and re-implemented it to work with mainline kernel (I don't have Exynos and OMAP devices to play with). I have come up with generic platform driver which handles modem configuration and a SoC specific part which performs USB controller bind/probe when modem is ready to handle the USB. ATM this SoC specific part is available and tested only for Tegra devices.

Quoted 4 lines

Are you familiar with the PCI pwrctrl code that lives under drivers/pci/pwrctrl/? It seems to be solving a somewhat similar issue for PCI devices that are hardwired and powered externally. Maybe you could use some of that code for your USB use-case?

I pointed to PCI already:
https://lore.kernel.org/lkml/20260518-mustard-rabbit-of-ecstasy-eed3b6@quoll/

Quoted 6 lines

And emphasized to describe hardware, not drivers. This binding AGAIN describes drivers, so we did not move forward at all.

Best regards,
Krzysztof

Krzysztof, why are you so mean? Yes, I misunderstood you and sent this schema. However, I am not stating or arguing that it must be applied or whatever. I am just looking for a proper solution to issue I am currently facing.

Anyway. That does not matter, what matters is how to organize everything I have regarding this modem into a logic set. This is why I am looking for maintainer suggestions.

How I see it ATM:
- I will remove this schema entirely and add usb-gpio (trigger for modem that USB is ready), vbus supply (yes, modem has this line too you can check in the P895 schematic) and infineon,usb-bus which represents HSIC connection to the modem to the modem schema itself. Obviously, I will add detailed descriptions of each component.
- I will resent patch 2 of this pwrseq with the modem patchset to have a bigger picture. Pwrseq will obtain needed data from the modem node itself (Bartosz Golaszewski are you fine with this?)
- I will try to get control over Tegra USB controller in the pwrseq without need in externally-controlled flag I have proposed for chipidea driver. I hope my idea will work.

Will this be acceptable for both of you?

#14 lore raw

Re: [PATCH v2 1/2] dt-bindings: soc: tegra: Document Nvidia Tegra modem pwrseq

Quoted 91 lines · Svyatoslav Ryhel

ср, 27 трав. 2026 р. о 11:26 Krzysztof Kozlowski <[email protected]> пише:

Quoted 90 lines · Bartosz Golaszewski
Quoted 75 lines · Svyatoslav Ryhel
Quoted 64 lines

вт, 26 трав. 2026 р. о 16:14 Bartosz Golaszewski <[email protected]> пише:

Quoted 34 lines · Svyatoslav Ryhel
Quoted 24 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines

The node attached to the pwrseq provider device should represent a real hardware component. Are the enable-gpios and power-supply lines connected to the modem package?

Quoted 8 lines
Quoted 4 lines

Yes, enable-gpio is connected to the modem and signals that USB is set and ready to work with the modem, while power-supply is an optional supply connected to the modem's vbus input.

The modem is a hard-wired USB device? Do you implement it as a platform driver or a USB driver?

It is not a traditional USB device. XMM6260 is an embedded modem used in the Tegra phones, it is linked with the AP using USB line in HSIC mode. The driver is implemented as a platform device since it does not interacts with the exposed USB device directly, it just ensures that USB device is properly configured and is ready for IPC.

Quoted 2 lines

Is there a connector of any kind that could be used as the HW component represented by the pwrseq device?

Quoted 7 lines

I assume control over USB line is the HW base, but as I have said, I can integrate binding in the modem node itself, and pwrseq can get all it needs from the match. Pwrseq framework states "This framework is designed to abstract complex power-up sequences that are shared between multiple logical devices in the Linux kernel." it does not say that it must represent some specific hardware.

Quoted 3 lines

No, not at all. We just can't make up any imaginary, logical "pwrseq" devices and describe them in DT bindings.

Ye, ye, sure, pwrseq framework is quite flexible and I am not stating this bindings is mandatory.

Quoted 10 lines
Quoted 6 lines

Using pwrseq allows modem driver to be SoC independent since USB line handling is moved into SoC specific power sequence, and this modem is used in Exynos and OMAP too with similar setup but they all have different USB controllers. Maybe you can point me where SoC specific USB controller handling can be implemented?

I'm not sure I'm following. Can you atrephrase or point me where OMAP and Samsung implement it?

They did not.

The XMM6260 modem is used not only in the Tegra phones but in the OMAP and Exynos based too. Replicant tried to implement support locally with midas devices and they had some progress. From what I have seen generic implementation I am proposing will work with any of those 3 SoCs maybe with some slight tweaks, only part that is totally different and SoC specific is how USB controller used by the modem is handled (well and IPC but that is out of scope of this patchset anyway).

Quoted 9 lines

Obviously, non of the 3 vendors have submitted any mainline patches, everything is in the downstream forks. I have investigated a bit how this modem works on my Tegra phone and re-implemented it to work with mainline kernel (I don't have Exynos and OMAP devices to play with). I have come up with generic platform driver which handles modem configuration and a SoC specific part which performs USB controller bind/probe when modem is ready to handle the USB. ATM this SoC specific part is available and tested only for Tegra devices.

Quoted 4 lines

Are you familiar with the PCI pwrctrl code that lives under drivers/pci/pwrctrl/? It seems to be solving a somewhat similar issue for PCI devices that are hardwired and powered externally. Maybe you could use some of that code for your USB use-case?

I pointed to PCI already:
https://lore.kernel.org/lkml/20260518-mustard-rabbit-of-ecstasy-eed3b6@quoll/

And emphasized to describe hardware, not drivers. This binding AGAIN describes drivers, so we did not move forward at all.

Quoted 8 lines
Quoted 2 lines

Best regards,
Krzysztof

Krzysztof, why are you so mean? Yes, I misunderstood you and sent this schema. However, I am not stating or arguing that it must be applied or whatever. I am just looking for a proper solution to issue I am currently facing.

Krzysztof reviews hundreds of patches so his fuse is quite short, don't take it personally, he's a nice guy in real life. :)

Quoted 4 lines

Anyway. That does not matter, what matters is how to organize everything I have regarding this modem into a logic set. This is why I am looking for maintainer suggestions.

Quoted 9 lines

How I see it ATM:
- I will remove this schema entirely and add usb-gpio (trigger for modem that USB is ready), vbus supply (yes, modem has this line too you can check in the P895 schematic) and infineon,usb-bus which represents HSIC connection to the modem to the modem schema itself. Obviously, I will add detailed descriptions of each component.
- I will resent patch 2 of this pwrseq with the modem patchset to have a bigger picture. Pwrseq will obtain needed data from the modem node itself (Bartosz Golaszewski are you fine with this?)

As in: the modem driver will be the pwrseq provider? Sure, sounds good.

Quoted 6 lines

- I will try to get control over Tegra USB controller in the pwrseq without need in externally-controlled flag I have proposed for chipidea driver. I hope my idea will work.

Will this be acceptable for both of you?

Bart

#15 lore raw

Re: [PATCH v2 1/2] dt-bindings: soc: tegra: Document Nvidia Tegra modem pwrseq

ср, 27 трав. 2026 р. о 12:15 Bartosz Golaszewski <[email protected]> пише:

Quoted 119 lines · Svyatoslav Ryhel
Quoted 91 lines

ср, 27 трав. 2026 р. о 11:26 Krzysztof Kozlowski <[email protected]> пише:

Quoted 90 lines · Bartosz Golaszewski
Quoted 75 lines · Svyatoslav Ryhel
Quoted 64 lines

вт, 26 трав. 2026 р. о 16:14 Bartosz Golaszewski <[email protected]> пише:

Quoted 34 lines · Svyatoslav Ryhel
Quoted 24 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines

The node attached to the pwrseq provider device should represent a real hardware component. Are the enable-gpios and power-supply lines connected to the modem package?

Quoted 8 lines
Quoted 4 lines

Yes, enable-gpio is connected to the modem and signals that USB is set and ready to work with the modem, while power-supply is an optional supply connected to the modem's vbus input.

The modem is a hard-wired USB device? Do you implement it as a platform driver or a USB driver?

It is not a traditional USB device. XMM6260 is an embedded modem used in the Tegra phones, it is linked with the AP using USB line in HSIC mode. The driver is implemented as a platform device since it does not interacts with the exposed USB device directly, it just ensures that USB device is properly configured and is ready for IPC.

Quoted 2 lines

Is there a connector of any kind that could be used as the HW component represented by the pwrseq device?

Quoted 7 lines

I assume control over USB line is the HW base, but as I have said, I can integrate binding in the modem node itself, and pwrseq can get all it needs from the match. Pwrseq framework states "This framework is designed to abstract complex power-up sequences that are shared between multiple logical devices in the Linux kernel." it does not say that it must represent some specific hardware.

Quoted 3 lines

No, not at all. We just can't make up any imaginary, logical "pwrseq" devices and describe them in DT bindings.

Ye, ye, sure, pwrseq framework is quite flexible and I am not stating this bindings is mandatory.

Quoted 10 lines
Quoted 6 lines

Using pwrseq allows modem driver to be SoC independent since USB line handling is moved into SoC specific power sequence, and this modem is used in Exynos and OMAP too with similar setup but they all have different USB controllers. Maybe you can point me where SoC specific USB controller handling can be implemented?

I'm not sure I'm following. Can you atrephrase or point me where OMAP and Samsung implement it?

They did not.

The XMM6260 modem is used not only in the Tegra phones but in the OMAP and Exynos based too. Replicant tried to implement support locally with midas devices and they had some progress. From what I have seen generic implementation I am proposing will work with any of those 3 SoCs maybe with some slight tweaks, only part that is totally different and SoC specific is how USB controller used by the modem is handled (well and IPC but that is out of scope of this patchset anyway).

Quoted 9 lines

Obviously, non of the 3 vendors have submitted any mainline patches, everything is in the downstream forks. I have investigated a bit how this modem works on my Tegra phone and re-implemented it to work with mainline kernel (I don't have Exynos and OMAP devices to play with). I have come up with generic platform driver which handles modem configuration and a SoC specific part which performs USB controller bind/probe when modem is ready to handle the USB. ATM this SoC specific part is available and tested only for Tegra devices.

Quoted 4 lines

Are you familiar with the PCI pwrctrl code that lives under drivers/pci/pwrctrl/? It seems to be solving a somewhat similar issue for PCI devices that are hardwired and powered externally. Maybe you could use some of that code for your USB use-case?

I pointed to PCI already:
https://lore.kernel.org/lkml/20260518-mustard-rabbit-of-ecstasy-eed3b6@quoll/

And emphasized to describe hardware, not drivers. This binding AGAIN describes drivers, so we did not move forward at all.

Quoted 8 lines
Quoted 2 lines

Best regards,
Krzysztof

Krzysztof, why are you so mean? Yes, I misunderstood you and sent this schema. However, I am not stating or arguing that it must be applied or whatever. I am just looking for a proper solution to issue I am currently facing.

Krzysztof reviews hundreds of patches so his fuse is quite short, don't take it personally, he's a nice guy in real life. :)

Quoted 4 lines

Anyway. That does not matter, what matters is how to organize everything I have regarding this modem into a logic set. This is why I am looking for maintainer suggestions.

Quoted 9 lines

How I see it ATM:
- I will remove this schema entirely and add usb-gpio (trigger for modem that USB is ready), vbus supply (yes, modem has this line too you can check in the P895 schematic) and infineon,usb-bus which represents HSIC connection to the modem to the modem schema itself. Obviously, I will add detailed descriptions of each component.
- I will resent patch 2 of this pwrseq with the modem patchset to have a bigger picture. Pwrseq will obtain needed data from the modem node itself (Bartosz Golaszewski are you fine with this?)

Quoted 2 lines

As in: the modem driver will be the pwrseq provider? Sure, sounds good.

No, consumer. Modem calls SoC specific pwrseq.

Quoted 8 lines
Quoted 6 lines

- I will try to get control over Tegra USB controller in the pwrseq without need in externally-controlled flag I have proposed for chipidea driver. I hope my idea will work.

Will this be acceptable for both of you?

Bart

#16 lore raw

Re: [PATCH v2 1/2] dt-bindings: soc: tegra: Document Nvidia Tegra modem pwrseq

In reply to Svyatoslav Ryhel
Quoted 87 lines · Svyatoslav Ryhel

ср, 27 трав. 2026 р. о 11:26 Krzysztof Kozlowski <[email protected]> пише:

Quoted 86 lines · Bartosz Golaszewski
Quoted 75 lines · Svyatoslav Ryhel
Quoted 64 lines

вт, 26 трав. 2026 р. о 16:14 Bartosz Golaszewski <[email protected]> пише:

Quoted 34 lines · Svyatoslav Ryhel
Quoted 24 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines

The node attached to the pwrseq provider device should represent a real hardware component. Are the enable-gpios and power-supply lines connected to the modem package?

Quoted 8 lines
Quoted 4 lines

Yes, enable-gpio is connected to the modem and signals that USB is set and ready to work with the modem, while power-supply is an optional supply connected to the modem's vbus input.

The modem is a hard-wired USB device? Do you implement it as a platform driver or a USB driver?

It is not a traditional USB device. XMM6260 is an embedded modem used in the Tegra phones, it is linked with the AP using USB line in HSIC mode. The driver is implemented as a platform device since it does not interacts with the exposed USB device directly, it just ensures that USB device is properly configured and is ready for IPC.

Quoted 2 lines

Is there a connector of any kind that could be used as the HW component represented by the pwrseq device?

Quoted 7 lines

I assume control over USB line is the HW base, but as I have said, I can integrate binding in the modem node itself, and pwrseq can get all it needs from the match. Pwrseq framework states "This framework is designed to abstract complex power-up sequences that are shared between multiple logical devices in the Linux kernel." it does not say that it must represent some specific hardware.

Quoted 3 lines

No, not at all. We just can't make up any imaginary, logical "pwrseq" devices and describe them in DT bindings.

Ye, ye, sure, pwrseq framework is quite flexible and I am not stating this bindings is mandatory.

Quoted 10 lines
Quoted 6 lines

Using pwrseq allows modem driver to be SoC independent since USB line handling is moved into SoC specific power sequence, and this modem is used in Exynos and OMAP too with similar setup but they all have different USB controllers. Maybe you can point me where SoC specific USB controller handling can be implemented?

I'm not sure I'm following. Can you atrephrase or point me where OMAP and Samsung implement it?

They did not.

The XMM6260 modem is used not only in the Tegra phones but in the OMAP and Exynos based too. Replicant tried to implement support locally with midas devices and they had some progress. From what I have seen generic implementation I am proposing will work with any of those 3 SoCs maybe with some slight tweaks, only part that is totally different and SoC specific is how USB controller used by the modem is handled (well and IPC but that is out of scope of this patchset anyway).

Quoted 9 lines

Obviously, non of the 3 vendors have submitted any mainline patches, everything is in the downstream forks. I have investigated a bit how this modem works on my Tegra phone and re-implemented it to work with mainline kernel (I don't have Exynos and OMAP devices to play with). I have come up with generic platform driver which handles modem configuration and a SoC specific part which performs USB controller bind/probe when modem is ready to handle the USB. ATM this SoC specific part is available and tested only for Tegra devices.

Quoted 4 lines

Are you familiar with the PCI pwrctrl code that lives under drivers/pci/pwrctrl/? It seems to be solving a somewhat similar issue for PCI devices that are hardwired and powered externally. Maybe you could use some of that code for your USB use-case?

I pointed to PCI already:
https://lore.kernel.org/lkml/20260518-mustard-rabbit-of-ecstasy-eed3b6@quoll/

Quoted 8 lines
Quoted 6 lines

And emphasized to describe hardware, not drivers. This binding AGAIN describes drivers, so we did not move forward at all.

Best regards,
Krzysztof

Krzysztof, why are you so mean? Yes, I misunderstood you and sent this

Just to recap:

https://lore.kernel.org/all/CAPVz0n09ZP1i2tasdTvnt8RvjhALvUYjv9u_EGRtnXPOYQtuqQ@mail.gmail.com/

And enormous discussion wasting our time here:
https://lore.kernel.org/all/CAPVz0n0u7uhL8_FQFiuB7DrnL++ecbaEKEoV7N2PgTVRBVECkw@mail.gmail.com/
because you were pushing your solution. I run out of spare time to handle endless discussions with you because you reject standard comments and expect long discussions with multiple justifications for standard (and documented in writing bindings) DT rules.

So here I told you to do like USB and PCI. This patchset is nothing like them.

Best regards,
Krzysztof

#17 lore raw

Re: [PATCH v2 1/2] dt-bindings: soc: tegra: Document Nvidia Tegra modem pwrseq

ср, 27 трав. 2026 р. о 12:20 Krzysztof Kozlowski <[email protected]> пише:

Quoted 109 lines · Svyatoslav Ryhel
Quoted 87 lines

ср, 27 трав. 2026 р. о 11:26 Krzysztof Kozlowski <[email protected]> пише:

Quoted 86 lines · Bartosz Golaszewski
Quoted 75 lines · Svyatoslav Ryhel
Quoted 64 lines

вт, 26 трав. 2026 р. о 16:14 Bartosz Golaszewski <[email protected]> пише:

Quoted 34 lines · Svyatoslav Ryhel
Quoted 24 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines

The node attached to the pwrseq provider device should represent a real hardware component. Are the enable-gpios and power-supply lines connected to the modem package?

Quoted 8 lines
Quoted 4 lines

Yes, enable-gpio is connected to the modem and signals that USB is set and ready to work with the modem, while power-supply is an optional supply connected to the modem's vbus input.

The modem is a hard-wired USB device? Do you implement it as a platform driver or a USB driver?

It is not a traditional USB device. XMM6260 is an embedded modem used in the Tegra phones, it is linked with the AP using USB line in HSIC mode. The driver is implemented as a platform device since it does not interacts with the exposed USB device directly, it just ensures that USB device is properly configured and is ready for IPC.

Quoted 2 lines

Is there a connector of any kind that could be used as the HW component represented by the pwrseq device?

Quoted 7 lines

I assume control over USB line is the HW base, but as I have said, I can integrate binding in the modem node itself, and pwrseq can get all it needs from the match. Pwrseq framework states "This framework is designed to abstract complex power-up sequences that are shared between multiple logical devices in the Linux kernel." it does not say that it must represent some specific hardware.

Quoted 3 lines

No, not at all. We just can't make up any imaginary, logical "pwrseq" devices and describe them in DT bindings.

Ye, ye, sure, pwrseq framework is quite flexible and I am not stating this bindings is mandatory.

Quoted 10 lines
Quoted 6 lines

Using pwrseq allows modem driver to be SoC independent since USB line handling is moved into SoC specific power sequence, and this modem is used in Exynos and OMAP too with similar setup but they all have different USB controllers. Maybe you can point me where SoC specific USB controller handling can be implemented?

I'm not sure I'm following. Can you atrephrase or point me where OMAP and Samsung implement it?

They did not.

The XMM6260 modem is used not only in the Tegra phones but in the OMAP and Exynos based too. Replicant tried to implement support locally with midas devices and they had some progress. From what I have seen generic implementation I am proposing will work with any of those 3 SoCs maybe with some slight tweaks, only part that is totally different and SoC specific is how USB controller used by the modem is handled (well and IPC but that is out of scope of this patchset anyway).

Quoted 9 lines

Obviously, non of the 3 vendors have submitted any mainline patches, everything is in the downstream forks. I have investigated a bit how this modem works on my Tegra phone and re-implemented it to work with mainline kernel (I don't have Exynos and OMAP devices to play with). I have come up with generic platform driver which handles modem configuration and a SoC specific part which performs USB controller bind/probe when modem is ready to handle the USB. ATM this SoC specific part is available and tested only for Tegra devices.

Quoted 4 lines

Are you familiar with the PCI pwrctrl code that lives under drivers/pci/pwrctrl/? It seems to be solving a somewhat similar issue for PCI devices that are hardwired and powered externally. Maybe you could use some of that code for your USB use-case?

I pointed to PCI already:
https://lore.kernel.org/lkml/20260518-mustard-rabbit-of-ecstasy-eed3b6@quoll/

Quoted 8 lines
Quoted 6 lines

And emphasized to describe hardware, not drivers. This binding AGAIN describes drivers, so we did not move forward at all.

Best regards,
Krzysztof

Krzysztof, why are you so mean? Yes, I misunderstood you and sent this

Just to recap:

https://lore.kernel.org/all/CAPVz0n09ZP1i2tasdTvnt8RvjhALvUYjv9u_EGRtnXPOYQtuqQ@mail.gmail.com/

And enormous discussion wasting our time here:
https://lore.kernel.org/all/CAPVz0n0u7uhL8_FQFiuB7DrnL++ecbaEKEoV7N2PgTVRBVECkw@mail.gmail.com/
because you were pushing your solution. I run out of spare time to handle endless discussions with you because you reject standard comments and expect long discussions with multiple justifications for standard (and documented in writing bindings) DT rules.

Quoted 3 lines

So here I told you to do like USB and PCI. This patchset is nothing like them.

You are creating an entire database of discussions we had. I am flattered.

Quoted 2 lines

Best regards,
Krzysztof

#18 lore raw

Re: [PATCH v2 1/2] dt-bindings: soc: tegra: Document Nvidia Tegra modem pwrseq

In reply to Svyatoslav Ryhel
Quoted 25 lines · Svyatoslav Ryhel

Document the Tegra modem pwseq used by various devices based on the Nvidia Tegra SoC, describing its usage. The power sequence provides interaction between the modem and SoC-specific interface configurations.

---
 .../soc/tegra/nvidia,tegra-modem-pwrseq.yaml  | 49 +++++++++++++++++++
 1 file changed, 49 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/soc/tegra/nvidia,tegra-modem-pwrseq.yaml
Documentation/devicetree/bindings/soc/tegra/nvidia,tegra-modem-pwrseq.yaml new file +9 -0
new file mode 100644
index 000000000000..3770fd6dc2cf
@@ -0,0 +1,49 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/soc/tegra/nvidia,tegra-modem-pwrseq.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Nvidia Tegra modem power sequence
+
+description:

Documentation/devicetree/bindings/soc/tegra/nvidia,tegra-modem-pwrseq.yaml line 19

Quoted 10 lines
Documentation/devicetree/bindings/soc/tegra/nvidia,tegra-modem-pwrseq.yaml new file +10 -0
+  A configuration sequence used in Tegra SoCs to provide proper interaction
+  between the application processor and the modem, as well as control over
+  one of the SoC's USB lines for the modem.
+
+maintainers:
+  - Svyatoslav Ryhel <[email protected]>
+
+properties:
+  compatible:
+    const: nvidia,tegra-modem-pwrseq

There is no such thing as pwrseq. I pointed you to existing code showing how to do it - PCI or USB. Fake devices won't be accepted.

Best regards,
Krzysztof

#19 lore raw

PATCH v2 2/2 power: sequencing: Add support for Nvidia Tegra modem pwrseq

In reply to Svyatoslav Ryhel

Nvidia Tegra modem power sequence is a set of configurations used in Tegra SoCs to provide proper interaction between the application processor and the modem, as well as control over one of the SoC's USB lines for the modem.

---
 drivers/power/sequencing/Kconfig              |  12 +
 drivers/power/sequencing/Makefile             |   1 +
 drivers/power/sequencing/pwrseq-tegra-modem.c | 209 ++++++++++++++++++
 3 files changed, 222 insertions(+)
 create mode 100644 drivers/power/sequencing/pwrseq-tegra-modem.c
drivers/power/sequencing/Kconfig +12 -0
index 1c5f5820f5b7..e04a6bacb476 100644
@@ -46,4 +46,16 @@ config POWER_SEQUENCING_PCIE_M2
 	  connectors. This driver handles the power sequencing for the M.2
 	  connectors exposing multiple interfaces like PCIe, SATA, UART, etc...
 
+config POWER_SEQUENCING_TEGRA_MODEM
+	tristate "NVIDIA Tegra modem power sequencing driver"
+	depends on ARCH_TEGRA && USB_NET_XMM6260 && USB_SUPPORT
+	help
+	  Enable this to support power sequence for XMM6260 modem found in
+	  various Tegra devices with cellular capabilities, like
+	  LG Optimus 4X P880, LG Optimus Vu P895, Google Nexus 7 (2012) 3G
+	  and ASUS Transformer Pad 3G TF300TG.
+
+	  To compile this driver as a module, choose M here: the module will
+	  be called pwrseq-tegra-modem.
+
 endif
drivers/power/sequencing/Makefile +1 -0
index 0911d4618298..c36be7edb8ca 100644
@@ -6,3 +6,4 @@ pwrseq-core-y				:= core.o
 obj-$(CONFIG_POWER_SEQUENCING_QCOM_WCN)	+= pwrseq-qcom-wcn.o
 obj-$(CONFIG_POWER_SEQUENCING_TH1520_GPU) += pwrseq-thead-gpu.o
 obj-$(CONFIG_POWER_SEQUENCING_PCIE_M2)	+= pwrseq-pcie-m2.o
+obj-$(CONFIG_POWER_SEQUENCING_TEGRA_MODEM) += pwrseq-tegra-modem.o
drivers/power/sequencing/pwrseq-tegra-modem.c new file +209 -0

209 lines not on this page · raw message

Signature · 1 line
2.51.0
#20 lore raw
Thank you for your contribution! Sashiko AI review found 6 potential issue(s) to consider: - [High] Hijacking and modifying the private state of the `tegra-usb` driver causes resource conflicts…

Thank you for your contribution! Sashiko AI review found 6 potential issue(s) to consider:
- [High] Hijacking and modifying the private state of the tegra-usb driver causes resource conflicts, memory leaks, and double-frees.
- [High] Missing device link allows the provider driver to unbind, leaving a dangling pointer.
- [High] Storing an ERR_PTR in usb->dev guarantees a crash during device removal.
- [High] Blindly casting driver data of an arbitrary platform device to struct tegra_usb * without validating the device type.
- [Low] Dereferencing incomplete type struct tegra_usb causes a compilation error.
- [Low] The Kconfig symbol depends on a non-existent symbol USB_NET_XMM6260.
--

commit 5c2fd594a3aa6ab625a68ba4bb3f25750e538e63
Author: Svyatoslav Ryhel <[email protected]>

power: sequencing: Add support for Nvidia Tegra modem pwrseq

Nvidia Tegra modem power sequence is a set of configurations used in Tegra SoCs to provide proper interaction between the application processor and the modem, as well as control over one of the SoC's USB lines for the modem.

drivers/power/sequencing/Kconfig config POWER_SEQUENCING_PCIE_M2 · line 51

Quoted 11 lines
drivers/power/sequencing/Kconfig +3 -0
index 1c5f5820f5b76..e04a6bacb476f 100644
@@ -46,4 +46,16 @@ config POWER_SEQUENCING_PCIE_M2
 	  connectors. This driver handles the power sequencing for the M.2
 	  connectors exposing multiple interfaces like PCIe, SATA, UART, etc...
 
+config POWER_SEQUENCING_TEGRA_MODEM
+	tristate "NVIDIA Tegra modem power sequencing driver"
+	depends on ARCH_TEGRA && USB_NET_XMM6260 && USB_SUPPORT

[Severity: Low]
Does the USB_NET_XMM6260 config symbol exist in the kernel tree? If this symbol is not present, this driver will be permanently disabled due to an unsatisfied dependency.

Quoted 5 lines
drivers/power/sequencing/Kconfig +5 -0
+	help
+	  Enable this to support power sequence for XMM6260 modem found in
+	  various Tegra devices with cellular capabilities, like
+	  LG Optimus 4X P880, LG Optimus Vu P895, Google Nexus 7 (2012) 3G
+	  and ASUS Transformer Pad 3G TF300TG.

[ ... ]

Quoted 10 lines
drivers/power/sequencing/pwrseq-tegra-modem.c new file +4 -0
new file mode 100644
index 0000000000000..0b212ec8b643e
@@ -0,0 +1,209 @@
+// SPDX-License-Identifier: GPL-2.0-only
+
+#include <linux/delay.h>
+#include <linux/device.h>

[ ... ]

Quoted 10 lines
drivers/power/sequencing/pwrseq-tegra-modem.c new file +10 -0
+struct pwrseq_tegra_modem_ctx {
+	struct device *dev;
+	struct pwrseq_device *pwrseq;
+
+	struct gpio_desc *enable_gpio;
+	struct regulator *power_supply;
+
+	struct platform_device *usb_dev;
+	struct tegra_usb *usb;
+};

[ ... ]

drivers/power/sequencing/pwrseq-tegra-modem.c line 66

Quoted 12 lines
drivers/power/sequencing/pwrseq-tegra-modem.c new file +12 -0
+static int pwrseq_tegra_modem_enable(struct pwrseq_device *pwrseq)
+{
+	struct pwrseq_tegra_modem_ctx *ctx = pwrseq_device_get_drvdata(pwrseq);
+	struct tegra_usb *usb = ctx->usb;
+	int ret;
+
+	/*
+	 * USB controller registers shouldn't be touched before PHY is
+	 * initialized, otherwise CPU will hang because clocks are gated.
+	 * PHY driver controls gating of internal USB clocks on Tegra.
+	 */
+	ret = usb_phy_init(usb->phy);

[Severity: Low]
Is struct tegra_usb defined in a public header? It appears to be a private structure defined only in drivers/usb/chipidea/ci_hdrc_tegra.c. Will accessing usb->phy here cause a compilation error due to dereferencing an incomplete type?

drivers/power/sequencing/pwrseq-tegra-modem.c line 75

Quoted 9 lines
drivers/power/sequencing/pwrseq-tegra-modem.c new file +9 -0
+	if (ret) {
+		dev_err(ctx->dev, "failed to init USB PHY\n");
+		return ret;
+	}
+
+	usb->dev = ci_hdrc_add_device(&ctx->usb_dev->dev,
+				      ctx->usb_dev->resource,
+				      ctx->usb_dev->num_resources,
+				      &usb->data);

[Severity: High]
Does modifying the tegra-usb driver's private state directly create resource conflicts?

If tegra_usb_probe() already initialized the PHY and registered a child device, calling ci_hdrc_add_device() here and overwriting usb->dev could leak the originally registered device. Furthermore, if both drivers independently attempt to call ci_hdrc_remove_device(usb->dev) during teardown, could this lead to use-after-free and double-free bugs?

drivers/power/sequencing/pwrseq-tegra-modem.c line 76

Quoted 1 line
drivers/power/sequencing/pwrseq-tegra-modem.c new file +1 -0
+	if (IS_ERR(usb->dev)) {

[Severity: High]
If ci_hdrc_add_device() fails, usb->dev is left containing an ERR_PTR. If the tegra-usb driver is subsequently unbound, its remove path:

tegra_usb_remove()
ci_hdrc_remove_device(usb->dev)

will unconditionally dereference this pointer since it expects a valid device. Could this lead to a fatal invalid pointer dereference?

Quoted 9 lines
drivers/power/sequencing/pwrseq-tegra-modem.c new file +9 -0
+		usb_phy_shutdown(usb->phy);
+		dev_err(ctx->dev, "failed to register USB controller\n");
+		return PTR_ERR(usb->dev);
+	}
+
+	gpiod_set_value_cansleep(ctx->enable_gpio, 1);
+
+	return 0;
+}

[ ... ]

Quoted 31 lines
drivers/power/sequencing/pwrseq-tegra-modem.c new file +31 -0
+static int pwrseq_tegra_modem_probe(struct platform_device *pdev)
+{
+	struct device *dev = &pdev->dev;
+	struct device_node *usb_node;
+	struct pwrseq_tegra_modem_ctx *ctx;
+	struct pwrseq_config config = { };
+	int ret;
+
+	ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
+	if (!ctx)
+		return -ENOMEM;
+
+	ctx->dev = dev;
+
+	ctx->enable_gpio = devm_gpiod_get_optional(dev, "enable",
+						   GPIOD_OUT_LOW);
+	if (IS_ERR(ctx->enable_gpio))
+		return dev_err_probe(dev, PTR_ERR(ctx->enable_gpio),
+				     "failed to get enable GPIO\n");
+
+	ctx->power_supply = devm_regulator_get(dev, "power");
+	if (IS_ERR(ctx->power_supply))
+		return dev_err_probe(dev, PTR_ERR(ctx->power_supply),
+				     "failed to get power supply\n");
+
+	usb_node = of_parse_phandle(dev->of_node, "nvidia,usb-bus", 0);
+	if (!usb_node)
+		return dev_err_probe(dev, -ENODEV,
+				     "failed to parse modem USB bus\n");
+
+	ctx->usb_dev = of_find_device_by_node(usb_node);

drivers/power/sequencing/pwrseq-tegra-modem.c line 174

Quoted 10 lines
drivers/power/sequencing/pwrseq-tegra-modem.c new file +10 -0
+	of_node_put(usb_node);
+	if (!ctx->usb_dev)
+		return -EPROBE_DEFER;
+
+	ret = devm_add_action_or_reset(dev, pwrseq_tegra_modem_put_device,
+				       &ctx->usb_dev->dev);
+	if (ret)
+		return ret;
+
+	ctx->usb = platform_get_drvdata(ctx->usb_dev);

[Severity: High]
Is it safe to cast the driver data of this platform device to struct tegra_usb * without first verifying the device type (for example, by checking its compatible string)?

If the phandle incorrectly points to an unrelated device, ctx->usb will point to the wrong driver data. Could this cause type confusion and crashes when fields like usb->phy are accessed later?

[Severity: High]
Should there be a device link established here using device_link_add() to enforce a consumer-supplier relationship?

Without a device link, the tegra-usb driver can be unbound at any time. If unbound, the devres-managed struct tegra_usb is freed. Would this leave ctx->usb as a dangling pointer, leading to a use-after-free during subsequent power sequence operations?

Quoted 5 lines
drivers/power/sequencing/pwrseq-tegra-modem.c new file +5 -0
+	if (!ctx->usb)
+		return -EPROBE_DEFER;
+
+	config.parent = dev;
+	config.owner = THIS_MODULE;

[ ... ]

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
#21 lore raw
In reply to Svyatoslav Ryhel

сб, 23 трав. 2026 р. о 11:51 Svyatoslav Ryhel <[email protected]> пише:

Quoted 25 lines

Patchset implements support for the Tegra-specific modem powerseqence, which handles the registration and unregistration of the USB controller.

This patchset is a part of larger series aiming to bring XMM6260 modem support for Tegra devices:
https://lore.kernel.org/lkml/[email protected]/

---
Changes in v2:
- previous phy driver reshaped into pwrseq driver
---

Svyatoslav Ryhel (2):
dt-bindings: soc: tegra: Document Nvidia Tegra modem pwrseq
power: sequencing: Add support for Nvidia Tegra modem pwrseq

 .../soc/tegra/nvidia,tegra-modem-pwrseq.yaml  |  49 ++++
 drivers/power/sequencing/Kconfig              |  12 +
 drivers/power/sequencing/Makefile             |   1 +
 drivers/power/sequencing/pwrseq-tegra-modem.c | 209 ++++++++++++++++++
 4 files changed, 271 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/soc/tegra/nvidia,tegra-modem-pwrseq.yaml
 create mode 100644 drivers/power/sequencing/pwrseq-tegra-modem.c
Quoted 3 lines

--
2.51.0

Hello there! There will be no v3. Sorry for disturbing LKML with 15 year old obsolete tech. My mistake.