mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Johan Hovold <johan+linaro@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
	Abel Vesa <abel.vesa@linaro.org>
Subject: Re: [PATCH] usb: typec: ps883x: fix probe error handling
Date: Wed, 26 Feb 2025 11:52:47 +0200	[thread overview]
Message-ID: <Z77kb2a_Vhln0reU@kuha.fi.intel.com> (raw)
In-Reply-To: <20250218082243.9318-1-johan+linaro@kernel.org>

On Tue, Feb 18, 2025 at 09:22:43AM +0100, Johan Hovold wrote:
> Fix the probe error handling to avoid unbalanced clock disable or
> leaving regulators on after probe failure.
> 
> Note that the active-low reset pin should also be asserted to avoid
> leaking current after disabling the regulators.
> 
> Fixes: 257a087c8b52 ("usb: typec: Add support for Parade PS8830 Type-C Retimer")
> Cc: Abel Vesa <abel.vesa@linaro.org>
> Signed-off-by: Johan Hovold <johan+linaro@kernel.org>

Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>

> ---
>  drivers/usb/typec/mux/ps883x.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/typec/mux/ps883x.c b/drivers/usb/typec/mux/ps883x.c
> index 10e407ab6b7f..ef086989231f 100644
> --- a/drivers/usb/typec/mux/ps883x.c
> +++ b/drivers/usb/typec/mux/ps883x.c
> @@ -387,10 +387,11 @@ static int ps883x_retimer_probe(struct i2c_client *client)
>  
>  err_switch_unregister:
>  	typec_switch_unregister(retimer->sw);
> -err_vregs_disable:
> -	ps883x_disable_vregs(retimer);
>  err_clk_disable:
>  	clk_disable_unprepare(retimer->xo_clk);
> +err_vregs_disable:
> +	gpiod_set_value(retimer->reset_gpio, 1);
> +	ps883x_disable_vregs(retimer);
>  err_mux_put:
>  	typec_mux_put(retimer->typec_mux);
>  err_switch_put:
> -- 
> 2.45.3

-- 
heikki

      reply	other threads:[~2025-02-26  9:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-18  8:22 Johan Hovold
2025-02-26  9:52 ` Heikki Krogerus [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z77kb2a_Vhln0reU@kuha.fi.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=abel.vesa@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=johan+linaro@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®