[PATCH] Add a non-blocking I2C interface

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Here's the code that I have so far for adding a non-blocking interface 
to the I2C interface.  I've debated whether to do this as a patch or 
just post the files, because the patch is about half the size of the 
files.  I've decided on the diff for now, it seems to be fairly 
readable.  This is relative to 2.6.11-rc2.

I have not extensively tested this patch.  I've done eeprom operations 
on the piix4 and i801 chips both with and without updating the those 
interface for non-blocking operation.  I'm going to test the block 
transfers with the IPMI driver when I get access to a system (this 
weekend).  This is posted for comment.

This patch doesn't actually change much.  It adds a queue entry that is 
used to pass around the message data (and is obviously used for queuing 
:).  But this mostly is using the queue entry for data, breaking the 
operations into smaller functions, and doing the polling in the i2c-core 
code instead of the drivers themselves (for non-blocking capable 
drivers).  Function for unchanged drivers should be unchanged.

This does not implement SMB Alert, which should improve the performace 
of the IPMI SMB driver.  I'll do that in the future and just poll the 
interface for now.

I'll post the changes to the i801 driver next.

This patch requires the fixes to the completion code that Mike Waychison 
posted a few days ago 
(http://marc.theaimsgroup.com/?l=linux-kernel&m=110669761400454&w=2).  
Otherwise the wait_for_completion_interruptible() and 
wait_for_completion_timeout() are broken.

In case you missed the previous discussion, I need a non-blocking 
interface in the I2C code for use by the IPMI SMB driver.  The driver 
needs to be able to do things like store panic information in the SEL, 
ping the watchdog timer while in a panic, and power the system off.  The 
current I2C driver requires a task context, but you can't exactly do 
things at panic time with a task context.

-Corey
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: i2c_async.diff
Url: http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20050128/3ecb7870/attachment.pl 


[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux