[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20200522143639.GG1634618@smile.fi.intel.com>
Date: Fri, 22 May 2020 17:36:39 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Serge Semin <Sergey.Semin@...kalelectronics.ru>
Cc: Mark Brown <broonie@...nel.org>,
Linus Walleij <linus.walleij@...ricsson.com>,
Vinod Koul <vkoul@...nel.org>, Feng Tang <feng.tang@...el.com>,
Grant Likely <grant.likely@...retlab.ca>,
Alan Cox <alan@...ux.intel.com>,
Georgy Vlasov <Georgy.Vlasov@...kalelectronics.ru>,
Ramil Zaripov <Ramil.Zaripov@...kalelectronics.ru>,
Alexey Malahov <Alexey.Malahov@...kalelectronics.ru>,
Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
Paul Burton <paulburton@...nel.org>,
Ralf Baechle <ralf@...ux-mips.org>,
Arnd Bergmann <arnd@...db.de>,
Rob Herring <robh+dt@...nel.org>, linux-mips@...r.kernel.org,
devicetree@...r.kernel.org,
Wan Ahmad Zainie <wan.ahmad.zainie.wan.mohamad@...el.com>,
Thomas Gleixner <tglx@...utronix.de>,
Jarkko Nikula <jarkko.nikula@...ux.intel.com>,
"wuxu.wu" <wuxu.wu@...wei.com>, Clement Leger <cleger@...ray.eu>,
Linus Walleij <linus.walleij@...aro.org>,
linux-spi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 01/16] spi: dw: Add Tx/Rx finish wait methods to the
MID DMA
On Fri, May 22, 2020 at 05:00:25PM +0300, Serge Semin wrote:
> On Fri, May 22, 2020 at 04:27:43PM +0300, Serge Semin wrote:
> > On Fri, May 22, 2020 at 02:10:13PM +0100, Mark Brown wrote:
> > > On Fri, May 22, 2020 at 03:44:06PM +0300, Serge Semin wrote:
> > > > On Fri, May 22, 2020 at 03:34:27PM +0300, Andy Shevchenko wrote:
...
> > > > > > Realistically it seems unlikely that the clock will be even as slow as
> > > > > > double digit kHz though, and if we do I'd not be surprised to see other
> > > > > > problems kicking in. It's definitely good to handle such things if we
> > > > > > can but so long as everything is OK for realistic use cases I'm not sure
> > > > > > it should be a blocker.
> > >
> > > > As I see it the only way to fix the problem for any use-case is to move the
> > > > busy-wait loop out from the tasklet's callback, add a completion variable to the
> > > > DW SPI data and wait for all the DMA transfers completion in the
> > > > dw_spi_dma_transfer() method. Then execute both busy-wait loops (there we can
> > > > use spi_delay_exec() since it's a work-thread) and call
> > > > spi_finalize_current_transfer() after it. What do you think?
> > >
> > > I'm concerned that this will add latency for the common case to handle a
> > > potential issue for unrealistically slow buses but yeah, if it's an
> > > issue kicking up to task context is how you'd handle it.
> >
> > I am not that worried about the latency (most likely it'll be the same as
> > before), but I am mostly concerned regarding a most likely need to re-implement
> > a local version spi_transfer_wait(). We can't afford wait for the completion
> > indefinitely here, so the wait_for_completion_timeout() should be used, for which
> > I would have to calculate a decent timeout based on the transfer capabilities,
> > etc. So basically it would mean to partly copy the spi_transfer_wait() to this
> > module.(
>
> I'd also wait for Andy's suggestion regarding this, since he's been worried
> about the delay length in the first place. So he may come up with a better
> solution in this regard.
The completion approach sounds quite heavy to me.
Since we haven't got any report for such an issue, I prefer as simplest as
possible approach.
If we add might_sleep() wouldn't it be basically reimplementation of the
spi_delay_exec() again?
And second question, do you experience this warning on your system?
My point is: let's warn and see if anybody comes with a bug report. We will
solve an issue when it appears.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists