summaryrefslogtreecommitdiffstats
path: root/core/timer.c
Commit message (Collapse)AuthorAgeFilesLines
* timer: Move update_timer_expiry call to separate functionVasant Hegde2018-05-061-9/+10
| | | | | Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* SBE: Add timer supportVasant Hegde2018-04-301-3/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SBE on P9 provides one shot programmable timer facility. We can use this to implement OPAL timers and hence limit the reliance on the Linux heartbeat (similar to HW timer facility provided by SLW on P8). Design: - We will continue to run Linux heartbeat. - Each chip has SBE. This patch always schedules timer on SBE on master chip. - Start timer option starts new timer or modifies an active timer for the specified timeout. - SBE expects timeout value in microseconds. We track timeout value in TB. Hence we convert tb to microseconds before sending request to SBE. - We are requesting ack from SBE for timer message. It gaurantees that SBE has scheduled timer. - Disabling SBE timer We expect SBE to send timer expiry interrupt whenever timer expires. We wait for 10 more ms before disabling timer. In future we can consider below alternative approaches: - Presently SBE timer disable is permanent (until we reboot system). SBE sends "I'm back" interrupt after reset. We can consider restarting timer after SBE reset. - Reset SBE and start timer again. - Each chip has SBE. On multi chip system we can try to schedule timer on different chip. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> CC: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* Move P8 timer code to separate fileVasant Hegde2018-04-301-4/+5
| | | | | | | | | | | | | Lets move P8 timer support code from slw.c to sbe-p8.c (as suggested by BenH). There is a difference between timer support in P8 and P9. Hence I think it makes sense to name it as sbe-p8.c. Note that this is pure code movement and renaming functions/variables. No functionality changes. Suggested-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* timer: Stop calling list_top() racilyBenjamin Herrenschmidt2017-12-111-4/+5
| | | | | | | | | | This will trip the debug checks in debug builds under some circumstances and is actually a rather bad idea as we might look at a timer that is concurrently being removed and modified, and thus incorrectly assume there is no work to do. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Convert important polling loops to spin at lowest SMT priorityNicholas Piggin2017-06-061-1/+4
| | | | | | | | | | | The pattern of calling cpu_relax() inside a polling loop does not suit the powerpc SMT priority instructions. Prefrred is to set a low priority then spin until break condition is reached, then restore priority. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> [stewart@linux.vnet.ibm.com: fixup lpc-uart wait_tx_room() and unit test] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* list: Use list_empty_nocheck() when checking a list racilyBenjamin Herrenschmidt2016-08-181-1/+1
| | | | | | | Otherwise we might trigger an assertion when list debug is enabled Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* core/timer: Add support for platform specific heartbeatChris Smart2016-07-221-6/+10
| | | | | | | | | | | | The timer code currently has a default and a special check for FSP machines or those with SLW timer facility. This patch adds support for platform quirk to set the timer. Signed-off-by: Chris Smart <chris@distroguy.com> Acked-by: Michael Neuling <mikey@neuling.org> [stewart@linux.vnet.ibm.com: fix whitespace issue] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* core/timer: Actually use default heartbeat valueChris Smart2016-07-221-3/+3
| | | | | | | | | | | | | | | | | HEARTBEAT_DEFAULT_MS sets the default heartbeat timeout, however this was not actually used as the default. The default was ten times quicker than this (HEARTBEAT_DEFAULT_MS / 10) while HEARTBEAT_DEFAULT_MS was actually used as a special case for FSP machines or those with SLW timer facility. This patch makes the default use HEARTBEAT_DEFAULT_MS and changes FSP or machines with SLW timer facility run 10 times slower (HEARTBEAT_DEFAULT_MS * 10). This will also now match the existing in-line comment. Signed-off-by: Chris Smart <chris@distroguy.com> Acked-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* slw/timer: SBE based timer supportBenjamin Herrenschmidt2015-09-111-24/+45
| | | | | | | | | | | | | Recent HostBoot & SBE firmware provide a HW timer facility that can be used to implement OPAL timers and thus limit the reliance on the Linux heartbeat. This implements support for it. The side effect is that i2c from Centaurs is now usable. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> [stewart@linux.vnet.ibm.com: fix run-timer unit test] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* timer: Pass current timer to timer callbacksBenjamin Herrenschmidt2015-09-111-4/+4
| | | | | | | | | The caller usually has it and it avoids additional mftb() which can be expensive. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> [stewart@linux.vnet.ibm.com: fix run-timer unit test] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Remove redundant includes of opal-api.hMichael Ellerman2015-04-011-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>
* Move skiboot internal things from opal.h to opal-api.hStewart Smith2015-02-061-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>
* timer: Change property name "ibm,heartbeat-freq" -> "ibm,heartbeat-ms"Benjamin Herrenschmidt2014-11-141-2/+2
| | | | Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* timer: Only check "poll" timers on actual poll, not any interruptBenjamin Herrenschmidt2014-11-121-2/+3
| | | | | | | | 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>
* timer: Add "polling" timersBenjamin Herrenschmidt2014-11-121-16/+126
| | | | | | | | | | | | | These have no expiry and get called whenever the opal pollers run, they are intended to replace most opal pollers and allow the same code in drivers to chose between a poller or a timer based on things like interrupt availability for example. The other advantage over existing pollers (which I hope to deprecate) is that they are protected against re-entrancy (while still running without locks held). Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* timer: Add scheduled timer facilityBenjamin Herrenschmidt2014-11-071-0/+134
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>
OpenPOWER on IntegriCloud