From: Conor Dooley <conor.dooley@microchip.com>
To: 运辉崔 <cuiyunhui@bytedance.com>
Cc: Conor Dooley <conor@kernel.org>, <ardb@kernel.org>,
<palmer@dabbelt.com>, <paul.walmsley@sifive.com>,
<aou@eecs.berkeley.edu>, <linux-riscv@lists.infradead.org>,
<rminnich@gmail.com>, <mark.rutland@arm.com>,
<lpieralisi@kernel.org>, <rafael@kernel.org>, <lenb@kernel.org>,
<jdelvare@suse.com>, <yc.hung@mediatek.com>,
<angelogioacchino.delregno@collabora.com>,
<allen-kh.cheng@mediatek.com>,
<pierre-louis.bossart@linux.intel.com>,
<tinghan.shen@mediatek.com>, <linux-kernel@vger.kernel.org>,
<linux-acpi@vger.kernel.org>, <geshijian@bytedance.com>,
<weidong.wd@bytedance.com>
Subject: Re: [External] Re: [PATCH v2 2/3] firmware: introduce FFI for SMBIOS entry.
Date: Mon, 3 Jul 2023 14:02:15 +0100 [thread overview]
Message-ID: <20230703-patrol-paced-76cd5e24db6b@wendy> (raw)
In-Reply-To: <CAEEQ3w=-1Zns_pZRSeM0+Wv46y6RttcT5jFy_ENnq--RptYp2g@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2821 bytes --]
On Mon, Jul 03, 2023 at 08:41:30PM +0800, 运辉崔 wrote:
> On Mon, Jul 3, 2023 at 4:36 PM Conor Dooley <conor.dooley@microchip.com> wrote:
> > On Mon, Jul 03, 2023 at 04:23:53PM +0800, 运辉崔 wrote:
> > > > > +FDT FIRMWARE INTERFACE (FFI)
> > > > > +M: Yunhui Cui cuiyunhui@bytedance.com
> > > > > +S: Maintained
> > > > > +F: drivers/firmware/ffi.c
> > > > > +F: include/linux/ffi.h
> > > >
> > > > Are you going to apply patches for this, or is someone else?
> > > Yes, it will be used by patch 3/3.
> >
> > That's not what I asked :(
>
> Sorry, ok, what do you want to ask?
Who is going to apply patches for drivers/firmware/ffi*?
> > > > > static void __init dmi_scan_machine(void)
> > > > > @@ -660,58 +686,22 @@ static void __init dmi_scan_machine(void)
> > > > > char __iomem *p, *q;
> > > > > char buf[32];
> > > > >
> > > > > +#ifdef CONFIG_FDT_FW_INTERFACE
> > > > > + if (dmi_sacn_smbios(ffi.smbios3, ffi.smbios))
> > > >
> > > > "dmi_sacn_smbios"
> > > >
> > > > > + goto error;
> > > > > +#endif
> > > >
> > > > Does this not mean that if FDT_FW_INTERFACE is enabled, but the platform
> > > > wants to use EFI, it won't be able to? The `goto error;` makes this look
> > > > mutually exclusive to my efi-unaware eyes.
> > >
> > > If you have enabled FFI, then if something goes wrong, you should goto error.
> > > Just like the origin code:
> > > if (efi_enabled(EFI_CONFIG_TABLES)) {
> > > if (dmi_sacn_smbios(efi.smbios3, efi.smbios))
> > > goto error;
> > > } else if (IS_ENABLED(CONFIG_DMI_SCAN_MACHINE_NON_EFI_FALLBACK)) {
> > > p = dmi_early_remap(SMBIOS_ENTRY_POINT_SCAN_START, 0x10000);
> > > if (p == NULL)
> > > goto error;
> >
> > Does this not make FFI and EFI mutually exclusive Kconfig options?
> > Suppose you are on a system that does not implement FFI, but does
> > implement EFI - what's going to happen then?
> > AFAICT, dmi_sacn_smbios(ffi.smbios3, ffi.smbios) will fail & you'll do a
> > `goto error` & skip the EFI code. What am I missing?
>
> Code is not intended to be mutually exclusive, get the correct value and return,
> The code is going to be changed to this:
>
> #ifdef CONFIG_FDT_FW_INTERFACE
Ideally, these would be IS_ENABLED() instead of #ifdef - but if you copy
what EFI does, then you don't need either, as there will always be an
ffi_enabled() defined.
> if (ffi_enabled(FFI_CONFIG_TABLES)) {
I don't know what this function is, but this code seems like a step in
the right direction.
> if (!dmi_sacn_smbios(ffi.smbios3, ffi.smbios))
> return;
> }
> #endif
Thanks,
Conor.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2023-07-03 13:03 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-02 9:57 [PATCH v2 1/3] riscv: obtain ACPI RSDP from FFI Yunhui Cui
2023-07-02 9:57 ` [PATCH v2 2/3] firmware: introduce FFI for SMBIOS entry Yunhui Cui
2023-07-02 12:41 ` Conor Dooley
2023-07-03 8:23 ` [External] " 运辉崔
2023-07-03 8:34 ` Conor Dooley
2023-07-03 12:41 ` 运辉崔
2023-07-03 13:02 ` Conor Dooley [this message]
2023-07-03 13:26 ` 运辉崔
2023-07-02 9:57 ` [PATCH v2 3/3] riscv: obtain SMBIOS entry from FFI Yunhui Cui
2023-07-02 12:42 ` Conor Dooley
2023-07-03 7:50 ` [External] " 运辉崔
2023-07-03 8:16 ` Conor Dooley
2023-07-02 13:47 ` [PATCH v2 1/3] riscv: obtain ACPI RSDP " Conor Dooley
2023-07-03 4:21 ` Sunil V L
2023-07-03 6:19 ` [External] " 运辉崔
2023-07-03 7:19 ` 运辉崔
2023-07-03 8:12 ` Conor Dooley
2023-07-03 10:16 ` 运辉崔
2023-07-03 12:18 ` Conor Dooley
2023-07-03 13:04 ` 运辉崔
2023-07-03 13:01 ` Andrew Jones
2023-07-03 13:30 ` [External] " 运辉崔
2023-07-03 14:17 ` Andrew Jones
2023-07-03 14:23 ` Conor Dooley
2023-07-03 18:58 ` Emil Renner Berthing
2023-07-03 21:32 ` [External] " Jessica Clarke
2023-07-05 14:42 ` Björn Töpel
2023-07-06 2:24 ` 运辉崔
2023-07-06 8:52 ` Björn Töpel
[not found] ` <CAP6exY+gTSxU95nDK14z-Y1suKeXPkLzZ_BZqr-vRVGO9qmcxg@mail.gmail.com>
2023-07-07 9:05 ` Björn Töpel
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=20230703-patrol-paced-76cd5e24db6b@wendy \
--to=conor.dooley@microchip.com \
--cc=allen-kh.cheng@mediatek.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=aou@eecs.berkeley.edu \
--cc=ardb@kernel.org \
--cc=conor@kernel.org \
--cc=cuiyunhui@bytedance.com \
--cc=geshijian@bytedance.com \
--cc=jdelvare@suse.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=lpieralisi@kernel.org \
--cc=mark.rutland@arm.com \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=rafael@kernel.org \
--cc=rminnich@gmail.com \
--cc=tinghan.shen@mediatek.com \
--cc=weidong.wd@bytedance.com \
--cc=yc.hung@mediatek.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