LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Flavio Suligoi <f.suligoi@asem.it>
Cc: Alan Stern <stern@rowland.harvard.edu>,
	Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
	Mathias Nyman <mathias.nyman@linux.intel.com>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Bixuan Cui <cuibixuan@huawei.com>, Andrew Lunn <andrew@lunn.ch>,
	Chris Chiu <chris.chiu@canonical.com>,
	Rajat Jain <rajatja@google.com>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] usb: core: hub: improve port over-current alert msg
Date: Tue, 5 Oct 2021 17:38:53 +0200	[thread overview]
Message-ID: <YVxxjUZDh8abDNjc@kroah.com> (raw)
In-Reply-To: <20211005151644.288932-1-f.suligoi@asem.it>

On Tue, Oct 05, 2021 at 05:16:44PM +0200, Flavio Suligoi wrote:
> At the moment the port over-current message is
> displayed only if the over-current condition is permanent.
> 
> But in case of permanent short-circuit or
> over-current, some USB power-distribution switches
> (such as the TPS20xx, etc.), after the over-current
> detection and the consequent shutdown, return
> in the normal state.

Please use the full 72 columns of the changelog text.


> 
> So, in these cases, the over-current error message
> never appears.
> 
> To overcome this problem, the "over-current condition"
> message is displayed even after some over-current events.
> 
> Signed-off-by: Flavio Suligoi <f.suligoi@asem.it>
> ---
>  arch/arm64/boot/dts/Makefile | 1 +
>  drivers/usb/core/hub.c       | 5 +++--
>  2 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/Makefile b/arch/arm64/boot/dts/Makefile
> index 639e01a4d855..bf26ce60d78a 100644
> --- a/arch/arm64/boot/dts/Makefile
> +++ b/arch/arm64/boot/dts/Makefile
> @@ -8,6 +8,7 @@ subdir-y += amlogic
>  subdir-y += apm
>  subdir-y += apple
>  subdir-y += arm
> +subdir-y += asem
>  subdir-y += bitmain
>  subdir-y += broadcom
>  subdir-y += cavium

I do not think this change is part of this :(

> diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
> index 86658a81d284..ff6c8e0e2673 100644
> --- a/drivers/usb/core/hub.c
> +++ b/drivers/usb/core/hub.c
> @@ -5577,7 +5577,8 @@ static void port_event(struct usb_hub *hub, int port1)
>  		msleep(100);	/* Cool down */
>  		hub_power_on(hub, true);
>  		hub_port_status(hub, port1, &status, &unused);
> -		if (status & USB_PORT_STAT_OVERCURRENT)
> +		if ((status & USB_PORT_STAT_OVERCURRENT) ||
> +		    !(port_dev->over_current_count % 15))

What is 15?

>  			dev_err(&port_dev->dev, "over-current condition\n");
>  	}
>  
> @@ -5738,7 +5739,7 @@ static void hub_event(struct work_struct *work)
>  			u16 status = 0;
>  			u16 unused;
>  
> -			dev_dbg(hub_dev, "over-current change\n");
> +			dev_info(hub_dev, "over-current change\n");

This is just going to be noisy, what can a user do with this?

thanks,

greg k-h

  reply	other threads:[~2021-10-05 15:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-05 15:16 Flavio Suligoi
2021-10-05 15:38 ` Greg Kroah-Hartman [this message]
2021-10-06  9:47   ` Flavio Suligoi

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=YVxxjUZDh8abDNjc@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=andrew@lunn.ch \
    --cc=bhelgaas@google.com \
    --cc=chris.chiu@canonical.com \
    --cc=cuibixuan@huawei.com \
    --cc=f.suligoi@asem.it \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@linux.intel.com \
    --cc=rajatja@google.com \
    --cc=stern@rowland.harvard.edu \
    --subject='Re: [PATCH v1] usb: core: hub: improve port over-current alert msg' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).