]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: cxlflash: Reset command ioasc
authorUma Krishnan <ukrishn@linux.vnet.ibm.com>
Wed, 3 Jan 2018 22:54:02 +0000 (16:54 -0600)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 11 Jan 2018 04:24:55 +0000 (23:24 -0500)
commit76a1f3191e26026778273774fd37943760cf481a
treed8df65cb59fdba7b74b93b4c128c985f482d8d50
parentcaaf064ed34e580d88a500f3edf5988bdcb4e166
scsi: cxlflash: Reset command ioasc

In the event of a command failure, cxlflash returns the failure to the upper
layers to process. After processing the error, when the command is queued
again, the private command structure will not be zeroed and the ioasc could be
stale. Per the SISLite specification, the AFU only sets the ioasc in the
presence of a failure. Thus, even though the original command succeeds the
second time, the command is considered a failure due to stale ioasc. This
cycle repeats indefinitely and can cause a hang or IO failure.

To fix the issue, clear the ioasc before queuing any command.

[mkp: added Cc: stable per request]

Fixes: 77b6b5261a45 ("scsi: cxlflash: Remove zeroing of private command data")
Cc: <stable@vger.kernel.org>
Signed-off-by: Uma Krishnan <ukrishn@linux.vnet.ibm.com>
Acked-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/cxlflash/main.c