public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 6.0 05/16] ACPI: processor: idle: Check acpi_fetch_acpi_dev() return value
       [not found] <20221217152821.98618-1-sashal@kernel.org>
@ 2022-12-17 15:28 ` Sasha Levin
  2022-12-17 15:28 ` [PATCH AUTOSEL 6.0 06/16] ACPI: EC: Add quirk for the HP Pavilion Gaming 15-cx0041ur Sasha Levin
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Sasha Levin @ 2022-12-17 15:28 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Li Zhong, Rafael J . Wysocki, Sasha Levin, rafael, linux-acpi

From: Li Zhong <floridsleeves@gmail.com>

[ Upstream commit 2437513a814b3e93bd02879740a8a06e52e2cf7d ]

The return value of acpi_fetch_acpi_dev() could be NULL, which would
cause a NULL pointer dereference to occur in acpi_device_hid().

Signed-off-by: Li Zhong <floridsleeves@gmail.com>
[ rjw: Subject and changelog edits, added empty line after if () ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/acpi/processor_idle.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index 9f40917c49ef..4d1dd255c122 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -1134,6 +1134,9 @@ static int acpi_processor_get_lpi_info(struct acpi_processor *pr)
 	status = acpi_get_parent(handle, &pr_ahandle);
 	while (ACPI_SUCCESS(status)) {
 		d = acpi_fetch_acpi_dev(pr_ahandle);
+		if (!d)
+			break;
+
 		handle = pr_ahandle;
 
 		if (strcmp(acpi_device_hid(d), ACPI_PROCESSOR_CONTAINER_HID))
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH AUTOSEL 6.0 06/16] ACPI: EC: Add quirk for the HP Pavilion Gaming 15-cx0041ur
       [not found] <20221217152821.98618-1-sashal@kernel.org>
  2022-12-17 15:28 ` [PATCH AUTOSEL 6.0 05/16] ACPI: processor: idle: Check acpi_fetch_acpi_dev() return value Sasha Levin
@ 2022-12-17 15:28 ` Sasha Levin
  2022-12-17 15:28 ` [PATCH AUTOSEL 6.0 07/16] ACPICA: Fix error code path in acpi_ds_call_control_method() Sasha Levin
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Sasha Levin @ 2022-12-17 15:28 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Mia Kanashi, Rafael J . Wysocki, Sasha Levin, rafael, linux-acpi

From: Mia Kanashi <chad@redpilled.dev>

[ Upstream commit b423f240a66ad928c4cb5ec6055dfc90ce8d894e ]

Added GPE quirk entry for the HP Pavilion Gaming 15-cx0041ur.
There is a quirk entry for the 15-cx0xxx laptops, but this one has
different DMI_PRODUCT_NAME.

Notably backlight keys and other ACPI events now function correctly.

Signed-off-by: Mia Kanashi <chad@redpilled.dev>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/acpi/ec.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index c95e535035a0..fdc760e1e09e 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -1879,6 +1879,16 @@ static const struct dmi_system_id ec_dmi_table[] __initconst = {
 			DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion Gaming Laptop 15-cx0xxx"),
 		},
 	},
+	{
+		/*
+		 * HP Pavilion Gaming Laptop 15-cx0041ur
+		 */
+		.callback = ec_honor_dsdt_gpe,
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "HP"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "HP 15-cx0041ur"),
+		},
+	},
 	{
 		/*
 		 * Samsung hardware
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH AUTOSEL 6.0 07/16] ACPICA: Fix error code path in acpi_ds_call_control_method()
       [not found] <20221217152821.98618-1-sashal@kernel.org>
  2022-12-17 15:28 ` [PATCH AUTOSEL 6.0 05/16] ACPI: processor: idle: Check acpi_fetch_acpi_dev() return value Sasha Levin
  2022-12-17 15:28 ` [PATCH AUTOSEL 6.0 06/16] ACPI: EC: Add quirk for the HP Pavilion Gaming 15-cx0041ur Sasha Levin
@ 2022-12-17 15:28 ` Sasha Levin
  2022-12-17 15:28 ` [PATCH AUTOSEL 6.0 11/16] ACPI / PCI: fix LPIC IRQ model default PCI IRQ polarity Sasha Levin
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Sasha Levin @ 2022-12-17 15:28 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Rafael J. Wysocki, Chen Zhongjin, Sasha Levin, robert.moore,
	linux-acpi, devel

From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>

[ Upstream commit 404ec60438add1afadaffaed34bb5fe4ddcadd40 ]

A use-after-free in acpi_ps_parse_aml() after a failing invocaion of
acpi_ds_call_control_method() is reported by KASAN [1] and code
inspection reveals that next_walk_state pushed to the thread by
acpi_ds_create_walk_state() is freed on errors, but it is not popped
from the thread beforehand.  Thus acpi_ds_get_current_walk_state()
called by acpi_ps_parse_aml() subsequently returns it as the new
walk state which is incorrect.

To address this, make acpi_ds_call_control_method() call
acpi_ds_pop_walk_state() to pop next_walk_state from the thread before
returning an error.

Link: https://lore.kernel.org/linux-acpi/20221019073443.248215-1-chenzhongjin@huawei.com/ # [1]
Reported-by: Chen Zhongjin <chenzhongjin@huawei.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Chen Zhongjin <chenzhongjin@huawei.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/acpi/acpica/dsmethod.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/acpica/dsmethod.c b/drivers/acpi/acpica/dsmethod.c
index ae2e768830bf..9332bc688713 100644
--- a/drivers/acpi/acpica/dsmethod.c
+++ b/drivers/acpi/acpica/dsmethod.c
@@ -517,7 +517,7 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread,
 	info = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_evaluate_info));
 	if (!info) {
 		status = AE_NO_MEMORY;
-		goto cleanup;
+		goto pop_walk_state;
 	}
 
 	info->parameters = &this_walk_state->operands[0];
@@ -529,7 +529,7 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread,
 
 	ACPI_FREE(info);
 	if (ACPI_FAILURE(status)) {
-		goto cleanup;
+		goto pop_walk_state;
 	}
 
 	next_walk_state->method_nesting_depth =
@@ -575,6 +575,12 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread,
 
 	return_ACPI_STATUS(status);
 
+pop_walk_state:
+
+	/* On error, pop the walk state to be deleted from thread */
+
+	acpi_ds_pop_walk_state(thread);
+
 cleanup:
 
 	/* On error, we must terminate the method properly */
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH AUTOSEL 6.0 11/16] ACPI / PCI: fix LPIC IRQ model default PCI IRQ polarity
       [not found] <20221217152821.98618-1-sashal@kernel.org>
                   ` (2 preceding siblings ...)
  2022-12-17 15:28 ` [PATCH AUTOSEL 6.0 07/16] ACPICA: Fix error code path in acpi_ds_call_control_method() Sasha Levin
@ 2022-12-17 15:28 ` Sasha Levin
  2022-12-17 18:07   ` Marc Zyngier
  2022-12-17 15:28 ` [PATCH AUTOSEL 6.0 14/16] ACPI: x86: Add skip i2c clients quirk for Lenovo Yoga Tab 3 Pro (YT3-X90F) Sasha Levin
  2022-12-17 15:28 ` [PATCH AUTOSEL 6.0 15/16] ACPI: x86: Add skip i2c clients quirk for Medion Lifetab S10346 Sasha Levin
  5 siblings, 1 reply; 8+ messages in thread
From: Sasha Levin @ 2022-12-17 15:28 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Jianmin Lv, Huacai Chen, Marc Zyngier, Sasha Levin, bhelgaas,
	rafael, linux-pci, linux-acpi

From: Jianmin Lv <lvjianmin@loongson.cn>

[ Upstream commit d0c50cc4b957b2cf6e43cec4998d212b5abe9220 ]

On LoongArch based systems, the PCI devices (e.g. SATA controllers and
PCI-to-PCI bridge controllers) in Loongson chipsets output high-level
interrupt signal to the interrupt controller they are connected (see
Loongson 7A1000 Bridge User Manual v2.00, sec 5.3, "For the bridge chip,
AC97 DMA interrupts are edge triggered, gpio interrupts can be configured
to be level triggered or edge triggered as needed, and the rest of the
interrupts are level triggered and active high."), while the IRQs are
active low from the perspective of PCI (see Conventional PCI spec r3.0,
sec 2.2.6, "Interrupts on PCI are optional and defined as level sensitive,
asserted low."), which means that the interrupt output of PCI devices plugged
into PCI-to-PCI bridges of Loongson chipset will be also converted to high-level.
So high level triggered type is required to be passed to acpi_register_gsi()
when creating mappings for PCI devices.

Signed-off-by: Jianmin Lv <lvjianmin@loongson.cn>
Reviewed-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20221022075955.11726-2-lvjianmin@loongson.cn
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/acpi/pci_irq.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c
index 08e15774fb9f..ff30ceca2203 100644
--- a/drivers/acpi/pci_irq.c
+++ b/drivers/acpi/pci_irq.c
@@ -387,13 +387,15 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
 	u8 pin;
 	int triggering = ACPI_LEVEL_SENSITIVE;
 	/*
-	 * On ARM systems with the GIC interrupt model, level interrupts
+	 * On ARM systems with the GIC interrupt model, or LoongArch
+	 * systems with the LPIC interrupt model, level interrupts
 	 * are always polarity high by specification; PCI legacy
 	 * IRQs lines are inverted before reaching the interrupt
 	 * controller and must therefore be considered active high
 	 * as default.
 	 */
-	int polarity = acpi_irq_model == ACPI_IRQ_MODEL_GIC ?
+	int polarity = acpi_irq_model == ACPI_IRQ_MODEL_GIC ||
+		       acpi_irq_model == ACPI_IRQ_MODEL_LPIC ?
 				      ACPI_ACTIVE_HIGH : ACPI_ACTIVE_LOW;
 	char *link = NULL;
 	char link_desc[16];
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH AUTOSEL 6.0 14/16] ACPI: x86: Add skip i2c clients quirk for Lenovo Yoga Tab 3 Pro (YT3-X90F)
       [not found] <20221217152821.98618-1-sashal@kernel.org>
                   ` (3 preceding siblings ...)
  2022-12-17 15:28 ` [PATCH AUTOSEL 6.0 11/16] ACPI / PCI: fix LPIC IRQ model default PCI IRQ polarity Sasha Levin
@ 2022-12-17 15:28 ` Sasha Levin
  2022-12-17 15:28 ` [PATCH AUTOSEL 6.0 15/16] ACPI: x86: Add skip i2c clients quirk for Medion Lifetab S10346 Sasha Levin
  5 siblings, 0 replies; 8+ messages in thread
From: Sasha Levin @ 2022-12-17 15:28 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Hans de Goede, Rafael J . Wysocki, Sasha Levin, rafael,
	mario.limonciello, andriy.shevchenko, linux-acpi

From: Hans de Goede <hdegoede@redhat.com>

[ Upstream commit fe820db35275561d8bf86ad19044d40ffc95bc04 ]

The Lenovo Yoga Tab 3 Pro (YT3-X90F) is a x86 (Cherry Trail) tablet which
ships with Android x86 as factory OS. The Android x86 kernel fork ignores
I2C devices described in the DSDT, except for the PMIC and Audio codecs.

As usual the Lenovo Yoga Tab 3 Pro's DSDT contains a bunch of extra I2C
devices which are not actually there, causing various resource conflicts.
Add an ACPI_QUIRK_SKIP_I2C_CLIENTS quirk for the Lenovo Yoga Tab 3 Pro to
the acpi_quirk_skip_dmi_ids table to woraround this.

ACPI_QUIRK_SKIP_I2C_CLIENTS handling uses i2c_acpi_known_good_ids[],
so that PMICs and Audio codecs will still be enumerated properly.
The Lenovo Yoga Tab 3 Pro uses a Whiskey Cove PMIC, add the INT34D3 HID
for this PMIC to the i2c_acpi_known_good_ids[] list.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/acpi/x86/utils.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/acpi/x86/utils.c b/drivers/acpi/x86/utils.c
index 950a93922ca8..fb999597a3f0 100644
--- a/drivers/acpi/x86/utils.c
+++ b/drivers/acpi/x86/utils.c
@@ -308,7 +308,7 @@ static const struct dmi_system_id acpi_quirk_skip_dmi_ids[] = {
 					ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY),
 	},
 	{
-		/* Lenovo Yoga Tablet 1050F/L */
+		/* Lenovo Yoga Tablet 2 1050F/L */
 		.matches = {
 			DMI_MATCH(DMI_SYS_VENDOR, "Intel Corp."),
 			DMI_MATCH(DMI_PRODUCT_NAME, "VALLEYVIEW C0 PLATFORM"),
@@ -319,6 +319,16 @@ static const struct dmi_system_id acpi_quirk_skip_dmi_ids[] = {
 		.driver_data = (void *)(ACPI_QUIRK_SKIP_I2C_CLIENTS |
 					ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY),
 	},
+	{
+		/* Lenovo Yoga Tab 3 Pro X90F */
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "Intel Corporation"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "CHERRYVIEW D1 PLATFORM"),
+			DMI_MATCH(DMI_PRODUCT_VERSION, "Blade3-10A-001"),
+		},
+		.driver_data = (void *)(ACPI_QUIRK_SKIP_I2C_CLIENTS |
+					ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY),
+	},
 	{
 		/* Nextbook Ares 8 */
 		.matches = {
@@ -348,6 +358,7 @@ static const struct acpi_device_id i2c_acpi_known_good_ids[] = {
 	{ "10EC5640", 0 }, /* RealTek ALC5640 audio codec */
 	{ "INT33F4", 0 },  /* X-Powers AXP288 PMIC */
 	{ "INT33FD", 0 },  /* Intel Crystal Cove PMIC */
+	{ "INT34D3", 0 },  /* Intel Whiskey Cove PMIC */
 	{ "NPCE69A", 0 },  /* Asus Transformer keyboard dock */
 	{}
 };
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH AUTOSEL 6.0 15/16] ACPI: x86: Add skip i2c clients quirk for Medion Lifetab S10346
       [not found] <20221217152821.98618-1-sashal@kernel.org>
                   ` (4 preceding siblings ...)
  2022-12-17 15:28 ` [PATCH AUTOSEL 6.0 14/16] ACPI: x86: Add skip i2c clients quirk for Lenovo Yoga Tab 3 Pro (YT3-X90F) Sasha Levin
@ 2022-12-17 15:28 ` Sasha Levin
  5 siblings, 0 replies; 8+ messages in thread
From: Sasha Levin @ 2022-12-17 15:28 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: Hans de Goede, Andy Shevchenko, Rafael J . Wysocki, Sasha Levin,
	rafael, mario.limonciello, andriy.shevchenko, linux-acpi

From: Hans de Goede <hdegoede@redhat.com>

[ Upstream commit ecc6aaabcedc276128315f57755364106017c606 ]

The Medion Lifetab S10346 is a x86 tablet which ships with Android x86 as
factory OS. The Android x86 kernel fork ignores I2C devices described in
the DSDT, except for the PMIC and Audio codecs.

As usual the Medion Lifetab S10346's DSDT contains a bunch of extra I2C
devices which are not actually there, causing various resource conflicts.
Add an ACPI_QUIRK_SKIP_I2C_CLIENTS quirk for the Medion Lifetab S10346 to
the acpi_quirk_skip_dmi_ids table to woraround this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/acpi/x86/utils.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/acpi/x86/utils.c b/drivers/acpi/x86/utils.c
index fb999597a3f0..ae60e4aae0ee 100644
--- a/drivers/acpi/x86/utils.c
+++ b/drivers/acpi/x86/utils.c
@@ -329,6 +329,17 @@ static const struct dmi_system_id acpi_quirk_skip_dmi_ids[] = {
 		.driver_data = (void *)(ACPI_QUIRK_SKIP_I2C_CLIENTS |
 					ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY),
 	},
+	{
+		/* Medion Lifetab S10346 */
+		.matches = {
+			DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
+			DMI_MATCH(DMI_BOARD_NAME, "Aptio CRB"),
+			/* Way too generic, also match on BIOS data */
+			DMI_MATCH(DMI_BIOS_DATE, "10/22/2015"),
+		},
+		.driver_data = (void *)(ACPI_QUIRK_SKIP_I2C_CLIENTS |
+					ACPI_QUIRK_SKIP_ACPI_AC_AND_BATTERY),
+	},
 	{
 		/* Nextbook Ares 8 */
 		.matches = {
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH AUTOSEL 6.0 11/16] ACPI / PCI: fix LPIC IRQ model default PCI IRQ polarity
  2022-12-17 15:28 ` [PATCH AUTOSEL 6.0 11/16] ACPI / PCI: fix LPIC IRQ model default PCI IRQ polarity Sasha Levin
@ 2022-12-17 18:07   ` Marc Zyngier
  2022-12-18 11:26     ` Sasha Levin
  0 siblings, 1 reply; 8+ messages in thread
From: Marc Zyngier @ 2022-12-17 18:07 UTC (permalink / raw)
  To: Sasha Levin
  Cc: linux-kernel, stable, Jianmin Lv, Huacai Chen, bhelgaas, rafael,
	linux-pci, linux-acpi

On Sat, 17 Dec 2022 15:28:14 +0000,
Sasha Levin <sashal@kernel.org> wrote:
> 
> From: Jianmin Lv <lvjianmin@loongson.cn>
> 
> [ Upstream commit d0c50cc4b957b2cf6e43cec4998d212b5abe9220 ]
> 
> On LoongArch based systems, the PCI devices (e.g. SATA controllers and
> PCI-to-PCI bridge controllers) in Loongson chipsets output high-level
> interrupt signal to the interrupt controller they are connected (see
> Loongson 7A1000 Bridge User Manual v2.00, sec 5.3, "For the bridge chip,
> AC97 DMA interrupts are edge triggered, gpio interrupts can be configured
> to be level triggered or edge triggered as needed, and the rest of the
> interrupts are level triggered and active high."), while the IRQs are
> active low from the perspective of PCI (see Conventional PCI spec r3.0,
> sec 2.2.6, "Interrupts on PCI are optional and defined as level sensitive,
> asserted low."), which means that the interrupt output of PCI devices plugged
> into PCI-to-PCI bridges of Loongson chipset will be also converted to high-level.
> So high level triggered type is required to be passed to acpi_register_gsi()
> when creating mappings for PCI devices.
> 
> Signed-off-by: Jianmin Lv <lvjianmin@loongson.cn>
> Reviewed-by: Huacai Chen <chenhuacai@loongson.cn>
> Signed-off-by: Marc Zyngier <maz@kernel.org>
> Link: https://lore.kernel.org/r/20221022075955.11726-2-lvjianmin@loongson.cn
> Signed-off-by: Sasha Levin <sashal@kernel.org>
> ---
>  drivers/acpi/pci_irq.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c
> index 08e15774fb9f..ff30ceca2203 100644
> --- a/drivers/acpi/pci_irq.c
> +++ b/drivers/acpi/pci_irq.c
> @@ -387,13 +387,15 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
>  	u8 pin;
>  	int triggering = ACPI_LEVEL_SENSITIVE;
>  	/*
> -	 * On ARM systems with the GIC interrupt model, level interrupts
> +	 * On ARM systems with the GIC interrupt model, or LoongArch
> +	 * systems with the LPIC interrupt model, level interrupts
>  	 * are always polarity high by specification; PCI legacy
>  	 * IRQs lines are inverted before reaching the interrupt
>  	 * controller and must therefore be considered active high
>  	 * as default.
>  	 */
> -	int polarity = acpi_irq_model == ACPI_IRQ_MODEL_GIC ?
> +	int polarity = acpi_irq_model == ACPI_IRQ_MODEL_GIC ||
> +		       acpi_irq_model == ACPI_IRQ_MODEL_LPIC ?
>  				      ACPI_ACTIVE_HIGH : ACPI_ACTIVE_LOW;
>  	char *link = NULL;
>  	char link_desc[16];

This is pointless on its own too, as it requires plenty of other
changes, none of which are stable candidates. Please drop this as well
as the v6.1 backport.

Thanks,

	M.

-- 
Without deviation from the norm, progress is not possible.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH AUTOSEL 6.0 11/16] ACPI / PCI: fix LPIC IRQ model default PCI IRQ polarity
  2022-12-17 18:07   ` Marc Zyngier
@ 2022-12-18 11:26     ` Sasha Levin
  0 siblings, 0 replies; 8+ messages in thread
From: Sasha Levin @ 2022-12-18 11:26 UTC (permalink / raw)
  To: Marc Zyngier
  Cc: linux-kernel, stable, Jianmin Lv, Huacai Chen, bhelgaas, rafael,
	linux-pci, linux-acpi

On Sat, Dec 17, 2022 at 06:07:42PM +0000, Marc Zyngier wrote:
>On Sat, 17 Dec 2022 15:28:14 +0000,
>Sasha Levin <sashal@kernel.org> wrote:
>>
>> From: Jianmin Lv <lvjianmin@loongson.cn>
>>
>> [ Upstream commit d0c50cc4b957b2cf6e43cec4998d212b5abe9220 ]
>>
>> On LoongArch based systems, the PCI devices (e.g. SATA controllers and
>> PCI-to-PCI bridge controllers) in Loongson chipsets output high-level
>> interrupt signal to the interrupt controller they are connected (see
>> Loongson 7A1000 Bridge User Manual v2.00, sec 5.3, "For the bridge chip,
>> AC97 DMA interrupts are edge triggered, gpio interrupts can be configured
>> to be level triggered or edge triggered as needed, and the rest of the
>> interrupts are level triggered and active high."), while the IRQs are
>> active low from the perspective of PCI (see Conventional PCI spec r3.0,
>> sec 2.2.6, "Interrupts on PCI are optional and defined as level sensitive,
>> asserted low."), which means that the interrupt output of PCI devices plugged
>> into PCI-to-PCI bridges of Loongson chipset will be also converted to high-level.
>> So high level triggered type is required to be passed to acpi_register_gsi()
>> when creating mappings for PCI devices.
>>
>> Signed-off-by: Jianmin Lv <lvjianmin@loongson.cn>
>> Reviewed-by: Huacai Chen <chenhuacai@loongson.cn>
>> Signed-off-by: Marc Zyngier <maz@kernel.org>
>> Link: https://lore.kernel.org/r/20221022075955.11726-2-lvjianmin@loongson.cn
>> Signed-off-by: Sasha Levin <sashal@kernel.org>
>> ---
>>  drivers/acpi/pci_irq.c | 6 ++++--
>>  1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c
>> index 08e15774fb9f..ff30ceca2203 100644
>> --- a/drivers/acpi/pci_irq.c
>> +++ b/drivers/acpi/pci_irq.c
>> @@ -387,13 +387,15 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
>>  	u8 pin;
>>  	int triggering = ACPI_LEVEL_SENSITIVE;
>>  	/*
>> -	 * On ARM systems with the GIC interrupt model, level interrupts
>> +	 * On ARM systems with the GIC interrupt model, or LoongArch
>> +	 * systems with the LPIC interrupt model, level interrupts
>>  	 * are always polarity high by specification; PCI legacy
>>  	 * IRQs lines are inverted before reaching the interrupt
>>  	 * controller and must therefore be considered active high
>>  	 * as default.
>>  	 */
>> -	int polarity = acpi_irq_model == ACPI_IRQ_MODEL_GIC ?
>> +	int polarity = acpi_irq_model == ACPI_IRQ_MODEL_GIC ||
>> +		       acpi_irq_model == ACPI_IRQ_MODEL_LPIC ?
>>  				      ACPI_ACTIVE_HIGH : ACPI_ACTIVE_LOW;
>>  	char *link = NULL;
>>  	char link_desc[16];
>
>This is pointless on its own too, as it requires plenty of other
>changes, none of which are stable candidates. Please drop this as well
>as the v6.1 backport.

Ack, will do. Thanks!

-- 
Thanks,
Sasha

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-12-18 11:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20221217152821.98618-1-sashal@kernel.org>
2022-12-17 15:28 ` [PATCH AUTOSEL 6.0 05/16] ACPI: processor: idle: Check acpi_fetch_acpi_dev() return value Sasha Levin
2022-12-17 15:28 ` [PATCH AUTOSEL 6.0 06/16] ACPI: EC: Add quirk for the HP Pavilion Gaming 15-cx0041ur Sasha Levin
2022-12-17 15:28 ` [PATCH AUTOSEL 6.0 07/16] ACPICA: Fix error code path in acpi_ds_call_control_method() Sasha Levin
2022-12-17 15:28 ` [PATCH AUTOSEL 6.0 11/16] ACPI / PCI: fix LPIC IRQ model default PCI IRQ polarity Sasha Levin
2022-12-17 18:07   ` Marc Zyngier
2022-12-18 11:26     ` Sasha Levin
2022-12-17 15:28 ` [PATCH AUTOSEL 6.0 14/16] ACPI: x86: Add skip i2c clients quirk for Lenovo Yoga Tab 3 Pro (YT3-X90F) Sasha Levin
2022-12-17 15:28 ` [PATCH AUTOSEL 6.0 15/16] ACPI: x86: Add skip i2c clients quirk for Medion Lifetab S10346 Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox