From d8358e9d3d1e24f57c8301d1d93bc7579e436d6a Mon Sep 17 00:00:00 2001 From: Ben Reed Date: Tue, 5 May 2026 10:16:33 -0600 Subject: [PATCH 1/4] PCI: switchtec: Add Gen6 Device IDs Add device IDs for the next generation of switchtec products. No changes to the driver were required with the new version of the hardware. [logang: rewrote commit message] Signed-off-by: Ben Reed Signed-off-by: Logan Gunthorpe Signed-off-by: Bjorn Helgaas Link: https://patch.msgid.link/20260505161633.67454-1-logang@deltatee.com Link: https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git/commit/?h=next&id=5e6c21c56998e1e58d2f314e70779989ea0fee5d Signed-off-by: WangYuli --- drivers/pci/switch/switchtec.c | 16 ++++++++++++++++ include/linux/switchtec.h | 1 + 2 files changed, 17 insertions(+) diff --git a/drivers/pci/switch/switchtec.c b/drivers/pci/switch/switchtec.c index 5ff84fb8fb0f4..f32ddfa79da99 100644 --- a/drivers/pci/switch/switchtec.c +++ b/drivers/pci/switch/switchtec.c @@ -1852,6 +1852,22 @@ static const struct pci_device_id switchtec_pci_tbl[] = { SWITCHTEC_PCI_DEVICE(0x5552, SWITCHTEC_GEN5), /* PAXA 52XG5 */ SWITCHTEC_PCI_DEVICE(0x5536, SWITCHTEC_GEN5), /* PAXA 36XG5 */ SWITCHTEC_PCI_DEVICE(0x5528, SWITCHTEC_GEN5), /* PAXA 28XG5 */ + SWITCHTEC_PCI_DEVICE(0x6048, SWITCHTEC_GEN6), /* PFXs 48XG6 */ + SWITCHTEC_PCI_DEVICE(0x6064, SWITCHTEC_GEN6), /* PFXs 64XG6 */ + SWITCHTEC_PCI_DEVICE(0x6044, SWITCHTEC_GEN6), /* PFXs 144XG6 */ + SWITCHTEC_PCI_DEVICE(0x6060, SWITCHTEC_GEN6), /* PFXs 160XG6 */ + SWITCHTEC_PCI_DEVICE(0x6148, SWITCHTEC_GEN6), /* PSXs 48XG6 */ + SWITCHTEC_PCI_DEVICE(0x6164, SWITCHTEC_GEN6), /* PSXs 64XG6 */ + SWITCHTEC_PCI_DEVICE(0x6144, SWITCHTEC_GEN6), /* PSXs 144XG6 */ + SWITCHTEC_PCI_DEVICE(0x6160, SWITCHTEC_GEN6), /* PSXs 160XG6 */ + SWITCHTEC_PCI_DEVICE(0x6248, SWITCHTEC_GEN6), /* PFX 48XG6 */ + SWITCHTEC_PCI_DEVICE(0x6264, SWITCHTEC_GEN6), /* PFX 64XG6 */ + SWITCHTEC_PCI_DEVICE(0x6244, SWITCHTEC_GEN6), /* PFX 144XG6 */ + SWITCHTEC_PCI_DEVICE(0x6260, SWITCHTEC_GEN6), /* PFX 160XG6 */ + SWITCHTEC_PCI_DEVICE(0x6348, SWITCHTEC_GEN6), /* PSX 48XG6 */ + SWITCHTEC_PCI_DEVICE(0x6364, SWITCHTEC_GEN6), /* PSX 64XG6 */ + SWITCHTEC_PCI_DEVICE(0x6344, SWITCHTEC_GEN6), /* PSX 144XG6 */ + SWITCHTEC_PCI_DEVICE(0x6360, SWITCHTEC_GEN6), /* PSX 160XG6 */ SWITCHTEC_PCI100X_DEVICE(0x1001, SWITCHTEC_GEN4), /* PCI1001 16XG4 */ SWITCHTEC_PCI100X_DEVICE(0x1002, SWITCHTEC_GEN4), /* PCI1002 12XG4 */ SWITCHTEC_PCI100X_DEVICE(0x1003, SWITCHTEC_GEN4), /* PCI1003 16XG4 */ diff --git a/include/linux/switchtec.h b/include/linux/switchtec.h index cdb58d61c1526..724da6c08bf7d 100644 --- a/include/linux/switchtec.h +++ b/include/linux/switchtec.h @@ -42,6 +42,7 @@ enum switchtec_gen { SWITCHTEC_GEN3, SWITCHTEC_GEN4, SWITCHTEC_GEN5, + SWITCHTEC_GEN6, }; struct mrpc_regs { From b13746b9e1a7da5687d30a3db29e9ce76367f2af Mon Sep 17 00:00:00 2001 From: Xia Qian Date: Thu, 21 May 2026 15:05:58 +0800 Subject: [PATCH 2/4] gpio: phytium: Rebind parent chained handler after resuming from S4 Fix module (=m) case where GPIO interrupts stop after S4 resume because the parent IRQ loses the chained handler setting up at probe. So rebind the handler for each parent in resume() to restore parent-to-child dispatch. While builtin (=y) builds unaffected. Mainline: Open-Source Signed-off-by: zhuling Signed-off-by: Wang Yinfeng Signed-off-by: Xia Qian --- drivers/gpio/gpio-phytium-core.h | 2 +- drivers/gpio/gpio-phytium-platform.c | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-phytium-core.h b/drivers/gpio/gpio-phytium-core.h index bb3f5af26c8db..c7aecbe658e32 100644 --- a/drivers/gpio/gpio-phytium-core.h +++ b/drivers/gpio/gpio-phytium-core.h @@ -34,7 +34,7 @@ #define GPIO_PORT_STRIDE (GPIO_EXT_PORTB - GPIO_EXT_PORTA) #define GPIO_CLEAR_IRQ 0xffffffff -#define PHYTIUM_GPIO_DRIVER_VERSION "1.1.2" +#define PHYTIUM_GPIO_DRIVER_VERSION "1.1.3" struct pin_loc { unsigned int port; diff --git a/drivers/gpio/gpio-phytium-platform.c b/drivers/gpio/gpio-phytium-platform.c index 2ebe2be5a7f88..745502630e65f 100644 --- a/drivers/gpio/gpio-phytium-platform.c +++ b/drivers/gpio/gpio-phytium-platform.c @@ -136,6 +136,21 @@ static int phytium_gpio_probe(struct platform_device *pdev) return 0; } +/* Rebind parent-to-child dispatch chain and enable parent IRQ lines. */ +static void phytium_set_irq_chained_handler(struct phytium_gpio *gpio) +{ + struct gpio_irq_chip *girq = &gpio->gc.irq; + int i; + + for (i = 0; i < girq->num_parents; i++) { + if (gpio->irq[i] >= 0) { + irq_set_chained_handler_and_data(gpio->irq[i], + phytium_gpio_irq_handler, &gpio->gc); + enable_irq(gpio->irq[i]); + } + } +} + #ifdef CONFIG_PM_SLEEP static int phytium_gpio_suspend(struct device *dev) { @@ -193,6 +208,8 @@ static int phytium_gpio_resume(struct device *dev) raw_spin_unlock_irqrestore(&gpio->lock, flags); + phytium_set_irq_chained_handler(gpio); + return 0; } #endif From d125e37628ecdb9ceb6d0b0a53c276d41c9e7dcd Mon Sep 17 00:00:00 2001 From: Xia Qian Date: Thu, 21 May 2026 15:09:29 +0800 Subject: [PATCH 3/4] gpio: phytium: Remove redundant enable_irq in chained handler setup Linux PM framework automatically calls suspend_device_irqs() during suspend to disable IRQs, and resume_device_irqs() during resume to re-enable them. The current GPIO driver redundantly calls enable_irq() in its resume flow, which will create an unbalanced IRQ enable since the kernel has already restored the IRQ state through resume_device_irqs(). Mainline: Open-Source Signed-off-by: Zhu Ling Signed-off-by: Wang Yinfeng Signed-off-by: Xia Qian --- drivers/gpio/gpio-phytium-platform.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpio/gpio-phytium-platform.c b/drivers/gpio/gpio-phytium-platform.c index 745502630e65f..d6475d67b805e 100644 --- a/drivers/gpio/gpio-phytium-platform.c +++ b/drivers/gpio/gpio-phytium-platform.c @@ -146,7 +146,6 @@ static void phytium_set_irq_chained_handler(struct phytium_gpio *gpio) if (gpio->irq[i] >= 0) { irq_set_chained_handler_and_data(gpio->irq[i], phytium_gpio_irq_handler, &gpio->gc); - enable_irq(gpio->irq[i]); } } } From e9545b2a58f4b0fc3f5203fabe7dbb1f786f0af2 Mon Sep 17 00:00:00 2001 From: Xia Qian Date: Thu, 21 May 2026 15:18:41 +0800 Subject: [PATCH 4/4] gpio: phytium: Add PCI and platform dependency Ensure the Phytium GPIO PCI driver is only selectable for its intended environment. This driver depends on both the Phytium platform and a working PCI subsystem. Mainline: Open-Source Signed-off-by: Zhu Ling Signed-off-by: Wang Yinfeng Signed-off-by: Xia Qian --- drivers/gpio/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index bd12196740a81..9e4473b2561b6 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -1724,6 +1724,7 @@ config GPIO_PCIE_IDIO_24 config GPIO_PHYTIUM_PCI tristate "Phytium GPIO PCI support" + depends on PCI && ARCH_PHYTIUM select GPIO_PHYTIUM_CORE select IRQ_DOMAIN select GENERIC_IRQ_CHIP