Merge tag 'scsi-postmerge' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb...
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 3 Feb 2018 21:07:56 +0000 (13:07 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 3 Feb 2018 21:07:56 +0000 (13:07 -0800)
Pull second set of SCSI updates from James Bottomley:
 "This is a set of three patches that depended on mq and zone changes in
  the block tree (now upstream)"

* tag 'scsi-postmerge' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
  scsi: sd: Remove zone write locking
  scsi: sd_zbc: Initialize device request queue zoned data
  scsi: scsi-mq-debugfs: Show more information

1  2 
drivers/scsi/sd.c
include/scsi/scsi_cmnd.h

diff --combined drivers/scsi/sd.c
index ce756d575aff9768593453e05e143ecd1c2d5753,f1157b4fe32ea267cb4065f6e083e72ff6bc9e4a..bff21e636dddefba176ff6a435cd23863335c3f8
@@@ -851,16 -851,13 +851,13 @@@ static int sd_setup_write_zeroes_cmnd(s
        struct scsi_disk *sdkp = scsi_disk(rq->rq_disk);
        u64 sector = blk_rq_pos(rq) >> (ilog2(sdp->sector_size) - 9);
        u32 nr_sectors = blk_rq_sectors(rq) >> (ilog2(sdp->sector_size) - 9);
-       int ret;
  
        if (!(rq->cmd_flags & REQ_NOUNMAP)) {
                switch (sdkp->zeroing_mode) {
                case SD_ZERO_WS16_UNMAP:
-                       ret = sd_setup_write_same16_cmnd(cmd, true);
-                       goto out;
+                       return sd_setup_write_same16_cmnd(cmd, true);
                case SD_ZERO_WS10_UNMAP:
-                       ret = sd_setup_write_same10_cmnd(cmd, true);
-                       goto out;
+                       return sd_setup_write_same10_cmnd(cmd, true);
                }
        }
  
                return BLKPREP_INVALID;
  
        if (sdkp->ws16 || sector > 0xffffffff || nr_sectors > 0xffff)
-               ret = sd_setup_write_same16_cmnd(cmd, false);
-       else
-               ret = sd_setup_write_same10_cmnd(cmd, false);
- out:
-       if (sd_is_zoned(sdkp) && ret == BLKPREP_OK)
-               return sd_zbc_write_lock_zone(cmd);
+               return sd_setup_write_same16_cmnd(cmd, false);
  
-       return ret;
+       return sd_setup_write_same10_cmnd(cmd, false);
  }
  
  static void sd_config_write_same(struct scsi_disk *sdkp)
@@@ -964,12 -955,6 +955,6 @@@ static int sd_setup_write_same_cmnd(str
  
        BUG_ON(bio_offset(bio) || bio_iovec(bio).bv_len != sdp->sector_size);
  
-       if (sd_is_zoned(sdkp)) {
-               ret = sd_zbc_write_lock_zone(cmd);
-               if (ret != BLKPREP_OK)
-                       return ret;
-       }
        sector >>= ilog2(sdp->sector_size) - 9;
        nr_sectors >>= ilog2(sdp->sector_size) - 9;
  
        ret = scsi_init_io(cmd);
        rq->__data_len = nr_bytes;
  
-       if (sd_is_zoned(sdkp) && ret != BLKPREP_OK)
-               sd_zbc_write_unlock_zone(cmd);
        return ret;
  }
  
@@@ -1036,19 -1018,12 +1018,12 @@@ static int sd_setup_read_write_cmnd(str
        sector_t threshold;
        unsigned int this_count = blk_rq_sectors(rq);
        unsigned int dif, dix;
-       bool zoned_write = sd_is_zoned(sdkp) && rq_data_dir(rq) == WRITE;
        int ret;
        unsigned char protect;
  
-       if (zoned_write) {
-               ret = sd_zbc_write_lock_zone(SCpnt);
-               if (ret != BLKPREP_OK)
-                       return ret;
-       }
        ret = scsi_init_io(SCpnt);
        if (ret != BLKPREP_OK)
-               goto out;
+               return ret;
        WARN_ON_ONCE(SCpnt != rq->special);
  
        /* from here on until we're complete, any goto out
         */
        ret = BLKPREP_OK;
   out:
-       if (zoned_write && ret != BLKPREP_OK)
-               sd_zbc_write_unlock_zone(SCpnt);
        return ret;
  }
  
@@@ -1314,9 -1286,6 +1286,6 @@@ static void sd_uninit_command(struct sc
        struct request *rq = SCpnt->request;
        u8 *cmnd;
  
-       if (SCpnt->flags & SCMD_ZONE_WRITE_LOCK)
-               sd_zbc_write_unlock_zone(SCpnt);
        if (rq->rq_flags & RQF_SPECIAL_PAYLOAD)
                __free_page(rq->special_vec.bv_page);
  
@@@ -2172,7 -2141,7 +2141,7 @@@ sd_spinup_disk(struct scsi_disk *sdkp
                        }
                        /* Wait 1 second for next try */
                        msleep(1000);
 -                      printk(".");
 +                      printk(KERN_CONT ".");
  
                /*
                 * Wait for USB flash devices with slow firmware.
  
        if (spintime) {
                if (scsi_status_is_good(the_result))
 -                      printk("ready\n");
 +                      printk(KERN_CONT "ready\n");
                else
 -                      printk("not responding...\n");
 +                      printk(KERN_CONT "not responding...\n");
        }
  }
  
diff --combined include/scsi/scsi_cmnd.h
index 949a016dd7fa3f50a0eb44cf0f291fd364da37ce,6bce2f64c22014f3b3ccc7866b9499262849b1b2..d8d4a902a88dedbc93ac8da1ca99bb5f3d394d65
@@@ -58,8 -58,7 +58,7 @@@ struct scsi_pointer 
  /* for scmd->flags */
  #define SCMD_TAGGED           (1 << 0)
  #define SCMD_UNCHECKED_ISA_DMA        (1 << 1)
- #define SCMD_ZONE_WRITE_LOCK  (1 << 2)
- #define SCMD_INITIALIZED      (1 << 3)
+ #define SCMD_INITIALIZED      (1 << 2)
  /* flags preserved across unprep / reprep */
  #define SCMD_PRESERVED_FLAGS  (SCMD_UNCHECKED_ISA_DMA | SCMD_INITIALIZED)
  
@@@ -171,6 -170,7 +170,6 @@@ extern void *scsi_kmap_atomic_sg(struc
  extern void scsi_kunmap_atomic_sg(void *virt);
  
  extern int scsi_init_io(struct scsi_cmnd *cmd);
 -extern void scsi_initialize_rq(struct request *rq);
  
  extern int scsi_dma_map(struct scsi_cmnd *cmd);
  extern void scsi_dma_unmap(struct scsi_cmnd *cmd);