From: kernel test robot <lkp@intel.com>
To: hangej <hangej@amazon.com>, bhelgaas@google.com
Cc: oe-kbuild-all@lists.linux.dev, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org, dwmw2@infradead.org,
kexec@lists.infradead.org, hangej@amazon.com
Subject: Re: [PATCH] pci_crash: capture PCI config space at panic time
Date: Thu, 14 May 2026 05:30:09 +0800 [thread overview]
Message-ID: <202605140501.1tSG7lxR-lkp@intel.com> (raw)
In-Reply-To: <20260512162402.1929687-1-hangej@amazon.com>
Hi hangej,
kernel test robot noticed the following build errors:
[auto build test ERROR on pci/next]
[also build test ERROR on pci/for-linus linus/master v7.1-rc3 next-20260508]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/hangej/pci_crash-capture-PCI-config-space-at-panic-time/20260514-000653
base: https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git next
patch link: https://lore.kernel.org/r/20260512162402.1929687-1-hangej%40amazon.com
patch subject: [PATCH] pci_crash: capture PCI config space at panic time
config: i386-randconfig-r071-20260514 (https://download.01.org/0day-ci/archive/20260514/202605140501.1tSG7lxR-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
smatch: v0.5.0-9185-gbcc58b9c
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260514/202605140501.1tSG7lxR-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202605140501.1tSG7lxR-lkp@intel.com/
All errors (new ones prefixed by >>):
kernel/pci_crash.c: In function 'pci_crash_save':
>> kernel/pci_crash.c:661:53: error: 'struct pci_dev' has no member named 'aer_cap'; did you mean 'acs_cap'?
661 | if (!pdev || !pdev->aer_cap)
| ^~~~~~~
| acs_cap
kernel/pci_crash.c:666:68: error: 'struct pci_dev' has no member named 'aer_cap'; did you mean 'acs_cap'?
666 | pdev->aer_cap + PCI_ERR_ROOT_STATUS,
| ^~~~~~~
| acs_cap
vim +661 kernel/pci_crash.c
599
600 /**
601 * pci_crash_save() - Capture PCI config space at crash time
602 *
603 * Called from crash_save_vmcoreinfo() inside __crash_kexec(), which
604 * runs before machine_kexec() boots the crash kernel. This is the
605 * only reliable capture point -- panic notifiers run AFTER kexec by
606 * default (crash_kexec_post_notifiers=0).
607 *
608 * Capture check (capture param):
609 * always -- capture unconditionally
610 * aer -- quick-scan root port AER ROOT_STATUS for uncorrectable
611 * errors; skip if none found
612 *
613 * When capture=always, captures on every panic.
614 * This is useful for cascading failures: a PCI link-down can cause
615 * an MCE or NMI watchdog timeout before DPC/AER fires, so the crash
616 * reason is UNKNOWN but AER registers may still hold error state.
617 *
618 * Reads config space fresh -- successful reads get current register
619 * state, failed reads (offline devices) write 0xFFFFFFFF.
620 *
621 * Flushes both buffer and pagemap from CPU cache to RAM so data
622 * survives kexec into crash kernel.
623 */
624 void pci_crash_save(void)
625 {
626 struct pci_crash_pagemap *pm;
627 unsigned long cflags;
628 unsigned int num_devs;
629 size_t pm_size;
630 size_t buf_size;
631 void *buffer;
632
633 num_devs = READ_ONCE(pci_crash_num_devs);
634 if (num_devs == 0)
635 return;
636
637 /* Pairs with smp_wmb() in rebuild -- ensures buffer/pagemap visible */
638 smp_rmb();
639
640 buffer = READ_ONCE(pci_crash_buffer);
641 buf_size = READ_ONCE(pci_crash_buffer_size);
642 pm = READ_ONCE(pci_crash_pagemap);
643 pm_size = READ_ONCE(pci_crash_pagemap_size);
644 if (!buffer || buf_size == 0)
645 return;
646
647 cflags = READ_ONCE(capture_flags);
648 if (!(cflags & PCI_CRASH_CAPTURE_ALWAYS)) {
649 if (cflags & PCI_CRASH_CAPTURE_AER) {
650 struct pci_dev **devs = READ_ONCE(pci_crash_devs);
651 unsigned int i;
652 bool pci_error_found = false;
653
654 if (!devs)
655 return;
656
657 for (i = 0; i < num_devs; i++) {
658 struct pci_dev *pdev = devs[i];
659 u32 status;
660
> 661 if (!pdev || !pdev->aer_cap)
662 continue;
663
664 if (pci_pcie_type(pdev) == PCI_EXP_TYPE_ROOT_PORT) {
665 pci_read_config_dword(pdev,
666 pdev->aer_cap + PCI_ERR_ROOT_STATUS,
667 &status);
668 if (status & PCI_ERR_ROOT_UNCOR_RCV) {
669 pci_error_found = true;
670 break;
671 }
672 }
673 }
674
675 if (!pci_error_found) {
676 pr_emerg("no PCI errors detected, skipping capture\n");
677 return;
678 }
679 } else {
680 return;
681 }
682 }
683
684 pci_crash_fill_buffer(buffer, num_devs);
685
686 /*
687 * Flush buffer and pagemap from CPU cache to RAM so the
688 * crash kernel sees our writes after kexec.
689 */
690 pci_crash_flush_dcache(buffer, buf_size);
691
692 if (pm && pm_size > 0)
693 pci_crash_flush_dcache(pm, pm_size);
694
695 pr_emerg("CAPTURE: %u devices, %zu bytes\n",
696 num_devs, buf_size);
697 }
698 EXPORT_SYMBOL_GPL(pci_crash_save);
699
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2026-05-13 21:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-12 16:24 [PATCH] pci_crash: capture PCI config space at panic time hangej
2026-05-13 21:30 ` kernel test robot [this message]
2026-05-13 22:23 ` kernel test robot
2026-05-13 23:07 ` kernel test robot
2026-05-13 23:39 ` sashiko-bot
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=202605140501.1tSG7lxR-lkp@intel.com \
--to=lkp@intel.com \
--cc=bhelgaas@google.com \
--cc=dwmw2@infradead.org \
--cc=hangej@amazon.com \
--cc=kexec@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
/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