[lm-sensors] [ patch .24-rc0 5/5 ] SuperIO locks coordinator - use in other hwmon/*.c

David Hubbard david.c.hubbard at gmail.com
Fri Nov 16 02:00:18 CET 2007


Hi Jim,

I pulled the w83627ehf.c patch out of patch #5, so patch #5 is
(mostly) unchanged, and then put some of the superio-locks.c changes
in patch #1 to support changes to w83627ehf. So w83627ehf changes are
in my patch #6, where I did the things we have talked about.

> > 1) This appears to be pasted in and needs to be updated for each driver:
> > printk(KERN_WARNING "pc87360: superio port not detected, "
> >
>
>  fixed here, thanks

Full changelog for patches 1-5:
1. Patches are now based on 2.6.24-rc2-git5. Since this patchset
touches so many drivers, it needs some heavy testing. So I also made a
patchset for 2.6.24-rc2-mm1, and I can post that set if I've based off
the wrong kernel version. (Both patchsets are compile-tested.)

1. I renamed drivers/hwmon/superio_locks.c to
drivers/hwmon/superio-locks.c (it seems to be the convention)

2. I updated patch #3 and #5 to use DRVNAME

3. I trimmed down patch #5 so that new stuff is in patch #6

4. I added a parameter enter_exit_method to struct superio_search &
struct superio which specifies what enter method to use. 0 = default,
the exit_seq is sent to the superio-port in a sequence. 1 = register
offset is first byte, followed by value. So W83627EHF has an exit_seq
of [ 0, 2, 1, 2 ]. Other methods can be added, if there are other
chips as weird as the W83627EHF.

5. I looked around superio-locks.c and I couldn't find code to copy
enter_seq, exit_seq, devid_word, and ldn_addr from struct
superio_search to struct superio. I added something to do this at the
end of superio_probe_reserve().

6. I renamed struct superio_search devid_mask to devid_mask_inverse

7. I fixed a bug in superio-locks.h:
for (i = 0; i < SEQ_SZ && gate->enter_seq[i]; i++)
outb(gate->exit_seq[i], gate->sioaddr);

The termination condition in the for loop in superio_exit() checks
enter_seq for zeros. It should check exit_seq, like this:
for (i = 0; i < SEQ_SZ && gate->exit_seq[i]; i++)
outb(gate->exit_seq[i], gate->sioaddr);

Patch #6 is the stuff in w83627ehf.c:
8. I removed SIO_ID_MASK and used superio_devid() instead in
w83627ehf_find(), because the devid is saved after having been masked
by struct superio_search devid_mask_inverse. I initialize struct
superio_search with 0xF, instead of ~SIO_ID_MASK where SIO_ID_MASK was
0xFFF0.

9. I removed my_superio_exit(), since superio-locks.c can now do the
superio_exit() for the w83627ehf.

10. I removed SIO_REG_LDSEL and SIO_REG_DEVID, since they are part of
superio-locks.c now. Other drivers might be able to do this too.

11. I moved struct superio * gate into struct w83627ehf_sio_data,
where it replaces int sioreg there. int sioreg was where the probed
superio address was stored, so that's where the gate should be stored
now.

12. I use superio_inw to get the ISA address

13. I release the superio slot reservation after successfully probing
the device and finding its ISA address. The code that releases it is
at the end of sensors_w83627ehf_init().

14. w83627ehf_find() return value is the ISA address or a negative
error code, as we discussed.

I tested everything on a w83627ehf and it works ok. I can test on a
w83627dhg in a few days.

Jim, when you have some time, please test on the motherboards you have.

Jean, if you have a chance, can you please review these patches?

Regards,
David
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 01_hwmon_superio_module.patch.txt
URL: <http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20071115/0c18974d/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 02_hwmon_superio_w83627hf.patch.txt
URL: <http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20071115/0c18974d/attachment-0001.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 03_hwmon_superio_pc87360.patch.txt
URL: <http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20071115/0c18974d/attachment-0002.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 04_hwmon_superio_pc8736x_gpio.patch.txt
URL: <http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20071115/0c18974d/attachment-0003.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 05_hwmon_superio_others.patch.txt
URL: <http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20071115/0c18974d/attachment-0004.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 06_hwmon_superio_w83627ehf.patch.txt
URL: <http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20071115/0c18974d/attachment-0005.txt>


More information about the lm-sensors mailing list