All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Ditto <mditto@consentry.com>
To: linuxppc-dev@ozlabs.org, linux-i2c@vger.kernel.org,
	Timur Tabi <timur@freescale.com>
Subject: Re: Calling wait_event_interruptible_timeout() in I2C wait functions
Date: Wed, 04 Feb 2009 12:00:52 -0800	[thread overview]
Message-ID: <4989F3F4.7070207@consentry.com> (raw)
In-Reply-To: <49889CFA.7070308@freescale.com>

Timur Tabi wrote:
> However, it appears that this is not common behavior for I2C driver.  In
> fact, only these six drivers ever call wait_event_interruptible_timeout():
> 
> i2c-cpm.c

I don't know about the others, but in i2c-cpm.c the use of interruptible
wait seems incorrect.  Maybe it could be made correct, but as is, it
does not correctly clean up the hardware state or return a useful
value when interrupted by a signal.  It's not clear what to do, anyway -
it's hard to know which messages of the interrupted transaction have
actually taken effect in the hardware.  I think it's better to use
uninterruptible wait here and just live with the delayed signal
handling (one second delay in the unlikely worst case for i2c-cpm).

In general, I think it's best to consider I2C I/O to be uninterruptible,
like disk I/O.  The only reason to make it interruptible is to make
sure you don't end up with an unkillable process due to an I/O error,
and that is adequately handled by a timeout (and re-initialization of
the I2C interface in that case).

					-=] Mike [=-

  reply	other threads:[~2009-02-04 20:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-03 19:37 Calling wait_event_interruptible_timeout() in I2C wait functions Timur Tabi
2009-02-03 19:37 ` Timur Tabi
2009-02-04 20:00 ` Mike Ditto [this message]
     [not found]   ` <4989F3F4.7070207-Vjf7OWgA3BLqlBn2x/YWAg@public.gmane.org>
2009-02-05 11:51     ` Mark Brown
2009-02-05 11:51       ` Mark Brown
     [not found]       ` <20090205115100.GD422-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2009-02-05 15:18         ` Timur Tabi
2009-02-05 15:18           ` Timur Tabi
2009-02-04 20:00 ` Mike Ditto
     [not found] ` <49889CFA.7070308-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2009-02-04 20:00   ` Mike Ditto

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=4989F3F4.7070207@consentry.com \
    --to=mditto@consentry.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=timur@freescale.com \
    /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.