On Tue, Mar 19, 2019 at 6:26 PM Lubomir Rintel <lkundrak@xxxxx> wrote: > On Tue, 2019-03-19 at 15:48 +0200, Andy Shevchenko wrote: > > On Tue, Mar 19, 2019 at 3:23 PM Lubomir Rintel <lkundrak@xxxxx> wrote: > > > On Tue, 2019-03-19 at 11:34 +0200, Andy Shevchenko wrote: > > > > Hmm... Shouldn't be enough to do this in ->setup() or even in > > > > ->probe() / ->resume()? > > > > > > I can't see how, though. As far as I can tell there's no way to just > > > dump bytes from the TXFIFO. In slave mode they just stay there until > > > the master initiates a transfer. The only solution I can think of is to > > > avoid pushing more data there until we're in sync. > > > > On ->probe() always start as a master in case of this hardware, drain > > FIFO, switch to slave. > > Would that work? > > It sounds like it would. > > Do you object how this is currently done solely because it's ugly? Nope, my main concern that for every message we will have very particular check which, for example on our platforms, always would be fail. If SPI speed is high enough and processor is slow (talking about Intel Galileo here), it might affect performance (rather not, but still). > Because perhaps it could be done away with completely and dealt with in > firmware (see the original commit message). The firmware already needs > heavy patching [1] to bring Linux up; maybe one more patch could be > tolerable. I see. Since this patch is applied anyway, consider my message as a suggestion to improve. -- With Best Regards, Andy Shevchenko