[Skiboot] [PATCH 2/5] external/common: arm: Don't error trying to wrprotect with MTD access

Joel Stanley joel at jms.id.au
Fri Oct 21 20:26:40 AEDT 2016


On Fri, Oct 21, 2016 at 7:22 PM, Cyril Bur <cyril.bur at au1.ibm.com> wrote:
> If the access method to the flash is PNOR_MTD or BMC_MTD then the
> actual access is being done for us by the kernel. This means we don't
> need to worry about wrprotecting. The arch level shouldn't be returning
> an error, it should be fall though.

I assume this passes all of the use cases (and tests)?
>
> Signed-off-by: Cyril Bur <cyril.bur at au1.ibm.com>

Acked-by: Joel Stanley <joel at jms.id.au>

> ---
> Hi Stewart,
>
> So this is the 'bug' I mentioned we may want to backport. OpenBMC are
> going to want patch 5/5 of this series so they'll get this for free, I
> don't see the point of backporting it for them. I don't know of anyone
> else building this code from stable releases.

We'd prefer a new tag based on the current state of play than backports.

>
>
>  external/common/arch_flash_arm.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/external/common/arch_flash_arm.c b/external/common/arch_flash_arm.c
> index 4e71dd9..0776436 100644
> --- a/external/common/arch_flash_arm.c
> +++ b/external/common/arch_flash_arm.c
> @@ -324,6 +324,9 @@ int arch_flash_set_wrprotect(struct blocklevel_device *bl, int set)
>         if (!arch_data.init_bl || arch_data.init_bl != bl)
>                 return -1;
>
> +       if (arch_data.access == PNOR_MTD || arch_data.access == BMC_MTD)
> +               return 0; /* Kernel looks after this for us */
> +
>         if (!arch_data.flash_chip)
>                 return -1;
>
> --
> 2.10.0
>


More information about the Skiboot mailing list