Re: [PATCH v2] xhci: dbc: fix handling ClearFeature Halt requests

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

 



On 30.7.2024 3.17, Łukasz Bartosik wrote:
On Mon, Jul 29, 2024 at 4:11 PM Mathias Nyman
<mathias.nyman@xxxxxxxxxxxxxxx> wrote:

Hi

On 25.7.2024 10.48, Łukasz Bartosik wrote:
DbC driver does not handle ClearFeature Halt requests correctly
which in turn may lead to dropping packets on the receive path.

Nice catch.
Looks like a halted endpoint is treated almost as a disconnect.


...


Hmm, I need to dig into this.

I don't think we should push this problem up to the request completion handler.
Maybe we are flushing requests that should not be flushed?


Section 7.6.4.3 "Halted DbC Endpoints" in Intel's xHCI specification
says the endpoint can
be halted by HW in case of error. Also it can be halted by software
through HIT or HOT flags for DbC.
I wonder how to recover properly from the Halted state caused by HW
error ? Does it make sense to continue with
the requests or just restart the endpoint (flush all requests) as this
patch does ?

DbC should respond with STALL packets to host if HIT or HOT is set.
Host side should react to this by sending a ClearFeature(HALT) request to DbC,
which should clear the halted endpoint and HIT/HOT flags.

I think we may lose more data in DbC bulk-out stall cases (data from DbC to host)
when flushing the requests.
Data is copied from kfifo to the requests while queuing them, if we then flush them
we will never send that data to host.


Do you have an easy way to reproduce the stall error case?


Yes I can easily reproduce the case with the stall errors.
Would you like me to run any specific scenarios ?

I pushed my thoughts to a "fix_dbc_halted_ep" branch, it compiles but is not complete.
It mostly focuses on getting the STALL case for bulk-in working which this report was
about.

I think the code itself best describes what I'm trying to do.

git://git.kernel.org/pub/scm/linux/kernel/git/mnyman/xhci.git fix_dbc_halted_ep
https://git.kernel.org/pub/scm/linux/kernel/git/mnyman/xhci.git/commit/?h=fix_dbc_halted_ep&id=8532b621314e93336535528d5d45e41974c75e01
If you can try it out it would be great.

Thanks
-Mathias





[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux