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: <20240326220919.GA2136359@hu-bjorande-lv.qualcomm.com>
Date: Tue, 26 Mar 2024 15:09:19 -0700
From: Bjorn Andersson <quic_bjorande@...cinc.com>
To: <neil.armstrong@...aro.org>
CC: Jameson Thies <jthies@...gle.com>, <heikki.krogerus@...ux.intel.com>,
        <linux-usb@...r.kernel.org>, <pmalani@...omium.org>,
        <bleung@...gle.com>, <abhishekpandit@...omium.org>,
        <andersson@...nel.org>, <dmitry.baryshkov@...aro.org>,
        <fabrice.gasnier@...s.st.com>, <gregkh@...uxfoundation.org>,
        <hdegoede@...hat.com>, <rajaram.regupathy@...el.com>,
        <saranya.gopal@...el.com>, <linux-kernel@...r.kernel.org>,
        Benson Leung <bleung@...omium.org>,
        Linux
 regressions mailing list <regressions@...ts.linux.dev>
Subject: Re: [PATCH v4 2/4] usb: typec: ucsi: Register cables based on
 GET_CABLE_PROPERTY

On Mon, Mar 11, 2024 at 06:28:41PM +0100, neil.armstrong@...aro.org wrote:
> On 05/03/2024 03:58, Jameson Thies wrote:
[..]
> With:
> =================><====================================
> diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
> index cf52cb34d285..eec64a4c8cdd 100644
> --- a/drivers/usb/typec/ucsi/ucsi.c
> +++ b/drivers/usb/typec/ucsi/ucsi.c
> @@ -1189,8 +1189,10 @@ static void ucsi_handle_connector_change(struct work_struct *work)
>                         ucsi_register_partner(con);
>                         ucsi_partner_task(con, ucsi_check_connection, 1, HZ);
>                         ucsi_partner_task(con, ucsi_check_connector_capability, 1, HZ);
> -                       ucsi_partner_task(con, ucsi_get_partner_identity, 1, HZ);
> -                       ucsi_partner_task(con, ucsi_check_cable, 1, HZ);
> +                       if (con->ucsi->cap.features & UCSI_CAP_GET_PD_MESSAGE)
> +                               ucsi_partner_task(con, ucsi_get_partner_identity, 1, HZ);
> +                       if (con->ucsi->cap.features & UCSI_CAP_CABLE_DETAILS)
> +                               ucsi_partner_task(con, ucsi_check_cable, 1, HZ);
> 
>                         if (UCSI_CONSTAT_PWR_OPMODE(con->status.flags) ==
>                             UCSI_CONSTAT_PWR_OPMODE_PD)
> @@ -1589,8 +1591,10 @@ static int ucsi_register_port(struct ucsi *ucsi, struct ucsi_connector *con)
>                 ucsi_register_partner(con);
>                 ucsi_pwr_opmode_change(con);
>                 ucsi_port_psy_changed(con);
> -               ucsi_get_partner_identity(con);
> -               ucsi_check_cable(con);
> +               if (con->ucsi->cap.features & UCSI_CAP_GET_PD_MESSAGE)
> +                       ucsi_get_partner_identity(con);
> +               if (con->ucsi->cap.features & UCSI_CAP_CABLE_DETAILS)
> +                       ucsi_check_cable(con);
>         }
> 
>         /* Only notify USB controller if partner supports USB data */
> diff --git a/drivers/usb/typec/ucsi/ucsi.h b/drivers/usb/typec/ucsi/ucsi.h
> index 32daf5f58650..2e9c35a3af27 100644
> --- a/drivers/usb/typec/ucsi/ucsi.h
> +++ b/drivers/usb/typec/ucsi/ucsi.h
> @@ -215,6 +215,7 @@ struct ucsi_capability {
>  #define UCSI_CAP_CABLE_DETAILS                 BIT(5)
>  #define UCSI_CAP_EXT_SUPPLY_NOTIFICATIONS      BIT(6)
>  #define UCSI_CAP_PD_RESET                      BIT(7)
> +#define UCSI_CAP_GET_PD_MESSAGE                        BIT(8)
>         u16 reserved_1;
>         u8 num_alt_modes;
>         u8 reserved_2;
> =================><====================================
> it works fine again.
> 

The series broke role switching on qcs6490-rb3gen2 (next-20240326 is
broken). You're proposed addition brings it back, thank you.

Was this posted somewhere?

Regards,
Bjorn

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ