提交 55acbe63 编写于 作者: L Logan Gunthorpe 提交者: Yang Yingliang

PCI/switchtec: Fix vep_vector_number ioread width

commit 9375646b upstream.

vep_vector_number is actually a 16 bit register which should be read with
ioread16() instead of ioread32().

Fixes: 080b47de ("MicroSemi Switchtec management interface driver")
Link: https://lore.kernel.org/r/20200106190337.2428-3-logang@deltatee.comReported-by: NDoug Meyer <dmeyer@gigaio.com>
Signed-off-by: NLogan Gunthorpe <logang@deltatee.com>
Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 d95fe5d0
...@@ -1186,7 +1186,7 @@ static int switchtec_init_isr(struct switchtec_dev *stdev) ...@@ -1186,7 +1186,7 @@ static int switchtec_init_isr(struct switchtec_dev *stdev)
if (nvecs < 0) if (nvecs < 0)
return nvecs; return nvecs;
event_irq = ioread32(&stdev->mmio_part_cfg->vep_vector_number); event_irq = ioread16(&stdev->mmio_part_cfg->vep_vector_number);
if (event_irq < 0 || event_irq >= nvecs) if (event_irq < 0 || event_irq >= nvecs)
return -EFAULT; return -EFAULT;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册