* [PATCH] usb: typec: ucsi: Skip setting orientation for UCSI version 2.0 and above
@ 2025-10-28 14:39 Abel Vesa
2025-10-28 14:59 ` Neil Armstrong
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Abel Vesa @ 2025-10-28 14:39 UTC (permalink / raw)
To: Heikki Krogerus, Greg Kroah-Hartman
Cc: Bjorn Andersson, Konrad Dybcio, Dmitry Baryshkov, linux-arm-msm,
linux-usb, linux-kernel, Abel Vesa
In case of UCSI version 2.0 and above, if the orientation is set from
glink as well, it will trigger the consumers along the graph (PHYs,
repeaters and so on) to reconfigure a second time. This might break
the consumer drivers which aren't currently implemented to drop the
second request of setting the same orientation.
So lets leave the orientation setting to the UCSI generic implementation
for all platform that implement UCSI spec 2.0 and above.
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
---
drivers/usb/typec/ucsi/ucsi_glink.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/usb/typec/ucsi/ucsi_glink.c b/drivers/usb/typec/ucsi/ucsi_glink.c
index 11b3e24e34e2b4c21df20b6bec69619a0292c7bb..e68fd3fd0f54bfa3c5998519b17cf187bb363ec8 100644
--- a/drivers/usb/typec/ucsi/ucsi_glink.c
+++ b/drivers/usb/typec/ucsi/ucsi_glink.c
@@ -209,6 +209,10 @@ static void pmic_glink_ucsi_connector_status(struct ucsi_connector *con)
struct pmic_glink_ucsi *ucsi = ucsi_get_drvdata(con->ucsi);
int orientation;
+ /* For UCSI 2.0 and above, orientation is part of UCSI payload */
+ if (ucsi->ucsi->version >= UCSI_VERSION_2_0)
+ return;
+
if (!UCSI_CONSTAT(con, CONNECTED)) {
typec_set_orientation(con->port, TYPEC_ORIENTATION_NONE);
return;
---
base-commit: f7d2388eeec24966fc4d5cf32d706f0514f29ac5
change-id: 20251028-ucsi-glink-skip-orientation-for-ucsi-v2-6d52c6644d46
Best regards,
--
Abel Vesa <abel.vesa@linaro.org>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] usb: typec: ucsi: Skip setting orientation for UCSI version 2.0 and above
2025-10-28 14:39 [PATCH] usb: typec: ucsi: Skip setting orientation for UCSI version 2.0 and above Abel Vesa
@ 2025-10-28 14:59 ` Neil Armstrong
2025-10-28 15:19 ` Abel Vesa
2025-10-28 15:30 ` Dmitry Baryshkov
2 siblings, 0 replies; 8+ messages in thread
From: Neil Armstrong @ 2025-10-28 14:59 UTC (permalink / raw)
To: Abel Vesa, Heikki Krogerus, Greg Kroah-Hartman
Cc: Bjorn Andersson, Konrad Dybcio, Dmitry Baryshkov, linux-arm-msm,
linux-usb, linux-kernel
On 10/28/25 15:39, Abel Vesa wrote:
> In case of UCSI version 2.0 and above, if the orientation is set from
> glink as well, it will trigger the consumers along the graph (PHYs,
> repeaters and so on) to reconfigure a second time. This might break
> the consumer drivers which aren't currently implemented to drop the
> second request of setting the same orientation.
>
> So lets leave the orientation setting to the UCSI generic implementation
> for all platform that implement UCSI spec 2.0 and above.
>
> Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
> ---
> drivers/usb/typec/ucsi/ucsi_glink.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/usb/typec/ucsi/ucsi_glink.c b/drivers/usb/typec/ucsi/ucsi_glink.c
> index 11b3e24e34e2b4c21df20b6bec69619a0292c7bb..e68fd3fd0f54bfa3c5998519b17cf187bb363ec8 100644
> --- a/drivers/usb/typec/ucsi/ucsi_glink.c
> +++ b/drivers/usb/typec/ucsi/ucsi_glink.c
> @@ -209,6 +209,10 @@ static void pmic_glink_ucsi_connector_status(struct ucsi_connector *con)
> struct pmic_glink_ucsi *ucsi = ucsi_get_drvdata(con->ucsi);
> int orientation;
>
> + /* For UCSI 2.0 and above, orientation is part of UCSI payload */
> + if (ucsi->ucsi->version >= UCSI_VERSION_2_0)
> + return;
> +
> if (!UCSI_CONSTAT(con, CONNECTED)) {
> typec_set_orientation(con->port, TYPEC_ORIENTATION_NONE);
> return;
>
> ---
> base-commit: f7d2388eeec24966fc4d5cf32d706f0514f29ac5
> change-id: 20251028-ucsi-glink-skip-orientation-for-ucsi-v2-6d52c6644d46
>
> Best regards,
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] usb: typec: ucsi: Skip setting orientation for UCSI version 2.0 and above
2025-10-28 14:39 [PATCH] usb: typec: ucsi: Skip setting orientation for UCSI version 2.0 and above Abel Vesa
2025-10-28 14:59 ` Neil Armstrong
@ 2025-10-28 15:19 ` Abel Vesa
2025-10-28 15:30 ` Dmitry Baryshkov
2025-10-28 15:30 ` Dmitry Baryshkov
2 siblings, 1 reply; 8+ messages in thread
From: Abel Vesa @ 2025-10-28 15:19 UTC (permalink / raw)
To: Heikki Krogerus, Greg Kroah-Hartman
Cc: Bjorn Andersson, Konrad Dybcio, Dmitry Baryshkov, linux-arm-msm,
linux-usb, linux-kernel
On 25-10-28 16:39:19, Abel Vesa wrote:
> In case of UCSI version 2.0 and above, if the orientation is set from
> glink as well, it will trigger the consumers along the graph (PHYs,
> repeaters and so on) to reconfigure a second time. This might break
> the consumer drivers which aren't currently implemented to drop the
> second request of setting the same orientation.
>
> So lets leave the orientation setting to the UCSI generic implementation
> for all platform that implement UCSI spec 2.0 and above.
>
> Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
Ignore this one please, as it is incomplete.
We need to also set the orientation_aware in pmic_glink_ucsi_update_connector()
if the ucsi version is at least 2.0.
Will do and respin.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] usb: typec: ucsi: Skip setting orientation for UCSI version 2.0 and above
2025-10-28 14:39 [PATCH] usb: typec: ucsi: Skip setting orientation for UCSI version 2.0 and above Abel Vesa
2025-10-28 14:59 ` Neil Armstrong
2025-10-28 15:19 ` Abel Vesa
@ 2025-10-28 15:30 ` Dmitry Baryshkov
2025-10-28 16:26 ` Abel Vesa
2 siblings, 1 reply; 8+ messages in thread
From: Dmitry Baryshkov @ 2025-10-28 15:30 UTC (permalink / raw)
To: Abel Vesa
Cc: Heikki Krogerus, Greg Kroah-Hartman, Bjorn Andersson,
Konrad Dybcio, Dmitry Baryshkov, linux-arm-msm, linux-usb,
linux-kernel
On Tue, Oct 28, 2025 at 04:39:19PM +0200, Abel Vesa wrote:
> In case of UCSI version 2.0 and above, if the orientation is set from
> glink as well, it will trigger the consumers along the graph (PHYs,
> repeaters and so on) to reconfigure a second time. This might break
> the consumer drivers which aren't currently implemented to drop the
> second request of setting the same orientation.
Might or breaks? What happens if the driver doesn't ignore the request?
>
> So lets leave the orientation setting to the UCSI generic implementation
> for all platform that implement UCSI spec 2.0 and above.
>
> Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
> ---
> drivers/usb/typec/ucsi/ucsi_glink.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] usb: typec: ucsi: Skip setting orientation for UCSI version 2.0 and above
2025-10-28 15:19 ` Abel Vesa
@ 2025-10-28 15:30 ` Dmitry Baryshkov
2025-10-28 15:37 ` Abel Vesa
0 siblings, 1 reply; 8+ messages in thread
From: Dmitry Baryshkov @ 2025-10-28 15:30 UTC (permalink / raw)
To: Abel Vesa
Cc: Heikki Krogerus, Greg Kroah-Hartman, Bjorn Andersson,
Konrad Dybcio, Dmitry Baryshkov, linux-arm-msm, linux-usb,
linux-kernel
On Tue, Oct 28, 2025 at 05:19:58PM +0200, Abel Vesa wrote:
> On 25-10-28 16:39:19, Abel Vesa wrote:
> > In case of UCSI version 2.0 and above, if the orientation is set from
> > glink as well, it will trigger the consumers along the graph (PHYs,
> > repeaters and so on) to reconfigure a second time. This might break
> > the consumer drivers which aren't currently implemented to drop the
> > second request of setting the same orientation.
> >
> > So lets leave the orientation setting to the UCSI generic implementation
> > for all platform that implement UCSI spec 2.0 and above.
> >
> > Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
>
> Ignore this one please, as it is incomplete.
>
> We need to also set the orientation_aware in pmic_glink_ucsi_update_connector()
> if the ucsi version is at least 2.0.
Note, I think it should be set in the core rather than setting it in the
driver.
>
> Will do and respin.
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] usb: typec: ucsi: Skip setting orientation for UCSI version 2.0 and above
2025-10-28 15:30 ` Dmitry Baryshkov
@ 2025-10-28 15:37 ` Abel Vesa
2025-10-28 15:44 ` Abel Vesa
0 siblings, 1 reply; 8+ messages in thread
From: Abel Vesa @ 2025-10-28 15:37 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: Heikki Krogerus, Greg Kroah-Hartman, Bjorn Andersson,
Konrad Dybcio, Dmitry Baryshkov, linux-arm-msm, linux-usb,
linux-kernel
On 25-10-28 17:30:37, Dmitry Baryshkov wrote:
> On Tue, Oct 28, 2025 at 05:19:58PM +0200, Abel Vesa wrote:
> > On 25-10-28 16:39:19, Abel Vesa wrote:
> > > In case of UCSI version 2.0 and above, if the orientation is set from
> > > glink as well, it will trigger the consumers along the graph (PHYs,
> > > repeaters and so on) to reconfigure a second time. This might break
> > > the consumer drivers which aren't currently implemented to drop the
> > > second request of setting the same orientation.
> > >
> > > So lets leave the orientation setting to the UCSI generic implementation
> > > for all platform that implement UCSI spec 2.0 and above.
> > >
> > > Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
> >
> > Ignore this one please, as it is incomplete.
> >
> > We need to also set the orientation_aware in pmic_glink_ucsi_update_connector()
> > if the ucsi version is at least 2.0.
>
> Note, I think it should be set in the core rather than setting it in the
> driver.
Yep. I agree.
That's what I'm doing next.
So ignore my earlier comment. :-)
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] usb: typec: ucsi: Skip setting orientation for UCSI version 2.0 and above
2025-10-28 15:37 ` Abel Vesa
@ 2025-10-28 15:44 ` Abel Vesa
0 siblings, 0 replies; 8+ messages in thread
From: Abel Vesa @ 2025-10-28 15:44 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: Heikki Krogerus, Greg Kroah-Hartman, Bjorn Andersson,
Konrad Dybcio, Dmitry Baryshkov, linux-arm-msm, linux-usb,
linux-kernel
On 25-10-28 17:37:45, Abel Vesa wrote:
> On 25-10-28 17:30:37, Dmitry Baryshkov wrote:
> > On Tue, Oct 28, 2025 at 05:19:58PM +0200, Abel Vesa wrote:
> > > On 25-10-28 16:39:19, Abel Vesa wrote:
> > > > In case of UCSI version 2.0 and above, if the orientation is set from
> > > > glink as well, it will trigger the consumers along the graph (PHYs,
> > > > repeaters and so on) to reconfigure a second time. This might break
> > > > the consumer drivers which aren't currently implemented to drop the
> > > > second request of setting the same orientation.
> > > >
> > > > So lets leave the orientation setting to the UCSI generic implementation
> > > > for all platform that implement UCSI spec 2.0 and above.
> > > >
> > > > Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
> > >
> > > Ignore this one please, as it is incomplete.
> > >
> > > We need to also set the orientation_aware in pmic_glink_ucsi_update_connector()
> > > if the ucsi version is at least 2.0.
> >
> > Note, I think it should be set in the core rather than setting it in the
> > driver.
>
> Yep. I agree.
>
> That's what I'm doing next.
There you go:
https://lore.kernel.org/r/20251028-b4-ucsi-set-orientation-aware-on-version-2-and-above-v1-1-d3425f5679af@linaro.org
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] usb: typec: ucsi: Skip setting orientation for UCSI version 2.0 and above
2025-10-28 15:30 ` Dmitry Baryshkov
@ 2025-10-28 16:26 ` Abel Vesa
0 siblings, 0 replies; 8+ messages in thread
From: Abel Vesa @ 2025-10-28 16:26 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: Heikki Krogerus, Greg Kroah-Hartman, Bjorn Andersson,
Konrad Dybcio, Dmitry Baryshkov, linux-arm-msm, linux-usb,
linux-kernel
On 25-10-28 17:30:08, Dmitry Baryshkov wrote:
> On Tue, Oct 28, 2025 at 04:39:19PM +0200, Abel Vesa wrote:
> > In case of UCSI version 2.0 and above, if the orientation is set from
> > glink as well, it will trigger the consumers along the graph (PHYs,
> > repeaters and so on) to reconfigure a second time. This might break
> > the consumer drivers which aren't currently implemented to drop the
> > second request of setting the same orientation.
>
> Might or breaks? What happens if the driver doesn't ignore the request?
So I do not have a very specific usecase in mind, but my point is more
about complex LTTPRs or repeaters which might misbehave if you trigger
multiple orientation setting.
Anyway, we currently do so on platforms where orientation is determined
by a gpio level. So I think requesting multiple same orientation settings
is definitely not a problem currently.
I still think we should stick to the UCSI payload value if available,
and ignore everything else.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2025-10-28 16:26 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-28 14:39 [PATCH] usb: typec: ucsi: Skip setting orientation for UCSI version 2.0 and above Abel Vesa
2025-10-28 14:59 ` Neil Armstrong
2025-10-28 15:19 ` Abel Vesa
2025-10-28 15:30 ` Dmitry Baryshkov
2025-10-28 15:37 ` Abel Vesa
2025-10-28 15:44 ` Abel Vesa
2025-10-28 15:30 ` Dmitry Baryshkov
2025-10-28 16:26 ` Abel Vesa
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®