From: Guangbo Cui <jckeep.cuiguangbo@gmail.com>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Clark Williams <clrkwllms@kernel.org>,
Steven Rostedt <rostedt@goodmis.org>,
Peter Zijlstra <peterz@infradead.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>
Cc: Jonathan Cameron <jonathan.cameron@huawei.com>,
Waiman Long <longman@redhat.com>,
linux-rt-devel@lists.linux.dev, linux-kernel@vger.kernel.org,
linux-pci@vger.kernel.org,
Guangbo Cui <jckeep.cuiguangbo@gmail.com>
Subject: [PATCH v3 2/2] PCI/aer_inject: Remove unnecessary lock in aer_inject_exit
Date: Sun, 26 Oct 2025 04:43:35 +0000 [thread overview]
Message-ID: <20251026044335.19049-4-jckeep.cuiguangbo@gmail.com> (raw)
In-Reply-To: <20251026044335.19049-2-jckeep.cuiguangbo@gmail.com>
After misc_deregister and restoring PCI bus ops, there can be no further
users accessing the einjected list. The list items are therefore safely
freed without taking the lock.
Signed-off-by: Guangbo Cui <jckeep.cuiguangbo@gmail.com>
---
drivers/pci/pcie/aer_inject.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/pci/pcie/aer_inject.c b/drivers/pci/pcie/aer_inject.c
index c8d65bfb10ff..a064fa2acb94 100644
--- a/drivers/pci/pcie/aer_inject.c
+++ b/drivers/pci/pcie/aer_inject.c
@@ -523,7 +523,6 @@ static int __init aer_inject_init(void)
static void __exit aer_inject_exit(void)
{
struct aer_error *err, *err_next;
- unsigned long flags;
struct pci_bus_ops *bus_ops;
misc_deregister(&aer_inject_device);
@@ -533,12 +532,10 @@ static void __exit aer_inject_exit(void)
kfree(bus_ops);
}
- spin_lock_irqsave(&inject_lock, flags);
list_for_each_entry_safe(err, err_next, &einjected, list) {
list_del(&err->list);
kfree(err);
}
- spin_unlock_irqrestore(&inject_lock, flags);
}
module_init(aer_inject_init);
--
2.43.0
next prev parent reply other threads:[~2025-10-26 4:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-26 4:43 [PATCH v3 0/2] PCI/aer_inject: Adjust locking for PREEMPT_RT Guangbo Cui
2025-10-26 4:43 ` [PATCH v3 1/2] PCI/aer_inject: Convert inject_lock to raw_spinlock_t Guangbo Cui
2025-10-27 8:11 ` Sebastian Andrzej Siewior
2025-10-27 15:11 ` Guangbo Cui
2025-10-26 4:43 ` Guangbo Cui [this message]
2025-10-27 8:12 ` [PATCH v3 2/2] PCI/aer_inject: Remove unnecessary lock in aer_inject_exit Sebastian Andrzej Siewior
2025-10-26 23:16 ` [PATCH v3 0/2] PCI/aer_inject: Adjust locking for PREEMPT_RT Waiman Long
2025-10-27 15:10 ` Guangbo Cui
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=20251026044335.19049-4-jckeep.cuiguangbo@gmail.com \
--to=jckeep.cuiguangbo@gmail.com \
--cc=bhelgaas@google.com \
--cc=bigeasy@linutronix.de \
--cc=boqun.feng@gmail.com \
--cc=clrkwllms@kernel.org \
--cc=jonathan.cameron@huawei.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=peterz@infradead.org \
--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