[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251106140551.GY4067720@noisy.programming.kicks-ass.net>
Date: Thu, 6 Nov 2025 15:05:51 +0100
From: Peter Zijlstra <peterz@...radead.org>
To: Guangbo Cui <jckeep.cuiguangbo@...il.com>
Cc: Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
Clark Williams <clrkwllms@...nel.org>,
Steven Rostedt <rostedt@...dmis.org>,
Ingo Molnar <mingo@...hat.com>, Will Deacon <will@...nel.org>,
Boqun Feng <boqun.feng@...il.com>,
Thomas Gleixner <tglx@...utronix.de>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Waiman Long <longman@...hat.com>, linux-rt-devel@...ts.linux.dev,
linux-kernel@...r.kernel.org, linux-pci@...r.kernel.org
Subject: Re: [PATCH v4 2/2] PCI/aer_inject: Convert inject_lock to
raw_spinlock_t
On Thu, Nov 06, 2025 at 01:08:22PM +0000, Guangbo Cui wrote:
> > + scoped_guard (raw_spinlock_irqsave, &inject_lock) {
> > + if (ops == &aer_inj_pci_ops)
> > + break;
> > + pci_bus_ops_init(bus_ops, bus, ops);
> > + list_add(&bus_ops->list, &pci_bus_ops_list);
> > + bus_ops = NULL;
> > + }
>
> I found that there are two styles of calling scoped_guard in the kernel:
>
> 1. scoped_guard (...)
>
> 2. scoped_guard(...)
>
> Is there any coding convention or guideline regarding this?
Not really :/ I usually use the former, to mirror if (cond) and for
(;;) usage as opposed to func(args).
> > + rperr->root_status |= PCI_ERR_ROOT_COR_RCV;
> > + rperr->source_id &= 0xffff0000;
> > + rperr->source_id |= PCI_DEVID(einj->bus, devfn);
> > + }
> > + if (einj->uncor_status) {
> > + if (rperr->root_status & PCI_ERR_ROOT_UNCOR_RCV)
> > + rperr->root_status |= PCI_ERR_ROOT_MULTI_UNCOR_RCV;
> > + if (sever & einj->uncor_status) {
> > + rperr->root_status |= PCI_ERR_ROOT_FATAL_RCV;
> > + if (!(rperr->root_status & PCI_ERR_ROOT_UNCOR_RCV))
> > + rperr->root_status |= PCI_ERR_ROOT_FIRST_FATAL;
> > + } else
> > + rperr->root_status |= PCI_ERR_ROOT_NONFATAL_RCV;
> > + rperr->root_status |= PCI_ERR_ROOT_UNCOR_RCV;
> > + rperr->source_id &= 0x0000ffff;
> > + rperr->source_id |= PCI_DEVID(einj->bus, devfn) << 16;
> > + }
> > }
> > - raw_spin_unlock_irqrestore(&inject_lock, flags);
> >
> > if (aer_mask_override) {
> > pci_write_config_dword(dev, pos_cap_err + PCI_ERR_COR_MASK,
>
> LGTM, If there are no objections, I’ll include these two patches in the
> next version of the patchset and add your Signed-off-by tag.
Sure, but please do test them, I've not even had them near a compiler
;-)
Thanks!
Powered by blists - more mailing lists