[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z2LxAU0U_G5wI_2M@kbusch-mbp.dhcp.thefacebook.com>
Date: Wed, 18 Dec 2024 08:57:53 -0700
From: Keith Busch <kbusch@...nel.org>
To: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Cc: Ryo Takakura <ryotkkr98@...il.com>, lgoncalv@...hat.com,
bhelgaas@...gle.com, jonathan.derrick@...ux.dev, kw@...ux.com,
lpieralisi@...nel.org, manivannan.sadhasivam@...aro.org,
nirmal.patel@...ux.intel.com, robh@...nel.org, rostedt@...dmis.org,
linux-kernel@...r.kernel.org, linux-pci@...r.kernel.org,
linux-rt-devel@...ts.linux.dev
Subject: Re: [PATCH v2] PCI: vmd: Fix spinlock usage on config access for RT
kernel
On Wed, Dec 18, 2024 at 04:48:38PM +0100, Sebastian Andrzej Siewior wrote:
> On 2024-12-18 08:36:54 [-0700], Keith Busch wrote:
> > On Wed, Dec 18, 2024 at 08:59:51PM +0900, Ryo Takakura wrote:
> > > PCI config access is locked with pci_lock which serializes
> > > pci_user/bus_write_config*() and pci_user/bus_read_config*().
> > > The subsequently invoked vmd_pci_write() and vmd_pci_read() are also
> > > serialized as they are only invoked by them respectively.
> > >
> > > Remove cfg_lock which is taken by vmd_pci_write() and vmd_pci_read()
> > > for their serialization as its already serialized by pci_lock.
> >
> > That's only true if CONFIG_PCI_LOCKLESS_CONFIG isn't set, so pci_lock
> > won't help with concurrent kernel config access in such a setup. I think
> > the previous change to raw lock proposal was the correct approach.
>
> I overlooked that. Wouldn't it make sense to let the vmd driver select
> that option rather than adding/ having a lock for the same purpose?
The arch/x86/Kconfig always selects PCI_LOCKESS_CONFIG, so I don't think
the vmd driver can require it be turned off. Besides, no need to punish
all PCI access if only this device requires it be serialized.
Powered by blists - more mailing lists