Skip to content

Commit aaf15f8

Browse files
bvanasschemartinkpetersen
authored andcommitted
scsi: sd: Fix Opal support
The SCSI core has been modified recently such that it only processes PM requests if rpm_status != RPM_ACTIVE. Since some Opal requests are submitted while rpm_status != RPM_ACTIVE, set flag RQF_PM for Opal requests. See also https://bugzilla.kernel.org/show_bug.cgi?id=211227. [mkp: updated sha for PM patch] Link: https://lore.kernel.org/r/20210222021042.3534-1-bvanassche@acm.org Fixes: d80210f ("sd: add support for TCG OPAL self encrypting disks") Fixes: e6044f7 ("scsi: core: Only process PM requests if rpm_status != RPM_ACTIVE") Cc: chriscjsus@yahoo.com Cc: Jens Axboe <axboe@kernel.dk> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: stable@vger.kernel.org Reported-by: chriscjsus@yahoo.com Tested-by: chriscjsus@yahoo.com Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 8f33bb2 commit aaf15f8

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/scsi/sd.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -707,9 +707,9 @@ static int sd_sec_submit(void *data, u16 spsp, u8 secp, void *buffer,
707707
put_unaligned_be16(spsp, &cdb[2]);
708708
put_unaligned_be32(len, &cdb[6]);
709709

710-
ret = scsi_execute_req(sdev, cdb,
711-
send ? DMA_TO_DEVICE : DMA_FROM_DEVICE,
712-
buffer, len, NULL, SD_TIMEOUT, sdkp->max_retries, NULL);
710+
ret = scsi_execute(sdev, cdb, send ? DMA_TO_DEVICE : DMA_FROM_DEVICE,
711+
buffer, len, NULL, NULL, SD_TIMEOUT, sdkp->max_retries, 0,
712+
RQF_PM, NULL);
713713
return ret <= 0 ? ret : -EIO;
714714
}
715715
#endif /* CONFIG_BLK_SED_OPAL */

0 commit comments

Comments
 (0)