提交 e3b9140e 编写于 作者: Y Yupeng Zhou 提交者: Xie XiuQi

hisi_sas: Fix the issue of disk in fail when only 1 cpu online.

driver inclusion
category: feature
bugzilla: NA
CVE: NA

This patch fix the issue of disk in fail when only 1 cpu online.
alloc the DQ number according to the interrupt allocated.
Signed-off-by: NYupeng Zhou <zhouyupeng1@huawei.com>
Reviewed-by: NJian Luo <luojian5@huawei.com>
Reviewed-by: NChuan Gao <gaochuan4@huawei.com>
Reviewed-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 c12e11ec
...@@ -2335,7 +2335,6 @@ int hisi_sas_alloc(struct hisi_hba *hisi_hba) ...@@ -2335,7 +2335,6 @@ int hisi_sas_alloc(struct hisi_hba *hisi_hba)
sema_init(&hisi_hba->sem, 1); sema_init(&hisi_hba->sem, 1);
spin_lock_init(&hisi_hba->lock); spin_lock_init(&hisi_hba->lock);
hisi_hba->dq_num_per_node = hisi_hba->queue_count/num_online_nodes();
for (i = 0; i < NR_CPUS; i++) for (i = 0; i < NR_CPUS; i++)
hisi_hba->dq_idx[i] = 0; hisi_hba->dq_idx[i] = 0;
......
...@@ -2586,6 +2586,7 @@ static int interrupt_init_v3_hw(struct hisi_hba *hisi_hba) ...@@ -2586,6 +2586,7 @@ static int interrupt_init_v3_hw(struct hisi_hba *hisi_hba)
int vectors, rc; int vectors, rc;
int i, k; int i, k;
int max_msi = HISI_SAS_MSI_COUNT_V3_HW; int max_msi = HISI_SAS_MSI_COUNT_V3_HW;
int max_dq_num, online_numa_num;
struct irq_affinity desc = { struct irq_affinity desc = {
.pre_vectors = HISI_SAS_CQ_INT_BASE_VECTORS_V3_HW, .pre_vectors = HISI_SAS_CQ_INT_BASE_VECTORS_V3_HW,
}; };
...@@ -2608,6 +2609,15 @@ static int interrupt_init_v3_hw(struct hisi_hba *hisi_hba) ...@@ -2608,6 +2609,15 @@ static int interrupt_init_v3_hw(struct hisi_hba *hisi_hba)
} }
hisi_hba->nvecs = vectors - HISI_SAS_CQ_INT_BASE_VECTORS_V3_HW; hisi_hba->nvecs = vectors - HISI_SAS_CQ_INT_BASE_VECTORS_V3_HW;
max_dq_num = (hisi_hba->nvecs < hisi_hba->queue_count) ?
hisi_hba->nvecs : hisi_hba->queue_count;
online_numa_num = num_online_nodes();
dev_info(dev, "vectors nvecs:%d, online_numa:%d\n",
hisi_hba->nvecs, online_numa_num);
if (max_dq_num > online_numa_num)
hisi_hba->dq_num_per_node = max_dq_num / online_numa_num;
else
hisi_hba->dq_num_per_node = 1;
rc = devm_request_irq(dev, pci_irq_vector(pdev, PCI_IRQ_PHY), rc = devm_request_irq(dev, pci_irq_vector(pdev, PCI_IRQ_PHY),
int_phy_up_down_bcast_v3_hw, 0, int_phy_up_down_bcast_v3_hw, 0,
DRV_NAME " phy", hisi_hba); DRV_NAME " phy", hisi_hba);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册