-
由 James Bottomley 提交于
mpt3sas has a firmware failure where it can only handle one pass through ATA command at a time. If another comes in, contrary to the SAT standard, it will hang until the first one completes (causing long commands like secure erase to timeout). The original fix was to block the device when an ATA command came in, but this caused a regression with commit 669f0441 Author: Bart Van Assche <bart.vanassche@sandisk.com> Date: Tue Nov 22 16:17:13 2016 -0800 scsi: srp_transport: Move queuecommand() wait code to SCSI core So fix the original fix of the secure erase timeout by properly returning SAM_STAT_BUSY like the SAT recommends. The original patch also had a concurrency problem since scsih_qcmd is lockless at that point (this is fixed by using atomic bitops to set and test the flag). [mkp: addressed feedback wrt. test_bit and fixed whitespace] Fixes: 18f6084a (mpt3sas: Fix secure erase premature termination) Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com> Acked-by: NSreekanth Reddy <Sreekanth.Reddy@broadcom.com> Reviewed-by: NChristoph Hellwig <hch@lst.de> Reported-by: NIngo Molnar <mingo@kernel.org> Tested-by: NIngo Molnar <mingo@kernel.org> Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
ffb58456