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

Skip to content
Commit f20810d8 authored by Sujit Reddy Thumma's avatar Sujit Reddy Thumma Committed by Christoph Hellwig
Browse files

scsi: ufs: Fix hardware race conditions while aborting a command



There is a possible race condition in the hardware when the abort
command is issued to terminate the ongoing SCSI command as described
below:

- A bit in the door-bell register is set in the controller for a
  new SCSI command.
- In some rare situations, before controller get a chance to issue
  the command to the device, the software issued an abort command.
- If the device recieves abort command first then it returns success
  because the command itself is not present.
- Now if the controller commits the command to device it will be
  processed.
- Software thinks that command is aborted and proceed while still
  the device is processing it.
- The software, controller and device may go out of sync because of
  this race condition.

To avoid this, query task presence in the device before sending abort
task command so that after the abort operation, the command is guaranteed
to be non-existent in both controller and the device.

Signed-off-by: default avatarSujit Reddy Thumma <sthumma@codeaurora.org>
Reviewed-by: default avatarYaniv Gardi <ygardi@codeaurora.org>
Tested-by: default avatarDolev Raviv <draviv@codeaurora.org>
Acked-by: default avatarVinayak Holikatti <vinholikatti@gmail.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent e2933132
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment