public inbox for linux-pci@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jonathan.cameron@huawei.com>
To: Sizhe Liu <liusizhe5@huawei.com>
Cc: <bhelgaas@google.com>, <shiju.jose@huawei.com>,
	<pandoh@google.com>, <linux-pci@vger.kernel.org>,
	<linuxarm@huawei.com>, <prime.zeng@hisilicon.com>,
	<fanghao11@huawei.com>, <shenyang39@huawei.com>
Subject: Re: [PATCH] PCI/AER: Fix AER log missing in DPC case
Date: Tue, 27 Jan 2026 15:56:52 +0000	[thread overview]
Message-ID: <20260127155652.00006bc1@huawei.com> (raw)
In-Reply-To: <20260127035405.712271-1-liusizhe5@huawei.com>

On Tue, 27 Jan 2026 11:54:05 +0800
Sizhe Liu <liusizhe5@huawei.com> wrote:

> In the current DPC error reporting case, some AER log information
> is missing.

Wrap commit messages up to 75 chars, this is about 65.
Only do that for stuff where the formatting isn't fixed for other
reasons, such as the log below.

> 
> -- Error log abnormal (line breaks adjusted)
> [  976.604003] pcieport 0000:20:00.0: DPC: containment event, status:
> 0x1f11: unmasked uncorrectable error detected
> (------ AER error log supposed to be printed here, but missing ------)
> [  976.604030] nvme nvme0: frozen state error detected, reset controller
> [  977.812932] {4}[Hardware Error]: Hardware error from APEI
> Generic Hardware Error Source: 0
> 
This, but do remove timestamps as those don't matter to anyone.
Not wrapping helps if anyone is searching for this later.

Abnormal error log

  pcieport 0000:20:00.0: DPC: containment event, status: 0x1f11: unmasked uncorrectable error detected
(------ AER error log supposed to be printed here, but missing ------)
  nvme nvme0: frozen state error detected, reset controller
{4}[Hardware Error]: Hardware error from APEI Generic Hardware Error Source: 0


> Cause:
> In aer_print_error(), PCIe AER errors is reported, and is rate-limited
> by info->ratelimit_print[i]. There are two entry points for
> aer_print_error().
> 
> 1) Native AER
> aer_isr_one_error_type() -> aer_process_err_devices() ->
> aer_print_error()
> 2) DPC
> dpc_process_error() -> aer_print_error()
> 
> The value of info->ratelimit_print[i] is initialized correctly in
> the native AER case:

> aer_isr_one_error_type() -> find_source_device() ->
> find_device_iter() -> add_error_device()
> 
> In the DPC case, info->ratelimit_print[i] is not initialized and
> alloc by 0 , so in aer_print_error(), it will directly return at line
> if (!info->ratelimit_print[i])
> This will result in lossing the AER log messages in the DPC case.

losing

> 
> Solution:
> 1. Move the initialization of info->ratelimit_print[i] to
> aer_ratelimit_print_init().
> 2. Add aer_ratelimit_print_init() in dpc_process_error().
> 3. Replace the initialization by aer_ratelimit_print_init()in
> Native AER case.
> 
> Test with AER inject:
> Set the DPC reporting priority in the BIOS and send
> MalfTLP(AER FATAL ERROR) to device.
> 
> -- Error log normal (line breaks adjusted)
> [ 5366.943807] pcieport 0000:20:00.0: DPC: containment event,
> status:0x1f11: unmasked uncorrectable error detected
> [ 5366.943826] pcieport 0000:20:00.0: PCIe Bus Error:
> severity=Uncorrectable (Fatal), type=Transaction Layer, (Receiver ID)
> [root@localhost ~]# [ 5366.943830] pcieport 0000:20:00.0:
> device [19e5:a120] error status/mask=00040000/04580000
> [ 5366.943833] pcieport 0000:20:00.0:    [18] MalfTLP   (First)
> [ 5366.943836] pcieport 0000:20:00.0: AER:   TLP Header:
> 0x00000000 0x00000000 0x00000000 0x00000000
> [ 5366.943843] nvme nvme0: frozen state error detected, reset controller
> [ 5368.156778] {2}[Hardware Error]: Hardware error from APEI Generic
> Hardware Error Source: 0
Reformat this and drop timestamps as well:

Normal error log

  pcieport 0000:20:00.0: DPC: containment event, status:0x1f11: unmasked uncorrectable error detected
  pcieport 0000:20:00.0: PCIe Bus Error: severity=Uncorrectable (Fatal), type=Transaction Layer, (Receiver ID)
  pcieport 0000:20:00.0: device [19e5:a120] error status/mask=00040000/04580000
  pcieport 0000:20:00.0:    [18] MalfTLP   (First)
  pcieport 0000:20:00.0: AER:   TLP Header: 0x00000000 0x00000000 0x00000000 0x00000000
  nvme nvme0: frozen state error detected, reset controller
  {2}[Hardware Error]: Hardware error from APEI Generic Hardware Error Source: 0

> 
> Fixes: a57f2bfb4a58 ("PCI/AER: Ratelimit correctable and non-fatal error logging")
> Signed-off-by: Sizhe Liu <liusizhe5@huawei.com>

Otherwise looks good to me.

Thanks,

Jonathan



  reply	other threads:[~2026-01-27 15:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-27  3:54 [PATCH] PCI/AER: Fix AER log missing in DPC case Sizhe Liu
2026-01-27 15:56 ` Jonathan Cameron [this message]
2026-01-29 13:22   ` Sizhe LIU

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=20260127155652.00006bc1@huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=bhelgaas@google.com \
    --cc=fanghao11@huawei.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=liusizhe5@huawei.com \
    --cc=pandoh@google.com \
    --cc=prime.zeng@hisilicon.com \
    --cc=shenyang39@huawei.com \
    --cc=shiju.jose@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox