From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Behun Date: Thu, 2 May 2019 11:36:10 +0200 Subject: [U-Boot] [PATCH u-boot-marvell v2.1 15/15] i2c: mvtwsi: fix reading status register after interrupt In-Reply-To: <6a6a2995-60a2-10db-57e9-cf86386606a0@denx.de> References: <20190501210901.10245-1-marek.behun@nic.cz> <6a6a2995-60a2-10db-57e9-cf86386606a0@denx.de> Message-ID: <20190502113610.2ddd9664@nic.cz> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de > 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? Marek