Hi, On Mon, 23 Nov 2020 at 00:22, Rasmus Villemoes <rasmus.villem...@prevas.dk> wrote: > > On 02/11/2020 19.14, Moshe, Yaniv wrote: > > Hi Simon, > > Hope you're doing good. > > > > My name is Yaniv, and I have a question regarding an old commit in U-boot: > > commit 60e2809a848bccd3a8090d3f2237964670f2780c > > Author: Simon Glass <s...@chromium.org<mailto:s...@chromium.org>> > > Date: Tue Feb 17 15:29:35 2015 -0700 > > > > dm: spi: Avoid setting the speed with every transfer > > > > Only set the speed if it has changed from last time. Since the speed > > will > > be 0 when the device is probed it will always be changed on the first > > transfer after the device is probed. > > > > Signed-off-by: Simon Glass s...@chromium.org<mailto:s...@chromium.org> > > > > > > As far as I understand it, each SPI slave has its own struct. So, when we > > will use the device for the first time, we will set the speed. > > But, if we're jumping between different slaves, the slaves structs were > > already configured at the first time, and since then there won't be any > > future speed setting. > > > > e.g: > > access flash with max-freq = X - > speed set > > access TPM with max-freq =Y -> speed set > > access flash again, slave struct already configured, no change between > > speed and slave->speed, -> speed stay the same as for TPM. > > > > Did I got it wrong? I'm trying to understand what am I missing... > > No, you're reading it the same way I did: > > https://lists.denx.de/pipermail/u-boot/2019-December/393854.html > > I never followed up because I didn't actually have two different spi > devices in play on the board I was working on at the time. But it's > something that really should be fixed.
It is easy enough to add a sandbox test for this I think. Regards, Simon