linux/arch/powerpc/platforms
Stewart Smith 774fea1a38 powerpc/powernv: Read OPAL error log and export it through sysfs
Based on a patch by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>

This patch adds support to read error logs from OPAL and export
them to userspace through a sysfs interface.

We export each log entry as a directory in /sys/firmware/opal/elog/

Currently, OPAL will buffer up to 128 error log records, we don't
need to have any knowledge of this limit on the Linux side as that
is actually largely transparent to us.

Each error log entry has the following files: id, type, acknowledge, raw.
Currently we just export the raw binary error log in the 'raw' attribute.
In a future patch, we may parse more of the error log to make it a bit
easier for userspace (e.g. to be able to display a brief summary in
petitboot without having to have a full parser).

If we have >128 logs from OPAL, we'll only be notified of 128 until
userspace starts acknowledging them. This limitation may be lifted in
the future and with this patch, that should "just work" from the linux side.

A userspace daemon should:
- wait for error log entries using normal mechanisms (we announce creation)
- read error log entry
- save error log entry safely to disk
- acknowledge the error log entry
- rinse, repeat.

On the Linux side, we read the error log when we're notified of it. This
possibly isn't ideal as it would be better to only read them on-demand.
However, this doesn't really work with current OPAL interface, so we
read the error log immediately when notified at the moment.

I've tested this pretty extensively and am rather confident that the
linux side of things works rather well. There is currently an issue with
the service processor side of things for >128 error logs though.

Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-03-07 16:19:00 +11:00
..
8xx powerpc: Remove unused REDBOOT Kconfig parameter 2013-12-30 14:17:00 +11:00
40x Removal of GENERIC_GPIO for v3.10 2013-05-09 09:59:16 -07:00
44x i2c: move OF helpers into the core 2013-08-23 10:22:20 +02:00
52xx Merge remote-tracking branch 'agust/next' into next 2014-01-29 16:53:55 +11:00
82xx powerpc: add explicit OF includes 2013-10-09 20:04:11 -05:00
83xx powerpc: Delete non-required instances of include <linux/init.h> 2014-01-15 13:46:44 +11:00
85xx Merge remote-tracking branch 'scott/next' into next 2014-01-15 14:22:35 +11:00
86xx powerpc: add explicit OF includes 2013-10-09 20:04:11 -05:00
512x powerpc/512x: clk: support MPC5121/5123/5125 SoC variants 2014-01-12 18:59:36 +01:00
amigaone pcspkr: Cleanup Kconfig dependencies 2011-06-09 15:01:41 +02:00
cell powerpc/iommu: Add it_page_shift field to determine iommu page size 2013-12-30 14:17:13 +11:00
chrp powerpc: Delete non-required instances of include <linux/init.h> 2014-01-15 13:46:44 +11:00
embedded6xx powerpc: Delete old PrPMC 280/2800 support 2014-03-07 15:54:48 +11:00
maple POWERPC: drivers: remove __dev* attributes. 2013-01-03 15:57:04 -08:00
pasemi powerpc: Delete non-required instances of include <linux/init.h> 2014-01-15 13:46:44 +11:00
powermac powerpc: Delete non-required instances of include <linux/init.h> 2014-01-15 13:46:44 +11:00
powernv powerpc/powernv: Read OPAL error log and export it through sysfs 2014-03-07 16:19:00 +11:00
ps3 powerpc/ps3: Remove inline marking of EXPORT_SYMBOL functions 2013-12-02 14:06:53 +11:00
pseries powerpc/pseries: Expose in kernel device tree update to drmgr 2014-03-07 15:54:50 +11:00
wsp powerpc/iommu: Add it_page_shift field to determine iommu page size 2013-12-30 14:17:13 +11:00
Kconfig powerpc: Better split CONFIG_PPC_INDIRECT_PIO and CONFIG_PPC_INDIRECT_MMIO 2013-08-14 14:57:50 +10:00
Kconfig.cputype powerpc/mm: Enable _PAGE_NUMA for book3s 2013-12-09 11:40:30 +11:00
Makefile powerpc: Remove the main legacy iSerie platform code 2012-03-09 10:35:11 +11:00
fsl_uli1575.c of/irq: Refactor interrupt-map parsing 2013-10-24 11:43:04 +01:00