Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 26 Apr 2023 22:39:25 +0000 (15:39 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 26 Apr 2023 22:39:25 +0000 (15:39 -0700)
Pull SCSI updates from James Bottomley:
 "Updates to the usual drivers (megaraid_sas, scsi_debug, lpfc, target,
  mpi3mr, hisi_sas, arcmsr).

  The major core change is the constification of the host templates
  (which touches everything) along with other minor fixups and clean
  ups"

* tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (207 commits)
  scsi: ufs: mcq: Use pointer arithmetic in ufshcd_send_command()
  scsi: ufs: mcq: Annotate ufshcd_inc_sq_tail() appropriately
  scsi: cxlflash: s/semahpore/semaphore/
  scsi: lpfc: Silence an incorrect device output
  scsi: mpi3mr: Use IRQ save variants of spinlock to protect chain frame allocation
  scsi: scsi_debug: Fix missing error code in scsi_debug_init()
  scsi: hisi_sas: Work around build failure in suspend function
  scsi: lpfc: Fix ioremap issues in lpfc_sli4_pci_mem_setup()
  scsi: mpt3sas: Fix an issue when driver is being removed
  scsi: mpt3sas: Remove HBA BIOS version in the kernel log
  scsi: target: core: Fix invalid memory access
  scsi: scsi_debug: Drop sdebug_queue
  scsi: scsi_debug: Only allow sdebug_max_queue be modified when no shosts
  scsi: scsi_debug: Use scsi_host_busy() in delay_store() and ndelay_store()
  scsi: scsi_debug: Use blk_mq_tagset_busy_iter() in stop_all_queued()
  scsi: scsi_debug: Use blk_mq_tagset_busy_iter() in sdebug_blk_mq_poll()
  scsi: scsi_debug: Dynamically allocate sdebug_queued_cmd
  scsi: scsi_debug: Use scsi_block_requests() to block queues
  scsi: scsi_debug: Protect block_unblock_all_queues() with mutex
  scsi: scsi_debug: Change shost list lock to a mutex
  ...

14 files changed:
1  2 
drivers/ata/ahci_imx.c
drivers/ata/ahci_mtk.c
drivers/ata/libahci_platform.c
drivers/ata/pata_ixp4xx_cf.c
drivers/ata/pata_macio.c
drivers/ata/pata_parport/pata_parport.c
drivers/ata/sata_dwc_460ex.c
drivers/scsi/iscsi_tcp.c
drivers/scsi/lpfc/lpfc_init.c
drivers/scsi/mpi3mr/mpi3mr_fw.c
drivers/scsi/qla2xxx/qla_os.c
drivers/ufs/core/ufshcd.c
drivers/vhost/scsi.c
include/ufs/ufshcd.h

diff --combined drivers/ata/ahci_imx.c
@@@ -418,7 -418,7 +418,7 @@@ static int __sata_ahci_read_temperature
  
  static int sata_ahci_read_temperature(struct thermal_zone_device *tz, int *temp)
  {
 -      return __sata_ahci_read_temperature(tz->devdata, temp);
 +      return __sata_ahci_read_temperature(thermal_zone_device_priv(tz), temp);
  }
  
  static ssize_t sata_ahci_show_temp(struct device *dev,
@@@ -979,7 -979,7 +979,7 @@@ static u32 imx_ahci_parse_props(struct 
        return reg_value;
  }
  
- static struct scsi_host_template ahci_platform_sht = {
+ static const struct scsi_host_template ahci_platform_sht = {
        AHCI_SHT(DRV_NAME),
  };
  
diff --combined drivers/ata/ahci_mtk.c
@@@ -37,7 -37,7 +37,7 @@@ static const struct ata_port_info ahci_
        .port_ops       = &ahci_platform_ops,
  };
  
- static struct scsi_host_template ahci_platform_sht = {
+ static const struct scsi_host_template ahci_platform_sht = {
        AHCI_SHT(DRV_NAME),
  };
  
@@@ -106,7 -106,7 +106,7 @@@ static int mtk_ahci_parse_property(stru
        struct device_node *np = dev->of_node;
  
        /* enable SATA function if needed */
 -      if (of_find_property(np, "mediatek,phy-mode", NULL)) {
 +      if (of_property_present(np, "mediatek,phy-mode")) {
                plat->mode = syscon_regmap_lookup_by_phandle(
                                        np, "mediatek,phy-mode");
                if (IS_ERR(plat->mode)) {
@@@ -363,7 -363,7 +363,7 @@@ static int ahci_platform_get_phy(struc
        switch (rc) {
        case -ENOSYS:
                /* No PHY support. Check if PHY is required. */
 -              if (of_find_property(node, "phys", NULL)) {
 +              if (of_property_present(node, "phys")) {
                        dev_err(dev,
                                "couldn't get PHY in node %pOFn: ENOSYS\n",
                                node);
@@@ -680,7 -680,7 +680,7 @@@ EXPORT_SYMBOL_GPL(ahci_platform_get_res
  int ahci_platform_init_host(struct platform_device *pdev,
                            struct ahci_host_priv *hpriv,
                            const struct ata_port_info *pi_template,
-                           struct scsi_host_template *sht)
+                           const struct scsi_host_template *sht)
  {
        struct device *dev = &pdev->dev;
        struct ata_port_info pi = *pi_template;
@@@ -17,7 -17,6 +17,7 @@@
  #include <linux/module.h>
  #include <linux/libata.h>
  #include <linux/irq.h>
 +#include <linux/of.h>
  #include <linux/platform_device.h>
  #include <linux/regmap.h>
  #include <scsi/scsi_host.h>
@@@ -174,7 -173,7 +174,7 @@@ static unsigned int ixp4xx_mmio_data_xf
        return words << 1;
  }
  
- static struct scsi_host_template ixp4xx_sht = {
+ static const struct scsi_host_template ixp4xx_sht = {
        ATA_PIO_SHT(DRV_NAME),
  };
  
diff --combined drivers/ata/pata_macio.c
@@@ -21,7 -21,6 +21,7 @@@
  #include <linux/adb.h>
  #include <linux/pmu.h>
  #include <linux/scatterlist.h>
 +#include <linux/irqdomain.h>
  #include <linux/of.h>
  #include <linux/gfp.h>
  #include <linux/pci.h>
@@@ -909,7 -908,7 +909,7 @@@ static int pata_macio_do_resume(struct 
  }
  #endif /* CONFIG_PM_SLEEP */
  
- static struct scsi_host_template pata_macio_sht = {
+ static const struct scsi_host_template pata_macio_sht = {
        __ATA_BASE_SHT(DRV_NAME),
        .sg_tablesize           = MAX_DCMDS,
        /* We may not need that strict one */
@@@ -6,7 -6,7 +6,7 @@@
  #include <linux/kernel.h>
  #include <linux/module.h>
  #include <linux/parport.h>
 -#include <linux/pata_parport.h>
 +#include "pata_parport.h"
  
  #define DRV_NAME "pata_parport"
  
@@@ -276,7 -276,7 +276,7 @@@ static void pi_release(struct pi_adapte
        module_put(pi->proto->owner);
  }
  
 -static int default_test_proto(struct pi_adapter *pi, char *scratch)
 +static int default_test_proto(struct pi_adapter *pi)
  {
        int j, k;
        int e[2] = { 0, 0 };
        return e[0] && e[1];    /* not here if both > 0 */
  }
  
 -static int pi_test_proto(struct pi_adapter *pi, char *scratch)
 +static int pi_test_proto(struct pi_adapter *pi)
  {
        int res;
  
        parport_claim_or_block(pi->pardev);
        if (pi->proto->test_proto)
 -              res = pi->proto->test_proto(pi, scratch, 1);
 +              res = pi->proto->test_proto(pi);
        else
 -              res = default_test_proto(pi, scratch);
 +              res = default_test_proto(pi);
        parport_release(pi->pardev);
  
        return res;
  }
  
 -static bool pi_probe_mode(struct pi_adapter *pi, int max, char *scratch)
 +static bool pi_probe_mode(struct pi_adapter *pi, int max)
  {
        int best, range;
  
                        range = 8;
                if (range == 8 && pi->port % 8)
                        return false;
 -              return !pi_test_proto(pi, scratch);
 +              return !pi_test_proto(pi);
        }
        best = -1;
        for (pi->mode = 0; pi->mode < max; pi->mode++) {
                        range = 8;
                if (range == 8 && pi->port % 8)
                        break;
 -              if (!pi_test_proto(pi, scratch))
 +              if (!pi_test_proto(pi))
                        best = pi->mode;
        }
        pi->mode = best;
        return best > -1;
  }
  
 -static bool pi_probe_unit(struct pi_adapter *pi, int unit, char *scratch)
 +static bool pi_probe_unit(struct pi_adapter *pi, int unit)
  {
        int max, s, e;
  
                for (pi->unit = s; pi->unit < e; pi->unit++) {
                        if (pi->proto->probe_unit(pi)) {
                                parport_release(pi->pardev);
 -                              return pi_probe_mode(pi, max, scratch);
 +                              return pi_probe_mode(pi, max);
                        }
                }
                parport_release(pi->pardev);
                return false;
        }
  
 -      return pi_probe_mode(pi, max, scratch);
 +      return pi_probe_mode(pi, max);
  }
  
  static void pata_parport_dev_release(struct device *dev)
  {
        struct pi_adapter *pi = container_of(dev, struct pi_adapter, dev);
  
 +      ida_free(&pata_parport_bus_dev_ids, dev->id);
        kfree(pi);
  }
  
@@@ -399,7 -398,7 +399,7 @@@ static struct device pata_parport_bus 
        .release = pata_parport_bus_release,
  };
  
- static struct scsi_host_template pata_parport_sht = {
+ static const struct scsi_host_template pata_parport_sht = {
        PATA_PARPORT_SHT("pata_parport")
  };
  
@@@ -420,6 -419,7 +420,6 @@@ static struct pi_adapter *pi_init_one(s
                        struct pi_protocol *pr, int mode, int unit, int delay)
  {
        struct pardev_cb par_cb = { };
 -      char scratch[512];
        const struct ata_port_info *ppi[] = { &pata_parport_port_info };
        struct ata_host *host;
        struct pi_adapter *pi;
        if (bus_for_each_dev(&pata_parport_bus_type, NULL, &match, pi_find_dev))
                return NULL;
  
 +      id = ida_alloc(&pata_parport_bus_dev_ids, GFP_KERNEL);
 +      if (id < 0)
 +              return NULL;
 +
        pi = kzalloc(sizeof(struct pi_adapter), GFP_KERNEL);
 -      if (!pi)
 +      if (!pi) {
 +              ida_free(&pata_parport_bus_dev_ids, id);
                return NULL;
 +      }
  
        /* set up pi->dev before pi_probe_unit() so it can use dev_printk() */
        pi->dev.parent = &pata_parport_bus;
        pi->dev.bus = &pata_parport_bus_type;
        pi->dev.driver = &pr->driver;
        pi->dev.release = pata_parport_dev_release;
 -      id = ida_alloc(&pata_parport_bus_dev_ids, GFP_KERNEL);
 -      if (id < 0)
 -              return NULL; /* pata_parport_dev_release will do kfree(pi) */
        pi->dev.id = id;
        dev_set_name(&pi->dev, "pata_parport.%u", pi->dev.id);
        if (device_register(&pi->dev)) {
                put_device(&pi->dev);
 -              goto out_ida_free;
 +              /* pata_parport_dev_release will do ida_free(dev->id) and kfree(pi) */
 +              return NULL;
        }
  
        pi->proto = pr;
        pi->port = parport->base;
  
        par_cb.private = pi;
 -      pi->pardev = parport_register_dev_model(parport, DRV_NAME, &par_cb,
 -                                              pi->dev.id);
 +      pi->pardev = parport_register_dev_model(parport, DRV_NAME, &par_cb, id);
        if (!pi->pardev)
                goto out_module_put;
  
 -      if (!pi_probe_unit(pi, unit, scratch)) {
 +      if (!pi_probe_unit(pi, unit)) {
                dev_info(&pi->dev, "Adapter not found\n");
                goto out_unreg_parport;
        }
  
 -      pi->proto->log_adapter(pi, scratch, 1);
 +      pi->proto->log_adapter(pi);
  
        host = ata_host_alloc_pinfo(&pi->pardev->dev, ppi, 1);
        if (!host)
  
        pi_connect(pi);
        if (ata_host_activate(host, 0, NULL, 0, &pata_parport_sht))
 -              goto out_unreg_parport;
 +              goto out_disconnect;
  
        return pi;
  
 -out_unreg_parport:
 +out_disconnect:
        pi_disconnect(pi);
 +out_unreg_parport:
        parport_unregister_device(pi->pardev);
        if (pi->proto->release_proto)
                pi->proto->release_proto(pi);
@@@ -504,7 -500,8 +504,7 @@@ out_module_put
        module_put(pi->proto->owner);
  out_unreg_dev:
        device_unregister(&pi->dev);
 -out_ida_free:
 -      ida_free(&pata_parport_bus_dev_ids, pi->dev.id);
 +      /* pata_parport_dev_release will do ida_free(dev->id) and kfree(pi) */
        return NULL;
  }
  
@@@ -533,7 -530,7 +533,7 @@@ int pata_parport_register_driver(struc
        if (probe) {
                /* probe all parports using this protocol */
                idr_for_each_entry(&parport_list, parport, port_num)
 -                      pi_init_one(parport, pr, -1, 0, -1);
 +                      pi_init_one(parport, pr, -1, -1, -1);
        }
        mutex_unlock(&pi_mutex);
  
@@@ -629,7 -626,8 +629,7 @@@ static void pi_remove_one(struct devic
        pi_disconnect(pi);
        pi_release(pi);
        device_unregister(dev);
 -      ida_free(&pata_parport_bus_dev_ids, dev->id);
 -      /* pata_parport_dev_release will do kfree(pi) */
 +      /* pata_parport_dev_release will do ida_free(dev->id) and kfree(pi) */
  }
  
  static ssize_t delete_device_store(struct bus_type *bus, const char *buf,
        }
  
        pi_remove_one(dev);
 +      put_device(dev);
        mutex_unlock(&pi_mutex);
  
        return count;
@@@ -668,7 -665,7 +668,7 @@@ static void pata_parport_attach(struct 
        if (probe) {
                /* probe this port using all protocols */
                idr_for_each_entry(&protocols, pr, pr_num)
 -                      pi_init_one(port, pr, -1, 0, -1);
 +                      pi_init_one(port, pr, -1, -1, -1);
        }
        mutex_unlock(&pi_mutex);
  }
@@@ -810,7 -810,7 +810,7 @@@ static int sata_dwc_dma_get_channel(str
        struct device *dev = hsdev->dev;
  
  #ifdef CONFIG_SATA_DWC_OLD_DMA
 -      if (!of_find_property(dev->of_node, "dmas", NULL))
 +      if (!of_property_present(dev->of_node, "dmas"))
                return sata_dwc_dma_get_channel_old(hsdevp);
  #endif
  
@@@ -1076,7 -1076,7 +1076,7 @@@ static void sata_dwc_dev_select(struct 
  /*
   * scsi mid-layer and libata interface structures
   */
- static struct scsi_host_template sata_dwc_sht = {
+ static const struct scsi_host_template sata_dwc_sht = {
        ATA_NCQ_SHT(DRV_NAME),
        /*
         * test-only: Currently this driver doesn't handle NCQ
@@@ -1180,7 -1180,7 +1180,7 @@@ static int sata_dwc_probe(struct platfo
        }
  
  #ifdef CONFIG_SATA_DWC_OLD_DMA
 -      if (!of_find_property(np, "dmas", NULL)) {
 +      if (!of_property_present(np, "dmas")) {
                err = sata_dwc_dma_init_old(ofdev, hsdev);
                if (err)
                        return err;
diff --combined drivers/scsi/iscsi_tcp.c
@@@ -47,7 -47,7 +47,7 @@@ MODULE_DESCRIPTION("iSCSI/TCP data-path
  MODULE_LICENSE("GPL");
  
  static struct scsi_transport_template *iscsi_sw_tcp_scsi_transport;
- static struct scsi_host_template iscsi_sw_tcp_sht;
+ static const struct scsi_host_template iscsi_sw_tcp_sht;
  static struct iscsi_transport iscsi_sw_tcp_transport;
  
  static unsigned int iscsi_max_lun = ~0;
@@@ -771,12 -771,13 +771,12 @@@ static int iscsi_sw_tcp_conn_set_param(
                iscsi_set_param(cls_conn, param, buf, buflen);
                break;
        case ISCSI_PARAM_DATADGST_EN:
 -              iscsi_set_param(cls_conn, param, buf, buflen);
 -
                mutex_lock(&tcp_sw_conn->sock_lock);
                if (!tcp_sw_conn->sock) {
                        mutex_unlock(&tcp_sw_conn->sock_lock);
                        return -ENOTCONN;
                }
 +              iscsi_set_param(cls_conn, param, buf, buflen);
                tcp_sw_conn->sendpage = conn->datadgst_en ?
                        sock_no_sendpage : tcp_sw_conn->sock->ops->sendpage;
                mutex_unlock(&tcp_sw_conn->sock_lock);
@@@ -1071,7 -1072,7 +1071,7 @@@ static int iscsi_sw_tcp_slave_configure
        return 0;
  }
  
- static struct scsi_host_template iscsi_sw_tcp_sht = {
+ static const struct scsi_host_template iscsi_sw_tcp_sht = {
        .module                 = THIS_MODULE,
        .name                   = "iSCSI Initiator over TCP/IP",
        .queuecommand           = iscsi_queuecommand,
@@@ -32,7 -32,6 +32,6 @@@
  #include <linux/spinlock.h>
  #include <linux/sched/clock.h>
  #include <linux/ctype.h>
- #include <linux/aer.h>
  #include <linux/slab.h>
  #include <linux/firmware.h>
  #include <linux/miscdevice.h>
@@@ -2148,7 -2147,7 +2147,7 @@@ lpfc_handle_eratt_s4(struct lpfc_hba *p
                /* fall through for not able to recover */
                lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT,
                                "3152 Unrecoverable error\n");
-               phba->link_state = LPFC_HBA_ERROR;
+               lpfc_sli4_offline_eratt(phba);
                break;
        case LPFC_SLI_INTF_IF_TYPE_1:
        default:
@@@ -9569,8 -9568,7 +9568,7 @@@ lpfc_sli4_post_status_check(struct lpfc
                        /* Final checks.  The port status should be clean. */
                        if (lpfc_readl(phba->sli4_hba.u.if_type2.STATUSregaddr,
                                &reg_data.word0) ||
-                               (bf_get(lpfc_sliport_status_err, &reg_data) &&
-                                !bf_get(lpfc_sliport_status_rn, &reg_data))) {
+                               lpfc_sli4_unrecoverable_port(&reg_data)) {
                                phba->work_status[0] =
                                        readl(phba->sli4_hba.u.if_type2.
                                              ERR1regaddr);
@@@ -12026,7 -12024,7 +12024,7 @@@ lpfc_sli4_pci_mem_setup(struct lpfc_hb
                                goto out_iounmap_all;
                } else {
                        error = -ENOMEM;
-                       goto out_iounmap_all;
+                       goto out_iounmap_ctrl;
                }
        }
  
                        dev_err(&pdev->dev,
                           "ioremap failed for SLI4 HBA dpp registers.\n");
                        error = -ENOMEM;
-                       goto out_iounmap_ctrl;
+                       goto out_iounmap_all;
                }
                phba->pci_bar4_memmap_p = phba->sli4_hba.dpp_regs_memmap_p;
        }
        return 0;
  
  out_iounmap_all:
-       iounmap(phba->sli4_hba.drbl_regs_memmap_p);
+       if (phba->sli4_hba.drbl_regs_memmap_p)
+               iounmap(phba->sli4_hba.drbl_regs_memmap_p);
  out_iounmap_ctrl:
-       iounmap(phba->sli4_hba.ctrl_regs_memmap_p);
+       if (phba->sli4_hba.ctrl_regs_memmap_p)
+               iounmap(phba->sli4_hba.ctrl_regs_memmap_p);
  out_iounmap_conf:
        iounmap(phba->sli4_hba.conf_regs_memmap_p);
  
@@@ -12107,6 -12107,7 +12107,7 @@@ lpfc_sli4_pci_mem_unset(struct lpfc_hb
                        iounmap(phba->sli4_hba.dpp_regs_memmap_p);
                break;
        case LPFC_SLI_INTF_IF_TYPE_1:
+               break;
        default:
                dev_printk(KERN_ERR, &phba->pcidev->dev,
                           "FATAL - unsupported SLI4 interface type - %d\n",
@@@ -12565,7 -12566,7 +12566,7 @@@ lpfc_cpu_affinity_check(struct lpfc_hb
                                        goto found_same;
                                new_cpu = cpumask_next(
                                        new_cpu, cpu_present_mask);
 -                              if (new_cpu == nr_cpumask_bits)
 +                              if (new_cpu >= nr_cpu_ids)
                                        new_cpu = first_cpu;
                        }
                        /* At this point, we leave the CPU as unassigned */
@@@ -12579,7 -12580,7 +12580,7 @@@ found_same
                         * selecting the same IRQ.
                         */
                        start_cpu = cpumask_next(new_cpu, cpu_present_mask);
 -                      if (start_cpu == nr_cpumask_bits)
 +                      if (start_cpu >= nr_cpu_ids)
                                start_cpu = first_cpu;
  
                        lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
                                        goto found_any;
                                new_cpu = cpumask_next(
                                        new_cpu, cpu_present_mask);
 -                              if (new_cpu == nr_cpumask_bits)
 +                              if (new_cpu >= nr_cpu_ids)
                                        new_cpu = first_cpu;
                        }
                        /* We should never leave an entry unassigned */
@@@ -12633,7 -12634,7 +12634,7 @@@ found_any
                         * selecting the same IRQ.
                         */
                        start_cpu = cpumask_next(new_cpu, cpu_present_mask);
 -                      if (start_cpu == nr_cpumask_bits)
 +                      if (start_cpu >= nr_cpu_ids)
                                start_cpu = first_cpu;
  
                        lpfc_printf_log(phba, KERN_INFO, LOG_INIT,
                                goto found_hdwq;
                        }
                        new_cpu = cpumask_next(new_cpu, cpu_present_mask);
 -                      if (new_cpu == nr_cpumask_bits)
 +                      if (new_cpu >= nr_cpu_ids)
                                new_cpu = first_cpu;
                }
  
                                goto found_hdwq;
  
                        new_cpu = cpumask_next(new_cpu, cpu_present_mask);
 -                      if (new_cpu == nr_cpumask_bits)
 +                      if (new_cpu >= nr_cpu_ids)
                                new_cpu = first_cpu;
                }
  
   found_hdwq:
                /* We found an available entry, copy the IRQ info */
                start_cpu = cpumask_next(new_cpu, cpu_present_mask);
 -              if (start_cpu == nr_cpumask_bits)
 +              if (start_cpu >= nr_cpu_ids)
                        start_cpu = first_cpu;
                cpup->hdwq = new_cpup->hdwq;
   logit:
@@@ -2,7 -2,7 +2,7 @@@
  /*
   * Driver for Broadcom MPI3 Storage Controllers
   *
-  * Copyright (C) 2017-2022 Broadcom Inc.
+  * Copyright (C) 2017-2023 Broadcom Inc.
   *  (mailto: mpi3mr-linuxdrv.pdl@broadcom.com)
   *
   */
@@@ -1098,7 -1098,7 +1098,7 @@@ static int mpi3mr_issue_and_process_mur
        ioc_config &= ~MPI3_SYSIF_IOC_CONFIG_ENABLE_IOC;
        writel(ioc_config, &mrioc->sysif_regs->ioc_configuration);
  
-       timeout = MPI3MR_RESET_ACK_TIMEOUT * 10;
+       timeout = MPI3MR_MUR_TIMEOUT * 10;
        do {
                ioc_status = readl(&mrioc->sysif_regs->ioc_status);
                if ((ioc_status & MPI3_SYSIF_IOC_STATUS_RESET_HISTORY)) {
@@@ -2526,7 -2526,7 +2526,7 @@@ static void mpi3mr_watchdog_work(struc
                mrioc->unrecoverable = 1;
                goto schedule_work;
        case MPI3_SYSIF_FAULT_CODE_SOFT_RESET_IN_PROGRESS:
 -              return;
 +              goto schedule_work;
        case MPI3_SYSIF_FAULT_CODE_CI_ACTIVATION_RESET:
                reset_reason = MPI3MR_RESET_FROM_CIACTIV_FAULT;
                break;
@@@ -2620,14 -2620,12 +2620,12 @@@ static int mpi3mr_setup_admin_qpair(str
        mrioc->num_admin_req = mrioc->admin_req_q_sz /
            MPI3MR_ADMIN_REQ_FRAME_SZ;
        mrioc->admin_req_ci = mrioc->admin_req_pi = 0;
-       mrioc->admin_req_base = NULL;
  
        mrioc->admin_reply_q_sz = MPI3MR_ADMIN_REPLY_Q_SIZE;
        mrioc->num_admin_replies = mrioc->admin_reply_q_sz /
            MPI3MR_ADMIN_REPLY_FRAME_SZ;
        mrioc->admin_reply_ci = 0;
        mrioc->admin_reply_ephase = 1;
-       mrioc->admin_reply_base = NULL;
        atomic_set(&mrioc->admin_reply_q_in_use, 0);
  
        if (!mrioc->admin_req_base) {
@@@ -2958,9 -2958,6 +2958,6 @@@ qla2x00_probe_one(struct pci_dev *pdev
                ql2xallocfwdump = 0;
        }
  
-       /* This may fail but that's ok */
-       pci_enable_pcie_error_reporting(pdev);
        ha = kzalloc(sizeof(struct qla_hw_data), GFP_KERNEL);
        if (!ha) {
                ql_log_pci(ql_log_fatal, pdev, 0x0009,
@@@ -3617,7 -3614,6 +3614,7 @@@ skip_dpc
  probe_failed:
        qla_enode_stop(base_vha);
        qla_edb_stop(base_vha);
 +      vfree(base_vha->scan.l);
        if (base_vha->gnl.l) {
                dma_free_coherent(&ha->pdev->dev, base_vha->gnl.size,
                                base_vha->gnl.l, base_vha->gnl.ldma);
@@@ -3968,8 -3964,6 +3965,6 @@@ qla2x00_remove_one(struct pci_dev *pdev
        pci_release_selected_regions(ha->pdev, ha->bars);
        kfree(ha);
  
-       pci_disable_pcie_error_reporting(pdev);
        pci_disable_device(pdev);
  }
  
@@@ -5024,8 -5018,8 +5019,8 @@@ qla2x00_mem_free(struct qla_hw_data *ha
        ha->vp_map = NULL;
  }
  
- struct scsi_qla_host *qla2x00_create_host(struct scsi_host_template *sht,
-                                               struct qla_hw_data *ha)
+ struct scsi_qla_host *qla2x00_create_host(const struct scsi_host_template *sht,
+                                         struct qla_hw_data *ha)
  {
        struct Scsi_Host *host;
        struct scsi_qla_host *vha = NULL;
@@@ -6845,7 -6839,6 +6840,6 @@@ qla2x00_disable_board_on_pci_error(stru
        qla2x00_unmap_iobases(ha);
  
        pci_release_selected_regions(ha->pdev, ha->bars);
-       pci_disable_pcie_error_reporting(pdev);
        pci_disable_device(pdev);
  
        /*
@@@ -422,7 -422,9 +422,9 @@@ static void ufshcd_add_command_trace(st
  {
        u64 lba = 0;
        u8 opcode = 0, group_id = 0;
-       u32 intr, doorbell;
+       u32 doorbell = 0;
+       u32 intr;
+       int hwq_id = -1;
        struct ufshcd_lrb *lrbp = &hba->lrb[tag];
        struct scsi_cmnd *cmd = lrbp->cmd;
        struct request *rq = scsi_cmd_to_rq(cmd);
        }
  
        intr = ufshcd_readl(hba, REG_INTERRUPT_STATUS);
-       doorbell = ufshcd_readl(hba, REG_UTP_TRANSFER_REQ_DOOR_BELL);
+       if (is_mcq_enabled(hba)) {
+               struct ufs_hw_queue *hwq = ufshcd_mcq_req_to_hwq(hba, rq);
+               hwq_id = hwq->id;
+       } else {
+               doorbell = ufshcd_readl(hba, REG_UTP_TRANSFER_REQ_DOOR_BELL);
+       }
        trace_ufshcd_command(dev_name(hba->dev), str_t, tag,
-                       doorbell, transfer_len, intr, lba, opcode, group_id);
+                       doorbell, hwq_id, transfer_len, intr, lba, opcode, group_id);
  }
  
  static void ufshcd_print_clk_freqs(struct ufs_hba *hba)
@@@ -533,48 -542,66 +542,66 @@@ static void ufshcd_print_evt_hist(struc
  }
  
  static
- void ufshcd_print_trs(struct ufs_hba *hba, unsigned long bitmap, bool pr_prdt)
+ void ufshcd_print_tr(struct ufs_hba *hba, int tag, bool pr_prdt)
  {
        const struct ufshcd_lrb *lrbp;
        int prdt_length;
-       int tag;
  
-       for_each_set_bit(tag, &bitmap, hba->nutrs) {
-               lrbp = &hba->lrb[tag];
+       lrbp = &hba->lrb[tag];
  
-               dev_err(hba->dev, "UPIU[%d] - issue time %lld us\n",
-                               tag, div_u64(lrbp->issue_time_stamp_local_clock, 1000));
-               dev_err(hba->dev, "UPIU[%d] - complete time %lld us\n",
-                               tag, div_u64(lrbp->compl_time_stamp_local_clock, 1000));
-               dev_err(hba->dev,
-                       "UPIU[%d] - Transfer Request Descriptor phys@0x%llx\n",
-                       tag, (u64)lrbp->utrd_dma_addr);
-               ufshcd_hex_dump("UPIU TRD: ", lrbp->utr_descriptor_ptr,
-                               sizeof(struct utp_transfer_req_desc));
-               dev_err(hba->dev, "UPIU[%d] - Request UPIU phys@0x%llx\n", tag,
-                       (u64)lrbp->ucd_req_dma_addr);
-               ufshcd_hex_dump("UPIU REQ: ", lrbp->ucd_req_ptr,
-                               sizeof(struct utp_upiu_req));
-               dev_err(hba->dev, "UPIU[%d] - Response UPIU phys@0x%llx\n", tag,
-                       (u64)lrbp->ucd_rsp_dma_addr);
-               ufshcd_hex_dump("UPIU RSP: ", lrbp->ucd_rsp_ptr,
-                               sizeof(struct utp_upiu_rsp));
-               prdt_length = le16_to_cpu(
-                       lrbp->utr_descriptor_ptr->prd_table_length);
-               if (hba->quirks & UFSHCD_QUIRK_PRDT_BYTE_GRAN)
-                       prdt_length /= ufshcd_sg_entry_size(hba);
+       dev_err(hba->dev, "UPIU[%d] - issue time %lld us\n",
+                       tag, div_u64(lrbp->issue_time_stamp_local_clock, 1000));
+       dev_err(hba->dev, "UPIU[%d] - complete time %lld us\n",
+                       tag, div_u64(lrbp->compl_time_stamp_local_clock, 1000));
+       dev_err(hba->dev,
+               "UPIU[%d] - Transfer Request Descriptor phys@0x%llx\n",
+               tag, (u64)lrbp->utrd_dma_addr);
+       ufshcd_hex_dump("UPIU TRD: ", lrbp->utr_descriptor_ptr,
+                       sizeof(struct utp_transfer_req_desc));
+       dev_err(hba->dev, "UPIU[%d] - Request UPIU phys@0x%llx\n", tag,
+               (u64)lrbp->ucd_req_dma_addr);
+       ufshcd_hex_dump("UPIU REQ: ", lrbp->ucd_req_ptr,
+                       sizeof(struct utp_upiu_req));
+       dev_err(hba->dev, "UPIU[%d] - Response UPIU phys@0x%llx\n", tag,
+               (u64)lrbp->ucd_rsp_dma_addr);
+       ufshcd_hex_dump("UPIU RSP: ", lrbp->ucd_rsp_ptr,
+                       sizeof(struct utp_upiu_rsp));
+       prdt_length = le16_to_cpu(
+               lrbp->utr_descriptor_ptr->prd_table_length);
+       if (hba->quirks & UFSHCD_QUIRK_PRDT_BYTE_GRAN)
+               prdt_length /= ufshcd_sg_entry_size(hba);
  
-               dev_err(hba->dev,
-                       "UPIU[%d] - PRDT - %d entries  phys@0x%llx\n",
-                       tag, prdt_length,
-                       (u64)lrbp->ucd_prdt_dma_addr);
+       dev_err(hba->dev,
+               "UPIU[%d] - PRDT - %d entries  phys@0x%llx\n",
+               tag, prdt_length,
+               (u64)lrbp->ucd_prdt_dma_addr);
  
-               if (pr_prdt)
-                       ufshcd_hex_dump("UPIU PRDT: ", lrbp->ucd_prdt_ptr,
-                               ufshcd_sg_entry_size(hba) * prdt_length);
-       }
+       if (pr_prdt)
+               ufshcd_hex_dump("UPIU PRDT: ", lrbp->ucd_prdt_ptr,
+                       ufshcd_sg_entry_size(hba) * prdt_length);
+ }
+ static bool ufshcd_print_tr_iter(struct request *req, void *priv)
+ {
+       struct scsi_device *sdev = req->q->queuedata;
+       struct Scsi_Host *shost = sdev->host;
+       struct ufs_hba *hba = shost_priv(shost);
+       ufshcd_print_tr(hba, req->tag, *(bool *)priv);
+       return true;
+ }
+ /**
+  * ufshcd_print_trs_all - print trs for all started requests.
+  * @hba: per-adapter instance.
+  * @pr_prdt: need to print prdt or not.
+  */
+ static void ufshcd_print_trs_all(struct ufs_hba *hba, bool pr_prdt)
+ {
+       blk_mq_tagset_busy_iter(&hba->host->tag_set, ufshcd_print_tr_iter, &pr_prdt);
  }
  
  static void ufshcd_print_tmrs(struct ufs_hba *hba, unsigned long bitmap)
@@@ -1242,7 -1269,7 +1269,7 @@@ static int ufshcd_scale_gear(struct ufs
        struct ufs_pa_layer_attr new_pwr_info;
  
        if (scale_up) {
-               memcpy(&new_pwr_info, &hba->clk_scaling.saved_pwr_info.info,
+               memcpy(&new_pwr_info, &hba->clk_scaling.saved_pwr_info,
                       sizeof(struct ufs_pa_layer_attr));
        } else {
                memcpy(&new_pwr_info, &hba->pwr_info,
                if (hba->pwr_info.gear_tx > hba->clk_scaling.min_gear ||
                    hba->pwr_info.gear_rx > hba->clk_scaling.min_gear) {
                        /* save the current power mode */
-                       memcpy(&hba->clk_scaling.saved_pwr_info.info,
+                       memcpy(&hba->clk_scaling.saved_pwr_info,
                                &hba->pwr_info,
                                sizeof(struct ufs_pa_layer_attr));
  
@@@ -1409,6 -1436,13 +1436,6 @@@ static int ufshcd_devfreq_target(struc
        struct ufs_clk_info *clki;
        unsigned long irq_flags;
  
 -      /*
 -       * Skip devfreq if UFS initialization is not finished.
 -       * Otherwise ufs could be in a inconsistent state.
 -       */
 -      if (!smp_load_acquire(&hba->logical_unit_scan_finished))
 -              return 0;
 -
        if (!ufshcd_is_clkscaling_supported(hba))
                return -EINVAL;
  
@@@ -2208,10 -2242,11 +2235,11 @@@ void ufshcd_send_command(struct ufs_hb
  
        if (is_mcq_enabled(hba)) {
                int utrd_size = sizeof(struct utp_transfer_req_desc);
+               struct utp_transfer_req_desc *src = lrbp->utr_descriptor_ptr;
+               struct utp_transfer_req_desc *dest = hwq->sqe_base_addr + hwq->sq_tail_slot;
  
                spin_lock(&hwq->sq_lock);
-               memcpy(hwq->sqe_base_addr + (hwq->sq_tail_slot * utrd_size),
-                      lrbp->utr_descriptor_ptr, utrd_size);
+               memcpy(dest, src, utrd_size);
                ufshcd_inc_sq_tail(hwq);
                spin_unlock(&hwq->sq_lock);
        } else {
@@@ -5231,6 -5266,9 +5259,9 @@@ ufshcd_transfer_rsp_status(struct ufs_h
        int scsi_status;
        enum utp_ocs ocs;
  
+       scsi_set_resid(lrbp->cmd,
+               be32_to_cpu(lrbp->ucd_rsp_ptr->sr.residual_transfer_count));
        /* overall command status of utrd */
        ocs = ufshcd_get_tr_ocs(lrbp, cqe);
  
  
        if ((host_byte(result) != DID_OK) &&
            (host_byte(result) != DID_REQUEUE) && !hba->silence_err_logs)
-               ufshcd_print_trs(hba, 1 << lrbp->task_tag, true);
+               ufshcd_print_tr(hba, lrbp->task_tag, true);
        return result;
  }
  
@@@ -6405,7 -6443,7 +6436,7 @@@ again
                ufshcd_print_pwr_info(hba);
                ufshcd_print_evt_hist(hba);
                ufshcd_print_tmrs(hba, hba->outstanding_tasks);
-               ufshcd_print_trs(hba, hba->outstanding_reqs, pr_prdt);
+               ufshcd_print_trs_all(hba, pr_prdt);
                spin_lock_irqsave(hba->host->host_lock, flags);
        }
  
@@@ -7434,9 -7472,9 +7465,9 @@@ static int ufshcd_abort(struct scsi_cmn
                ufshcd_print_evt_hist(hba);
                ufshcd_print_host_state(hba);
                ufshcd_print_pwr_info(hba);
-               ufshcd_print_trs(hba, 1 << tag, true);
+               ufshcd_print_tr(hba, tag, true);
        } else {
-               ufshcd_print_trs(hba, 1 << tag, false);
+               ufshcd_print_tr(hba, tag, false);
        }
        hba->req_abort_count++;
  
@@@ -8392,22 -8430,6 +8423,21 @@@ static int ufshcd_add_lus(struct ufs_hb
        if (ret)
                goto out;
  
-               memcpy(&hba->clk_scaling.saved_pwr_info.info,
 +      /* Initialize devfreq after UFS device is detected */
 +      if (ufshcd_is_clkscaling_supported(hba)) {
-               hba->clk_scaling.saved_pwr_info.is_valid = true;
++              memcpy(&hba->clk_scaling.saved_pwr_info,
 +                      &hba->pwr_info,
 +                      sizeof(struct ufs_pa_layer_attr));
 +              hba->clk_scaling.is_allowed = true;
 +
 +              ret = ufshcd_devfreq_init(hba);
 +              if (ret)
 +                      goto out;
 +
 +              hba->clk_scaling.is_enabled = true;
 +              ufshcd_init_clk_scaling_sysfs(hba);
 +      }
 +
        ufs_bsg_probe(hba);
        ufshpb_init(hba);
        scsi_scan_host(hba->host);
@@@ -8679,6 -8701,12 +8709,6 @@@ out
        if (ret) {
                pm_runtime_put_sync(hba->dev);
                ufshcd_hba_exit(hba);
 -      } else {
 -              /*
 -               * Make sure that when reader code sees UFS initialization has finished,
 -               * all initialization steps have really been executed.
 -               */
 -              smp_store_release(&hba->logical_unit_scan_finished, true);
        }
  }
  
@@@ -8724,7 -8752,7 +8754,7 @@@ static struct ufs_hba_variant_params uf
        .ondemand_data.downdifferential = 5,
  };
  
- static struct scsi_host_template ufshcd_driver_template = {
+ static const struct scsi_host_template ufshcd_driver_template = {
        .module                 = THIS_MODULE,
        .name                   = UFSHCD,
        .proc_name              = UFSHCD,
        .max_sectors            = (1 << 20) / SECTOR_SIZE, /* 1 MiB */
        .max_host_blocked       = 1,
        .track_queue_depth      = 1,
+       .skip_settle_delay      = 1,
        .sdev_groups            = ufshcd_driver_groups,
        .rpm_autosuspend_delay  = RPM_AUTOSUSPEND_DELAY_MS,
  };
@@@ -10319,12 -10348,29 +10350,12 @@@ int ufshcd_init(struct ufs_hba *hba, vo
         */
        ufshcd_set_ufs_dev_active(hba);
  
 -      /* Initialize devfreq */
 -      if (ufshcd_is_clkscaling_supported(hba)) {
 -              memcpy(&hba->clk_scaling.saved_pwr_info,
 -                      &hba->pwr_info,
 -                      sizeof(struct ufs_pa_layer_attr));
 -              hba->clk_scaling.is_allowed = true;
 -
 -              err = ufshcd_devfreq_init(hba);
 -              if (err)
 -                      goto rpm_put_sync;
 -
 -              hba->clk_scaling.is_enabled = true;
 -              ufshcd_init_clk_scaling_sysfs(hba);
 -      }
 -
        async_schedule(ufshcd_async_scan, hba);
        ufs_sysfs_add_nodes(hba->dev);
  
        device_enable_async_suspend(dev);
        return 0;
  
 -rpm_put_sync:
 -      pm_runtime_put_sync(dev);
  free_tmf_queue:
        blk_mq_destroy_queue(hba->tmf_queue);
        blk_put_queue(hba->tmf_queue);
diff --combined drivers/vhost/scsi.c
@@@ -125,6 -125,7 +125,6 @@@ struct vhost_scsi_tpg 
        struct se_portal_group se_tpg;
        /* Pointer back to vhost_scsi, protected by tv_tpg_mutex */
        struct vhost_scsi *vhost_scsi;
 -      struct list_head tmf_queue;
  };
  
  struct vhost_scsi_tport {
@@@ -205,8 -206,10 +205,8 @@@ struct vhost_scsi 
  
  struct vhost_scsi_tmf {
        struct vhost_work vwork;
 -      struct vhost_scsi_tpg *tpg;
        struct vhost_scsi *vhost;
        struct vhost_scsi_virtqueue *svq;
 -      struct list_head queue_entry;
  
        struct se_cmd se_cmd;
        u8 scsi_resp;
@@@ -291,11 -294,6 +291,6 @@@ static int vhost_scsi_check_true(struc
        return 1;
  }
  
- static int vhost_scsi_check_false(struct se_portal_group *se_tpg)
- {
-       return 0;
- }
  static char *vhost_scsi_get_fabric_wwn(struct se_portal_group *se_tpg)
  {
        struct vhost_scsi_tpg *tpg = container_of(se_tpg,
@@@ -320,11 -318,6 +315,6 @@@ static int vhost_scsi_check_prot_fabric
        return tpg->tv_fabric_prot_type;
  }
  
- static u32 vhost_scsi_tpg_get_inst_index(struct se_portal_group *se_tpg)
- {
-       return 1;
- }
  static void vhost_scsi_release_cmd_res(struct se_cmd *se_cmd)
  {
        struct vhost_scsi_cmd *tv_cmd = container_of(se_cmd,
  
  static void vhost_scsi_release_tmf_res(struct vhost_scsi_tmf *tmf)
  {
 -      struct vhost_scsi_tpg *tpg = tmf->tpg;
        struct vhost_scsi_inflight *inflight = tmf->inflight;
  
 -      mutex_lock(&tpg->tv_tpg_mutex);
 -      list_add_tail(&tpg->tmf_queue, &tmf->queue_entry);
 -      mutex_unlock(&tpg->tv_tpg_mutex);
 +      kfree(tmf);
        vhost_scsi_put_inflight(inflight);
  }
  
@@@ -372,11 -368,6 +362,6 @@@ static void vhost_scsi_release_cmd(stru
        }
  }
  
- static u32 vhost_scsi_sess_get_index(struct se_session *se_sess)
- {
-       return 0;
- }
  static int vhost_scsi_write_pending(struct se_cmd *se_cmd)
  {
        /* Go ahead and process the write immediately */
        return 0;
  }
  
- static void vhost_scsi_set_default_node_attrs(struct se_node_acl *nacl)
- {
-       return;
- }
- static int vhost_scsi_get_cmd_state(struct se_cmd *se_cmd)
- {
-       return 0;
- }
  static int vhost_scsi_queue_data_in(struct se_cmd *se_cmd)
  {
        transport_generic_free_cmd(se_cmd, 0);
@@@ -665,7 -646,7 +640,7 @@@ vhost_scsi_calc_sgls(struct iov_iter *i
  {
        int sgl_count = 0;
  
 -      if (!iter || !iter->iov) {
 +      if (!iter || !iter_iov(iter)) {
                pr_err("%s: iter->iov is NULL, but expected bytes: %zu"
                       " present\n", __func__, bytes);
                return -EINVAL;
@@@ -1188,11 -1169,19 +1163,11 @@@ vhost_scsi_handle_tmf(struct vhost_scs
                goto send_reject;
        }
  
 -      mutex_lock(&tpg->tv_tpg_mutex);
 -      if (list_empty(&tpg->tmf_queue)) {
 -              pr_err("Missing reserve TMF. Could not handle LUN RESET.\n");
 -              mutex_unlock(&tpg->tv_tpg_mutex);
 +      tmf = kzalloc(sizeof(*tmf), GFP_KERNEL);
 +      if (!tmf)
                goto send_reject;
 -      }
 -
 -      tmf = list_first_entry(&tpg->tmf_queue, struct vhost_scsi_tmf,
 -                             queue_entry);
 -      list_del_init(&tmf->queue_entry);
 -      mutex_unlock(&tpg->tv_tpg_mutex);
  
 -      tmf->tpg = tpg;
 +      vhost_work_init(&tmf->vwork, vhost_scsi_tmf_resp_work);
        tmf->vhost = vs;
        tmf->svq = svq;
        tmf->resp_iov = vq->iov[vc->out];
@@@ -1644,10 -1633,7 +1619,10 @@@ undepend
        for (i = 0; i < VHOST_SCSI_MAX_TARGET; i++) {
                tpg = vs_tpg[i];
                if (tpg) {
 +                      mutex_lock(&tpg->tv_tpg_mutex);
 +                      tpg->vhost_scsi = NULL;
                        tpg->tv_tpg_vhost_count--;
 +                      mutex_unlock(&tpg->tv_tpg_mutex);
                        target_undepend_item(&tpg->se_tpg.tpg_group.cg_item);
                }
        }
@@@ -2021,11 -2007,19 +1996,11 @@@ static int vhost_scsi_port_link(struct 
  {
        struct vhost_scsi_tpg *tpg = container_of(se_tpg,
                                struct vhost_scsi_tpg, se_tpg);
 -      struct vhost_scsi_tmf *tmf;
 -
 -      tmf = kzalloc(sizeof(*tmf), GFP_KERNEL);
 -      if (!tmf)
 -              return -ENOMEM;
 -      INIT_LIST_HEAD(&tmf->queue_entry);
 -      vhost_work_init(&tmf->vwork, vhost_scsi_tmf_resp_work);
  
        mutex_lock(&vhost_scsi_mutex);
  
        mutex_lock(&tpg->tv_tpg_mutex);
        tpg->tv_tpg_port_count++;
 -      list_add_tail(&tmf->queue_entry, &tpg->tmf_queue);
        mutex_unlock(&tpg->tv_tpg_mutex);
  
        vhost_scsi_hotplug(tpg, lun);
@@@ -2040,11 -2034,16 +2015,11 @@@ static void vhost_scsi_port_unlink(stru
  {
        struct vhost_scsi_tpg *tpg = container_of(se_tpg,
                                struct vhost_scsi_tpg, se_tpg);
 -      struct vhost_scsi_tmf *tmf;
  
        mutex_lock(&vhost_scsi_mutex);
  
        mutex_lock(&tpg->tv_tpg_mutex);
        tpg->tv_tpg_port_count--;
 -      tmf = list_first_entry(&tpg->tmf_queue, struct vhost_scsi_tmf,
 -                             queue_entry);
 -      list_del(&tmf->queue_entry);
 -      kfree(tmf);
        mutex_unlock(&tpg->tv_tpg_mutex);
  
        vhost_scsi_hotunplug(tpg, lun);
@@@ -2305,6 -2304,7 +2280,6 @@@ vhost_scsi_make_tpg(struct se_wwn *wwn
        }
        mutex_init(&tpg->tv_tpg_mutex);
        INIT_LIST_HEAD(&tpg->tv_tpg_list);
 -      INIT_LIST_HEAD(&tpg->tmf_queue);
        tpg->tport = tport;
        tpg->tport_tpgt = tpgt;
  
@@@ -2435,17 -2435,11 +2410,11 @@@ static const struct target_core_fabric_
        .tpg_get_tag                    = vhost_scsi_get_tpgt,
        .tpg_check_demo_mode            = vhost_scsi_check_true,
        .tpg_check_demo_mode_cache      = vhost_scsi_check_true,
-       .tpg_check_demo_mode_write_protect = vhost_scsi_check_false,
-       .tpg_check_prod_mode_write_protect = vhost_scsi_check_false,
        .tpg_check_prot_fabric_only     = vhost_scsi_check_prot_fabric_only,
-       .tpg_get_inst_index             = vhost_scsi_tpg_get_inst_index,
        .release_cmd                    = vhost_scsi_release_cmd,
        .check_stop_free                = vhost_scsi_check_stop_free,
-       .sess_get_index                 = vhost_scsi_sess_get_index,
        .sess_get_initiator_sid         = NULL,
        .write_pending                  = vhost_scsi_write_pending,
-       .set_default_node_attributes    = vhost_scsi_set_default_node_attrs,
-       .get_cmd_state                  = vhost_scsi_get_cmd_state,
        .queue_data_in                  = vhost_scsi_queue_data_in,
        .queue_status                   = vhost_scsi_queue_status,
        .queue_tm_rsp                   = vhost_scsi_queue_tm_rsp,
diff --combined include/ufs/ufshcd.h
@@@ -394,11 -394,6 +394,6 @@@ struct ufs_clk_gating 
        struct workqueue_struct *clk_gating_workq;
  };
  
- struct ufs_saved_pwr_info {
-       struct ufs_pa_layer_attr info;
-       bool is_valid;
- };
  /**
   * struct ufs_clk_scaling - UFS clock scaling related data
   * @active_reqs: number of requests that are pending. If this is zero when
@@@ -428,7 -423,7 +423,7 @@@ struct ufs_clk_scaling 
        ktime_t window_start_t;
        ktime_t busy_start_t;
        struct device_attribute enable_attr;
-       struct ufs_saved_pwr_info saved_pwr_info;
+       struct ufs_pa_layer_attr saved_pwr_info;
        struct workqueue_struct *workq;
        struct work_struct suspend_work;
        struct work_struct resume_work;
@@@ -979,6 -974,7 +974,6 @@@ struct ufs_hba 
        struct completion *uic_async_done;
  
        enum ufshcd_state ufshcd_state;
 -      bool logical_unit_scan_finished;
        u32 eh_flags;
        u32 intr_mask;
        u16 ee_ctrl_mask;
@@@ -1099,7 -1095,7 +1094,7 @@@ struct ufs_hw_queue 
        void __iomem *mcq_cq_head;
        void __iomem *mcq_cq_tail;
  
-       void *sqe_base_addr;
+       struct utp_transfer_req_desc *sqe_base_addr;
        dma_addr_t sqe_dma_addr;
        struct cq_entry *cqe_base_addr;
        dma_addr_t cqe_dma_addr;