From: Jarkko Nikula <jarkko.nikula@linux.intel.com>
To: Xiangliang Yu <Xiangliang.Yu@amd.com>,
andriy.shevchenko@linux.intel.com,
mika.westerberg@linux.intel.com, wsa@the-dreams.de,
linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: SPG_Linux_Kernel@amd.com
Subject: Re: [PATCH v2] I2C: designware: fix IO timeout issue for AMD controller
Date: Fri, 11 Dec 2015 10:42:30 +0200 [thread overview]
Message-ID: <566A8C76.9080104@linux.intel.com> (raw)
In-Reply-To: <1449835373-4669-1-git-send-email-Xiangliang.Yu@amd.com>
On 12/11/2015 02:02 PM, Xiangliang Yu wrote:
> Because of some hardware limitation, AMD I2C controller can't
> trigger pending interrupt if interrupt status has been changed
> after clearing interrupt status bits. Then, I2C will lost
> interrupt and IO timeout.
>
> According to hardware design, this patch implements a workaround
> to disable i2c controller interrupt and re-enable i2c interrupt
> before exiting ISR.
>
> To reduce the performance impacts on other vendors, use unlikely
> function to check flag in ISR.
> ---
> Changes in v2:
> - pass flags with ->driver_data
> - unmask interrupt right after masking
>
> Signed-off-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
> ---
> drivers/i2c/busses/i2c-designware-core.c | 6 ++++++
> drivers/i2c/busses/i2c-designware-core.h | 1 +
> drivers/i2c/busses/i2c-designware-platdrv.c | 7 ++++++-
> 3 files changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/i2c/busses/i2c-designware-core.c b/drivers/i2c/busses/i2c-designware-core.c
> index 8c48b27..de7fbbb 100644
> --- a/drivers/i2c/busses/i2c-designware-core.c
> +++ b/drivers/i2c/busses/i2c-designware-core.c
> @@ -813,6 +813,12 @@ static irqreturn_t i2c_dw_isr(int this_irq, void *dev_id)
> tx_aborted:
> if ((stat & (DW_IC_INTR_TX_ABRT | DW_IC_INTR_STOP_DET)) || dev->msg_err)
> complete(&dev->cmd_complete);
> + else if (unlikely(dev->accessor_flags & ACCESS_INTR_MASK)) {
> + /* workaround to trigger pending interrupt */
> + stat = dw_readl(dev, DW_IC_INTR_MASK);
> + i2c_dw_disable_int(dev);
> + dw_writel(dev, stat, DW_IC_INTR_MASK);
> + }
>
Looks ok to me.
Acked-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
next prev parent reply other threads:[~2015-12-11 8:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-11 12:02 [PATCH v2] I2C: designware: fix IO timeout issue for AMD controller Xiangliang Yu
2015-12-11 8:42 ` Jarkko Nikula [this message]
2015-12-12 17:03 ` Wolfram Sang
2015-12-13 12:01 ` Yu, Xiangliang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=566A8C76.9080104@linux.intel.com \
--to=jarkko.nikula@linux.intel.com \
--cc=SPG_Linux_Kernel@amd.com \
--cc=Xiangliang.Yu@amd.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=wsa@the-dreams.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).