linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Jiwei Sun <sjiwei@163.com>
Cc: nirmal.patel@linux.intel.com, jonathan.derrick@linux.dev,
	paul.m.stillwell.jr@intel.com, lpieralisi@kernel.org,
	kw@linux.com, robh@kernel.org, bhelgaas@google.com,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
	sunjw10@lenovo.com, ahuang12@lenovo.com
Subject: Re: [PATCH v3] PCI: vmd: Create domain symlink before pci_bus_add_devices()
Date: Wed, 10 Jul 2024 17:16:59 -0500	[thread overview]
Message-ID: <20240710221659.GA262309@bhelgaas> (raw)
In-Reply-To: <b5d99ec8-9e4d-494a-bf62-02b992a042e8@163.com>

[-cc Pawel, Alexey, Tomasz, which all bounced]

On Wed, Jul 10, 2024 at 09:29:25PM +0800, Jiwei Sun wrote:
> On 7/10/24 04:59, Bjorn Helgaas wrote:
> > [+cc Pawel, Alexey, Tomasz for mdadm history]
> > On Wed, Jun 05, 2024 at 08:48:44PM +0800, Jiwei Sun wrote:
> >> From: Jiwei Sun <sunjw10@lenovo.com>
> >>
> >> During booting into the kernel, the following error message appears:
> >>
> >>   (udev-worker)[2149]: nvme1n1: '/sbin/mdadm -I /dev/nvme1n1'(err) 'mdadm: Unable to get real path for '/sys/bus/pci/drivers/vmd/0000:c7:00.5/domain/device''
> >>   (udev-worker)[2149]: nvme1n1: '/sbin/mdadm -I /dev/nvme1n1'(err) 'mdadm: /dev/nvme1n1 is not attached to Intel(R) RAID controller.'
> >>   (udev-worker)[2149]: nvme1n1: '/sbin/mdadm -I /dev/nvme1n1'(err) 'mdadm: No OROM/EFI properties for /dev/nvme1n1'
> >>   (udev-worker)[2149]: nvme1n1: '/sbin/mdadm -I /dev/nvme1n1'(err) 'mdadm: no RAID superblock on /dev/nvme1n1.'
> >>   (udev-worker)[2149]: nvme1n1: Process '/sbin/mdadm -I /dev/nvme1n1' failed with exit code 1.
> >>
> >> This symptom prevents the OS from booting successfully.
> > 
> > I guess the root filesystem must be on a RAID device, and it's the
> > failure to assemble that RAID device that prevents OS boot?  The
> > messages are just details about why the assembly failed?
> 
> Yes, you are right, in our test environment, we installed the SLES15SP6
> on a VROC RAID 1 device which is set up by two NVME hard drivers. And
> there is also a hardware RAID kit on the motherboard with other two NVME 
> hard drivers.

OK, thanks for all the details.  What would you think of updating the
commit log like this?

  The vmd driver creates a "domain" symlink in sysfs for each VMD bridge.
  Previously this symlink was created after pci_bus_add_devices() added
  devices below the VMD bridge and emitted udev events to announce them to
  userspace.

  This led to a race between userspace consumers of the udev events and the
  kernel creation of the symlink.  One such consumer is mdadm, which
  assembles block devices into a RAID array, and for devices below a VMD
  bridge, mdadm depends on the "domain" symlink.

  If mdadm loses the race, it may be unable to assemble a RAID array, which
  may cause a boot failure or other issues, with complaints like this:

  ...

  Create the VMD "domain" symlink before invoking pci_bus_add_devices() to
  avoid this race.

  reply	other threads:[~2024-07-10 22:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-05 12:48 [PATCH v3] PCI: vmd: Create domain symlink before pci_bus_add_devices() Jiwei Sun
2024-06-05 16:57 ` Nirmal Patel
2024-07-06  3:22 ` Krzysztof Wilczyński
2024-07-09 20:59 ` Bjorn Helgaas
2024-07-10 13:29   ` Jiwei Sun
2024-07-10 22:16     ` Bjorn Helgaas [this message]
2024-07-11  1:32       ` Jiwei Sun
2024-07-11 16:12         ` 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=20240710221659.GA262309@bhelgaas \
    --to=helgaas@kernel.org \
    --cc=ahuang12@lenovo.com \
    --cc=bhelgaas@google.com \
    --cc=jonathan.derrick@linux.dev \
    --cc=kw@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=nirmal.patel@linux.intel.com \
    --cc=paul.m.stillwell.jr@intel.com \
    --cc=robh@kernel.org \
    --cc=sjiwei@163.com \
    --cc=sunjw10@lenovo.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;
as well as URLs for NNTP newsgroup(s).