提交 554ea036 编写于 作者: Y Yanjiang Jin 提交者: Caspar Zhang

PCI/AER: Queue one GHES event, not several uninitialized ones

task #29600094

commit 1063a5148ac9d1606e80886fa53ee57d45fb4589 upstream.
Backport summary: for 4.19 kernel ICX PCIe Gen4 support.

ecae65e133f2 ("PCI/AER: Use kfifo_in_spinlocked() to insert locked
elements") replaced kfifo_put() with kfifo_in_spinlocked(), but passed the
*size* of the queue entry, where kfifo_in_spinlocked() expects the *number*
of entries to be copied.

We want to insert only one element into kfifo, not "sizeof(entry) = 16".
Without this patch, we would get 15 uninitialized elements.

Fixes: ecae65e133f2 ("PCI/AER: Use kfifo_in_spinlocked() to insert locked elements")
Signed-off-by: NYanjiang Jin <yanjiang.jin@hxt-semitech.com>
[bhelgaas: changelog]
Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
Reviewed-by: NKeith Busch <keith.busch@intel.com>
(cherry picked from commit 1063a5148ac9d1606e80886fa53ee57d45fb4589)
Signed-off-by: NEthan Zhao <haifeng.zhao@intel.com>
Signed-off-by: NArtie Ding <artie.ding@linux.alibaba.com>
Acked-by: NCaspar Zhang <caspar@linux.alibaba.com>
上级 860bafce
...@@ -1064,7 +1064,7 @@ void aer_recover_queue(int domain, unsigned int bus, unsigned int devfn, ...@@ -1064,7 +1064,7 @@ void aer_recover_queue(int domain, unsigned int bus, unsigned int devfn,
.regs = aer_regs, .regs = aer_regs,
}; };
if (kfifo_in_spinlocked(&aer_recover_ring, &entry, sizeof(entry), if (kfifo_in_spinlocked(&aer_recover_ring, &entry, 1,
&aer_recover_ring_lock)) &aer_recover_ring_lock))
schedule_work(&aer_recover_work); schedule_work(&aer_recover_work);
else else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册