[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200921112125.GI3950626@ulmo>
Date: Mon, 21 Sep 2020 13:21:25 +0200
From: Thierry Reding <thierry.reding@...il.com>
To: Dmitry Osipenko <digetx@...il.com>
Cc: Jonathan Hunter <jonathanh@...dia.com>,
Laxman Dewangan <ldewangan@...dia.com>,
Wolfram Sang <wsa@...-dreams.de>,
Michał Mirosław <mirq-linux@...e.qmqm.pl>,
Andy Shevchenko <andy.shevchenko@...il.com>,
linux-i2c@...r.kernel.org, linux-tegra@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v7 21/34] i2c: tegra: Don't fall back to PIO mode if DMA
configuration fails
On Thu, Sep 17, 2020 at 06:03:04PM +0300, Dmitry Osipenko wrote:
> 17.09.2020 14:47, Thierry Reding пишет:
> > On Wed, Sep 09, 2020 at 01:39:53AM +0300, Dmitry Osipenko wrote:
> >> The DMA code path has been tested well enough and the DMA configuration
> >> performed by tegra_i2c_config_fifo_trig() shouldn't ever fail in practice.
> >> Hence let's remove the obscure transfer-mode switching in order to have a
> >> cleaner and simpler code. Now I2C transfer will be failed if DMA
> >> configuration fails.
> >>
> >> Signed-off-by: Dmitry Osipenko <digetx@...il.com>
> >> ---
> >> drivers/i2c/busses/i2c-tegra.c | 18 ++++++++++--------
> >> 1 file changed, 10 insertions(+), 8 deletions(-)
> >
> > I'm not sure that's a good idea. It's always possible that the DMA setup
> > is going to break because of something that's not related to the I2C
> > driver itself. Having the system completely break instead of falling
> > back to PIO mode seems like it would only complicate troubleshooting any
> > such issues.
>
> That code has zero test coverage because this problem never happens in
> practice, hence it should be better to have it removed. We may consider
> re-adding it back if there will be a real-world incident, okay?
Again, I think throwing out fallbacks and error messages out the window
just because they "don't happen in practice" is misguided. Just because
they don't *usually* happen doesn't mean they can't happen. And in case
they do happen we absolutely do want some way of dealing with it rather
than just have the driver stop working without any explanation.
Thierry
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists