From: Peter Zijlstra <peterz@infradead.org>
To: Guangbo Cui <jckeep.cuiguangbo@gmail.com>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Clark Williams <clrkwllms@kernel.org>,
Steven Rostedt <rostedt@goodmis.org>,
Ingo Molnar <mingo@redhat.com>, Will Deacon <will@kernel.org>,
Boqun Feng <boqun.feng@gmail.com>,
Thomas Gleixner <tglx@linutronix.de>,
Bjorn Helgaas <bhelgaas@google.com>,
Waiman Long <longman@redhat.com>,
linux-rt-devel@lists.linux.dev, linux-kernel@vger.kernel.org,
linux-pci@vger.kernel.org
Subject: Re: [PATCH v4 2/2] PCI/aer_inject: Convert inject_lock to raw_spinlock_t
Date: Thu, 6 Nov 2025 15:05:51 +0100 [thread overview]
Message-ID: <20251106140551.GY4067720@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <aQydxtOtgPTPxL_9@2a2a0ba7cec8>
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!
next prev parent reply other threads:[~2025-11-06 14:05 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-02 10:57 [PATCH v4 0/2] PCI/aer_inject: Adjust locking for PREEMPT_RT Guangbo Cui
2025-11-02 10:57 ` [PATCH v4 1/2] PCI/aer_inject: Remove unnecessary lock in aer_inject_exit Guangbo Cui
2025-11-02 10:57 ` [PATCH v4 2/2] PCI/aer_inject: Convert inject_lock to raw_spinlock_t Guangbo Cui
2025-11-03 19:21 ` Peter Zijlstra
2025-11-03 19:27 ` Peter Zijlstra
2025-11-06 13:08 ` Guangbo Cui
2025-11-06 14:05 ` Peter Zijlstra [this message]
2025-11-11 14:39 ` Sebastian Andrzej Siewior
2025-11-03 20:02 ` Sebastian Andrzej Siewior
2025-11-03 20:29 ` Peter Zijlstra
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=20251106140551.GY4067720@noisy.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=bhelgaas@google.com \
--cc=bigeasy@linutronix.de \
--cc=boqun.feng@gmail.com \
--cc=clrkwllms@kernel.org \
--cc=jckeep.cuiguangbo@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-rt-devel@lists.linux.dev \
--cc=longman@redhat.com \
--cc=mingo@redhat.com \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=will@kernel.org \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).