diff mbox series

scsi: depopulation and restoration in progress

Message ID 20231015050650.131145-1-dgilbert@interlog.com (mailing list archive)
State Accepted
Headers show
Series scsi: depopulation and restoration in progress | expand

Commit Message

Douglas Gilbert Oct. 15, 2023, 5:06 a.m. UTC
The default handling of the NOT READY sense key is to wait
for the device to become ready. The "wait" is assumed to
be relatively short. However there is a sub-class of NOT
READY that have the "... in progress" phrase in their
additional sense code and these can take much longer.
Following on from commit 505aa4b6a8834 we now have element
depopulation and restoration that can take a long time.
For example, over 24 hours for a 20 TB, 7200 rpm hard
disk to depopulate 1 of its 20 elements.

Add handling of asc/ascq: 0x4,0x24 (depopulation in progress)
and asc/ascq: 0x4,0x25 (depopulation restoration in progress)
to sd.c . The scsi_lib.c has incomplete handling of these
two messages, so complete it.

Signed-off-by: Douglas Gilbert <dgilbert@interlog.com>
---
 drivers/scsi/scsi_lib.c | 1 +
 drivers/scsi/sd.c       | 4 ++++
 2 files changed, 5 insertions(+)

Comments

Martin K. Petersen Oct. 17, 2023, 1:02 a.m. UTC | #1
Doug,

> Add handling of asc/ascq: 0x4,0x24 (depopulation in progress) and
> asc/ascq: 0x4,0x25 (depopulation restoration in progress) to sd.c .
> The scsi_lib.c has incomplete handling of these two messages, so
> complete it.

Applied to 6.7/scsi-staging, thanks!
Martin K. Petersen Oct. 25, 2023, 2:19 a.m. UTC | #2
On Sun, 15 Oct 2023 01:06:50 -0400, Douglas Gilbert wrote:

> The default handling of the NOT READY sense key is to wait
> for the device to become ready. The "wait" is assumed to
> be relatively short. However there is a sub-class of NOT
> READY that have the "... in progress" phrase in their
> additional sense code and these can take much longer.
> Following on from commit 505aa4b6a8834 we now have element
> depopulation and restoration that can take a long time.
> For example, over 24 hours for a 20 TB, 7200 rpm hard
> disk to depopulate 1 of its 20 elements.
> 
> [...]

Applied to 6.7/scsi-queue, thanks!

[1/1] scsi: depopulation and restoration in progress
      https://git.kernel.org/mkp/scsi/c/2bbeb8d12404
diff mbox series

Patch

diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index c2f647a7c1b0..9adde7d9830a 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -774,6 +774,7 @@  static void scsi_io_completion_action(struct scsi_cmnd *cmd, int result)
 				case 0x1b: /* sanitize in progress */
 				case 0x1d: /* configuration in progress */
 				case 0x24: /* depopulation in progress */
+				case 0x25: /* depopulation restore in progress */
 					action = ACTION_DELAYED_RETRY;
 					break;
 				case 0x0a: /* ALUA state transition */
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index c92a317ba547..519baef237f3 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -2224,6 +2224,10 @@  sd_spinup_disk(struct scsi_disk *sdkp)
 				break;	/* unavailable */
 			if (sshdr.asc == 4 && sshdr.ascq == 0x1b)
 				break;	/* sanitize in progress */
+			if (sshdr.asc == 4 && sshdr.ascq == 0x24)
+				break;	/* depopulation in progress */
+			if (sshdr.asc == 4 && sshdr.ascq == 0x25)
+				break;	/* depopulation restoration in progress */
 			/*
 			 * Issue command to spin up drive when not ready
 			 */