* [Fwd: PATCH: bmcsensors and i2c-ipmi port to 2.6]
2005-05-19 6:24 [Fwd: PATCH: bmcsensors and i2c-ipmi port to 2.6] Yani Ioannou
@ 2005-05-19 6:24 ` Mark Studebaker
2005-05-19 6:24 ` Yani Ioannou
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Mark Studebaker @ 2005-05-19 6:24 UTC (permalink / raw)
To: lm-sensors
thanks for the submission.
hopefully you can figure out a way to generate the sysfs entries dynamically.
The static generation is unfortunate. Perhaps Greg could help us here.
Also I got mail from one person who had 70 sensors on his BMC.
I'm not running 2.6 on my BMC machine but I may try to backport the write code
and test it on 2.4.
We've recently changed the sysfs naming convention (from temp_min1 to temp1_min,
for example), so we'll need the naming reworked.
mds
Yani Ioannou wrote:
> Hi, attached is my e-mail to the author of the bmcsensors and i2c-ipmi
> driver (*Mark D. Studebaker*), I realized I probably should have CCed
> the original message to the lm-sensors development team as a whole.
>
> Thanks :-),
> Yani
>
> ------------------------------------------------------------------------
>
> Subject:
> PATCH: bmcsensors and i2c-ipmi port to 2.6
> From:
> Yani Ioannou <yanii@utsc.utoronto.ca>
> Date:
> Mon, 15 Mar 2004 11:36:32 -0500
> To:
> "M. Studebaker" <mdsxyz123@yahoo.com>
>
>
> Hi,
>
> As the kernel newbie faq puts it I've been "pissing in your pool" :-P so
> I thought it best to contact you. I love the 2.6 kernel but I also loved
> being able to read the sensors off my HP workstation x4000's IPMI BMC,
> so I took to porting the driver to 2.6/sysfs. I seem to have been fairly
> successful, although this could definitely do with some more testing on
> different hardware.
>
> First of all I'd like to thank you immensely for writing the driver :-)
> I was very pleased beyond words when I could finally use the IPMI BMC on
> my motherboard to see my sensors readings, although ironically with my
> motherboard I can't read 13 voltage, fan and temperatures sensors but
> not the CPU temperatures! I think being one of the first IPMI 1.0
> implementations they messed up the smbus, the adm1021 driver doesn't
> seem to be able to read the Xeon's temps either.
>
> Attached you will find a patch for kernel 2.6.4-rc2. My main problems
> porting the driver were in the ability of a BMC to have any number of
> sensors (or up to 50 as set in your driver). The sysfs show and store
> callbacks (more specifically the device.h implementation of it) do not
> appear to provide the ability to pass any information other than the
> device struct (and the buffer to write into), and thus making a single
> callback that can work for all sensors turns out to be impossible as far
> as I can see. Unfortunately (just as with the other ported sensor
> drivers) I had to create static functions for each sensor id, (i.e.
> 50!). In the other sensor drivers this is usually only a maximum of 8,
> so it is not as pronounced. It would make sense to me for the show and
> store callbacks of device.h to include information on the file that the
> specific call pertains to (just as the base sysfs implementation does).
>
> Note also that I implemented code to allow the setting of the thresholds
> for the sensors, but on writing it I found that my BMC doesn't support
> this, hence they have had no testing whatsoever, and obviously need to
> be tested on the appropriate hardware. Further improvements that I
> didn't get around to are creating the sysfs entries for hysteresis
> thresholds, and of course the driver still only works for one BMC.
>
> I'd be very grateful if you could test out the patch, and if possible
> test the driver more throughly on other IPMI implementations.
>
> Thanks,
> Yani
^ permalink raw reply [flat|nested] 5+ messages in thread* [Fwd: PATCH: bmcsensors and i2c-ipmi port to 2.6]
2005-05-19 6:24 [Fwd: PATCH: bmcsensors and i2c-ipmi port to 2.6] Yani Ioannou
2005-05-19 6:24 ` Mark Studebaker
@ 2005-05-19 6:24 ` Yani Ioannou
2005-05-19 6:24 ` Jean Delvare
2005-05-19 6:24 ` Mark Studebaker
3 siblings, 0 replies; 5+ messages in thread
From: Yani Ioannou @ 2005-05-19 6:24 UTC (permalink / raw)
To: lm-sensors
Yes, just to clarify I was referring to the sysfs_ops as defined in
sysfs.h (and described in Documentation/filesystems/sysfs.txt).
struct sysfs_ops {
ssize_t (*show)(struct kobject *, struct attribute *,char *);
ssize_t (*store)(struct kobject *,struct attribute *,const char *);
};
However subsystems such as device.h are free to define their own
implementations, as also described in
Documentation/filesystems/sysfs.txt as an example, device.h defines
ssize_t (*show)(struct device * dev, char * buf);
ssize_t (*store)(struct device * dev, const char * buf);
and maps to the sysfs callbacks by the following code:
static ssize_t
dev_attr_show(struct kobject * kobj, struct attribute * attr, char * buf)
{
struct device_attribute * dev_attr = to_dev_attr(attr);
struct device * dev = to_dev(kobj);
ssize_t ret = 0;
if (dev_attr->show)
ret = dev_attr->show(dev,buf);
return ret;
}
So the main problem for people writing sensors is that for some reason
in the device.h implementation of the sysfs callbacks the attribute
parameter was removed, I can only think there is a good reason for this
(does anybody know why?). I suppose one method might be to implement our
own set of callbacks for i2c - but because of the kobject hierarchy (as
far as I can see - I could be wrong) we need to go through the device
implementation to create the proper sysfs directory structure.
Yani
Jean Delvare wrote:
>Greg,
>
>
>
>>Yani Ioannou wrote:
>>
>>
>>
>>>I can't imagine why
>>>the device sysfs callbacks don't pass information on the file they
>>>pertain to, like the base sysfs callbacks, I can only think there
>>>must be a good reason, or something I'm missing.
>>>
>>>
>
>See how I am not the only one complaining about the lack of an
>additional parameter to i2c sysfs callback functions, that would let us
>have a single callback function for several similar sysfs entries, much
>like we were doing in 2.4.
>
>Now that Yani seems to pretend other (non-i2c) sysfs callback functions
>work that way, I am even more confused and really wonder why it was
>decided we would not be able to use that possibility.
>
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread* [Fwd: PATCH: bmcsensors and i2c-ipmi port to 2.6]
2005-05-19 6:24 [Fwd: PATCH: bmcsensors and i2c-ipmi port to 2.6] Yani Ioannou
2005-05-19 6:24 ` Mark Studebaker
2005-05-19 6:24 ` Yani Ioannou
@ 2005-05-19 6:24 ` Jean Delvare
2005-05-19 6:24 ` Mark Studebaker
3 siblings, 0 replies; 5+ messages in thread
From: Jean Delvare @ 2005-05-19 6:24 UTC (permalink / raw)
To: lm-sensors
Greg,
> Yani Ioannou wrote:
>
> > I can't imagine why
> > the device sysfs callbacks don't pass information on the file they
> > pertain to, like the base sysfs callbacks, I can only think there
> > must be a good reason, or something I'm missing.
See how I am not the only one complaining about the lack of an
additional parameter to i2c sysfs callback functions, that would let us
have a single callback function for several similar sysfs entries, much
like we were doing in 2.4.
Now that Yani seems to pretend other (non-i2c) sysfs callback functions
work that way, I am even more confused and really wonder why it was
decided we would not be able to use that possibility.
--
Jean Delvare
http://www.ensicaen.ismra.fr/~delvare/
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Fwd: PATCH: bmcsensors and i2c-ipmi port to 2.6]
2005-05-19 6:24 [Fwd: PATCH: bmcsensors and i2c-ipmi port to 2.6] Yani Ioannou
` (2 preceding siblings ...)
2005-05-19 6:24 ` Jean Delvare
@ 2005-05-19 6:24 ` Mark Studebaker
3 siblings, 0 replies; 5+ messages in thread
From: Mark Studebaker @ 2005-05-19 6:24 UTC (permalink / raw)
To: lm-sensors
the sensors mailing list is the one.
Phil please sign Yani up.
Yani Ioannou wrote:
> Wow.. and I thought allowing for 50 sensors was over cautious. Yes,
> dynamic callbacks would be much more scalable (nevermind easier to code,
> and less of an eye-sore), but we can't bypass the device.h
> implementation if only for the kobj hiearchy. I can't imagine why the
> device sysfs callbacks don't pass information on the file they pertain
> to, like the base sysfs callbacks, I can only think there must be a good
> reason, or something I'm missing.
>
> I'll get about to changing the naming when I get time, it won't take
> much to change, on the dynamic generation of sysfs entries however I
> could do with all the help I can get :-)
>
> I suppose I really should subscribe to the relevant mailing list, but is
> that the lm_sensors or kernel one?
>
> Thanks,
> Yani
>
> Mark Studebaker wrote:
>
>> thanks for the submission.
>> hopefully you can figure out a way to generate the sysfs entries
>> dynamically.
>> The static generation is unfortunate. Perhaps Greg could help us here.
>> Also I got mail from one person who had 70 sensors on his BMC.
>>
>> I'm not running 2.6 on my BMC machine but I may try to backport the
>> write code
>> and test it on 2.4.
>>
>> We've recently changed the sysfs naming convention (from temp_min1 to
>> temp1_min,
>> for example), so we'll need the naming reworked.
>>
>> mds
>
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread