From: James Hogan <james.hogan-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
To: Sifan Naeem <sifan.naeem-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>,
Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>,
linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Ezequiel Garcia
<ezequiel-30ULvvUtt6G51wMPkGsGjgyUoB5FGQPZ@public.gmane.org>
Cc: Ionela Voinescu
<Ionela.Voinescu-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH v2 2/5] i2c: img-scb: remove fifo EMPTYING interrupts handle
Date: Thu, 3 Sep 2015 09:54:00 +0100 [thread overview]
Message-ID: <55E80AA8.9070501@imgtec.com> (raw)
In-Reply-To: <1439567447-8139-3-git-send-email-sifan.naeem-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 2910 bytes --]
On 14/08/15 16:50, Sifan Naeem wrote:
> Now that we are using the transaction halt interrupt to safely control
Is that referring to patch 4, which comes after this one?
> repeated start transfers, we no longer need to handle the fifo
> emptying interrupts.
>
> Handling this interrupt along with Transaction Halt interrupt can
> cause erratic behaviour.
You said in response to my question before:
> EMPTYING interrupt indicates that the transfer is in its last byte,
> and in old ip versions it was safe to start a new transfer at this
> point. The erratic behaviour I saw was due to how the latest IP
> handles Master Halt. In this IP a transaction is halted after each
> byte of a transfer. Having to halt the transfer after the last byte
> means we can no longer service the EMPTYING interrupt, doing so may
> cause repeated start transfers to fails.
That doesn't look like its what the code did though. If emptying and not
empty, it only wrote to fifo, but didn't start the next transaction.
>
> Signed-off-by: Sifan Naeem <sifan.naeem-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
> ---
> drivers/i2c/busses/i2c-img-scb.c | 16 +++-------------
> 1 file changed, 3 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-img-scb.c b/drivers/i2c/busses/i2c-img-scb.c
> index ad1d1df943db..75a44e794d75 100644
> --- a/drivers/i2c/busses/i2c-img-scb.c
> +++ b/drivers/i2c/busses/i2c-img-scb.c
> @@ -154,7 +154,6 @@
> #define INT_TIMING BIT(18)
>
> #define INT_FIFO_FULL_FILLING (INT_FIFO_FULL | INT_FIFO_FILLING)
> -#define INT_FIFO_EMPTY_EMPTYING (INT_FIFO_EMPTY | INT_FIFO_EMPTYING)
>
> /* Level interrupts need clearing after handling instead of before */
> #define INT_LEVEL 0x01e00
> @@ -176,8 +175,7 @@
> INT_WRITE_ACK_ERR | \
> INT_FIFO_FULL | \
> INT_FIFO_FILLING | \
> - INT_FIFO_EMPTY | \
> - INT_FIFO_EMPTYING)
> + INT_FIFO_EMPTY)
img_i2c_write_fifo also clears INT_FIFO_EMPTYING from int_enable if
nothing left to write. That would seem redundant after this change.
Cheers
James
>
> #define INT_ENABLE_MASK_WAITSTOP (INT_SLAVE_EVENT | \
> INT_ADDR_ACK_ERR | \
> @@ -882,16 +880,8 @@ static unsigned int img_i2c_auto(struct img_i2c *i2c,
> return ISR_WAITSTOP;
> }
> } else {
> - if (int_status & INT_FIFO_EMPTY_EMPTYING) {
> - /*
> - * The write fifo empty indicates that we're in the
> - * last byte so it's safe to start a new write
> - * transaction without losing any bytes from the
> - * previous one.
> - * see 2.3.7 Repeated Start Transactions.
> - */
> - if ((int_status & INT_FIFO_EMPTY) &&
> - i2c->msg.len == 0)
> + if (int_status & INT_FIFO_EMPTY) {
> + if (i2c->msg.len == 0)
> return ISR_WAITSTOP;
> img_i2c_write_fifo(i2c);
> }
>
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2015-09-03 8:54 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-14 15:50 [PATCH v2 0/5] i2c: img-scb: enchancements to support i2c on pistachio Sifan Naeem
[not found] ` <1439567447-8139-1-git-send-email-sifan.naeem-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
2015-08-14 15:50 ` [PATCH v2 1/5] i2c: img-scb: support I2C_M_IGNORE_NAK Sifan Naeem
2015-08-14 15:50 ` [PATCH v2 2/5] i2c: img-scb: remove fifo EMPTYING interrupts handle Sifan Naeem
[not found] ` <1439567447-8139-3-git-send-email-sifan.naeem-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
2015-09-03 8:54 ` James Hogan [this message]
2015-10-09 8:43 ` Sifan Naeem
2015-08-14 15:50 ` [PATCH v2 3/5] i2c: img-scb: add handle for stop detected interrupt Sifan Naeem
[not found] ` <1439567447-8139-4-git-send-email-sifan.naeem-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
2015-09-02 15:47 ` James Hogan
2015-08-14 15:50 ` [PATCH v2 4/5] i2c: img-scb: add handle for Master halt interrupt Sifan Naeem
2015-08-14 15:50 ` [PATCH v2 5/5] i2c: img-scb: support repeated starts on IP v3.3 Sifan Naeem
[not found] ` <1439567447-8139-6-git-send-email-sifan.naeem-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
2015-09-03 8:29 ` James Hogan
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=55E80AA8.9070501@imgtec.com \
--to=james.hogan-1axoqhu6uovqt0dzr+alfa@public.gmane.org \
--cc=Ionela.Voinescu-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org \
--cc=ezequiel-30ULvvUtt6G51wMPkGsGjgyUoB5FGQPZ@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=sifan.naeem-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org \
--cc=wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.