Re: [PATCH v3] xhci: fix reporting of 0-sized URBs in control endpoint

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

 



On 26.02.2015 16:57, Alan Stern wrote:
> On Thu, 26 Feb 2015, Mathias Nyman wrote:
> 
>> I'm starting to like your idea of setting the urb->actual_length in advance,
>> It may actually simplify things.
> 
> But it will make unlinking more difficult.  Also, what will you do if 
> there is more than one TRB?
> 

current xhci driver can't handle more than one data trb in control tranfers:
xhci-ring.c,

int xhci_queue_ctrl_tx(struct xhci_hcd *xhci, gfp_t mem_flags,
                struct urb *urb, int slot_id, unsigned int ep_index)
...
  /* 1 TRB for setup, 1 for status */
        num_trbs = 2;
        /*                                                                                              
         * Don't need to check if we need additional event data and normal TRBs,                        
         * since data in control transfers will never get bigger than 16MB                              
         * XXX: can we get a buffer that crosses 64KB boundaries?                                       
         */
        if (urb->transfer_buffer_length > 0)
                num_trbs++;


Shouldn't control urbs only be given back when they finish (SUCCESS, STALL, SHORT etc),
are dequeued, or some major host failure causes us to empty the rings?

I thought it would be enough to set urb->actual_length = 0 for the ctrl URBs in all other
cases than short or successful completion?

I'll send a RFC so you can see if it makes sense to try out this path, or If Im only shooting
myself in the foot.

-Mathias

--
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