[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHp75VeVvJhkz2b5SVwaKFzGUtiRiqcKnCDXxcQhV6ke3pyzLA@mail.gmail.com>
Date: Tue, 14 Aug 2018 15:50:40 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: "Jonas Mark (BT-FIR/ENG1)" <Mark.Jonas@...bosch.com>
Cc: Bartosz Golaszewski <brgl@...ev.pl>, Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-i2c <linux-i2c@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
"WANG Xin (BT-FIR/ENG1-Zhu)" <Xin.Wang7@...bosch.com>
Subject: Re: [PATCH] eeprom: at24: Fix unexpected timeout under high load
On Mon, Aug 6, 2018 at 2:39 PM, Jonas Mark (BT-FIR/ENG1)
<Mark.Jonas@...bosch.com> wrote:
> tout = jiffies + msecs_to_jiffies(at24_write_timeout);
> do {
> read_time = jiffies;
>
> ret = regmap_bulk_read(regmap, offset, buf, count);
> dev_dbg(&client->dev, "read %zu@%d --> %d (%ld)\n",
> count, offset, ret, jiffies);
> if (!ret)
> return count;
>
> usleep_range(1000, 1500);
> } while (!time_before(tout, read_time))
>
> The advantage of this code is that the usleep_range() is unconditional.
> The disadvantage of the new proposal is that in case of a timeout one
> more unnecessary sleep is made. Is that acceptable?
Yes.
> An alternative would be to duplicate the regmap_bulk_read() and the
> debugging code outside the loop.
> Is this preferable?
No.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists