Re: [PATCH 36/37] xhci: simplify how we store TDs in urb private data

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

 



On 23.01.2017 14:15, Mathias Nyman wrote:
On 23.01.2017 13:57, David Laight wrote:
From: Mathias Nyman
Sent: 20 January 2017 14:47

Instead of storing a zero length array of td pointers, and then
allocate memory both for the td pointer array and the td's, just
use a zero length array of actual td's in urb private data.

This reminds me of an old patch that got reverted because things
broke because the lifetimes/accesses of the data wasn't the obvious one.


Can you recall more details about that case? I'd hate to revert this
later.


Thanks for the (off list) info.

You submitted a similar patch in 2013, but it caused a regression and was not applied:

https://www.spinics.net/lists/linux-usb/msg99748.html

Reason it regressed back then was because we handled stalled endpoints a bit differently.
We saved a pointer to the current TD of a stalled endpoint, then gave back the
URB, and freed urb_priv, but _not_ the TD that urb_priv->td[x] pointed to.

This TD was later used in the endpoint reset callback to figure out where we should
set the dequeue pointer of that ring.

Handling stalled endpoints has changed since then. We don't store the TD pointer in
STALL cases, and we free the urb_priv completely when giving back the URB

see:

commit 8e71a322fdb127814bcba423a512914ca5bc6cf5
    USB: xhci: Reset a halted endpoint immediately when we encounter a stall.

So now it should work

-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