From b434001e42f6eb5e24e5a07dc76d91f40aaf0520 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 27 May 2021 11:23:44 +0200 Subject: [PATCH] 4.14-stable patches added patches: mm-vmstat-drop-zone-lock-in-proc-pagetypeinfo.patch scripts-switch-explicitly-to-python-3.patch tweewide-fix-most-shebang-lines.patch usb-dwc3-gadget-enable-suspend-events.patch --- ...-drop-zone-lock-in-proc-pagetypeinfo.patch | 49 ++++ ...cripts-switch-explicitly-to-python-3.patch | 38 +++ queue-4.14/series | 4 + .../tweewide-fix-most-shebang-lines.patch | 237 ++++++++++++++++++ ...sb-dwc3-gadget-enable-suspend-events.patch | 43 ++++ 5 files changed, 371 insertions(+) create mode 100644 queue-4.14/mm-vmstat-drop-zone-lock-in-proc-pagetypeinfo.patch create mode 100644 queue-4.14/scripts-switch-explicitly-to-python-3.patch create mode 100644 queue-4.14/tweewide-fix-most-shebang-lines.patch create mode 100644 queue-4.14/usb-dwc3-gadget-enable-suspend-events.patch diff --git a/queue-4.14/mm-vmstat-drop-zone-lock-in-proc-pagetypeinfo.patch b/queue-4.14/mm-vmstat-drop-zone-lock-in-proc-pagetypeinfo.patch new file mode 100644 index 00000000000..03b264146e8 --- /dev/null +++ b/queue-4.14/mm-vmstat-drop-zone-lock-in-proc-pagetypeinfo.patch @@ -0,0 +1,49 @@ +From foo@baz Thu May 27 11:14:38 AM CEST 2021 +From: Stephen Brennan +Date: Wed, 26 May 2021 10:46:13 -0700 +Subject: mm, vmstat: drop zone->lock in /proc/pagetypeinfo +To: stable@vger.kernel.org +Cc: Stephen Brennan , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Christoph Lameter , Mel Gorman , Andy Whitcroft , Aruna Ramakrishna , Khalid Aziz +Message-ID: <20210526174613.339990-1-stephen.s.brennan@oracle.com> + +From: Stephen Brennan + +Commit 93b3a674485f6a4b8ffff85d1682d5e8b7c51560 upstream + +Commit 93b3a674485f ("mm,vmstat: reduce zone->lock holding time by +/proc/pagetypeinfo") upstream caps the number of iterations over each +free_list at 100,000, and also drops the zone->lock in between each +migrate type. Capping the iteration count alters the file contents in +some cases, which means this approach may not be suitable for stable +backports. + +However, dropping zone->lock in between migrate types (and, as a result, +page orders) will not change the /proc/pagetypeinfo file contents. It +can significantly reduce the length of time spent with IRQs disabled, +which can prevent missed interrupts or soft lockups which we have +observed on systems with particularly large memory. + +Thus, this commit is a modified version of the upstream one which only +drops the lock in between migrate types. + +Fixes: 467c996c1e19 ("Print out statistics in relation to fragmentation avoidance to /proc/pagetypeinfo") +Signed-off-by: Stephen Brennan +Reviewed-by: Aruna Ramakrishna +Reviewed-by: Khalid Aziz +Signed-off-by: Greg Kroah-Hartman +--- + mm/vmstat.c | 3 +++ + 1 file changed, 3 insertions(+) + +--- a/mm/vmstat.c ++++ b/mm/vmstat.c +@@ -1313,6 +1313,9 @@ static void pagetypeinfo_showfree_print( + list_for_each(curr, &area->free_list[mtype]) + freecount++; + seq_printf(m, "%6lu ", freecount); ++ spin_unlock_irq(&zone->lock); ++ cond_resched(); ++ spin_lock_irq(&zone->lock); + } + seq_putc(m, '\n'); + } diff --git a/queue-4.14/scripts-switch-explicitly-to-python-3.patch b/queue-4.14/scripts-switch-explicitly-to-python-3.patch new file mode 100644 index 00000000000..20bd5887263 --- /dev/null +++ b/queue-4.14/scripts-switch-explicitly-to-python-3.patch @@ -0,0 +1,38 @@ +From 51839e29cb5954470ea4db7236ef8c3d77a6e0bb Mon Sep 17 00:00:00 2001 +From: Andy Shevchenko +Date: Wed, 9 Dec 2020 13:50:17 +0200 +Subject: scripts: switch explicitly to Python 3 + +From: Andy Shevchenko + +commit 51839e29cb5954470ea4db7236ef8c3d77a6e0bb upstream. + +Some distributions are about to switch to Python 3 support only. +This means that /usr/bin/python, which is Python 2, is not available +anymore. Hence, switch scripts to use Python 3 explicitly. + +Signed-off-by: Andy Shevchenko +Signed-off-by: Masahiro Yamada +Signed-off-by: Nicolas Schier +Signed-off-by: Greg Kroah-Hartman +--- + scripts/bloat-o-meter | 2 +- + scripts/diffconfig | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/scripts/bloat-o-meter ++++ b/scripts/bloat-o-meter +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + # + # Copyright 2004 Matt Mackall + # +--- a/scripts/diffconfig ++++ b/scripts/diffconfig +@@ -1,4 +1,4 @@ +-#!/usr/bin/env python ++#!/usr/bin/env python3 + # SPDX-License-Identifier: GPL-2.0 + # + # diffconfig - a tool to compare .config files. diff --git a/queue-4.14/series b/queue-4.14/series index e69de29bb2d..374e5bdbeba 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -0,0 +1,4 @@ +mm-vmstat-drop-zone-lock-in-proc-pagetypeinfo.patch +tweewide-fix-most-shebang-lines.patch +scripts-switch-explicitly-to-python-3.patch +usb-dwc3-gadget-enable-suspend-events.patch diff --git a/queue-4.14/tweewide-fix-most-shebang-lines.patch b/queue-4.14/tweewide-fix-most-shebang-lines.patch new file mode 100644 index 00000000000..0478e92ad54 --- /dev/null +++ b/queue-4.14/tweewide-fix-most-shebang-lines.patch @@ -0,0 +1,237 @@ +From c25ce589dca10d64dde139ae093abc258a32869c Mon Sep 17 00:00:00 2001 +From: Finn Behrens +Date: Mon, 23 Nov 2020 15:15:33 +0100 +Subject: tweewide: Fix most Shebang lines + +From: Finn Behrens + +commit c25ce589dca10d64dde139ae093abc258a32869c upstream. + +Change every shebang which does not need an argument to use /usr/bin/env. +This is needed as not every distro has everything under /usr/bin, +sometimes not even bash. + +Signed-off-by: Finn Behrens +Signed-off-by: Masahiro Yamada +[nicolas@fjasle.eu: update contexts for v4.14, adapt for old scripts] +Signed-off-by: Nicolas Schier +Signed-off-by: Greg Kroah-Hartman +--- + Documentation/sphinx/parse-headers.pl | 2 +- + Documentation/target/tcm_mod_builder.py | 2 +- + Documentation/trace/postprocess/decode_msr.py | 2 +- + Documentation/trace/postprocess/trace-pagealloc-postprocess.pl | 2 +- + Documentation/trace/postprocess/trace-vmscan-postprocess.pl | 2 +- + arch/ia64/scripts/unwcheck.py | 2 +- + scripts/bloat-o-meter | 2 +- + scripts/config | 2 +- + scripts/diffconfig | 2 +- + scripts/show_delta | 2 +- + scripts/sphinx-pre-install | 2 +- + scripts/tracing/draw_functrace.py | 2 +- + tools/kvm/kvm_stat/kvm_stat | 2 +- + tools/perf/python/tracepoint.py | 2 +- + tools/perf/python/twatch.py | 2 +- + tools/perf/scripts/python/call-graph-from-sql.py | 2 +- + tools/perf/scripts/python/sched-migration.py | 2 +- + tools/perf/tests/attr.py | 2 +- + tools/perf/util/setup.py | 2 +- + tools/power/pm-graph/analyze_boot.py | 2 +- + tools/power/pm-graph/analyze_suspend.py | 2 +- + tools/power/x86/intel_pstate_tracer/intel_pstate_tracer.py | 2 +- + tools/testing/ktest/compare-ktest-sample.pl | 2 +- + tools/testing/selftests/tc-testing/tdc_batch.py | 2 +- + 24 files changed, 24 insertions(+), 24 deletions(-) + +--- a/Documentation/sphinx/parse-headers.pl ++++ b/Documentation/sphinx/parse-headers.pl +@@ -1,4 +1,4 @@ +-#!/usr/bin/perl ++#!/usr/bin/env perl + use strict; + use Text::Tabs; + use Getopt::Long; +--- a/Documentation/target/tcm_mod_builder.py ++++ b/Documentation/target/tcm_mod_builder.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/python ++#!/usr/bin/env python + # The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD + # + # Copyright (c) 2010 Rising Tide Systems +--- a/Documentation/trace/postprocess/decode_msr.py ++++ b/Documentation/trace/postprocess/decode_msr.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/python ++#!/usr/bin/env python + # add symbolic names to read_msr / write_msr in trace + # decode_msr msr-index.h < trace + import sys +--- a/Documentation/trace/postprocess/trace-pagealloc-postprocess.pl ++++ b/Documentation/trace/postprocess/trace-pagealloc-postprocess.pl +@@ -1,4 +1,4 @@ +-#!/usr/bin/perl ++#!/usr/bin/env perl + # This is a POC (proof of concept or piece of crap, take your pick) for reading the + # text representation of trace output related to page allocation. It makes an attempt + # to extract some high-level information on what is going on. The accuracy of the parser +--- a/Documentation/trace/postprocess/trace-vmscan-postprocess.pl ++++ b/Documentation/trace/postprocess/trace-vmscan-postprocess.pl +@@ -1,4 +1,4 @@ +-#!/usr/bin/perl ++#!/usr/bin/env perl + # This is a POC for reading the text representation of trace output related to + # page reclaim. It makes an attempt to extract some high-level information on + # what is going on. The accuracy of the parser may vary +--- a/arch/ia64/scripts/unwcheck.py ++++ b/arch/ia64/scripts/unwcheck.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/python ++#!/usr/bin/env python + # SPDX-License-Identifier: GPL-2.0 + # + # Usage: unwcheck.py FILE +--- a/scripts/bloat-o-meter ++++ b/scripts/bloat-o-meter +@@ -1,4 +1,4 @@ +-#!/usr/bin/python ++#!/usr/bin/env python + # + # Copyright 2004 Matt Mackall + # +--- a/scripts/config ++++ b/scripts/config +@@ -1,4 +1,4 @@ +-#!/bin/bash ++#!/usr/bin/env bash + # SPDX-License-Identifier: GPL-2.0 + # Manipulate options in a .config file from the command line + +--- a/scripts/diffconfig ++++ b/scripts/diffconfig +@@ -1,4 +1,4 @@ +-#!/usr/bin/python ++#!/usr/bin/env python + # SPDX-License-Identifier: GPL-2.0 + # + # diffconfig - a tool to compare .config files. +--- a/scripts/show_delta ++++ b/scripts/show_delta +@@ -1,4 +1,4 @@ +-#!/usr/bin/python ++#!/usr/bin/env python + # + # show_deltas: Read list of printk messages instrumented with + # time data, and format with time deltas. +--- a/scripts/sphinx-pre-install ++++ b/scripts/sphinx-pre-install +@@ -1,4 +1,4 @@ +-#!/usr/bin/perl ++#!/usr/bin/env perl + use strict; + + # Copyright (c) 2017 Mauro Carvalho Chehab +--- a/scripts/tracing/draw_functrace.py ++++ b/scripts/tracing/draw_functrace.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/python ++#!/usr/bin/env python + + """ + Copyright 2008 (c) Frederic Weisbecker +--- a/tools/kvm/kvm_stat/kvm_stat ++++ b/tools/kvm/kvm_stat/kvm_stat +@@ -1,4 +1,4 @@ +-#!/usr/bin/python ++#!/usr/bin/env python + # + # top-like utility for displaying kvm statistics + # +--- a/tools/perf/python/tracepoint.py ++++ b/tools/perf/python/tracepoint.py +@@ -1,4 +1,4 @@ +-#! /usr/bin/python ++#! /usr/bin/env python + # SPDX-License-Identifier: GPL-2.0 + # -*- python -*- + # -*- coding: utf-8 -*- +--- a/tools/perf/python/twatch.py ++++ b/tools/perf/python/twatch.py +@@ -1,4 +1,4 @@ +-#! /usr/bin/python ++#! /usr/bin/env python + # -*- python -*- + # -*- coding: utf-8 -*- + # twatch - Experimental use of the perf python interface +--- a/tools/perf/scripts/python/call-graph-from-sql.py ++++ b/tools/perf/scripts/python/call-graph-from-sql.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/python2 ++#!/usr/bin/env python2 + # call-graph-from-sql.py: create call-graph from sql database + # Copyright (c) 2014-2017, Intel Corporation. + # +--- a/tools/perf/scripts/python/sched-migration.py ++++ b/tools/perf/scripts/python/sched-migration.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/python ++#!/usr/bin/env python + # + # Cpu task migration overview toy + # +--- a/tools/perf/tests/attr.py ++++ b/tools/perf/tests/attr.py +@@ -1,4 +1,4 @@ +-#! /usr/bin/python ++#! /usr/bin/env python + # SPDX-License-Identifier: GPL-2.0 + + import os +--- a/tools/perf/util/setup.py ++++ b/tools/perf/util/setup.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/python2 ++#!/usr/bin/env python2 + + from os import getenv + +--- a/tools/power/pm-graph/analyze_boot.py ++++ b/tools/power/pm-graph/analyze_boot.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/python ++#!/usr/bin/env python + # + # Tool for analyzing boot timing + # Copyright (c) 2013, Intel Corporation. +--- a/tools/power/pm-graph/analyze_suspend.py ++++ b/tools/power/pm-graph/analyze_suspend.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/python ++#!/usr/bin/env python + # + # Tool for analyzing suspend/resume timing + # Copyright (c) 2013, Intel Corporation. +--- a/tools/power/x86/intel_pstate_tracer/intel_pstate_tracer.py ++++ b/tools/power/x86/intel_pstate_tracer/intel_pstate_tracer.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/python ++#!/usr/bin/env python + # -*- coding: utf-8 -*- + # + """ This utility can be used to debug and tune the performance of the +--- a/tools/testing/ktest/compare-ktest-sample.pl ++++ b/tools/testing/ktest/compare-ktest-sample.pl +@@ -1,4 +1,4 @@ +-#!/usr/bin/perl ++#!/usr/bin/env perl + # SPDX-License-Identifier: GPL-2.0 + + open (IN,"ktest.pl"); +--- a/tools/testing/selftests/tc-testing/tdc_batch.py ++++ b/tools/testing/selftests/tc-testing/tdc_batch.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/python3 ++#!/usr/bin/env python3 + + """ + tdc_batch.py - a script to generate TC batch file diff --git a/queue-4.14/usb-dwc3-gadget-enable-suspend-events.patch b/queue-4.14/usb-dwc3-gadget-enable-suspend-events.patch new file mode 100644 index 00000000000..5678304352e --- /dev/null +++ b/queue-4.14/usb-dwc3-gadget-enable-suspend-events.patch @@ -0,0 +1,43 @@ +From d1d90dd27254c44d087ad3f8b5b3e4fff0571f45 Mon Sep 17 00:00:00 2001 +From: Jack Pham +Date: Wed, 28 Apr 2021 02:01:10 -0700 +Subject: usb: dwc3: gadget: Enable suspend events + +From: Jack Pham + +commit d1d90dd27254c44d087ad3f8b5b3e4fff0571f45 upstream. + +commit 72704f876f50 ("dwc3: gadget: Implement the suspend entry event +handler") introduced (nearly 5 years ago!) an interrupt handler for +U3/L1-L2 suspend events. The problem is that these events aren't +currently enabled in the DEVTEN register so the handler is never +even invoked. Fix this simply by enabling the corresponding bit +in dwc3_gadget_enable_irq() using the same revision check as found +in the handler. + +Fixes: 72704f876f50 ("dwc3: gadget: Implement the suspend entry event handler") +Acked-by: Felipe Balbi +Signed-off-by: Jack Pham +Cc: stable +Link: https://lore.kernel.org/r/20210428090111.3370-1-jackp@codeaurora.org +[jackp@codeaurora.org: backport to pre-5.7 by replacing + DWC3_IS_VER_PRIOR check with direct comparison of dwc->revision] +Signed-off-by: Jack Pham +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/dwc3/gadget.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/usb/dwc3/gadget.c ++++ b/drivers/usb/dwc3/gadget.c +@@ -1829,6 +1829,10 @@ static void dwc3_gadget_enable_irq(struc + if (dwc->revision < DWC3_REVISION_250A) + reg |= DWC3_DEVTEN_ULSTCNGEN; + ++ /* On 2.30a and above this bit enables U3/L2-L1 Suspend Events */ ++ if (dwc->revision >= DWC3_REVISION_230A) ++ reg |= DWC3_DEVTEN_EOPFEN; ++ + dwc3_writel(dwc->regs, DWC3_DEVTEN, reg); + } + -- 2.47.3