linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: wsa@the-dreams.de (Wolfram Sang)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/4] i2c: cadence: Set the hardware time-out register to maximum value
Date: Wed, 3 Dec 2014 12:28:30 +0100	[thread overview]
Message-ID: <20141203112830.GD1039@katana> (raw)
In-Reply-To: <1417514749-24319-3-git-send-email-harinik@xilinx.com>

On Tue, Dec 02, 2014 at 03:35:47PM +0530, Harini Katakam wrote:
> From: Vishnu Motghare <vishnum@xilinx.com>
> 
> Cadence I2C controller has bug wherein it generates invalid read transactions
> after time-out in master receiver mode. This driver does not use the HW
> timeout and this interrupt is disabled but the feature itself cannot be
> disabled. Hence, this patch writes the maximum value (0xFF) to this register.
> This is one of the workarounds to this bug and it will not avoid the issue
> completely but reduce the chances of error.

This is a good description and should be in a comment in the driver.

> 
> Signed-off-by: Vishnu Motghare <vishnum@xilinx.com>
> Signed-off-by: Harini Katakam <harinik@xilinx.com>
> ---
>  drivers/i2c/busses/i2c-cadence.c |    4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/i2c/busses/i2c-cadence.c b/drivers/i2c/busses/i2c-cadence.c
> index e54899e..8065205 100644
> --- a/drivers/i2c/busses/i2c-cadence.c
> +++ b/drivers/i2c/busses/i2c-cadence.c
> @@ -111,6 +111,8 @@
>  #define CDNS_I2C_DIVA_MAX	4
>  #define CDNS_I2C_DIVB_MAX	64
>  
> +#define CDNS_I2C_TIMEOUT_MAX	0xFF
> +
>  #define cdns_i2c_readreg(offset)       readl_relaxed(id->membase + offset)
>  #define cdns_i2c_writereg(val, offset) writel_relaxed(val, id->membase + offset)
>  
> @@ -858,6 +860,8 @@ static int cdns_i2c_probe(struct platform_device *pdev)
>  		goto err_clk_dis;
>  	}
>  
> +	cdns_i2c_writereg(CDNS_I2C_TIMEOUT_MAX, CDNS_I2C_TIME_OUT_OFFSET);
> +
>  	dev_info(&pdev->dev, "%u kHz mmio %08lx irq %d\n",
>  		 id->i2c_clk / 1000, (unsigned long)r_mem->start, id->irq);
>  
> -- 
> 1.7.9.5
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20141203/fff8bc0b/attachment.sig>

  reply	other threads:[~2014-12-03 11:28 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-02 10:05 [PATCH 0/4] Cadence I2C driver fixes Harini Katakam
2014-12-02 10:05 ` [PATCH 1/4] i2c: cadence: Handle > 252 byte transfers Harini Katakam
2014-12-02 10:05 ` [PATCH 2/4] i2c: cadence: Set the hardware time-out register to maximum value Harini Katakam
2014-12-03 11:28   ` Wolfram Sang [this message]
2014-12-02 10:05 ` [PATCH 3/4] devicetree: bindings: Add defeature-repeated-start property for Cadence I2C Harini Katakam
2014-12-02 11:19   ` Mark Rutland
2014-12-02 12:13     ` Harini Katakam
2014-12-02 12:52       ` Wolfram Sang
2014-12-02 13:10         ` Harini Katakam
2014-12-02 13:16           ` Wolfram Sang
2014-12-02 13:30             ` Harini Katakam
2014-12-02 14:15               ` Wolfram Sang
2014-12-02 15:12                 ` Lars-Peter Clausen
2014-12-02 10:05 ` [PATCH 4/4] i2c: cadence: Defeature repeated start based on devicetree property Harini Katakam
2014-12-02 11:21   ` Mark Rutland

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=20141203112830.GD1039@katana \
    --to=wsa@the-dreams.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).