Skip to contentSkip to conversation

i2c-i801: Add basic interrupt support

PATCH Superseded Ivo Manca 2 participants 4 messages Jul 23, 2008 – Aug 11, 2008 3 messages not in the archive I2C subsystem host drivers

lore
Share & tools
lore

Ivo Manca

author
#0 lore raw

cover i2c-i801: Add basic interrupt support

Hey All,

It's been a while since I last posted about this matter, but the patch is finally there.

This patch adds basic interrupt support to the i2c-i801 bus driver. This means i2c transactions can be completed without useless and pricy waiting loops (the polling) and speeds things up.
Currently only basic transactions are support. The HW PEC or i2c block transactions still use polling.

To write this patch, I've extensively used Mark M. Hoffman's i2c-i801 rewrite of the i2c-i801 driver dating back from 28 Nov 2008. This can be found at http://archives.andrew.net.au/lm-sensors/msg28496.html

I've tested this patch extensively on a machine provided by the Hague University (Thanks Hans! ;) which is ICH5 based, but it needs a lot of more testing. So please be welcome to give the patch a shot.

Since I’m completely new to linux device driver development, interrupts and i2c, stupid mistakes can be very well possible. Please use this patch with caution and let me know whatever I did wrong :). Oh, and if your PC won’t start up anymore, removing power from the PC always worked for me ;p.

All patches are made against 2.6.26-rc9

Patch 1 implements the functionality, while patch 2 only adds the alignment changes. This is done to make it easier reviewable. Patch 3 is quite unrelated and only fixes some checkPatch warnings..

---
Ivo Manca

_______________________________________________
i2c mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/i2c

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

Hi Ivo,

Quoted 10 lines · Ivo Manca

Hey All,

It's been a while since I last posted about this matter, but the patch is finally there.

This patch adds basic interrupt support to the i2c-i801 bus driver. This means i2c transactions can be completed without useless and pricy waiting loops (the polling) and speeds things up.
Currently only basic transactions are support. The HW PEC or i2c block transactions still use polling.

Ah, really great! Thanks for working on this :)

Is there any inherent difficulty to get interrupts to work with HW PEC? And with I2C block transactions? Or did you just not get around to doing it?

Quoted 3 lines

To write this patch, I've extensively used Mark M. Hoffman's i2c-i801 rewrite of the i2c-i801 driver dating back from 28 Nov 2008. This can be found at http://archives.andrew.net.au/lm-sensors/msg28496.html

Yeah, Mark has been traveling a lot in time lately. Unfortunately this also means that we can't watch this archived post yet, it'll be a few more months before it shows up! ;)

(Seriously, archives.andrew.net.au is the old list archive and apparently it has been discontinued, please use lists.lm-sensors.org instead.)

Quoted 9 lines

I've tested this patch extensively on a machine provided by the Hague University (Thanks Hans! ;) which is ICH5 based, but it needs a lot of more testing. So please be welcome to give the patch a shot.

Since I’m completely new to linux device driver development, interrupts and i2c, stupid mistakes can be very well possible. Please use this patch with caution and let me know whatever I did wrong :). Oh, and if your PC won’t start up anymore, removing power from the PC always worked for me ;p.

I've just given it a quick try on my old ICH3-M-based laptop and it seems to work fine there. The speed improvement compared to the polling code is very impressive.

I'm going to do more tests on 2 other machines (with ICH5 and ICH7 respectively) and will report when I'm done. A patch review will also follow.

Quoted 1 line

All patches are made against 2.6.26-rc9

The i2c-i801 driver has changed a lot since then. Any chance you could respin the patches against 2.6.27-rc2?

Quoted 3 lines

Patch 1 implements the functionality, while patch 2 only adds the alignment changes. This is done to make it easier reviewable. Patch 3 is quite unrelated and only fixes some checkPatch warnings..

Thanks,

Signature · 6 lines
Jean Delvare

_______________________________________________
i2c mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/i2c

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#4 lore raw

Hey Jean,

Quoted 6 lines · Jean Delvare

Ah, really great! Thanks for working on this :)

Is there any inherent difficulty to get interrupts to work with HW PEC? And with I2C block transactions? Or did you just not get around to doing it?

To be honoust: I don't know a thing about HW PEC and was not able to test it anyway. Therefor, I decided not to touch this part yet. I did try to add support for interrupts with I2C block transactions. This however caused various nasty problems.

That made me first want to test and implement basic interrupt support before going there again. When I know for sure the basics work correctly and stable (and when I know for sure I haven't made very stupid coding mistakes), I'll try again to add support for block transactions :).

Quoted 8 lines

Yeah, Mark has been traveling a lot in time lately. Unfortunately this also means that we can't watch this archived post yet, it'll be a few more months before it shows up! ;)

(Seriously, archives.andrew.net.au is the old list archive and apparently it has been discontinued, please use lists.lm-sensors.org instead.)

Ugh, you _can't_ time travel yourself? ";p

(I used archives.andrew.net.au because that was the first hit on google... Anyway, here is the correct link:
http://lists.lm-sensors.org/pipermail/lm-sensors/2004-November/009588.html )

Quoted 8 lines

I've just given it a quick try on my old ICH3-M-based laptop and it seems to work fine there. The speed improvement compared to the polling code is very impressive.

I'm going to do more tests on 2 other machines (with ICH5 and ICH7 respectively) and will report when I'm done. A patch review will also follow.

Thanks! Glad to hear I didn't kill your laptop :).

Quoted 3 lines

The i2c-i801 driver has changed a lot since then. Any chance you could respin the patches against 2.6.27-rc2?

Sure, I'll try to respin it as soon as possible. Hopefully, that will be tomorrow.

Quoted 2 lines

Thanks,

Ivo

_______________________________________________
i2c mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/i2c

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw
Quoted 5 lines · Ivo Manca

Hey Jean,

Quoted 2 lines · Jean Delvare

Ah, really great! Thanks for working on this :)

Quoted 8 lines
Quoted 3 lines

Is there any inherent difficulty to get interrupts to work with HW PEC? And with I2C block transactions? Or did you just not get around to doing it?

To be honoust: I don't know a thing about HW PEC and was not able to test it anyway. Therefor, I decided not to touch this part yet. I did try to add support for interrupts with I2C block transactions. This however caused various nasty problems.

PEC is an optional extra byte at the end of SMBus transactions, containing a checksum to detect transaction errors. It can be handled directly by the ICH4 hardware and later, thus the name "hwpec". The ICH3 can do software PEC but we don't support that.

I don't think you need to care much about this as far as interrupts are concerned, this should be pretty transparent.

I2C block writes shouldn't differ from other block transactions. I2C block reads OTOH are special in many aspects so I do expect special handling to be required for interrupt support.

Quoted 4 lines

That made me first want to test and implement basic interrupt support before going there again. When I know for sure the basics work correctly and stable (and when I know for sure I haven't made very stupid coding mistakes), I'll try again to add support for block transactions :).

This is a good strategy, no question about that.

Quoted 9 lines
Quoted 7 lines

I've just given it a quick try on my old ICH3-M-based laptop and it seems to work fine there. The speed improvement compared to the polling code is very impressive.

I'm going to do more tests on 2 other machines (with ICH5 and ICH7 respectively) and will report when I'm done. A patch review will also follow.

Thanks! Glad to hear I didn't kill your laptop :).

Testing is done, and all 3 systems survived and actually worked :) Well done!

Quoted 5 lines
Quoted 2 lines

The i2c-i801 driver has changed a lot since then. Any chance you could respin the patches against 2.6.27-rc2?

Sure, I'll try to respin it as soon as possible. Hopefully, that will be tomorrow.

Thanks. No need to hurry though, take your time. You may want to wait for my review so that you can address my concerns at the same time.

Signature · 6 lines
Jean Delvare

_______________________________________________
i2c mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/i2c