]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 26 Jul 2021 09:36:11 +0000 (11:36 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 26 Jul 2021 09:36:11 +0000 (11:36 +0200)
added patches:
btrfs-compression-don-t-try-to-compress-if-we-don-t-have-enough-pages.patch
iio-accel-bma180-fix-bma25x-bandwidth-register-values.patch
iio-accel-bma180-use-explicit-member-assignment.patch
pci-mark-amd-navi14-gpu-ats-as-broken.patch
spi-spi-fsl-dspi-fix-a-resource-leak-in-an-error-handling-path.patch

queue-4.19/btrfs-compression-don-t-try-to-compress-if-we-don-t-have-enough-pages.patch [new file with mode: 0644]
queue-4.19/iio-accel-bma180-fix-bma25x-bandwidth-register-values.patch [new file with mode: 0644]
queue-4.19/iio-accel-bma180-use-explicit-member-assignment.patch [new file with mode: 0644]
queue-4.19/pci-mark-amd-navi14-gpu-ats-as-broken.patch [new file with mode: 0644]
queue-4.19/series
queue-4.19/spi-spi-fsl-dspi-fix-a-resource-leak-in-an-error-handling-path.patch [new file with mode: 0644]

diff --git a/queue-4.19/btrfs-compression-don-t-try-to-compress-if-we-don-t-have-enough-pages.patch b/queue-4.19/btrfs-compression-don-t-try-to-compress-if-we-don-t-have-enough-pages.patch
new file mode 100644 (file)
index 0000000..4db77f2
--- /dev/null
@@ -0,0 +1,39 @@
+From foo@baz Mon Jul 26 11:33:21 AM CEST 2021
+From: David Sterba <dsterba@suse.com>
+Date: Mon, 14 Jun 2021 12:45:18 +0200
+Subject: btrfs: compression: don't try to compress if we don't have enough pages
+
+From: David Sterba <dsterba@suse.com>
+
+commit f2165627319ffd33a6217275e5690b1ab5c45763 upstream
+
+The early check if we should attempt compression does not take into
+account the number of input pages. It can happen that there's only one
+page, eg. a tail page after some ranges of the BTRFS_MAX_UNCOMPRESSED
+have been processed, or an isolated page that won't be converted to an
+inline extent.
+
+The single page would be compressed but a later check would drop it
+again because the result size must be at least one block shorter than
+the input. That can never work with just one page.
+
+CC: stable@vger.kernel.org # 4.4+
+Signed-off-by: David Sterba <dsterba@suse.com>
+[sudip: adjust context]
+Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/btrfs/inode.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/fs/btrfs/inode.c
++++ b/fs/btrfs/inode.c
+@@ -530,7 +530,7 @@ again:
+        * inode has not been flagged as nocompress.  This flag can
+        * change at any time if we discover bad compression ratios.
+        */
+-      if (inode_need_compress(inode, start, end)) {
++      if (nr_pages > 1 && inode_need_compress(inode, start, end)) {
+               WARN_ON(pages);
+               pages = kcalloc(nr_pages, sizeof(struct page *), GFP_NOFS);
+               if (!pages) {
diff --git a/queue-4.19/iio-accel-bma180-fix-bma25x-bandwidth-register-values.patch b/queue-4.19/iio-accel-bma180-fix-bma25x-bandwidth-register-values.patch
new file mode 100644 (file)
index 0000000..3ca5bb5
--- /dev/null
@@ -0,0 +1,77 @@
+From foo@baz Mon Jul 26 11:32:18 AM CEST 2021
+From: Stephan Gerhold <stephan@gerhold.net>
+Date: Wed, 26 May 2021 11:44:07 +0200
+Subject: iio: accel: bma180: Fix BMA25x bandwidth register values
+
+From: Stephan Gerhold <stephan@gerhold.net>
+
+commit 8090d67421ddab0ae932abab5a60200598bf0bbb upstream
+
+According to the BMA253 datasheet [1] and BMA250 datasheet [2] the
+bandwidth value for BMA25x should be set as 01xxx:
+
+  "Settings 00xxx result in a bandwidth of 7.81 Hz; [...]
+   It is recommended [...] to use the range from ´01000b´ to ´01111b´
+   only in order to be compatible with future products."
+
+However, at the moment the drivers sets bandwidth values from 0 to 6,
+which is not recommended and always results into 7.81 Hz bandwidth
+according to the datasheet.
+
+Fix this by introducing a bw_offset = 8 = 01000b for BMA25x,
+so the additional bit is always set for BMA25x.
+
+[1]: https://www.bosch-sensortec.com/media/boschsensortec/downloads/datasheets/bst-bma253-ds000.pdf
+[2]: https://datasheet.octopart.com/BMA250-Bosch-datasheet-15540103.pdf
+
+Cc: Peter Meerwald <pmeerw@pmeerw.net>
+Fixes: 2017cff24cc0 ("iio:bma180: Add BMA250 chip support")
+Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
+Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
+Link: https://lore.kernel.org/r/20210526094408.34298-2-stephan@gerhold.net
+Cc: <Stable@vger.kernel.org>
+Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
+[sudip: adjust context]
+Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/iio/accel/bma180.c |    7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+--- a/drivers/iio/accel/bma180.c
++++ b/drivers/iio/accel/bma180.c
+@@ -50,7 +50,7 @@ struct bma180_part_info {
+       u8 int_reset_reg, int_reset_mask;
+       u8 sleep_reg, sleep_mask;
+-      u8 bw_reg, bw_mask;
++      u8 bw_reg, bw_mask, bw_offset;
+       u8 scale_reg, scale_mask;
+       u8 power_reg, power_mask, lowpower_val;
+       u8 int_enable_reg, int_enable_mask;
+@@ -106,6 +106,7 @@ struct bma180_part_info {
+ #define BMA250_RANGE_MASK     GENMASK(3, 0) /* Range of accel values */
+ #define BMA250_BW_MASK                GENMASK(4, 0) /* Accel bandwidth */
++#define BMA250_BW_OFFSET      8
+ #define BMA250_SUSPEND_MASK   BIT(7) /* chip will sleep */
+ #define BMA250_LOWPOWER_MASK  BIT(6)
+ #define BMA250_DATA_INTEN_MASK        BIT(4)
+@@ -243,7 +244,8 @@ static int bma180_set_bw(struct bma180_d
+       for (i = 0; i < data->part_info->num_bw; ++i) {
+               if (data->part_info->bw_table[i] == val) {
+                       ret = bma180_set_bits(data, data->part_info->bw_reg,
+-                              data->part_info->bw_mask, i);
++                              data->part_info->bw_mask,
++                              i + data->part_info->bw_offset);
+                       if (ret) {
+                               dev_err(&data->client->dev,
+                                       "failed to set bandwidth\n");
+@@ -661,6 +663,7 @@ static const struct bma180_part_info bma
+               .sleep_mask = BMA250_SUSPEND_MASK,
+               .bw_reg = BMA250_BW_REG,
+               .bw_mask = BMA250_BW_MASK,
++              .bw_offset = BMA250_BW_OFFSET,
+               .scale_reg = BMA250_RANGE_REG,
+               .scale_mask = BMA250_RANGE_MASK,
+               .power_reg = BMA250_POWER_REG,
diff --git a/queue-4.19/iio-accel-bma180-use-explicit-member-assignment.patch b/queue-4.19/iio-accel-bma180-use-explicit-member-assignment.patch
new file mode 100644 (file)
index 0000000..4475c20
--- /dev/null
@@ -0,0 +1,102 @@
+From foo@baz Mon Jul 26 11:32:18 AM CEST 2021
+From: Linus Walleij <linus.walleij@linaro.org>
+Date: Wed, 11 Dec 2019 22:38:18 +0100
+Subject: iio: accel: bma180: Use explicit member assignment
+
+From: Linus Walleij <linus.walleij@linaro.org>
+
+commit 9436abc40139503a7cea22a96437697d048f31c0 upstream
+
+This uses the C99 explicit .member assignment for the
+variant data in struct bma180_part_info. This makes it
+easier to understand and add new variants.
+
+Cc: Peter Meerwald <pmeerw@pmeerw.net>
+Cc: Oleksandr Kravchenko <o.v.kravchenko@globallogic.com>
+Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
+Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
+Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/iio/accel/bma180.c |   68 +++++++++++++++++++++++++++++----------------
+ 1 file changed, 44 insertions(+), 24 deletions(-)
+
+--- a/drivers/iio/accel/bma180.c
++++ b/drivers/iio/accel/bma180.c
+@@ -625,32 +625,52 @@ static const struct iio_chan_spec bma250
+ static const struct bma180_part_info bma180_part_info[] = {
+       [BMA180] = {
+-              bma180_channels, ARRAY_SIZE(bma180_channels),
+-              bma180_scale_table, ARRAY_SIZE(bma180_scale_table),
+-              bma180_bw_table, ARRAY_SIZE(bma180_bw_table),
+-              BMA180_CTRL_REG0, BMA180_RESET_INT,
+-              BMA180_CTRL_REG0, BMA180_SLEEP,
+-              BMA180_BW_TCS, BMA180_BW,
+-              BMA180_OFFSET_LSB1, BMA180_RANGE,
+-              BMA180_TCO_Z, BMA180_MODE_CONFIG, BMA180_LOW_POWER,
+-              BMA180_CTRL_REG3, BMA180_NEW_DATA_INT,
+-              BMA180_RESET,
+-              bma180_chip_config,
+-              bma180_chip_disable,
++              .channels = bma180_channels,
++              .num_channels = ARRAY_SIZE(bma180_channels),
++              .scale_table = bma180_scale_table,
++              .num_scales = ARRAY_SIZE(bma180_scale_table),
++              .bw_table = bma180_bw_table,
++              .num_bw = ARRAY_SIZE(bma180_bw_table),
++              .int_reset_reg = BMA180_CTRL_REG0,
++              .int_reset_mask = BMA180_RESET_INT,
++              .sleep_reg = BMA180_CTRL_REG0,
++              .sleep_mask = BMA180_SLEEP,
++              .bw_reg = BMA180_BW_TCS,
++              .bw_mask = BMA180_BW,
++              .scale_reg = BMA180_OFFSET_LSB1,
++              .scale_mask = BMA180_RANGE,
++              .power_reg = BMA180_TCO_Z,
++              .power_mask = BMA180_MODE_CONFIG,
++              .lowpower_val = BMA180_LOW_POWER,
++              .int_enable_reg = BMA180_CTRL_REG3,
++              .int_enable_mask = BMA180_NEW_DATA_INT,
++              .softreset_reg = BMA180_RESET,
++              .chip_config = bma180_chip_config,
++              .chip_disable = bma180_chip_disable,
+       },
+       [BMA250] = {
+-              bma250_channels, ARRAY_SIZE(bma250_channels),
+-              bma250_scale_table, ARRAY_SIZE(bma250_scale_table),
+-              bma250_bw_table, ARRAY_SIZE(bma250_bw_table),
+-              BMA250_INT_RESET_REG, BMA250_INT_RESET_MASK,
+-              BMA250_POWER_REG, BMA250_SUSPEND_MASK,
+-              BMA250_BW_REG, BMA250_BW_MASK,
+-              BMA250_RANGE_REG, BMA250_RANGE_MASK,
+-              BMA250_POWER_REG, BMA250_LOWPOWER_MASK, 1,
+-              BMA250_INT_ENABLE_REG, BMA250_DATA_INTEN_MASK,
+-              BMA250_RESET_REG,
+-              bma250_chip_config,
+-              bma250_chip_disable,
++              .channels = bma250_channels,
++              .num_channels = ARRAY_SIZE(bma250_channels),
++              .scale_table = bma250_scale_table,
++              .num_scales = ARRAY_SIZE(bma250_scale_table),
++              .bw_table = bma250_bw_table,
++              .num_bw = ARRAY_SIZE(bma250_bw_table),
++              .int_reset_reg = BMA250_INT_RESET_REG,
++              .int_reset_mask = BMA250_INT_RESET_MASK,
++              .sleep_reg = BMA250_POWER_REG,
++              .sleep_mask = BMA250_SUSPEND_MASK,
++              .bw_reg = BMA250_BW_REG,
++              .bw_mask = BMA250_BW_MASK,
++              .scale_reg = BMA250_RANGE_REG,
++              .scale_mask = BMA250_RANGE_MASK,
++              .power_reg = BMA250_POWER_REG,
++              .power_mask = BMA250_LOWPOWER_MASK,
++              .lowpower_val = 1,
++              .int_enable_reg = BMA250_INT_ENABLE_REG,
++              .int_enable_mask = BMA250_DATA_INTEN_MASK,
++              .softreset_reg = BMA250_RESET_REG,
++              .chip_config = bma250_chip_config,
++              .chip_disable = bma250_chip_disable,
+       },
+ };
diff --git a/queue-4.19/pci-mark-amd-navi14-gpu-ats-as-broken.patch b/queue-4.19/pci-mark-amd-navi14-gpu-ats-as-broken.patch
new file mode 100644 (file)
index 0000000..94d27a4
--- /dev/null
@@ -0,0 +1,51 @@
+From foo@baz Mon Jul 26 11:34:22 AM CEST 2021
+From: Evan Quan <evan.quan@amd.com>
+Date: Wed, 2 Jun 2021 10:12:55 +0800
+Subject: PCI: Mark AMD Navi14 GPU ATS as broken
+
+From: Evan Quan <evan.quan@amd.com>
+
+commit e8946a53e2a698c148b3b3ed732f43c7747fbeb6 upstream
+
+Observed unexpected GPU hang during runpm stress test on 0x7341 rev 0x00.
+Further debugging shows broken ATS is related.
+
+Disable ATS on this part.  Similar issues on other devices:
+
+  a2da5d8cc0b0 ("PCI: Mark AMD Raven iGPU ATS as broken in some platforms")
+  45beb31d3afb ("PCI: Mark AMD Navi10 GPU rev 0x00 ATS as broken")
+  5e89cd303e3a ("PCI: Mark AMD Navi14 GPU rev 0xc5 ATS as broken")
+
+Suggested-by: Alex Deucher <alexander.deucher@amd.com>
+Link: https://lore.kernel.org/r/20210602021255.939090-1-evan.quan@amd.com
+Signed-off-by: Evan Quan <evan.quan@amd.com>
+Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
+Reviewed-by: Krzysztof Wilczyński <kw@linux.com>
+Cc: stable@vger.kernel.org
+[sudip: adjust context]
+Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/pci/quirks.c |    4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/drivers/pci/quirks.c
++++ b/drivers/pci/quirks.c
+@@ -5172,7 +5172,8 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_SE
+ static void quirk_amd_harvest_no_ats(struct pci_dev *pdev)
+ {
+       if ((pdev->device == 0x7312 && pdev->revision != 0x00) ||
+-          (pdev->device == 0x7340 && pdev->revision != 0xc5))
++          (pdev->device == 0x7340 && pdev->revision != 0xc5) ||
++          (pdev->device == 0x7341 && pdev->revision != 0x00))
+               return;
+       pci_info(pdev, "disabling ATS\n");
+@@ -5187,6 +5188,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AT
+ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x7312, quirk_amd_harvest_no_ats);
+ /* AMD Navi14 dGPU */
+ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x7340, quirk_amd_harvest_no_ats);
++DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, 0x7341, quirk_amd_harvest_no_ats);
+ #endif /* CONFIG_PCI_ATS */
+ /* Freescale PCIe doesn't support MSI in RC mode */
index 61e256dc1223a3edb1abebc367128ea18f438e92..14ce3359a256e224ff6a93627f8eb886630bbe90 100644 (file)
@@ -112,3 +112,8 @@ kvm-do-not-assume-pte-is-writable-after-follow_pfn.patch
 kvm-do-not-allow-mapping-valid-but-non-reference-counted-pages.patch
 net-dsa-mv88e6xxx-use-correct-.stats_set_histogram-on-topaz.patch
 net-bcmgenet-ensure-ext_energy_det_mask-is-clear.patch
+iio-accel-bma180-use-explicit-member-assignment.patch
+iio-accel-bma180-fix-bma25x-bandwidth-register-values.patch
+btrfs-compression-don-t-try-to-compress-if-we-don-t-have-enough-pages.patch
+pci-mark-amd-navi14-gpu-ats-as-broken.patch
+spi-spi-fsl-dspi-fix-a-resource-leak-in-an-error-handling-path.patch
diff --git a/queue-4.19/spi-spi-fsl-dspi-fix-a-resource-leak-in-an-error-handling-path.patch b/queue-4.19/spi-spi-fsl-dspi-fix-a-resource-leak-in-an-error-handling-path.patch
new file mode 100644 (file)
index 0000000..14938e9
--- /dev/null
@@ -0,0 +1,42 @@
+From foo@baz Mon Jul 26 11:35:04 AM CEST 2021
+From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
+Date: Sun, 9 May 2021 21:12:27 +0200
+Subject: spi: spi-fsl-dspi: Fix a resource leak in an error handling path
+
+From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
+
+commit 680ec0549a055eb464dce6ffb4bfb736ef87236e upstream
+
+'dspi_request_dma()' should be undone by a 'dspi_release_dma()' call in the
+error handling path of the probe function, as already done in the remove
+function
+
+Fixes: 90ba37033cb9 ("spi: spi-fsl-dspi: Add DMA support for Vybrid")
+Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
+Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
+Link: https://lore.kernel.org/r/d51caaac747277a1099ba8dea07acd85435b857e.1620587472.git.christophe.jaillet@wanadoo.fr
+Signed-off-by: Mark Brown <broonie@kernel.org>
+[sudip: adjust context]
+Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/spi/spi-fsl-dspi.c |    4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/drivers/spi/spi-fsl-dspi.c
++++ b/drivers/spi/spi-fsl-dspi.c
+@@ -1124,11 +1124,13 @@ static int dspi_probe(struct platform_de
+       ret = spi_register_master(master);
+       if (ret != 0) {
+               dev_err(&pdev->dev, "Problem registering DSPI master\n");
+-              goto out_free_irq;
++              goto out_release_dma;
+       }
+       return ret;
++out_release_dma:
++      dspi_release_dma(dspi);
+ out_free_irq:
+       if (dspi->irq)
+               free_irq(dspi->irq, dspi);