* [PATCH] Fix for iBFT compile issues on ARM64
@ 2021-09-02 14:03 Konrad Rzeszutek Wilk
2021-09-02 14:03 ` [PATCH] iscsi_ibft: Fix isa_bus_to_virt not working under ARM Konrad Rzeszutek Wilk
0 siblings, 1 reply; 4+ messages in thread
From: Konrad Rzeszutek Wilk @ 2021-09-02 14:03 UTC (permalink / raw)
To: linux-kernel, vijayendra.suman, mlombard, rppt, pjones
This is a patch to fix the https://lkml.org/lkml/2021/8/3/108 compile
issue which I managed to miss. My apologies for the late fix - please
see the attached patch.
The fix is rather simple - only on X86 do we need to search for the
iBFT under 640KB, so lets ifdef that code.
I also put the patch in linux-next and devel/for-linus-5.15
drivers/firmware/iscsi_ibft.c | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
Konrad Rzeszutek Wilk (1):
iscsi_ibft: Fix isa_bus_to_virt not working under ARM
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] iscsi_ibft: Fix isa_bus_to_virt not working under ARM
2021-09-02 14:03 [PATCH] Fix for iBFT compile issues on ARM64 Konrad Rzeszutek Wilk
@ 2021-09-02 14:03 ` Konrad Rzeszutek Wilk
2021-09-02 17:14 ` Mike Rapoport
0 siblings, 1 reply; 4+ messages in thread
From: Konrad Rzeszutek Wilk @ 2021-09-02 14:03 UTC (permalink / raw)
To: linux-kernel, vijayendra.suman, mlombard, rppt, pjones
Cc: Konrad Rzeszutek Wilk, kernel test robot
The isa_bus_to_virt is only needed under X86 and in fact the code
that sets the ibft_phys_addr is only compiled under X86.
As such lets just ifdef the code.
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Vijayendra Suman <vijayendra.suman@oracle.com>
CC: Maurizio Lombardi <mlombard@redhat.com>
CC: Mike Rapoport <rppt@kernel.org>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
drivers/firmware/iscsi_ibft.c | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c
index 612a59e213df..7cde1a7a3ab1 100644
--- a/drivers/firmware/iscsi_ibft.c
+++ b/drivers/firmware/iscsi_ibft.c
@@ -86,7 +86,7 @@ MODULE_VERSION(IBFT_ISCSI_VERSION);
static struct acpi_table_ibft *ibft_addr;
-#ifndef CONFIG_ISCSI_IBFT_FIND
+#ifdef CONFIG_ISCSI_IBFT_FIND
phys_addr_t ibft_phys_addr;
#endif
@@ -851,7 +851,21 @@ static void __init acpi_find_ibft_region(void)
{
}
#endif
-
+#ifdef CONFIG_ISCSI_IBFT_FIND
+static int __init acpi_find_isa_region(void)
+{
+ if (ibft_phys_addr) {
+ ibft_addr = isa_bus_to_virt(ibft_phys_addr);
+ return 0;
+ }
+ return -ENODEV;
+}
+#else
+static int __init acpi_find_isa_region(void)
+{
+ return -ENODEV;
+}
+#endif
/*
* ibft_init() - creates sysfs tree entries for the iBFT data.
*/
@@ -864,9 +878,7 @@ static int __init ibft_init(void)
is called before ACPI tables are parsed and it only does
legacy finding.
*/
- if (ibft_phys_addr)
- ibft_addr = isa_bus_to_virt(ibft_phys_addr);
- else
+ if (acpi_find_isa_region())
acpi_find_ibft_region();
if (ibft_addr) {
--
2.27.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] iscsi_ibft: Fix isa_bus_to_virt not working under ARM
2021-09-02 14:03 ` [PATCH] iscsi_ibft: Fix isa_bus_to_virt not working under ARM Konrad Rzeszutek Wilk
@ 2021-09-02 17:14 ` Mike Rapoport
2021-09-02 20:35 ` Konrad Rzeszutek Wilk
0 siblings, 1 reply; 4+ messages in thread
From: Mike Rapoport @ 2021-09-02 17:14 UTC (permalink / raw)
To: Konrad Rzeszutek Wilk
Cc: linux-kernel, vijayendra.suman, mlombard, pjones, kernel test robot
On Thu, Sep 02, 2021 at 02:03:13PM +0000, Konrad Rzeszutek Wilk wrote:
> The isa_bus_to_virt is only needed under X86 and in fact the code
> that sets the ibft_phys_addr is only compiled under X86.
>
> As such lets just ifdef the code.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Reported-by: Vijayendra Suman <vijayendra.suman@oracle.com>
> CC: Maurizio Lombardi <mlombard@redhat.com>
> CC: Mike Rapoport <rppt@kernel.org>
> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> ---
> drivers/firmware/iscsi_ibft.c | 22 +++++++++++++++++-----
> 1 file changed, 17 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c
> index 612a59e213df..7cde1a7a3ab1 100644
> --- a/drivers/firmware/iscsi_ibft.c
> +++ b/drivers/firmware/iscsi_ibft.c
> @@ -86,7 +86,7 @@ MODULE_VERSION(IBFT_ISCSI_VERSION);
>
> static struct acpi_table_ibft *ibft_addr;
>
> -#ifndef CONFIG_ISCSI_IBFT_FIND
> +#ifdef CONFIG_ISCSI_IBFT_FIND
> phys_addr_t ibft_phys_addr;
> #endif
I think this declaration should be removed after you added
acpi_find_ibft_region().
Before your changes we had ibft_phys_addr defined in iscsi_ibft_find.c for
CONFIG_ISCSI_IBFT_FIND=y and the declaration above was needed to avoid
compilation error in ibft_init().
With the only use of ibft_phys_addr hidden under #ifdef CONFIG_ISCSI_IBFT_FIND
this declaration actually hides ibft_phys_addr defined in
iscsi_ibft_find.c.
>
> @@ -851,7 +851,21 @@ static void __init acpi_find_ibft_region(void)
> {
> }
> #endif
> -
> +#ifdef CONFIG_ISCSI_IBFT_FIND
> +static int __init acpi_find_isa_region(void)
> +{
> + if (ibft_phys_addr) {
> + ibft_addr = isa_bus_to_virt(ibft_phys_addr);
> + return 0;
> + }
> + return -ENODEV;
> +}
> +#else
> +static int __init acpi_find_isa_region(void)
> +{
> + return -ENODEV;
> +}
> +#endif
> /*
> * ibft_init() - creates sysfs tree entries for the iBFT data.
> */
> @@ -864,9 +878,7 @@ static int __init ibft_init(void)
> is called before ACPI tables are parsed and it only does
> legacy finding.
> */
> - if (ibft_phys_addr)
> - ibft_addr = isa_bus_to_virt(ibft_phys_addr);
> - else
> + if (acpi_find_isa_region())
> acpi_find_ibft_region();
>
> if (ibft_addr) {
> --
> 2.27.0
>
--
Sincerely yours,
Mike.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] iscsi_ibft: Fix isa_bus_to_virt not working under ARM
2021-09-02 17:14 ` Mike Rapoport
@ 2021-09-02 20:35 ` Konrad Rzeszutek Wilk
0 siblings, 0 replies; 4+ messages in thread
From: Konrad Rzeszutek Wilk @ 2021-09-02 20:35 UTC (permalink / raw)
To: Mike Rapoport
Cc: linux-kernel, vijayendra.suman, mlombard, pjones, kernel test robot
On Thu, Sep 02, 2021 at 08:14:44PM +0300, Mike Rapoport wrote:
> On Thu, Sep 02, 2021 at 02:03:13PM +0000, Konrad Rzeszutek Wilk wrote:
> > The isa_bus_to_virt is only needed under X86 and in fact the code
> > that sets the ibft_phys_addr is only compiled under X86.
> >
> > As such lets just ifdef the code.
> >
> > Reported-by: kernel test robot <lkp@intel.com>
> > Reported-by: Vijayendra Suman <vijayendra.suman@oracle.com>
> > CC: Maurizio Lombardi <mlombard@redhat.com>
> > CC: Mike Rapoport <rppt@kernel.org>
> > Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> > ---
> > drivers/firmware/iscsi_ibft.c | 22 +++++++++++++++++-----
> > 1 file changed, 17 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c
> > index 612a59e213df..7cde1a7a3ab1 100644
> > --- a/drivers/firmware/iscsi_ibft.c
> > +++ b/drivers/firmware/iscsi_ibft.c
> > @@ -86,7 +86,7 @@ MODULE_VERSION(IBFT_ISCSI_VERSION);
> >
> > static struct acpi_table_ibft *ibft_addr;
> >
> > -#ifndef CONFIG_ISCSI_IBFT_FIND
> > +#ifdef CONFIG_ISCSI_IBFT_FIND
> > phys_addr_t ibft_phys_addr;
> > #endif
>
> I think this declaration should be removed after you added
> acpi_find_ibft_region().
>
> Before your changes we had ibft_phys_addr defined in iscsi_ibft_find.c for
> CONFIG_ISCSI_IBFT_FIND=y and the declaration above was needed to avoid
> compilation error in ibft_init().
>
> With the only use of ibft_phys_addr hidden under #ifdef CONFIG_ISCSI_IBFT_FIND
> this declaration actually hides ibft_phys_addr defined in
> iscsi_ibft_find.c.
Yes good idea. I think this below will work rather nicely:
From 799206c1302e8fabfab5a4151e74a2fe90090590 Mon Sep 17 00:00:00 2001
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Date: Wed, 1 Sep 2021 20:22:11 -0400
Subject: [PATCH] iscsi_ibft: Fix isa_bus_to_virt not working under ARM
The isa_bus_to_virt is only needed under X86 and in fact the code
that sets the ibft_phys_addr is only compiled under X86.
As such lets just ifdef the code.
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Vijayendra Suman <vijayendra.suman@oracle.com>
CC: Maurizio Lombardi <mlombard@redhat.com>
CC: Mike Rapoport <rppt@kernel.org>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
v2: Remove the ibft_phys_addr as it is defined in iscsi_ibft.h
---
drivers/firmware/iscsi_ibft.c | 24 ++++++++++++++++--------
1 file changed, 16 insertions(+), 8 deletions(-)
diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c
index 612a59e213df..6e9788324fea 100644
--- a/drivers/firmware/iscsi_ibft.c
+++ b/drivers/firmware/iscsi_ibft.c
@@ -86,10 +86,6 @@ MODULE_VERSION(IBFT_ISCSI_VERSION);
static struct acpi_table_ibft *ibft_addr;
-#ifndef CONFIG_ISCSI_IBFT_FIND
-phys_addr_t ibft_phys_addr;
-#endif
-
struct ibft_hdr {
u8 id;
u8 version;
@@ -851,7 +847,21 @@ static void __init acpi_find_ibft_region(void)
{
}
#endif
-
+#ifdef CONFIG_ISCSI_IBFT_FIND
+static int __init acpi_find_isa_region(void)
+{
+ if (ibft_phys_addr) {
+ ibft_addr = isa_bus_to_virt(ibft_phys_addr);
+ return 0;
+ }
+ return -ENODEV;
+}
+#else
+static int __init acpi_find_isa_region(void)
+{
+ return -ENODEV;
+}
+#endif
/*
* ibft_init() - creates sysfs tree entries for the iBFT data.
*/
@@ -864,9 +874,7 @@ static int __init ibft_init(void)
is called before ACPI tables are parsed and it only does
legacy finding.
*/
- if (ibft_phys_addr)
- ibft_addr = isa_bus_to_virt(ibft_phys_addr);
- else
+ if (acpi_find_isa_region())
acpi_find_ibft_region();
if (ibft_addr) {
--
2.27.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-09-02 20:35 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-02 14:03 [PATCH] Fix for iBFT compile issues on ARM64 Konrad Rzeszutek Wilk
2021-09-02 14:03 ` [PATCH] iscsi_ibft: Fix isa_bus_to_virt not working under ARM Konrad Rzeszutek Wilk
2021-09-02 17:14 ` Mike Rapoport
2021-09-02 20:35 ` Konrad Rzeszutek Wilk
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 NNTP newsgroup(s).