Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1033038AbbKFI7k (ORCPT ); Fri, 6 Nov 2015 03:59:40 -0500 Received: from mga09.intel.com ([134.134.136.24]:64273 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1032020AbbKFI7j (ORCPT ); Fri, 6 Nov 2015 03:59:39 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,251,1444719600"; d="scan'208";a="595086358" Message-ID: <563C6BF7.3080406@linux.intel.com> Date: Fri, 06 Nov 2015 10:59:35 +0200 From: Jarkko Nikula User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.7.0 MIME-Version: 1.0 To: "Yu, Xiangliang" , Mika Westerberg CC: "andriy.shevchenko@linux.intel.com" , "wsa@the-dreams.de" , "linux-i2c@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Xue, Ken" , "Wan, Vincent" , "Huang, Ray" , "Wang, Annie" , "Li, Tony" Subject: Re: [PATCH 1/1] I2C: designware: fix IO timeout issue for AMD controller References: <1446726884-30558-1-git-send-email-Xiangliang.Yu@amd.com> <20151105135216.GN1509@lahna.fi.intel.com> <1C99EED8F51BBC41A8F1E645B51245F41AE8AA50@scybexdag03.amd.com> In-Reply-To: <1C99EED8F51BBC41A8F1E645B51245F41AE8AA50@scybexdag03.amd.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1431 Lines: 32 On 06.11.2015 06:34, Yu, Xiangliang wrote: >> -----Original Message----- >> From: Mika Westerberg [mailto:mika.westerberg@linux.intel.com] >>> --- a/drivers/i2c/busses/i2c-designware-core.c >>> +++ b/drivers/i2c/busses/i2c-designware-core.c >>> @@ -783,6 +783,9 @@ irqreturn_t i2c_dw_isr(int this_irq, void *dev_id) >>> >>> stat = i2c_dw_read_clear_intrbits(dev); >> >> What if the status changes right here, before you go and mask the interrupt? > Have no effect, because i2c controller can't trigger next interrupt. > Does it mean possible lost interrupt too? I guess it can be debugged by placing a few ms long mdelay() between clearing and masking. How frequent is this timeout? I guess lost interrupt is somehow nearly related to clearing, masking and unmasking if that cycle helps. One thing that comes to my mind is masking needed and could plain unmasking be also a working workaround? Have you tried to print DW_IC_INTR_STAT, DW_IC_INTR_MASK and DW_IC_RAW_INTR_STAT when timeout occurs? E.g. just after printing the timeout out error in i2c_dw_xfer(). Probably good in i2c_dw_isr() too if if doesn't produce too much data and make debugging impossible. -- Jarkko -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/