lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAA8EJpodS=x9BZwpnOLN2eOVA31pNy9YT7rJjVfKqAKJ7c3O_A@mail.gmail.com>
Date: Mon, 24 Jun 2024 16:08:20 +0300
From: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
To: neil.armstrong@...aro.org
Cc: Caleb Connolly <caleb.connolly@...aro.org>, Bjorn Andersson <andersson@...nel.org>, 
	Konrad Dybcio <konrad.dybcio@...aro.org>, Rob Herring <robh@...nel.org>, 
	Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>, linux-arm-msm@...r.kernel.org, 
	devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/3] arm64: dts: qcom: prefer host mode on dev boards

On Mon, 24 Jun 2024 at 15:33, <neil.armstrong@...aro.org> wrote:
>
> On 24/06/2024 14:31, Dmitry Baryshkov wrote:
> > On Mon, 24 Jun 2024 at 15:28, <neil.armstrong@...aro.org> wrote:
> >>
> >> On 24/06/2024 14:23, Caleb Connolly wrote:
> >>> Generally, when given the choice these boards should prefer host mode
> >>> since they're SBCs. When attached to a laptop (which is host-only) they
> >>> should still fall back to peripheral mode.
> >>
> >> It's really not what I observed on sm8550/sm8650 QRD/HDK, as the power
> >> is setup for peripheral by the bootloader and without an actual UCSI/PD
> >> negociation it would only be functionnal as peripheral mode.
> >>
> >> So this is definitely untrue on sm8450/sm8550/sm8650 HDK/QRD/MTP.
> >
> > But we now have the UCSI support for those platforms, don't we?
>
> UCSI doesn't care about role-switch-default-mode, it's the default
> fallback role to set when no role was explicitely set by UCSI.
>
> Setting host won't make it work because the power support is handled
> by the UCSI firmware. setting role-switch-default-mode = "host" will
> make the USB port unusable if UCSI fails to start since it's
> physically set to peripheral mode.

Let's not mix the source/sink and host/peripheral, those are
independent. But I see your point. Neither TCPM nor UCSI check this
property. So it seems it's incorrect to set it even for the TCPM
hosts.

>
> Neil
>
> >
> >>
> >> Neil
> >>
> >>>
> >>> Suggested-by: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>
> >>> Signed-off-by: Caleb Connolly <caleb.connolly@...aro.org>
> >>> ---
> >>>    arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts | 1 +
> >>>    arch/arm64/boot/dts/qcom/qrb2210-rb1.dts     | 4 ++++
> >>>    arch/arm64/boot/dts/qcom/qrb4210-rb2.dts     | 4 ++++
> >>>    arch/arm64/boot/dts/qcom/sm8150-hdk.dts      | 1 +
> >>>    arch/arm64/boot/dts/qcom/sm8350-hdk.dts      | 4 ++++
> >>>    arch/arm64/boot/dts/qcom/sm8450-hdk.dts      | 1 +
> >>>    arch/arm64/boot/dts/qcom/sm8550-hdk.dts      | 4 ++++
> >>>    arch/arm64/boot/dts/qcom/sm8550-mtp.dts      | 4 ++++
> >>>    arch/arm64/boot/dts/qcom/sm8550-qrd.dts      | 4 ++++
> >>>    arch/arm64/boot/dts/qcom/sm8650-hdk.dts      | 4 ++++
> >>>    arch/arm64/boot/dts/qcom/sm8650-mtp.dts      | 4 ++++
> >>>    arch/arm64/boot/dts/qcom/sm8650-qrd.dts      | 4 ++++
> >>>    12 files changed, 39 insertions(+)
> >>>
> >>> diff --git a/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts b/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts
> >>> index c4cde4328e3d..bac4ed5874b6 100644
> >>> --- a/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts
> >>> +++ b/arch/arm64/boot/dts/qcom/qcs6490-rb3gen2.dts
> >>> @@ -657,8 +657,9 @@ &usb_1 {
> >>>
> >>>    &usb_1_dwc3 {
> >>>        dr_mode = "otg";
> >>>        usb-role-switch;
> >>> +     role-switch-default-mode = "host";
> >>>    };
> >>>
> >>>    &usb_1_dwc3_hs {
> >>>        remote-endpoint = <&pmic_glink_hs_in>;
> >>> diff --git a/arch/arm64/boot/dts/qcom/qrb2210-rb1.dts b/arch/arm64/boot/dts/qcom/qrb2210-rb1.dts
> >>> index e19790464a11..bece4896ca23 100644
> >>> --- a/arch/arm64/boot/dts/qcom/qrb2210-rb1.dts
> >>> +++ b/arch/arm64/boot/dts/qcom/qrb2210-rb1.dts
> >>> @@ -593,8 +593,12 @@ &uart4 {
> >>>    &usb {
> >>>        status = "okay";
> >>>    };
> >>>
> >>> +&usb_dwc3 {
> >>> +     role-switch-default-mode = "host";
> >>> +};
> >>> +
> >>>    &usb_dwc3_hs {
> >>>        remote-endpoint = <&pm4125_hs_in>;
> >>>    };
> >>>
> >>> diff --git a/arch/arm64/boot/dts/qcom/qrb4210-rb2.dts b/arch/arm64/boot/dts/qcom/qrb4210-rb2.dts
> >>> index 1c7de7f2db79..17d36f0ef5ab 100644
> >>> --- a/arch/arm64/boot/dts/qcom/qrb4210-rb2.dts
> >>> +++ b/arch/arm64/boot/dts/qcom/qrb4210-rb2.dts
> >>> @@ -661,8 +661,12 @@ &uart4 {
> >>>    &usb {
> >>>        status = "okay";
> >>>    };
> >>>
> >>> +&usb_dwc3 {
> >>> +     role-switch-default-mode = "host";
> >>> +};
> >>> +
> >>>    &usb_dwc3_hs {
> >>>        remote-endpoint = <&pmi632_hs_in>;
> >>>    };
> >>>
> >>> diff --git a/arch/arm64/boot/dts/qcom/sm8150-hdk.dts b/arch/arm64/boot/dts/qcom/sm8150-hdk.dts
> >>> index bac08f00b303..fe548d795490 100644
> >>> --- a/arch/arm64/boot/dts/qcom/sm8150-hdk.dts
> >>> +++ b/arch/arm64/boot/dts/qcom/sm8150-hdk.dts
> >>> @@ -695,8 +695,9 @@ &usb_2 {
> >>>
> >>>    &usb_1_dwc3 {
> >>>        dr_mode = "otg";
> >>>        usb-role-switch;
> >>> +     role-switch-default-mode = "host";
> >>>    };
> >>>
> >>>    &usb_1_dwc3_hs {
> >>>        remote-endpoint = <&pm8150b_hs_in>;
> >>> diff --git a/arch/arm64/boot/dts/qcom/sm8350-hdk.dts b/arch/arm64/boot/dts/qcom/sm8350-hdk.dts
> >>> index e031ad4c19f4..20d5c54cfcf9 100644
> >>> --- a/arch/arm64/boot/dts/qcom/sm8350-hdk.dts
> >>> +++ b/arch/arm64/boot/dts/qcom/sm8350-hdk.dts
> >>> @@ -847,8 +847,12 @@ &ufs_mem_phy {
> >>>    &usb_1 {
> >>>        status = "okay";
> >>>    };
> >>>
> >>> +&usb_1_dwc3 {
> >>> +     role-switch-default-mode = "host";
> >>> +};
> >>> +
> >>>    &usb_1_dwc3_hs {
> >>>        remote-endpoint = <&pmic_glink_hs_in>;
> >>>    };
> >>>
> >>> diff --git a/arch/arm64/boot/dts/qcom/sm8450-hdk.dts b/arch/arm64/boot/dts/qcom/sm8450-hdk.dts
> >>> index a754b8fe9167..ebafcbe6859e 100644
> >>> --- a/arch/arm64/boot/dts/qcom/sm8450-hdk.dts
> >>> +++ b/arch/arm64/boot/dts/qcom/sm8450-hdk.dts
> >>> @@ -1098,8 +1098,9 @@ &usb_1 {
> >>>
> >>>    &usb_1_dwc3 {
> >>>        dr_mode = "otg";
> >>>        usb-role-switch;
> >>> +     role-switch-default-mode = "host";
> >>>    };
> >>>
> >>>    &usb_1_dwc3_hs {
> >>>        remote-endpoint = <&pmic_glink_hs_in>;
> >>> diff --git a/arch/arm64/boot/dts/qcom/sm8550-hdk.dts b/arch/arm64/boot/dts/qcom/sm8550-hdk.dts
> >>> index e0dc03a97771..1efda478b7b9 100644
> >>> --- a/arch/arm64/boot/dts/qcom/sm8550-hdk.dts
> >>> +++ b/arch/arm64/boot/dts/qcom/sm8550-hdk.dts
> >>> @@ -1252,8 +1252,12 @@ &ufs_mem_phy {
> >>>    &usb_1 {
> >>>        status = "okay";
> >>>    };
> >>>
> >>> +&usb_1_dwc3 {
> >>> +     role-switch-default-mode = "host";
> >>> +};
> >>> +
> >>>    &usb_1_dwc3_hs {
> >>>        remote-endpoint = <&pmic_glink_hs_in>;
> >>>    };
> >>>
> >>> diff --git a/arch/arm64/boot/dts/qcom/sm8550-mtp.dts b/arch/arm64/boot/dts/qcom/sm8550-mtp.dts
> >>> index 26dfca0c3e05..7b05932f9c36 100644
> >>> --- a/arch/arm64/boot/dts/qcom/sm8550-mtp.dts
> >>> +++ b/arch/arm64/boot/dts/qcom/sm8550-mtp.dts
> >>> @@ -945,8 +945,12 @@ &ufs_mem_phy {
> >>>    &usb_1 {
> >>>        status = "okay";
> >>>    };
> >>>
> >>> +&usb_1_dwc3 {
> >>> +     role-switch-default-mode = "host";
> >>> +};
> >>> +
> >>>    &usb_1_dwc3_hs {
> >>>        remote-endpoint = <&pmic_glink_hs_in>;
> >>>    };
> >>>
> >>> diff --git a/arch/arm64/boot/dts/qcom/sm8550-qrd.dts b/arch/arm64/boot/dts/qcom/sm8550-qrd.dts
> >>> index 361b0792db4f..744bdc846e70 100644
> >>> --- a/arch/arm64/boot/dts/qcom/sm8550-qrd.dts
> >>> +++ b/arch/arm64/boot/dts/qcom/sm8550-qrd.dts
> >>> @@ -1211,8 +1211,12 @@ &ufs_mem_phy {
> >>>    &usb_1 {
> >>>        status = "okay";
> >>>    };
> >>>
> >>> +&usb_1_dwc3 {
> >>> +     role-switch-default-mode = "host";
> >>> +};
> >>> +
> >>>    &usb_1_dwc3_hs {
> >>>        remote-endpoint = <&pmic_glink_hs_in>;
> >>>    };
> >>>
> >>> diff --git a/arch/arm64/boot/dts/qcom/sm8650-hdk.dts b/arch/arm64/boot/dts/qcom/sm8650-hdk.dts
> >>> index 092b78fd8a3b..f07a56583e7d 100644
> >>> --- a/arch/arm64/boot/dts/qcom/sm8650-hdk.dts
> >>> +++ b/arch/arm64/boot/dts/qcom/sm8650-hdk.dts
> >>> @@ -1300,8 +1300,12 @@ &ufs_mem_phy {
> >>>    &usb_1 {
> >>>        status = "okay";
> >>>    };
> >>>
> >>> +&usb_1_dwc3 {
> >>> +     role-switch-default-mode = "host";
> >>> +};
> >>> +
> >>>    &usb_1_dwc3_hs {
> >>>        remote-endpoint = <&pmic_glink_hs_in>;
> >>>    };
> >>>
> >>> diff --git a/arch/arm64/boot/dts/qcom/sm8650-mtp.dts b/arch/arm64/boot/dts/qcom/sm8650-mtp.dts
> >>> index d6f91580ba8d..1a9a31423af4 100644
> >>> --- a/arch/arm64/boot/dts/qcom/sm8650-mtp.dts
> >>> +++ b/arch/arm64/boot/dts/qcom/sm8650-mtp.dts
> >>> @@ -839,8 +839,12 @@ &ufs_mem_phy {
> >>>    &usb_1 {
> >>>        status = "okay";
> >>>    };
> >>>
> >>> +&usb_1_dwc3 {
> >>> +     role-switch-default-mode = "host";
> >>> +};
> >>> +
> >>>    &usb_1_dwc3_hs {
> >>>        remote-endpoint = <&pmic_glink_hs_in>;
> >>>    };
> >>>
> >>> diff --git a/arch/arm64/boot/dts/qcom/sm8650-qrd.dts b/arch/arm64/boot/dts/qcom/sm8650-qrd.dts
> >>> index bd60c2770da2..031b7ada8eb1 100644
> >>> --- a/arch/arm64/boot/dts/qcom/sm8650-qrd.dts
> >>> +++ b/arch/arm64/boot/dts/qcom/sm8650-qrd.dts
> >>> @@ -1285,8 +1285,12 @@ &ufs_mem_phy {
> >>>    &usb_1 {
> >>>        status = "okay";
> >>>    };
> >>>
> >>> +&usb_1_dwc3 {
> >>> +     role-switch-default-mode = "host";
> >>> +};
> >>> +
> >>>    &usb_1_dwc3_hs {
> >>>        remote-endpoint = <&pmic_glink_hs_in>;
> >>>    };
> >>>
> >>>
> >>
> >
> >
>


-- 
With best wishes
Dmitry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ