[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <957928b1-0b74-f263-b699-5a83db77df62@gmail.com>
Date: Thu, 3 Sep 2020 16:49:02 +0300
From: Dmitry Osipenko <digetx@...il.com>
To: Andy Shevchenko <andy.shevchenko@...il.com>
Cc: Thierry Reding <thierry.reding@...il.com>,
Jonathan Hunter <jonathanh@...dia.com>,
Laxman Dewangan <ldewangan@...dia.com>,
Wolfram Sang <wsa@...-dreams.de>,
Michał Mirosław <mirq-linux@...e.qmqm.pl>,
linux-i2c <linux-i2c@...r.kernel.org>,
linux-tegra@...r.kernel.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3 01/22] i2c: tegra: Make tegra_i2c_flush_fifos() usable
in atomic transfer
03.09.2020 14:02, Andy Shevchenko пишет:
> On Thu, Sep 3, 2020 at 3:53 AM Dmitry Osipenko <digetx@...il.com> wrote:
>>
>> The tegra_i2c_flush_fifos() shouldn't sleep in atomic transfer and jiffies
>> are not updating if interrupts are disabled. Hence let's use proper delay
>> functions and use ktime API in order not to hang atomic transfer. Note
>> that this patch doesn't fix any known problem because normally FIFO is
>> flushed at the time of starting a new transfer.
>
>> + /*
>> + * ktime_get() may take up to couple milliseconds in a worst case
>> + * and normally FIFOs are flushed, hence let's check the state before
>> + * proceeding to polling.
>> + */
>
> Everything, including above can be done by using macros from iopoll.h. Why not?
Perhaps indeed it should be possible to use the common macros, at least
I can't recall why I chose not to use them. Maybe because it appeared to
me that the current variant is a bit nicer than:
if (atomic)
read_poll_atomic()
else
read_poll()
I'll consider to use the common iopoll macros in v4, thanks!
Powered by blists - more mailing lists