Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 25 Mar 2022 02:37:53 +0000 (19:37 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 25 Mar 2022 02:37:53 +0000 (19:37 -0700)
Pull SCSI updates from James Bottomley:
 "This series consists of the usual driver updates (qla2xxx, pm8001,
  libsas, smartpqi, scsi_debug, lpfc, iscsi, mpi3mr) plus minor updates
  and bug fixes.

  The high blast radius core update is the removal of write same, which
  affects block and several non-SCSI devices. The other big change,
  which is more local, is the removal of the SCSI pointer"

* tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (281 commits)
  scsi: scsi_ioctl: Drop needless assignment in sg_io()
  scsi: bsg: Drop needless assignment in scsi_bsg_sg_io_fn()
  scsi: lpfc: Copyright updates for 14.2.0.0 patches
  scsi: lpfc: Update lpfc version to 14.2.0.0
  scsi: lpfc: SLI path split: Refactor BSG paths
  scsi: lpfc: SLI path split: Refactor Abort paths
  scsi: lpfc: SLI path split: Refactor SCSI paths
  scsi: lpfc: SLI path split: Refactor CT paths
  scsi: lpfc: SLI path split: Refactor misc ELS paths
  scsi: lpfc: SLI path split: Refactor VMID paths
  scsi: lpfc: SLI path split: Refactor FDISC paths
  scsi: lpfc: SLI path split: Refactor LS_RJT paths
  scsi: lpfc: SLI path split: Refactor LS_ACC paths
  scsi: lpfc: SLI path split: Refactor the RSCN/SCR/RDF/EDC/FARPR paths
  scsi: lpfc: SLI path split: Refactor PLOGI/PRLI/ADISC/LOGO paths
  scsi: lpfc: SLI path split: Refactor base ELS paths and the FLOGI path
  scsi: lpfc: SLI path split: Introduce lpfc_prep_wqe
  scsi: lpfc: SLI path split: Refactor fast and slow paths to native SLI4
  scsi: lpfc: SLI path split: Refactor lpfc_iocbq
  scsi: lpfc: Use kcalloc()
  ...

51 files changed:
1  2 
block/blk-core.c
block/blk-lib.c
block/blk-merge.c
block/blk-sysfs.c
block/blk-zoned.c
block/blk.h
block/bounce.c
drivers/ata/libata-scsi.c
drivers/block/drbd/drbd_receiver.c
drivers/block/drbd/drbd_req.c
drivers/block/drbd/drbd_worker.c
drivers/block/pktcdvd.c
drivers/block/rnbd/rnbd-clt.c
drivers/block/rnbd/rnbd-clt.h
drivers/block/rnbd/rnbd-proto.h
drivers/block/rnbd/rnbd-srv.c
drivers/md/dm-core.h
drivers/md/dm-crypt.c
drivers/md/dm-io.c
drivers/md/dm-mpath.c
drivers/md/dm-rq.c
drivers/md/dm-table.c
drivers/md/dm.c
drivers/md/md-multipath.c
drivers/md/raid1.c
drivers/md/raid10.c
drivers/md/raid5.c
drivers/scsi/fnic/fnic_scsi.c
drivers/scsi/lpfc/lpfc.h
drivers/scsi/lpfc/lpfc_attr.c
drivers/scsi/lpfc/lpfc_els.c
drivers/scsi/lpfc/lpfc_nportdisc.c
drivers/scsi/mpi3mr/mpi3mr.h
drivers/scsi/mpt3sas/mpt3sas_base.c
drivers/scsi/qedi/qedi_fw.c
drivers/scsi/qla2xxx/qla_def.h
drivers/scsi/scsi_debug.c
drivers/scsi/scsi_lib.c
drivers/scsi/sd.c
drivers/scsi/sg.c
drivers/scsi/sr.c
drivers/scsi/st.c
drivers/scsi/ufs/ufshcd.c
drivers/scsi/ufs/ufshpb.c
drivers/target/target_core_pscsi.c
include/linux/bio.h
include/linux/blk_types.h
include/linux/blkdev.h
include/linux/device-mapper.h
include/scsi/scsi_cmnd.h
kernel/trace/blktrace.c

@@@ -762,122 -903,6 +761,118 @@@ void submit_bio_noacct_nocheck(struct b
        else
                __submit_bio_noacct(bio);
  }
-       case REQ_OP_WRITE_SAME:
-               if (!q->limits.max_write_same_sectors)
-                       goto not_supported;
-               break;
 +
 +/**
 + * submit_bio_noacct - re-submit a bio to the block device layer for I/O
 + * @bio:  The bio describing the location in memory and on the device.
 + *
 + * This is a version of submit_bio() that shall only be used for I/O that is
 + * resubmitted to lower level drivers by stacking block drivers.  All file
 + * systems and other upper level users of the block layer should use
 + * submit_bio() instead.
 + */
 +void submit_bio_noacct(struct bio *bio)
 +{
 +      struct block_device *bdev = bio->bi_bdev;
 +      struct request_queue *q = bdev_get_queue(bdev);
 +      blk_status_t status = BLK_STS_IOERR;
 +      struct blk_plug *plug;
 +
 +      might_sleep();
 +
 +      plug = blk_mq_plug(q, bio);
 +      if (plug && plug->nowait)
 +              bio->bi_opf |= REQ_NOWAIT;
 +
 +      /*
 +       * For a REQ_NOWAIT based request, return -EOPNOTSUPP
 +       * if queue does not support NOWAIT.
 +       */
 +      if ((bio->bi_opf & REQ_NOWAIT) && !blk_queue_nowait(q))
 +              goto not_supported;
 +
 +      if (should_fail_bio(bio))
 +              goto end_io;
 +      if (unlikely(bio_check_ro(bio)))
 +              goto end_io;
 +      if (!bio_flagged(bio, BIO_REMAPPED)) {
 +              if (unlikely(bio_check_eod(bio)))
 +                      goto end_io;
 +              if (bdev->bd_partno && unlikely(blk_partition_remap(bio)))
 +                      goto end_io;
 +      }
 +
 +      /*
 +       * Filter flush bio's early so that bio based drivers without flush
 +       * support don't have to worry about them.
 +       */
 +      if (op_is_flush(bio->bi_opf) &&
 +          !test_bit(QUEUE_FLAG_WC, &q->queue_flags)) {
 +              bio->bi_opf &= ~(REQ_PREFLUSH | REQ_FUA);
 +              if (!bio_sectors(bio)) {
 +                      status = BLK_STS_OK;
 +                      goto end_io;
 +              }
 +      }
 +
 +      if (!test_bit(QUEUE_FLAG_POLL, &q->queue_flags))
 +              bio_clear_polled(bio);
 +
 +      switch (bio_op(bio)) {
 +      case REQ_OP_DISCARD:
 +              if (!blk_queue_discard(q))
 +                      goto not_supported;
 +              break;
 +      case REQ_OP_SECURE_ERASE:
 +              if (!blk_queue_secure_erase(q))
 +                      goto not_supported;
 +              break;
 +      case REQ_OP_ZONE_APPEND:
 +              status = blk_check_zone_append(q, bio);
 +              if (status != BLK_STS_OK)
 +                      goto end_io;
 +              break;
 +      case REQ_OP_ZONE_RESET:
 +      case REQ_OP_ZONE_OPEN:
 +      case REQ_OP_ZONE_CLOSE:
 +      case REQ_OP_ZONE_FINISH:
 +              if (!blk_queue_is_zoned(q))
 +                      goto not_supported;
 +              break;
 +      case REQ_OP_ZONE_RESET_ALL:
 +              if (!blk_queue_is_zoned(q) || !blk_queue_zone_resetall(q))
 +                      goto not_supported;
 +              break;
 +      case REQ_OP_WRITE_ZEROES:
 +              if (!q->limits.max_write_zeroes_sectors)
 +                      goto not_supported;
 +              break;
 +      default:
 +              break;
 +      }
 +
 +      if (blk_throtl_bio(bio))
 +              return;
 +
 +      blk_cgroup_bio_start(bio);
 +      blkcg_bio_issue_init(bio);
 +
 +      if (!bio_flagged(bio, BIO_TRACE_COMPLETION)) {
 +              trace_block_bio_queue(bio);
 +              /* Now that enqueuing has been traced, we need to trace
 +               * completion as well.
 +               */
 +              bio_set_flag(bio, BIO_TRACE_COMPLETION);
 +      }
 +      submit_bio_noacct_nocheck(bio);
 +      return;
 +
 +not_supported:
 +      status = BLK_STS_NOTSUPP;
 +end_io:
 +      bio->bi_status = status;
 +      bio_endio(bio);
 +}
  EXPORT_SYMBOL(submit_bio_noacct);
  
  /**
diff --cc block/blk-lib.c
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc block/blk.h
Simple merge
diff --cc block/bounce.c
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -326,14 -326,9 +326,9 @@@ void drbd_csum_bio(struct crypto_shash 
        bio_for_each_segment(bvec, bio, iter) {
                u8 *src;
  
 -              src = kmap_atomic(bvec.bv_page);
 -              crypto_shash_update(desc, src + bvec.bv_offset, bvec.bv_len);
 -              kunmap_atomic(src);
 +              src = bvec_kmap_local(&bvec);
 +              crypto_shash_update(desc, src, bvec.bv_len);
 +              kunmap_local(src);
-               /* REQ_OP_WRITE_SAME has only one segment,
-                * checksum the payload only once. */
-               if (bio_op(bio) == REQ_OP_WRITE_SAME)
-                       break;
        }
        crypto_shash_final(desc, digest);
        shash_desc_zero(desc);
Simple merge
@@@ -1606,13 -1607,13 +1603,13 @@@ struct rnbd_clt_dev *rnbd_clt_map_devic
        }
  
        rnbd_clt_info(dev,
-                      "map_device: Device mapped as %s (nsectors: %zu, logical_block_size: %d, physical_block_size: %d, max_write_same_sectors: %d, max_discard_sectors: %d, discard_granularity: %d, discard_alignment: %d, secure_discard: %d, max_segments: %d, max_hw_sectors: %d, wc: %d, fua: %d)\n",
 -                     "map_device: Device mapped as %s (nsectors: %zu, logical_block_size: %d, physical_block_size: %d, max_discard_sectors: %d, discard_granularity: %d, discard_alignment: %d, secure_discard: %d, max_segments: %d, max_hw_sectors: %d, rotational: %d, wc: %d, fua: %d)\n",
++                     "map_device: Device mapped as %s (nsectors: %zu, logical_block_size: %d, physical_block_size: %d, max_discard_sectors: %d, discard_granularity: %d, discard_alignment: %d, secure_discard: %d, max_segments: %d, max_hw_sectors: %d, wc: %d, fua: %d)\n",
                       dev->gd->disk_name, dev->nsectors,
                       dev->logical_block_size, dev->physical_block_size,
-                      dev->max_write_same_sectors, dev->max_discard_sectors,
+                      dev->max_discard_sectors,
                       dev->discard_granularity, dev->discard_alignment,
                       dev->secure_discard, dev->max_segments,
 -                     dev->max_hw_sectors, dev->rotational, dev->wc, dev->fua);
 +                     dev->max_hw_sectors, dev->wc, dev->fua);
  
        mutex_unlock(&dev->lock);
        rnbd_clt_put_sess(sess);
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc drivers/md/dm.c
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -983,9 -982,11 +982,9 @@@ static void fnic_fcpio_icmnd_cmpl_handl
        }
  
        /* Break link with the SCSI command */
-       CMD_SP(sc) = NULL;
-       CMD_FLAGS(sc) |= FNIC_IO_DONE;
+       fnic_priv(sc)->io_req = NULL;
+       fnic_priv(sc)->flags |= FNIC_IO_DONE;
  
 -      spin_unlock_irqrestore(io_lock, flags);
 -
        if (hdr_status != FCPIO_SUCCESS) {
                atomic64_inc(&fnic_stats->io_stats.io_failures);
                shost_printk(KERN_ERR, fnic->lport->host, "hdr status = %s\n",
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -877,8 -879,10 +879,10 @@@ struct mpi3mr_fwevt 
        bool send_ack;
        bool process_evt;
        u32 evt_ctx;
+       bool pending_at_sml;
+       bool discard;
        struct kref ref_count;
 -      char event_data[0] __aligned(4);
 +      char event_data[] __aligned(4);
  };
  
  
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -121,8 -122,12 +121,7 @@@ static void scsi_disk_release(struct de
  
  static DEFINE_IDA(sd_index_ida);
  
 -/* This semaphore is used to mediate the 0->1 reference get in the
 - * face of object destruction (i.e. we can't allow a get on an
 - * object after last put) */
 -static DEFINE_MUTEX(sd_ref_mutex);
 -
  static struct kmem_cache *sd_cdb_cache;
- static mempool_t *sd_cdb_pool;
  static mempool_t *sd_page_pool;
  static struct lock_class_key sd_bio_compl_lkclass;
  
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -10,9 -10,9 +10,8 @@@
  #include <linux/timer.h>
  #include <linux/scatterlist.h>
  #include <scsi/scsi_device.h>
- #include <scsi/scsi_request.h>
  
  struct Scsi_Host;
 -struct scsi_driver;
  
  /*
   * MAX_COMMAND_SIZE is:
@@@ -158,7 -153,16 +152,8 @@@ static inline void *scsi_cmd_priv(struc
        return cmd + 1;
  }
  
 -/* make sure not to use it with passthrough commands */
 -static inline struct scsi_driver *scsi_cmd_to_driver(struct scsi_cmnd *cmd)
 -{
 -      struct request *rq = scsi_cmd_to_rq(cmd);
 -
 -      return *(struct scsi_driver **)rq->q->disk->private_data;
 -}
 -
  void scsi_done(struct scsi_cmnd *cmd);
+ void scsi_done_direct(struct scsi_cmnd *cmd);
  
  extern void scsi_finish_command(struct scsi_cmnd *cmd);
  
Simple merge