From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932262AbbGJNR3 (ORCPT ); Fri, 10 Jul 2015 09:17:29 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:41363 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932072AbbGJNRV (ORCPT ); Fri, 10 Jul 2015 09:17:21 -0400 Message-ID: <559FC5D7.3000108@ti.com> Date: Fri, 10 Jul 2015 18:47:11 +0530 From: Vignesh R User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Wolfram Sang , Alexander Sverdlin , Felipe Balbi CC: Tony Lindgren , , , Subject: Re: [RFC PATCH] i2c: busses: i2c-omap: Increase timeout for i2c interrupt References: <1436504994-31137-1-git-send-email-vigneshr@ti.com> <559F8670.2060305@nokia.com> <20150710090909.GF1528@katana> In-Reply-To: <20150710090909.GF1528@katana> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/10/2015 02:39 PM, Wolfram Sang wrote: > >> 60 s sounds way too much and actually I simply don't believe this is >> the root cause. If I take a look into the driver, then I see, that > > I agree, this is just a workaround. > Yes, this is a workaround. I thought this is simpler change and can go into -rc while I work on the better fix. As you can see, the other suggestions need quite a significant change to the isr code. >> the design is not really the best. The whole IRQ handling could be >> actually performed in hard IRQ handler, without threading overhead. >> Putting even 2 bytes in the controller FIFO should not be too heavy >> for the hard IRQ handler. Then these ridiculous spin_lock()s. What >> is the reason behind? The IRQ is flagged with ONESHOT, so thread and >> hardirq handler are anyway mutually excluded. But if this thread >> ever runs longer than it's allowed in IRQ context, then it anyway >> produces this IRQ latency because it locks spin_lock_irqsave() for >> the whole time! So the whole point of threaded interrupt is missing. > > Furthermore, this combination of threaded_irq and struct completion seems > bogus to me. If you just want to ensure the irq happened before timeout, > you just complete when the irq happened and do the "bottom half" after the > completion returned? This sounds good to me. I will try to implement this option. Thanks for the suggestion. > >> I would propose you to throw away spinlocks. Convert threaded IRQ to >> just one hardirq handler. And continue debugging. You will reduce the >> load of the system with the above measures, maybe it will not happen >> any more, maybe you'll figure out that problem is somewhere else. > > Or this. I am not convinced with moving entire code at hardirq context. I believe its better to keep hardirq as small as possible. -- Regards Vignesh