]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 4.9
authorSasha Levin <sashal@kernel.org>
Wed, 10 Mar 2021 12:07:01 +0000 (07:07 -0500)
committerSasha Levin <sashal@kernel.org>
Wed, 10 Mar 2021 12:07:01 +0000 (07:07 -0500)
Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-4.9/misc-eeprom_93xx46-add-quirk-to-support-microchip-93.patch [new file with mode: 0644]
queue-4.9/pci-add-function-1-dma-alias-quirk-for-marvell-9215-.patch [new file with mode: 0644]
queue-4.9/platform-x86-acer-wmi-add-new-force_caps-module-para.patch [new file with mode: 0644]
queue-4.9/series

diff --git a/queue-4.9/misc-eeprom_93xx46-add-quirk-to-support-microchip-93.patch b/queue-4.9/misc-eeprom_93xx46-add-quirk-to-support-microchip-93.patch
new file mode 100644 (file)
index 0000000..ae241fd
--- /dev/null
@@ -0,0 +1,91 @@
+From 4143cbfcf985392f293af8f3bc5c7269b8d63c0f Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 5 Jan 2021 16:28:12 +0530
+Subject: misc: eeprom_93xx46: Add quirk to support Microchip 93LC46B eeprom
+
+From: Aswath Govindraju <a-govindraju@ti.com>
+
+[ Upstream commit f6f1f8e6e3eea25f539105d48166e91f0ab46dd1 ]
+
+A dummy zero bit is sent preceding the data during a read transfer by the
+Microchip 93LC46B eeprom (section 2.7 of[1]). This results in right shift
+of data during a read. In order to ignore this bit a quirk can be added to
+send an extra zero bit after the read address.
+
+Add a quirk to ignore the zero bit sent before data by adding a zero bit
+after the read address.
+
+[1] - https://www.mouser.com/datasheet/2/268/20001749K-277859.pdf
+
+Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
+Link: https://lore.kernel.org/r/20210105105817.17644-3-a-govindraju@ti.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/misc/eeprom/eeprom_93xx46.c | 15 +++++++++++++++
+ include/linux/eeprom_93xx46.h       |  2 ++
+ 2 files changed, 17 insertions(+)
+
+diff --git a/drivers/misc/eeprom/eeprom_93xx46.c b/drivers/misc/eeprom/eeprom_93xx46.c
+index d30deee1effd..30b490329f55 100644
+--- a/drivers/misc/eeprom/eeprom_93xx46.c
++++ b/drivers/misc/eeprom/eeprom_93xx46.c
+@@ -38,6 +38,10 @@ static const struct eeprom_93xx46_devtype_data atmel_at93c46d_data = {
+                 EEPROM_93XX46_QUIRK_INSTRUCTION_LENGTH,
+ };
++static const struct eeprom_93xx46_devtype_data microchip_93lc46b_data = {
++      .quirks = EEPROM_93XX46_QUIRK_EXTRA_READ_CYCLE,
++};
++
+ struct eeprom_93xx46_dev {
+       struct spi_device *spi;
+       struct eeprom_93xx46_platform_data *pdata;
+@@ -58,6 +62,11 @@ static inline bool has_quirk_instruction_length(struct eeprom_93xx46_dev *edev)
+       return edev->pdata->quirks & EEPROM_93XX46_QUIRK_INSTRUCTION_LENGTH;
+ }
++static inline bool has_quirk_extra_read_cycle(struct eeprom_93xx46_dev *edev)
++{
++      return edev->pdata->quirks & EEPROM_93XX46_QUIRK_EXTRA_READ_CYCLE;
++}
++
+ static int eeprom_93xx46_read(void *priv, unsigned int off,
+                             void *val, size_t count)
+ {
+@@ -99,6 +108,11 @@ static int eeprom_93xx46_read(void *priv, unsigned int off,
+               dev_dbg(&edev->spi->dev, "read cmd 0x%x, %d Hz\n",
+                       cmd_addr, edev->spi->max_speed_hz);
++              if (has_quirk_extra_read_cycle(edev)) {
++                      cmd_addr <<= 1;
++                      bits += 1;
++              }
++
+               spi_message_init(&m);
+               t[0].tx_buf = (char *)&cmd_addr;
+@@ -366,6 +380,7 @@ static void select_deassert(void *context)
+ static const struct of_device_id eeprom_93xx46_of_table[] = {
+       { .compatible = "eeprom-93xx46", },
+       { .compatible = "atmel,at93c46d", .data = &atmel_at93c46d_data, },
++      { .compatible = "microchip,93lc46b", .data = &microchip_93lc46b_data, },
+       {}
+ };
+ MODULE_DEVICE_TABLE(of, eeprom_93xx46_of_table);
+diff --git a/include/linux/eeprom_93xx46.h b/include/linux/eeprom_93xx46.h
+index 885f587a3555..affe4d1d7d4a 100644
+--- a/include/linux/eeprom_93xx46.h
++++ b/include/linux/eeprom_93xx46.h
+@@ -16,6 +16,8 @@ struct eeprom_93xx46_platform_data {
+ #define EEPROM_93XX46_QUIRK_SINGLE_WORD_READ          (1 << 0)
+ /* Instructions such as EWEN are (addrlen + 2) in length. */
+ #define EEPROM_93XX46_QUIRK_INSTRUCTION_LENGTH                (1 << 1)
++/* Add extra cycle after address during a read */
++#define EEPROM_93XX46_QUIRK_EXTRA_READ_CYCLE          BIT(2)
+       /*
+        * optional hooks to control additional logic
+-- 
+2.30.1
+
diff --git a/queue-4.9/pci-add-function-1-dma-alias-quirk-for-marvell-9215-.patch b/queue-4.9/pci-add-function-1-dma-alias-quirk-for-marvell-9215-.patch
new file mode 100644 (file)
index 0000000..7c3922d
--- /dev/null
@@ -0,0 +1,37 @@
+From 61c6e45bb13f34501d98ab0c97478d3e2ce9bd8a Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 10 Nov 2020 16:00:57 -0600
+Subject: PCI: Add function 1 DMA alias quirk for Marvell 9215 SATA controller
+
+From: Bjorn Helgaas <bhelgaas@google.com>
+
+[ Upstream commit 059983790a4c963d92943e55a61fca55be427d55 ]
+
+Add function 1 DMA alias quirk for Marvell 88SS9215 PCIe SSD Controller.
+
+Link: https://bugzilla.kernel.org/show_bug.cgi?id=42679#c135
+Link: https://lore.kernel.org/r/20201110220516.697934-1-helgaas@kernel.org
+Reported-by: John Smith <LK7S2ED64JHGLKj75shg9klejHWG49h5hk@protonmail.com>
+Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/pci/quirks.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
+index 1fdb1ef5eaae..0ebf7500e171 100644
+--- a/drivers/pci/quirks.c
++++ b/drivers/pci/quirks.c
+@@ -3911,6 +3911,9 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MARVELL_EXT, 0x9182,
+ /* https://bugzilla.kernel.org/show_bug.cgi?id=42679#c46 */
+ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MARVELL_EXT, 0x91a0,
+                        quirk_dma_func1_alias);
++/* https://bugzilla.kernel.org/show_bug.cgi?id=42679#c135 */
++DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MARVELL_EXT, 0x9215,
++                       quirk_dma_func1_alias);
+ /* https://bugzilla.kernel.org/show_bug.cgi?id=42679#c127 */
+ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MARVELL_EXT, 0x9220,
+                        quirk_dma_func1_alias);
+-- 
+2.30.1
+
diff --git a/queue-4.9/platform-x86-acer-wmi-add-new-force_caps-module-para.patch b/queue-4.9/platform-x86-acer-wmi-add-new-force_caps-module-para.patch
new file mode 100644 (file)
index 0000000..00c31d8
--- /dev/null
@@ -0,0 +1,78 @@
+From 39ddc8f73cc7fa993acb91ac27d311c315a24f1d Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 19 Oct 2020 20:56:26 +0200
+Subject: platform/x86: acer-wmi: Add new force_caps module parameter
+
+From: Hans de Goede <hdegoede@redhat.com>
+
+[ Upstream commit 39aa009bb66f9d5fbd1e58ca4aa03d6e6f2c9915 ]
+
+Add a new force_caps module parameter to allow overriding the drivers
+builtin capability detection mechanism.
+
+This can be used to for example:
+-Disable rfkill functionality on devices where there is an AA OEM DMI
+ record advertising non functional rfkill switches
+-Force loading of the driver on devices with a missing AA OEM DMI record
+
+Note that force_caps is -1 when unset, this allows forcing the
+capability field to 0, which results in acer-wmi only providing WMI
+hotkey handling while disabling all other (led, rfkill, backlight)
+functionality.
+
+Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Link: https://lore.kernel.org/r/20201019185628.264473-4-hdegoede@redhat.com
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/platform/x86/acer-wmi.c | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
+index 90015e2cce9b..ec3cbb7844bc 100644
+--- a/drivers/platform/x86/acer-wmi.c
++++ b/drivers/platform/x86/acer-wmi.c
+@@ -229,6 +229,7 @@ static int mailled = -1;
+ static int brightness = -1;
+ static int threeg = -1;
+ static int force_series;
++static int force_caps = -1;
+ static bool ec_raw_mode;
+ static bool has_type_aa;
+ static u16 commun_func_bitmap;
+@@ -238,11 +239,13 @@ module_param(mailled, int, 0444);
+ module_param(brightness, int, 0444);
+ module_param(threeg, int, 0444);
+ module_param(force_series, int, 0444);
++module_param(force_caps, int, 0444);
+ module_param(ec_raw_mode, bool, 0444);
+ MODULE_PARM_DESC(mailled, "Set initial state of Mail LED");
+ MODULE_PARM_DESC(brightness, "Set initial LCD backlight brightness");
+ MODULE_PARM_DESC(threeg, "Set initial state of 3G hardware");
+ MODULE_PARM_DESC(force_series, "Force a different laptop series");
++MODULE_PARM_DESC(force_caps, "Force the capability bitmask to this value");
+ MODULE_PARM_DESC(ec_raw_mode, "Enable EC raw mode");
+ struct acer_data {
+@@ -2198,7 +2201,7 @@ static int __init acer_wmi_init(void)
+               }
+               /* WMID always provides brightness methods */
+               interface->capability |= ACER_CAP_BRIGHTNESS;
+-      } else if (!wmi_has_guid(WMID_GUID2) && interface && !has_type_aa) {
++      } else if (!wmi_has_guid(WMID_GUID2) && interface && !has_type_aa && force_caps == -1) {
+               pr_err("No WMID device detection method found\n");
+               return -ENODEV;
+       }
+@@ -2228,6 +2231,9 @@ static int __init acer_wmi_init(void)
+       if (acpi_video_get_backlight_type() != acpi_backlight_vendor)
+               interface->capability &= ~ACER_CAP_BRIGHTNESS;
++      if (force_caps != -1)
++              interface->capability = force_caps;
++
+       if (wmi_has_guid(WMID_GUID3)) {
+               if (ec_raw_mode) {
+                       if (ACPI_FAILURE(acer_wmi_enable_ec_raw())) {
+-- 
+2.30.1
+
index 60d0426cbca2be2d264d9b45073ef81bf1ea51b8..b29ee7d63db278975ee3e793258cc0f7c5013948 100644 (file)
@@ -3,3 +3,6 @@ btrfs-fix-raid6-qstripe-kmap.patch
 usbip-tools-fix-build-error-for-multiple-definition.patch
 alsa-ctxfi-cthw20k2-fix-mask-on-conf-to-allow-4-bits.patch
 rsxx-return-efault-if-copy_to_user-fails.patch
+platform-x86-acer-wmi-add-new-force_caps-module-para.patch
+pci-add-function-1-dma-alias-quirk-for-marvell-9215-.patch
+misc-eeprom_93xx46-add-quirk-to-support-microchip-93.patch