From: Greg Kroah-Hartman Date: Sun, 20 May 2018 07:55:40 +0000 (+0200) Subject: 3.18-stable patches X-Git-Tag: v4.9.102~33 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a34a13fc92d73d1611b78c8bd60be95650bc79fd;p=thirdparty%2Fkernel%2Fstable-queue.git 3.18-stable patches added patches: powerpc-powernv-fix-nvram-sleep-in-invalid-context-when-crashing.patch --- diff --git a/queue-3.18/powerpc-powernv-fix-nvram-sleep-in-invalid-context-when-crashing.patch b/queue-3.18/powerpc-powernv-fix-nvram-sleep-in-invalid-context-when-crashing.patch new file mode 100644 index 00000000000..58a637c7d15 --- /dev/null +++ b/queue-3.18/powerpc-powernv-fix-nvram-sleep-in-invalid-context-when-crashing.patch @@ -0,0 +1,55 @@ +From c1d2a31397ec51f0370f6bd17b19b39152c263cb Mon Sep 17 00:00:00 2001 +From: Nicholas Piggin +Date: Tue, 15 May 2018 01:59:47 +1000 +Subject: powerpc/powernv: Fix NVRAM sleep in invalid context when crashing + +From: Nicholas Piggin + +commit c1d2a31397ec51f0370f6bd17b19b39152c263cb upstream. + +Similarly to opal_event_shutdown, opal_nvram_write can be called in +the crash path with irqs disabled. Special case the delay to avoid +sleeping in invalid context. + +Fixes: 3b8070335f75 ("powerpc/powernv: Fix OPAL NVRAM driver OPAL_BUSY loops") +Cc: stable@vger.kernel.org # v3.2 +Signed-off-by: Nicholas Piggin +Signed-off-by: Michael Ellerman +Signed-off-by: Greg Kroah-Hartman + +--- + arch/powerpc/platforms/powernv/opal-nvram.c | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + +--- a/arch/powerpc/platforms/powernv/opal-nvram.c ++++ b/arch/powerpc/platforms/powernv/opal-nvram.c +@@ -43,6 +43,10 @@ static ssize_t opal_nvram_read(char *buf + return count; + } + ++/* ++ * This can be called in the panic path with interrupts off, so use ++ * mdelay in that case. ++ */ + static ssize_t opal_nvram_write(char *buf, size_t count, loff_t *index) + { + s64 rc = OPAL_BUSY; +@@ -57,10 +61,16 @@ static ssize_t opal_nvram_write(char *bu + while (rc == OPAL_BUSY || rc == OPAL_BUSY_EVENT) { + rc = opal_write_nvram(__pa(buf), count, off); + if (rc == OPAL_BUSY_EVENT) { +- msleep(OPAL_BUSY_DELAY_MS); ++ if (in_interrupt() || irqs_disabled()) ++ mdelay(OPAL_BUSY_DELAY_MS); ++ else ++ msleep(OPAL_BUSY_DELAY_MS); + opal_poll_events(NULL); + } else if (rc == OPAL_BUSY) { +- msleep(OPAL_BUSY_DELAY_MS); ++ if (in_interrupt() || irqs_disabled()) ++ mdelay(OPAL_BUSY_DELAY_MS); ++ else ++ msleep(OPAL_BUSY_DELAY_MS); + } + } + diff --git a/queue-3.18/series b/queue-3.18/series index 9c60991326f..32cf9b2f2d6 100644 --- a/queue-3.18/series +++ b/queue-3.18/series @@ -30,3 +30,4 @@ alsa-usb-mixer-volume-quirk-for-cm102-a-102s.patch alsa-control-fix-a-redundant-copy-issue.patch powerpc-don-t-preempt_disable-in-show_cpuinfo.patch tracing-x86-xen-remove-zero-data-size-trace-events-trace_xen_mmu_flush_tlb-_all.patch +powerpc-powernv-fix-nvram-sleep-in-invalid-context-when-crashing.patch