Commit 3cd1c5d5 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:
 "Six small fixes, five in drivers and one to correct another minor
  regression from cc97923a ("block: move dma drain handling to
  scsi") where we still need the drain stub to be built in to the kernel
  for the modular libata, non-modular SAS driver case"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
  scsi: mptscsih: Fix read sense data size
  scsi: zfcp: Fix panic on ERP timeout for previously dismissed ERP action
  scsi: lpfc: Avoid another null dereference in lpfc_sli4_hba_unset()
  scsi: libata: Fix the ata_scsi_dma_need_drain stub
  scsi: qla2xxx: Keep initiator ports after RSCN
  scsi: qla2xxx: Set NVMe status code for failed NVMe FCP request
parents c322f539 afe89f11
...@@ -118,8 +118,6 @@ int mptscsih_suspend(struct pci_dev *pdev, pm_message_t state); ...@@ -118,8 +118,6 @@ int mptscsih_suspend(struct pci_dev *pdev, pm_message_t state);
int mptscsih_resume(struct pci_dev *pdev); int mptscsih_resume(struct pci_dev *pdev);
#endif #endif
#define SNS_LEN(scp) SCSI_SENSE_BUFFERSIZE
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
/* /*
...@@ -2422,7 +2420,7 @@ mptscsih_copy_sense_data(struct scsi_cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR ...@@ -2422,7 +2420,7 @@ mptscsih_copy_sense_data(struct scsi_cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR
/* Copy the sense received into the scsi command block. */ /* Copy the sense received into the scsi command block. */
req_index = le16_to_cpu(mf->u.frame.hwhdr.msgctxu.fld.req_idx); req_index = le16_to_cpu(mf->u.frame.hwhdr.msgctxu.fld.req_idx);
sense_data = ((u8 *)ioc->sense_buf_pool + (req_index * MPT_SENSE_BUFFER_ALLOC)); sense_data = ((u8 *)ioc->sense_buf_pool + (req_index * MPT_SENSE_BUFFER_ALLOC));
memcpy(sc->sense_buffer, sense_data, SNS_LEN(sc)); memcpy(sc->sense_buffer, sense_data, MPT_SENSE_BUFFER_ALLOC);
/* Log SMART data (asc = 0x5D, non-IM case only) if required. /* Log SMART data (asc = 0x5D, non-IM case only) if required.
*/ */
......
...@@ -577,7 +577,10 @@ static void zfcp_erp_strategy_check_fsfreq(struct zfcp_erp_action *act) ...@@ -577,7 +577,10 @@ static void zfcp_erp_strategy_check_fsfreq(struct zfcp_erp_action *act)
ZFCP_STATUS_ERP_TIMEDOUT)) { ZFCP_STATUS_ERP_TIMEDOUT)) {
req->status |= ZFCP_STATUS_FSFREQ_DISMISSED; req->status |= ZFCP_STATUS_FSFREQ_DISMISSED;
zfcp_dbf_rec_run("erscf_1", act); zfcp_dbf_rec_run("erscf_1", act);
req->erp_action = NULL; /* lock-free concurrent access with
* zfcp_erp_timeout_handler()
*/
WRITE_ONCE(req->erp_action, NULL);
} }
if (act->status & ZFCP_STATUS_ERP_TIMEDOUT) if (act->status & ZFCP_STATUS_ERP_TIMEDOUT)
zfcp_dbf_rec_run("erscf_2", act); zfcp_dbf_rec_run("erscf_2", act);
...@@ -613,8 +616,14 @@ void zfcp_erp_notify(struct zfcp_erp_action *erp_action, unsigned long set_mask) ...@@ -613,8 +616,14 @@ void zfcp_erp_notify(struct zfcp_erp_action *erp_action, unsigned long set_mask)
void zfcp_erp_timeout_handler(struct timer_list *t) void zfcp_erp_timeout_handler(struct timer_list *t)
{ {
struct zfcp_fsf_req *fsf_req = from_timer(fsf_req, t, timer); struct zfcp_fsf_req *fsf_req = from_timer(fsf_req, t, timer);
struct zfcp_erp_action *act = fsf_req->erp_action; struct zfcp_erp_action *act;
if (fsf_req->status & ZFCP_STATUS_FSFREQ_DISMISSED)
return;
/* lock-free concurrent access with zfcp_erp_strategy_check_fsfreq() */
act = READ_ONCE(fsf_req->erp_action);
if (!act)
return;
zfcp_erp_notify(act, ZFCP_STATUS_ERP_TIMEDOUT); zfcp_erp_notify(act, ZFCP_STATUS_ERP_TIMEDOUT);
} }
......
...@@ -11878,6 +11878,7 @@ lpfc_sli4_hba_unset(struct lpfc_hba *phba) ...@@ -11878,6 +11878,7 @@ lpfc_sli4_hba_unset(struct lpfc_hba *phba)
lpfc_sli4_xri_exchange_busy_wait(phba); lpfc_sli4_xri_exchange_busy_wait(phba);
/* per-phba callback de-registration for hotplug event */ /* per-phba callback de-registration for hotplug event */
if (phba->pport)
lpfc_cpuhp_remove(phba); lpfc_cpuhp_remove(phba);
/* Disable PCI subsystem interrupt */ /* Disable PCI subsystem interrupt */
......
...@@ -3496,7 +3496,9 @@ void qla24xx_async_gnnft_done(scsi_qla_host_t *vha, srb_t *sp) ...@@ -3496,7 +3496,9 @@ void qla24xx_async_gnnft_done(scsi_qla_host_t *vha, srb_t *sp)
qla2x00_clear_loop_id(fcport); qla2x00_clear_loop_id(fcport);
fcport->flags |= FCF_FABRIC_DEVICE; fcport->flags |= FCF_FABRIC_DEVICE;
} else if (fcport->d_id.b24 != rp->id.b24 || } else if (fcport->d_id.b24 != rp->id.b24 ||
fcport->scan_needed) { (fcport->scan_needed &&
fcport->port_type != FCT_INITIATOR &&
fcport->port_type != FCT_NVME_INITIATOR)) {
qlt_schedule_sess_for_deletion(fcport); qlt_schedule_sess_for_deletion(fcport);
} }
fcport->d_id.b24 = rp->id.b24; fcport->d_id.b24 = rp->id.b24;
......
...@@ -139,11 +139,12 @@ static void qla_nvme_release_fcp_cmd_kref(struct kref *kref) ...@@ -139,11 +139,12 @@ static void qla_nvme_release_fcp_cmd_kref(struct kref *kref)
sp->priv = NULL; sp->priv = NULL;
if (priv->comp_status == QLA_SUCCESS) { if (priv->comp_status == QLA_SUCCESS) {
fd->rcv_rsplen = le16_to_cpu(nvme->u.nvme.rsp_pyld_len); fd->rcv_rsplen = le16_to_cpu(nvme->u.nvme.rsp_pyld_len);
fd->status = NVME_SC_SUCCESS;
} else { } else {
fd->rcv_rsplen = 0; fd->rcv_rsplen = 0;
fd->transferred_length = 0; fd->transferred_length = 0;
fd->status = NVME_SC_INTERNAL;
} }
fd->status = 0;
spin_unlock_irqrestore(&priv->cmd_lock, flags); spin_unlock_irqrestore(&priv->cmd_lock, flags);
fd->done(fd); fd->done(fd);
......
...@@ -1095,7 +1095,7 @@ extern int ata_scsi_ioctl(struct scsi_device *dev, unsigned int cmd, ...@@ -1095,7 +1095,7 @@ extern int ata_scsi_ioctl(struct scsi_device *dev, unsigned int cmd,
#define ATA_SCSI_COMPAT_IOCTL /* empty */ #define ATA_SCSI_COMPAT_IOCTL /* empty */
#endif #endif
extern int ata_scsi_queuecmd(struct Scsi_Host *h, struct scsi_cmnd *cmd); extern int ata_scsi_queuecmd(struct Scsi_Host *h, struct scsi_cmnd *cmd);
#if IS_ENABLED(CONFIG_ATA) #if IS_REACHABLE(CONFIG_ATA)
bool ata_scsi_dma_need_drain(struct request *rq); bool ata_scsi_dma_need_drain(struct request *rq);
#else #else
#define ata_scsi_dma_need_drain NULL #define ata_scsi_dma_need_drain NULL
......
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