]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 5.10
authorSasha Levin <sashal@kernel.org>
Fri, 25 Jun 2021 11:56:14 +0000 (07:56 -0400)
committerSasha Levin <sashal@kernel.org>
Fri, 25 Jun 2021 11:56:14 +0000 (07:56 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-5.10/revert-pci-pm-do-not-read-power-state-in-pci_enable_.patch [new file with mode: 0644]
queue-5.10/series
queue-5.10/spi-spi-nxp-fspi-move-the-register-operation-after-t.patch [new file with mode: 0644]

diff --git a/queue-5.10/revert-pci-pm-do-not-read-power-state-in-pci_enable_.patch b/queue-5.10/revert-pci-pm-do-not-read-power-state-in-pci_enable_.patch
new file mode 100644 (file)
index 0000000..bad81f1
--- /dev/null
@@ -0,0 +1,57 @@
+From fc30aa663aeeccae50f7b94a077a9811bd0ccf6f Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 22 Jun 2021 17:35:18 +0200
+Subject: Revert "PCI: PM: Do not read power state in
+ pci_enable_device_flags()"
+
+From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+
+[ Upstream commit 4d6035f9bf4ea12776322746a216e856dfe46698 ]
+
+Revert commit 4514d991d992 ("PCI: PM: Do not read power state in
+pci_enable_device_flags()") that is reported to cause PCI device
+initialization issues on some systems.
+
+BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=213481
+Link: https://lore.kernel.org/linux-acpi/YNDoGICcg0V8HhpQ@eldamar.lan
+Reported-by: Michael <phyre@rogers.com>
+Reported-by: Salvatore Bonaccorso <carnil@debian.org>
+Fixes: 4514d991d992 ("PCI: PM: Do not read power state in pci_enable_device_flags()")
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/pci/pci.c | 16 +++++++++++++---
+ 1 file changed, 13 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
+index d5d9ea864fe6..9e971fffeb6a 100644
+--- a/drivers/pci/pci.c
++++ b/drivers/pci/pci.c
+@@ -1874,11 +1874,21 @@ static int pci_enable_device_flags(struct pci_dev *dev, unsigned long flags)
+       int err;
+       int i, bars = 0;
+-      if (atomic_inc_return(&dev->enable_cnt) > 1) {
+-              pci_update_current_state(dev, dev->current_state);
+-              return 0;               /* already enabled */
++      /*
++       * Power state could be unknown at this point, either due to a fresh
++       * boot or a device removal call.  So get the current power state
++       * so that things like MSI message writing will behave as expected
++       * (e.g. if the device really is in D0 at enable time).
++       */
++      if (dev->pm_cap) {
++              u16 pmcsr;
++              pci_read_config_word(dev, dev->pm_cap + PCI_PM_CTRL, &pmcsr);
++              dev->current_state = (pmcsr & PCI_PM_CTRL_STATE_MASK);
+       }
++      if (atomic_inc_return(&dev->enable_cnt) > 1)
++              return 0;               /* already enabled */
++
+       bridge = pci_upstream_bridge(dev);
+       if (bridge)
+               pci_enable_bridge(bridge);
+-- 
+2.30.2
+
index 39d402c8fefe14459dcd92a3adb0d5bc9595879a..ddee0e909799df62066336e4ea48677f39d5f583 100644 (file)
@@ -10,3 +10,5 @@ mmc-meson-gx-use-memcpy_to-fromio-for-dram-access-quirk.patch
 mips-generic-update-node-names-to-avoid-unit-addresses.patch
 arm64-ignore-any-dma-offsets-in-the-max_zone_phys-calculation.patch
 arm64-force-no_block_mappings-if-crashkernel-reservation-is-required.patch
+spi-spi-nxp-fspi-move-the-register-operation-after-t.patch
+revert-pci-pm-do-not-read-power-state-in-pci_enable_.patch
diff --git a/queue-5.10/spi-spi-nxp-fspi-move-the-register-operation-after-t.patch b/queue-5.10/spi-spi-nxp-fspi-move-the-register-operation-after-t.patch
new file mode 100644 (file)
index 0000000..9c5aed4
--- /dev/null
@@ -0,0 +1,53 @@
+From 3321c0abaa8f5a875c73c892729b8b87c21f7849 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 10 Jun 2021 17:24:33 +0800
+Subject: spi: spi-nxp-fspi: move the register operation after the clock enable
+
+From: Haibo Chen <haibo.chen@nxp.com>
+
+[ Upstream commit f422316c8e9d3c4aff3c56549dfb44a677d02f14 ]
+
+Move the register operation after the clock enable, otherwise system
+will stuck when this driver probe.
+
+Fixes: 71d80563b076 ("spi: spi-nxp-fspi: fix fspi panic by unexpected interrupts")
+Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
+Link: https://lore.kernel.org/r/1623317073-25158-1-git-send-email-haibo.chen@nxp.com
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/spi/spi-nxp-fspi.c | 11 +++++------
+ 1 file changed, 5 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/spi/spi-nxp-fspi.c b/drivers/spi/spi-nxp-fspi.c
+index ab9035662717..bcc0b5a3a459 100644
+--- a/drivers/spi/spi-nxp-fspi.c
++++ b/drivers/spi/spi-nxp-fspi.c
+@@ -1033,12 +1033,6 @@ static int nxp_fspi_probe(struct platform_device *pdev)
+               goto err_put_ctrl;
+       }
+-      /* Clear potential interrupts */
+-      reg = fspi_readl(f, f->iobase + FSPI_INTR);
+-      if (reg)
+-              fspi_writel(f, reg, f->iobase + FSPI_INTR);
+-
+-
+       /* find the resources - controller memory mapped space */
+       if (is_acpi_node(f->dev->fwnode))
+               res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
+@@ -1076,6 +1070,11 @@ static int nxp_fspi_probe(struct platform_device *pdev)
+               }
+       }
++      /* Clear potential interrupts */
++      reg = fspi_readl(f, f->iobase + FSPI_INTR);
++      if (reg)
++              fspi_writel(f, reg, f->iobase + FSPI_INTR);
++
+       /* find the irq */
+       ret = platform_get_irq(pdev, 0);
+       if (ret < 0)
+-- 
+2.30.2
+