• Luo Jiaxing's avatar
    scsi: hisi_sas: Use hisi_hba->cq_nvecs for calling calling synchronize_irq() · 7f054da7
    Luo Jiaxing authored
    A call trace is observed when running function level reset with online CPUs
    less than 16 and MSI auto-affinity enabled.
    
    [16538.348038] Call trace:
    [16538.348422]  pci_irq_vector+0x98/0xc0
    [16538.348947]  disable_host_v3_hw+0x8c/0x288 [hisi_sas_v3_hw]
    [16538.349706]  hisi_sas_reset_prepare_v3_hw+0x60/0x88 [hisi_sas_v3_hw]
    [16538.350631]  pci_dev_save_and_disable+0x38/0x68
    [16538.351290]  pci_reset_function+0x44/0x88
    [16538.351846]  reset_store+0x6c/0xb8
    [16538.352429]  dev_attr_store+0x44/0x60
    [16538.353035]  sysfs_kf_write+0x58/0x80
    [16538.353558]  kernfs_fop_write+0x140/0x230
    [16538.354175]  __vfs_write+0x48/0x80
    [16538.354675]  vfs_write+0xb8/0x1d8
    [16538.355145]  ksys_write+0x74/0xf8
    [16538.355615]  __arm64_sys_write+0x24/0x30
    [16538.356240]  el0_svc_common.constprop.4+0x80/0x1f0
    [16538.356905]  do_el0_svc+0x2c/0x38
    [16538.357408]  el0_svc+0x14/0x40
    [16538.357848]  el0_sync_handler+0xbc/0x2ec
    [16538.358388]  el0_sync+0x140/0x180
    
    The reason is that if we use pci_alloc_irq_vectors_affinity() to allocate
    IRQs, the number of CQ IRQs can only be less than or equal to the number of
    online CPUs, but we use hisi_hba->queue_count (always 16) to iterate during
    interrupt_disable_v3_hw().
    
    Use hisi_hba->cq_nvecs to replace hisi_hba->queue_count to avoid
    synchronize IRQ on a CPU which does not exist.
    
    Link: https://lore.kernel.org/r/1601649038-25534-2-git-send-email-john.garry@huawei.comSigned-off-by: default avatarLuo Jiaxing <luojiaxing@huawei.com>
    Signed-off-by: default avatarJohn Garry <john.garry@huawei.com>
    Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
    7f054da7
hisi_sas_v3_hw.c 103 KB