scsi: mpt3sas: Add io_uring iopoll support
[linux-2.6-block.git] / drivers / scsi / scsi_scan.c
index 5ce45ef9808f18dc3953c9ca6e8a2af6253b5f27..e06a2602fca4cfa968e156693439e49506ae056e 100644 (file)
@@ -217,6 +217,7 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget,
 {
        unsigned int depth;
        struct scsi_device *sdev;
+       struct request_queue *q;
        int display_failure_msg = 1, ret;
        struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
 
@@ -266,16 +267,21 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget,
         */
        sdev->borken = 1;
 
-       sdev->request_queue = scsi_mq_alloc_queue(sdev);
-       if (!sdev->request_queue) {
+       sdev->sg_reserved_size = INT_MAX;
+
+       q = blk_mq_init_queue(&sdev->host->tag_set);
+       if (IS_ERR(q)) {
                /* release fn is set up in scsi_sysfs_device_initialise, so
                 * have to free and put manually here */
                put_device(&starget->dev);
                kfree(sdev);
                goto out;
        }
-       WARN_ON_ONCE(!blk_get_queue(sdev->request_queue));
-       sdev->request_queue->queuedata = sdev;
+       sdev->request_queue = q;
+       q->queuedata = sdev;
+       __scsi_init_queue(sdev->host, q);
+       blk_queue_flag_set(QUEUE_FLAG_SCSI_PASSTHROUGH, q);
+       WARN_ON_ONCE(!blk_get_queue(q));
 
        depth = sdev->host->cmd_per_lun ?: 1;
 
@@ -969,6 +975,9 @@ static int scsi_add_lun(struct scsi_device *sdev, unsigned char *inq_result,
        if (*bflags & BLIST_UNMAP_LIMIT_WS)
                sdev->unmap_limit_for_ws = 1;
 
+       if (*bflags & BLIST_IGN_MEDIA_CHANGE)
+               sdev->ignore_media_change = 1;
+
        sdev->eh_timeout = SCSI_DEFAULT_EH_TIMEOUT;
 
        if (*bflags & BLIST_TRY_VPD_PAGES)