linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: James Hogan <james.hogan-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
To: Andrew Bresticker <abrestic-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
Cc: Ezequiel Garcia
	<ezequiel.garcia-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>,
	James Hartley
	<james.hartley-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>,
	Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 1/2] i2c: Add Imagination Technologies I2C SCB driver
Date: Fri, 31 Oct 2014 21:58:01 +0000	[thread overview]
Message-ID: <20141031215801.GD12801@jhogan-linux.le.imgtec.org> (raw)
In-Reply-To: <CAL1qeaEquLhpuSXd5=t9oEXi2iOArDbFFbfVrhOmyu70GR-z7w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

Hi Andrew,

On Fri, Oct 31, 2014 at 02:17:31PM -0700, Andrew Bresticker wrote:
> > +       /*
> > +        * To avoid slave event interrupts in automatic mode, use a timer to
> > +        * poll the abort condition if we don't get an interrupt for too long.
> > +        */
> 
> Why would polling be better than taking the interrupt?  Are an
> excessive number of interrupts generated during normal operation?

You get a slave event and transaction done interrupt for each atomic
mode command (start, data, ack, stop, etc) that gets completed, none of
which are of interest when using automatic mode since those atomic mode
commands are managed automatically by hardware rather than by the I2C
state machine in the ISR.

In practice, normal I2C transactions will be complete well before you
get the timer interrupt, as the timer is "pushed back" during FIFO
maintenance and disabled after the transaction is complete.

In this way normal automatic mode operation isn't impacted by
unnecessary interrupts, but the exceptional abort condition can still be
detected (with a slight delay).

> > +/*
> > + * Timer function to check if something has gone wrong in automatic mode (so we
> > + * don't have to handle so many interrupts just to catch an exception).
> > + */
> > +static void img_i2c_check_timer(unsigned long arg)
> 
> When are slave event interrupts generated during normal operation?
> It's not clear from the TRM I have.

Mainly on completion (or rather detection) of certain atomic mode
commands on the bus. Look for the use of at_slave_event in the driver.
This is used with the atomic mode part, and set to false while it is
waiting for a slave event interrupt before it can continue with the next
atomic mode command.

Cheers
James

  parent reply	other threads:[~2014-10-31 21:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-29 19:57 [PATCH 0/2] i2c: Imagination Technologies I2C adapter driver Ezequiel Garcia
     [not found] ` <1414612641-4259-1-git-send-email-ezequiel.garcia-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
2014-10-29 19:57   ` [PATCH 1/2] i2c: Add Imagination Technologies I2C SCB driver Ezequiel Garcia
     [not found]     ` <1414612641-4259-2-git-send-email-ezequiel.garcia-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
2014-10-31 21:17       ` Andrew Bresticker
     [not found]         ` <CAL1qeaEquLhpuSXd5=t9oEXi2iOArDbFFbfVrhOmyu70GR-z7w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-10-31 21:58           ` James Hogan [this message]
2014-11-04 20:30           ` Ezequiel Garcia
2014-10-29 19:57   ` [PATCH 2/2] DT: i2c: Add binding document for IMG I2C SCB Ezequiel Garcia
     [not found]     ` <1414612641-4259-3-git-send-email-ezequiel.garcia-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
2014-10-29 23:32       ` Andrew Bresticker
     [not found]         ` <CAL1qeaEzg5Qh9B62zFkbnhRgC9Ewxs7xkvwNdOO5t6bZd-HV-A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-10-29 23:55           ` James Hogan
2014-10-30 18:03           ` Ezequiel Garcia
     [not found]             ` <54527D71.2040901-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org>
2014-10-30 18:34               ` Andrew Bresticker

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=20141031215801.GD12801@jhogan-linux.le.imgtec.org \
    --to=james.hogan-1axoqhu6uovqt0dzr+alfa@public.gmane.org \
    --cc=abrestic-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
    --cc=ezequiel.garcia-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org \
    --cc=james.hartley-1AXoQHu6uovQT0dZR+AlfA@public.gmane.org \
    --cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@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 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).