提交 fd98df2a 编写于 作者: L Luo Jiaxing 提交者: Xie XiuQi

scsi: hisi_sas: correct an error setting of memory allocation size for DQ at Debugfs feature

We allocate memory base on hisi_hba->hw->complete_hdr_size for DQ, but
it was wrong.For the structure, which used to save DQ, is
struct hisi_sas_cmd_hdr, and this size is not saved at
variables: complete_hdr_size.

So we need to correct it.
Signed-off-by: NLuo Jiaxing <luojiaxing@huawei.com>
Signed-off-by: NJohn Garry <john.garry@huawei.com>

Feature or Bugfix:Bugfix
Signed-off-by: Nluojiaxing <luojiaxing@huawei.com>
Reviewed-by: Nchenxiang <chenxiang66@hisilicon.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 ccf99168
......@@ -2641,7 +2641,7 @@ static void hisi_sas_debugfs_snapshot_cq_reg(struct hisi_hba *hisi_hba)
static void hisi_sas_debugfs_snapshot_dq_reg(struct hisi_hba *hisi_hba)
{
int queue_entry_size = hisi_hba->hw->complete_hdr_size;
int queue_entry_size = sizeof(struct hisi_sas_cmd_hdr);
int i;
for (i = 0; i < hisi_hba->queue_count; i++)
......@@ -3104,7 +3104,7 @@ void hisi_sas_debugfs_init(struct hisi_hba *hisi_hba)
}
/* Alloc buffer for dq */
sz = hisi_hba->hw->complete_hdr_size * HISI_SAS_QUEUE_SLOTS;
sz = sizeof(struct hisi_sas_cmd_hdr) * HISI_SAS_QUEUE_SLOTS;
for (d = 0; d < hisi_hba->queue_count; d++) {
hisi_hba->debugfs_cmd_hdr[d] =
devm_kmalloc(dev, sz, GFP_KERNEL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册