[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z77lA_FViRjqjrUa@kuha.fi.intel.com>
Date: Wed, 26 Feb 2025 11:55:15 +0200
From: Heikki Krogerus <heikki.krogerus@...ux.intel.com>
To: Johan Hovold <johan+linaro@...nel.org>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Abel Vesa <abel.vesa@...aro.org>,
Stephan Gerhold <stephan.gerhold@...aro.org>,
linux-arm-msm@...r.kernel.org, linux-usb@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/3] usb: typec: ps883x: fix missing accessibility check
On Tue, Feb 18, 2025 at 04:29:32PM +0100, Johan Hovold wrote:
> Make sure that the retimer is accessible before registering to avoid
> having later consumer calls fail to configure it, something which, for
> example, can lead to a hotplugged display not being recognised:
>
> [drm:msm_dp_panel_read_sink_caps [msm]] *ERROR* read dpcd failed -110
>
> Fixes: 257a087c8b52 ("usb: typec: Add support for Parade PS8830 Type-C Retimer")
> Cc: Abel Vesa <abel.vesa@...aro.org>
> Signed-off-by: Johan Hovold <johan+linaro@...nel.org>
Reviewed-by: Heikki Krogerus <heikki.krogerus@...ux.intel.com>
> ---
> drivers/usb/typec/mux/ps883x.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/drivers/usb/typec/mux/ps883x.c b/drivers/usb/typec/mux/ps883x.c
> index 274de7abe585..f8b47187f4cf 100644
> --- a/drivers/usb/typec/mux/ps883x.c
> +++ b/drivers/usb/typec/mux/ps883x.c
> @@ -291,6 +291,7 @@ static int ps883x_retimer_probe(struct i2c_client *client)
> struct typec_switch_desc sw_desc = { };
> struct typec_retimer_desc rtmr_desc = { };
> struct ps883x_retimer *retimer;
> + unsigned int val;
> int ret;
>
> retimer = devm_kzalloc(dev, sizeof(*retimer), GFP_KERNEL);
> @@ -360,6 +361,16 @@ static int ps883x_retimer_probe(struct i2c_client *client)
>
> /* firmware initialization delay */
> msleep(60);
> +
> + /* make sure device is accessible */
> + ret = regmap_read(retimer->regmap, REG_USB_PORT_CONN_STATUS_0,
> + &val);
> + if (ret) {
> + dev_err(dev, "failed to read conn_status_0: %d\n", ret);
> + if (ret == -ENXIO)
> + ret = -EIO;
> + goto err_clk_disable;
> + }
> }
>
> sw_desc.drvdata = retimer;
> --
> 2.45.3
--
heikki
Powered by blists - more mailing lists