From a39cabc3864fb1ee64092569773d12400478b647 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 30 Oct 2023 16:12:16 +0000 Subject: [PATCH] Revert "ata,scsi: do not issue START STOP UNIT on resume" This reverts commit dc3354c961badffc24117390ed2d4d12988d171b which is commit 0a8589055936d8feb56477123a8373ac634018fa upstream. It breaks the Android ABI so revert it for now, if it is needed in the future, it can be brought back in an ABI-safe way. Bug: 161946584 Signed-off-by: Greg Kroah-Hartman Change-Id: I667c8e367971886e847b2240d2c1efcf6a2fe92c --- drivers/ata/libata-scsi.c | 7 ------- drivers/scsi/sd.c | 9 +++------ include/scsi/scsi_device.h | 1 - 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 56cf555fd70a..c73e8a77c157 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -1086,14 +1086,7 @@ int ata_scsi_dev_config(struct scsi_device *sdev, struct ata_device *dev) } } else { sdev->sector_size = ata_id_logical_sector_size(dev->id); - /* - * Stop the drive on suspend but do not issue START STOP UNIT - * on resume as this is not necessary and may fail: the device - * will be woken up by ata_port_pm_resume() with a port reset - * and device revalidation. - */ sdev->manage_start_stop = 1; - sdev->no_start_on_resume = 1; } /* diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 350936860554..0efc659b8336 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -3742,7 +3742,7 @@ static int sd_suspend_runtime(struct device *dev) static int sd_resume(struct device *dev) { struct scsi_disk *sdkp = dev_get_drvdata(dev); - int ret = 0; + int ret; if (!sdkp) /* E.g.: runtime resume at the start of sd_probe() */ return 0; @@ -3750,11 +3750,8 @@ static int sd_resume(struct device *dev) if (!sdkp->device->manage_start_stop) return 0; - if (!sdkp->device->no_start_on_resume) { - sd_printk(KERN_NOTICE, sdkp, "Starting disk\n"); - ret = sd_start_stop_device(sdkp, 1); - } - + sd_printk(KERN_NOTICE, sdkp, "Starting disk\n"); + ret = sd_start_stop_device(sdkp, 1); if (!ret) opal_unlock_from_suspend(sdkp->opal_dev); return ret; diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 506af7a1762e..26c2ac1ca6a1 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h @@ -194,7 +194,6 @@ struct scsi_device { unsigned no_start_on_add:1; /* do not issue start on add */ unsigned allow_restart:1; /* issue START_UNIT in error handler */ unsigned manage_start_stop:1; /* Let HLD (sd) manage start/stop */ - unsigned no_start_on_resume:1; /* Do not issue START_STOP_UNIT on resume */ unsigned start_stop_pwr_cond:1; /* Set power cond. in START_STOP_UNIT */ unsigned no_uld_attach:1; /* disable connecting to upper level drivers */ unsigned select_no_atn:1;