linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: Question: hwmon: Adding addtitional sysfs entries
  2014-05-10 13:22 Question: hwmon: Adding addtitional sysfs entries Andreas Werner
@ 2014-05-10 12:32 ` Guenter Roeck
  2014-05-10 16:02   ` Andreas Werner
  0 siblings, 1 reply; 5+ messages in thread
From: Guenter Roeck @ 2014-05-10 12:32 UTC (permalink / raw)
  To: Andreas Werner, linux-kernel; +Cc: khali, andreas.werner

On 05/10/2014 06:22 AM, Andreas Werner wrote:
> Hi,
> i am currently working on an implemenation of my Board Management Controller (BMC).
>
> This Controller is a MCR assembled on almost all of our Compact PCI or Compact PCI Serial
> Cards as well as on some other CPU Boards.
>
> The BMC includes LED´s, Watchdog, Voltage Monitoring and some other features.
> I have already implemented an MFD driver, LED and Watchdog driver.
>
> Currently i am working on the hwmon implemenation. This includes for the first step the
> voltage monitoring.
>
> The BMC has some other feature which are not supported by any of the subsystem.
>   - Errorcounter (Board status)
>   - Power Failure status
>   - Operating ours

Guess you mean hours here.

>   - Do software reset, do cold reset
>   - Set power modes
>   - Backplate Geographical Address
>
> These are all informations related to the Board where the BMC is assembled to.
> I think all those features could be part of the hwmon implementation.
>
Why ?

> Is it possible to add "custom" sysfs entries in my hwmon driver to support all these features?
> Does lm-sensor ingore those custom features or is it a problem for lm-sensors?
>
> What is the normal way to add those features?
>

The hwmon subsystem isn't really the correct location for this functionality.
Power management should be done with a regulator driver (possibly power).
The other attributes and functionality would better fit into the mfd core
driver.

You might want to tie the reset functions into the system reset functionality.

Guenter


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Question: hwmon: Adding addtitional sysfs entries
@ 2014-05-10 13:22 Andreas Werner
  2014-05-10 12:32 ` Guenter Roeck
  0 siblings, 1 reply; 5+ messages in thread
From: Andreas Werner @ 2014-05-10 13:22 UTC (permalink / raw)
  To: linux-kernel; +Cc: khali, linux, andreas.werner

Hi,
i am currently working on an implemenation of my Board Management Controller (BMC).

This Controller is a MCR assembled on almost all of our Compact PCI or Compact PCI Serial
Cards as well as on some other CPU Boards.

The BMC includes LED´s, Watchdog, Voltage Monitoring and some other features.
I have already implemented an MFD driver, LED and Watchdog driver.

Currently i am working on the hwmon implemenation. This includes for the first step the
voltage monitoring.

The BMC has some other feature which are not supported by any of the subsystem.
 - Errorcounter (Board status)
 - Power Failure status
 - Operating ours
 - Do software reset, do cold reset
 - Set power modes
 - Backplate Geographical Address

These are all informations related to the Board where the BMC is assembled to.
I think all those features could be part of the hwmon implementation.

Is it possible to add "custom" sysfs entries in my hwmon driver to support all these features?
Does lm-sensor ingore those custom features or is it a problem for lm-sensors?

What is the normal way to add those features?

Regards
Andy

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Question: hwmon: Adding addtitional sysfs entries
  2014-05-10 16:02   ` Andreas Werner
@ 2014-05-10 15:32     ` Guenter Roeck
  2014-05-14  6:44       ` Andreas Werner
  0 siblings, 1 reply; 5+ messages in thread
From: Guenter Roeck @ 2014-05-10 15:32 UTC (permalink / raw)
  To: Andreas Werner; +Cc: linux-kernel, khali, andreas.werner

On 05/10/2014 09:02 AM, Andreas Werner wrote:
> On Sat, May 10, 2014 at 05:32:13AM -0700, Guenter Roeck wrote:
>> On 05/10/2014 06:22 AM, Andreas Werner wrote:
>>> Hi,
>>> i am currently working on an implemenation of my Board Management Controller (BMC).
>>>
>>> This Controller is a MCR assembled on almost all of our Compact PCI or Compact PCI Serial
>>> Cards as well as on some other CPU Boards.
>>>
>>> The BMC includes LED´s, Watchdog, Voltage Monitoring and some other features.
>>> I have already implemented an MFD driver, LED and Watchdog driver.
>>>
>>> Currently i am working on the hwmon implemenation. This includes for the first step the
>>> voltage monitoring.
>>>
>>> The BMC has some other feature which are not supported by any of the subsystem.
>>>   - Errorcounter (Board status)
>>>   - Power Failure status
>>>   - Operating ours
>>
>> Guess you mean hours here.
>
> Yes sorry my mistake.
>
>>
>>>   - Do software reset, do cold reset
>>>   - Set power modes
>>>   - Backplate Geographical Address
>>>
>>> These are all informations related to the Board where the BMC is assembled to.
>>> I think all those features could be part of the hwmon implementation.
>>>
>> Why ?
>
> As all of the settings are CPU board related i thought it will be an good idea
> to put as much settings as possible to a group to one subsystem.
> This would be easier for the User Application.
>
Bad argument, even for the users. A user would not normally expect to find
the above information in unrelated subsystems such as hwmon. Keep in mind that
the Linux kernel is supposed to be useful for more than the application developers
in your company, and think about it - assume you would have to implement an
application which runs on more than one hardware, and attributes like the above
would be spread throughout the system. It would be all but impossible to write
generic applications, so you would want to avoid adding anything non-standard
as much as you can. And if you have to implement something non-standard, at least
implement it where people at least have a chance to find it.

>>
>>> Is it possible to add "custom" sysfs entries in my hwmon driver to support all these features?
>>> Does lm-sensor ingore those custom features or is it a problem for lm-sensors?
>>>
>>> What is the normal way to add those features?
>>>
>>
>> The hwmon subsystem isn't really the correct location for this functionality.
>> Power management should be done with a regulator driver (possibly power).
>> The other attributes and functionality would better fit into the mfd core
>> driver.
>>
>
> MFD Core sounds good. That is also perfect for the User App.
>
>> You might want to tie the reset functions into the system reset functionality.
>
> I do not understand this. Is there another subsystem or something like that
> were I can put the Reset stuff to?
>
Assuming you are talking about system reset, there is a function named machine_restart()
to accomplish that. This is architecture and, in many cases, machine specific functionality.
For example, many arm architectures have a different means to reset the system, and there
is a separate function pointer named arm_pm_restart to tie into that functionality.

Many restart functions are implemented in the drivers/power/reset directory, which may be
a good location for yours.

>
> I guess the hwmon subsys is the right place for the voltage monitoring (3,3V, 5V etc) isn´t it?
>
Yes, that is what it is for.

Guenter


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Question: hwmon: Adding addtitional sysfs entries
  2014-05-10 12:32 ` Guenter Roeck
@ 2014-05-10 16:02   ` Andreas Werner
  2014-05-10 15:32     ` Guenter Roeck
  0 siblings, 1 reply; 5+ messages in thread
From: Andreas Werner @ 2014-05-10 16:02 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: linux-kernel, khali, andreas.werner

On Sat, May 10, 2014 at 05:32:13AM -0700, Guenter Roeck wrote:
> On 05/10/2014 06:22 AM, Andreas Werner wrote:
> >Hi,
> >i am currently working on an implemenation of my Board Management Controller (BMC).
> >
> >This Controller is a MCR assembled on almost all of our Compact PCI or Compact PCI Serial
> >Cards as well as on some other CPU Boards.
> >
> >The BMC includes LED´s, Watchdog, Voltage Monitoring and some other features.
> >I have already implemented an MFD driver, LED and Watchdog driver.
> >
> >Currently i am working on the hwmon implemenation. This includes for the first step the
> >voltage monitoring.
> >
> >The BMC has some other feature which are not supported by any of the subsystem.
> >  - Errorcounter (Board status)
> >  - Power Failure status
> >  - Operating ours
> 
> Guess you mean hours here.

Yes sorry my mistake.

> 
> >  - Do software reset, do cold reset
> >  - Set power modes
> >  - Backplate Geographical Address
> >
> >These are all informations related to the Board where the BMC is assembled to.
> >I think all those features could be part of the hwmon implementation.
> >
> Why ?

As all of the settings are CPU board related i thought it will be an good idea
to put as much settings as possible to a group to one subsystem.
This would be easier for the User Application.

> 
> >Is it possible to add "custom" sysfs entries in my hwmon driver to support all these features?
> >Does lm-sensor ingore those custom features or is it a problem for lm-sensors?
> >
> >What is the normal way to add those features?
> >
> 
> The hwmon subsystem isn't really the correct location for this functionality.
> Power management should be done with a regulator driver (possibly power).
> The other attributes and functionality would better fit into the mfd core
> driver.
> 

MFD Core sounds good. That is also perfect for the User App. 

> You might want to tie the reset functions into the system reset functionality.

I do not understand this. Is there another subsystem or something like that
were I can put the Reset stuff to?

> 
> Guenter
> 


I guess the hwmon subsys is the right place for the voltage monitoring (3,3V, 5V etc) isn´t it?


Regards Andy

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Question: hwmon: Adding addtitional sysfs entries
  2014-05-10 15:32     ` Guenter Roeck
@ 2014-05-14  6:44       ` Andreas Werner
  0 siblings, 0 replies; 5+ messages in thread
From: Andreas Werner @ 2014-05-14  6:44 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: linux-kernel, khali, andreas.werner

On Sat, May 10, 2014 at 08:32:40AM -0700, Guenter Roeck wrote:
> On 05/10/2014 09:02 AM, Andreas Werner wrote:
> >On Sat, May 10, 2014 at 05:32:13AM -0700, Guenter Roeck wrote:
> >>On 05/10/2014 06:22 AM, Andreas Werner wrote:
> >>>Hi,
> >>>i am currently working on an implemenation of my Board Management Controller (BMC).
> >>>
> >>>This Controller is a MCR assembled on almost all of our Compact PCI or Compact PCI Serial
> >>>Cards as well as on some other CPU Boards.
> >>>
> >>>The BMC includes LED´s, Watchdog, Voltage Monitoring and some other features.
> >>>I have already implemented an MFD driver, LED and Watchdog driver.
> >>>
> >>>Currently i am working on the hwmon implemenation. This includes for the first step the
> >>>voltage monitoring.
> >>>
> >>>The BMC has some other feature which are not supported by any of the subsystem.
> >>>  - Errorcounter (Board status)
> >>>  - Power Failure status
> >>>  - Operating ours
> >>
> >>Guess you mean hours here.
> >
> >Yes sorry my mistake.
> >
> >>
> >>>  - Do software reset, do cold reset
> >>>  - Set power modes
> >>>  - Backplate Geographical Address
> >>>
> >>>These are all informations related to the Board where the BMC is assembled to.
> >>>I think all those features could be part of the hwmon implementation.
> >>>
> >>Why ?
> >
> >As all of the settings are CPU board related i thought it will be an good idea
> >to put as much settings as possible to a group to one subsystem.
> >This would be easier for the User Application.
> >
> Bad argument, even for the users. A user would not normally expect to find
> the above information in unrelated subsystems such as hwmon. Keep in mind that
> the Linux kernel is supposed to be useful for more than the application developers
> in your company, and think about it - assume you would have to implement an
> application which runs on more than one hardware, and attributes like the above
> would be spread throughout the system. It would be all but impossible to write
> generic applications, so you would want to avoid adding anything non-standard
> as much as you can. And if you have to implement something non-standard, at least
> implement it where people at least have a chance to find it.
>
Ok, you are right :-)
 
> >>
> >>>Is it possible to add "custom" sysfs entries in my hwmon driver to support all these features?
> >>>Does lm-sensor ingore those custom features or is it a problem for lm-sensors?
> >>>
> >>>What is the normal way to add those features?
> >>>
> >>
> >>The hwmon subsystem isn't really the correct location for this functionality.
> >>Power management should be done with a regulator driver (possibly power).
> >>The other attributes and functionality would better fit into the mfd core
> >>driver.
> >>
> >
> >MFD Core sounds good. That is also perfect for the User App.
> >
> >>You might want to tie the reset functions into the system reset functionality.
> >
> >I do not understand this. Is there another subsystem or something like that
> >were I can put the Reset stuff to?
> >
> Assuming you are talking about system reset, there is a function named machine_restart()
> to accomplish that. This is architecture and, in many cases, machine specific functionality.
> For example, many arm architectures have a different means to reset the system, and there
> is a separate function pointer named arm_pm_restart to tie into that functionality.
> 
> Many restart functions are implemented in the drivers/power/reset directory, which may be
> a good location for yours.
> 
Just for explanation and to avoid missunderstanding. The reset functionality of the BMC
is to send a I2C command from the Host to the BMC, and the BMC does the reset or power down.

There is also a functionality where you can send a command the Controller and he will press
the "power button" which cause an ACPI event to shutdown the PC if configured.

Thanks for the /drivers/power informations there is really nice code in there where I can
pick up some stuff to implement functions like that.

> >
> >I guess the hwmon subsys is the right place for the voltage monitoring (3,3V, 5V etc) isn´t it?
> >
> Yes, that is what it is for.

Thanks, works fine. Nice integration in lm_sensors thats what I love in Linux :-)
> 
> Guenter
> 
Regards
Andy

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-05-14  6:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-10 13:22 Question: hwmon: Adding addtitional sysfs entries Andreas Werner
2014-05-10 12:32 ` Guenter Roeck
2014-05-10 16:02   ` Andreas Werner
2014-05-10 15:32     ` Guenter Roeck
2014-05-14  6:44       ` Andreas Werner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).