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: <ZJlX6CsCI1EJXLKF@kuha.fi.intel.com>
Date:   Mon, 26 Jun 2023 12:18:32 +0300
From:   Heikki Krogerus <heikki.krogerus@...ux.intel.com>
To:     Neil Armstrong <neil.armstrong@...aro.org>
Cc:     Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        Conor Dooley <conor+dt@...nel.org>,
        Andy Gross <agross@...nel.org>,
        Bjorn Andersson <andersson@...nel.org>,
        Konrad Dybcio <konrad.dybcio@...aro.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Rob Herring <robh@...nel.org>, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-arm-msm@...r.kernel.org,
        linux-usb@...r.kernel.org
Subject: Re: [PATCH v3 2/8] soc: qcom: pmic_glink_altmode: handle safe mode
 when disconnect

On Tue, Jun 13, 2023 at 09:55:55AM +0200, Neil Armstrong wrote:
> On some Qcom SoCs, the Altmode event mode is set to 0xff when
> the Type-C port is disconnected.
> 
> Handle this specific mode and translate it as the SAFE mode.
> 
> Signed-off-by: Neil Armstrong <neil.armstrong@...aro.org>

FWIW:

Acked-by: Heikki Krogerus <heikki.krogerus@...ux.intel.com>

> ---
>  drivers/soc/qcom/pmic_glink_altmode.c | 18 +++++++++++++++++-
>  1 file changed, 17 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/soc/qcom/pmic_glink_altmode.c b/drivers/soc/qcom/pmic_glink_altmode.c
> index df48fbea4b68..007d308e2f15 100644
> --- a/drivers/soc/qcom/pmic_glink_altmode.c
> +++ b/drivers/soc/qcom/pmic_glink_altmode.c
> @@ -173,6 +173,20 @@ static void pmic_glink_altmode_enable_usb(struct pmic_glink_altmode *altmode,
>  		dev_err(altmode->dev, "failed to switch mux to USB\n");
>  }
>  
> +static void pmic_glink_altmode_safe(struct pmic_glink_altmode *altmode,
> +				    struct pmic_glink_altmode_port *port)
> +{
> +	int ret;
> +
> +	port->state.alt = NULL;
> +	port->state.data = NULL;
> +	port->state.mode = TYPEC_STATE_SAFE;
> +
> +	ret = typec_mux_set(port->typec_mux, &port->state);
> +	if (ret)
> +		dev_err(altmode->dev, "failed to switch mux to safe mode\n");
> +}
> +
>  static void pmic_glink_altmode_worker(struct work_struct *work)
>  {
>  	struct pmic_glink_altmode_port *alt_port = work_to_altmode_port(work);
> @@ -180,7 +194,9 @@ static void pmic_glink_altmode_worker(struct work_struct *work)
>  
>  	typec_switch_set(alt_port->typec_switch, alt_port->orientation);
>  
> -	if (alt_port->svid == USB_TYPEC_DP_SID)
> +	if (alt_port->svid == USB_TYPEC_DP_SID && alt_port->mode == 0xff)
> +		pmic_glink_altmode_safe(altmode, alt_port);
> +	else if (alt_port->svid == USB_TYPEC_DP_SID)
>  		pmic_glink_altmode_enable_dp(altmode, alt_port, alt_port->mode,
>  					     alt_port->hpd_state, alt_port->hpd_irq);
>  	else
> 
> -- 
> 2.34.1

-- 
heikki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ