From: Bjorn Helgaas <helgaas@kernel.org>
To: Dongdong Liu <liudongdong3@huawei.com>
Cc: keith.busch@intel.com, linux-pci@vger.kernel.org, linuxarm@huawei.com
Subject: Re: [PATCH] PCI/AER: Fix the uninitialized aer_fifo
Date: Thu, 23 Jan 2020 16:25:55 -0600 [thread overview]
Message-ID: <20200123222555.GA151102@google.com> (raw)
In-Reply-To: <1579767991-103898-1-git-send-email-liudongdong3@huawei.com>
On Thu, Jan 23, 2020 at 04:26:31PM +0800, Dongdong Liu wrote:
> Current code do not call INIT_KFIFO() to init aer_fifo. This will lead to
> kfifo_put() sometimes return 0. This means the fifo was full. In fact, it
> is not.
It's definitely a problem that we don't call INIT_KFIFO(). But I'm
curious about why this would only be a problem "sometimes". The kfifo
is allocated with devm_kzalloc(), so it should be zero-filled and I
would think it would fail consistently, every time. But I guess not?
> It is easy to reproduce the problem by using aer_inject.
I assume maybe you mean "aer-inject" (not "aer_inject"), from
https://git.kernel.org/pub/scm/linux/kernel/git/gong.chen/aer-inject.git/ ?
At least, that's what's mentioned in Documentation/PCI/pcieaer-howto.rst.
> aer_inject -s :82:00.0 multiple-corr-nonfatal
> The content of multiple-corr-nonfatal file is as below.
> AER
> COR RCVR
> HL 0 1 2 3
> AER
> UNCOR POISON_TLP
> HL 4 5 6 7
>
> Fixes: 27c1ce8bbed7 ("PCI/AER: Use kfifo for tracking events instead of reimplementing it")
> Signed-off-by: Dongdong Liu <liudongdong3@huawei.com>
> ---
> drivers/pci/pcie/aer.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/pci/pcie/aer.c b/drivers/pci/pcie/aer.c
> index 1ca86f2..4a818b0 100644
> --- a/drivers/pci/pcie/aer.c
> +++ b/drivers/pci/pcie/aer.c
> @@ -1445,6 +1445,7 @@ static int aer_probe(struct pcie_device *dev)
> return -ENOMEM;
>
> rpc->rpd = port;
> + INIT_KFIFO(rpc->aer_fifo);
> set_service_data(dev, rpc);
>
> status = devm_request_threaded_irq(device, dev->irq, aer_irq, aer_isr,
> --
> 1.9.1
>
next prev parent reply other threads:[~2020-01-23 22:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-23 8:26 [PATCH] PCI/AER: Fix the uninitialized aer_fifo Dongdong Liu
2020-01-23 22:25 ` Bjorn Helgaas [this message]
2020-01-29 8:16 ` Dongdong Liu
2020-01-29 14:29 ` Bjorn Helgaas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200123222555.GA151102@google.com \
--to=helgaas@kernel.org \
--cc=keith.busch@intel.com \
--cc=linux-pci@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=liudongdong3@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.