net-ethernet-ravb-exit-if-re-initialization-fails-in.patch
revert-i2c-cadence-fix-the-hold-bit-setting.patch
xen-netfront-fix-potential-deadlock-in-xennet_remove.patch
+x86-i8259-use-printk_deferred-to-prevent-deadlock.patch
--- /dev/null
+From bdd65589593edd79b6a12ce86b3b7a7c6dae5208 Mon Sep 17 00:00:00 2001
+From: Thomas Gleixner <tglx@linutronix.de>
+Date: Wed, 29 Jul 2020 10:53:28 +0200
+Subject: x86/i8259: Use printk_deferred() to prevent deadlock
+
+From: Thomas Gleixner <tglx@linutronix.de>
+
+commit bdd65589593edd79b6a12ce86b3b7a7c6dae5208 upstream.
+
+0day reported a possible circular locking dependency:
+
+Chain exists of:
+ &irq_desc_lock_class --> console_owner --> &port_lock_key
+
+ Possible unsafe locking scenario:
+
+ CPU0 CPU1
+ ---- ----
+ lock(&port_lock_key);
+ lock(console_owner);
+ lock(&port_lock_key);
+ lock(&irq_desc_lock_class);
+
+The reason for this is a printk() in the i8259 interrupt chip driver
+which is invoked with the irq descriptor lock held, which reverses the
+lock operations vs. printk() from arbitrary contexts.
+
+Switch the printk() to printk_deferred() to avoid that.
+
+Reported-by: kernel test robot <lkp@intel.com>
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+Signed-off-by: Ingo Molnar <mingo@kernel.org>
+Cc: stable@vger.kernel.org
+Link: https://lore.kernel.org/r/87365abt2v.fsf@nanos.tec.linutronix.de
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/x86/kernel/i8259.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/x86/kernel/i8259.c
++++ b/arch/x86/kernel/i8259.c
+@@ -204,7 +204,7 @@ spurious_8259A_irq:
+ * lets ACK and report it. [once per IRQ]
+ */
+ if (!(spurious_irq_mask & irqmask)) {
+- printk(KERN_DEBUG
++ printk_deferred(KERN_DEBUG
+ "spurious 8259A interrupt: IRQ%d.\n", irq);
+ spurious_irq_mask |= irqmask;
+ }
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
- drivers/net/xen-netfront.c | 64 +++++++++++++++++++++++++-------------
+ drivers/net/xen-netfront.c | 64 +++++++++++++++++++++++++++++----------------
1 file changed, 42 insertions(+), 22 deletions(-)
-diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
-index 02b6a6c108400..7d4c0c46a889d 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
-@@ -62,6 +62,8 @@ module_param_named(max_queues, xennet_max_queues, uint, 0644);
+@@ -62,6 +62,8 @@ module_param_named(max_queues, xennet_ma
MODULE_PARM_DESC(max_queues,
"Maximum number of queues per virtual interface");
static const struct ethtool_ops xennet_ethtool_ops;
struct netfront_cb {
-@@ -1349,12 +1351,15 @@ static struct net_device *xennet_create_dev(struct xenbus_device *dev)
+@@ -1349,12 +1351,15 @@ static struct net_device *xennet_create_
netif_carrier_off(netdev);
return netdev;
exit:
-@@ -2166,28 +2171,43 @@ static const struct attribute_group xennet_dev_group = {
+@@ -2166,28 +2171,43 @@ static const struct attribute_group xenn
};
#endif /* CONFIG_SYSFS */
+ XenbusStateUnknown,
+ XENNET_TIMEOUT);
+ } while (!ret);
-+
+
+ if (xenbus_read_driver_state(dev->otherend) == XenbusStateClosed)
+ return;
-
++
+ do {
xenbus_switch_state(dev, XenbusStateClosed);
- wait_event(module_wq,
xennet_disconnect_backend(info);
if (info->netdev->reg_state == NETREG_REGISTERED)
---
-2.25.1
-