From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Roese Date: Thu, 2 May 2019 11:40:09 +0200 Subject: [U-Boot] [PATCH u-boot-marvell v2.1 15/15] i2c: mvtwsi: fix reading status register after interrupt In-Reply-To: <20190502113610.2ddd9664@nic.cz> References: <20190501210901.10245-1-marek.behun@nic.cz> <6a6a2995-60a2-10db-57e9-cf86386606a0@denx.de> <20190502113610.2ddd9664@nic.cz> Message-ID: <6ae935c9-f3ad-cd58-e4b0-b928f59065e0@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 02.05.19 11:36, Marek Behun wrote: >> This still looks a bit strange. Looking at the Linux driver, there >> is no delay after reading the control register. But its using >> interrupts and therefore an implicit delay is added before this >> interrupt service routine is called (instead of the busy loop here >> in the U-Boot driver). > > Exactly my opinion as well. > >> BTW: Whats the value of "tick" in twsi_wait() in your case? > > requested I2C freq is 100000 Hz, actual 97656 Hz (nearest lower > possible). This calculates the tick to 10340 ns with calc_tick, and > u-boot sleeps for 11 ms (DIV_ROUND_UP). > > When tick was 10 ms this bug did not occur, because of the different > timing when the control value was read it already was set for a while > by the controller, it seems. > > Btw should I sent these first 14 patches with Reviewed-by tags? No need for that, thanks. Patchwork will pick up the tags automatically. Next time, please switch to v3 instead of v2.1 though. Thanks, Stefan