mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] firmware: google: Properly state IOMEM dependency
@ 2022-02-25  4:15 David Gow
  2022-02-25 10:47 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 3+ messages in thread
From: David Gow @ 2022-02-25  4:15 UTC (permalink / raw)
  To: Julius Werner, Greg Kroah-Hartman, Ben Hutchings
  Cc: David Gow, linux-kernel, linux-um, anton ivanov

The Google Coreboot implementation requires IOMEM functions
(memmremap, memunmap, devm_memremap), but does not specify this is its
Kconfig. This results in build errors when HAS_IOMEM is not set, such as
on some UML configurations:

/usr/bin/ld: drivers/firmware/google/coreboot_table.o: in function `coreboot_table_probe':
coreboot_table.c:(.text+0x311): undefined reference to `memremap'
/usr/bin/ld: coreboot_table.c:(.text+0x34e): undefined reference to `memunmap'
/usr/bin/ld: drivers/firmware/google/memconsole-coreboot.o: in function `memconsole_probe':
memconsole-coreboot.c:(.text+0x12d): undefined reference to `memremap'
/usr/bin/ld: memconsole-coreboot.c:(.text+0x17e): undefined reference to `devm_memremap'
/usr/bin/ld: memconsole-coreboot.c:(.text+0x191): undefined reference to `memunmap'
/usr/bin/ld: drivers/firmware/google/vpd.o: in function `vpd_section_destroy.isra.0':
vpd.c:(.text+0x300): undefined reference to `memunmap'
/usr/bin/ld: drivers/firmware/google/vpd.o: in function `vpd_section_init':
vpd.c:(.text+0x382): undefined reference to `memremap'
/usr/bin/ld: vpd.c:(.text+0x459): undefined reference to `memunmap'
/usr/bin/ld: drivers/firmware/google/vpd.o: in function `vpd_probe':
vpd.c:(.text+0x59d): undefined reference to `memremap'
/usr/bin/ld: vpd.c:(.text+0x5d3): undefined reference to `memunmap'
collect2: error: ld returned 1 exit status

Signed-off-by: David Gow <davidgow@google.com>
Acked-By: anton ivanov <anton.ivanov@cambridgegreys.com>
Acked-By: Julius Werner <jwerner@chromium.org>
---

Changes since v1:
http://lists.infradead.org/pipermail/linux-um/2022-February/002266.html
- Fix to depend on HAS_IOMEM, not IOMEM
- Add Acked-By tags.

---
 drivers/firmware/google/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/firmware/google/Kconfig b/drivers/firmware/google/Kconfig
index 931544c9f63d..983e07dc022e 100644
--- a/drivers/firmware/google/Kconfig
+++ b/drivers/firmware/google/Kconfig
@@ -21,7 +21,7 @@ config GOOGLE_SMI
 
 config GOOGLE_COREBOOT_TABLE
 	tristate "Coreboot Table Access"
-	depends on ACPI || OF
+	depends on HAS_IOMEM && (ACPI || OF)
 	help
 	  This option enables the coreboot_table module, which provides other
 	  firmware modules access to the coreboot table. The coreboot table
-- 
2.35.1.574.g5d30c73bfb-goog


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] firmware: google: Properly state IOMEM dependency
  2022-02-25  4:15 [PATCH v2] firmware: google: Properly state IOMEM dependency David Gow
@ 2022-02-25 10:47 ` Greg Kroah-Hartman
  2022-02-25 14:55   ` David Gow
  0 siblings, 1 reply; 3+ messages in thread
From: Greg Kroah-Hartman @ 2022-02-25 10:47 UTC (permalink / raw)
  To: David Gow
  Cc: Julius Werner, Ben Hutchings, linux-kernel, linux-um, anton ivanov

On Fri, Feb 25, 2022 at 12:15:02PM +0800, David Gow wrote:
> The Google Coreboot implementation requires IOMEM functions
> (memmremap, memunmap, devm_memremap), but does not specify this is its
> Kconfig. This results in build errors when HAS_IOMEM is not set, such as
> on some UML configurations:
> 
> /usr/bin/ld: drivers/firmware/google/coreboot_table.o: in function `coreboot_table_probe':
> coreboot_table.c:(.text+0x311): undefined reference to `memremap'
> /usr/bin/ld: coreboot_table.c:(.text+0x34e): undefined reference to `memunmap'
> /usr/bin/ld: drivers/firmware/google/memconsole-coreboot.o: in function `memconsole_probe':
> memconsole-coreboot.c:(.text+0x12d): undefined reference to `memremap'
> /usr/bin/ld: memconsole-coreboot.c:(.text+0x17e): undefined reference to `devm_memremap'
> /usr/bin/ld: memconsole-coreboot.c:(.text+0x191): undefined reference to `memunmap'
> /usr/bin/ld: drivers/firmware/google/vpd.o: in function `vpd_section_destroy.isra.0':
> vpd.c:(.text+0x300): undefined reference to `memunmap'
> /usr/bin/ld: drivers/firmware/google/vpd.o: in function `vpd_section_init':
> vpd.c:(.text+0x382): undefined reference to `memremap'
> /usr/bin/ld: vpd.c:(.text+0x459): undefined reference to `memunmap'
> /usr/bin/ld: drivers/firmware/google/vpd.o: in function `vpd_probe':
> vpd.c:(.text+0x59d): undefined reference to `memremap'
> /usr/bin/ld: vpd.c:(.text+0x5d3): undefined reference to `memunmap'
> collect2: error: ld returned 1 exit status
> 
> Signed-off-by: David Gow <davidgow@google.com>
> Acked-By: anton ivanov <anton.ivanov@cambridgegreys.com>
> Acked-By: Julius Werner <jwerner@chromium.org>
> ---

What commit id does this fix?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] firmware: google: Properly state IOMEM dependency
  2022-02-25 10:47 ` Greg Kroah-Hartman
@ 2022-02-25 14:55   ` David Gow
  0 siblings, 0 replies; 3+ messages in thread
From: David Gow @ 2022-02-25 14:55 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Julius Werner, Ben Hutchings, Linux Kernel Mailing List,
	linux-um, anton ivanov

[-- Attachment #1: Type: text/plain, Size: 2553 bytes --]

On Fri, Feb 25, 2022 at 6:47 PM Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
>
> On Fri, Feb 25, 2022 at 12:15:02PM +0800, David Gow wrote:
> > The Google Coreboot implementation requires IOMEM functions
> > (memmremap, memunmap, devm_memremap), but does not specify this is its
> > Kconfig. This results in build errors when HAS_IOMEM is not set, such as
> > on some UML configurations:
> >
> > /usr/bin/ld: drivers/firmware/google/coreboot_table.o: in function `coreboot_table_probe':
> > coreboot_table.c:(.text+0x311): undefined reference to `memremap'
> > /usr/bin/ld: coreboot_table.c:(.text+0x34e): undefined reference to `memunmap'
> > /usr/bin/ld: drivers/firmware/google/memconsole-coreboot.o: in function `memconsole_probe':
> > memconsole-coreboot.c:(.text+0x12d): undefined reference to `memremap'
> > /usr/bin/ld: memconsole-coreboot.c:(.text+0x17e): undefined reference to `devm_memremap'
> > /usr/bin/ld: memconsole-coreboot.c:(.text+0x191): undefined reference to `memunmap'
> > /usr/bin/ld: drivers/firmware/google/vpd.o: in function `vpd_section_destroy.isra.0':
> > vpd.c:(.text+0x300): undefined reference to `memunmap'
> > /usr/bin/ld: drivers/firmware/google/vpd.o: in function `vpd_section_init':
> > vpd.c:(.text+0x382): undefined reference to `memremap'
> > /usr/bin/ld: vpd.c:(.text+0x459): undefined reference to `memunmap'
> > /usr/bin/ld: drivers/firmware/google/vpd.o: in function `vpd_probe':
> > vpd.c:(.text+0x59d): undefined reference to `memremap'
> > /usr/bin/ld: vpd.c:(.text+0x5d3): undefined reference to `memunmap'
> > collect2: error: ld returned 1 exit status
> >
> > Signed-off-by: David Gow <davidgow@google.com>
> > Acked-By: anton ivanov <anton.ivanov@cambridgegreys.com>
> > Acked-By: Julius Werner <jwerner@chromium.org>
> > ---
>
> What commit id does this fix?
>
> thanks,
>
> greg k-h

As best I can tell, this[1] is the most sensible answer:

Fixes: a28aad66da ("firmware: coreboot: Collapse platform drivers into
bus core")

However, I think the first actual HAS_IOMEM-dependent calls were
introduced earlier, in "firmware: google memconsole: Add coreboot
support"[2], it just (a) never caused a problem under UML due to the
ACPI requirement, and (b) this fix won't apply particularly cleanly to
anything earlier than [1] anyway.

-- David

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a28aad66da8bd19b249670d003bb9a698bdda397
[2]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d384d6f43d1ec3f1225ab0275fd592c5980bd830

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4003 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-02-25 14:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-25  4:15 [PATCH v2] firmware: google: Properly state IOMEM dependency David Gow
2022-02-25 10:47 ` Greg Kroah-Hartman
2022-02-25 14:55   ` David Gow

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®