Re: [PATCH] usb/xhci: ignore xhci version while checking for the link quirk

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Aug 31, 2011 at 05:41:59PM +0200, Sebastian Andrzej Siewior wrote:
> instead of reading the xhci interface version each time _even_ if the
> quirk is not required, simply check if the quirk flag is set. This flag
> is only set of the module parameter is set and here is where I moved the
> version check to.

Your patch description made it sound like you were going to let non-0.95
xHCI hosts use the link quirk (which is not something I want to do,
since the 0.96 spec mandates they fix this issue), but reading the code
I see you're just trying to eliminate a register read every time the
xHCI driver wraps around the ring.  Looks fine, I'll queue it for 3.2.

Sarah Sharp

> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>
> ---
>  drivers/usb/host/xhci.c |    2 +-
>  drivers/usb/host/xhci.h |    4 +---
>  2 files changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
> index 8fc51dd..9628825 100644
> --- a/drivers/usb/host/xhci.c
> +++ b/drivers/usb/host/xhci.c
> @@ -395,7 +395,7 @@ int xhci_init(struct usb_hcd *hcd)
>  
>  	xhci_dbg(xhci, "xhci_init\n");
>  	spin_lock_init(&xhci->lock);
> -	if (link_quirk) {
> +	if (xhci->hci_version == 0x95 && link_quirk) {
>  		xhci_dbg(xhci, "QUIRK: Not clearing Link TRB chain bits.\n");
>  		xhci->quirks |= XHCI_LINK_TRB_QUIRK;
>  	} else {
> diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
> index 79749ba..ec71cb4 100644
> --- a/drivers/usb/host/xhci.h
> +++ b/drivers/usb/host/xhci.h
> @@ -1394,9 +1394,7 @@ static inline void xhci_write_64(struct xhci_hcd *xhci,
>  
>  static inline int xhci_link_trb_quirk(struct xhci_hcd *xhci)
>  {
> -	u32 temp = xhci_readl(xhci, &xhci->cap_regs->hc_capbase);
> -	return ((HC_VERSION(temp) == 0x95) &&
> -			(xhci->quirks & XHCI_LINK_TRB_QUIRK));
> +	return xhci->quirks & XHCI_LINK_TRB_QUIRK;
>  }
>  
>  /* xHCI debugging */
> -- 
> 1.7.5.4
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux