From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Grygorii.Strashko-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org" Subject: Re: [PATCH v2] i2c: davinci: Refactor i2c_davinci_wait_bus_not_busy() Date: Thu, 14 May 2015 14:19:00 +0300 Message-ID: <555484A4.9090109@linaro.org> References: <55534BA0.3000506@nokia.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <55534BA0.3000506-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org> Sender: linux-i2c-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Alexander Sverdlin , linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Wolfram Sang , Kevin Hilman , Sekhar Nori , Santosh Shilimkar , "Vishwanathrao Badarkhe, Manish" , Murali Karicheri Cc: Lawnick Michael 61283229 , Mike Looijmans , Mastalski Bartosz List-Id: linux-i2c@vger.kernel.org On 05/13/2015 04:03 PM, Alexander Sverdlin wrote: > There are several problems in the function: > - "to_cnt" variable does nothing > - schedule_timeout() call without setting current state does nothing > - "allow_sleep" parameter is not really used > > Refactor the function so that it really tries to wait. In case of timeout try > to recover the bus. Reviewed-by: Grygorii Strashko > Signed-off-by: Alexander Sverdlin > --- > Changes in v2: > - rebased on 110bc76729d4 of Linus's tree; > > drivers/i2c/busses/i2c-davinci.c | 42 +++++++++++++++++-------------------- > 1 files changed, 19 insertions(+), 23 deletions(-) -- regards, -grygorii