Merge branch '5.4/scsi-fixes' into 5.5/scsi-queue
[linux-2.6-microblaze.git] / drivers / scsi / sd.c
index 0f96eb0..326e287 100644 (file)
@@ -1211,9 +1211,6 @@ static blk_status_t sd_setup_read_write_cmnd(struct scsi_cmnd *cmd)
        dix = scsi_prot_sg_count(cmd);
        dif = scsi_host_dif_capable(cmd->device->host, sdkp->protection_type);
 
-       if (write && dix)
-               t10_pi_prepare(cmd->request, sdkp->protection_type);
-
        if (dif || dix)
                protect = sd_setup_protect_cmnd(cmd, dix, dif);
        else
@@ -1293,7 +1290,9 @@ static blk_status_t sd_init_command(struct scsi_cmnd *cmd)
        case REQ_OP_WRITE:
                return sd_setup_read_write_cmnd(cmd);
        case REQ_OP_ZONE_RESET:
-               return sd_zbc_setup_reset_cmnd(cmd);
+               return sd_zbc_setup_reset_cmnd(cmd, false);
+       case REQ_OP_ZONE_RESET_ALL:
+               return sd_zbc_setup_reset_cmnd(cmd, true);
        default:
                WARN_ON_ONCE(1);
                return BLK_STS_NOTSUPP;
@@ -1960,6 +1959,7 @@ static int sd_done(struct scsi_cmnd *SCpnt)
        case REQ_OP_WRITE_ZEROES:
        case REQ_OP_WRITE_SAME:
        case REQ_OP_ZONE_RESET:
+       case REQ_OP_ZONE_RESET_ALL:
                if (!result) {
                        good_bytes = blk_rq_bytes(req);
                        scsi_set_resid(SCpnt, 0);
@@ -2053,11 +2053,6 @@ static int sd_done(struct scsi_cmnd *SCpnt)
                                           "sd_done: completed %d of %d bytes\n",
                                           good_bytes, scsi_bufflen(SCpnt)));
 
-       if (rq_data_dir(SCpnt->request) == READ && scsi_prot_sg_count(SCpnt) &&
-           good_bytes)
-               t10_pi_complete(SCpnt->request, sdkp->protection_type,
-                               good_bytes / scsi_prot_interval(SCpnt));
-
        return good_bytes;
 }
 
@@ -3373,6 +3368,10 @@ static int sd_probe(struct device *dev)
        }
 
        blk_pm_runtime_init(sdp->request_queue, dev);
+       if (sdp->rpm_autosuspend) {
+               pm_runtime_set_autosuspend_delay(dev,
+                       sdp->host->hostt->rpm_autosuspend_delay);
+       }
        device_add_disk(dev, gd, NULL);
        if (sdkp->capacity)
                sd_dif_config_host(sdkp);