public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] scsi/sd: Fix Opal support
@ 2021-02-22  2:10 Bart Van Assche
  2021-02-22  7:12 ` Christoph Hellwig
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Bart Van Assche @ 2021-02-22  2:10 UTC (permalink / raw)
  To: Martin K . Petersen, James E . J . Bottomley
  Cc: linux-scsi, Bart Van Assche, chriscjsus, Christoph Hellwig,
	Jens Axboe, Alan Stern, stable

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.

Fixes: d80210f25ff0 ("sd: add support for TCG OPAL self encrypting disks")
Fixes: 271822bbf9fe ("scsi: core: Only process PM requests if rpm_status != RPM_ACTIVE")
Reported-by: chriscjsus@yahoo.com
Tested-by: chriscjsus@yahoo.com
Cc: chriscjsus@yahoo.com
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: stable@vger.kernel.org
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
Changes compared to v1:
- Addressed Christoph's review comments.
- Added Cc: stable.
---
 drivers/scsi/sd.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index a3d2d4bc4a3d..6a3a163b0706 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -707,9 +707,9 @@ static int sd_sec_submit(void *data, u16 spsp, u8 secp, void *buffer,
 	put_unaligned_be16(spsp, &cdb[2]);
 	put_unaligned_be32(len, &cdb[6]);
 
-	ret = scsi_execute_req(sdev, cdb,
-			send ? DMA_TO_DEVICE : DMA_FROM_DEVICE,
-			buffer, len, NULL, SD_TIMEOUT, sdkp->max_retries, NULL);
+	ret = scsi_execute(sdev, cdb, send ? DMA_TO_DEVICE : DMA_FROM_DEVICE,
+		buffer, len, NULL, NULL, SD_TIMEOUT, sdkp->max_retries, 0,
+		RQF_PM, NULL);
 	return ret <= 0 ? ret : -EIO;
 }
 #endif /* CONFIG_BLK_SED_OPAL */

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] scsi/sd: Fix Opal support
  2021-02-22  2:10 [PATCH v2] scsi/sd: Fix Opal support Bart Van Assche
@ 2021-02-22  7:12 ` Christoph Hellwig
  2021-02-23  3:40 ` Martin K. Petersen
  2021-02-26  2:22 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2021-02-22  7:12 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: Martin K . Petersen, James E . J . Bottomley, linux-scsi,
	chriscjsus, Christoph Hellwig, Jens Axboe, Alan Stern, stable

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] scsi/sd: Fix Opal support
  2021-02-22  2:10 [PATCH v2] scsi/sd: Fix Opal support Bart Van Assche
  2021-02-22  7:12 ` Christoph Hellwig
@ 2021-02-23  3:40 ` Martin K. Petersen
  2021-02-26  2:22 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2021-02-23  3:40 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: Martin K . Petersen, James E . J . Bottomley, linux-scsi,
	chriscjsus, Christoph Hellwig, Jens Axboe, Alan Stern, stable


Bart,

> 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.

Applied to 5.12/scsi-staging. Thanks for fixing this up!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] scsi/sd: Fix Opal support
  2021-02-22  2:10 [PATCH v2] scsi/sd: Fix Opal support Bart Van Assche
  2021-02-22  7:12 ` Christoph Hellwig
  2021-02-23  3:40 ` Martin K. Petersen
@ 2021-02-26  2:22 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2021-02-26  2:22 UTC (permalink / raw)
  To: James E . J . Bottomley, Bart Van Assche
  Cc: Martin K . Petersen, linux-scsi, chriscjsus, Alan Stern, stable,
	Jens Axboe, Christoph Hellwig

On Sun, 21 Feb 2021 18:10:42 -0800, Bart Van Assche wrote:

> 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.

Applied to 5.12/scsi-queue, thanks!

[1/1] scsi/sd: Fix Opal support
      https://git.kernel.org/mkp/scsi/c/aaf15f8c6de9

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-02-26  2:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-22  2:10 [PATCH v2] scsi/sd: Fix Opal support Bart Van Assche
2021-02-22  7:12 ` Christoph Hellwig
2021-02-23  3:40 ` Martin K. Petersen
2021-02-26  2:22 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox