From: Greg Kroah-Hartman Date: Fri, 8 Nov 2019 14:08:45 +0000 (+0100) Subject: 4.14-stable patches X-Git-Tag: v4.4.200~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5bd8ad6b0b56cd0cfcef89fb37fe38c88c8111da;p=thirdparty%2Fkernel%2Fstable-queue.git 4.14-stable patches added patches: platform-x86-pmc_atom-add-siemens-simatic-ipc227e-to-critclk_systems-dmi-table.patch sched-wake_q-fix-wakeup-ordering-for-wake_q.patch --- diff --git a/queue-4.14/platform-x86-pmc_atom-add-siemens-simatic-ipc227e-to-critclk_systems-dmi-table.patch b/queue-4.14/platform-x86-pmc_atom-add-siemens-simatic-ipc227e-to-critclk_systems-dmi-table.patch new file mode 100644 index 00000000000..3793e88a6b7 --- /dev/null +++ b/queue-4.14/platform-x86-pmc_atom-add-siemens-simatic-ipc227e-to-critclk_systems-dmi-table.patch @@ -0,0 +1,38 @@ +From ad0d315b4d4e7138f43acf03308192ec00e9614d Mon Sep 17 00:00:00 2001 +From: Jan Kiszka +Date: Wed, 4 Sep 2019 08:42:30 +0200 +Subject: platform/x86: pmc_atom: Add Siemens SIMATIC IPC227E to critclk_systems DMI table + +From: Jan Kiszka + +commit ad0d315b4d4e7138f43acf03308192ec00e9614d upstream. + +The SIMATIC IPC227E uses the PMC clock for on-board components and gets +stuck during boot if the clock is disabled. Therefore, add this device +to the critical systems list. + +Fixes: 648e921888ad ("clk: x86: Stop marking clocks as CLK_IS_CRITICAL") +Signed-off-by: Jan Kiszka +Signed-off-by: Andy Shevchenko +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/platform/x86/pmc_atom.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/drivers/platform/x86/pmc_atom.c ++++ b/drivers/platform/x86/pmc_atom.c +@@ -475,6 +475,13 @@ static const struct dmi_system_id critcl + DMI_MATCH(DMI_BOARD_NAME, "CB6363"), + }, + }, ++ { ++ .ident = "SIMATIC IPC227E", ++ .matches = { ++ DMI_MATCH(DMI_SYS_VENDOR, "SIEMENS AG"), ++ DMI_MATCH(DMI_PRODUCT_VERSION, "6ES7647-8B"), ++ }, ++ }, + { /*sentinel*/ } + }; + diff --git a/queue-4.14/sched-wake_q-fix-wakeup-ordering-for-wake_q.patch b/queue-4.14/sched-wake_q-fix-wakeup-ordering-for-wake_q.patch new file mode 100644 index 00000000000..677c7b71258 --- /dev/null +++ b/queue-4.14/sched-wake_q-fix-wakeup-ordering-for-wake_q.patch @@ -0,0 +1,93 @@ +From 4c4e3731564c8945ac5ac90fc2a1e1f21cb79c92 Mon Sep 17 00:00:00 2001 +From: Peter Zijlstra +Date: Mon, 17 Dec 2018 10:14:53 +0100 +Subject: sched/wake_q: Fix wakeup ordering for wake_q + +From: Peter Zijlstra + +commit 4c4e3731564c8945ac5ac90fc2a1e1f21cb79c92 upstream. + +Notable cmpxchg() does not provide ordering when it fails, however +wake_q_add() requires ordering in this specific case too. Without this +it would be possible for the concurrent wakeup to not observe our +prior state. + +Andrea Parri provided: + + C wake_up_q-wake_q_add + + { + int next = 0; + int y = 0; + } + + P0(int *next, int *y) + { + int r0; + + /* in wake_up_q() */ + + WRITE_ONCE(*next, 1); /* node->next = NULL */ + smp_mb(); /* implied by wake_up_process() */ + r0 = READ_ONCE(*y); + } + + P1(int *next, int *y) + { + int r1; + + /* in wake_q_add() */ + + WRITE_ONCE(*y, 1); /* wake_cond = true */ + smp_mb__before_atomic(); + r1 = cmpxchg_relaxed(next, 1, 2); + } + + exists (0:r0=0 /\ 1:r1=0) + + This "exists" clause cannot be satisfied according to the LKMM: + + Test wake_up_q-wake_q_add Allowed + States 3 + 0:r0=0; 1:r1=1; + 0:r0=1; 1:r1=0; + 0:r0=1; 1:r1=1; + No + Witnesses + Positive: 0 Negative: 3 + Condition exists (0:r0=0 /\ 1:r1=0) + Observation wake_up_q-wake_q_add Never 0 3 + +Reported-by: Yongji Xie +Signed-off-by: Peter Zijlstra (Intel) +Cc: Davidlohr Bueso +Cc: Linus Torvalds +Cc: Peter Zijlstra +Cc: Thomas Gleixner +Cc: Waiman Long +Cc: Will Deacon +Signed-off-by: Ingo Molnar +Signed-off-by: Jisheng Zhang +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/sched/core.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +--- a/kernel/sched/core.c ++++ b/kernel/sched/core.c +@@ -432,10 +432,11 @@ void wake_q_add(struct wake_q_head *head + * its already queued (either by us or someone else) and will get the + * wakeup due to that. + * +- * This cmpxchg() implies a full barrier, which pairs with the write +- * barrier implied by the wakeup in wake_up_q(). ++ * In order to ensure that a pending wakeup will observe our pending ++ * state, even in the failed case, an explicit smp_mb() must be used. + */ +- if (cmpxchg(&node->next, NULL, WAKE_Q_TAIL)) ++ smp_mb__before_atomic(); ++ if (cmpxchg_relaxed(&node->next, NULL, WAKE_Q_TAIL)) + return; + + get_task_struct(task); diff --git a/queue-4.14/series b/queue-4.14/series index 392f289ca0b..d65f6e94321 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -48,5 +48,7 @@ erspan-fix-the-tun_info-options_len-check-for-erspan.patch inet-stop-leaking-jiffies-on-the-wire.patch net-flow_dissector-switch-to-siphash.patch dmaengine-qcom-bam_dma-fix-resource-leak.patch +sched-wake_q-fix-wakeup-ordering-for-wake_q.patch kbuild-use-fmacro-prefix-map-to-make-__file__-a-rela.patch kbuild-add-fcf-protection-none-when-using-retpoline-.patch +platform-x86-pmc_atom-add-siemens-simatic-ipc227e-to-critclk_systems-dmi-table.patch