* [PATCH] powerpc/powernv/flash: Check OPAL flash calls exist before using
@ 2021-09-14 10:16 Vasant Hegde
2021-09-15 6:23 ` Michael Ellerman
2022-05-24 11:09 ` Michael Ellerman
0 siblings, 2 replies; 5+ messages in thread
From: Vasant Hegde @ 2021-09-14 10:16 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Vasant Hegde
Currently only FSP based powernv systems supports firmware update
interfaces. Hence check that the token OPAL_FLASH_VALIDATE exists
before initalising the flash driver.
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
---
arch/powerpc/platforms/powernv/opal-flash.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/powerpc/platforms/powernv/opal-flash.c b/arch/powerpc/platforms/powernv/opal-flash.c
index 7e7d38b17420..05490fc22fae 100644
--- a/arch/powerpc/platforms/powernv/opal-flash.c
+++ b/arch/powerpc/platforms/powernv/opal-flash.c
@@ -520,6 +520,10 @@ void __init opal_flash_update_init(void)
{
int ret;
+ /* Firmware update is not supported by firmware */
+ if (!opal_check_token(OPAL_FLASH_VALIDATE))
+ return;
+
/* Allocate validate image buffer */
validate_flash_data.buf = kzalloc(VALIDATE_BUF_SIZE, GFP_KERNEL);
if (!validate_flash_data.buf) {
--
2.31.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] powerpc/powernv/flash: Check OPAL flash calls exist before using
2021-09-14 10:16 [PATCH] powerpc/powernv/flash: Check OPAL flash calls exist before using Vasant Hegde
@ 2021-09-15 6:23 ` Michael Ellerman
2021-09-15 6:55 ` Vasant Hegde
2021-09-15 6:55 ` Vasant Hegde
2022-05-24 11:09 ` Michael Ellerman
1 sibling, 2 replies; 5+ messages in thread
From: Michael Ellerman @ 2021-09-15 6:23 UTC (permalink / raw)
To: Vasant Hegde, linuxppc-dev; +Cc: Vasant Hegde
Vasant Hegde <hegdevasant@linux.vnet.ibm.com> writes:
> Currently only FSP based powernv systems supports firmware update
> interfaces. Hence check that the token OPAL_FLASH_VALIDATE exists
> before initalising the flash driver.
>
> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
> ---
> arch/powerpc/platforms/powernv/opal-flash.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/arch/powerpc/platforms/powernv/opal-flash.c b/arch/powerpc/platforms/powernv/opal-flash.c
> index 7e7d38b17420..05490fc22fae 100644
> --- a/arch/powerpc/platforms/powernv/opal-flash.c
> +++ b/arch/powerpc/platforms/powernv/opal-flash.c
> @@ -520,6 +520,10 @@ void __init opal_flash_update_init(void)
> {
> int ret;
>
> + /* Firmware update is not supported by firmware */
> + if (!opal_check_token(OPAL_FLASH_VALIDATE))
> + return;
> +
That will mean the following files no longer appear on BMC systems:
/sys/firmware/opal/image
/sys/firmware/opal/validate_flash
/sys/firmware/opal/manage_flash
/sys/firmware/opal/update_flash
Presumably those files don't actually work correctly, but are we sure
their mere existence isn't used by anything at all?
We've had trouble in the past where removing sysfs files breaks tools
unexpectedly, see smt_snooze_delay.
cheers
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] powerpc/powernv/flash: Check OPAL flash calls exist before using
2021-09-15 6:23 ` Michael Ellerman
@ 2021-09-15 6:55 ` Vasant Hegde
2021-09-15 6:55 ` Vasant Hegde
1 sibling, 0 replies; 5+ messages in thread
From: Vasant Hegde @ 2021-09-15 6:55 UTC (permalink / raw)
To: Michael Ellerman, linuxppc-dev
On 9/15/21 11:53 AM, Michael Ellerman wrote:
> Vasant Hegde <hegdevasant@linux.vnet.ibm.com> writes:
>> Currently only FSP based powernv systems supports firmware update
>> interfaces. Hence check that the token OPAL_FLASH_VALIDATE exists
>> before initalising the flash driver.
>>
>> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
>> ---
>> arch/powerpc/platforms/powernv/opal-flash.c | 4 ++++
>> 1 file changed, 4 insertions(+)
>>
>> diff --git a/arch/powerpc/platforms/powernv/opal-flash.c b/arch/powerpc/platforms/powernv/opal-flash.c
>> index 7e7d38b17420..05490fc22fae 100644
>> --- a/arch/powerpc/platforms/powernv/opal-flash.c
>> +++ b/arch/powerpc/platforms/powernv/opal-flash.c
>> @@ -520,6 +520,10 @@ void __init opal_flash_update_init(void)
>> {
>> int ret;
>>
>> + /* Firmware update is not supported by firmware */
>> + if (!opal_check_token(OPAL_FLASH_VALIDATE))
>> + return;
>> +
>
Michael,
> That will mean the following files no longer appear on BMC systems:
>
> /sys/firmware/opal/image
> /sys/firmware/opal/validate_flash
> /sys/firmware/opal/manage_flash
> /sys/firmware/opal/update_flash
>
> Presumably those files don't actually work correctly, but are we sure
> their mere existence isn't used by anything at all?
That's correct. We never used these files/interfaces on BMC based systems.
>
> We've had trouble in the past where removing sysfs files breaks tools
> unexpectedly, see smt_snooze_delay.
AFAIK only update_flash uses these interfaces on baremetal systems.
This change shouldn't break update_flash as these interfaces never used/worked
on BMC based powernv systems.
-Vasant
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] powerpc/powernv/flash: Check OPAL flash calls exist before using
2021-09-15 6:23 ` Michael Ellerman
2021-09-15 6:55 ` Vasant Hegde
@ 2021-09-15 6:55 ` Vasant Hegde
1 sibling, 0 replies; 5+ messages in thread
From: Vasant Hegde @ 2021-09-15 6:55 UTC (permalink / raw)
To: Michael Ellerman, linuxppc-dev
On 9/15/21 11:53 AM, Michael Ellerman wrote:
> Vasant Hegde <hegdevasant@linux.vnet.ibm.com> writes:
>> Currently only FSP based powernv systems supports firmware update
>> interfaces. Hence check that the token OPAL_FLASH_VALIDATE exists
>> before initalising the flash driver.
>>
>> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
>> ---
>> arch/powerpc/platforms/powernv/opal-flash.c | 4 ++++
>> 1 file changed, 4 insertions(+)
>>
>> diff --git a/arch/powerpc/platforms/powernv/opal-flash.c b/arch/powerpc/platforms/powernv/opal-flash.c
>> index 7e7d38b17420..05490fc22fae 100644
>> --- a/arch/powerpc/platforms/powernv/opal-flash.c
>> +++ b/arch/powerpc/platforms/powernv/opal-flash.c
>> @@ -520,6 +520,10 @@ void __init opal_flash_update_init(void)
>> {
>> int ret;
>>
>> + /* Firmware update is not supported by firmware */
>> + if (!opal_check_token(OPAL_FLASH_VALIDATE))
>> + return;
>> +
>
Michael,
> That will mean the following files no longer appear on BMC systems:
>
> /sys/firmware/opal/image
> /sys/firmware/opal/validate_flash
> /sys/firmware/opal/manage_flash
> /sys/firmware/opal/update_flash
>
> Presumably those files don't actually work correctly, but are we sure
> their mere existence isn't used by anything at all?
That's correct. We never used these files/interfaces on BMC based systems.
>
> We've had trouble in the past where removing sysfs files breaks tools
> unexpectedly, see smt_snooze_delay.
AFAIK only update_flash uses these interfaces on baremetal systems.
This change shouldn't break update_flash as these interfaces never used/worked
on BMC based powernv systems.
-Vasant
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] powerpc/powernv/flash: Check OPAL flash calls exist before using
2021-09-14 10:16 [PATCH] powerpc/powernv/flash: Check OPAL flash calls exist before using Vasant Hegde
2021-09-15 6:23 ` Michael Ellerman
@ 2022-05-24 11:09 ` Michael Ellerman
1 sibling, 0 replies; 5+ messages in thread
From: Michael Ellerman @ 2022-05-24 11:09 UTC (permalink / raw)
To: Vasant Hegde, linuxppc-dev
On Tue, 14 Sep 2021 15:46:30 +0530, Vasant Hegde wrote:
> Currently only FSP based powernv systems supports firmware update
> interfaces. Hence check that the token OPAL_FLASH_VALIDATE exists
> before initalising the flash driver.
>
>
Applied to powerpc/next.
[1/1] powerpc/powernv/flash: Check OPAL flash calls exist before using
https://git.kernel.org/powerpc/c/25e69962efdbbbd8bf52e6b4d7852c49717923a2
cheers
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-05-24 11:21 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-14 10:16 [PATCH] powerpc/powernv/flash: Check OPAL flash calls exist before using Vasant Hegde
2021-09-15 6:23 ` Michael Ellerman
2021-09-15 6:55 ` Vasant Hegde
2021-09-15 6:55 ` Vasant Hegde
2022-05-24 11:09 ` Michael Ellerman
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.