public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Anton Vorontsov <cbouatmailru@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Balaji Rao <balajirrao@openmoko.org>,
	linux-kernel@vger.kernel.org, cbou@mail.ru, andy@openmoko.com
Subject: Re: [PATCH 3/3] pcf50633_charger: Enable periodic charging restart
Date: Tue, 3 Feb 2009 03:33:45 +0300	[thread overview]
Message-ID: <20090203003345.GB29462@zarina> (raw)
In-Reply-To: <20090202144131.41a8d279.akpm@linux-foundation.org>

On Mon, Feb 02, 2009 at 02:41:31PM -0800, Andrew Morton wrote:
> On Tue, 27 Jan 2009 19:23:12 +0530
> Balaji Rao <balajirrao@openmoko.org> wrote:
> 
> > @@ -157,6 +213,7 @@ pcf50633_mbc_irq_handler(int irq, void *data)
> >  		mbc->usb_online = 0;
> >  		mbc->usb_active = 0;
> >  		pcf50633_mbc_usb_curlim_set(mbc->pcf, 0);
> > +		cancel_delayed_work_sync(&mbc->charging_restart_work);
> >  	}
> 
> eek, can't call cancel_delayed_work_sync() from an interrupt handler! 

It's rather confusing, but it's not an irq handler, in the sense that
it does not run in atomic context -- the PCF IRQ handlers run in
kernel threads.

It's done that way because PCF50633 is an I2C device, and normally
we can't access I2C devices in the atomic context (plus it's rather
slow, thus would cause huge latencies if we'd try).

-- 
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2

  reply	other threads:[~2009-02-03  0:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-27 13:52 [PATCH 1/3] pcf50633_charger: Fix typo Balaji Rao
2009-01-27 13:52 ` [PATCH 2/3] pcf50633_charger: Remove mbc_set_status Balaji Rao
2009-02-03  0:34   ` Anton Vorontsov
2009-01-27 13:53 ` [PATCH 3/3] pcf50633_charger: Enable periodic charging restart Balaji Rao
2009-02-02 22:41   ` Andrew Morton
2009-02-03  0:33     ` Anton Vorontsov [this message]
2009-02-02 22:41 ` [PATCH 1/3] pcf50633_charger: Fix typo Andrew Morton
2009-02-03  0:20   ` Anton Vorontsov

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=20090203003345.GB29462@zarina \
    --to=cbouatmailru@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=andy@openmoko.com \
    --cc=balajirrao@openmoko.org \
    --cc=cbou@mail.ru \
    --cc=linux-kernel@vger.kernel.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