aboutsummaryrefslogtreecommitdiff
path: root/core/timebase.c
AgeCommit message (Collapse)AuthorFilesLines
2017-06-06Improve cpu_idle when PM is disabledNicholas Piggin1-20/+8
Split cpu_idle() into cpu_idle_delay() and cpu_idle_job() rather than requesting the idle type as a function argument. Have those functions provide a default polling (non-PM) implentation which spin at the lowest SMT priority. This moves all the decrementer delay code into the CPU idle code rather than the caller. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-08-22time: Setup DEC and call cpu_idle() in time_wait_nopoll()Benjamin Herrenschmidt1-2/+15
This will currently do nothing more than spin but will eventually allow us to nap until the decrementer fires. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-08-11time: Improve time_wait_poll()Benjamin Herrenschmidt1-1/+2
Call time_wait_nopoll() when period is smaller than remaining Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-07-06Timebase quirk for slow simulators like AWAN and SIMICSBenjamin Herrenschmidt1-1/+7
This will internally pretend the timebase is running 1000 times slower, which reduces some otherwise really terrible delays in some simulators. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Acked-by: Michael Neuling <mikey@neuling.org> [stewart@linux.vnet.ibm.com: move cfam_chipid cleanup into own patch] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-09-15opal: Fix hang in time_wait* calls on HMI for TB errors.Mahesh Salgaonkar1-0/+10
On TOD/TB errors timebase register stops/freezes until HMI error recovery gets TOD/TB back into running state. However, while HMI recovery is in progress there are chances where some code path may invoke time_wait*() calls which depends on running TB value. In an event of TB not moving, time_wait* calls would keep looping resulting into a hang on that CPU. On OpenPower systems we are seeing system hang on TOD/TB errors. The hang is seen inside OPAL HMI handler while invoking prlog/perror(). The reason is, on OpenPower systems prlog/perror() depends on LPC UART console driver to flush log messages to the console. UART read/write calls invoke time_wait_nopoll() inside opb_[read|write]() functions. When TB is in stopped state this causes a hang in prlog/perror() calls. This patch fixes this issue by modifying time_wait_[no]poll() to check for TB validity and return immediately. Signed-off-by: Mahesh Salgaonkar <mahesh@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-02-18Don't run pollers in time_wait() when a lock is heldBenjamin Herrenschmidt1-1/+9
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-02-17timebase: Add nanosleep_nopollAnanth N Mavinakayanahalli1-0/+11
For use by hservices mainly... Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Acked-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-10-01core: make time_wait call pollers if on boot CPUJoel Stanley1-4/+20
Instead of running the pollers flat out, instead call them once every 5ms. This helps in situations where pollers are taking locks that are also taken by tasks completing on other CPUs. The 5ms time is arbitrary; it was chosen such that most callers of time_wait will call the pollers at least twice. Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-13Add cpu_relax to stop cores spinning hardJoel Stanley1-2/+6
Ensure a thread is not stopping its siblings from making forward progress when we are busy-waiting on older DD1.x CPU revisions where SMT priorities are somewhat broken. Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-07-08timebase: Add "nopoll" variants of the delaysBenjamin Herrenschmidt1-0/+18
In case where we don't want to recurse into opal pollers Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-07-08opal: Replace fsp_poll() with a full run of all OPAL pollersBenjamin Herrenschmidt1-2/+2
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/+67
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>