All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Maxim Moseychuk <franchesko.salias.hudro.pedros@gmail.com>
Cc: linux-usb@vger.kernel.org, stern@rowland.harvard.edu,
	mathias.nyman@linux.intel.com
Subject: [v2] usb: do not reset if a low-speed or full-speed device timed out
Date: Fri, 23 Mar 2018 14:11:30 +0100	[thread overview]
Message-ID: <20180323131129.GA17177@kroah.com> (raw)

On Thu, Jan 04, 2018 at 09:43:03PM +0300, Maxim Moseychuk wrote:
> Some low-speed and full-speed devices (for example, bluetooth)
> do not have time to initialize. For them, ETIMEDOUT is a valid error.
> We need to give them another try. Otherwise, they will
> never be initialized correctly and in dmesg will be messages
> "Bluetooth: hci0 command 0x1002 tx timeout" or similars.
> 
> Fixes: 264904ccc33c ("usb: retry reset if a device times out")
> Cc: stable <stable@vger.kernel.org>
> Signed-off-by: Maxim Moseychuk <franchesko.salias.hudro.pedros@gmail.com>
> ---
>  drivers/usb/core/hub.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
> index cf7bbcb9a63c..775d97035503 100644
> --- a/drivers/usb/core/hub.c
> +++ b/drivers/usb/core/hub.c
> @@ -4524,7 +4524,9 @@ hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1,
>  				 * reset. But only on the first attempt,
>  				 * lest we get into a time out/reset loop
>  				 */
> -				if (r == 0  || (r == -ETIMEDOUT && retries == 0))
> +				if (r == 0 || (r == -ETIMEDOUT &&
> +						retries == 0 &&
> +						udev->speed > USB_SPEED_FULL))
>  					break;

But can't we now get into a loop where this never happens?  We still
need to "fail" these slow devices somehow.

Do you have a device that this fixes a problem for?  I would think we
would have seen this issue before now, given that this change has been
present in the tree for quite some time now.

thanks,

greg k-h
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

             reply	other threads:[~2018-03-23 13:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-23 13:11 Greg Kroah-Hartman [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-03-23 13:39 [v2] usb: do not reset if a low-speed or full-speed device timed out Maxim Moseychuk
2018-01-04 18:43 Maxim Moseychuk

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=20180323131129.GA17177@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=franchesko.salias.hudro.pedros@gmail.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@linux.intel.com \
    --cc=stern@rowland.harvard.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.