Thread (4 messages) 4 messages, 3 authors, 2021-09-27

Re: Communication between kernel and user-space

From: Thomas Marangoni <hidden>
Date: 2021-08-31 06:49:10

What kind of devices is it going to handle, specifically?
The AXP209 is a power management chip for e.g. Allwinner A20 (ARM 
architecture), I want to focus on the axp20x-battery driver.
quoted
The device has multiple
warnings like: temperature too high or low,
You should be able to use the existing thermal framework for this.
quoted
over-voltage, under-voltage
But there's no generic way to communicate those AFAICS.

The question here is what user space is going to do about them, though.
Events I like to communicate to the user-space:

- Battery Temperature to high (as already mentioned, possible with 
thermal framework)
- Battery Temperature to low (as already mentioned, possible with 
thermal framework)
- AXP209Internal over-temperature (should also be possible with thermal 
framework)
- Low Voltage Level 2 (shuts down the device)

- Low Voltage Level 1
- Over Voltage
- Under Voltage
- Chargingcurrent shortage

In my case the application would prepare for a shutdown if the low 
voltage warning level 1 event is received. For the other events the user 
would get a warning with instruction how to handle them from the 
application.
quoted
etc. What is the recommended way to communicate such warnings to the
user-space, besides dmesg, so programs can handle them? Or should I just
create my own attribute for each warning and set it to a specific value
from the kernel and let user-space applications reset them to
acknowledge them? And if there is a recommended way can you name me a
driver that is using it?

Thanks for your help!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help