* [PATCH v0 0/2] Fix LPSS clock divider for XPS 9530, 6.7.y backport @ 2024-03-17 1:06 Aleksandrs Vinarskis 2024-03-17 1:06 ` [PATCH v0 1/2] mfd: intel-lpss: Switch to generalized quirk table Aleksandrs Vinarskis 2024-03-17 1:06 ` [PATCH v0 2/2] mfd: intel-lpss: Introduce QUIRK_CLOCK_DIVIDER_UNITY for XPS 9530 Aleksandrs Vinarskis 0 siblings, 2 replies; 6+ messages in thread From: Aleksandrs Vinarskis @ 2024-03-17 1:06 UTC (permalink / raw) To: stable; +Cc: Lee Jones, Andy Shevchenko This is a backport of recently upstreamed fix for XPS 9530 sound issue. Changes wouldn't apply cleanly, and were backported manually to 6.7.y. Ideally should be applied to all branches where upstream commit d110858a6925827609d11db8513d76750483ec06 exists (6.8.y) or was backported (6.7.y) as it adds initial yet incomplete support for this laptop. Signed-off-by: Aleksandrs Vinarskis <alex.vinarskis@gmail.com> Aleksandrs Vinarskis (2): mfd: intel-lpss: Switch to generalized quirk table mfd: intel-lpss: Introduce QUIRK_CLOCK_DIVIDER_UNITY for XPS 9530 drivers/mfd/intel-lpss-pci.c | 28 ++++++++++++++++++++-------- drivers/mfd/intel-lpss.c | 9 ++++++++- drivers/mfd/intel-lpss.h | 14 +++++++++++++- 3 files changed, 41 insertions(+), 10 deletions(-) -- 2.40.1 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v0 1/2] mfd: intel-lpss: Switch to generalized quirk table 2024-03-17 1:06 [PATCH v0 0/2] Fix LPSS clock divider for XPS 9530, 6.7.y backport Aleksandrs Vinarskis @ 2024-03-17 1:06 ` Aleksandrs Vinarskis 2024-03-17 19:06 ` Greg KH 2024-03-17 1:06 ` [PATCH v0 2/2] mfd: intel-lpss: Introduce QUIRK_CLOCK_DIVIDER_UNITY for XPS 9530 Aleksandrs Vinarskis 1 sibling, 1 reply; 6+ messages in thread From: Aleksandrs Vinarskis @ 2024-03-17 1:06 UTC (permalink / raw) To: stable; +Cc: Lee Jones, Andy Shevchenko 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 <alex.vinarskis@gmail.com> --- 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(-) diff --git a/drivers/mfd/intel-lpss-pci.c b/drivers/mfd/intel-lpss-pci.c index ae5759200622..eb3b0195db2e 100644 --- a/drivers/mfd/intel-lpss-pci.c +++ b/drivers/mfd/intel-lpss-pci.c @@ -18,18 +18,24 @@ #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, + }, { } }; static int intel_lpss_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) { + const struct pci_device_id *quirk_pci_info; struct intel_lpss_platform_info *info; int ret; @@ -45,8 +51,9 @@ static int intel_lpss_pci_probe(struct pci_dev *pdev, info->mem = &pdev->resource[0]; info->irq = pdev->irq; - 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; diff --git a/drivers/mfd/intel-lpss.c b/drivers/mfd/intel-lpss.c index 00e7b578bb3e..7af0a1fab062 100644 --- a/drivers/mfd/intel-lpss.c +++ b/drivers/mfd/intel-lpss.c @@ -401,7 +401,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); diff --git a/drivers/mfd/intel-lpss.h b/drivers/mfd/intel-lpss.h index 062ce95b68b9..f636059cbc71 100644 --- 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 <linux/bits.h> #include <linux/pm.h> +/* + * 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; -- 2.40.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v0 1/2] mfd: intel-lpss: Switch to generalized quirk table 2024-03-17 1:06 ` [PATCH v0 1/2] mfd: intel-lpss: Switch to generalized quirk table Aleksandrs Vinarskis @ 2024-03-17 19:06 ` Greg KH 2024-03-17 20:55 ` alex vinarskis 0 siblings, 1 reply; 6+ messages in thread From: Greg KH @ 2024-03-17 19:06 UTC (permalink / raw) To: Aleksandrs Vinarskis; +Cc: stable, Lee Jones, Andy Shevchenko On Sun, Mar 17, 2024 at 02:06:50AM +0100, Aleksandrs Vinarskis wrote: > 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 <alex.vinarskis@gmail.com> > --- What is the git commit id of this and patch 2/2? ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v0 1/2] mfd: intel-lpss: Switch to generalized quirk table 2024-03-17 19:06 ` Greg KH @ 2024-03-17 20:55 ` alex vinarskis 0 siblings, 0 replies; 6+ messages in thread From: alex vinarskis @ 2024-03-17 20:55 UTC (permalink / raw) To: Greg KH; +Cc: stable, Lee Jones, Andy Shevchenko On Sun, 17 Mar 2024 at 20:06, Greg KH <gregkh@linuxfoundation.org> wrote: > > On Sun, Mar 17, 2024 at 02:06:50AM +0100, Aleksandrs Vinarskis wrote: > > 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 <alex.vinarskis@gmail.com> > > --- > > What is the git commit id of this and patch 2/2? Apologies, patch 1/2: commit ac9538f6007e1c80f1b8a62db7ecc391b4d78ae5 upstream. patch 2/2: commit 1d8c51ed2ddcc4161e6496cf14fcd83921c50ec8 upstream. ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v0 2/2] mfd: intel-lpss: Introduce QUIRK_CLOCK_DIVIDER_UNITY for XPS 9530 2024-03-17 1:06 [PATCH v0 0/2] Fix LPSS clock divider for XPS 9530, 6.7.y backport Aleksandrs Vinarskis 2024-03-17 1:06 ` [PATCH v0 1/2] mfd: intel-lpss: Switch to generalized quirk table Aleksandrs Vinarskis @ 2024-03-17 1:06 ` Aleksandrs Vinarskis 1 sibling, 0 replies; 6+ messages in thread From: Aleksandrs Vinarskis @ 2024-03-17 1:06 UTC (permalink / raw) To: stable; +Cc: Lee Jones, Andy Shevchenko 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 <alex.vinarskis@gmail.com> --- drivers/mfd/intel-lpss-pci.c | 5 +++++ drivers/mfd/intel-lpss.c | 7 +++++++ drivers/mfd/intel-lpss.h | 5 +++++ 3 files changed, 17 insertions(+) diff --git a/drivers/mfd/intel-lpss-pci.c b/drivers/mfd/intel-lpss-pci.c index eb3b0195db2e..cab11ed23b4f 100644 --- a/drivers/mfd/intel-lpss-pci.c +++ b/drivers/mfd/intel-lpss-pci.c @@ -29,6 +29,11 @@ static const struct pci_device_id quirk_ids[] = { 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, + }, { } }; diff --git a/drivers/mfd/intel-lpss.c b/drivers/mfd/intel-lpss.c index 7af0a1fab062..d422e88ba491 100644 --- a/drivers/mfd/intel-lpss.c +++ b/drivers/mfd/intel-lpss.c @@ -292,6 +292,7 @@ static int intel_lpss_register_clock_divider(struct intel_lpss *lpss, { 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, @@ -308,6 +309,12 @@ static int intel_lpss_register_clock_divider(struct intel_lpss *lpss, 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); diff --git a/drivers/mfd/intel-lpss.h b/drivers/mfd/intel-lpss.h index f636059cbc71..f50d11d60d94 100644 --- 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; -- 2.40.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v0 0/2] Fix LPSS clock divider for XPS 9530, 6.8.y backport @ 2024-03-17 0:53 Aleksandrs Vinarskis 2024-03-17 0:53 ` [PATCH v0 1/2] mfd: intel-lpss: Switch to generalized quirk table Aleksandrs Vinarskis 0 siblings, 1 reply; 6+ messages in thread From: Aleksandrs Vinarskis @ 2024-03-17 0:53 UTC (permalink / raw) To: stable This is a backport of recently upstreamed fix for XPS 9530 sound issue. Both apply cleanly to 6.8.y, and could also be cherry-picked from upstream. Ideally should be applied to all branches where upstream commit d110858a6925827609d11db8513d76750483ec06 exists (6.8.y) or was backported (6.7.y) as it adds initial yet incomplete support for this laptop. Patches for 6.7.y require modification, will be submitted separately. Signed-off-by: Aleksandrs Vinarskis <alex.vinarskis@gmail.com> Aleksandrs Vinarskis (2): mfd: intel-lpss: Switch to generalized quirk table mfd: intel-lpss: Introduce QUIRK_CLOCK_DIVIDER_UNITY for XPS 9530 drivers/mfd/intel-lpss-pci.c | 28 ++++++++++++++++++++-------- drivers/mfd/intel-lpss.c | 9 ++++++++- drivers/mfd/intel-lpss.h | 14 +++++++++++++- 3 files changed, 41 insertions(+), 10 deletions(-) -- 2.40.1 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v0 1/2] mfd: intel-lpss: Switch to generalized quirk table 2024-03-17 0:53 [PATCH v0 0/2] Fix LPSS clock divider for XPS 9530, 6.8.y backport Aleksandrs Vinarskis @ 2024-03-17 0:53 ` Aleksandrs Vinarskis 0 siblings, 0 replies; 6+ messages in thread From: Aleksandrs Vinarskis @ 2024-03-17 0:53 UTC (permalink / raw) To: stable; +Cc: Andy Shevchenko, Lee Jones 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 <alex.vinarskis@gmail.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20231221185142.9224-2-alex.vinarskis@gmail.com Signed-off-by: Lee Jones <lee@kernel.org> --- 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(-) diff --git a/drivers/mfd/intel-lpss-pci.c b/drivers/mfd/intel-lpss-pci.c index 4621d3950b8f..07713a2f694f 100644 --- 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 pci_dev *pdev, 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 pci_dev *pdev, 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; diff --git a/drivers/mfd/intel-lpss.c b/drivers/mfd/intel-lpss.c index eff423f7dd28..aafa0da5f8db 100644 --- 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); diff --git a/drivers/mfd/intel-lpss.h b/drivers/mfd/intel-lpss.h index c1d72b117ed5..2fa9ef916258 100644 --- 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 <linux/bits.h> #include <linux/pm.h> +/* + * 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; -- 2.40.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-03-17 20:55 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2024-03-17 1:06 [PATCH v0 0/2] Fix LPSS clock divider for XPS 9530, 6.7.y backport Aleksandrs Vinarskis 2024-03-17 1:06 ` [PATCH v0 1/2] mfd: intel-lpss: Switch to generalized quirk table Aleksandrs Vinarskis 2024-03-17 19:06 ` Greg KH 2024-03-17 20:55 ` alex vinarskis 2024-03-17 1:06 ` [PATCH v0 2/2] mfd: intel-lpss: Introduce QUIRK_CLOCK_DIVIDER_UNITY for XPS 9530 Aleksandrs Vinarskis -- strict thread matches above, loose matches on Subject: below -- 2024-03-17 0:53 [PATCH v0 0/2] Fix LPSS clock divider for XPS 9530, 6.8.y backport Aleksandrs Vinarskis 2024-03-17 0:53 ` [PATCH v0 1/2] mfd: intel-lpss: Switch to generalized quirk table Aleksandrs Vinarskis
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox