aboutsummaryrefslogtreecommitdiff
path: root/core/opal.c
AgeCommit message (Collapse)AuthorFilesLines
2018-01-05core/opal: check ibm,opal existsOliver O'Halloran1-5/+1
The ibm,opal node is normally created by Skiboot either in the HDAT parser or after the input FDT has been unflattened. However, in order to supply the /ibm,opal/power-mgt/enabled-stop-states property FDT we to tolerate /ibm,opal/ existing in the input tree. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Acked-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> (cherry picked from commit eeba2d64fb7ac929283ed4611ca04209278eb777) Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-06-09FSP: Notify FSP of Platform Log ID after Host Initiated Reset ReloadStewart Smith1-1/+11
Trigging a Host Initiated Reset (when the host detects the FSP has gone out to lunch and should be rebooted), would cause "Unknown Command" messages to appear in the OPAL log. This patch implements those messages How to trigger FSP RR(HIR): $ putmemproc 300000f8 0x00000000deadbeef s1 k0:n0:s0:p00 ecmd_ppc putmemproc 300000f8 0x00000000deadbeef Log showing unknown command: / # cat /sys/firmware/opal/msglog | grep -i ,3 [ 110.232114723,3] FSP: fsp_trigger_reset() entry [ 188.431793837,3] FSP #0: Link down, starting R&R [ 464.109239162,3] FSP #0: Got XUP with no pending message ! [ 466.340598554,3] FSP-DPO: Unknown command 0xce0900 [ 466.340600126,3] FSP: Unhandled message ce0900 The message we need to handle is "Get PLID after host initiated FipS reset/reload". When the FSP comes back from HIR, it asks "hey, so, which error log explains why you rebooted me?". So, we tell it. Reported-by: Pridhiviraj Paidipeddi <ppaidipe@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> (cherry picked from commit f3a5741408a11be6992cf8779f2eae10b08c020a) Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-11-24Limit number of "Poller recursion detected" errors to displayStewart Smith1-1/+5
In some error conditions, we could spiral out of control on this and spend all of our time printing the exact same backtrace. Limit it to 16 times, because 16 is a nice number. Cc: stable Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> (cherry picked from commit b6a729e118f42dae88ebf70a09a7e2aa4f788fdc) Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-09-22core: Create event node to enable irqchipSam Mendoza-Jonas1-0/+7
This allows devices such as IPMI and serial consoles to use dynamic irq numbers and have separate irq numbers in Linux. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com> Signed-off-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-08-17Use additional checks in skiboot for pointersBalbir Singh1-0/+4
The checks validate pointers sent in using opal_addr_valid() in opal_call API's provided via the console, cpu, fdt, flash, i2c, interrupts, nvram, opal-msg, opal, opal-pci, xscom and cec modules Signed-off-by: Balbir Singh <bsingharora@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-07-20device-tree: Only advertise ibm, opal-v3 (not v2) on POWER9 and aboveStewart Smith1-2/+7
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-06-27core/opal.c: Add FWTS annotations for pollers and missing OPAL_CHECK_TOKENStewart Smith1-2/+30
For the missing OPAL_CHECK_TOKEN call, it means we catch kernel bugs in the firmware test suite, which I guess is a valid thing to do, if slightly odd. Unfortunately, kernels for POWER8 systems shipped with this (totally harmless) bug, so it's possible that if FWTS is run on older POWER8 PowerNV kernels, this warning will be hit. On POWER9 and above though, this warning should never be hit. The annotations for pollers should also never be hit, although I'm not convinced we don't have a spot or two in OPAL where this could still be the case (specifically, under certain error conditions). Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-06-20Add fwts annotations for critical errorsStewart Smith1-0/+5
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-11-09Fix sparse warnings in opal_trace_entry()Stewart Smith1-5/+6
Need to flip things appropriately for endian annotations No actual functional changes since skiboot is still BE, but we're a bit more explicit about the fact the ABI is BE. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-11-09Fixup sparse endian annotations for opal events and masksStewart Smith1-2/+2
This fixes many spurious sparse warnings Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-10-30slw: Move add_cpu_idle_state_properties() to add_opal_node()Shilpasri G Bhat1-0/+1
05f52a8dd7c7e402896e049fd24f83d56b70aff4 core: Setup the OPAL DT node before platform probe add_cpu_idle_state_properties() was made local to slw.c in the above commit which caused p7 systems to not populate the nap idle state in DT. So moving add_cpu_idle_state_properties() to add_opal_node to fix this bug. Reported-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-09-10Remove FIXME for using atomics for opal_pending_eventsStewart Smith1-1/+0
The locking code is obviously correct and it's never shown up in a profile - so it's likely fine for a while yet. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-09-10remove FIXME from opal_trace_entryStewart Smith1-1/+0
We unlikely need this as ASM until somebody finds it to be a problem. So removing the FIXME so that it doesn't show up when grepping for FIXMEs. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-07-08fix potential integer overflow for giant cpu_max_pirStewart Smith1-1/+1
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-05-07OPAL: Validate before creating opal device tree nodeVasant Hegde1-1/+5
On FSP based machine, attention LED location code is passed to OPAL via HDAT. We want to populate this information in device tree under led node, so that LED driver can use this information. Presently we are creating '/ibm,opal' node after parsing hdata information. This patch validates '/ibm,opal' node before creating. So on FSP based machine we can create this node in hdata itself without breaking. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-04-01Remove redundant includes of opal-api.hMichael Ellerman1-1/+0
Now that opal.h includes opal-api.h, there are a bunch of files that include both but don't need to. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-03-19OPAL: Detect recursive poller entry from same CPUVasant Hegde1-0/+11
Detect recursive opal poller call from same CPU. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-02-18Limit number of warnings of pollers run with lock heldStewart Smith1-1/+6
Otherwise we pretty much spin in printing backtraces on some machines. A limit of 64 per boot is likely to give us enough bugs to fix. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-02-18Warn when pollers are called with a lock heldBenjamin Herrenschmidt1-0/+5
So we can start fixing those cases Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-02-06Move skiboot internal things from opal.h to opal-api.hStewart Smith1-0/+1
This is probably not the best collection of things in the world, but it means that opal.h is much closer to being directly usable by an OS. This triggers a bunch of #include fixes throughout the tree. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-12-05opal: Don't put the symbol map whole into a propertyBenjamin Herrenschmidt1-3/+5
The huge property trips a bug in some versions of kexec, and it generally makes looking at the device-tree more painful than it has to be. Instead, let's just pass the address & size and we'll add a debugfs file on the Linux side to recover them. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-11-22Merge remote-tracking branch 'ltcgit/master'Benjamin Herrenschmidt1-1/+1
2014-11-19Implement skiboot versioningStewart Smith1-1/+1
We grab a version from git tags (or SKIBOOT_VERSION environment variable), optionally tack on EXTRA_VERSION (if from git) as well as add things to the git version number if we're ahead of the most recent tag or the tree is dirty. Also fix-up makefiles so that we don't have to rebuild version.c every time you run make. fsp attn area needed updating as we can have >40 character version strings. We also export the version string via device tree rather than just the gitid. For buildroot builds, setting SKIBOOT_VERSION environment variable to the tag you grab will do the correct thing. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-11-18Add symbolic backtraces and expose skiboot map to LinuxBenjamin Herrenschmidt1-0/+2
We use a double link technique, doing a first pass with a .o containing a dummy symbol map, then re-linking with a new .o Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-11-17Stack checking extensionsBenjamin Herrenschmidt1-0/+3
This patch adds: - Normal builds are done with -fstack-protector (we want to investigate using -fstack-protector-strong on gcc4.9 but for now we just use that - Build with STACK_CHECK=1 will use -fstack-protector-all and -pg and will check the stack in mcount Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-11-12timer: Only check "poll" timers on actual poll, not any interruptBenjamin Herrenschmidt1-1/+1
Due to the lack of SLW timed interrupt support, we take the opportunity to check out timers on any incoming interrupt. However we really don't want to do that for the background pollers. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-11-07timer: Add scheduled timer facilityBenjamin Herrenschmidt1-0/+4
For now running off the event pollers, that will improve once we get delayed interrupts from the SLW Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-10-30opal: Add facility for dynamic event bitsJeremy Kerr1-1/+39
We steal opal_update_pending_evt's lock for protecting the allocated dynamic event mask. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-10-24irq/occ/opal: Add self-sent dummy interruptBenjamin Herrenschmidt1-3/+18
This makes OPAL use the OCC interrupt facility to send itself an interrupt whenever the OPAL event bit is set as a result of an OPAL call that wasn't itself opal_handle_interrupt() or opal_handle_hmi() (both of which we know the OS will already deal with appropriately). This ensures that OPAL event changes are notified to Linux via its interrupt path which is necessary for it to properly broadcast the state change to its various clients. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-10-15opal_del_caller shouldn't be called: up severity level, change message.Stewart Smith1-1/+2
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-10-15Make assert(false) for calling attn be a PR_EMERG level errorStewart Smith1-1/+1
When we do something so severe we're asserting... we want that to be in the log! Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-09-01core: Setup the OPAL DT node before platform probeBenjamin Herrenschmidt1-1/+0
The platform probe code might want to add things to it. While at it, make add_cpu_idle_state_properties() local to slw.c and call it from slw_init() instead of from add_opal_node(). Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-07-13opal: poller re-entrancy try #3Benjamin Herrenschmidt1-31/+14
So my great attempt at avoiding all re-entencies fails due to HBRT... at least until we have some kind of way to thread things, it will have to re-enter so let's bite the bullet, make the poller list walking lockless (we'll handle removal when we have to, ie, not yet) and slightly extend the coverage of the PSI lock while at it. All the other pollers already have their own locks anyway so we are actually removing some overhead. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-07-08opal: Add a debug helper to check for poller recursionBenjamin Herrenschmidt1-1/+21
And check & warn inside opal_run_pollers() as well Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-07-08opal: Replace fsp_poll() with a full run of all OPAL pollersBenjamin Herrenschmidt1-10/+15
Otherwise we don't handle surveillance and PSI link monitoring This should fix cases of surveillance timeouts during things like code update such as BZ109939 Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-07-02Initial commit of Open Source releaseBenjamin Herrenschmidt1-0/+308
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>