diff --git a/Documentation/scsi/scsi_mid_low_api.rst b/Documentation/scsi/scsi_mid_low_api.rst index a93df7c3ae50..9d15e20b0b5e 100644 --- a/Documentation/scsi/scsi_mid_low_api.rst +++ b/Documentation/scsi/scsi_mid_low_api.rst @@ -101,7 +101,7 @@ supplied functions" below. Those functions in group b) are listed in a section entitled "Interface functions" below. Their function pointers are placed in the members of "struct scsi_host_template", an instance of which is passed to -scsi_host_alloc() [#]_. Those interface functions that the LLD does not +scsi_host_alloc(). Those interface functions that the LLD does not wish to supply should have NULL placed in the corresponding member of struct scsi_host_template. Defining an instance of struct scsi_host_template at file scope will cause NULL to be placed in function @@ -116,9 +116,6 @@ should be static. For example the sdev_init() function in an LLD called "xxx" could be defined as ``static int xxx_sdev_init(struct scsi_device * sdev) { /* code */ }`` -.. [#] the scsi_host_alloc() function is a replacement for the rather vaguely - named scsi_register() function in most situations. - Hotplug initialization model ============================ @@ -302,14 +299,12 @@ Summary: - scsi_host_alloc - return a new scsi_host instance whose refcount==1 - scsi_host_get - increments Scsi_Host instance's refcount - scsi_host_put - decrements Scsi_Host instance's refcount (free if 0) - - scsi_register - create and register a scsi host adapter instance. - scsi_remove_device - detach and remove a SCSI device - scsi_remove_host - detach and remove all SCSI devices owned by host - scsi_report_bus_reset - report scsi _bus_ reset observed - scsi_scan_host - scan SCSI bus - scsi_track_queue_full - track successive QUEUE_FULL events - scsi_unblock_requests - allow further commands to be queued to given host - - scsi_unregister - [calls scsi_host_put()] Details:: @@ -474,27 +469,6 @@ Details:: void scsi_host_put(struct Scsi_Host *shost) - /** - * scsi_register - create and register a scsi host adapter instance. - * @sht: pointer to scsi host template - * @privsize: extra bytes to allocate in hostdata array (which is the - * last member of the returned Scsi_Host instance) - * - * Returns pointer to new Scsi_Host instance or NULL on failure - * - * Might block: yes - * - * Notes: When this call returns to the LLD, the SCSI bus scan on - * this host has _not_ yet been done. - * The hostdata array (by default zero length) is a per host scratch - * area for the LLD. - * - * Defined in: drivers/scsi/hosts.c . - **/ - struct Scsi_Host * scsi_register(struct scsi_host_template * sht, - int privsize) - - /** * scsi_remove_device - detach and remove a SCSI device * @sdev: a pointer to a scsi device instance @@ -524,7 +498,7 @@ Details:: * * Notes: Should only be invoked if the "hotplug initialization * model" is being used. It should be called _prior_ to - * scsi_unregister(). + * calling scsi_host_put(). * * Defined in: drivers/scsi/hosts.c . **/ @@ -601,31 +575,12 @@ Details:: void scsi_unblock_requests(struct Scsi_Host * shost) - /** - * scsi_unregister - unregister and free memory used by host instance - * @shp: pointer to scsi host instance to unregister. - * - * Returns nothing - * - * Might block: no - * - * Notes: Should not be invoked if the "hotplug initialization - * model" is being used. Called internally by exit_this_scsi_driver() - * in the "passive initialization model". Hence a LLD has no need to - * call this function directly. - * - * Defined in: drivers/scsi/hosts.c . - **/ - void scsi_unregister(struct Scsi_Host * shp) - - - Interface Functions =================== Interface functions are supplied (defined) by LLDs and their function pointers are placed in an instance of struct scsi_host_template which -is passed to scsi_host_alloc() [or scsi_register() / init_this_scsi_driver()]. +is passed to scsi_host_alloc(). Some are mandatory. Interface functions should be declared static. The accepted convention is that driver "xyz" will declare its sdev_configure() function as:: @@ -636,8 +591,8 @@ and so forth for all interface functions listed below. A pointer to this function should be placed in the 'sdev_configure' member of a "struct scsi_host_template" instance. A pointer to such an instance -should be passed to the mid level's scsi_host_alloc() [or scsi_register() / -init_this_scsi_driver()]. +should be passed to the mid level's scsi_host_alloc(). +. The interface functions are also described in the include/scsi/scsi_host.h file immediately above their definition point in "struct scsi_host_template". @@ -817,10 +772,6 @@ Details:: * The SCSI_IOCTL_PROBE_HOST ioctl yields the string returned by this * function (or struct Scsi_Host::name if this function is not * available). - * In a similar manner, init_this_scsi_driver() outputs to the console - * each host's "info" (or name) for the driver it is registering. - * Also if proc_info() is not supplied, the output of this function - * is used instead. * * Optionally defined in: LLD **/ @@ -1115,7 +1066,7 @@ of interest: hostdata[0] - area reserved for LLD at end of struct Scsi_Host. Size is set by the second argument (named 'xtr_bytes') to - scsi_host_alloc() or scsi_register(). + scsi_host_alloc(). vendor_id - a unique value that identifies the vendor supplying the LLD for the Scsi_Host. Used most often in validating diff --git a/MAINTAINERS b/MAINTAINERS index a4aef1f8bb9d..2f44cc6827f2 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -20754,8 +20754,7 @@ F: arch/s390/include/uapi/asm/zcrypt.h F: drivers/s390/crypto/ S390 ZFCP DRIVER -M: Steffen Maier -M: Benjamin Block +M: Nihar Panda L: linux-s390@vger.kernel.org S: Supported F: drivers/s390/scsi/zfcp_* diff --git a/drivers/s390/scsi/zfcp_fc.c b/drivers/s390/scsi/zfcp_fc.c index d6516ab00437..1d50f463afe7 100644 --- a/drivers/s390/scsi/zfcp_fc.c +++ b/drivers/s390/scsi/zfcp_fc.c @@ -537,6 +537,11 @@ static void zfcp_fc_adisc_handler(void *data) /* port is still good, nothing to do */ out: atomic_andnot(ZFCP_STATUS_PORT_LINK_TEST, &port->status); + /* + * port ref comes from get_device() in zfcp_fc_test_link() and + * work item zfcp_fc_link_test_work() passes ref via + * zfcp_fc_adisc() to here, if zfcp_fc_adisc() could send ADISC + */ put_device(&port->dev); kmem_cache_free(zfcp_fc_req_cache, fc_req); } @@ -603,7 +608,7 @@ void zfcp_fc_link_test_work(struct work_struct *work) retval = zfcp_fc_adisc(port); if (retval == 0) - return; + return; /* port ref passed to zfcp_fc_adisc(), no put here */ /* send of ADISC was not possible */ atomic_andnot(ZFCP_STATUS_PORT_LINK_TEST, &port->status); diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index 22e82000334a..99d6b3f8692b 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c @@ -1218,7 +1218,7 @@ static int zfcp_fsf_setup_ct_els(struct zfcp_fsf_req *req, /** * zfcp_fsf_send_ct - initiate a Generic Service request (FC-GS) * @wka_port: pointer to zfcp WKA port to send CT/GS to - * @ct: pointer to struct zfcp_send_ct with data for request + * @ct: pointer to struct zfcp_fsf_ct_els with data for CT request * @pool: if non-null this mempool is used to allocate struct zfcp_fsf_req * @timeout: timeout that hardware should use, and a later software timeout */ @@ -1316,7 +1316,7 @@ skip_fsfstatus: * zfcp_fsf_send_els - initiate an ELS command (FC-FS) * @adapter: pointer to zfcp adapter * @d_id: N_Port_ID to send ELS to - * @els: pointer to struct zfcp_send_els with data for the command + * @els: pointer to struct zfcp_fsf_ct_els with data for the ELS command * @timeout: timeout that hardware should use, and a later software timeout */ int zfcp_fsf_send_els(struct zfcp_adapter *adapter, u32 d_id, diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c index 97bcdf84386d..883d4a12a172 100644 --- a/drivers/scsi/3w-9xxx.c +++ b/drivers/scsi/3w-9xxx.c @@ -2261,7 +2261,7 @@ out_disable_device: } /* End twa_resume() */ /* PCI Devices supported by this driver */ -static struct pci_device_id twa_pci_tbl[] = { +static const struct pci_device_id twa_pci_tbl[] = { { PCI_VENDOR_ID_3WARE, PCI_DEVICE_ID_3WARE_9000, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, { PCI_VENDOR_ID_3WARE, PCI_DEVICE_ID_3WARE_9550SX, diff --git a/drivers/scsi/3w-sas.c b/drivers/scsi/3w-sas.c index 8ed7126d82bb..9b6eab3b1e4d 100644 --- a/drivers/scsi/3w-sas.c +++ b/drivers/scsi/3w-sas.c @@ -1822,7 +1822,7 @@ out_disable_device: } /* End twl_resume() */ /* PCI Devices supported by this driver */ -static struct pci_device_id twl_pci_tbl[] = { +static const struct pci_device_id twl_pci_tbl[] = { { PCI_VDEVICE(3WARE, PCI_DEVICE_ID_3WARE_9750) }, { } }; diff --git a/drivers/scsi/3w-xxxx.c b/drivers/scsi/3w-xxxx.c index 82fb9dc8dac9..89bd56f78ef9 100644 --- a/drivers/scsi/3w-xxxx.c +++ b/drivers/scsi/3w-xxxx.c @@ -2393,7 +2393,7 @@ static void tw_remove(struct pci_dev *pdev) } /* End tw_remove() */ /* PCI Devices supported by this driver */ -static struct pci_device_id tw_pci_tbl[] = { +static const struct pci_device_id tw_pci_tbl[] = { { PCI_VENDOR_ID_3WARE, PCI_DEVICE_ID_3WARE_1000, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, { PCI_VENDOR_ID_3WARE, PCI_DEVICE_ID_3WARE_7000, diff --git a/drivers/scsi/BusLogic.c b/drivers/scsi/BusLogic.c index d04b5feec2eb..1f100270cd38 100644 --- a/drivers/scsi/BusLogic.c +++ b/drivers/scsi/BusLogic.c @@ -3716,7 +3716,7 @@ static void __exit blogic_exit(void) __setup("BusLogic=", blogic_setup); #ifdef MODULE -/*static struct pci_device_id blogic_pci_tbl[] = { +/*static const struct pci_device_id blogic_pci_tbl[] = { { PCI_VENDOR_ID_BUSLOGIC, PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, { PCI_VENDOR_ID_BUSLOGIC, PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER_NC, diff --git a/drivers/scsi/a100u2w.c b/drivers/scsi/a100u2w.c index b95147fb18b0..a8979f9e30ff 100644 --- a/drivers/scsi/a100u2w.c +++ b/drivers/scsi/a100u2w.c @@ -1206,7 +1206,7 @@ static void inia100_remove_one(struct pci_dev *pdev) scsi_host_put(shost); } -static struct pci_device_id inia100_pci_tbl[] = { +static const struct pci_device_id inia100_pci_tbl[] = { {PCI_VENDOR_ID_INIT, 0x1060, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {0,} }; diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c index 8fededa1a751..3a2c336307c0 100644 --- a/drivers/scsi/advansys.c +++ b/drivers/scsi/advansys.c @@ -11409,7 +11409,7 @@ static struct eisa_driver advansys_eisa_driver = { }; /* PCI Devices supported by this driver */ -static struct pci_device_id advansys_pci_tbl[] = { +static const struct pci_device_id advansys_pci_tbl[] = { {PCI_VENDOR_ID_ASP, PCI_DEVICE_ID_ASP_1200A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {PCI_VENDOR_ID_ASP, PCI_DEVICE_ID_ASP_ABP940, diff --git a/drivers/scsi/am53c974.c b/drivers/scsi/am53c974.c index fbb29dbb1e50..003e61831e33 100644 --- a/drivers/scsi/am53c974.c +++ b/drivers/scsi/am53c974.c @@ -513,7 +513,7 @@ static void pci_esp_remove_one(struct pci_dev *pdev) scsi_host_put(esp->host); } -static struct pci_device_id am53c974_pci_tbl[] = { +static const struct pci_device_id am53c974_pci_tbl[] = { { PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_SCSI, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, { } diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c index fe7de7705b7e..221a520e8a9b 100644 --- a/drivers/scsi/arcmsr/arcmsr_hba.c +++ b/drivers/scsi/arcmsr/arcmsr_hba.c @@ -172,7 +172,7 @@ static const struct scsi_host_template arcmsr_scsi_host_template = { .no_write_same = 1, }; -static struct pci_device_id arcmsr_device_id_table[] = { +static const struct pci_device_id arcmsr_device_id_table[] = { {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1110), .driver_data = ACB_ADAPTER_TYPE_A}, {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1120), diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c index 928151ec927a..401242912855 100644 --- a/drivers/scsi/atp870u.c +++ b/drivers/scsi/atp870u.c @@ -1743,7 +1743,7 @@ static const struct scsi_host_template atp870u_template = { .max_sectors = ATP870U_MAX_SECTORS, }; -static struct pci_device_id atp870u_id_table[] = { +static const struct pci_device_id atp870u_id_table[] = { { PCI_DEVICE(PCI_VENDOR_ID_ARTOP, ATP885_DEVID) }, { PCI_DEVICE(PCI_VENDOR_ID_ARTOP, ATP880_DEVID1) }, { PCI_DEVICE(PCI_VENDOR_ID_ARTOP, ATP880_DEVID2) }, diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c index 60d62b93d624..76073a71c028 100644 --- a/drivers/scsi/cxlflash/main.c +++ b/drivers/scsi/cxlflash/main.c @@ -3177,7 +3177,7 @@ static struct dev_dependent_vals dev_briard_vals = { CXLFLASH_MAX_SECTORS, /* * PCI device binding table */ -static struct pci_device_id cxlflash_pci_table[] = { +static const struct pci_device_id cxlflash_pci_table[] = { {PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CORSA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (kernel_ulong_t)&dev_corsa_vals}, {PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_FLASH_GT, diff --git a/drivers/scsi/dc395x.c b/drivers/scsi/dc395x.c index 235ebc851ca9..e71de2419758 100644 --- a/drivers/scsi/dc395x.c +++ b/drivers/scsi/dc395x.c @@ -4668,7 +4668,7 @@ static void dc395x_remove_one(struct pci_dev *dev) } -static struct pci_device_id dc395x_pci_table[] = { +static const struct pci_device_id dc395x_pci_table[] = { { .vendor = PCI_VENDOR_ID_TEKRAM, .device = PCI_DEVICE_ID_TEKRAM_TRMS1040, diff --git a/drivers/scsi/dmx3191d.c b/drivers/scsi/dmx3191d.c index dfb091d34363..d6d091b2f3c7 100644 --- a/drivers/scsi/dmx3191d.c +++ b/drivers/scsi/dmx3191d.c @@ -127,7 +127,7 @@ static void dmx3191d_remove_one(struct pci_dev *pdev) pci_disable_device(pdev); } -static struct pci_device_id dmx3191d_pci_tbl[] = { +static const struct pci_device_id dmx3191d_pci_tbl[] = { {PCI_VENDOR_ID_DOMEX, PCI_DEVICE_ID_DOMEX_DMX3191D, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4}, { } diff --git a/drivers/scsi/elx/efct/efct_driver.c b/drivers/scsi/elx/efct/efct_driver.c index 55d2301bfd7d..8469c156ab33 100644 --- a/drivers/scsi/elx/efct/efct_driver.c +++ b/drivers/scsi/elx/efct/efct_driver.c @@ -470,7 +470,7 @@ out: return rc; } -static struct pci_device_id efct_pci_table[] = { +static const struct pci_device_id efct_pci_table[] = { {PCI_DEVICE(EFCT_VENDOR_ID, EFCT_DEVICE_LANCER_G6), 0}, {PCI_DEVICE(EFCT_VENDOR_ID, EFCT_DEVICE_LANCER_G7), 0}, {} /* terminate list */ diff --git a/drivers/scsi/fdomain_pci.c b/drivers/scsi/fdomain_pci.c index 3e05ce7b89e5..c15b2ce76e9f 100644 --- a/drivers/scsi/fdomain_pci.c +++ b/drivers/scsi/fdomain_pci.c @@ -47,7 +47,7 @@ static void fdomain_pci_remove(struct pci_dev *pdev) pci_disable_device(pdev); } -static struct pci_device_id fdomain_pci_table[] = { +static const struct pci_device_id fdomain_pci_table[] = { { PCI_DEVICE(PCI_VENDOR_ID_FD, PCI_DEVICE_ID_FD_36C70) }, {} }; diff --git a/drivers/scsi/fnic/fnic_main.c b/drivers/scsi/fnic/fnic_main.c index 84e79b1f12f2..b57287409113 100644 --- a/drivers/scsi/fnic/fnic_main.c +++ b/drivers/scsi/fnic/fnic_main.c @@ -43,7 +43,7 @@ static DEFINE_SPINLOCK(fnic_list_lock); static DEFINE_IDA(fnic_ida); /* Supported devices by fnic module */ -static struct pci_device_id fnic_id_table[] = { +static const struct pci_device_id fnic_id_table[] = { { PCI_DEVICE(PCI_VENDOR_ID_CISCO, PCI_DEVICE_ID_CISCO_FNIC) }, { 0, } }; diff --git a/drivers/scsi/hptiop.c b/drivers/scsi/hptiop.c index 55eee5b0f0d7..21f1d9871a33 100644 --- a/drivers/scsi/hptiop.c +++ b/drivers/scsi/hptiop.c @@ -1634,7 +1634,7 @@ static struct hptiop_adapter_ops hptiop_mvfrey_ops = { .host_phy_flag = cpu_to_le64(1), }; -static struct pci_device_id hptiop_id_table[] = { +static const struct pci_device_id hptiop_id_table[] = { { PCI_VDEVICE(TTI, 0x3220), (kernel_ulong_t)&hptiop_itl_ops }, { PCI_VDEVICE(TTI, 0x3320), (kernel_ulong_t)&hptiop_itl_ops }, { PCI_VDEVICE(TTI, 0x3410), (kernel_ulong_t)&hptiop_itl_ops }, diff --git a/drivers/scsi/initio.c b/drivers/scsi/initio.c index 625fd547ee60..8648bd965287 100644 --- a/drivers/scsi/initio.c +++ b/drivers/scsi/initio.c @@ -2941,7 +2941,7 @@ static void initio_remove_one(struct pci_dev *pdev) MODULE_LICENSE("GPL"); -static struct pci_device_id initio_pci_tbl[] = { +static const struct pci_device_id initio_pci_tbl[] = { {PCI_VENDOR_ID_INIT, 0x9500, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {PCI_VENDOR_ID_INIT, 0x9400, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {PCI_VENDOR_ID_INIT, 0x9401, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index f0444faf776a..1ea528f5d23d 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c @@ -9844,7 +9844,7 @@ static void ipr_shutdown(struct pci_dev *pdev) } } -static struct pci_device_id ipr_pci_table[] = { +static const struct pci_device_id ipr_pci_table[] = { { PCI_VENDOR_ID_MYLEX, PCI_DEVICE_ID_IBM_GEMSTONE, PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_5702, 0, 0, 0 }, { PCI_VENDOR_ID_MYLEX, PCI_DEVICE_ID_IBM_GEMSTONE, diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c index 38976f94453e..adab151663dd 100644 --- a/drivers/scsi/megaraid.c +++ b/drivers/scsi/megaraid.c @@ -4551,7 +4551,7 @@ megaraid_shutdown(struct pci_dev *pdev) __megaraid_shutdown(adapter); } -static struct pci_device_id megaraid_pci_tbl[] = { +static const struct pci_device_id megaraid_pci_tbl[] = { {PCI_VENDOR_ID_AMI, PCI_DEVICE_ID_AMI_MEGARAID, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {PCI_VENDOR_ID_AMI, PCI_DEVICE_ID_AMI_MEGARAID2, diff --git a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c index bc867da650b6..60cc3372991f 100644 --- a/drivers/scsi/megaraid/megaraid_mbox.c +++ b/drivers/scsi/megaraid/megaraid_mbox.c @@ -199,7 +199,7 @@ MODULE_PARM_DESC(debug_level, "Debug level for driver (default=0)"); /* * PCI table for all supported controllers. */ -static struct pci_device_id pci_id_table_g[] = { +static const struct pci_device_id pci_id_table_g[] = { { PCI_VENDOR_ID_DELL, PCI_DEVICE_ID_PERC4_DI_DISCOVERY, @@ -621,7 +621,7 @@ megaraid_io_attach(adapter_t *adapter) host = scsi_host_alloc(&megaraid_template_g, 8); if (!host) { con_log(CL_ANN, (KERN_WARNING - "megaraid mbox: scsi_register failed\n")); + "megaraid mbox: scsi_host_alloc failed\n")); return -1; } diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index ba2ab5911c53..d85f990aec88 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -146,7 +146,7 @@ megasas_set_ld_removed_by_fw(struct megasas_instance *instance); /* * PCI ID table for all supported controllers */ -static struct pci_device_id megasas_pci_table[] = { +static const struct pci_device_id megasas_pci_table[] = { {PCI_DEVICE(PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_SAS1064R)}, /* xscale IOP */ diff --git a/drivers/scsi/mvsas/mv_init.c b/drivers/scsi/mvsas/mv_init.c index 020037cbf0d9..2c72da6b8cf0 100644 --- a/drivers/scsi/mvsas/mv_init.c +++ b/drivers/scsi/mvsas/mv_init.c @@ -609,7 +609,7 @@ static void mvs_pci_remove(struct pci_dev *pdev) return; } -static struct pci_device_id mvs_pci_table[] = { +static const struct pci_device_id mvs_pci_table[] = { { PCI_VDEVICE(MARVELL, 0x6320), chip_6320 }, { PCI_VDEVICE(MARVELL, 0x6340), chip_6440 }, { diff --git a/drivers/scsi/nsp32.c b/drivers/scsi/nsp32.c index b7987019686e..abc4ce9eae74 100644 --- a/drivers/scsi/nsp32.c +++ b/drivers/scsi/nsp32.c @@ -66,7 +66,7 @@ static const char *nsp32_release_version = "1.2"; /**************************************************************************** * Supported hardware */ -static struct pci_device_id nsp32_pci_table[] = { +static const struct pci_device_id nsp32_pci_table[] = { { .vendor = PCI_VENDOR_ID_IODATA, .device = PCI_DEVICE_ID_NINJASCSI_32BI_CBSC_II, diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c index 571121520cf4..599410bcdfea 100644 --- a/drivers/scsi/pm8001/pm8001_init.c +++ b/drivers/scsi/pm8001/pm8001_init.c @@ -1435,7 +1435,7 @@ err_out_disable: /* update of pci device, vendor id and driver data with * unique value for each of the controller */ -static struct pci_device_id pm8001_pci_table[] = { +static const struct pci_device_id pm8001_pci_table[] = { { PCI_VDEVICE(PMC_Sierra, 0x8001), chip_8001 }, { PCI_VDEVICE(PMC_Sierra, 0x8006), chip_8006 }, { PCI_VDEVICE(ADAPTEC2, 0x8006), chip_8006 }, diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c index 2342ded7ee78..3ba53916fd86 100644 --- a/drivers/scsi/pmcraid.c +++ b/drivers/scsi/pmcraid.c @@ -113,7 +113,7 @@ static struct pmcraid_chip_details pmcraid_chip_cfg[] = { /* * PCI device ids supported by pmcraid driver */ -static struct pci_device_id pmcraid_pci_table[] = { +static const struct pci_device_id pmcraid_pci_table[] = { { PCI_DEVICE(PCI_VENDOR_ID_PMC, PCI_DEVICE_ID_PMC_MAXRAID), 0, 0, (kernel_ulong_t)&pmcraid_chip_cfg[0] }, diff --git a/drivers/scsi/qedi/qedi_main.c b/drivers/scsi/qedi/qedi_main.c index 628d59dda20c..1cab66a1f4f6 100644 --- a/drivers/scsi/qedi/qedi_main.c +++ b/drivers/scsi/qedi/qedi_main.c @@ -2869,7 +2869,7 @@ static void qedi_remove(struct pci_dev *pdev) __qedi_remove(pdev, QEDI_MODE_NORMAL); } -static struct pci_device_id qedi_pci_tbl[] = { +static const struct pci_device_id qedi_pci_tbl[] = { { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, 0x165E) }, { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, 0x8084) }, { 0 }, diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c index 360867838abd..1fd2da0264e3 100644 --- a/drivers/scsi/qla1280.c +++ b/drivers/scsi/qla1280.c @@ -501,7 +501,7 @@ struct qla_boards { }; /* NOTE: the last argument in each entry is used to index ql1280_board_tbl */ -static struct pci_device_id qla1280_pci_tbl[] = { +static const struct pci_device_id qla1280_pci_tbl[] = { {PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP12160, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP1020, diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index fb6ff4a5e360..6b9b8218b512 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c @@ -8116,7 +8116,7 @@ static const struct pci_error_handlers qla2xxx_err_handler = { .reset_done = qla_pci_reset_done, }; -static struct pci_device_id qla2xxx_pci_tbl[] = { +static const struct pci_device_id qla2xxx_pci_tbl[] = { { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2100) }, { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2200) }, { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2300) }, diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c index 863071f80d39..062ec5f24758 100644 --- a/drivers/scsi/qla4xxx/ql4_os.c +++ b/drivers/scsi/qla4xxx/ql4_os.c @@ -9846,7 +9846,7 @@ static const struct pci_error_handlers qla4xxx_err_handler = { .resume = qla4xxx_pci_resume, }; -static struct pci_device_id qla4xxx_pci_tbl[] = { +static const struct pci_device_id qla4xxx_pci_tbl[] = { { .vendor = PCI_VENDOR_ID_QLOGIC, .device = PCI_DEVICE_ID_QLOGIC_ISP4010, diff --git a/drivers/scsi/snic/snic_main.c b/drivers/scsi/snic/snic_main.c index d3cf50088a37..1c24517e4e65 100644 --- a/drivers/scsi/snic/snic_main.c +++ b/drivers/scsi/snic/snic_main.c @@ -21,7 +21,7 @@ #define PCI_DEVICE_ID_CISCO_SNIC 0x0046 /* Supported devices by snic module */ -static struct pci_device_id snic_id_table[] = { +static const struct pci_device_id snic_id_table[] = { {PCI_DEVICE(0x1137, PCI_DEVICE_ID_CISCO_SNIC) }, { 0, } /* end of table */ }; diff --git a/drivers/scsi/stex.c b/drivers/scsi/stex.c index 0e5c7609dcc4..63ed7f9aaa93 100644 --- a/drivers/scsi/stex.c +++ b/drivers/scsi/stex.c @@ -1488,7 +1488,7 @@ static const struct scsi_host_template driver_template = { .dma_boundary = PAGE_SIZE - 1, }; -static struct pci_device_id stex_pci_tbl[] = { +static const struct pci_device_id stex_pci_tbl[] = { /* st_shasta */ { 0x105a, 0x8350, PCI_ANY_ID, PCI_ANY_ID, 0, 0, st_shasta }, /* SuperTrak EX8350/8300/16350/16300 */ diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index e4696bf41b11..45665d4aca92 100644 --- a/drivers/scsi/storvsc_drv.c +++ b/drivers/scsi/storvsc_drv.c @@ -917,14 +917,13 @@ static int storvsc_channel_init(struct hv_device *device, bool is_fc) /* * Allocate state to manage the sub-channels. - * We allocate an array based on the numbers of possible CPUs - * (Hyper-V does not support cpu online/offline). - * This Array will be sparseley populated with unique - * channels - primary + sub-channels. - * We will however populate all the slots to evenly distribute - * the load. + * We allocate an array based on the number of CPU ids. This array + * is initially sparsely populated for the CPUs assigned to channels: + * primary + sub-channels. As I/Os are initiated by different CPUs, + * the slots for all online CPUs are populated to evenly distribute + * the load across all channels. */ - stor_device->stor_chns = kcalloc(num_possible_cpus(), sizeof(void *), + stor_device->stor_chns = kcalloc(nr_cpu_ids, sizeof(void *), GFP_KERNEL); if (stor_device->stor_chns == NULL) return -ENOMEM; diff --git a/drivers/scsi/sym53c8xx_2/sym_glue.c b/drivers/scsi/sym53c8xx_2/sym_glue.c index 9b8cb7319370..212d89d0d23e 100644 --- a/drivers/scsi/sym53c8xx_2/sym_glue.c +++ b/drivers/scsi/sym53c8xx_2/sym_glue.c @@ -2031,7 +2031,7 @@ static struct spi_function_template sym2_transport_functions = { .get_signalling = sym2_get_signalling, }; -static struct pci_device_id sym2_id_table[] = { +static const struct pci_device_id sym2_id_table[] = { { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_NCR_53C810, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL }, { PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_NCR_53C820, diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index ae88bea21d2a..f7691b457c51 100644 --- a/drivers/ufs/core/ufshcd.c +++ b/drivers/ufs/core/ufshcd.c @@ -4805,20 +4805,14 @@ EXPORT_SYMBOL_GPL(ufshcd_make_hba_operational); */ void ufshcd_hba_stop(struct ufs_hba *hba) { - unsigned long flags; int err; - /* - * Obtain the host lock to prevent that the controller is disabled - * while the UFS interrupt handler is active on another CPU. - */ - spin_lock_irqsave(hba->host->host_lock, flags); + ufshcd_disable_irq(hba); ufshcd_writel(hba, CONTROLLER_DISABLE, REG_CONTROLLER_ENABLE); - spin_unlock_irqrestore(hba->host->host_lock, flags); - err = ufshcd_wait_for_register(hba, REG_CONTROLLER_ENABLE, CONTROLLER_ENABLE, CONTROLLER_DISABLE, 10, 1); + ufshcd_enable_irq(hba); if (err) dev_err(hba->dev, "%s: Controller disable failed\n", __func__); } diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 8fccfd27393e..fac90ae884c7 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -595,7 +595,7 @@ struct Scsi_Host { * have some way of identifying each detected host adapter properly * and uniquely. For hosts that do not support more than one card * in the system at one time, this does not need to be set. It is - * initialized to 0 in scsi_register. + * initialized to 0 in scsi_host_alloc. */ unsigned int unique_id;