lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACPK8XfrF2h0zYNPcFwHmGfyohCOYQziqoUAJ6j60bEonFHu0A@mail.gmail.com>
Date:   Sun, 16 Oct 2022 22:43:30 +0000
From:   Joel Stanley <joel@....id.au>
To:     Cédric Le Goater <clg@...d.org>
Cc:     linux-spi@...r.kernel.org, Mark Brown <broonie@...nel.org>,
        linux-aspeed@...ts.ozlabs.org, openbmc@...ts.ozlabs.org,
        Andrew Jeffery <andrew@...id.au>,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        Chin-Ting Kuo <chin-ting_kuo@...eedtech.com>
Subject: Re: [PATCH] spi: aspeed: Fix window offset of CE1

On Sun, 16 Oct 2022 at 15:57, Cédric Le Goater <clg@...d.org> wrote:
>
> The offset value of the mapping window in the kernel structure is
> calculated using the value of the previous window offset. This doesn't
> reflect how the HW is configured and can lead to erroneous setting of
> the second flash device (CE1).

So .offset is expected to be the absolute address of the window, and
this was okay for the 2400/2500 but was broken on the 2600?

Reviewed-by: Joel Stanley <joel@....id.au>


>
> Cc: Chin-Ting Kuo <chin-ting_kuo@...eedtech.com>
> Fixes: e3228ed92893 ("spi: spi-mem: Convert Aspeed SMC driver to spi-mem")
> Signed-off-by: Cédric Le Goater <clg@...d.org>
> ---
>  drivers/spi/spi-aspeed-smc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/spi/spi-aspeed-smc.c b/drivers/spi/spi-aspeed-smc.c
> index 33cefcf18392..b90571396a60 100644
> --- a/drivers/spi/spi-aspeed-smc.c
> +++ b/drivers/spi/spi-aspeed-smc.c
> @@ -398,7 +398,7 @@ static void aspeed_spi_get_windows(struct aspeed_spi *aspi,
>                 windows[cs].cs = cs;
>                 windows[cs].size = data->segment_end(aspi, reg_val) -
>                         data->segment_start(aspi, reg_val);
> -               windows[cs].offset = cs ? windows[cs - 1].offset + windows[cs - 1].size : 0;
> +               windows[cs].offset = data->segment_start(aspi, reg_val) - aspi->ahb_base_phy;
>                 dev_vdbg(aspi->dev, "CE%d offset=0x%.8x size=0x%x\n", cs,
>                          windows[cs].offset, windows[cs].size);
>         }
> --
> 2.37.3
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ