Commit 6fe1de43 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi

Pull SCSI fixes from James Bottomley:
 "This is the first sweep of mostly minor fixes. There's one security
  one: the read past the end of a buffer in qedf, and a panic fix for
  lpfc SLI-3 adapters, but the rest are a set of include and build
  dependency tidy ups and assorted other small fixes and updates"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
  scsi: pmcraid: remove redundant check to see if request_size is less than zero
  scsi: lpfc: ensure els_wq is being checked before destroying it
  scsi: cxlflash: Select IRQ_POLL
  scsi: qedf: Avoid reading past end of buffer
  scsi: qedf: Cleanup the type of io_log->op
  scsi: lpfc: double lock typo in lpfc_ns_rsp()
  scsi: qedf: properly update arguments position in function call
  scsi: scsi_lib: Add #include <scsi/scsi_transport.h>
  scsi: MAINTAINERS: update OSD entries
  scsi: Skip deleted devices in __scsi_device_lookup
  scsi: lpfc: Fix panic on BFS configuration
  scsi: libfc: do not flood console with messages 'libfc: queue full ...'
parents 8c3fc164 b77b36cb
...@@ -9553,10 +9553,6 @@ F: drivers/net/wireless/intersil/orinoco/ ...@@ -9553,10 +9553,6 @@ F: drivers/net/wireless/intersil/orinoco/
OSD LIBRARY and FILESYSTEM OSD LIBRARY and FILESYSTEM
M: Boaz Harrosh <ooo@electrozaur.com> M: Boaz Harrosh <ooo@electrozaur.com>
M: Benny Halevy <bhalevy@primarydata.com>
L: osd-dev@open-osd.org
W: http://open-osd.org
T: git git://git.open-osd.org/open-osd.git
S: Maintained S: Maintained
F: drivers/scsi/osd/ F: drivers/scsi/osd/
F: include/scsi/osd_* F: include/scsi/osd_*
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
config CXLFLASH config CXLFLASH
tristate "Support for IBM CAPI Flash" tristate "Support for IBM CAPI Flash"
depends on PCI && SCSI && CXL && EEH depends on PCI && SCSI && CXL && EEH
select IRQ_POLL
default m default m
help help
Allows CAPI Accelerated IO to Flash Allows CAPI Accelerated IO to Flash
......
...@@ -407,11 +407,12 @@ static void fc_fcp_can_queue_ramp_up(struct fc_lport *lport) ...@@ -407,11 +407,12 @@ static void fc_fcp_can_queue_ramp_up(struct fc_lport *lport)
* can_queue. Eventually we will hit the point where we run * can_queue. Eventually we will hit the point where we run
* on all reserved structs. * on all reserved structs.
*/ */
static void fc_fcp_can_queue_ramp_down(struct fc_lport *lport) static bool fc_fcp_can_queue_ramp_down(struct fc_lport *lport)
{ {
struct fc_fcp_internal *si = fc_get_scsi_internal(lport); struct fc_fcp_internal *si = fc_get_scsi_internal(lport);
unsigned long flags; unsigned long flags;
int can_queue; int can_queue;
bool changed = false;
spin_lock_irqsave(lport->host->host_lock, flags); spin_lock_irqsave(lport->host->host_lock, flags);
...@@ -427,9 +428,11 @@ static void fc_fcp_can_queue_ramp_down(struct fc_lport *lport) ...@@ -427,9 +428,11 @@ static void fc_fcp_can_queue_ramp_down(struct fc_lport *lport)
if (!can_queue) if (!can_queue)
can_queue = 1; can_queue = 1;
lport->host->can_queue = can_queue; lport->host->can_queue = can_queue;
changed = true;
unlock: unlock:
spin_unlock_irqrestore(lport->host->host_lock, flags); spin_unlock_irqrestore(lport->host->host_lock, flags);
return changed;
} }
/* /*
...@@ -1896,7 +1899,7 @@ int fc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *sc_cmd) ...@@ -1896,7 +1899,7 @@ int fc_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *sc_cmd)
if (!fc_fcp_lport_queue_ready(lport)) { if (!fc_fcp_lport_queue_ready(lport)) {
if (lport->qfull) { if (lport->qfull) {
fc_fcp_can_queue_ramp_down(lport); if (fc_fcp_can_queue_ramp_down(lport))
shost_printk(KERN_ERR, lport->host, shost_printk(KERN_ERR, lport->host,
"libfc: queue full, " "libfc: queue full, "
"reducing can_queue to %d.\n", "reducing can_queue to %d.\n",
......
...@@ -294,6 +294,7 @@ int lpfc_selective_reset(struct lpfc_hba *); ...@@ -294,6 +294,7 @@ int lpfc_selective_reset(struct lpfc_hba *);
void lpfc_reset_barrier(struct lpfc_hba *); void lpfc_reset_barrier(struct lpfc_hba *);
int lpfc_sli_brdready(struct lpfc_hba *, uint32_t); int lpfc_sli_brdready(struct lpfc_hba *, uint32_t);
int lpfc_sli_brdkill(struct lpfc_hba *); int lpfc_sli_brdkill(struct lpfc_hba *);
int lpfc_sli_chipset_init(struct lpfc_hba *phba);
int lpfc_sli_brdreset(struct lpfc_hba *); int lpfc_sli_brdreset(struct lpfc_hba *);
int lpfc_sli_brdrestart(struct lpfc_hba *); int lpfc_sli_brdrestart(struct lpfc_hba *);
int lpfc_sli_hba_setup(struct lpfc_hba *); int lpfc_sli_hba_setup(struct lpfc_hba *);
......
...@@ -630,7 +630,7 @@ lpfc_ns_rsp(struct lpfc_vport *vport, struct lpfc_dmabuf *mp, uint8_t fc4_type, ...@@ -630,7 +630,7 @@ lpfc_ns_rsp(struct lpfc_vport *vport, struct lpfc_dmabuf *mp, uint8_t fc4_type,
NLP_EVT_DEVICE_RECOVERY); NLP_EVT_DEVICE_RECOVERY);
spin_lock_irq(shost->host_lock); spin_lock_irq(shost->host_lock);
ndlp->nlp_flag &= ~NLP_NVMET_RECOV; ndlp->nlp_flag &= ~NLP_NVMET_RECOV;
spin_lock_irq(shost->host_lock); spin_unlock_irq(shost->host_lock);
} }
} }
......
...@@ -3602,6 +3602,13 @@ lpfc_get_wwpn(struct lpfc_hba *phba) ...@@ -3602,6 +3602,13 @@ lpfc_get_wwpn(struct lpfc_hba *phba)
LPFC_MBOXQ_t *mboxq; LPFC_MBOXQ_t *mboxq;
MAILBOX_t *mb; MAILBOX_t *mb;
if (phba->sli_rev < LPFC_SLI_REV4) {
/* Reset the port first */
lpfc_sli_brdrestart(phba);
rc = lpfc_sli_chipset_init(phba);
if (rc)
return (uint64_t)-1;
}
mboxq = (LPFC_MBOXQ_t *) mempool_alloc(phba->mbox_mem_pool, mboxq = (LPFC_MBOXQ_t *) mempool_alloc(phba->mbox_mem_pool,
GFP_KERNEL); GFP_KERNEL);
...@@ -8847,7 +8854,7 @@ lpfc_sli4_queue_unset(struct lpfc_hba *phba) ...@@ -8847,7 +8854,7 @@ lpfc_sli4_queue_unset(struct lpfc_hba *phba)
lpfc_wq_destroy(phba, phba->sli4_hba.nvmels_wq); lpfc_wq_destroy(phba, phba->sli4_hba.nvmels_wq);
/* Unset ELS work queue */ /* Unset ELS work queue */
if (phba->sli4_hba.els_cq) if (phba->sli4_hba.els_wq)
lpfc_wq_destroy(phba, phba->sli4_hba.els_wq); lpfc_wq_destroy(phba, phba->sli4_hba.els_wq);
/* Unset unsolicited receive queue */ /* Unset unsolicited receive queue */
......
...@@ -4204,13 +4204,16 @@ lpfc_sli_brdreset(struct lpfc_hba *phba) ...@@ -4204,13 +4204,16 @@ lpfc_sli_brdreset(struct lpfc_hba *phba)
/* Reset HBA */ /* Reset HBA */
lpfc_printf_log(phba, KERN_INFO, LOG_SLI, lpfc_printf_log(phba, KERN_INFO, LOG_SLI,
"0325 Reset HBA Data: x%x x%x\n", "0325 Reset HBA Data: x%x x%x\n",
phba->pport->port_state, psli->sli_flag); (phba->pport) ? phba->pport->port_state : 0,
psli->sli_flag);
/* perform board reset */ /* perform board reset */
phba->fc_eventTag = 0; phba->fc_eventTag = 0;
phba->link_events = 0; phba->link_events = 0;
if (phba->pport) {
phba->pport->fc_myDID = 0; phba->pport->fc_myDID = 0;
phba->pport->fc_prevDID = 0; phba->pport->fc_prevDID = 0;
}
/* Turn off parity checking and serr during the physical reset */ /* Turn off parity checking and serr during the physical reset */
pci_read_config_word(phba->pcidev, PCI_COMMAND, &cfg_value); pci_read_config_word(phba->pcidev, PCI_COMMAND, &cfg_value);
...@@ -4336,7 +4339,8 @@ lpfc_sli_brdrestart_s3(struct lpfc_hba *phba) ...@@ -4336,7 +4339,8 @@ lpfc_sli_brdrestart_s3(struct lpfc_hba *phba)
/* Restart HBA */ /* Restart HBA */
lpfc_printf_log(phba, KERN_INFO, LOG_SLI, lpfc_printf_log(phba, KERN_INFO, LOG_SLI,
"0337 Restart HBA Data: x%x x%x\n", "0337 Restart HBA Data: x%x x%x\n",
phba->pport->port_state, psli->sli_flag); (phba->pport) ? phba->pport->port_state : 0,
psli->sli_flag);
word0 = 0; word0 = 0;
mb = (MAILBOX_t *) &word0; mb = (MAILBOX_t *) &word0;
...@@ -4350,7 +4354,7 @@ lpfc_sli_brdrestart_s3(struct lpfc_hba *phba) ...@@ -4350,7 +4354,7 @@ lpfc_sli_brdrestart_s3(struct lpfc_hba *phba)
readl(to_slim); /* flush */ readl(to_slim); /* flush */
/* Only skip post after fc_ffinit is completed */ /* Only skip post after fc_ffinit is completed */
if (phba->pport->port_state) if (phba->pport && phba->pport->port_state)
word0 = 1; /* This is really setting up word1 */ word0 = 1; /* This is really setting up word1 */
else else
word0 = 0; /* This is really setting up word1 */ word0 = 0; /* This is really setting up word1 */
...@@ -4359,6 +4363,7 @@ lpfc_sli_brdrestart_s3(struct lpfc_hba *phba) ...@@ -4359,6 +4363,7 @@ lpfc_sli_brdrestart_s3(struct lpfc_hba *phba)
readl(to_slim); /* flush */ readl(to_slim); /* flush */
lpfc_sli_brdreset(phba); lpfc_sli_brdreset(phba);
if (phba->pport)
phba->pport->stopped = 0; phba->pport->stopped = 0;
phba->link_state = LPFC_INIT_START; phba->link_state = LPFC_INIT_START;
phba->hba_flag = 0; phba->hba_flag = 0;
...@@ -4446,7 +4451,7 @@ lpfc_sli_brdrestart(struct lpfc_hba *phba) ...@@ -4446,7 +4451,7 @@ lpfc_sli_brdrestart(struct lpfc_hba *phba)
* iteration, the function will restart the HBA again. The function returns * iteration, the function will restart the HBA again. The function returns
* zero if HBA successfully restarted else returns negative error code. * zero if HBA successfully restarted else returns negative error code.
**/ **/
static int int
lpfc_sli_chipset_init(struct lpfc_hba *phba) lpfc_sli_chipset_init(struct lpfc_hba *phba)
{ {
uint32_t status, i = 0; uint32_t status, i = 0;
......
...@@ -3770,9 +3770,6 @@ static long pmcraid_ioctl_passthrough( ...@@ -3770,9 +3770,6 @@ static long pmcraid_ioctl_passthrough(
pmcraid_err("couldn't build passthrough ioadls\n"); pmcraid_err("couldn't build passthrough ioadls\n");
goto out_free_cmd; goto out_free_cmd;
} }
} else if (request_size < 0) {
rc = -EINVAL;
goto out_free_cmd;
} }
/* If data is being written into the device, copy the data from user /* If data is being written into the device, copy the data from user
......
...@@ -259,7 +259,7 @@ struct qedf_io_log { ...@@ -259,7 +259,7 @@ struct qedf_io_log {
uint16_t task_id; uint16_t task_id;
uint32_t port_id; /* Remote port fabric ID */ uint32_t port_id; /* Remote port fabric ID */
int lun; int lun;
char op; /* SCSI CDB */ unsigned char op; /* SCSI CDB */
uint8_t lba[4]; uint8_t lba[4];
unsigned int bufflen; /* SCSI buffer length */ unsigned int bufflen; /* SCSI buffer length */
unsigned int sg_count; /* Number of SG elements */ unsigned int sg_count; /* Number of SG elements */
......
...@@ -109,7 +109,7 @@ static int qedf_initiate_els(struct qedf_rport *fcport, unsigned int op, ...@@ -109,7 +109,7 @@ static int qedf_initiate_els(struct qedf_rport *fcport, unsigned int op,
did = fcport->rdata->ids.port_id; did = fcport->rdata->ids.port_id;
sid = fcport->sid; sid = fcport->sid;
__fc_fill_fc_hdr(fc_hdr, FC_RCTL_ELS_REQ, sid, did, __fc_fill_fc_hdr(fc_hdr, FC_RCTL_ELS_REQ, did, sid,
FC_TYPE_ELS, FC_FC_FIRST_SEQ | FC_FC_END_SEQ | FC_TYPE_ELS, FC_FC_FIRST_SEQ | FC_FC_END_SEQ |
FC_FC_SEQ_INIT, 0); FC_FC_SEQ_INIT, 0);
......
...@@ -2895,7 +2895,7 @@ static int __qedf_probe(struct pci_dev *pdev, int mode) ...@@ -2895,7 +2895,7 @@ static int __qedf_probe(struct pci_dev *pdev, int mode)
slowpath_params.drv_minor = QEDF_DRIVER_MINOR_VER; slowpath_params.drv_minor = QEDF_DRIVER_MINOR_VER;
slowpath_params.drv_rev = QEDF_DRIVER_REV_VER; slowpath_params.drv_rev = QEDF_DRIVER_REV_VER;
slowpath_params.drv_eng = QEDF_DRIVER_ENG_VER; slowpath_params.drv_eng = QEDF_DRIVER_ENG_VER;
memcpy(slowpath_params.name, "qedf", QED_DRV_VER_STR_SIZE); strncpy(slowpath_params.name, "qedf", QED_DRV_VER_STR_SIZE);
rc = qed_ops->common->slowpath_start(qedf->cdev, &slowpath_params); rc = qed_ops->common->slowpath_start(qedf->cdev, &slowpath_params);
if (rc) { if (rc) {
QEDF_ERR(&(qedf->dbg_ctx), "Cannot start slowpath.\n"); QEDF_ERR(&(qedf->dbg_ctx), "Cannot start slowpath.\n");
......
...@@ -763,6 +763,8 @@ struct scsi_device *__scsi_device_lookup(struct Scsi_Host *shost, ...@@ -763,6 +763,8 @@ struct scsi_device *__scsi_device_lookup(struct Scsi_Host *shost,
struct scsi_device *sdev; struct scsi_device *sdev;
list_for_each_entry(sdev, &shost->__devices, siblings) { list_for_each_entry(sdev, &shost->__devices, siblings) {
if (sdev->sdev_state == SDEV_DEL)
continue;
if (sdev->channel == channel && sdev->id == id && if (sdev->channel == channel && sdev->id == id &&
sdev->lun ==lun) sdev->lun ==lun)
return sdev; return sdev;
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <scsi/scsi_driver.h> #include <scsi/scsi_driver.h>
#include <scsi/scsi_eh.h> #include <scsi/scsi_eh.h>
#include <scsi/scsi_host.h> #include <scsi/scsi_host.h>
#include <scsi/scsi_transport.h> /* __scsi_init_queue() */
#include <scsi/scsi_dh.h> #include <scsi/scsi_dh.h>
#include <trace/events/scsi.h> #include <trace/events/scsi.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment