From: Kai-Heng Feng <kaihengf@nvidia.com>
To: Jonathan Cameron <jonathan.cameron@huawei.com>
Cc: rafael@kernel.org, Tony Luck <tony.luck@intel.com>,
Borislav Petkov <bp@alien8.de>,
Hanjun Guo <guohanjun@huawei.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Shuai Xue <xueshuai@linux.alibaba.com>,
Len Brown <lenb@kernel.org>,
Robert Moore <robert.moore@intel.com>,
Ard Biesheuvel <ardb@kernel.org>,
Breno Leitao <leitao@debian.org>,
"Fabio M. De Francesco" <fabio.m.de.francesco@linux.intel.com>,
Jason Tian <jason@os.amperecomputing.com>,
linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org,
acpica-devel@lists.linux.dev
Subject: Re: [PATCH v2 1/3] acpi/apei: Add devm_ghes_register_vendor_record_notifier()
Date: Tue, 24 Mar 2026 18:14:09 +0800 [thread overview]
Message-ID: <acJctweJv0kdABgV@M5403NF6WD> (raw)
In-Reply-To: <20260320095513.00007636@huawei.com>
On 2026-03-20 09:55, Jonathan Cameron wrote:
> External email: Use caution opening links or attachments
>
>
> On Thu, 19 Mar 2026 19:13:07 +0800
> Kai-Heng Feng <kaihengf@nvidia.com> wrote:
>
> > Add a device-managed wrapper around ghes_register_vendor_record_notifier()
> > so drivers can avoid manual cleanup on device removal or probe failure.
> >
> > Cc: Jonathan Cameron <jonathan.cameron@huawei.com>
> > Signed-off-by: Kai-Heng Feng <kaihengf@nvidia.com>
> Hi,
>
> My only comment is about following local style. I think that
> means moving the docs to the header. Unfortunately whether things
> are in the header or the c file is a subsystem specific thing.
>
> My preference is in the c file, but local style overrides that!
> Better to have all the docs in the same place.
You are right, I didn't notice it.
>
> Jonathan
>
> > ---
> > v2:
> > - New patch.
> >
> > drivers/acpi/apei/ghes.c | 25 +++++++++++++++++++++++++
> > include/acpi/ghes.h | 3 +++
> > 2 files changed, 28 insertions(+)
> >
> > diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
> > index 8acd2742bb27..d31a70a05538 100644
> > --- a/drivers/acpi/apei/ghes.c
> > +++ b/
> > @@ -689,6 +689,31 @@ void ghes_unregister_vendor_record_notifier(struct notifier_block *nb)
> > }
> > EXPORT_SYMBOL_GPL(ghes_unregister_vendor_record_notifier);
> >
> > +static void ghes_vendor_record_notifier_destroy(void *nb)
> > +{
> > + ghes_unregister_vendor_record_notifier(nb);
> > +}
> > +
> > +/**
> > + * devm_ghes_register_vendor_record_notifier - device-managed vendor record notifier registration
>
> There is also quite a bit of kernel doc in header. So I guess
> local convention is put it there not in the C code?
>
> Hence I would move the docs there.
Sure, will do in next version.
>
>
> > + * @dev: device that owns the notifier lifetime
> > + * @nb: pointer to the notifier_block structure of the vendor record handler
> > + *
> > + * Return: 0 on success, negative errno on failure.
> > + */
> > +int devm_ghes_register_vendor_record_notifier(struct device *ev,
> > + struct notifier_block *nb)
> > +{
> > + int ret;
> > +
> > + ret = ghes_register_vendor_record_notifier(nb);
> > + if (ret)
> > + return ret;
> > +
> > + return devm_add_action_or_reset(dev, ghes_vendor_record_notifier_destroy, nb);
> > +}
> > +EXPORT_SYMBOL_GPL(devm_ghes_register_vendor_record_notifier);
> > +
> > static void ghes_vendor_record_work_func(struct work_struct *work)
> > {
> > struct ghes_vendor_record_entry *entry;
> > diff --git a/include/acpi/ghes.h b/include/acpi/ghes.h
> > index 7bea522c0657..ca3ace828c1c 100644
> > --- a/include/acpi/ghes.h
> > +++ b/include/acpi/ghes.h
> > @@ -71,6 +71,9 @@ int ghes_register_vendor_record_notifier(struct notifier_block *nb);
> > */
> > void ghes_unregister_vendor_record_notifier(struct notifier_block *nb);
> >
> > +int devm_ghes_register_vendor_record_notifier(struct device *dev,
> > + struct notifier_block *nb);
> > +
> > struct list_head *ghes_get_devices(void);
> >
> > void ghes_estatus_pool_region_free(unsigned long addr, u32 size);
>
next prev parent reply other threads:[~2026-03-24 10:14 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-19 11:13 [PATCH v2 1/3] acpi/apei: Add devm_ghes_register_vendor_record_notifier() Kai-Heng Feng
2026-03-19 11:13 ` [PATCH v2 2/3] PCI: hisi: Use devm_ghes_register_vendor_record_notifier() Kai-Heng Feng
2026-03-20 9:57 ` Jonathan Cameron
2026-03-19 11:13 ` [PATCH v2 3/3] acpi/apei: Add NVIDIA GHES vendor CPER record handler Kai-Heng Feng
2026-03-20 10:13 ` Jonathan Cameron
2026-03-24 9:10 ` Kai-Heng Feng
2026-03-20 14:52 ` Bjorn Helgaas
2026-03-20 15:13 ` Bjorn Helgaas
2026-03-24 9:33 ` Kai-Heng Feng
2026-03-24 16:15 ` Bjorn Helgaas
2026-03-25 11:34 ` Kai-Heng Feng
2026-03-25 15:36 ` Bjorn Helgaas
2026-03-25 17:08 ` Jonathan Cameron
2026-03-25 17:16 ` Rafael J. Wysocki
2026-03-20 9:55 ` [PATCH v2 1/3] acpi/apei: Add devm_ghes_register_vendor_record_notifier() Jonathan Cameron
2026-03-24 10:14 ` Kai-Heng Feng [this message]
2026-03-23 12:28 ` Hanjun Guo
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=acJctweJv0kdABgV@M5403NF6WD \
--to=kaihengf@nvidia.com \
--cc=acpica-devel@lists.linux.dev \
--cc=ardb@kernel.org \
--cc=bp@alien8.de \
--cc=fabio.m.de.francesco@linux.intel.com \
--cc=guohanjun@huawei.com \
--cc=jason@os.amperecomputing.com \
--cc=jonathan.cameron@huawei.com \
--cc=leitao@debian.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=rafael@kernel.org \
--cc=robert.moore@intel.com \
--cc=tony.luck@intel.com \
--cc=xueshuai@linux.alibaba.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