* [PATCH v2] phy: exynos5-usbdrd: Fix broken USB on Exynos5422 (TYPEC dependency)
@ 2025-02-16 11:41 Krzysztof Kozlowski
2025-02-16 11:45 ` Krzysztof Kozlowski
2025-02-17 5:59 ` André Draszik
0 siblings, 2 replies; 4+ messages in thread
From: Krzysztof Kozlowski @ 2025-02-16 11:41 UTC (permalink / raw)
To: Vinod Koul, Kishon Vijay Abraham I, Krzysztof Kozlowski,
Alim Akhtar, André Draszik, Peter Griffin, linux-phy,
linux-kernel, linux-arm-kernel, linux-samsung-soc
Cc: Krzysztof Kozlowski, Marek Szyprowski
Older Exynos designs, like Exynos5422, do not have USB Type-C and the
USB DRD PHY does not really depend on Type-C for these devices at all.
Incorrectly added optional dependency on CONFIG_TYPEC caused this driver
to be missing for exynos_defconfig and as result Exynos5422-based boards
like Hardkernel Odroid HC1 failed to probe USB.
However ARM64 boards should have CONFIG_TYPEC enabled and in proper
state (e.g. =y when PHY_EXYNOS5_USBDRD is =y) for proper USB support on
Google GS101 boards.
Add itermediate CONFIG_PHY_EXYNOS5_USBDRD_TYPEC symbol to skip TYPEC on
older boards, while still expressing optional dependency.
Reported-by: Krzysztof Kozlowski <krzk@kernel.org>
Closes: https://krzk.eu/#/builders/21/builds/6139
Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
Closes: https://lore.kernel.org/all/3c0b77e6-357d-453e-8b63-4757c3231bde@samsung.com/
Fixes: 09dc674295a3 ("phy: exynos5-usbdrd: subscribe to orientation notifier if required")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
Patch for issue in linux-next
Changes in v2:
1. Add PHY_EXYNOS5_USBDRD_TYPEC, so arm64 defconfig will have both
symbols in-sync
---
drivers/phy/samsung/Kconfig | 12 +++++++++++-
drivers/phy/samsung/phy-exynos5-usbdrd.c | 1 +
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/drivers/phy/samsung/Kconfig b/drivers/phy/samsung/Kconfig
index 7fba571c0e2b..b20ac6b75993 100644
--- a/drivers/phy/samsung/Kconfig
+++ b/drivers/phy/samsung/Kconfig
@@ -77,12 +77,22 @@ config PHY_S5PV210_USB2
particular SoC is compiled in the driver. In case of S5PV210 two phys
are available - device and host.
+# None of ARM32 Samsung boards use Type-C, however newer ARM64 do and
+# PHY_EXYNOS5_USBDRD driver needs TYPEC to be in a matching state to avoid link
+# failures (see optional dependencies in kconfig-language.rst). Intermediate
+# PHY_EXYNOS5_USBDRD_TYPEC symbol allows to skip TYPEC on ARM32 boards.
+config PHY_EXYNOS5_USBDRD_TYPEC
+ tristate
+ depends on ARCH_EXYNOS
+ depends on ARM || TYPEC || !TYPEC
+ default y
+
config PHY_EXYNOS5_USBDRD
tristate "Exynos5 SoC series USB DRD PHY driver"
depends on (ARCH_EXYNOS && OF) || COMPILE_TEST
depends on HAS_IOMEM
- depends on TYPEC || (TYPEC=n && COMPILE_TEST)
depends on USB_DWC3_EXYNOS
+ depends on PHY_EXYNOS5_USBDRD_TYPEC
select GENERIC_PHY
select MFD_SYSCON
default y
diff --git a/drivers/phy/samsung/phy-exynos5-usbdrd.c b/drivers/phy/samsung/phy-exynos5-usbdrd.c
index ff2436f11d68..6d571dff2898 100644
--- a/drivers/phy/samsung/phy-exynos5-usbdrd.c
+++ b/drivers/phy/samsung/phy-exynos5-usbdrd.c
@@ -1456,6 +1456,7 @@ static int exynos5_usbdrd_setup_notifiers(struct exynos5_usbdrd_phy *phy_drd)
{
int ret;
+ /* See CONFIG_PHY_EXYNOS5_USBDRD_TYPEC */
if (!IS_ENABLED(CONFIG_TYPEC))
return 0;
--
2.43.0
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v2] phy: exynos5-usbdrd: Fix broken USB on Exynos5422 (TYPEC dependency)
2025-02-16 11:41 [PATCH v2] phy: exynos5-usbdrd: Fix broken USB on Exynos5422 (TYPEC dependency) Krzysztof Kozlowski
@ 2025-02-16 11:45 ` Krzysztof Kozlowski
2025-02-17 5:59 ` André Draszik
1 sibling, 0 replies; 4+ messages in thread
From: Krzysztof Kozlowski @ 2025-02-16 11:45 UTC (permalink / raw)
To: Vinod Koul, Kishon Vijay Abraham I, Krzysztof Kozlowski,
Alim Akhtar, André Draszik, Peter Griffin, linux-phy,
linux-kernel, linux-arm-kernel, linux-samsung-soc
Cc: Marek Szyprowski
On 16/02/2025 12:41, Krzysztof Kozlowski wrote:
> +
> config PHY_EXYNOS5_USBDRD
> tristate "Exynos5 SoC series USB DRD PHY driver"
> depends on (ARCH_EXYNOS && OF) || COMPILE_TEST
> depends on HAS_IOMEM
> - depends on TYPEC || (TYPEC=n && COMPILE_TEST)
> depends on USB_DWC3_EXYNOS
> + depends on PHY_EXYNOS5_USBDRD_TYPEC
This probably should be COMPILE_TEST to preserve previous compile
testing options on !ARCH_EXYNOS
Best regards,
Krzysztof
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] phy: exynos5-usbdrd: Fix broken USB on Exynos5422 (TYPEC dependency)
2025-02-16 11:41 [PATCH v2] phy: exynos5-usbdrd: Fix broken USB on Exynos5422 (TYPEC dependency) Krzysztof Kozlowski
2025-02-16 11:45 ` Krzysztof Kozlowski
@ 2025-02-17 5:59 ` André Draszik
2025-02-17 9:03 ` Krzysztof Kozlowski
1 sibling, 1 reply; 4+ messages in thread
From: André Draszik @ 2025-02-17 5:59 UTC (permalink / raw)
To: Krzysztof Kozlowski, Vinod Koul, Kishon Vijay Abraham I,
Krzysztof Kozlowski, Alim Akhtar, Peter Griffin, linux-phy,
linux-kernel, linux-arm-kernel, linux-samsung-soc
Cc: Marek Szyprowski
Hi Krzysztof,
On Sun, 2025-02-16 at 12:41 +0100, Krzysztof Kozlowski wrote:
> Older Exynos designs, like Exynos5422, do not have USB Type-C and the
> USB DRD PHY does not really depend on Type-C for these devices at all.
> Incorrectly added optional dependency on CONFIG_TYPEC caused this driver
> to be missing for exynos_defconfig and as result Exynos5422-based boards
> like Hardkernel Odroid HC1 failed to probe USB.
>
> However ARM64 boards should have CONFIG_TYPEC enabled and in proper
> state (e.g. =y when PHY_EXYNOS5_USBDRD is =y) for proper USB support on
> Google GS101 boards.
>
> Add itermediate CONFIG_PHY_EXYNOS5_USBDRD_TYPEC symbol to skip TYPEC on
> older boards, while still expressing optional dependency.
>
> Reported-by: Krzysztof Kozlowski <krzk@kernel.org>
> Closes: https://krzk.eu/#/builders/21/builds/6139
> Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
> Closes: https://lore.kernel.org/all/3c0b77e6-357d-453e-8b63-4757c3231bde@samsung.com/
> Fixes: 09dc674295a3 ("phy: exynos5-usbdrd: subscribe to orientation notifier if required")
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>
> ---
>
> Patch for issue in linux-next
>
> Changes in v2:
> 1. Add PHY_EXYNOS5_USBDRD_TYPEC, so arm64 defconfig will have both
> symbols in-sync
> ---
> drivers/phy/samsung/Kconfig | 12 +++++++++++-
> drivers/phy/samsung/phy-exynos5-usbdrd.c | 1 +
> 2 files changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/phy/samsung/Kconfig b/drivers/phy/samsung/Kconfig
> index 7fba571c0e2b..b20ac6b75993 100644
> --- a/drivers/phy/samsung/Kconfig
> +++ b/drivers/phy/samsung/Kconfig
> @@ -77,12 +77,22 @@ config PHY_S5PV210_USB2
> particular SoC is compiled in the driver. In case of S5PV210 two phys
> are available - device and host.
>
> +# None of ARM32 Samsung boards use Type-C, however newer ARM64 do and
> +# PHY_EXYNOS5_USBDRD driver needs TYPEC to be in a matching state to avoid link
> +# failures (see optional dependencies in kconfig-language.rst). Intermediate
> +# PHY_EXYNOS5_USBDRD_TYPEC symbol allows to skip TYPEC on ARM32 boards.
> +config PHY_EXYNOS5_USBDRD_TYPEC
> + tristate
> + depends on ARCH_EXYNOS
> + depends on ARM || TYPEC || !TYPEC
> + default y
> +
> config PHY_EXYNOS5_USBDRD
> tristate "Exynos5 SoC series USB DRD PHY driver"
> depends on (ARCH_EXYNOS && OF) || COMPILE_TEST
> depends on HAS_IOMEM
> - depends on TYPEC || (TYPEC=n && COMPILE_TEST)
Is it not possible to just drop the '&& COMPILE_TEST' part to make
it
depends on TYPEC || TYPEC=n
or
depends on TYPEC || !TYPEC
(without any of the other changes)?
If not, why not, are there corner cases that doesn't catch? Some
minimal testing seems to suggest that that works, too.
Cheers,
Andre'
> depends on USB_DWC3_EXYNOS
> + depends on PHY_EXYNOS5_USBDRD_TYPEC
> select GENERIC_PHY
> select MFD_SYSCON
> default y
> diff --git a/drivers/phy/samsung/phy-exynos5-usbdrd.c b/drivers/phy/samsung/phy-exynos5-usbdrd.c
> index ff2436f11d68..6d571dff2898 100644
> --- a/drivers/phy/samsung/phy-exynos5-usbdrd.c
> +++ b/drivers/phy/samsung/phy-exynos5-usbdrd.c
> @@ -1456,6 +1456,7 @@ static int exynos5_usbdrd_setup_notifiers(struct exynos5_usbdrd_phy *phy_drd)
> {
> int ret;
>
> + /* See CONFIG_PHY_EXYNOS5_USBDRD_TYPEC */
> if (!IS_ENABLED(CONFIG_TYPEC))
> return 0;
>
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] phy: exynos5-usbdrd: Fix broken USB on Exynos5422 (TYPEC dependency)
2025-02-17 5:59 ` André Draszik
@ 2025-02-17 9:03 ` Krzysztof Kozlowski
0 siblings, 0 replies; 4+ messages in thread
From: Krzysztof Kozlowski @ 2025-02-17 9:03 UTC (permalink / raw)
To: André Draszik, Krzysztof Kozlowski, Vinod Koul,
Kishon Vijay Abraham I, Alim Akhtar, Peter Griffin, linux-phy,
linux-kernel, linux-arm-kernel, linux-samsung-soc
Cc: Marek Szyprowski
On 17/02/2025 06:59, André Draszik wrote:
> Hi Krzysztof,
>
> On Sun, 2025-02-16 at 12:41 +0100, Krzysztof Kozlowski wrote:
>> Older Exynos designs, like Exynos5422, do not have USB Type-C and the
>> USB DRD PHY does not really depend on Type-C for these devices at all.
>> Incorrectly added optional dependency on CONFIG_TYPEC caused this driver
>> to be missing for exynos_defconfig and as result Exynos5422-based boards
>> like Hardkernel Odroid HC1 failed to probe USB.
>>
>> However ARM64 boards should have CONFIG_TYPEC enabled and in proper
>> state (e.g. =y when PHY_EXYNOS5_USBDRD is =y) for proper USB support on
>> Google GS101 boards.
>>
>> Add itermediate CONFIG_PHY_EXYNOS5_USBDRD_TYPEC symbol to skip TYPEC on
>> older boards, while still expressing optional dependency.
>>
>> Reported-by: Krzysztof Kozlowski <krzk@kernel.org>
>> Closes: https://krzk.eu/#/builders/21/builds/6139
>> Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
>> Closes: https://lore.kernel.org/all/3c0b77e6-357d-453e-8b63-4757c3231bde@samsung.com/
>> Fixes: 09dc674295a3 ("phy: exynos5-usbdrd: subscribe to orientation notifier if required")
>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>>
>> ---
>>
>> Patch for issue in linux-next
>>
>> Changes in v2:
>> 1. Add PHY_EXYNOS5_USBDRD_TYPEC, so arm64 defconfig will have both
>> symbols in-sync
>> ---
>> drivers/phy/samsung/Kconfig | 12 +++++++++++-
>> drivers/phy/samsung/phy-exynos5-usbdrd.c | 1 +
>> 2 files changed, 12 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/phy/samsung/Kconfig b/drivers/phy/samsung/Kconfig
>> index 7fba571c0e2b..b20ac6b75993 100644
>> --- a/drivers/phy/samsung/Kconfig
>> +++ b/drivers/phy/samsung/Kconfig
>> @@ -77,12 +77,22 @@ config PHY_S5PV210_USB2
>> particular SoC is compiled in the driver. In case of S5PV210 two phys
>> are available - device and host.
>>
>> +# None of ARM32 Samsung boards use Type-C, however newer ARM64 do and
>> +# PHY_EXYNOS5_USBDRD driver needs TYPEC to be in a matching state to avoid link
>> +# failures (see optional dependencies in kconfig-language.rst). Intermediate
>> +# PHY_EXYNOS5_USBDRD_TYPEC symbol allows to skip TYPEC on ARM32 boards.
>> +config PHY_EXYNOS5_USBDRD_TYPEC
>> + tristate
>> + depends on ARCH_EXYNOS
>> + depends on ARM || TYPEC || !TYPEC
>> + default y
>> +
>> config PHY_EXYNOS5_USBDRD
>> tristate "Exynos5 SoC series USB DRD PHY driver"
>> depends on (ARCH_EXYNOS && OF) || COMPILE_TEST
>> depends on HAS_IOMEM
>> - depends on TYPEC || (TYPEC=n && COMPILE_TEST)
>
> Is it not possible to just drop the '&& COMPILE_TEST' part to make
> it
> depends on TYPEC || TYPEC=n
> or
> depends on TYPEC || !TYPEC
> (without any of the other changes)?
>
> If not, why not, are there corner cases that doesn't catch? Some
> minimal testing seems to suggest that that works, too.
Yeah, I think I overcomplicated it. I wanted to make it really
independent from TYPEC on ARM, but that's not trivial and my patch fails
here.
Best regards,
Krzysztof
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-02-17 9:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-16 11:41 [PATCH v2] phy: exynos5-usbdrd: Fix broken USB on Exynos5422 (TYPEC dependency) Krzysztof Kozlowski
2025-02-16 11:45 ` Krzysztof Kozlowski
2025-02-17 5:59 ` André Draszik
2025-02-17 9:03 ` Krzysztof Kozlowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox