public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Cc: gregkh@linuxfoundation.org, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-stm32@st-md-mailman.stormreply.com
Subject: Re: [PATCH] usb: typec: ucsi: don't print PPM init deferred errors
Date: Thu, 13 Apr 2023 09:22:15 +0300	[thread overview]
Message-ID: <ZDeflxzawVNxhsL7@kuha.fi.intel.com> (raw)
In-Reply-To: <20230412161734.3425090-1-fabrice.gasnier@foss.st.com>

On Wed, Apr 12, 2023 at 06:17:34PM +0200, Fabrice Gasnier wrote:
> ucsi_init() may be deferred as usb_role_sw may be deferred in
> ucsi_register_port(). This results in several PPM init failed (-517)
> messages maybe printed several times upon boot, like on stm32mp135f-dk
> board, until the role_switch driver gets probed.
> 
> [   19.880945] dwc2 49000000.usb: supply vusb_d not found, using dummy regulator
> [   19.887136] dwc2 49000000.usb: supply vusb_a not found, using dummy regulator
> [   19.975432] ucsi-stm32g0-i2c 0-0053: PPM init failed (-517)
> [   20.155746] dwc2 49000000.usb: EPs: 9, dedicated fifos, 952 entries in SPRAM
> [   20.175429] ucsi-stm32g0-i2c 0-0053: PPM init failed (-517)
> [   20.184242] dwc2 49000000.usb: DWC OTG Controller
> 
> Adopt dev_err_probe() instead of dev_err(), to only print other errors.
> Also print an error in case the wait count has expired.
> 
> Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>

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

> ---
>  drivers/usb/typec/ucsi/ucsi.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
> index f632350f6dcb..4d809e0d7761 100644
> --- a/drivers/usb/typec/ucsi/ucsi.c
> +++ b/drivers/usb/typec/ucsi/ucsi.c
> @@ -1447,11 +1447,13 @@ static void ucsi_init_work(struct work_struct *work)
>  
>  	ret = ucsi_init(ucsi);
>  	if (ret)
> -		dev_err(ucsi->dev, "PPM init failed (%d)\n", ret);
> +		dev_err_probe(ucsi->dev, ret, "PPM init failed\n");
>  
>  	if (ret == -EPROBE_DEFER) {
> -		if (ucsi->work_count++ > UCSI_ROLE_SWITCH_WAIT_COUNT)
> +		if (ucsi->work_count++ > UCSI_ROLE_SWITCH_WAIT_COUNT) {
> +			dev_err(ucsi->dev, "PPM init failed, stop trying\n");
>  			return;
> +		}
>  
>  		queue_delayed_work(system_long_wq, &ucsi->work,
>  				   UCSI_ROLE_SWITCH_INTERVAL);
> -- 
> 2.25.1

-- 
heikki

      reply	other threads:[~2023-04-13  6:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-12 16:17 [PATCH] usb: typec: ucsi: don't print PPM init deferred errors Fabrice Gasnier
2023-04-13  6:22 ` 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=ZDeflxzawVNxhsL7@kuha.fi.intel.com \
    --to=heikki.krogerus@linux.intel.com \
    --cc=fabrice.gasnier@foss.st.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --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