Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Feng Tang <feng.tang@linux.alibaba.com>
To: Bjorn Helgaas <bhelgaas@google.com>,
	Lukas Wunner <lukas@wunner.de>,
	Sathyanarayanan Kuppuswamy
	<sathyanarayanan.kuppuswamy@linux.intel.com>,
	Liguang Zhang <zhangliguang@linux.alibaba.com>,
	Guanghui Feng <guanghuifeng@linux.alibaba.com>,
	rafael@kernel.org
Cc: Markus Elfring <Markus.Elfring@web.de>,
	lkp@intel.com, Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	ilpo.jarvinen@linux.intel.com, linux-pci@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Feng Tang <feng.tang@linux.alibaba.com>
Subject: [PATCH v3 0/4] PCIe hotplug interrupt related fixes
Date: Mon, 24 Feb 2025 11:44:56 +0800	[thread overview]
Message-ID: <20250224034500.23024-1-feng.tang@linux.alibaba.com> (raw)

Hi all,

This patchset tries to address 2 PCIe hotplug interrupt related problems
we met recently:

1. Firmware developers reported that they received two PCIe hotplug commands
   in very short intervals on an ARM server, which doesn't comply with PCIe
   spec, and broke their state machine and work flow.
2. An irq storm bug found when testing "pci=nomsi" case, and the root
   cause is: 'nomsi' will disable MSI and let devices and root ports use
   legacy INTX interrupt, and likely make several devices/ports share one
   interrupt. In the failure case, BIOS doesn't disable the pcie hotplug
   interrupts, and actually asserts the command-complete interrupt.

More details could be found in commit log of patch 2/4 and 4/4. Basically:
    Patch 0001 moves the PCIe hotplug command waiting funtion from pciehp
               driver to PCIe port driver for code reuse.
    Patch 0002 adds the necessary wait for PCIe hotplug command
    Patch 0003 loose the condition check for interrupt disabling
    Patch 0004 for msi disabled case, disable PCIe hotplug interrupt in
               early boot phase 

Please help to review, thanks!

- Feng

Changelog:

  since v2:
    * Add patch 0001, which move the waiting logic of pcie_poll_cmd from pciehp
      driver to PCIe port driver for code reuse (Bjorn Helgaas)
    * Separate Lucas' suggestion out as patch 0003 (Bjorn and Sathyanarayanan)  
    * Avoid hotplug command waiting for HW without command-complete
      event support (Bjorn Helgaas)
    * Fix spell issue in commit log (Bjorn and Markus)
    * Add cover-letter for whole patchset (Markus Elfring)
    * Handle a set-but-unused build warning (0Day lkp bot)

  since v1:
    * Add the Originally-by for Liguang for patch 0002. The issue was found on
      a 5.10 kernel, then 6.6. I was initially given a 5.10 kernel tar ball
      without git info to debug the issue, and made the patch. Thanks to Guanghui
      who recently pointed me to tree https://gitee.com/anolis/cloud-kernel which
      show the wait logic in 5.10 was originally from Liguang, and never hit
      mainline.
    * Make the irq disabling not dependent on wthether pciehp service driver
      will be loaded (Lukas Wunner) 
    * Use read_poll_timeout() API to simply the waiting logic (Sathyanarayanan
      Kuppuswamy)
    * Fix wrong email address (Markus Elfring)
    * Add logic to skip irq disabling if it is already disabled.


Feng Tang (4):
  PCI: portdrv: pciehp: Move PCIe hotplug command waiting logic to port
    driver
  PCI/portdrv: Add necessary wait for disabling hotplug events
  PCI/portdrv: Loose the condition check for disabling hotplug
    interrupts
  PCI: Disable PCIe hotplug interrupts early when msi is disabled

 drivers/pci/hotplug/pciehp_hpc.c | 38 ++++++------------------
 drivers/pci/pci.h                |  7 +++++
 drivers/pci/pcie/portdrv.c       | 50 ++++++++++++++++++++++++++++----
 drivers/pci/probe.c              |  9 ++++++
 4 files changed, 70 insertions(+), 34 deletions(-)

-- 
2.43.5


             reply	other threads:[~2025-02-24  3:45 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-24  3:44 Feng Tang [this message]
2025-02-24  3:44 ` [PATCH v3 1/4] PCI: portdrv: pciehp: Move PCIe hotplug command waiting logic to port driver Feng Tang
2025-02-24 15:06   ` Ilpo Järvinen
2025-02-25  8:18     ` Feng Tang
2025-02-24  3:44 ` [PATCH v3 2/4] PCI/portdrv: Add necessary wait for disabling hotplug events Feng Tang
2025-02-24  9:42   ` Markus Elfring
2025-02-24 15:00   ` Ilpo Järvinen
2025-02-25  5:51     ` Feng Tang
2025-02-24 18:12   ` Lukas Wunner
2025-02-25  3:06     ` Feng Tang
2025-02-25  4:01       ` Lukas Wunner
2025-02-25  4:42         ` Feng Tang
2025-02-28  6:29           ` Feng Tang
2025-02-28  7:14             ` Lukas Wunner
2025-02-28  9:33               ` Feng Tang
2025-02-28 10:01                 ` Feng Tang
2025-02-24  3:44 ` [PATCH v3 3/4] PCI/portdrv: Loose the condition check for disabling hotplug interrupts Feng Tang
2025-02-24  9:47   ` Markus Elfring
2025-02-25  4:09   ` Lukas Wunner
2025-02-26  2:54     ` Feng Tang
2025-02-24  3:45 ` [PATCH v3 4/4] PCI: Disable PCIe hotplug interrupts early when msi is disabled Feng Tang

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=20250224034500.23024-1-feng.tang@linux.alibaba.com \
    --to=feng.tang@linux.alibaba.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=Markus.Elfring@web.de \
    --cc=bhelgaas@google.com \
    --cc=guanghuifeng@linux.alibaba.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=lukas@wunner.de \
    --cc=rafael@kernel.org \
    --cc=sathyanarayanan.kuppuswamy@linux.intel.com \
    --cc=zhangliguang@linux.alibaba.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