From: Greg Kroah-Hartman Date: Fri, 29 Mar 2024 12:52:59 +0000 (+0100) Subject: 6.8-stable patches X-Git-Tag: v6.7.12~152 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=363c7377026954e1e70c45a5024dc291eb4ea29d;p=thirdparty%2Fkernel%2Fstable-queue.git 6.8-stable patches added patches: mfd-intel-lpss-introduce-quirk_clock_divider_unity-for-xps-9530.patch mfd-intel-lpss-switch-to-generalized-quirk-table.patch --- diff --git a/queue-6.8/mfd-intel-lpss-introduce-quirk_clock_divider_unity-for-xps-9530.patch b/queue-6.8/mfd-intel-lpss-introduce-quirk_clock_divider_unity-for-xps-9530.patch new file mode 100644 index 00000000000..4e441a99d4d --- /dev/null +++ b/queue-6.8/mfd-intel-lpss-introduce-quirk_clock_divider_unity-for-xps-9530.patch @@ -0,0 +1,75 @@ +From 1d8c51ed2ddcc4161e6496cf14fcd83921c50ec8 Mon Sep 17 00:00:00 2001 +From: Aleksandrs Vinarskis +Date: Thu, 21 Dec 2023 19:51:42 +0100 +Subject: mfd: intel-lpss: Introduce QUIRK_CLOCK_DIVIDER_UNITY for XPS 9530 + +From: Aleksandrs Vinarskis + +commit 1d8c51ed2ddcc4161e6496cf14fcd83921c50ec8 upstream. + +Some devices (eg. Dell XPS 9530, 2023) due to a firmware bug have a +misconfigured clock divider, which should've been 1:1. This introduces +quirk which conditionally re-configures the clock divider to 1:1. + +Signed-off-by: Aleksandrs Vinarskis +Reviewed-by: Andy Shevchenko +Link: https://lore.kernel.org/r/20231221185142.9224-3-alex.vinarskis@gmail.com +Signed-off-by: Lee Jones +Signed-off-by: Greg Kroah-Hartman +--- + drivers/mfd/intel-lpss-pci.c | 5 +++++ + drivers/mfd/intel-lpss.c | 7 +++++++ + drivers/mfd/intel-lpss.h | 5 +++++ + 3 files changed, 17 insertions(+) + +--- a/drivers/mfd/intel-lpss-pci.c ++++ b/drivers/mfd/intel-lpss-pci.c +@@ -34,6 +34,11 @@ static const struct pci_device_id quirk_ + PCI_DEVICE_SUB(PCI_VENDOR_ID_INTEL, 0x9d64, 0x152d, 0x1237), + .driver_data = QUIRK_IGNORE_RESOURCE_CONFLICTS, + }, ++ { ++ /* Dell XPS 9530 (2023) */ ++ PCI_DEVICE_SUB(PCI_VENDOR_ID_INTEL, 0x51fb, 0x1028, 0x0beb), ++ .driver_data = QUIRK_CLOCK_DIVIDER_UNITY, ++ }, + { } + }; + +--- a/drivers/mfd/intel-lpss.c ++++ b/drivers/mfd/intel-lpss.c +@@ -300,6 +300,7 @@ static int intel_lpss_register_clock_div + { + char name[32]; + struct clk *tmp = *clk; ++ int ret; + + snprintf(name, sizeof(name), "%s-enable", devname); + tmp = clk_register_gate(NULL, name, __clk_get_name(tmp), 0, +@@ -316,6 +317,12 @@ static int intel_lpss_register_clock_div + return PTR_ERR(tmp); + *clk = tmp; + ++ if (lpss->info->quirks & QUIRK_CLOCK_DIVIDER_UNITY) { ++ ret = clk_set_rate(tmp, lpss->info->clk_rate); ++ if (ret) ++ return ret; ++ } ++ + snprintf(name, sizeof(name), "%s-update", devname); + tmp = clk_register_gate(NULL, name, __clk_get_name(tmp), + CLK_SET_RATE_PARENT, lpss->priv, 31, 0, NULL); +--- a/drivers/mfd/intel-lpss.h ++++ b/drivers/mfd/intel-lpss.h +@@ -19,6 +19,11 @@ + * Set to ignore resource conflicts with ACPI declared SystemMemory regions. + */ + #define QUIRK_IGNORE_RESOURCE_CONFLICTS BIT(0) ++/* ++ * Some devices have misconfigured clock divider due to a firmware bug. ++ * Set this to force the clock divider to 1:1 ratio. ++ */ ++#define QUIRK_CLOCK_DIVIDER_UNITY BIT(1) + + struct device; + struct resource; diff --git a/queue-6.8/mfd-intel-lpss-switch-to-generalized-quirk-table.patch b/queue-6.8/mfd-intel-lpss-switch-to-generalized-quirk-table.patch new file mode 100644 index 00000000000..de2e77da6f7 --- /dev/null +++ b/queue-6.8/mfd-intel-lpss-switch-to-generalized-quirk-table.patch @@ -0,0 +1,108 @@ +From ac9538f6007e1c80f1b8a62db7ecc391b4d78ae5 Mon Sep 17 00:00:00 2001 +From: Aleksandrs Vinarskis +Date: Thu, 21 Dec 2023 19:51:41 +0100 +Subject: mfd: intel-lpss: Switch to generalized quirk table + +From: Aleksandrs Vinarskis + +commit ac9538f6007e1c80f1b8a62db7ecc391b4d78ae5 upstream. + +Introduce generic quirk table, and port existing walkaround for select +Microsoft devices to it. This is a preparation for +QUIRK_CLOCK_DIVIDER_UNITY. + +Signed-off-by: Aleksandrs Vinarskis +Reviewed-by: Andy Shevchenko +Link: https://lore.kernel.org/r/20231221185142.9224-2-alex.vinarskis@gmail.com +Signed-off-by: Lee Jones +Signed-off-by: Greg Kroah-Hartman +--- + drivers/mfd/intel-lpss-pci.c | 23 +++++++++++++++-------- + drivers/mfd/intel-lpss.c | 2 +- + drivers/mfd/intel-lpss.h | 9 ++++++++- + 3 files changed, 24 insertions(+), 10 deletions(-) + +--- a/drivers/mfd/intel-lpss-pci.c ++++ b/drivers/mfd/intel-lpss-pci.c +@@ -23,12 +23,17 @@ + + #include "intel-lpss.h" + +-/* Some DSDTs have an unused GEXP ACPI device conflicting with I2C4 resources */ +-static const struct pci_device_id ignore_resource_conflicts_ids[] = { +- /* Microsoft Surface Go (version 1) I2C4 */ +- { PCI_DEVICE_SUB(PCI_VENDOR_ID_INTEL, 0x9d64, 0x152d, 0x1182), }, +- /* Microsoft Surface Go 2 I2C4 */ +- { PCI_DEVICE_SUB(PCI_VENDOR_ID_INTEL, 0x9d64, 0x152d, 0x1237), }, ++static const struct pci_device_id quirk_ids[] = { ++ { ++ /* Microsoft Surface Go (version 1) I2C4 */ ++ PCI_DEVICE_SUB(PCI_VENDOR_ID_INTEL, 0x9d64, 0x152d, 0x1182), ++ .driver_data = QUIRK_IGNORE_RESOURCE_CONFLICTS, ++ }, ++ { ++ /* Microsoft Surface Go 2 I2C4 */ ++ PCI_DEVICE_SUB(PCI_VENDOR_ID_INTEL, 0x9d64, 0x152d, 0x1237), ++ .driver_data = QUIRK_IGNORE_RESOURCE_CONFLICTS, ++ }, + { } + }; + +@@ -36,6 +41,7 @@ static int intel_lpss_pci_probe(struct p + const struct pci_device_id *id) + { + const struct intel_lpss_platform_info *data = (void *)id->driver_data; ++ const struct pci_device_id *quirk_pci_info; + struct intel_lpss_platform_info *info; + int ret; + +@@ -55,8 +61,9 @@ static int intel_lpss_pci_probe(struct p + info->mem = pci_resource_n(pdev, 0); + info->irq = pci_irq_vector(pdev, 0); + +- if (pci_match_id(ignore_resource_conflicts_ids, pdev)) +- info->ignore_resource_conflicts = true; ++ quirk_pci_info = pci_match_id(quirk_ids, pdev); ++ if (quirk_pci_info) ++ info->quirks = quirk_pci_info->driver_data; + + pdev->d3cold_delay = 0; + +--- a/drivers/mfd/intel-lpss.c ++++ b/drivers/mfd/intel-lpss.c +@@ -412,7 +412,7 @@ int intel_lpss_probe(struct device *dev, + return ret; + + lpss->cell->swnode = info->swnode; +- lpss->cell->ignore_resource_conflicts = info->ignore_resource_conflicts; ++ lpss->cell->ignore_resource_conflicts = info->quirks & QUIRK_IGNORE_RESOURCE_CONFLICTS; + + intel_lpss_init_dev(lpss); + +--- a/drivers/mfd/intel-lpss.h ++++ b/drivers/mfd/intel-lpss.h +@@ -11,16 +11,23 @@ + #ifndef __MFD_INTEL_LPSS_H + #define __MFD_INTEL_LPSS_H + ++#include + #include + ++/* ++ * Some DSDTs have an unused GEXP ACPI device conflicting with I2C4 resources. ++ * Set to ignore resource conflicts with ACPI declared SystemMemory regions. ++ */ ++#define QUIRK_IGNORE_RESOURCE_CONFLICTS BIT(0) ++ + struct device; + struct resource; + struct software_node; + + struct intel_lpss_platform_info { + struct resource *mem; +- bool ignore_resource_conflicts; + int irq; ++ unsigned int quirks; + unsigned long clk_rate; + const char *clk_con_id; + const struct software_node *swnode; diff --git a/queue-6.8/series b/queue-6.8/series index 3c741da7748..0c9358fbb2a 100644 --- a/queue-6.8/series +++ b/queue-6.8/series @@ -273,3 +273,5 @@ selftests-mm-fix-build-with-_fortify_source.patch btrfs-handle-errors-returned-from-unpin_extent_cache.patch btrfs-fix-warning-messages-not-printing-interval-at-.patch btrfs-do-not-skip-re-registration-for-the-mounted-device.patch +mfd-intel-lpss-switch-to-generalized-quirk-table.patch +mfd-intel-lpss-introduce-quirk_clock_divider_unity-for-xps-9530.patch