Subject: Re: [PATCH V4] powerpc, powernv: Add OPAL platform event driver

From: Vipin K Parashar <[email-masked]>
Date: Thu, 12 Feb 2015 11:17:38 +0530

On 02/11/2015 10:32 AM, Stewart Smith wrote:
> Vipin K Parashar <[email-masked]> writes:
>> 	(1) Environmental and Power Warning (EPOW)
>> 	(2) Delayed Power Off (DPO)
>> The user interface for this driver is /dev/opal_event character
>> device file where the user space clients can poll and read for
>> new opal platform events. The expected sequence of events driven
>> from user space should be like the following.
>>
>> 	(1) Open the character device file
>> 	(2) Poll on the file for POLLIN event
>> 	(3) When unblocked, must attempt to read OPAL_PLAT_EVENT_MAX_SIZE size
>> 	(4) Kernel driver will pass at most one opal_plat_event structure
>> 	(5) Poll again for more new events
> A few thoughts from discussing with Michael and Joel:
> - not convinced that a chardev is the most ideal way to notify
>    userspace. It seems like yet-another powerpc specific notification
>    mechanism, which isn't ideal.
> - netlink probably isn't right either (although maybe *sligthtly*
>    better?)
> - it seems that the "standard" way is ACPI, so I wonder if we could emit
>    an ACPI event and essentially fake having ACPI... that would make all
>    existing userspace "just work", right?
>    Looking at acpi_bus_generate_netlink_event call in
>    drivers/acpi/button.c it looks possible that we may be able to
>    (relatively simply) do that?
Thanks Stewart, i will explore more about ACPI and will also try to see 
if we could use it to throw
events to guests.
> - What do UPSs do? It would seem that some common "this is what's about
>    to happen to your power" would almost *have* to exist somewhat
>    generically?
UPS class tells about UPS status with system. FSP sends mbox messages 
with UPS status along with
UPS status bit which tells exactly as to what change is there in UPS 
status like UPS installed, UPS battery low, UPS removed (By passed). We 
plan to add support for these UPS events in skiboot to provide more
UPS details.
> I strongly advocate for anything that doesn't require custom userspace
> that's OPAL/POWER specific (that we then have to get into distros etc etc
>
> _______________________________________________
> Linuxppc-dev mailing list
> [email-masked]
> https://lists.ozlabs.org/listinfo/linuxppc-dev