Re: Mismatch in TRB_LEN bit mask for Transfer Event TRBs

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

 



Hi Sarah,


On Wed, Mar 20, 2013 at 10:17 AM, Vivek Gautam
<gautamvivek1987@xxxxxxxxx> wrote:
> Hi,
>
>
> On Wed, Mar 20, 2013 at 12:51 AM, Sarah Sharp
> <sarah.a.sharp@xxxxxxxxxxxxxxx> wrote:
>> On Thu, Mar 07, 2013 at 03:38:46PM +0530, Vivek Gautam wrote:
>>> Hi Sarah,
>>>
>>>
>>> While going through the code for Handling Transfer Events
>>> (drivers/usb/host/xhci-ring.c), i hit upon this problem.
>>> As defined in "drivers/usb/host/xhci.h"
>>>
>>>         /* Normal TRB fields */
>>>         /* transfer_len bitmasks - bits 0:16 */
>>>         #define TRB_LEN(p)              ((p) & 0x1ffff)
>>>
>>> And the same macro i could see being used while Handling Trasfer
>>> events "handle_tx_event()", and further in
>>> process_ctrl_td(), process_isoc_td(), and process_bulk_intr_td().
>>>
>>> However, as per XHCI specs (Rev 1.0, 5/21/10) section 6.4.2.1 for
>>> Transfer event TRBs, the transfer length is bits 0:23
>>> thereby something like below could be valid:
>>>
>>>         /* Transfer event TRB length bit mask */
>>>         /* bits 0:23 */
>>>         #define        EVENT_TRB_LEN(p)                ((p) & 0xffffff)
>>>
>>> This difference is confusing somewhat.
>>> I hope the current code must be pretty much fine, and there could be
>>> something that i might be stupidly missing.
>>
>> Nope, you've caught an honest-to-goodness bug. :)
>
> Hmm.
>
>>
>> Would you like to submit a patch to fix this?  It should be pretty easy
>> to look at the context in xhci-ring.c and figure out whether the
>> function is queueing a TRB (and thus should use the TRB_LEN macro) or
>> handling a event TRB (and should be using the new EVENT_TRB_LEN macro).
>>
>
> Sure, will send a patch for this.
>

Please refer to patch: usb: xhci: Fix TRB transfer length macro used
for Event TRB.


-- 
Thanks & Regards
Vivek
--
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