Re: [PATCH] xhci: Remove the arbitrary limit of 15 xHCI ports

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

 



Hi William,

The code itself looks good, but it's missing a signed-off by line.
Please read Documentation/SubmittingPatches.  `git format-patch` or `git
send-email` will format your git commit into something reasonable.

Also, it looks like something converted the tabs into spaces, so I can't
apply it.  It could be your mail client (don't use Outlook), your
outgoing mail server, or my incoming mail server.  Can you fix the
signed-off by issue and then resend with a different mail client?

Sarah Sharp

On Thu, May 06, 2010 at 04:20:13PM -0700, William Gulland wrote:
> Our virtual xHCI device can have as many ports as we like - I've tested this patch with 31.
> 
> diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
> index 208b805..bf7f47e 100644
> --- a/drivers/usb/host/xhci-hub.c
> +++ b/drivers/usb/host/xhci-hub.c
> @@ -298,7 +298,6 @@ error:
>   * Returns 0 if the status hasn't changed, or the number of bytes in buf.
>   * Ports are 0-indexed from the HCD point of view,
>   * and 1-indexed from the USB core pointer of view.
> - * xHCI instances can have up to 127 ports, so FIXME if you see more than 15.
>   *
>   * Note that the status change bits will be cleared as soon as a port status
>   * change event is generated, so we use the saved status from that event.
> @@ -315,14 +314,9 @@ int xhci_hub_status_data(struct usb_hcd *hcd, char *buf)
>       ports = HCS_MAX_PORTS(xhci->hcs_params1);
>  
>       /* Initial status is no changes */
> -     buf[0] = 0;
> +     retval = (ports + 8) / 8;
> +     memset(buf, 0, retval);
>       status = 0;
> -     if (ports > 7) {
> -           buf[1] = 0;
> -           retval = 2;
> -     } else {
> -           retval = 1;
> -     }
>  
>       spin_lock_irqsave(&xhci->lock, flags);
>       /* For each port, did anything change?  If so, set that bit in buf. */
> @@ -331,10 +325,7 @@ int xhci_hub_status_data(struct usb_hcd *hcd, char *buf)
>                   NUM_PORT_REGS*i;
>             temp = xhci_readl(xhci, addr);
>             if (temp & (PORT_CSC | PORT_PEC | PORT_OCC)) {
> -                 if (i < 7)
> -                       buf[0] |= 1 << (i + 1);
> -                 else
> -                       buf[1] |= 1 << (i - 7);
> +                 buf[(i + 1) / 8] |= 1 << (i + 1) % 8;
>                   status = 1;
>             }
>       }
>  
--
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