All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ACPI, APEI, Fix error return value in apei_map_generic_address()
@ 2020-11-10  8:33 yaoaili126
  2020-11-16 18:30 ` Rafael J. Wysocki
  0 siblings, 1 reply; 6+ messages in thread
From: yaoaili126 @ 2020-11-10  8:33 UTC (permalink / raw)
  To: rjw, lenb
  Cc: james.morse, tony.luck, bp, linux-acpi, stable, yangfeng1, yaoaili

From: Aili Yao <yaoaili@kingsoft.com>

From commit 6915564dc5a8 ("ACPI: OSL: Change the type of
acpi_os_map_generic_address() return value"),
acpi_os_map_generic_address() will return logical address or NULL for
error, but for ACPI_ADR_SPACE_SYSTEM_IO case, it should be also return 0
as it's a normal case, but now it will return -ENXIO. So check it out for
such case to avoid einj module initialization fail.

Fixes: 6915564dc5a8 ("ACPI: OSL: Change the type of
acpi_os_map_generic_address() return value")
Cc: <stable@vger.kernel.org>
Reviewed-by: James Morse <james.morse@arm.com>
Tested-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Aili Yao <yaoaili@kingsoft.com>
---
 drivers/acpi/apei/apei-base.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/acpi/apei/apei-base.c b/drivers/acpi/apei/apei-base.c
index 552fd9f..3294cc8 100644
--- a/drivers/acpi/apei/apei-base.c
+++ b/drivers/acpi/apei/apei-base.c
@@ -633,6 +633,10 @@ int apei_map_generic_address(struct acpi_generic_address *reg)
 	if (rc)
 		return rc;
 
+	/* IO space doesn't need mapping */
+	if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_IO)
+		return 0;
+
 	if (!acpi_os_map_generic_address(reg))
 		return -ENXIO;
 
-- 
2.9.5



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

* Re: [PATCH] ACPI, APEI, Fix error return value in apei_map_generic_address()
  2020-11-10  8:33 [PATCH] ACPI, APEI, Fix error return value in apei_map_generic_address() yaoaili126
@ 2020-11-16 18:30 ` Rafael J. Wysocki
  0 siblings, 0 replies; 6+ messages in thread
From: Rafael J. Wysocki @ 2020-11-16 18:30 UTC (permalink / raw)
  To: yaoaili126
  Cc: Rafael J. Wysocki, Len Brown, James Morse, Tony Luck,
	Borislav Petkov, ACPI Devel Maling List, Stable, yangfeng1,
	yaoaili

On Tue, Nov 10, 2020 at 9:50 AM <yaoaili126@163.com> wrote:
>
> From: Aili Yao <yaoaili@kingsoft.com>
>
> From commit 6915564dc5a8 ("ACPI: OSL: Change the type of
> acpi_os_map_generic_address() return value"),
> acpi_os_map_generic_address() will return logical address or NULL for
> error, but for ACPI_ADR_SPACE_SYSTEM_IO case, it should be also return 0
> as it's a normal case, but now it will return -ENXIO. So check it out for
> such case to avoid einj module initialization fail.
>
> Fixes: 6915564dc5a8 ("ACPI: OSL: Change the type of
> acpi_os_map_generic_address() return value")
> Cc: <stable@vger.kernel.org>
> Reviewed-by: James Morse <james.morse@arm.com>
> Tested-by: Tony Luck <tony.luck@intel.com>
> Signed-off-by: Aili Yao <yaoaili@kingsoft.com>
> ---
>  drivers/acpi/apei/apei-base.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/acpi/apei/apei-base.c b/drivers/acpi/apei/apei-base.c
> index 552fd9f..3294cc8 100644
> --- a/drivers/acpi/apei/apei-base.c
> +++ b/drivers/acpi/apei/apei-base.c
> @@ -633,6 +633,10 @@ int apei_map_generic_address(struct acpi_generic_address *reg)
>         if (rc)
>                 return rc;
>
> +       /* IO space doesn't need mapping */
> +       if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_IO)
> +               return 0;
> +
>         if (!acpi_os_map_generic_address(reg))
>                 return -ENXIO;
>
> --

Applied as 5.10-rc material, thanks!

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

* Re: [PATCH] ACPI, APEI, Fix error return value in apei_map_generic_address()
  2020-11-10  9:42   ` yaoaili [么爱利]
@ 2020-11-10  9:49     ` Greg KH
  0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2020-11-10  9:49 UTC (permalink / raw)
  To: yaoaili [么爱利]; +Cc: yaoaili126, stable

On Tue, Nov 10, 2020 at 09:42:21AM +0000, yaoaili [么爱利] wrote:
> Sorry for confusing. I am really new to kernel community!
> I should just add the tag 'Cc: <stable@vger.kernel.org>' , not really cc to stable@vger.kernel.org
> sorry for this!

No, that's fine, you just didn't send this to us with any sort of
context at all.  The patch needs to be accepted by the subsystem
maintainer first, right?  Please read over
Documentation/process/development-process.rst for all of the details on
how to do this correctly.

Good luck!

greg k-h

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

* RE: [PATCH] ACPI, APEI, Fix error return value in apei_map_generic_address()
  2020-11-10  9:19 ` Greg KH
@ 2020-11-10  9:42   ` yaoaili [么爱利]
  2020-11-10  9:49     ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: yaoaili [么爱利] @ 2020-11-10  9:42 UTC (permalink / raw)
  To: Greg KH, yaoaili126; +Cc: stable

Sorry for confusing. I am really new to kernel community!
I should just add the tag 'Cc: <stable@vger.kernel.org>' , not really cc to stable@vger.kernel.org
sorry for this!

Best Regards!

Aili Yao

> -----Original Message-----
> From: Greg KH [mailto:gregkh@linuxfoundation.org]
> Sent: Tuesday, November 10, 2020 5:19 PM
> To: yaoaili126@163.com
> Cc: yaoaili <yaoaili@kingsoft.com>; stable@vger.kernel.org
> Subject: Re: [PATCH] ACPI, APEI, Fix error return value in
> apei_map_generic_address()
> 
> On Tue, Nov 10, 2020 at 12:29:42AM -0800, yaoaili126@163.com wrote:
> > From: Aili Yao <yaoaili@kingsoft.com>
> >
> > >From commit 6915564dc5a8 ("ACPI: OSL: Change the type of
> > acpi_os_map_generic_address() return value"),
> > acpi_os_map_generic_address() will return logical address or NULL for
> > error, but for ACPI_ADR_SPACE_SYSTEM_IO case, it should be also return
> > 0, as it's a normal case, but now it will return -ENXIO. so check it
> > out for such case to avoid einj module initialization fail.
> >
> > Fixes: 6915564dc5a8 ("ACPI: OSL: Change the type of
> > acpi_os_map_generic_address() return value")
> > Cc: <stable@vger.kernel.org>
> > Reviewed-by: James Morse <james.morse@arm.com>
> > Tested-by: Tony Luck <tony.luck@intel.com>
> > Signed-off-by: Aili Yao <yaoaili@kingsoft.com>
> > ---
> >  drivers/acpi/apei/apei-base.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> 
> I'm confused as to what you are asking us to do with this patch?  Have you
> read:
>     https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
> for how to do this properly?
> 
> thanks,
> 
> greg k-h

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

* Re: [PATCH] ACPI, APEI, Fix error return value in apei_map_generic_address()
  2020-11-10  8:29 yaoaili126
@ 2020-11-10  9:19 ` Greg KH
  2020-11-10  9:42   ` yaoaili [么爱利]
  0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2020-11-10  9:19 UTC (permalink / raw)
  To: yaoaili126; +Cc: yaoaili, stable

On Tue, Nov 10, 2020 at 12:29:42AM -0800, yaoaili126@163.com wrote:
> From: Aili Yao <yaoaili@kingsoft.com>
> 
> >From commit 6915564dc5a8 ("ACPI: OSL: Change the type of
> acpi_os_map_generic_address() return value"),
> acpi_os_map_generic_address() will return logical address or NULL for
> error, but for ACPI_ADR_SPACE_SYSTEM_IO case, it should be also return 0,
> as it's a normal case, but now it will return -ENXIO. so check it out for
> such case to avoid einj module initialization fail.
> 
> Fixes: 6915564dc5a8 ("ACPI: OSL: Change the type of
> acpi_os_map_generic_address() return value")
> Cc: <stable@vger.kernel.org>
> Reviewed-by: James Morse <james.morse@arm.com>
> Tested-by: Tony Luck <tony.luck@intel.com>
> Signed-off-by: Aili Yao <yaoaili@kingsoft.com>
> ---
>  drivers/acpi/apei/apei-base.c | 4 ++++
>  1 file changed, 4 insertions(+)

I'm confused as to what you are asking us to do with this patch?  Have
you read:
    https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
for how to do this properly?

thanks,

greg k-h

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

* [PATCH] ACPI, APEI, Fix error return value in apei_map_generic_address()
@ 2020-11-10  8:29 yaoaili126
  2020-11-10  9:19 ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: yaoaili126 @ 2020-11-10  8:29 UTC (permalink / raw)
  To: yaoaili; +Cc: stable

From: Aili Yao <yaoaili@kingsoft.com>

From commit 6915564dc5a8 ("ACPI: OSL: Change the type of
acpi_os_map_generic_address() return value"),
acpi_os_map_generic_address() will return logical address or NULL for
error, but for ACPI_ADR_SPACE_SYSTEM_IO case, it should be also return 0,
as it's a normal case, but now it will return -ENXIO. so check it out for
such case to avoid einj module initialization fail.

Fixes: 6915564dc5a8 ("ACPI: OSL: Change the type of
acpi_os_map_generic_address() return value")
Cc: <stable@vger.kernel.org>
Reviewed-by: James Morse <james.morse@arm.com>
Tested-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Aili Yao <yaoaili@kingsoft.com>
---
 drivers/acpi/apei/apei-base.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/acpi/apei/apei-base.c b/drivers/acpi/apei/apei-base.c
index 552fd9f..3294cc8 100644
--- a/drivers/acpi/apei/apei-base.c
+++ b/drivers/acpi/apei/apei-base.c
@@ -633,6 +633,10 @@ int apei_map_generic_address(struct acpi_generic_address *reg)
 	if (rc)
 		return rc;
 
+	/* IO space doesn't need mapping */
+	if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_IO)
+		return 0;
+
 	if (!acpi_os_map_generic_address(reg))
 		return -ENXIO;
 
-- 
2.9.5



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

end of thread, other threads:[~2020-11-16 18:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-10  8:33 [PATCH] ACPI, APEI, Fix error return value in apei_map_generic_address() yaoaili126
2020-11-16 18:30 ` Rafael J. Wysocki
  -- strict thread matches above, loose matches on Subject: below --
2020-11-10  8:29 yaoaili126
2020-11-10  9:19 ` Greg KH
2020-11-10  9:42   ` yaoaili [么爱利]
2020-11-10  9:49     ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.