Commit 8c1f0c38 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:
 "Four fixes, all in drivers: three fairly obvious small ones and a
  large one in aacraid to add block queue completion mapping and fix a
  CPU offline hang"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
  scsi: lpfc: Fix incorrect big endian type assignment in bsg loopback path
  scsi: target: core: Fix error path in target_setup_session()
  scsi: storvsc: Always set no_report_opcodes
  scsi: aacraid: Reply queue mapping to CPUs based on IRQ affinity
parents ecbcffe3 9cefd6e7
...@@ -1678,6 +1678,7 @@ struct aac_dev ...@@ -1678,6 +1678,7 @@ struct aac_dev
u32 handle_pci_error; u32 handle_pci_error;
bool init_reset; bool init_reset;
u8 soft_reset_support; u8 soft_reset_support;
u8 use_map_queue;
}; };
#define aac_adapter_interrupt(dev) \ #define aac_adapter_interrupt(dev) \
......
...@@ -223,8 +223,12 @@ int aac_fib_setup(struct aac_dev * dev) ...@@ -223,8 +223,12 @@ int aac_fib_setup(struct aac_dev * dev)
struct fib *aac_fib_alloc_tag(struct aac_dev *dev, struct scsi_cmnd *scmd) struct fib *aac_fib_alloc_tag(struct aac_dev *dev, struct scsi_cmnd *scmd)
{ {
struct fib *fibptr; struct fib *fibptr;
u32 blk_tag;
int i;
fibptr = &dev->fibs[scsi_cmd_to_rq(scmd)->tag]; blk_tag = blk_mq_unique_tag(scsi_cmd_to_rq(scmd));
i = blk_mq_unique_tag_to_tag(blk_tag);
fibptr = &dev->fibs[i];
/* /*
* Null out fields that depend on being zero at the start of * Null out fields that depend on being zero at the start of
* each I/O * each I/O
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include <linux/compat.h> #include <linux/compat.h>
#include <linux/blkdev.h> #include <linux/blkdev.h>
#include <linux/blk-mq-pci.h>
#include <linux/completion.h> #include <linux/completion.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
...@@ -504,6 +505,15 @@ static int aac_slave_configure(struct scsi_device *sdev) ...@@ -504,6 +505,15 @@ static int aac_slave_configure(struct scsi_device *sdev)
return 0; return 0;
} }
static void aac_map_queues(struct Scsi_Host *shost)
{
struct aac_dev *aac = (struct aac_dev *)shost->hostdata;
blk_mq_pci_map_queues(&shost->tag_set.map[HCTX_TYPE_DEFAULT],
aac->pdev, 0);
aac->use_map_queue = true;
}
/** /**
* aac_change_queue_depth - alter queue depths * aac_change_queue_depth - alter queue depths
* @sdev: SCSI device we are considering * @sdev: SCSI device we are considering
...@@ -1488,6 +1498,7 @@ static const struct scsi_host_template aac_driver_template = { ...@@ -1488,6 +1498,7 @@ static const struct scsi_host_template aac_driver_template = {
.bios_param = aac_biosparm, .bios_param = aac_biosparm,
.shost_groups = aac_host_groups, .shost_groups = aac_host_groups,
.slave_configure = aac_slave_configure, .slave_configure = aac_slave_configure,
.map_queues = aac_map_queues,
.change_queue_depth = aac_change_queue_depth, .change_queue_depth = aac_change_queue_depth,
.sdev_groups = aac_dev_groups, .sdev_groups = aac_dev_groups,
.eh_abort_handler = aac_eh_abort, .eh_abort_handler = aac_eh_abort,
...@@ -1775,6 +1786,8 @@ static int aac_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) ...@@ -1775,6 +1786,8 @@ static int aac_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
shost->max_lun = AAC_MAX_LUN; shost->max_lun = AAC_MAX_LUN;
pci_set_drvdata(pdev, shost); pci_set_drvdata(pdev, shost);
shost->nr_hw_queues = aac->max_msix;
shost->host_tagset = 1;
error = scsi_add_host(shost, &pdev->dev); error = scsi_add_host(shost, &pdev->dev);
if (error) if (error)
...@@ -1906,6 +1919,7 @@ static void aac_remove_one(struct pci_dev *pdev) ...@@ -1906,6 +1919,7 @@ static void aac_remove_one(struct pci_dev *pdev)
struct aac_dev *aac = (struct aac_dev *)shost->hostdata; struct aac_dev *aac = (struct aac_dev *)shost->hostdata;
aac_cancel_rescan_worker(aac); aac_cancel_rescan_worker(aac);
aac->use_map_queue = false;
scsi_remove_host(shost); scsi_remove_host(shost);
__aac_shutdown(aac); __aac_shutdown(aac);
......
...@@ -493,6 +493,10 @@ static int aac_src_deliver_message(struct fib *fib) ...@@ -493,6 +493,10 @@ static int aac_src_deliver_message(struct fib *fib)
#endif #endif
u16 vector_no; u16 vector_no;
struct scsi_cmnd *scmd;
u32 blk_tag;
struct Scsi_Host *shost = dev->scsi_host_ptr;
struct blk_mq_queue_map *qmap;
atomic_inc(&q->numpending); atomic_inc(&q->numpending);
...@@ -505,8 +509,25 @@ static int aac_src_deliver_message(struct fib *fib) ...@@ -505,8 +509,25 @@ static int aac_src_deliver_message(struct fib *fib)
if ((dev->comm_interface == AAC_COMM_MESSAGE_TYPE3) if ((dev->comm_interface == AAC_COMM_MESSAGE_TYPE3)
&& dev->sa_firmware) && dev->sa_firmware)
vector_no = aac_get_vector(dev); vector_no = aac_get_vector(dev);
else else {
vector_no = fib->vector_no; if (!fib->vector_no || !fib->callback_data) {
if (shost && dev->use_map_queue) {
qmap = &shost->tag_set.map[HCTX_TYPE_DEFAULT];
vector_no = qmap->mq_map[raw_smp_processor_id()];
}
/*
* We hardcode the vector_no for
* reserved commands as a valid shost is
* absent during the init
*/
else
vector_no = 0;
} else {
scmd = (struct scsi_cmnd *)fib->callback_data;
blk_tag = blk_mq_unique_tag(scsi_cmd_to_rq(scmd));
vector_no = blk_mq_unique_tag_to_hwq(blk_tag);
}
}
if (native_hba) { if (native_hba) {
if (fib->flags & FIB_CONTEXT_FLAG_NATIVE_HBA_TMF) { if (fib->flags & FIB_CONTEXT_FLAG_NATIVE_HBA_TMF) {
......
...@@ -889,7 +889,7 @@ lpfc_bsg_ct_unsol_event(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, ...@@ -889,7 +889,7 @@ lpfc_bsg_ct_unsol_event(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
struct lpfc_iocbq *piocbq) struct lpfc_iocbq *piocbq)
{ {
uint32_t evt_req_id = 0; uint32_t evt_req_id = 0;
uint32_t cmd; u16 cmd;
struct lpfc_dmabuf *dmabuf = NULL; struct lpfc_dmabuf *dmabuf = NULL;
struct lpfc_bsg_event *evt; struct lpfc_bsg_event *evt;
struct event_data *evt_dat = NULL; struct event_data *evt_dat = NULL;
...@@ -915,7 +915,7 @@ lpfc_bsg_ct_unsol_event(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, ...@@ -915,7 +915,7 @@ lpfc_bsg_ct_unsol_event(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
ct_req = (struct lpfc_sli_ct_request *)bdeBuf1->virt; ct_req = (struct lpfc_sli_ct_request *)bdeBuf1->virt;
evt_req_id = ct_req->FsType; evt_req_id = ct_req->FsType;
cmd = ct_req->CommandResponse.bits.CmdRsp; cmd = be16_to_cpu(ct_req->CommandResponse.bits.CmdRsp);
spin_lock_irqsave(&phba->ct_ev_lock, flags); spin_lock_irqsave(&phba->ct_ev_lock, flags);
list_for_each_entry(evt, &phba->ct_ev_waiters, node) { list_for_each_entry(evt, &phba->ct_ev_waiters, node) {
...@@ -3186,8 +3186,8 @@ lpfc_bsg_diag_loopback_run(struct bsg_job *job) ...@@ -3186,8 +3186,8 @@ lpfc_bsg_diag_loopback_run(struct bsg_job *job)
ctreq->RevisionId.bits.InId = 0; ctreq->RevisionId.bits.InId = 0;
ctreq->FsType = SLI_CT_ELX_LOOPBACK; ctreq->FsType = SLI_CT_ELX_LOOPBACK;
ctreq->FsSubType = 0; ctreq->FsSubType = 0;
ctreq->CommandResponse.bits.CmdRsp = ELX_LOOPBACK_DATA; ctreq->CommandResponse.bits.CmdRsp = cpu_to_be16(ELX_LOOPBACK_DATA);
ctreq->CommandResponse.bits.Size = size; ctreq->CommandResponse.bits.Size = cpu_to_be16(size);
segment_offset = ELX_LOOPBACK_HEADER_SZ; segment_offset = ELX_LOOPBACK_HEADER_SZ;
} else } else
segment_offset = 0; segment_offset = 0;
......
...@@ -1567,6 +1567,8 @@ static int storvsc_device_configure(struct scsi_device *sdevice) ...@@ -1567,6 +1567,8 @@ static int storvsc_device_configure(struct scsi_device *sdevice)
{ {
blk_queue_rq_timeout(sdevice->request_queue, (storvsc_timeout * HZ)); blk_queue_rq_timeout(sdevice->request_queue, (storvsc_timeout * HZ));
/* storvsc devices don't support MAINTENANCE_IN SCSI cmd */
sdevice->no_report_opcodes = 1;
sdevice->no_write_same = 1; sdevice->no_write_same = 1;
/* /*
......
...@@ -504,6 +504,8 @@ target_setup_session(struct se_portal_group *tpg, ...@@ -504,6 +504,8 @@ target_setup_session(struct se_portal_group *tpg,
free_sess: free_sess:
transport_free_session(sess); transport_free_session(sess);
return ERR_PTR(rc);
free_cnt: free_cnt:
target_free_cmd_counter(cmd_cnt); target_free_cmd_counter(cmd_cnt);
return ERR_PTR(rc); return ERR_PTR(rc);
......
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