* Ported driver for PC87360 for 2.6 Kernel
@ 2005-05-19 6:25 Robert Martin - inmedia
2005-05-19 6:25 ` Jean Delvare
2005-05-19 6:25 ` Jean Delvare
0 siblings, 2 replies; 3+ messages in thread
From: Robert Martin - inmedia @ 2005-05-19 6:25 UTC (permalink / raw)
To: lm-sensors
WARNING: This e-mail has been altered by MIMEDefang. Following this
paragraph are indications of the actual changes made. For more
information about your site's MIMEDefang policy, contact
andrew.net.au Postmaster <postmaster@andrew.net.au>. For more information about MIMEDefang, see:
http://www.roaringpenguin.com/mimedefang/enduser.php3
An attachment named cat-sensors.sh was removed from this document as it
constituted a security hazard. If you require this document, please contact
the sender and arrange an alternate means of receiving it.
-------------- next part --------------
Hi,
I have ported the PC87360 driver to the 2.6 kernel. It is required for, and
only tested on, a Tyan GS10, running SuSE 9.1. I have also made some
modifications. It will be used with Nagios. It would be advisable if
someone can check the code over, I haven't ported a driver to 2.6 before,
and I'm not familiar with these drivers. I can easily arrange testing.
Modifications include:-
A parameter to select the secondary device. This was done prior to porting.
Voltages changed to give mV. The ability to set the voltage multiplier,
which is divided by 1000 to allow for non-integer values, and is in line
with the use of mV. The setting of an off-set to allow for negative
voltages.
The FSCM registers can be set as a parameter, to overcome inappropriate BIOS
settings.
The fan divisors can be set.
I have included a simple BASH script I have used for testing.
In the Kconfig file, /usr/src/linux/drivers/i2c/chips/Kconfig, the following
lines should be added:-
config SENSORS_PC87360
tristate "PC87360"
depends on I2C && EXPERIMENTAL
select I2C_SENSOR
help
If you say yes here you get support for the Nat Semi PC8736X
series
of sensor chips: the PC87360, PC87363, PC87364, PC87365, PC87366
This driver can also be built as a module. If so, the module
will be called pc87360.
In the Makefile, /usr/src/linux/drivers/i2c/chips/Makefile, the following
line should be added after the obj-$(CONFIG_SENSORS_W83L785TS) +w83l785ts.o line:-
obj-$(CONFIG_SENSORS_PC87360) += pc87360.o
In the file /etc/sysconfig/lm_sensors
MODULE_0=i2c-i801
MODULE_1=i2c-isa
MODULE_2îprom
MODULE_3="pc87360 secondary=1 fanspeedcandm=0x036c"
When testing I found that the status bits changed correctly, however these
do not seem to be reflected in the alarm indication. I suspect that it may
be that some settings in some other registers require setting. I started to
do this, however this could lead to unexpected results if some of the output
pins are connected and as a consequence of changing the values in a register
there could be unintended system resets. A similar effect can be achieved
in the bash script if required. I had a quick look at the Watch dog Timer,
however the address registers have not been set by the BIOS.
Regards,
Bob.
Robert Martin
Product Development Manager
Inmedia
PO Box 2287
Gerrards Cross
SL9 8BF
Email: robert.martin@inmedia.co.uk
Direct Phone +44 (0)1494 878522
Direct Fax +44 (0)1494 874433
Mobile +44 (0)7771 645527
Web: www.inmedia.co.ukThe content of this e-mail and any attachment is
private and may
be legally privileged. If you are not the intended recipient,
any use, disclosure, copying or forwarding of this e-mail
and/or its attachments is unauthorised.
If you have received this e-mail in error please notify the
sender by e-mail and delete this message and any attachments
immediately from this system.
Inmedia Communications Limited is a private limited company
incorporated in England and Wales with registration
number 02928653 and whose registered office is at
Chalfont Grove, Narcot Lane, Gerrards Cross SL9 8TW.
For more information please visit: http://www.inmedia.co.uk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pc87360.c
Type: application/octet-stream
Size: 42673 bytes
Desc: not available
Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20040911/ba730c3a/pc87360.obj
^ permalink raw reply [flat|nested] 3+ messages in thread
* Ported driver for PC87360 for 2.6 Kernel
2005-05-19 6:25 Ported driver for PC87360 for 2.6 Kernel Robert Martin - inmedia
2005-05-19 6:25 ` Jean Delvare
@ 2005-05-19 6:25 ` Jean Delvare
1 sibling, 0 replies; 3+ messages in thread
From: Jean Delvare @ 2005-05-19 6:25 UTC (permalink / raw)
To: lm-sensors
> I have ported the PC87360 driver to the 2.6 kernel. It is required
> for, and only tested on, a Tyan GS10, running SuSE 9.1. I have also
> made some modifications. It will be used with Nagios. It would be
> advisable if someone can check the code over, I haven't ported a
> driver to 2.6 before, and I'm not familiar with these drivers. I can
> easily arrange testing.
Nice. I am the original author of the driver but have no hardware to
test it. It's always better when the developers can test their code
themselves.
Did you have a chance to test the 2.4 driver?
> Modifications include:-
>
> A parameter to select the secondary device. This was done prior to
> porting.
I don't get you. What do you mean?
> Voltages changed to give mV.
Yes, this is a requirement to comply with i2c/sysfs-interface.
> The ability to set the voltage
> multiplier, which is divided by 1000 to allow for non-integer values,
> and is in line with the use of mV.
I am not sure I get you. What is this multiplier you are talking about?
> The setting of an off-set to allow for negative voltages.
This does not belong to the driver. The chip does not monitor negative
voltages. All required conversions belong to libsensors.
> The FSCM registers can be set as a parameter, to overcome
> inappropriate BIOS settings.
This would better be done from userspace using isaset IMHO. Or, even
better, fixed in the faulty BIOS. Fixing problems where they are not is
asking for even more problems later.
> The fan divisors can be set.
Why do you need this? The driver already dynamically choose the best
clock divider for you.
> In the Kconfig file, /usr/src/linux/drivers/i2c/chips/Kconfig, the
> following lines should be added:-
>
> config SENSORS_PC87360
> tristate "PC87360"
> depends on I2C && EXPERIMENTAL
> select I2C_SENSOR
> help
> If you say yes here you get support for the Nat Semi PC8736X
> series
> of sensor chips: the PC87360, PC87363, PC87364, PC87365,
> PC87366
>
> This driver can also be built as a module. If so, the module
> will be called pc87360.
>
>
> In the Makefile, /usr/src/linux/drivers/i2c/chips/Makefile, the
> following line should be added after the
> obj-$(CONFIG_SENSORS_W83L785TS) += w83l785ts.o line:-
> obj-$(CONFIG_SENSORS_PC87360) += pc87360.o
Well, better provide a patch including these changes (together with the
new driver itself). This is the easiest way for testers to test your
contribution.
> In the file /etc/sysconfig/lm_sensors
>
> MODULE_0=i2c-i801
> MODULE_1=i2c-isa
> MODULE_2îprom
> MODULE_3="pc87360 secondary=1 fanspeedcandm=0x036c"
This is motherboard/distro dependant and does not belong to the kernel.
What does "fanspeedcandm" stand for?
> When testing I found that the status bits changed correctly, however
> these do not seem to be reflected in the alarm indication. I suspect
> that it may be that some settings in some other registers require
> setting. I started to do this, however this could lead to unexpected
> results if some of the output pins are connected and as a consequence
> of changing the values in a register there could be unintended system
> resets. A similar effect can be achieved in the bash script if
> required. I had a quick look at the Watch dog Timer, however the
> address registers have not been set by the BIOS.
Which status bits are you talking about? The driver uses register TEVSTS
for temperatures, VEVSTS0/1 for voltages/temperatures(thermistor-based)
and FMCSR0/1/2 for fans. These bits should match the limits comparisons
and the alarm indications should be a direct representation of these
bits. If this isn't the case then this is a bug in the driver. Please
give details if you think this is the case.
I don't get the idea of your bash script. It seems to duplicate what
libsensors/sensors do.
I will get a look at your ported code after you answer my questions and
as time permits.
Thanks.
--
Jean "Khali" Delvare
http://khali.linux-fr.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Ported driver for PC87360 for 2.6 Kernel
2005-05-19 6:25 Ported driver for PC87360 for 2.6 Kernel Robert Martin - inmedia
@ 2005-05-19 6:25 ` Jean Delvare
2005-05-19 6:25 ` Jean Delvare
1 sibling, 0 replies; 3+ messages in thread
From: Jean Delvare @ 2005-05-19 6:25 UTC (permalink / raw)
To: lm-sensors
Hi Robert,
> A quick reply.
Please reply to the list instead of to me only. People here may help as
well.
> I can if you require arrange ssh access through a public IP address.
I have no convenient Internat access these days, so I have to decline
the offer. At any rate, you seem to have the skills to test your code
yourself, so I don't think I would be of much help.
> > Did you have a chance to test the 2.4 driver?
>
> Yes I did, but the Tyan GS10 uses the secondary addresses 0x4e /
> 0x4f, hence the first modification to give this selection as a
> parameter. When running sensors detect it should up, so I guess this
> could be automated. I followed the keep it simple approach.
I don't think it's that simple. The user shouldn't have to know where
the chip is to get it to work, since we can easily detect it
automatically. Please update your code so that both 0x2e/0x2f and
0x4e/0x4f are tested and used automatically. A similar patch for the 2.4
driver would be appreciated as well.
BTW, what do you have at 0x2e/0x2f? Nothing? Or a different Super-I/O
chip?
I think it is acceptable to stop searching after we found a first
supported device (i.e. not scan 0x4e/0x4f if a PC8736x was found at
0x2e/0x2f). It means that we don't support dual-PC8736x configurations
but I wonder if we will ever see something like that. And this should
make the code easier.
> > > The ability to set the voltage
> > > multiplier, which is divided by 1000 to allow for non-integer
> > > values, and is in line with the use of mV.
> >
> > I am not sure I get you. What is this multiplier you are talking
> > about?
>
> This is an addition I made, so that i2c/sysfs-interface gives the
> correct reading. For example the multiplier is set to 8000 ie x8 for
> the 12V input, which measures as 1.5V with the input potential
> divider. If no external entry is made it defaults to x1, so that it
> will be compliant with libsensors.
Like negative voltages right below, this does not belong to the driver
but to userspace.
> > > The setting of an off-set to allow for negative voltages.
> >
> > This does not belong to the driver. The chip does not monitor negative
> > voltages. All required conversions belong to libsensors.
>
> I wasn't sure what the best way was to handle this. It defaults to
> 0, for compatability with libsensors. In our particular application
> the drivers will be used with Nagios. There is a Nagios plugin in the
> form of a shell script wrapper for the sensors program. I quickly
> tried the sensors program, quickly pasting in the section for the
> pc87360 from the 2.4 kernel version, but it didn't work. I didn't
> investigate it any further, as it was potentially an unnecessary
> additional layer. We would just use a shell script to access the
> i2c/sysfs-interface directly.
The fact that it defaults to 0 and is thus "libsensors-compatible" is
not relevant. Conversions do not belong to kernel space. Your port will
not be accepted into the 2.6 kernel tree as long as it contains such
code, even if its use is optional. Please get rid of it.
If you really don't want to use libsensors, you should be able to achive
the same operations in your shell script, using the bash built-in
arithmetics capabilities, or expr. However, I wonder why you don't want
to use libsensors and sensors.
> > > The fan divisors can be set.
> >
> > Why do you need this? The driver already dynamically choose the best
> > clock divider for you.
>
> It appeared in the original driver that the 960000 had been divided
> by 2 in a couple of the macros to give 480000, which would correspond
> to two pulses per revolution. To allow for different number of pulses
> per revolution I have included an additional divisor to set the number
> of pulses per revolution. For example on the Tyan, the front fans are
> 2 pulses per rev, whilst the rear is 4.
Again, you are duplicating libsensors goals. The driver assumes 2
ticks/revolution because this is the most common value. If it doesn't
work for you, you have to divide/multiply in user-space to get the
correct readings. And if you don't want to use libsensors, do the
arithmetics from your shell script.
> > What does "fanspeedcandm" stand for?
>
> See earlier
This doesn't quite answer my question. What does "candm" stand for?
Please fix your port according to my comments and provide a new version
in the form of a patch against linux 2.6.9-rc1.
Thanks.
--
Jean "Khali" Delvare
http://khali.linux-fr.org/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-05-19 6:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-19 6:25 Ported driver for PC87360 for 2.6 Kernel Robert Martin - inmedia
2005-05-19 6:25 ` Jean Delvare
2005-05-19 6:25 ` Jean Delvare
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.