Linux Renesas SOC kernel development
 help / color / mirror / Atom feed
From: Mathias Nyman <mathias.nyman@linux.intel.com>
To: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>,
	mathias.nyman@intel.com, gregkh@linuxfoundation.org
Cc: stern@rowland.harvard.edu, linux-usb@vger.kernel.org,
	linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH] usb: host: xhci-hub: avoid xhci_warn() when PORT_PE was clear.
Date: Wed, 31 Jan 2018 14:28:59 +0200	[thread overview]
Message-ID: <9a651725-c50f-5e07-6911-b630ac8a7cb8@linux.intel.com> (raw)
In-Reply-To: <1517399893-24883-1-git-send-email-yoshihiro.shimoda.uh@renesas.com>

On 31.01.2018 13:58, Yoshihiro Shimoda wrote:
> The commit 37be66767e3c ("usb: hub: Fix auto-remount of safely removed
> or ejected USB-3 devices") causes the following error when we
> disconnected a usb 3.0 device on some environment (e.g. R-Car H3):
> 
>   xhci-hcd ee000000.usb: Cannot set link state.
>   usb usb8-port1: cannot disable (err = -32)
> 
> According to Figure 35 in xhci spec, the PED (PORT_PE) will
> be set to 0 after the usb3 root hub enters "Error" or "Disconnected"
> state. So, this patch avoids the error messages to return -ENODEV when
> asked to set the USB_PORT_FEAT_LINK_STATE feature to U3 and PORT_PE
> was clear.
> 
> Suggested-by: Mathias Nyman <mathias.nyman@linux.intel.com>
> Suggested-by: Alan Stern <stern@rowland.harvard.edu>
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> ---
>   drivers/usb/host/xhci-hub.c | 7 +++++--
>   1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
> index 2a90229..7e95f9e 100644
> --- a/drivers/usb/host/xhci-hub.c
> +++ b/drivers/usb/host/xhci-hub.c
> @@ -1229,8 +1229,11 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
>   			 * port link state above '3' (U3) and the port
>   			 * must be enabled.
>   			 */
> -			if ((temp & PORT_PE) == 0 ||
> -				(link_state > USB_SS_PORT_LS_U3)) {
> +			if ((temp & PORT_PE) == 0) {
> +				retval = -ENODEV;
> +				break;
> +			}
> +			if (link_state > USB_SS_PORT_LS_U3) {
>   				xhci_warn(xhci, "Cannot set link state.\n");
>   				goto error;
>   			}
> 

Thanks.
Didn't notice this before writing a similar patch.
Anyway, I'll make sure one of them goes forward after rc1

-Mathias  

  reply	other threads:[~2018-01-31 12:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-31 11:58 [PATCH] usb: host: xhci-hub: avoid xhci_warn() when PORT_PE was clear Yoshihiro Shimoda
2018-01-31 12:28 ` Mathias Nyman [this message]
2018-02-01  2:09   ` Yoshihiro Shimoda

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=9a651725-c50f-5e07-6911-b630ac8a7cb8@linux.intel.com \
    --to=mathias.nyman@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    --cc=stern@rowland.harvard.edu \
    --cc=yoshihiro.shimoda.uh@renesas.com \
    /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