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: <06f8339c-4be1-159f-9374-ef8e6031da1e@kontron.de>
Date:   Tue, 15 Nov 2022 18:14:38 +0100
From:   Frieder Schrempf <frieder.schrempf@...tron.de>
To:     Marc Kleine-Budde <mkl@...gutronix.de>,
        Frieder Schrempf <frieder@...s.de>
Cc:     David Jander <david@...tonic.nl>,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        linux-spi@...r.kernel.org, Mark Brown <broonie@...nel.org>,
        Sascha Hauer <s.hauer@...gutronix.de>,
        Shawn Guo <shawnguo@...nel.org>, Marek Vasut <marex@...x.de>,
        NXP Linux Team <linux-imx@....com>, stable@...r.kernel.org,
        Pengutronix Kernel Team <kernel@...gutronix.de>,
        Baruch Siach <baruch.siach@...lu.com>,
        Fabio Estevam <festevam@...il.com>,
        Minghao Chi <chi.minghao@....com.cn>
Subject: Re: [PATCH v2] spi: spi-imx: Fix spi_bus_clk if requested clock is
 higher than input clock

On 15.11.22 17:54, Marc Kleine-Budde wrote:
> On 15.11.2022 17:26:53, Frieder Schrempf wrote:
>> From: Frieder Schrempf <frieder.schrempf@...tron.de>
>>
>> In case the requested bus clock is higher than the input clock, the correct
>> dividers (pre = 0, post = 0) are returned from mx51_ecspi_clkdiv(), but
>> *fres is left uninitialized and therefore contains an arbitrary value.
>>
>> This causes trouble for the recently introduced PIO polling feature as the
>> value in spi_imx->spi_bus_clk is used there to calculate for which
>> transfers to enable PIO polling.
>>
>> Fix this by setting *fres even if no clock dividers are in use.
>>
>> This issue was observed on Kontron BL i.MX8MM with an SPI peripheral clock set
>> to 50 MHz by default and a requested SPI bus clock of 80 MHz for the SPI NOR
>> flash.
>>
>> With the fix applied the debug message from mx51_ecspi_clkdiv() now prints the
>> following:
>>
>> spi_imx 30820000.spi: mx51_ecspi_clkdiv: fin: 50000000, fspi: 50000000,
>> post: 0, pre: 0
>>
>> Fixes: 07e759387788 ("spi: spi-imx: add PIO polling support")

You want me to remove this tag?

> The *fres parameter was introduced in:
> 
> | Fixes: 6fd8b8503a0d ("spi: spi-imx: Fix out-of-order CS/SCLK operation at low speeds")

and instead add back this tag? I wasn't really sure about that.

> 
> The exiting code:
> 
> |	if (unlikely(fspi > fin))
> |		return 0;
> 
> was not sufficient any more and should be fixed.

You want me to add this in the description? Or is this just the
explanation for why 6fd8b8503a0d should be in the Fixes tag?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ