]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.8-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 4 Oct 2020 10:59:47 +0000 (12:59 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 4 Oct 2020 10:59:47 +0000 (12:59 +0200)
added patches:
drm-amdgpu-restore-proper-ref-count-in-amdgpu_display_crtc_set_config.patch
ftrace-move-rcu-is-watching-check-after-recursion-check.patch
i2c-i801-exclude-device-from-suspend-direct-complete-optimization.patch
iio-adc-qcom-spmi-adc5-fix-driver-name.patch
input-i8042-add-nopnp-quirk-for-acer-aspire-5-a515.patch
memstick-skip-allocating-card-when-removing-host.patch
tracing-fix-trace_find_next_entry-accounting-of-temp-buffer-size.patch
xen-events-don-t-use-chip_data-for-legacy-irqs.patch

queue-5.8/drm-amdgpu-restore-proper-ref-count-in-amdgpu_display_crtc_set_config.patch [new file with mode: 0644]
queue-5.8/ftrace-move-rcu-is-watching-check-after-recursion-check.patch [new file with mode: 0644]
queue-5.8/i2c-i801-exclude-device-from-suspend-direct-complete-optimization.patch [new file with mode: 0644]
queue-5.8/iio-adc-qcom-spmi-adc5-fix-driver-name.patch [new file with mode: 0644]
queue-5.8/input-i8042-add-nopnp-quirk-for-acer-aspire-5-a515.patch [new file with mode: 0644]
queue-5.8/memstick-skip-allocating-card-when-removing-host.patch [new file with mode: 0644]
queue-5.8/series
queue-5.8/tracing-fix-trace_find_next_entry-accounting-of-temp-buffer-size.patch [new file with mode: 0644]
queue-5.8/xen-events-don-t-use-chip_data-for-legacy-irqs.patch [new file with mode: 0644]

diff --git a/queue-5.8/drm-amdgpu-restore-proper-ref-count-in-amdgpu_display_crtc_set_config.patch b/queue-5.8/drm-amdgpu-restore-proper-ref-count-in-amdgpu_display_crtc_set_config.patch
new file mode 100644 (file)
index 0000000..f69be27
--- /dev/null
@@ -0,0 +1,43 @@
+From a39d0d7bdf8c21ac7645c02e9676b5cb2b804c31 Mon Sep 17 00:00:00 2001
+From: Jean Delvare <jdelvare@suse.de>
+Date: Mon, 28 Sep 2020 11:10:37 +0200
+Subject: drm/amdgpu: restore proper ref count in amdgpu_display_crtc_set_config
+
+From: Jean Delvare <jdelvare@suse.de>
+
+commit a39d0d7bdf8c21ac7645c02e9676b5cb2b804c31 upstream.
+
+A recent attempt to fix a ref count leak in
+amdgpu_display_crtc_set_config() turned out to be doing too much and
+"fixed" an intended decrease as if it were a leak. Undo that part to
+restore the proper balance. This is the very nature of this function
+to increase or decrease the power reference count depending on the
+situation.
+
+Consequences of this bug is that the power reference would
+eventually get down to 0 while the display was still in use,
+resulting in that display switching off unexpectedly.
+
+Signed-off-by: Jean Delvare <jdelvare@suse.de>
+Fixes: e008fa6fb415 ("drm/amdgpu: fix ref count leak in amdgpu_display_crtc_set_config")
+Cc: stable@vger.kernel.org
+Cc: Navid Emamdoost <navid.emamdoost@gmail.com>
+Cc: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_display.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
+@@ -297,7 +297,7 @@ int amdgpu_display_crtc_set_config(struc
+          take the current one */
+       if (active && !adev->have_disp_power_ref) {
+               adev->have_disp_power_ref = true;
+-              goto out;
++              return ret;
+       }
+       /* if we have no active crtcs, then drop the power ref
+          we got before */
diff --git a/queue-5.8/ftrace-move-rcu-is-watching-check-after-recursion-check.patch b/queue-5.8/ftrace-move-rcu-is-watching-check-after-recursion-check.patch
new file mode 100644 (file)
index 0000000..f283703
--- /dev/null
@@ -0,0 +1,55 @@
+From b40341fad6cc2daa195f8090fd3348f18fff640a Mon Sep 17 00:00:00 2001
+From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
+Date: Tue, 29 Sep 2020 12:40:31 -0400
+Subject: ftrace: Move RCU is watching check after recursion check
+
+From: Steven Rostedt (VMware) <rostedt@goodmis.org>
+
+commit b40341fad6cc2daa195f8090fd3348f18fff640a upstream.
+
+The first thing that the ftrace function callback helper functions should do
+is to check for recursion. Peter Zijlstra found that when
+"rcu_is_watching()" had its notrace removed, it caused perf function tracing
+to crash. This is because the call of rcu_is_watching() is tested before
+function recursion is checked and and if it is traced, it will cause an
+infinite recursion loop.
+
+rcu_is_watching() should still stay notrace, but to prevent this should
+never had crashed in the first place. The recursion prevention must be the
+first thing done in callback functions.
+
+Link: https://lore.kernel.org/r/20200929112541.GM2628@hirez.programming.kicks-ass.net
+
+Cc: stable@vger.kernel.org
+Cc: Paul McKenney <paulmck@kernel.org>
+Fixes: c68c0fa293417 ("ftrace: Have ftrace_ops_get_func() handle RCU and PER_CPU flags too")
+Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
+Reported-by: Peter Zijlstra (Intel) <peterz@infradead.org>
+Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ kernel/trace/ftrace.c |    6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+--- a/kernel/trace/ftrace.c
++++ b/kernel/trace/ftrace.c
+@@ -6877,16 +6877,14 @@ static void ftrace_ops_assist_func(unsig
+ {
+       int bit;
+-      if ((op->flags & FTRACE_OPS_FL_RCU) && !rcu_is_watching())
+-              return;
+-
+       bit = trace_test_and_set_recursion(TRACE_LIST_START, TRACE_LIST_MAX);
+       if (bit < 0)
+               return;
+       preempt_disable_notrace();
+-      op->func(ip, parent_ip, op, regs);
++      if (!(op->flags & FTRACE_OPS_FL_RCU) || rcu_is_watching())
++              op->func(ip, parent_ip, op, regs);
+       preempt_enable_notrace();
+       trace_clear_recursion(bit);
diff --git a/queue-5.8/i2c-i801-exclude-device-from-suspend-direct-complete-optimization.patch b/queue-5.8/i2c-i801-exclude-device-from-suspend-direct-complete-optimization.patch
new file mode 100644 (file)
index 0000000..04ee74f
--- /dev/null
@@ -0,0 +1,39 @@
+From 845b89127bc5458d0152a4d63f165c62a22fcb70 Mon Sep 17 00:00:00 2001
+From: Jean Delvare <jdelvare@suse.de>
+Date: Thu, 10 Sep 2020 11:57:08 +0200
+Subject: i2c: i801: Exclude device from suspend direct complete optimization
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Jean Delvare <jdelvare@suse.de>
+
+commit 845b89127bc5458d0152a4d63f165c62a22fcb70 upstream.
+
+By default, PCI drivers with runtime PM enabled will skip the calls
+to suspend and resume on system PM. For this driver, we don't want
+that, as we need to perform additional steps for system PM to work
+properly on all systems. So instruct the PM core to not skip these
+calls.
+
+Fixes: a9c8088c7988 ("i2c: i801: Don't restore config registers on runtime PM")
+Reported-by: Volker Rümelin <volker.ruemelin@googlemail.com>
+Signed-off-by: Jean Delvare <jdelvare@suse.de>
+Cc: stable@vger.kernel.org
+Signed-off-by: Wolfram Sang <wsa@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/i2c/busses/i2c-i801.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/i2c/busses/i2c-i801.c
++++ b/drivers/i2c/busses/i2c-i801.c
+@@ -1913,6 +1913,7 @@ static int i801_probe(struct pci_dev *de
+       pci_set_drvdata(dev, priv);
++      dev_pm_set_driver_flags(&dev->dev, DPM_FLAG_NO_DIRECT_COMPLETE);
+       pm_runtime_set_autosuspend_delay(&dev->dev, 1000);
+       pm_runtime_use_autosuspend(&dev->dev);
+       pm_runtime_put_autosuspend(&dev->dev);
diff --git a/queue-5.8/iio-adc-qcom-spmi-adc5-fix-driver-name.patch b/queue-5.8/iio-adc-qcom-spmi-adc5-fix-driver-name.patch
new file mode 100644 (file)
index 0000000..c403d9b
--- /dev/null
@@ -0,0 +1,33 @@
+From fdb29f4de1374483291232ae7515e5e7bb464762 Mon Sep 17 00:00:00 2001
+From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
+Date: Thu, 10 Sep 2020 16:59:51 +0300
+Subject: iio: adc: qcom-spmi-adc5: fix driver name
+
+From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
+
+commit fdb29f4de1374483291232ae7515e5e7bb464762 upstream.
+
+Remove superfluous '.c' from qcom-spmi-adc5 device driver name.
+Fixes: e13d757279bb ("iio: adc: Add QCOM SPMI PMIC5 ADC driver")
+Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
+Acked-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
+Cc: <Stable@vger.kernel.org>
+Link: https://lore.kernel.org/r/20200910140000.324091-2-dmitry.baryshkov@linaro.org
+Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/iio/adc/qcom-spmi-adc5.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/iio/adc/qcom-spmi-adc5.c
++++ b/drivers/iio/adc/qcom-spmi-adc5.c
+@@ -786,7 +786,7 @@ static int adc5_probe(struct platform_de
+ static struct platform_driver adc5_driver = {
+       .driver = {
+-              .name = "qcom-spmi-adc5.c",
++              .name = "qcom-spmi-adc5",
+               .of_match_table = adc5_match_table,
+       },
+       .probe = adc5_probe,
diff --git a/queue-5.8/input-i8042-add-nopnp-quirk-for-acer-aspire-5-a515.patch b/queue-5.8/input-i8042-add-nopnp-quirk-for-acer-aspire-5-a515.patch
new file mode 100644 (file)
index 0000000..7f81a77
--- /dev/null
@@ -0,0 +1,45 @@
+From 5fc27b098dafb8e30794a9db0705074c7d766179 Mon Sep 17 00:00:00 2001
+From: Jiri Kosina <jkosina@suse.cz>
+Date: Mon, 28 Sep 2020 16:21:17 -0700
+Subject: Input: i8042 - add nopnp quirk for Acer Aspire 5 A515
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Jiri Kosina <jkosina@suse.cz>
+
+commit 5fc27b098dafb8e30794a9db0705074c7d766179 upstream.
+
+Touchpad on this laptop is not detected properly during boot, as PNP
+enumerates (wrongly) AUX port as disabled on this machine.
+
+Fix that by adding this board (with admittedly quite funny DMI
+identifiers) to nopnp quirk list.
+
+Reported-by: Andrés Barrantes Silman <andresbs2000@protonmail.com>
+Signed-off-by: Jiri Kosina <jkosina@suse.cz>
+Link: https://lore.kernel.org/r/nycvar.YFH.7.76.2009252337340.3336@cbobk.fhfr.pm
+Cc: stable@vger.kernel.org
+Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/input/serio/i8042-x86ia64io.h |    7 +++++++
+ 1 file changed, 7 insertions(+)
+
+--- a/drivers/input/serio/i8042-x86ia64io.h
++++ b/drivers/input/serio/i8042-x86ia64io.h
+@@ -721,6 +721,13 @@ static const struct dmi_system_id __init
+                       DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"),
+               },
+       },
++      {
++              /* Acer Aspire 5 A515 */
++              .matches = {
++                      DMI_MATCH(DMI_BOARD_NAME, "Grumpy_PK"),
++                      DMI_MATCH(DMI_BOARD_VENDOR, "PK"),
++              },
++      },
+       { }
+ };
diff --git a/queue-5.8/memstick-skip-allocating-card-when-removing-host.patch b/queue-5.8/memstick-skip-allocating-card-when-removing-host.patch
new file mode 100644 (file)
index 0000000..354d1f0
--- /dev/null
@@ -0,0 +1,60 @@
+From 62c59a8786e6bb75569cee91dab66e9da3ff4b68 Mon Sep 17 00:00:00 2001
+From: Kai-Heng Feng <kai.heng.feng@canonical.com>
+Date: Fri, 25 Sep 2020 16:49:51 +0800
+Subject: memstick: Skip allocating card when removing host
+
+From: Kai-Heng Feng <kai.heng.feng@canonical.com>
+
+commit 62c59a8786e6bb75569cee91dab66e9da3ff4b68 upstream.
+
+After commit 6827ca573c03 ("memstick: rtsx_usb_ms: Support runtime power
+management"), removing module rtsx_usb_ms will be stuck.
+
+The deadlock is caused by powering on and powering off at the same time,
+the former one is when memstick_check() is flushed, and the later is called
+by memstick_remove_host().
+
+Soe let's skip allocating card to prevent this issue.
+
+Fixes: 6827ca573c03 ("memstick: rtsx_usb_ms: Support runtime power management")
+Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
+Link: https://lore.kernel.org/r/20200925084952.13220-1-kai.heng.feng@canonical.com
+Cc: stable@vger.kernel.org
+Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/memstick/core/memstick.c |    4 ++++
+ include/linux/memstick.h         |    1 +
+ 2 files changed, 5 insertions(+)
+
+--- a/drivers/memstick/core/memstick.c
++++ b/drivers/memstick/core/memstick.c
+@@ -441,6 +441,9 @@ static void memstick_check(struct work_s
+       } else if (host->card->stop)
+               host->card->stop(host->card);
++      if (host->removing)
++              goto out_power_off;
++
+       card = memstick_alloc_card(host);
+       if (!card) {
+@@ -545,6 +548,7 @@ EXPORT_SYMBOL(memstick_add_host);
+  */
+ void memstick_remove_host(struct memstick_host *host)
+ {
++      host->removing = 1;
+       flush_workqueue(workqueue);
+       mutex_lock(&host->lock);
+       if (host->card)
+--- a/include/linux/memstick.h
++++ b/include/linux/memstick.h
+@@ -281,6 +281,7 @@ struct memstick_host {
+       struct memstick_dev *card;
+       unsigned int        retries;
++      bool removing;
+       /* Notify the host that some requests are pending. */
+       void                (*request)(struct memstick_host *host);
index 21219af2e84935bb9fc1a2e643fdf3dbd637de2b..d63a7e23fd09c965a5a6e96bb6cce34349dd717a 100644 (file)
@@ -13,3 +13,11 @@ gpio-amd-fch-correct-logic-of-gpio_line_direction.patch
 clk-samsung-keep-top-bpll-mux-on-exynos542x-enabled.patch
 clk-socfpga-stratix10-fix-the-divider-for-the-emac_ptp_free_clk.patch
 scsi-iscsi-iscsi_tcp-avoid-holding-spinlock-while-calling-getpeername.patch
+i2c-i801-exclude-device-from-suspend-direct-complete-optimization.patch
+input-i8042-add-nopnp-quirk-for-acer-aspire-5-a515.patch
+iio-adc-qcom-spmi-adc5-fix-driver-name.patch
+ftrace-move-rcu-is-watching-check-after-recursion-check.patch
+tracing-fix-trace_find_next_entry-accounting-of-temp-buffer-size.patch
+memstick-skip-allocating-card-when-removing-host.patch
+drm-amdgpu-restore-proper-ref-count-in-amdgpu_display_crtc_set_config.patch
+xen-events-don-t-use-chip_data-for-legacy-irqs.patch
diff --git a/queue-5.8/tracing-fix-trace_find_next_entry-accounting-of-temp-buffer-size.patch b/queue-5.8/tracing-fix-trace_find_next_entry-accounting-of-temp-buffer-size.patch
new file mode 100644 (file)
index 0000000..9f36b89
--- /dev/null
@@ -0,0 +1,101 @@
+From 851e6f61cd076954f9d521e0d79b173ad3a2453b Mon Sep 17 00:00:00 2001
+From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
+Date: Tue, 29 Sep 2020 12:27:23 -0400
+Subject: tracing: Fix trace_find_next_entry() accounting of temp buffer size
+
+From: Steven Rostedt (VMware) <rostedt@goodmis.org>
+
+commit 851e6f61cd076954f9d521e0d79b173ad3a2453b upstream.
+
+The temp buffer size variable for trace_find_next_entry() was incorrectly
+being updated when the size did not change. The temp buffer size should only
+be updated when it is reallocated.
+
+This is mostly an issue when used with ftrace_dump(). That's because
+ftrace_dump() can not allocate a new buffer, and instead uses a temporary
+buffer with a fix size. But the variable that keeps track of that size is
+incorrectly updated with each call, and it could fall into the path that
+would try to reallocate the buffer and produce a warning.
+
+ ------------[ cut here ]------------
+ WARNING: CPU: 1 PID: 1601 at kernel/trace/trace.c:3548
+trace_find_next_entry+0xd0/0xe0
+ Modules linked in [..]
+ CPU: 1 PID: 1601 Comm: bash Not tainted 5.9.0-rc5-test+ #521
+ Hardware name: Hewlett-Packard HP Compaq Pro 6300 SFF/339A, BIOS K01 v03.03
+07/14/2016
+ RIP: 0010:trace_find_next_entry+0xd0/0xe0
+ Code: 40 21 00 00 4c 89 e1 31 d2 4c 89 ee 48 89 df e8 c6 9e ff ff 89 ab 54
+21 00 00 5b 5d 41 5c 41 5d c3 48 63 d5 eb bf 31 c0 eb f0 <0f> 0b 48 63 d5 eb
+b4 66 0f 1f 84 00 00 00 00 00 53 48 8d 8f 60 21
+ RSP: 0018:ffff95a4f2e8bd70 EFLAGS: 00010046
+ RAX: ffffffff96679fc0 RBX: ffffffff97910de0 RCX: ffffffff96679fc0
+ RDX: ffff95a4f2e8bd98 RSI: ffff95a4ee321098 RDI: ffffffff97913000
+ RBP: 0000000000000018 R08: 0000000000000000 R09: 0000000000000000
+ R10: 0000000000000001 R11: 0000000000000046 R12: ffff95a4f2e8bd98
+ R13: 0000000000000000 R14: ffff95a4ee321098 R15: 00000000009aa301
+ FS:  00007f8565484740(0000) GS:ffff95a55aa40000(0000)
+knlGS:0000000000000000
+ CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
+ CR2: 000055876bd43d90 CR3: 00000000b76e6003 CR4: 00000000001706e0
+ Call Trace:
+  trace_print_lat_context+0x58/0x2d0
+  ? cpumask_next+0x16/0x20
+  print_trace_line+0x1a4/0x4f0
+  ftrace_dump.cold+0xad/0x12c
+  __handle_sysrq.cold+0x51/0x126
+  write_sysrq_trigger+0x3f/0x4a
+  proc_reg_write+0x53/0x80
+  vfs_write+0xca/0x210
+  ksys_write+0x70/0xf0
+  do_syscall_64+0x33/0x40
+  entry_SYSCALL_64_after_hwframe+0x44/0xa9
+ RIP: 0033:0x7f8565579487
+ Code: 64 89 02 48 c7 c0 ff ff ff ff eb bb 0f 1f 80 00 00 00 00 f3 0f 1e fa
+64 8b 04 25 18 00 00 00 85 c0 75 10 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff
+77 51 c3 48 83 ec 28 48 89 54 24 18 48 89 74 24
+ RSP: 002b:00007ffd40707948 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
+ RAX: ffffffffffffffda RBX: 0000000000000002 RCX: 00007f8565579487
+ RDX: 0000000000000002 RSI: 000055876bd74de0 RDI: 0000000000000001
+ RBP: 000055876bd74de0 R08: 000000000000000a R09: 0000000000000001
+ R10: 000055876bdec280 R11: 0000000000000246 R12: 0000000000000002
+ R13: 00007f856564a500 R14: 0000000000000002 R15: 00007f856564a700
+ irq event stamp: 109958
+ ---[ end trace 7aab5b7e51484b00 ]---
+
+Not only fix the updating of the temp buffer, but also do not free the temp
+buffer before a new buffer is allocated (there's no reason to not continue
+to use the current temp buffer if an allocation fails).
+
+Cc: stable@vger.kernel.org
+Fixes: 8e99cf91b99bb ("tracing: Do not allocate buffer in trace_find_next_entry() in atomic")
+Reported-by: Anna-Maria Behnsen <anna-maria@linutronix.de>
+Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ kernel/trace/trace.c |   10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+--- a/kernel/trace/trace.c
++++ b/kernel/trace/trace.c
+@@ -3507,13 +3507,15 @@ struct trace_entry *trace_find_next_entr
+       if (iter->ent && iter->ent != iter->temp) {
+               if ((!iter->temp || iter->temp_size < iter->ent_size) &&
+                   !WARN_ON_ONCE(iter->temp == static_temp_buf)) {
+-                      kfree(iter->temp);
+-                      iter->temp = kmalloc(iter->ent_size, GFP_KERNEL);
+-                      if (!iter->temp)
++                      void *temp;
++                      temp = kmalloc(iter->ent_size, GFP_KERNEL);
++                      if (!temp)
+                               return NULL;
++                      kfree(iter->temp);
++                      iter->temp = temp;
++                      iter->temp_size = iter->ent_size;
+               }
+               memcpy(iter->temp, iter->ent, iter->ent_size);
+-              iter->temp_size = iter->ent_size;
+               iter->ent = iter->temp;
+       }
+       entry = __find_next_entry(iter, ent_cpu, NULL, ent_ts);
diff --git a/queue-5.8/xen-events-don-t-use-chip_data-for-legacy-irqs.patch b/queue-5.8/xen-events-don-t-use-chip_data-for-legacy-irqs.patch
new file mode 100644 (file)
index 0000000..34be133
--- /dev/null
@@ -0,0 +1,123 @@
+From 0891fb39ba67bd7ae023ea0d367297ffff010781 Mon Sep 17 00:00:00 2001
+From: Juergen Gross <jgross@suse.com>
+Date: Wed, 30 Sep 2020 11:16:14 +0200
+Subject: xen/events: don't use chip_data for legacy IRQs
+
+From: Juergen Gross <jgross@suse.com>
+
+commit 0891fb39ba67bd7ae023ea0d367297ffff010781 upstream.
+
+Since commit c330fb1ddc0a ("XEN uses irqdesc::irq_data_common::handler_data to store a per interrupt XEN data pointer which contains XEN specific information.")
+Xen is using the chip_data pointer for storing IRQ specific data. When
+running as a HVM domain this can result in problems for legacy IRQs, as
+those might use chip_data for their own purposes.
+
+Use a local array for this purpose in case of legacy IRQs, avoiding the
+double use.
+
+Cc: stable@vger.kernel.org
+Fixes: c330fb1ddc0a ("XEN uses irqdesc::irq_data_common::handler_data to store a per interrupt XEN data pointer which contains XEN specific information.")
+Signed-off-by: Juergen Gross <jgross@suse.com>
+Tested-by: Stefan Bader <stefan.bader@canonical.com>
+Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
+Link: https://lore.kernel.org/r/20200930091614.13660-1-jgross@suse.com
+Signed-off-by: Juergen Gross <jgross@suse.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/xen/events/events_base.c |   29 +++++++++++++++++++++--------
+ 1 file changed, 21 insertions(+), 8 deletions(-)
+
+--- a/drivers/xen/events/events_base.c
++++ b/drivers/xen/events/events_base.c
+@@ -92,6 +92,8 @@ static bool (*pirq_needs_eoi)(unsigned i
+ /* Xen will never allocate port zero for any purpose. */
+ #define VALID_EVTCHN(chn)     ((chn) != 0)
++static struct irq_info *legacy_info_ptrs[NR_IRQS_LEGACY];
++
+ static struct irq_chip xen_dynamic_chip;
+ static struct irq_chip xen_percpu_chip;
+ static struct irq_chip xen_pirq_chip;
+@@ -156,7 +158,18 @@ int get_evtchn_to_irq(evtchn_port_t evtc
+ /* Get info for IRQ */
+ struct irq_info *info_for_irq(unsigned irq)
+ {
+-      return irq_get_chip_data(irq);
++      if (irq < nr_legacy_irqs())
++              return legacy_info_ptrs[irq];
++      else
++              return irq_get_chip_data(irq);
++}
++
++static void set_info_for_irq(unsigned int irq, struct irq_info *info)
++{
++      if (irq < nr_legacy_irqs())
++              legacy_info_ptrs[irq] = info;
++      else
++              irq_set_chip_data(irq, info);
+ }
+ /* Constructors for packed IRQ information. */
+@@ -377,7 +390,7 @@ static void xen_irq_init(unsigned irq)
+       info->type = IRQT_UNBOUND;
+       info->refcnt = -1;
+-      irq_set_chip_data(irq, info);
++      set_info_for_irq(irq, info);
+       list_add_tail(&info->list, &xen_irq_list_head);
+ }
+@@ -426,14 +439,14 @@ static int __must_check xen_allocate_irq
+ static void xen_free_irq(unsigned irq)
+ {
+-      struct irq_info *info = irq_get_chip_data(irq);
++      struct irq_info *info = info_for_irq(irq);
+       if (WARN_ON(!info))
+               return;
+       list_del(&info->list);
+-      irq_set_chip_data(irq, NULL);
++      set_info_for_irq(irq, NULL);
+       WARN_ON(info->refcnt > 0);
+@@ -603,7 +616,7 @@ EXPORT_SYMBOL_GPL(xen_irq_from_gsi);
+ static void __unbind_from_irq(unsigned int irq)
+ {
+       evtchn_port_t evtchn = evtchn_from_irq(irq);
+-      struct irq_info *info = irq_get_chip_data(irq);
++      struct irq_info *info = info_for_irq(irq);
+       if (info->refcnt > 0) {
+               info->refcnt--;
+@@ -1108,7 +1121,7 @@ int bind_ipi_to_irqhandler(enum ipi_vect
+ void unbind_from_irqhandler(unsigned int irq, void *dev_id)
+ {
+-      struct irq_info *info = irq_get_chip_data(irq);
++      struct irq_info *info = info_for_irq(irq);
+       if (WARN_ON(!info))
+               return;
+@@ -1142,7 +1155,7 @@ int evtchn_make_refcounted(evtchn_port_t
+       if (irq == -1)
+               return -ENOENT;
+-      info = irq_get_chip_data(irq);
++      info = info_for_irq(irq);
+       if (!info)
+               return -ENOENT;
+@@ -1170,7 +1183,7 @@ int evtchn_get(evtchn_port_t evtchn)
+       if (irq == -1)
+               goto done;
+-      info = irq_get_chip_data(irq);
++      info = info_for_irq(irq);
+       if (!info)
+               goto done;