On 5/27/19 5:02 PM, Ming Lei wrote:
Hisi_sas_v3_hw, hpsa, megaraid and mpt3sas use single blk-mq hw queue
to submit request, meantime apply multiple private reply queues served as
completion queue. The mapping between CPU and reply queue is setup via
pci_alloc_irq_vectors_affinity(PCI_IRQ_AFFINITY) just like the usual
blk-mq queue mapping.

These drivers always use current CPU(raw_smp_processor_id) to figure out
the reply queue. Switch to use request's CPU to get the reply queue,
so we can drain in-flight request via blk-mq's API before the last CPU of
the reply queue becomes offline.

Signed-off-by: Ming Lei <ming....@redhat.com>
---
  drivers/scsi/hisi_sas/hisi_sas_main.c       |  5 +++--
  drivers/scsi/hpsa.c                         |  2 +-
  drivers/scsi/megaraid/megaraid_sas_fusion.c |  4 ++--
  drivers/scsi/mpt3sas/mpt3sas_base.c         | 16 ++++++++--------
  include/scsi/scsi_cmnd.h                    | 11 +++++++++++
  5 files changed, 25 insertions(+), 13 deletions(-)

Reviewed-by: Hannes Reinecke <h...@suse.com>

Cheers,

Hannes


Reply via email to