Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2b83d2f9 authored by Subhash Jadavani's avatar Subhash Jadavani
Browse files

scsi: ufs: add error recovery after DL NAC error



Some vendor's UFS device sends back to back NACs for the DL data frames
causing the host controller to raise the DFES error status. Sometimes
such UFS devices send back to back NAC without waiting for new
retransmitted DL frame from the host and in such cases it might be possible
the Host UniPro goes into bad state without raising the DFES error
interrupt. If this happens then all the pending commands would timeout
only after respective SW command (which is generally too large).

This change workarounds such device behaviour like this:
- As soon as SW sees the DL NAC error, it would schedule the error handler
- Error handler would sleep for 50ms to see if there any fatal errors
  raised by UFS controller.
   - If there are fatal errors then SW does normal error recovery.
   - If there are no fatal errors then SW sends the NOP command to device
     to check if link is alive.
       - If NOP command times out, SW does normal error recovery
       - If NOP command succeed, skip the error handling.

If DL NAC error is seen multiple times with some vendor's UFS devices then
enable this quirk to initiate quick error recovery and also silence related
error logs to reduce spamming of kernel logs.

Change-Id: Id2f0c05c414d700ba923513f8c9e3d1e6a8a749a
Signed-off-by: default avatarSubhash Jadavani <subhashj@codeaurora.org>
parent c6029bb6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment