Re: [RFC] usb: g_file_storage: don't enqueue partial buffers where possible

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

 



Alan Stern wrote:
> On Mon, 9 Mar 2009, David Vrabel wrote:
> 
>> The g_file_storage module part fills an IN buffer if the requested read
>> would have ended in the middle of a page.  With wireless USB this can
>> result in enqueued requests that are not a multiple of wMaxPacketSize
>> (e.g., 3584) and consequentially the host would receive an unexpected
>> short packet.
>>
>> Is there are reason for this check for the page boundary?  Is it simply
>> an optimization so subsequent calls to vfs_read() are page-aligned?
> 
> That's right.
> 
>> The attached patch simply removes the check for partial pages.
> 
> Can you rewrite it so that the check is removed only when
> wMaxPacketSize > 512?

I'll make it so it aligns on a page boundary iff it results in buffers
that are a multiple of wMaxPacketSize.  This will be useful if
wMaxPacketSize is 1k or 2k.

David
-- 
David Vrabel, Senior Software Engineer, Drivers
CSR, Churchill House, Cambridge Business Park,  Tel: +44 (0)1223 692562
Cowley Road, Cambridge, CB4 0WZ                 http://www.csr.com/
--
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