public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
To: Troy Kisky
	<troy.kisky-Q5RJGjKts06CY9SHAMCTRUEOCMrvLtNR@public.gmane.org>
Cc: i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org,
	Kevin Hilman <khilman-Igf4POYTYCDQT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH 3/5] I2C: DaVinci: remove useless IVR read
Date: Fri, 28 Mar 2008 22:01:53 +0100	[thread overview]
Message-ID: <20080328220153.3d197f0d@hyperion.delvare> (raw)
In-Reply-To: <47ED48E7.4060803-Q5RJGjKts06CY9SHAMCTRUEOCMrvLtNR@public.gmane.org>

On Fri, 28 Mar 2008 12:37:11 -0700, Troy Kisky wrote:
> Jean Delvare wrote:
> > On Thu, 20 Mar 2008 20:06:08 -0700, Troy Kisky wrote:
> >> Interrupts are enabled at the point where
> >> the DAVINCI_I2C_IVR_REG is read, so unless
> >> an interrupt happened just at that moment,
> >> no interrupt would be pending. Even though
> >> documentation implies you should do this,
> >> I see no reason. If slave support is added,
> >> this read would cause a hard to reproduce bug.
> > 
> > This is only a problem if the device can operate in master mode and
> > slave mode concurrently. Is it the case? But even then, as you can't
> > have master and slave activity going on at the same time on a given I2C
> > bus, it only matters if some DaVinci boards have more than one i2c
> > buses. Is it the case?
> > 
> 
> There is only one i2c bus AFAIK, but how that is relevant escapes me.
> And I realize that the host controller can not be master while it is
> addressed as slave, but that does not prohibit a program from trying to
> be master. Just because the interrupt that lets me know I am addressed
> as slave is removed (and ignored,) the state of the bus is not suddenly
> idle again. The documentation says to make sure no interrupts are pending
> before starting a transfer. It should says "Service all pending interrupts, so
> that the bus is idle before starting a transfer."

Even that is just best effort... You can be addressed as a slave
between the time you serviced all pending interrupts and the time you
start a transfer as a master. There's no way to solve this problem
though as far as I can see.

> The wait_bus_not_busy
> will satisfy this in most cases. The exception being if the process is swapped
> out, giving time for someone else on the bus to become master.

The process being swapped out only gives the race more time to happen,
but it can happen even without it.

> 
> 
> My removing the IVR read will not magically make the bus idle again either. But
> at least, the interrupt routine will have a chance to do something.

OK, fine with me. But then don't you want to read the IVR register at
driver load time, to clear up everything that may have happened before
the driver is loaded?

-- 
Jean Delvare

_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c

  parent reply	other threads:[~2008-03-28 21:01 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-21  3:06 [PATCH 0/5]I2C: Davinci host controller changes Troy Kisky
     [not found] ` <1206068770-15458-1-git-send-email-troy.kisky-Q5RJGjKts06CY9SHAMCTRUEOCMrvLtNR@public.gmane.org>
2008-03-21  3:06   ` [PATCH 1/5] I2C: DaVinci: fix lost interrupt Troy Kisky
     [not found]     ` <1206068770-15458-2-git-send-email-troy.kisky-Q5RJGjKts06CY9SHAMCTRUEOCMrvLtNR@public.gmane.org>
2008-03-21  3:06       ` [PATCH 2/5] I2C: DaVinci: clock between 7-12 Mhz Troy Kisky
     [not found]         ` <1206068770-15458-3-git-send-email-troy.kisky-Q5RJGjKts06CY9SHAMCTRUEOCMrvLtNR@public.gmane.org>
2008-03-21  3:06           ` [PATCH 3/5] I2C: DaVinci: remove useless IVR read Troy Kisky
     [not found]             ` <1206068770-15458-4-git-send-email-troy.kisky-Q5RJGjKts06CY9SHAMCTRUEOCMrvLtNR@public.gmane.org>
2008-03-21  3:06               ` [PATCH 4/5] I2C: DaVinci: fix signal handling bug Troy Kisky
     [not found]                 ` <1206068770-15458-5-git-send-email-troy.kisky-Q5RJGjKts06CY9SHAMCTRUEOCMrvLtNR@public.gmane.org>
2008-03-21  3:06                   ` [PATCH 5/5] I2C: DaVinci: initialize cmd_complete sooner Troy Kisky
2008-03-27 15:56               ` [PATCH 3/5] I2C: DaVinci: remove useless IVR read Jean Delvare
     [not found]                 ` <20080327165641.4380a7f1-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-03-28 19:37                   ` Troy Kisky
     [not found]                     ` <47ED48E7.4060803-Q5RJGjKts06CY9SHAMCTRUEOCMrvLtNR@public.gmane.org>
2008-03-28 21:01                       ` Jean Delvare [this message]
     [not found]                         ` <20080328220153.3d197f0d-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-03-28 22:23                           ` Troy Kisky
2008-03-27 15:36           ` [PATCH 2/5] I2C: DaVinci: clock between 7-12 Mhz Jean Delvare
     [not found]             ` <20080327163626.75d1bd51-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-03-28 20:04               ` Troy Kisky
     [not found]                 ` <47ED4F3A.5060007-Q5RJGjKts06CY9SHAMCTRUEOCMrvLtNR@public.gmane.org>
2008-03-28 20:36                   ` Jean Delvare
     [not found]                     ` <20080328213649.508b4f3c-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-04-25  9:41                       ` Jean Delvare
     [not found]                         ` <20080425114146.2dbedee6-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2008-04-25 15:44                           ` Troy Kisky
     [not found]                             ` <4811FC79.10803-Q5RJGjKts06CY9SHAMCTRUEOCMrvLtNR@public.gmane.org>
2008-04-25 16:06                               ` Troy Kisky
2008-03-27 13:18       ` [PATCH 1/5] I2C: DaVinci: fix lost interrupt Jean Delvare
  -- strict thread matches above, loose matches on Subject: below --
2008-04-25 16:58 [PATCH 1/5] I2C: DaVinci: clock between 7-12 MHz Troy Kisky
2008-04-25 16:58 ` [PATCH 2/5] I2C: DaVinci: move dev_debug line for more output Troy Kisky
     [not found]   ` <1209142694-30046-2-git-send-email-troy.kisky-Q5RJGjKts06CY9SHAMCTRUEOCMrvLtNR@public.gmane.org>
2008-04-25 16:58     ` [PATCH 3/5] I2C: DaVinci: remove useless IVR read Troy Kisky
     [not found]       ` <1209142694-30046-3-git-send-email-troy.kisky-Q5RJGjKts06CY9SHAMCTRUEOCMrvLtNR@public.gmane.org>
2008-04-28 16:08         ` Jean Delvare

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=20080328220153.3d197f0d@hyperion.delvare \
    --to=khali-puyad+kwke1g9huczpvpmw@public.gmane.org \
    --cc=i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org \
    --cc=khilman-Igf4POYTYCDQT0dZR+AlfA@public.gmane.org \
    --cc=troy.kisky-Q5RJGjKts06CY9SHAMCTRUEOCMrvLtNR@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