aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorBrian Norris <computersforpeace@gmail.com>2017-06-01 13:53:55 -0400
committerBrian Norris <computersforpeace@gmail.com>2017-06-01 13:53:55 -0400
commit05e97a9eda72d58dba293857df6aac62584ef99a (patch)
treee86e692f26d4879ff2210c54722e2b7780210249 /drivers/scsi
parent2ea659a9ef488125eb46da6eb571de5eae5c43f6 (diff)
parentd4ed3b9015b5eebc90d629579d9e7944607cbae5 (diff)
Merge tag 'nand/fixes-for-4.12-rc3' of git://git.infradead.org/linux-mtd into MTD
From Boris: """ This pull request contains several fixes to the core and the tango driver. tango fixes: * Add missing MODULE_DEVICE_TABLE() in tango_nand.c * Update the number of corrected bitflips core fixes: * Fix a long standing memory leak in nand_scan_tail() * Fix several bugs introduced by the per-vendor init/detection infrastructure (introduced in 4.12) * Add a static specifier to nand_ooblayout_lp_hamming_ops definition """
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/cxlflash/Kconfig1
-rw-r--r--drivers/scsi/libfc/fc_fcp.c15
-rw-r--r--drivers/scsi/lpfc/lpfc_crtn.h1
-rw-r--r--drivers/scsi/lpfc/lpfc_ct.c2
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c9
-rw-r--r--drivers/scsi/lpfc/lpfc_nvmet.c1
-rw-r--r--drivers/scsi/lpfc/lpfc_sli.c19
-rw-r--r--drivers/scsi/pmcraid.c3
-rw-r--r--drivers/scsi/qedf/qedf.h2
-rw-r--r--drivers/scsi/qedf/qedf_els.c2
-rw-r--r--drivers/scsi/qedf/qedf_main.c2
-rw-r--r--drivers/scsi/scsi.c2
-rw-r--r--drivers/scsi/scsi_lib.c1
13 files changed, 38 insertions, 22 deletions
diff --git a/drivers/scsi/cxlflash/Kconfig b/drivers/scsi/cxlflash/Kconfig
index c052104e523e..a011c5dbf214 100644
--- a/drivers/scsi/cxlflash/Kconfig
+++ b/drivers/scsi/cxlflash/Kconfig
@@ -5,6 +5,7 @@
5config CXLFLASH 5config CXLFLASH
6 tristate "Support for IBM CAPI Flash" 6 tristate "Support for IBM CAPI Flash"
7 depends on PCI && SCSI && CXL && EEH 7 depends on PCI && SCSI && CXL && EEH
8 select IRQ_POLL
8 default m 9 default m
9 help 10 help
10 Allows CAPI Accelerated IO to Flash 11 Allows CAPI Accelerated IO to Flash
diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c
index a808e8ef1d08..234352da5c3c 100644
--- a/drivers/scsi/libfc/fc_fcp.c
+++ b/drivers/scsi/libfc/fc_fcp.c
@@ -407,11 +407,12 @@ unlock:
407 * can_queue. Eventually we will hit the point where we run 407 * can_queue. Eventually we will hit the point where we run
408 * on all reserved structs. 408 * on all reserved structs.
409 */ 409 */
410static void fc_fcp_can_queue_ramp_down(struct fc_lport *lport) 410static bool fc_fcp_can_queue_ramp_down(struct fc_lport *lport)
411{ 411{
412 struct fc_fcp_internal *si = fc_get_scsi_internal(lport); 412 struct fc_fcp_internal *si = fc_get_scsi_internal(lport);
413 unsigned long flags; 413 unsigned long flags;
414 int can_queue; 414 int can_queue;
415 bool changed = false;
415 416
416 spin_lock_irqsave(lport->host->host_lock, flags); 417 spin_lock_irqsave(lport->host->host_lock, flags);
417 418
@@ -427,9 +428,11 @@ static void fc_fcp_can_queue_ramp_down(struct fc_lport *lport)
427 if (!can_queue) 428 if (!can_queue)
428 can_queue = 1; 429 can_queue = 1;
429 lport->host->can_queue = can_queue; 430 lport->host->can_queue = can_queue;
431 changed = true;
430 432
431unlock: 433unlock:
432 spin_unlock_irqrestore(lport->host->host_lock, flags); 434 spin_unlock_irqrestore(lport->host->host_lock, flags);
435 return changed;
433} 436}
434 437
435/* 438/*
@@ -1896,11 +1899,11 @@ int fc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *sc_cmd)
1896 1899
1897 if (!fc_fcp_lport_queue_ready(lport)) { 1900 if (!fc_fcp_lport_queue_ready(lport)) {
1898 if (lport->qfull) { 1901 if (lport->qfull) {
1899 fc_fcp_can_queue_ramp_down(lport); 1902 if (fc_fcp_can_queue_ramp_down(lport))
1900 shost_printk(KERN_ERR, lport->host, 1903 shost_printk(KERN_ERR, lport->host,
1901 "libfc: queue full, " 1904 "libfc: queue full, "
1902 "reducing can_queue to %d.\n", 1905 "reducing can_queue to %d.\n",
1903 lport->host->can_queue); 1906 lport->host->can_queue);
1904 } 1907 }
1905 rc = SCSI_MLQUEUE_HOST_BUSY; 1908 rc = SCSI_MLQUEUE_HOST_BUSY;
1906 goto out; 1909 goto out;
diff --git a/drivers/scsi/lpfc/lpfc_crtn.h b/drivers/scsi/lpfc/lpfc_crtn.h
index 944b32ca4931..1c55408ac718 100644
--- a/drivers/scsi/lpfc/lpfc_crtn.h
+++ b/drivers/scsi/lpfc/lpfc_crtn.h
@@ -294,6 +294,7 @@ int lpfc_selective_reset(struct lpfc_hba *);
294void lpfc_reset_barrier(struct lpfc_hba *); 294void lpfc_reset_barrier(struct lpfc_hba *);
295int lpfc_sli_brdready(struct lpfc_hba *, uint32_t); 295int lpfc_sli_brdready(struct lpfc_hba *, uint32_t);
296int lpfc_sli_brdkill(struct lpfc_hba *); 296int lpfc_sli_brdkill(struct lpfc_hba *);
297int lpfc_sli_chipset_init(struct lpfc_hba *phba);
297int lpfc_sli_brdreset(struct lpfc_hba *); 298int lpfc_sli_brdreset(struct lpfc_hba *);
298int lpfc_sli_brdrestart(struct lpfc_hba *); 299int lpfc_sli_brdrestart(struct lpfc_hba *);
299int lpfc_sli_hba_setup(struct lpfc_hba *); 300int lpfc_sli_hba_setup(struct lpfc_hba *);
diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c
index 1487406aea77..c7962dae4dab 100644
--- a/drivers/scsi/lpfc/lpfc_ct.c
+++ b/drivers/scsi/lpfc/lpfc_ct.c
@@ -630,7 +630,7 @@ lpfc_ns_rsp(struct lpfc_vport *vport, struct lpfc_dmabuf *mp, uint8_t fc4_type,
630 NLP_EVT_DEVICE_RECOVERY); 630 NLP_EVT_DEVICE_RECOVERY);
631 spin_lock_irq(shost->host_lock); 631 spin_lock_irq(shost->host_lock);
632 ndlp->nlp_flag &= ~NLP_NVMET_RECOV; 632 ndlp->nlp_flag &= ~NLP_NVMET_RECOV;
633 spin_lock_irq(shost->host_lock); 633 spin_unlock_irq(shost->host_lock);
634 } 634 }
635 } 635 }
636 636
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 90ae354a9c45..4b1eb98c228d 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -3602,6 +3602,13 @@ lpfc_get_wwpn(struct lpfc_hba *phba)
3602 LPFC_MBOXQ_t *mboxq; 3602 LPFC_MBOXQ_t *mboxq;
3603 MAILBOX_t *mb; 3603 MAILBOX_t *mb;
3604 3604
3605 if (phba->sli_rev < LPFC_SLI_REV4) {
3606 /* Reset the port first */
3607 lpfc_sli_brdrestart(phba);
3608 rc = lpfc_sli_chipset_init(phba);
3609 if (rc)
3610 return (uint64_t)-1;
3611 }
3605 3612
3606 mboxq = (LPFC_MBOXQ_t *) mempool_alloc(phba->mbox_mem_pool, 3613 mboxq = (LPFC_MBOXQ_t *) mempool_alloc(phba->mbox_mem_pool,
3607 GFP_KERNEL); 3614 GFP_KERNEL);
@@ -8847,7 +8854,7 @@ lpfc_sli4_queue_unset(struct lpfc_hba *phba)
8847 lpfc_wq_destroy(phba, phba->sli4_hba.nvmels_wq); 8854 lpfc_wq_destroy(phba, phba->sli4_hba.nvmels_wq);
8848 8855
8849 /* Unset ELS work queue */ 8856 /* Unset ELS work queue */
8850 if (phba->sli4_hba.els_cq) 8857 if (phba->sli4_hba.els_wq)
8851 lpfc_wq_destroy(phba, phba->sli4_hba.els_wq); 8858 lpfc_wq_destroy(phba, phba->sli4_hba.els_wq);
8852 8859
8853 /* Unset unsolicited receive queue */ 8860 /* Unset unsolicited receive queue */
diff --git a/drivers/scsi/lpfc/lpfc_nvmet.c b/drivers/scsi/lpfc/lpfc_nvmet.c
index 94434e621c33..0488580eea12 100644
--- a/drivers/scsi/lpfc/lpfc_nvmet.c
+++ b/drivers/scsi/lpfc/lpfc_nvmet.c
@@ -764,7 +764,6 @@ lpfc_nvmet_create_targetport(struct lpfc_hba *phba)
764 lpfc_tgttemplate.max_sgl_segments = phba->cfg_nvme_seg_cnt + 1; 764 lpfc_tgttemplate.max_sgl_segments = phba->cfg_nvme_seg_cnt + 1;
765 lpfc_tgttemplate.max_hw_queues = phba->cfg_nvme_io_channel; 765 lpfc_tgttemplate.max_hw_queues = phba->cfg_nvme_io_channel;
766 lpfc_tgttemplate.target_features = NVMET_FCTGTFEAT_READDATA_RSP | 766 lpfc_tgttemplate.target_features = NVMET_FCTGTFEAT_READDATA_RSP |
767 NVMET_FCTGTFEAT_NEEDS_CMD_CPUSCHED |
768 NVMET_FCTGTFEAT_CMD_IN_ISR | 767 NVMET_FCTGTFEAT_CMD_IN_ISR |
769 NVMET_FCTGTFEAT_OPDONE_IN_ISR; 768 NVMET_FCTGTFEAT_OPDONE_IN_ISR;
770 769
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index cf19f4976f5f..2a4fc00dfa9b 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -4204,13 +4204,16 @@ lpfc_sli_brdreset(struct lpfc_hba *phba)
4204 /* Reset HBA */ 4204 /* Reset HBA */
4205 lpfc_printf_log(phba, KERN_INFO, LOG_SLI, 4205 lpfc_printf_log(phba, KERN_INFO, LOG_SLI,
4206 "0325 Reset HBA Data: x%x x%x\n", 4206 "0325 Reset HBA Data: x%x x%x\n",
4207 phba->pport->port_state, psli->sli_flag); 4207 (phba->pport) ? phba->pport->port_state : 0,
4208 psli->sli_flag);
4208 4209
4209 /* perform board reset */ 4210 /* perform board reset */
4210 phba->fc_eventTag = 0; 4211 phba->fc_eventTag = 0;
4211 phba->link_events = 0; 4212 phba->link_events = 0;
4212 phba->pport->fc_myDID = 0; 4213 if (phba->pport) {
4213 phba->pport->fc_prevDID = 0; 4214 phba->pport->fc_myDID = 0;
4215 phba->pport->fc_prevDID = 0;
4216 }
4214 4217
4215 /* Turn off parity checking and serr during the physical reset */ 4218 /* Turn off parity checking and serr during the physical reset */
4216 pci_read_config_word(phba->pcidev, PCI_COMMAND, &cfg_value); 4219 pci_read_config_word(phba->pcidev, PCI_COMMAND, &cfg_value);
@@ -4336,7 +4339,8 @@ lpfc_sli_brdrestart_s3(struct lpfc_hba *phba)
4336 /* Restart HBA */ 4339 /* Restart HBA */
4337 lpfc_printf_log(phba, KERN_INFO, LOG_SLI, 4340 lpfc_printf_log(phba, KERN_INFO, LOG_SLI,
4338 "0337 Restart HBA Data: x%x x%x\n", 4341 "0337 Restart HBA Data: x%x x%x\n",
4339 phba->pport->port_state, psli->sli_flag); 4342 (phba->pport) ? phba->pport->port_state : 0,
4343 psli->sli_flag);
4340 4344
4341 word0 = 0; 4345 word0 = 0;
4342 mb = (MAILBOX_t *) &word0; 4346 mb = (MAILBOX_t *) &word0;
@@ -4350,7 +4354,7 @@ lpfc_sli_brdrestart_s3(struct lpfc_hba *phba)
4350 readl(to_slim); /* flush */ 4354 readl(to_slim); /* flush */
4351 4355
4352 /* Only skip post after fc_ffinit is completed */ 4356 /* Only skip post after fc_ffinit is completed */
4353 if (phba->pport->port_state) 4357 if (phba->pport && phba->pport->port_state)
4354 word0 = 1; /* This is really setting up word1 */ 4358 word0 = 1; /* This is really setting up word1 */
4355 else 4359 else
4356 word0 = 0; /* This is really setting up word1 */ 4360 word0 = 0; /* This is really setting up word1 */
@@ -4359,7 +4363,8 @@ lpfc_sli_brdrestart_s3(struct lpfc_hba *phba)
4359 readl(to_slim); /* flush */ 4363 readl(to_slim); /* flush */
4360 4364
4361 lpfc_sli_brdreset(phba); 4365 lpfc_sli_brdreset(phba);
4362 phba->pport->stopped = 0; 4366 if (phba->pport)
4367 phba->pport->stopped = 0;
4363 phba->link_state = LPFC_INIT_START; 4368 phba->link_state = LPFC_INIT_START;
4364 phba->hba_flag = 0; 4369 phba->hba_flag = 0;
4365 spin_unlock_irq(&phba->hbalock); 4370 spin_unlock_irq(&phba->hbalock);
@@ -4446,7 +4451,7 @@ lpfc_sli_brdrestart(struct lpfc_hba *phba)
4446 * iteration, the function will restart the HBA again. The function returns 4451 * iteration, the function will restart the HBA again. The function returns
4447 * zero if HBA successfully restarted else returns negative error code. 4452 * zero if HBA successfully restarted else returns negative error code.
4448 **/ 4453 **/
4449static int 4454int
4450lpfc_sli_chipset_init(struct lpfc_hba *phba) 4455lpfc_sli_chipset_init(struct lpfc_hba *phba)
4451{ 4456{
4452 uint32_t status, i = 0; 4457 uint32_t status, i = 0;
diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c
index a4aadf5f4dc6..1cc814f1505a 100644
--- a/drivers/scsi/pmcraid.c
+++ b/drivers/scsi/pmcraid.c
@@ -3770,9 +3770,6 @@ static long pmcraid_ioctl_passthrough(
3770 pmcraid_err("couldn't build passthrough ioadls\n"); 3770 pmcraid_err("couldn't build passthrough ioadls\n");
3771 goto out_free_cmd; 3771 goto out_free_cmd;
3772 } 3772 }
3773 } else if (request_size < 0) {
3774 rc = -EINVAL;
3775 goto out_free_cmd;
3776 } 3773 }
3777 3774
3778 /* If data is being written into the device, copy the data from user 3775 /* If data is being written into the device, copy the data from user
diff --git a/drivers/scsi/qedf/qedf.h b/drivers/scsi/qedf/qedf.h
index 40aeb6bb96a2..07ee88200e91 100644
--- a/drivers/scsi/qedf/qedf.h
+++ b/drivers/scsi/qedf/qedf.h
@@ -259,7 +259,7 @@ struct qedf_io_log {
259 uint16_t task_id; 259 uint16_t task_id;
260 uint32_t port_id; /* Remote port fabric ID */ 260 uint32_t port_id; /* Remote port fabric ID */
261 int lun; 261 int lun;
262 char op; /* SCSI CDB */ 262 unsigned char op; /* SCSI CDB */
263 uint8_t lba[4]; 263 uint8_t lba[4];
264 unsigned int bufflen; /* SCSI buffer length */ 264 unsigned int bufflen; /* SCSI buffer length */
265 unsigned int sg_count; /* Number of SG elements */ 265 unsigned int sg_count; /* Number of SG elements */
diff --git a/drivers/scsi/qedf/qedf_els.c b/drivers/scsi/qedf/qedf_els.c
index c505d41f6dc8..90627033bde6 100644
--- a/drivers/scsi/qedf/qedf_els.c
+++ b/drivers/scsi/qedf/qedf_els.c
@@ -109,7 +109,7 @@ retry_els:
109 did = fcport->rdata->ids.port_id; 109 did = fcport->rdata->ids.port_id;
110 sid = fcport->sid; 110 sid = fcport->sid;
111 111
112 __fc_fill_fc_hdr(fc_hdr, FC_RCTL_ELS_REQ, sid, did, 112 __fc_fill_fc_hdr(fc_hdr, FC_RCTL_ELS_REQ, did, sid,
113 FC_TYPE_ELS, FC_FC_FIRST_SEQ | FC_FC_END_SEQ | 113 FC_TYPE_ELS, FC_FC_FIRST_SEQ | FC_FC_END_SEQ |
114 FC_FC_SEQ_INIT, 0); 114 FC_FC_SEQ_INIT, 0);
115 115
diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c
index cceddd995a4b..a5c97342fd5d 100644
--- a/drivers/scsi/qedf/qedf_main.c
+++ b/drivers/scsi/qedf/qedf_main.c
@@ -2895,7 +2895,7 @@ static int __qedf_probe(struct pci_dev *pdev, int mode)
2895 slowpath_params.drv_minor = QEDF_DRIVER_MINOR_VER; 2895 slowpath_params.drv_minor = QEDF_DRIVER_MINOR_VER;
2896 slowpath_params.drv_rev = QEDF_DRIVER_REV_VER; 2896 slowpath_params.drv_rev = QEDF_DRIVER_REV_VER;
2897 slowpath_params.drv_eng = QEDF_DRIVER_ENG_VER; 2897 slowpath_params.drv_eng = QEDF_DRIVER_ENG_VER;
2898 memcpy(slowpath_params.name, "qedf", QED_DRV_VER_STR_SIZE); 2898 strncpy(slowpath_params.name, "qedf", QED_DRV_VER_STR_SIZE);
2899 rc = qed_ops->common->slowpath_start(qedf->cdev, &slowpath_params); 2899 rc = qed_ops->common->slowpath_start(qedf->cdev, &slowpath_params);
2900 if (rc) { 2900 if (rc) {
2901 QEDF_ERR(&(qedf->dbg_ctx), "Cannot start slowpath.\n"); 2901 QEDF_ERR(&(qedf->dbg_ctx), "Cannot start slowpath.\n");
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index 7bfbcfa7af40..61cdd99ae41e 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -763,6 +763,8 @@ struct scsi_device *__scsi_device_lookup(struct Scsi_Host *shost,
763 struct scsi_device *sdev; 763 struct scsi_device *sdev;
764 764
765 list_for_each_entry(sdev, &shost->__devices, siblings) { 765 list_for_each_entry(sdev, &shost->__devices, siblings) {
766 if (sdev->sdev_state == SDEV_DEL)
767 continue;
766 if (sdev->channel == channel && sdev->id == id && 768 if (sdev->channel == channel && sdev->id == id &&
767 sdev->lun ==lun) 769 sdev->lun ==lun)
768 return sdev; 770 return sdev;
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 814a4bd8405d..e31f1cc90b81 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -30,6 +30,7 @@
30#include <scsi/scsi_driver.h> 30#include <scsi/scsi_driver.h>
31#include <scsi/scsi_eh.h> 31#include <scsi/scsi_eh.h>
32#include <scsi/scsi_host.h> 32#include <scsi/scsi_host.h>
33#include <scsi/scsi_transport.h> /* __scsi_init_queue() */
33#include <scsi/scsi_dh.h> 34#include <scsi/scsi_dh.h>
34 35
35#include <trace/events/scsi.h> 36#include <trace/events/scsi.h>