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

Stewart Smith stewart at linux.vnet.ibm.com
Wed Feb 11 16:02:22 AEDT 2015


Vipin K Parashar <vipin at linux.vnet.ibm.com> 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?
- 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?

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)



More information about the Linuxppc-dev mailing list