From: Mark Brown <broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
To: NiTr0 <nitr0-z9XQkeP78BxUq1AO9QMCaQ@public.gmane.org>
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: i2c_smbus_write_block_data vs scheduled routine calls (add_timer) - kernel crash
Date: Tue, 4 Aug 2009 21:35:56 +0100 [thread overview]
Message-ID: <20090804203556.GI4342@sirena.org.uk> (raw)
In-Reply-To: <4A788121.8020601-z9XQkeP78BxUq1AO9QMCaQ@public.gmane.org>
On Tue, Aug 04, 2009 at 09:42:41PM +0300, NiTr0 wrote:
> All variables are declared as static, all data is prepared correctly
> - so IMHO trouble is outside of my driver.
> There is a part of code:
The problem is that your driver is trying to do I2C/SMBus I/O from a
timer, which is run from an interrupt context. Since I2C buses are
generally very slow the controllers are interrupt driven and the read
and write operations on them will sleep waiting for operations to
complete. If the code waited for the I/O to complete in an interrupt
context it would cause serious performance problems in the rest of the
system.
You should do the actual I/O from another context, such as a workqueue.
schedule_delayed_work() may be helpful here.
prev parent reply other threads:[~2009-08-04 20:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-04 18:42 i2c_smbus_write_block_data vs scheduled routine calls (add_timer) - kernel crash NiTr0
[not found] ` <4A788121.8020601-z9XQkeP78BxUq1AO9QMCaQ@public.gmane.org>
2009-08-04 19:45 ` Matthias Kaehlcke
2009-08-04 20:35 ` Mark Brown [this message]
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=20090804203556.GI4342@sirena.org.uk \
--to=broonie-yzvpicuk2aatku/dhu1wvuem+bqzidxxqq4iyu8u01e@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=nitr0-z9XQkeP78BxUq1AO9QMCaQ@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