* [PATCH 00/16] gpio: Use modern PM macros
@ 2025-08-20 15:40 Jisheng Zhang
2025-08-20 15:40 ` [PATCH 01/16] gpio: dwapb: " Jisheng Zhang
` (16 more replies)
0 siblings, 17 replies; 30+ messages in thread
From: Jisheng Zhang @ 2025-08-20 15:40 UTC (permalink / raw)
To: Doug Berger, Florian Fainelli, Linus Walleij, Bartosz Golaszewski,
Michael Buesch, Hoan Tran, Andy Shevchenko, Daniel Palmer,
Romain Perier, Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
Robert Jarzmik, Kunihiko Hayashi, Masami Hiramatsu,
Shubhrajyoti Datta, Srinivas Neeli, Michal Simek
Cc: Broadcom internal kernel review list, linux-gpio,
linux-arm-kernel, linux-kernel, linux-omap, linux
Use the modern PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards or
__maybe_unused.
This has the advantage of always compiling these functions in,
independently of any Kconfig option. Thanks to that, bugs and other
regressions are subsequently easier to catch.
Almost all drivers are converted, only gpio-tegra and gpio-mlxbf are
left as is, because the memory for saving HW context is not trivial,
if we convert them, then the two drivers' users may complain for
!CONFIG_PM && !CONFIG_PM_SLEEP case. So I didn't touch them.
patch to gpio-dwapb.c is tested on real HW, others are compile-tested only.
Jisheng Zhang (16):
gpio: dwapb: Use modern PM macros
gpio: brcmstb: Use modern PM macros
gpio: bt8xx: Use modern PM macros
gpio: htc-egpio: Use modern PM macros
gpio: pl061: Use modern PM macros
gpio: pxa: Use modern PM macros
gpio: ml-ioh: Use modern PM macros
gpio: mlxbf2: Use modern PM macros
gpio: msc313: Use modern PM macros
gpio: omap: Use modern PM macros
gpio: pch: Use modern PM macros
gpio: tqmx86: Use modern PM macros
gpio: uniphier: Use modern PM macros
gpio: xgene: Use modern PM macros
gpio: xilinx: Use modern PM macros
gpio: zynq: Use modern PM macros
drivers/gpio/gpio-brcmstb.c | 12 +++---------
drivers/gpio/gpio-bt8xx.c | 11 ++---------
drivers/gpio/gpio-dwapb.c | 31 +++++++------------------------
drivers/gpio/gpio-htc-egpio.c | 21 ++++++++-------------
drivers/gpio/gpio-ml-ioh.c | 12 ++++++------
drivers/gpio/gpio-mlxbf2.c | 8 ++++----
drivers/gpio/gpio-msc313.c | 8 ++++----
drivers/gpio/gpio-omap.c | 15 +++++++--------
drivers/gpio/gpio-pch.c | 12 ++++++------
drivers/gpio/gpio-pl061.c | 17 ++---------------
drivers/gpio/gpio-pxa.c | 12 ++----------
drivers/gpio/gpio-tqmx86.c | 9 ++++-----
drivers/gpio/gpio-uniphier.c | 9 ++++-----
drivers/gpio/gpio-xgene.c | 8 ++++----
drivers/gpio/gpio-xilinx.c | 15 +++++++--------
drivers/gpio/gpio-zynq.c | 15 +++++++--------
16 files changed, 77 insertions(+), 138 deletions(-)
--
2.50.1
^ permalink raw reply [flat|nested] 30+ messages in thread
* [PATCH 01/16] gpio: dwapb: Use modern PM macros
2025-08-20 15:40 [PATCH 00/16] gpio: Use modern PM macros Jisheng Zhang
@ 2025-08-20 15:40 ` Jisheng Zhang
2025-08-20 16:54 ` Andy Shevchenko
2025-08-20 15:40 ` [PATCH 02/16] gpio: brcmstb: " Jisheng Zhang
` (15 subsequent siblings)
16 siblings, 1 reply; 30+ messages in thread
From: Jisheng Zhang @ 2025-08-20 15:40 UTC (permalink / raw)
To: Doug Berger, Florian Fainelli, Linus Walleij, Bartosz Golaszewski,
Michael Buesch, Hoan Tran, Andy Shevchenko, Daniel Palmer,
Romain Perier, Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
Robert Jarzmik, Kunihiko Hayashi, Masami Hiramatsu,
Shubhrajyoti Datta, Srinivas Neeli, Michal Simek
Cc: Broadcom internal kernel review list, linux-gpio,
linux-arm-kernel, linux-kernel, linux-omap, linux
Use the modern PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
This has the advantage of always compiling these functions in,
independently of any Kconfig option. Thanks to that, bugs and other
regressions are subsequently easier to catch.
The dwapb_context structure is always embedded into struct
dwapb_gpio_port to simplify code. Sure this brings a tiny 36 bytes
data overhead for !CONFIG_PM_SLEP.
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
drivers/gpio/gpio-dwapb.c | 31 +++++++------------------------
1 file changed, 7 insertions(+), 24 deletions(-)
diff --git a/drivers/gpio/gpio-dwapb.c b/drivers/gpio/gpio-dwapb.c
index 43b667b41f5d..d831e6c61566 100644
--- a/drivers/gpio/gpio-dwapb.c
+++ b/drivers/gpio/gpio-dwapb.c
@@ -78,7 +78,6 @@ struct dwapb_platform_data {
unsigned int nports;
};
-#ifdef CONFIG_PM_SLEEP
/* Store GPIO context across system-wide suspend/resume transitions */
struct dwapb_context {
u32 data;
@@ -91,7 +90,6 @@ struct dwapb_context {
u32 int_deb;
u32 wake_en;
};
-#endif
struct dwapb_gpio_port_irqchip {
unsigned int nr_irqs;
@@ -102,9 +100,7 @@ struct dwapb_gpio_port {
struct gpio_chip gc;
struct dwapb_gpio_port_irqchip *pirq;
struct dwapb_gpio *gpio;
-#ifdef CONFIG_PM_SLEEP
- struct dwapb_context *ctx;
-#endif
+ struct dwapb_context ctx;
unsigned int idx;
};
#define to_dwapb_gpio(_gc) \
@@ -357,12 +353,11 @@ static int dwapb_irq_set_type(struct irq_data *d, u32 type)
return 0;
}
-#ifdef CONFIG_PM_SLEEP
static int dwapb_irq_set_wake(struct irq_data *d, unsigned int enable)
{
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
struct dwapb_gpio *gpio = to_dwapb_gpio(gc);
- struct dwapb_context *ctx = gpio->ports[0].ctx;
+ struct dwapb_context *ctx = &gpio->ports[0].ctx;
irq_hw_number_t bit = irqd_to_hwirq(d);
if (enable)
@@ -372,9 +367,6 @@ static int dwapb_irq_set_wake(struct irq_data *d, unsigned int enable)
return 0;
}
-#else
-#define dwapb_irq_set_wake NULL
-#endif
static const struct irq_chip dwapb_irq_chip = {
.name = DWAPB_DRIVER_NAME,
@@ -384,7 +376,7 @@ static const struct irq_chip dwapb_irq_chip = {
.irq_set_type = dwapb_irq_set_type,
.irq_enable = dwapb_irq_enable,
.irq_disable = dwapb_irq_disable,
- .irq_set_wake = dwapb_irq_set_wake,
+ .irq_set_wake = pm_sleep_ptr(dwapb_irq_set_wake),
.flags = IRQCHIP_IMMUTABLE,
GPIOCHIP_IRQ_RESOURCE_HELPERS,
};
@@ -509,12 +501,6 @@ static int dwapb_gpio_add_port(struct dwapb_gpio *gpio,
port->gpio = gpio;
port->idx = pp->idx;
-#ifdef CONFIG_PM_SLEEP
- port->ctx = devm_kzalloc(gpio->dev, sizeof(*port->ctx), GFP_KERNEL);
- if (!port->ctx)
- return -ENOMEM;
-#endif
-
dat = gpio->regs + GPIO_EXT_PORTA + pp->idx * GPIO_EXT_PORT_STRIDE;
set = gpio->regs + GPIO_SWPORTA_DR + pp->idx * GPIO_SWPORT_DR_STRIDE;
dirout = gpio->regs + GPIO_SWPORTA_DDR + pp->idx * GPIO_SWPORT_DDR_STRIDE;
@@ -746,7 +732,6 @@ static int dwapb_gpio_probe(struct platform_device *pdev)
return 0;
}
-#ifdef CONFIG_PM_SLEEP
static int dwapb_gpio_suspend(struct device *dev)
{
struct dwapb_gpio *gpio = dev_get_drvdata(dev);
@@ -758,7 +743,7 @@ static int dwapb_gpio_suspend(struct device *dev)
for (i = 0; i < gpio->nr_ports; i++) {
unsigned int offset;
unsigned int idx = gpio->ports[i].idx;
- struct dwapb_context *ctx = gpio->ports[i].ctx;
+ struct dwapb_context *ctx = &gpio->ports[i].ctx;
offset = GPIO_SWPORTA_DDR + idx * GPIO_SWPORT_DDR_STRIDE;
ctx->dir = dwapb_read(gpio, offset);
@@ -805,7 +790,7 @@ static int dwapb_gpio_resume(struct device *dev)
for (i = 0; i < gpio->nr_ports; i++) {
unsigned int offset;
unsigned int idx = gpio->ports[i].idx;
- struct dwapb_context *ctx = gpio->ports[i].ctx;
+ struct dwapb_context *ctx = &gpio->ports[i].ctx;
offset = GPIO_SWPORTA_DR + idx * GPIO_SWPORT_DR_STRIDE;
dwapb_write(gpio, offset, ctx->data);
@@ -832,15 +817,13 @@ static int dwapb_gpio_resume(struct device *dev)
return 0;
}
-#endif
-static SIMPLE_DEV_PM_OPS(dwapb_gpio_pm_ops, dwapb_gpio_suspend,
- dwapb_gpio_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(dwapb_gpio_pm_ops, dwapb_gpio_suspend, dwapb_gpio_resume);
static struct platform_driver dwapb_gpio_driver = {
.driver = {
.name = DWAPB_DRIVER_NAME,
- .pm = &dwapb_gpio_pm_ops,
+ .pm = pm_sleep_ptr(&dwapb_gpio_pm_ops),
.of_match_table = dwapb_of_match,
.acpi_match_table = dwapb_acpi_match,
},
--
2.50.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 02/16] gpio: brcmstb: Use modern PM macros
2025-08-20 15:40 [PATCH 00/16] gpio: Use modern PM macros Jisheng Zhang
2025-08-20 15:40 ` [PATCH 01/16] gpio: dwapb: " Jisheng Zhang
@ 2025-08-20 15:40 ` Jisheng Zhang
2025-08-26 21:47 ` Doug Berger
2025-08-20 15:40 ` [PATCH 03/16] gpio: bt8xx: " Jisheng Zhang
` (14 subsequent siblings)
16 siblings, 1 reply; 30+ messages in thread
From: Jisheng Zhang @ 2025-08-20 15:40 UTC (permalink / raw)
To: Doug Berger, Florian Fainelli, Linus Walleij, Bartosz Golaszewski,
Michael Buesch, Hoan Tran, Andy Shevchenko, Daniel Palmer,
Romain Perier, Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
Robert Jarzmik, Kunihiko Hayashi, Masami Hiramatsu,
Shubhrajyoti Datta, Srinivas Neeli, Michal Simek
Cc: Broadcom internal kernel review list, linux-gpio,
linux-arm-kernel, linux-kernel, linux-omap, linux
Use the modern PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
This has the advantage of always compiling these functions in,
independently of any Kconfig option. Thanks to that, bugs and other
regressions are subsequently easier to catch.
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
drivers/gpio/gpio-brcmstb.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/drivers/gpio/gpio-brcmstb.c b/drivers/gpio/gpio-brcmstb.c
index e29a9589b3cc..0ca3e0d8aa46 100644
--- a/drivers/gpio/gpio-brcmstb.c
+++ b/drivers/gpio/gpio-brcmstb.c
@@ -534,7 +534,6 @@ static void brcmstb_gpio_shutdown(struct platform_device *pdev)
brcmstb_gpio_quiesce(&pdev->dev, false);
}
-#ifdef CONFIG_PM_SLEEP
static void brcmstb_gpio_bank_restore(struct brcmstb_gpio_priv *priv,
struct brcmstb_gpio_bank *bank)
{
@@ -573,14 +572,9 @@ static int brcmstb_gpio_resume(struct device *dev)
return 0;
}
-#else
-#define brcmstb_gpio_suspend NULL
-#define brcmstb_gpio_resume NULL
-#endif /* CONFIG_PM_SLEEP */
-
static const struct dev_pm_ops brcmstb_gpio_pm_ops = {
- .suspend_noirq = brcmstb_gpio_suspend,
- .resume_noirq = brcmstb_gpio_resume,
+ .suspend_noirq = pm_sleep_ptr(brcmstb_gpio_suspend),
+ .resume_noirq = pm_sleep_ptr(brcmstb_gpio_resume),
};
static int brcmstb_gpio_probe(struct platform_device *pdev)
@@ -747,7 +741,7 @@ static struct platform_driver brcmstb_gpio_driver = {
.driver = {
.name = "brcmstb-gpio",
.of_match_table = brcmstb_gpio_of_match,
- .pm = &brcmstb_gpio_pm_ops,
+ .pm = pm_sleep_ptr(&brcmstb_gpio_pm_ops),
},
.probe = brcmstb_gpio_probe,
.remove = brcmstb_gpio_remove,
--
2.50.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 03/16] gpio: bt8xx: Use modern PM macros
2025-08-20 15:40 [PATCH 00/16] gpio: Use modern PM macros Jisheng Zhang
2025-08-20 15:40 ` [PATCH 01/16] gpio: dwapb: " Jisheng Zhang
2025-08-20 15:40 ` [PATCH 02/16] gpio: brcmstb: " Jisheng Zhang
@ 2025-08-20 15:40 ` Jisheng Zhang
2025-08-20 17:08 ` Michael Büsch
2025-08-20 15:40 ` [PATCH 04/16] gpio: htc-egpio: " Jisheng Zhang
` (13 subsequent siblings)
16 siblings, 1 reply; 30+ messages in thread
From: Jisheng Zhang @ 2025-08-20 15:40 UTC (permalink / raw)
To: Doug Berger, Florian Fainelli, Linus Walleij, Bartosz Golaszewski,
Michael Buesch, Hoan Tran, Andy Shevchenko, Daniel Palmer,
Romain Perier, Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
Robert Jarzmik, Kunihiko Hayashi, Masami Hiramatsu,
Shubhrajyoti Datta, Srinivas Neeli, Michal Simek
Cc: Broadcom internal kernel review list, linux-gpio,
linux-arm-kernel, linux-kernel, linux-omap, linux
Use the modern PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
This has the advantage of always compiling these functions in,
independently of any Kconfig option. Thanks to that, bugs and other
regressions are subsequently easier to catch.
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
drivers/gpio/gpio-bt8xx.c | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/drivers/gpio/gpio-bt8xx.c b/drivers/gpio/gpio-bt8xx.c
index 05401da03ca3..5e120c4dfea5 100644
--- a/drivers/gpio/gpio-bt8xx.c
+++ b/drivers/gpio/gpio-bt8xx.c
@@ -52,10 +52,8 @@ struct bt8xxgpio {
struct pci_dev *pdev;
struct gpio_chip gpio;
-#ifdef CONFIG_PM
u32 saved_outen;
u32 saved_data;
-#endif
};
#define bgwrite(dat, adr) writel((dat), bg->mmio+(adr))
@@ -224,7 +222,6 @@ static void bt8xxgpio_remove(struct pci_dev *pdev)
pci_disable_device(pdev);
}
-#ifdef CONFIG_PM
static int bt8xxgpio_suspend(struct pci_dev *pdev, pm_message_t state)
{
struct bt8xxgpio *bg = pci_get_drvdata(pdev);
@@ -267,10 +264,6 @@ static int bt8xxgpio_resume(struct pci_dev *pdev)
return 0;
}
-#else
-#define bt8xxgpio_suspend NULL
-#define bt8xxgpio_resume NULL
-#endif /* CONFIG_PM */
static const struct pci_device_id bt8xxgpio_pci_tbl[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_BROOKTREE, PCI_DEVICE_ID_BT848) },
@@ -286,8 +279,8 @@ static struct pci_driver bt8xxgpio_pci_driver = {
.id_table = bt8xxgpio_pci_tbl,
.probe = bt8xxgpio_probe,
.remove = bt8xxgpio_remove,
- .suspend = bt8xxgpio_suspend,
- .resume = bt8xxgpio_resume,
+ .suspend = pm_ptr(bt8xxgpio_suspend),
+ .resume = pm_ptr(bt8xxgpio_resume),
};
module_pci_driver(bt8xxgpio_pci_driver);
--
2.50.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 04/16] gpio: htc-egpio: Use modern PM macros
2025-08-20 15:40 [PATCH 00/16] gpio: Use modern PM macros Jisheng Zhang
` (2 preceding siblings ...)
2025-08-20 15:40 ` [PATCH 03/16] gpio: bt8xx: " Jisheng Zhang
@ 2025-08-20 15:40 ` Jisheng Zhang
2025-08-20 15:40 ` [PATCH 05/16] gpio: pl061: " Jisheng Zhang
` (12 subsequent siblings)
16 siblings, 0 replies; 30+ messages in thread
From: Jisheng Zhang @ 2025-08-20 15:40 UTC (permalink / raw)
To: Doug Berger, Florian Fainelli, Linus Walleij, Bartosz Golaszewski,
Michael Buesch, Hoan Tran, Andy Shevchenko, Daniel Palmer,
Romain Perier, Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
Robert Jarzmik, Kunihiko Hayashi, Masami Hiramatsu,
Shubhrajyoti Datta, Srinivas Neeli, Michal Simek
Cc: Broadcom internal kernel review list, linux-gpio,
linux-arm-kernel, linux-kernel, linux-omap, linux
Use the modern PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
This has the advantage of always compiling these functions in,
independently of any Kconfig option. Thanks to that, bugs and other
regressions are subsequently easier to catch.
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
drivers/gpio/gpio-htc-egpio.c | 21 ++++++++-------------
1 file changed, 8 insertions(+), 13 deletions(-)
diff --git a/drivers/gpio/gpio-htc-egpio.c b/drivers/gpio/gpio-htc-egpio.c
index 2eaed83214d8..72935d6dbebf 100644
--- a/drivers/gpio/gpio-htc-egpio.c
+++ b/drivers/gpio/gpio-htc-egpio.c
@@ -364,21 +364,20 @@ static int __init egpio_probe(struct platform_device *pdev)
return 0;
}
-#ifdef CONFIG_PM
-static int egpio_suspend(struct platform_device *pdev, pm_message_t state)
+static int egpio_suspend(struct device *dev)
{
- struct egpio_info *ei = platform_get_drvdata(pdev);
+ struct egpio_info *ei = dev_get_drvdata(dev);
- if (ei->chained_irq && device_may_wakeup(&pdev->dev))
+ if (ei->chained_irq && device_may_wakeup(dev))
enable_irq_wake(ei->chained_irq);
return 0;
}
-static int egpio_resume(struct platform_device *pdev)
+static int egpio_resume(struct device *dev)
{
- struct egpio_info *ei = platform_get_drvdata(pdev);
+ struct egpio_info *ei = dev_get_drvdata(dev);
- if (ei->chained_irq && device_may_wakeup(&pdev->dev))
+ if (ei->chained_irq && device_may_wakeup(dev))
disable_irq_wake(ei->chained_irq);
/* Update registers from the cache, in case
@@ -386,19 +385,15 @@ static int egpio_resume(struct platform_device *pdev)
egpio_write_cache(ei);
return 0;
}
-#else
-#define egpio_suspend NULL
-#define egpio_resume NULL
-#endif
+static DEFINE_SIMPLE_DEV_PM_OPS(egpio_pm_ops, egpio_suspend, egpio_resume);
static struct platform_driver egpio_driver = {
.driver = {
.name = "htc-egpio",
.suppress_bind_attrs = true,
+ .pm = pm_sleep_ptr(&egpio_pm_ops),
},
- .suspend = egpio_suspend,
- .resume = egpio_resume,
};
static int __init egpio_init(void)
--
2.50.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 05/16] gpio: pl061: Use modern PM macros
2025-08-20 15:40 [PATCH 00/16] gpio: Use modern PM macros Jisheng Zhang
` (3 preceding siblings ...)
2025-08-20 15:40 ` [PATCH 04/16] gpio: htc-egpio: " Jisheng Zhang
@ 2025-08-20 15:40 ` Jisheng Zhang
2025-08-21 11:52 ` Linus Walleij
2025-08-20 15:40 ` [PATCH 06/16] gpio: pxa: " Jisheng Zhang
` (11 subsequent siblings)
16 siblings, 1 reply; 30+ messages in thread
From: Jisheng Zhang @ 2025-08-20 15:40 UTC (permalink / raw)
To: Doug Berger, Florian Fainelli, Linus Walleij, Bartosz Golaszewski,
Michael Buesch, Hoan Tran, Andy Shevchenko, Daniel Palmer,
Romain Perier, Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
Robert Jarzmik, Kunihiko Hayashi, Masami Hiramatsu,
Shubhrajyoti Datta, Srinivas Neeli, Michal Simek
Cc: Broadcom internal kernel review list, linux-gpio,
linux-arm-kernel, linux-kernel, linux-omap, linux
Use the modern PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
This has the advantage of always compiling these functions in,
independently of any Kconfig option. Thanks to that, bugs and other
regressions are subsequently easier to catch.
The pl061_context_save_regs structure is always embedded into struct
pl061 to simplify code, so this brings a tiny 8 bytes memory overhead
for !CONFIG_PM_SLEP.
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
drivers/gpio/gpio-pl061.c | 17 ++---------------
1 file changed, 2 insertions(+), 15 deletions(-)
diff --git a/drivers/gpio/gpio-pl061.c b/drivers/gpio/gpio-pl061.c
index 02e4ffcf5a6f..919cf86fd590 100644
--- a/drivers/gpio/gpio-pl061.c
+++ b/drivers/gpio/gpio-pl061.c
@@ -37,7 +37,6 @@
#define PL061_GPIO_NR 8
-#ifdef CONFIG_PM
struct pl061_context_save_regs {
u8 gpio_data;
u8 gpio_dir;
@@ -46,7 +45,6 @@ struct pl061_context_save_regs {
u8 gpio_iev;
u8 gpio_ie;
};
-#endif
struct pl061 {
raw_spinlock_t lock;
@@ -55,9 +53,7 @@ struct pl061 {
struct gpio_chip gc;
int parent_irq;
-#ifdef CONFIG_PM
struct pl061_context_save_regs csave_regs;
-#endif
};
static int pl061_get_direction(struct gpio_chip *gc, unsigned offset)
@@ -367,7 +363,6 @@ static int pl061_probe(struct amba_device *adev, const struct amba_id *id)
return 0;
}
-#ifdef CONFIG_PM
static int pl061_suspend(struct device *dev)
{
struct pl061 *pl061 = dev_get_drvdata(dev);
@@ -411,13 +406,7 @@ static int pl061_resume(struct device *dev)
return 0;
}
-static const struct dev_pm_ops pl061_dev_pm_ops = {
- .suspend = pl061_suspend,
- .resume = pl061_resume,
- .freeze = pl061_suspend,
- .restore = pl061_resume,
-};
-#endif
+static DEFINE_SIMPLE_DEV_PM_OPS(pl061_dev_pm_ops, pl061_suspend, pl061_resume);
static const struct amba_id pl061_ids[] = {
{
@@ -431,9 +420,7 @@ MODULE_DEVICE_TABLE(amba, pl061_ids);
static struct amba_driver pl061_gpio_driver = {
.drv = {
.name = "pl061_gpio",
-#ifdef CONFIG_PM
- .pm = &pl061_dev_pm_ops,
-#endif
+ .pm = pm_sleep_ptr(&pl061_dev_pm_ops),
},
.id_table = pl061_ids,
.probe = pl061_probe,
--
2.50.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 06/16] gpio: pxa: Use modern PM macros
2025-08-20 15:40 [PATCH 00/16] gpio: Use modern PM macros Jisheng Zhang
` (4 preceding siblings ...)
2025-08-20 15:40 ` [PATCH 05/16] gpio: pl061: " Jisheng Zhang
@ 2025-08-20 15:40 ` Jisheng Zhang
2025-08-20 15:40 ` [PATCH 07/16] gpio: ml-ioh: " Jisheng Zhang
` (10 subsequent siblings)
16 siblings, 0 replies; 30+ messages in thread
From: Jisheng Zhang @ 2025-08-20 15:40 UTC (permalink / raw)
To: Doug Berger, Florian Fainelli, Linus Walleij, Bartosz Golaszewski,
Michael Buesch, Hoan Tran, Andy Shevchenko, Daniel Palmer,
Romain Perier, Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
Robert Jarzmik, Kunihiko Hayashi, Masami Hiramatsu,
Shubhrajyoti Datta, Srinivas Neeli, Michal Simek
Cc: Broadcom internal kernel review list, linux-gpio,
linux-arm-kernel, linux-kernel, linux-omap, linux
Use the modern PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
This has the advantage of always compiling these functions in,
independently of any Kconfig option. Thanks to that, bugs and other
regressions are subsequently easier to catch.
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
drivers/gpio/gpio-pxa.c | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c
index fa22f3faa163..288c72f9c015 100644
--- a/drivers/gpio/gpio-pxa.c
+++ b/drivers/gpio/gpio-pxa.c
@@ -66,13 +66,10 @@ struct pxa_gpio_bank {
unsigned long irq_mask;
unsigned long irq_edge_rise;
unsigned long irq_edge_fall;
-
-#ifdef CONFIG_PM
unsigned long saved_gplr;
unsigned long saved_gpdr;
unsigned long saved_grer;
unsigned long saved_gfer;
-#endif
};
struct pxa_gpio_chip {
@@ -746,7 +743,6 @@ static int __init pxa_gpio_dt_init(void)
}
device_initcall(pxa_gpio_dt_init);
-#ifdef CONFIG_PM
static int pxa_gpio_suspend(void)
{
struct pxa_gpio_chip *pchip = pxa_gpio_chip;
@@ -787,14 +783,10 @@ static void pxa_gpio_resume(void)
writel_relaxed(c->saved_gpdr, c->regbase + GPDR_OFFSET);
}
}
-#else
-#define pxa_gpio_suspend NULL
-#define pxa_gpio_resume NULL
-#endif
static struct syscore_ops pxa_gpio_syscore_ops = {
- .suspend = pxa_gpio_suspend,
- .resume = pxa_gpio_resume,
+ .suspend = pm_ptr(pxa_gpio_suspend),
+ .resume = pm_ptr(pxa_gpio_resume),
};
static int __init pxa_gpio_sysinit(void)
--
2.50.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 07/16] gpio: ml-ioh: Use modern PM macros
2025-08-20 15:40 [PATCH 00/16] gpio: Use modern PM macros Jisheng Zhang
` (5 preceding siblings ...)
2025-08-20 15:40 ` [PATCH 06/16] gpio: pxa: " Jisheng Zhang
@ 2025-08-20 15:40 ` Jisheng Zhang
2025-08-20 16:56 ` Andy Shevchenko
2025-08-20 15:40 ` [PATCH 08/16] gpio: mlxbf2: " Jisheng Zhang
` (9 subsequent siblings)
16 siblings, 1 reply; 30+ messages in thread
From: Jisheng Zhang @ 2025-08-20 15:40 UTC (permalink / raw)
To: Doug Berger, Florian Fainelli, Linus Walleij, Bartosz Golaszewski,
Michael Buesch, Hoan Tran, Andy Shevchenko, Daniel Palmer,
Romain Perier, Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
Robert Jarzmik, Kunihiko Hayashi, Masami Hiramatsu,
Shubhrajyoti Datta, Srinivas Neeli, Michal Simek
Cc: Broadcom internal kernel review list, linux-gpio,
linux-arm-kernel, linux-kernel, linux-omap, linux
Use the modern PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
drivers/gpio/gpio-ml-ioh.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/gpio/gpio-ml-ioh.c b/drivers/gpio/gpio-ml-ioh.c
index f6af81bf2b13..6576e5dcb0ee 100644
--- a/drivers/gpio/gpio-ml-ioh.c
+++ b/drivers/gpio/gpio-ml-ioh.c
@@ -160,7 +160,7 @@ static int ioh_gpio_direction_input(struct gpio_chip *gpio, unsigned nr)
/*
* Save register configuration and disable interrupts.
*/
-static void __maybe_unused ioh_gpio_save_reg_conf(struct ioh_gpio *chip)
+static void ioh_gpio_save_reg_conf(struct ioh_gpio *chip)
{
int i;
@@ -186,7 +186,7 @@ static void __maybe_unused ioh_gpio_save_reg_conf(struct ioh_gpio *chip)
/*
* This function restores the register configuration of the GPIO device.
*/
-static void __maybe_unused ioh_gpio_restore_reg_conf(struct ioh_gpio *chip)
+static void ioh_gpio_restore_reg_conf(struct ioh_gpio *chip)
{
int i;
@@ -479,7 +479,7 @@ static int ioh_gpio_probe(struct pci_dev *pdev,
return 0;
}
-static int __maybe_unused ioh_gpio_suspend(struct device *dev)
+static int ioh_gpio_suspend(struct device *dev)
{
struct ioh_gpio *chip = dev_get_drvdata(dev);
unsigned long flags;
@@ -491,7 +491,7 @@ static int __maybe_unused ioh_gpio_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused ioh_gpio_resume(struct device *dev)
+static int ioh_gpio_resume(struct device *dev)
{
struct ioh_gpio *chip = dev_get_drvdata(dev);
unsigned long flags;
@@ -505,7 +505,7 @@ static int __maybe_unused ioh_gpio_resume(struct device *dev)
return 0;
}
-static SIMPLE_DEV_PM_OPS(ioh_gpio_pm_ops, ioh_gpio_suspend, ioh_gpio_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(ioh_gpio_pm_ops, ioh_gpio_suspend, ioh_gpio_resume);
static const struct pci_device_id ioh_gpio_pcidev_id[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x802E) },
@@ -518,7 +518,7 @@ static struct pci_driver ioh_gpio_driver = {
.id_table = ioh_gpio_pcidev_id,
.probe = ioh_gpio_probe,
.driver = {
- .pm = &ioh_gpio_pm_ops,
+ .pm = pm_sleep_ptr(&ioh_gpio_pm_ops),
},
};
--
2.50.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 08/16] gpio: mlxbf2: Use modern PM macros
2025-08-20 15:40 [PATCH 00/16] gpio: Use modern PM macros Jisheng Zhang
` (6 preceding siblings ...)
2025-08-20 15:40 ` [PATCH 07/16] gpio: ml-ioh: " Jisheng Zhang
@ 2025-08-20 15:40 ` Jisheng Zhang
2025-08-20 15:40 ` [PATCH 09/16] gpio: msc313: " Jisheng Zhang
` (8 subsequent siblings)
16 siblings, 0 replies; 30+ messages in thread
From: Jisheng Zhang @ 2025-08-20 15:40 UTC (permalink / raw)
To: Doug Berger, Florian Fainelli, Linus Walleij, Bartosz Golaszewski,
Michael Buesch, Hoan Tran, Andy Shevchenko, Daniel Palmer,
Romain Perier, Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
Robert Jarzmik, Kunihiko Hayashi, Masami Hiramatsu,
Shubhrajyoti Datta, Srinivas Neeli, Michal Simek
Cc: Broadcom internal kernel review list, linux-gpio,
linux-arm-kernel, linux-kernel, linux-omap, linux
Use the modern PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
drivers/gpio/gpio-mlxbf2.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/gpio/gpio-mlxbf2.c b/drivers/gpio/gpio-mlxbf2.c
index 390f2e74a9d8..f3112d949195 100644
--- a/drivers/gpio/gpio-mlxbf2.c
+++ b/drivers/gpio/gpio-mlxbf2.c
@@ -431,7 +431,7 @@ mlxbf2_gpio_probe(struct platform_device *pdev)
return 0;
}
-static int __maybe_unused mlxbf2_gpio_suspend(struct device *dev)
+static int mlxbf2_gpio_suspend(struct device *dev)
{
struct mlxbf2_gpio_context *gs = dev_get_drvdata(dev);
@@ -443,7 +443,7 @@ static int __maybe_unused mlxbf2_gpio_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused mlxbf2_gpio_resume(struct device *dev)
+static int mlxbf2_gpio_resume(struct device *dev)
{
struct mlxbf2_gpio_context *gs = dev_get_drvdata(dev);
@@ -454,7 +454,7 @@ static int __maybe_unused mlxbf2_gpio_resume(struct device *dev)
return 0;
}
-static SIMPLE_DEV_PM_OPS(mlxbf2_pm_ops, mlxbf2_gpio_suspend, mlxbf2_gpio_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(mlxbf2_pm_ops, mlxbf2_gpio_suspend, mlxbf2_gpio_resume);
static const struct acpi_device_id __maybe_unused mlxbf2_gpio_acpi_match[] = {
{ "MLNXBF22", 0 },
@@ -466,7 +466,7 @@ static struct platform_driver mlxbf2_gpio_driver = {
.driver = {
.name = "mlxbf2_gpio",
.acpi_match_table = mlxbf2_gpio_acpi_match,
- .pm = &mlxbf2_pm_ops,
+ .pm = pm_sleep_ptr(&mlxbf2_pm_ops),
},
.probe = mlxbf2_gpio_probe,
};
--
2.50.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 09/16] gpio: msc313: Use modern PM macros
2025-08-20 15:40 [PATCH 00/16] gpio: Use modern PM macros Jisheng Zhang
` (7 preceding siblings ...)
2025-08-20 15:40 ` [PATCH 08/16] gpio: mlxbf2: " Jisheng Zhang
@ 2025-08-20 15:40 ` Jisheng Zhang
2025-08-20 15:40 ` [PATCH 10/16] gpio: omap: " Jisheng Zhang
` (7 subsequent siblings)
16 siblings, 0 replies; 30+ messages in thread
From: Jisheng Zhang @ 2025-08-20 15:40 UTC (permalink / raw)
To: Doug Berger, Florian Fainelli, Linus Walleij, Bartosz Golaszewski,
Michael Buesch, Hoan Tran, Andy Shevchenko, Daniel Palmer,
Romain Perier, Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
Robert Jarzmik, Kunihiko Hayashi, Masami Hiramatsu,
Shubhrajyoti Datta, Srinivas Neeli, Michal Simek
Cc: Broadcom internal kernel review list, linux-gpio,
linux-arm-kernel, linux-kernel, linux-omap, linux
Use the modern PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
drivers/gpio/gpio-msc313.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/gpio/gpio-msc313.c b/drivers/gpio/gpio-msc313.c
index b0cccd856840..7345afdc78de 100644
--- a/drivers/gpio/gpio-msc313.c
+++ b/drivers/gpio/gpio-msc313.c
@@ -694,7 +694,7 @@ static const struct of_device_id msc313_gpio_of_match[] = {
* SoC goes into suspend to memory mode so we need to save some
* of the register bits before suspending and put it back when resuming
*/
-static int __maybe_unused msc313_gpio_suspend(struct device *dev)
+static int msc313_gpio_suspend(struct device *dev)
{
struct msc313_gpio *gpio = dev_get_drvdata(dev);
int i;
@@ -705,7 +705,7 @@ static int __maybe_unused msc313_gpio_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused msc313_gpio_resume(struct device *dev)
+static int msc313_gpio_resume(struct device *dev)
{
struct msc313_gpio *gpio = dev_get_drvdata(dev);
int i;
@@ -716,13 +716,13 @@ static int __maybe_unused msc313_gpio_resume(struct device *dev)
return 0;
}
-static SIMPLE_DEV_PM_OPS(msc313_gpio_ops, msc313_gpio_suspend, msc313_gpio_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(msc313_gpio_ops, msc313_gpio_suspend, msc313_gpio_resume);
static struct platform_driver msc313_gpio_driver = {
.driver = {
.name = DRIVER_NAME,
.of_match_table = msc313_gpio_of_match,
- .pm = &msc313_gpio_ops,
+ .pm = pm_sleep_ptr(&msc313_gpio_ops),
},
.probe = msc313_gpio_probe,
};
--
2.50.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 10/16] gpio: omap: Use modern PM macros
2025-08-20 15:40 [PATCH 00/16] gpio: Use modern PM macros Jisheng Zhang
` (8 preceding siblings ...)
2025-08-20 15:40 ` [PATCH 09/16] gpio: msc313: " Jisheng Zhang
@ 2025-08-20 15:40 ` Jisheng Zhang
2025-08-20 15:40 ` [PATCH 11/16] gpio: pch: " Jisheng Zhang
` (6 subsequent siblings)
16 siblings, 0 replies; 30+ messages in thread
From: Jisheng Zhang @ 2025-08-20 15:40 UTC (permalink / raw)
To: Doug Berger, Florian Fainelli, Linus Walleij, Bartosz Golaszewski,
Michael Buesch, Hoan Tran, Andy Shevchenko, Daniel Palmer,
Romain Perier, Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
Robert Jarzmik, Kunihiko Hayashi, Masami Hiramatsu,
Shubhrajyoti Datta, Srinivas Neeli, Michal Simek
Cc: Broadcom internal kernel review list, linux-gpio,
linux-arm-kernel, linux-kernel, linux-omap, linux
Use the modern PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
drivers/gpio/gpio-omap.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index a268c76bdca6..e136e81794df 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -1503,7 +1503,7 @@ static void omap_gpio_remove(struct platform_device *pdev)
clk_unprepare(bank->dbck);
}
-static int __maybe_unused omap_gpio_runtime_suspend(struct device *dev)
+static int omap_gpio_runtime_suspend(struct device *dev)
{
struct gpio_bank *bank = dev_get_drvdata(dev);
unsigned long flags;
@@ -1516,7 +1516,7 @@ static int __maybe_unused omap_gpio_runtime_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused omap_gpio_runtime_resume(struct device *dev)
+static int omap_gpio_runtime_resume(struct device *dev)
{
struct gpio_bank *bank = dev_get_drvdata(dev);
unsigned long flags;
@@ -1529,7 +1529,7 @@ static int __maybe_unused omap_gpio_runtime_resume(struct device *dev)
return 0;
}
-static int __maybe_unused omap_gpio_suspend(struct device *dev)
+static int omap_gpio_suspend(struct device *dev)
{
struct gpio_bank *bank = dev_get_drvdata(dev);
@@ -1541,7 +1541,7 @@ static int __maybe_unused omap_gpio_suspend(struct device *dev)
return omap_gpio_runtime_suspend(dev);
}
-static int __maybe_unused omap_gpio_resume(struct device *dev)
+static int omap_gpio_resume(struct device *dev)
{
struct gpio_bank *bank = dev_get_drvdata(dev);
@@ -1554,9 +1554,8 @@ static int __maybe_unused omap_gpio_resume(struct device *dev)
}
static const struct dev_pm_ops gpio_pm_ops = {
- SET_RUNTIME_PM_OPS(omap_gpio_runtime_suspend, omap_gpio_runtime_resume,
- NULL)
- SET_LATE_SYSTEM_SLEEP_PM_OPS(omap_gpio_suspend, omap_gpio_resume)
+ RUNTIME_PM_OPS(omap_gpio_runtime_suspend, omap_gpio_runtime_resume, NULL)
+ LATE_SYSTEM_SLEEP_PM_OPS(omap_gpio_suspend, omap_gpio_resume)
};
static struct platform_driver omap_gpio_driver = {
@@ -1564,7 +1563,7 @@ static struct platform_driver omap_gpio_driver = {
.remove = omap_gpio_remove,
.driver = {
.name = "omap_gpio",
- .pm = &gpio_pm_ops,
+ .pm = pm_ptr(&gpio_pm_ops),
.of_match_table = omap_gpio_match,
},
};
--
2.50.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 11/16] gpio: pch: Use modern PM macros
2025-08-20 15:40 [PATCH 00/16] gpio: Use modern PM macros Jisheng Zhang
` (9 preceding siblings ...)
2025-08-20 15:40 ` [PATCH 10/16] gpio: omap: " Jisheng Zhang
@ 2025-08-20 15:40 ` Jisheng Zhang
2025-08-20 16:55 ` Andy Shevchenko
2025-08-20 15:40 ` [PATCH 12/16] gpio: tqmx86: " Jisheng Zhang
` (5 subsequent siblings)
16 siblings, 1 reply; 30+ messages in thread
From: Jisheng Zhang @ 2025-08-20 15:40 UTC (permalink / raw)
To: Doug Berger, Florian Fainelli, Linus Walleij, Bartosz Golaszewski,
Michael Buesch, Hoan Tran, Andy Shevchenko, Daniel Palmer,
Romain Perier, Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
Robert Jarzmik, Kunihiko Hayashi, Masami Hiramatsu,
Shubhrajyoti Datta, Srinivas Neeli, Michal Simek
Cc: Broadcom internal kernel review list, linux-gpio,
linux-arm-kernel, linux-kernel, linux-omap, linux
Use the modern PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
drivers/gpio/gpio-pch.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/gpio/gpio-pch.c b/drivers/gpio/gpio-pch.c
index 9925687e05fb..4ffa0955a9e3 100644
--- a/drivers/gpio/gpio-pch.c
+++ b/drivers/gpio/gpio-pch.c
@@ -171,7 +171,7 @@ static int pch_gpio_direction_input(struct gpio_chip *gpio, unsigned int nr)
/*
* Save register configuration and disable interrupts.
*/
-static void __maybe_unused pch_gpio_save_reg_conf(struct pch_gpio *chip)
+static void pch_gpio_save_reg_conf(struct pch_gpio *chip)
{
chip->pch_gpio_reg.ien_reg = ioread32(&chip->reg->ien);
chip->pch_gpio_reg.imask_reg = ioread32(&chip->reg->imask);
@@ -187,7 +187,7 @@ static void __maybe_unused pch_gpio_save_reg_conf(struct pch_gpio *chip)
/*
* This function restores the register configuration of the GPIO device.
*/
-static void __maybe_unused pch_gpio_restore_reg_conf(struct pch_gpio *chip)
+static void pch_gpio_restore_reg_conf(struct pch_gpio *chip)
{
iowrite32(chip->pch_gpio_reg.ien_reg, &chip->reg->ien);
iowrite32(chip->pch_gpio_reg.imask_reg, &chip->reg->imask);
@@ -402,7 +402,7 @@ static int pch_gpio_probe(struct pci_dev *pdev,
return pch_gpio_alloc_generic_chip(chip, irq_base, gpio_pins[chip->ioh]);
}
-static int __maybe_unused pch_gpio_suspend(struct device *dev)
+static int pch_gpio_suspend(struct device *dev)
{
struct pch_gpio *chip = dev_get_drvdata(dev);
unsigned long flags;
@@ -414,7 +414,7 @@ static int __maybe_unused pch_gpio_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused pch_gpio_resume(struct device *dev)
+static int pch_gpio_resume(struct device *dev)
{
struct pch_gpio *chip = dev_get_drvdata(dev);
unsigned long flags;
@@ -428,7 +428,7 @@ static int __maybe_unused pch_gpio_resume(struct device *dev)
return 0;
}
-static SIMPLE_DEV_PM_OPS(pch_gpio_pm_ops, pch_gpio_suspend, pch_gpio_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(pch_gpio_pm_ops, pch_gpio_suspend, pch_gpio_resume);
static const struct pci_device_id pch_gpio_pcidev_id[] = {
{ PCI_DEVICE_DATA(INTEL, EG20T_PCH, INTEL_EG20T_PCH) },
@@ -444,7 +444,7 @@ static struct pci_driver pch_gpio_driver = {
.id_table = pch_gpio_pcidev_id,
.probe = pch_gpio_probe,
.driver = {
- .pm = &pch_gpio_pm_ops,
+ .pm = pm_sleep_ptr(&pch_gpio_pm_ops),
},
};
--
2.50.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 12/16] gpio: tqmx86: Use modern PM macros
2025-08-20 15:40 [PATCH 00/16] gpio: Use modern PM macros Jisheng Zhang
` (10 preceding siblings ...)
2025-08-20 15:40 ` [PATCH 11/16] gpio: pch: " Jisheng Zhang
@ 2025-08-20 15:40 ` Jisheng Zhang
2025-08-20 15:40 ` [PATCH 13/16] gpio: uniphier: " Jisheng Zhang
` (4 subsequent siblings)
16 siblings, 0 replies; 30+ messages in thread
From: Jisheng Zhang @ 2025-08-20 15:40 UTC (permalink / raw)
To: Doug Berger, Florian Fainelli, Linus Walleij, Bartosz Golaszewski,
Michael Buesch, Hoan Tran, Andy Shevchenko, Daniel Palmer,
Romain Perier, Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
Robert Jarzmik, Kunihiko Hayashi, Masami Hiramatsu,
Shubhrajyoti Datta, Srinivas Neeli, Michal Simek
Cc: Broadcom internal kernel review list, linux-gpio,
linux-arm-kernel, linux-kernel, linux-omap, linux
Use the modern PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
drivers/gpio/gpio-tqmx86.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/gpio/gpio-tqmx86.c b/drivers/gpio/gpio-tqmx86.c
index 27dd09273292..d79f515137a5 100644
--- a/drivers/gpio/gpio-tqmx86.c
+++ b/drivers/gpio/gpio-tqmx86.c
@@ -279,19 +279,18 @@ static void tqmx86_gpio_irq_handler(struct irq_desc *desc)
}
/* Minimal runtime PM is needed by the IRQ subsystem */
-static int __maybe_unused tqmx86_gpio_runtime_suspend(struct device *dev)
+static int tqmx86_gpio_runtime_suspend(struct device *dev)
{
return 0;
}
-static int __maybe_unused tqmx86_gpio_runtime_resume(struct device *dev)
+static int tqmx86_gpio_runtime_resume(struct device *dev)
{
return 0;
}
static const struct dev_pm_ops tqmx86_gpio_dev_pm_ops = {
- SET_RUNTIME_PM_OPS(tqmx86_gpio_runtime_suspend,
- tqmx86_gpio_runtime_resume, NULL)
+ RUNTIME_PM_OPS(tqmx86_gpio_runtime_suspend, tqmx86_gpio_runtime_resume, NULL)
};
static void tqmx86_init_irq_valid_mask(struct gpio_chip *chip,
@@ -425,7 +424,7 @@ static int tqmx86_gpio_probe(struct platform_device *pdev)
static struct platform_driver tqmx86_gpio_driver = {
.driver = {
.name = "tqmx86-gpio",
- .pm = &tqmx86_gpio_dev_pm_ops,
+ .pm = pm_sleep_ptr(&tqmx86_gpio_dev_pm_ops),
},
.probe = tqmx86_gpio_probe,
};
--
2.50.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 13/16] gpio: uniphier: Use modern PM macros
2025-08-20 15:40 [PATCH 00/16] gpio: Use modern PM macros Jisheng Zhang
` (11 preceding siblings ...)
2025-08-20 15:40 ` [PATCH 12/16] gpio: tqmx86: " Jisheng Zhang
@ 2025-08-20 15:40 ` Jisheng Zhang
2025-08-20 15:40 ` [PATCH 14/16] gpio: xgene: " Jisheng Zhang
` (3 subsequent siblings)
16 siblings, 0 replies; 30+ messages in thread
From: Jisheng Zhang @ 2025-08-20 15:40 UTC (permalink / raw)
To: Doug Berger, Florian Fainelli, Linus Walleij, Bartosz Golaszewski,
Michael Buesch, Hoan Tran, Andy Shevchenko, Daniel Palmer,
Romain Perier, Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
Robert Jarzmik, Kunihiko Hayashi, Masami Hiramatsu,
Shubhrajyoti Datta, Srinivas Neeli, Michal Simek
Cc: Broadcom internal kernel review list, linux-gpio,
linux-arm-kernel, linux-kernel, linux-omap, linux
Use the modern PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
drivers/gpio/gpio-uniphier.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/gpio/gpio-uniphier.c b/drivers/gpio/gpio-uniphier.c
index 197bb1d22b3c..0574dde5b5bb 100644
--- a/drivers/gpio/gpio-uniphier.c
+++ b/drivers/gpio/gpio-uniphier.c
@@ -426,7 +426,7 @@ static void uniphier_gpio_remove(struct platform_device *pdev)
irq_domain_remove(priv->domain);
}
-static int __maybe_unused uniphier_gpio_suspend(struct device *dev)
+static int uniphier_gpio_suspend(struct device *dev)
{
struct uniphier_gpio_priv *priv = dev_get_drvdata(dev);
unsigned int nbanks = uniphier_gpio_get_nbanks(priv->chip.ngpio);
@@ -448,7 +448,7 @@ static int __maybe_unused uniphier_gpio_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused uniphier_gpio_resume(struct device *dev)
+static int uniphier_gpio_resume(struct device *dev)
{
struct uniphier_gpio_priv *priv = dev_get_drvdata(dev);
unsigned int nbanks = uniphier_gpio_get_nbanks(priv->chip.ngpio);
@@ -473,8 +473,7 @@ static int __maybe_unused uniphier_gpio_resume(struct device *dev)
}
static const struct dev_pm_ops uniphier_gpio_pm_ops = {
- SET_LATE_SYSTEM_SLEEP_PM_OPS(uniphier_gpio_suspend,
- uniphier_gpio_resume)
+ LATE_SYSTEM_SLEEP_PM_OPS(uniphier_gpio_suspend, uniphier_gpio_resume)
};
static const struct of_device_id uniphier_gpio_match[] = {
@@ -489,7 +488,7 @@ static struct platform_driver uniphier_gpio_driver = {
.driver = {
.name = "uniphier-gpio",
.of_match_table = uniphier_gpio_match,
- .pm = &uniphier_gpio_pm_ops,
+ .pm = pm_sleep_ptr(&uniphier_gpio_pm_ops),
},
};
module_platform_driver(uniphier_gpio_driver);
--
2.50.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 14/16] gpio: xgene: Use modern PM macros
2025-08-20 15:40 [PATCH 00/16] gpio: Use modern PM macros Jisheng Zhang
` (12 preceding siblings ...)
2025-08-20 15:40 ` [PATCH 13/16] gpio: uniphier: " Jisheng Zhang
@ 2025-08-20 15:40 ` Jisheng Zhang
2025-08-20 15:40 ` [PATCH 15/16] gpio: xilinx: " Jisheng Zhang
` (2 subsequent siblings)
16 siblings, 0 replies; 30+ messages in thread
From: Jisheng Zhang @ 2025-08-20 15:40 UTC (permalink / raw)
To: Doug Berger, Florian Fainelli, Linus Walleij, Bartosz Golaszewski,
Michael Buesch, Hoan Tran, Andy Shevchenko, Daniel Palmer,
Romain Perier, Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
Robert Jarzmik, Kunihiko Hayashi, Masami Hiramatsu,
Shubhrajyoti Datta, Srinivas Neeli, Michal Simek
Cc: Broadcom internal kernel review list, linux-gpio,
linux-arm-kernel, linux-kernel, linux-omap, linux
Use the modern PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
drivers/gpio/gpio-xgene.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/gpio/gpio-xgene.c b/drivers/gpio/gpio-xgene.c
index 4f627de3f56c..809668449dbe 100644
--- a/drivers/gpio/gpio-xgene.c
+++ b/drivers/gpio/gpio-xgene.c
@@ -130,7 +130,7 @@ static int xgene_gpio_dir_out(struct gpio_chip *gc,
return 0;
}
-static __maybe_unused int xgene_gpio_suspend(struct device *dev)
+static int xgene_gpio_suspend(struct device *dev)
{
struct xgene_gpio *gpio = dev_get_drvdata(dev);
unsigned long bank_offset;
@@ -143,7 +143,7 @@ static __maybe_unused int xgene_gpio_suspend(struct device *dev)
return 0;
}
-static __maybe_unused int xgene_gpio_resume(struct device *dev)
+static int xgene_gpio_resume(struct device *dev)
{
struct xgene_gpio *gpio = dev_get_drvdata(dev);
unsigned long bank_offset;
@@ -156,7 +156,7 @@ static __maybe_unused int xgene_gpio_resume(struct device *dev)
return 0;
}
-static SIMPLE_DEV_PM_OPS(xgene_gpio_pm, xgene_gpio_suspend, xgene_gpio_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(xgene_gpio_pm, xgene_gpio_suspend, xgene_gpio_resume);
static int xgene_gpio_probe(struct platform_device *pdev)
{
@@ -204,7 +204,7 @@ static struct platform_driver xgene_gpio_driver = {
.name = "xgene-gpio",
.of_match_table = xgene_gpio_of_match,
.acpi_match_table = ACPI_PTR(xgene_gpio_acpi_match),
- .pm = &xgene_gpio_pm,
+ .pm = pm_sleep_ptr(&xgene_gpio_pm),
},
.probe = xgene_gpio_probe,
};
--
2.50.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 15/16] gpio: xilinx: Use modern PM macros
2025-08-20 15:40 [PATCH 00/16] gpio: Use modern PM macros Jisheng Zhang
` (13 preceding siblings ...)
2025-08-20 15:40 ` [PATCH 14/16] gpio: xgene: " Jisheng Zhang
@ 2025-08-20 15:40 ` Jisheng Zhang
2025-08-20 15:40 ` [PATCH 16/16] gpio: zynq: " Jisheng Zhang
2025-08-28 13:39 ` [PATCH 00/16] gpio: " Bartosz Golaszewski
16 siblings, 0 replies; 30+ messages in thread
From: Jisheng Zhang @ 2025-08-20 15:40 UTC (permalink / raw)
To: Doug Berger, Florian Fainelli, Linus Walleij, Bartosz Golaszewski,
Michael Buesch, Hoan Tran, Andy Shevchenko, Daniel Palmer,
Romain Perier, Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
Robert Jarzmik, Kunihiko Hayashi, Masami Hiramatsu,
Shubhrajyoti Datta, Srinivas Neeli, Michal Simek
Cc: Broadcom internal kernel review list, linux-gpio,
linux-arm-kernel, linux-kernel, linux-omap, linux
Use the modern PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
drivers/gpio/gpio-xilinx.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/drivers/gpio/gpio-xilinx.c b/drivers/gpio/gpio-xilinx.c
index 83675ac81077..be4b4d730547 100644
--- a/drivers/gpio/gpio-xilinx.c
+++ b/drivers/gpio/gpio-xilinx.c
@@ -286,7 +286,7 @@ static void xgpio_free(struct gpio_chip *chip, unsigned int offset)
pm_runtime_put(chip->parent);
}
-static int __maybe_unused xgpio_suspend(struct device *dev)
+static int xgpio_suspend(struct device *dev)
{
struct xgpio_instance *gpio = dev_get_drvdata(dev);
struct irq_data *data = irq_get_irq_data(gpio->irq);
@@ -327,7 +327,7 @@ static void xgpio_irq_ack(struct irq_data *irq_data)
{
}
-static int __maybe_unused xgpio_resume(struct device *dev)
+static int xgpio_resume(struct device *dev)
{
struct xgpio_instance *gpio = dev_get_drvdata(dev);
struct irq_data *data = irq_get_irq_data(gpio->irq);
@@ -343,7 +343,7 @@ static int __maybe_unused xgpio_resume(struct device *dev)
return 0;
}
-static int __maybe_unused xgpio_runtime_suspend(struct device *dev)
+static int xgpio_runtime_suspend(struct device *dev)
{
struct xgpio_instance *gpio = dev_get_drvdata(dev);
@@ -352,7 +352,7 @@ static int __maybe_unused xgpio_runtime_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused xgpio_runtime_resume(struct device *dev)
+static int xgpio_runtime_resume(struct device *dev)
{
struct xgpio_instance *gpio = dev_get_drvdata(dev);
@@ -360,9 +360,8 @@ static int __maybe_unused xgpio_runtime_resume(struct device *dev)
}
static const struct dev_pm_ops xgpio_dev_pm_ops = {
- SET_SYSTEM_SLEEP_PM_OPS(xgpio_suspend, xgpio_resume)
- SET_RUNTIME_PM_OPS(xgpio_runtime_suspend,
- xgpio_runtime_resume, NULL)
+ SYSTEM_SLEEP_PM_OPS(xgpio_suspend, xgpio_resume)
+ RUNTIME_PM_OPS(xgpio_runtime_suspend, xgpio_runtime_resume, NULL)
};
/**
@@ -682,7 +681,7 @@ static struct platform_driver xgpio_plat_driver = {
.driver = {
.name = "gpio-xilinx",
.of_match_table = xgpio_of_match,
- .pm = &xgpio_dev_pm_ops,
+ .pm = pm_ptr(&xgpio_dev_pm_ops),
},
};
--
2.50.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH 16/16] gpio: zynq: Use modern PM macros
2025-08-20 15:40 [PATCH 00/16] gpio: Use modern PM macros Jisheng Zhang
` (14 preceding siblings ...)
2025-08-20 15:40 ` [PATCH 15/16] gpio: xilinx: " Jisheng Zhang
@ 2025-08-20 15:40 ` Jisheng Zhang
2025-08-28 13:39 ` [PATCH 00/16] gpio: " Bartosz Golaszewski
16 siblings, 0 replies; 30+ messages in thread
From: Jisheng Zhang @ 2025-08-20 15:40 UTC (permalink / raw)
To: Doug Berger, Florian Fainelli, Linus Walleij, Bartosz Golaszewski,
Michael Buesch, Hoan Tran, Andy Shevchenko, Daniel Palmer,
Romain Perier, Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
Robert Jarzmik, Kunihiko Hayashi, Masami Hiramatsu,
Shubhrajyoti Datta, Srinivas Neeli, Michal Simek
Cc: Broadcom internal kernel review list, linux-gpio,
linux-arm-kernel, linux-kernel, linux-omap, linux
Use the modern PM macros for the suspend and resume functions to be
automatically dropped by the compiler when CONFIG_PM or
CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused
Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
drivers/gpio/gpio-zynq.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/drivers/gpio/gpio-zynq.c b/drivers/gpio/gpio-zynq.c
index 0ffd76e8951f..97780c57ab56 100644
--- a/drivers/gpio/gpio-zynq.c
+++ b/drivers/gpio/gpio-zynq.c
@@ -735,7 +735,7 @@ static void zynq_gpio_restore_context(struct zynq_gpio *gpio)
}
}
-static int __maybe_unused zynq_gpio_suspend(struct device *dev)
+static int zynq_gpio_suspend(struct device *dev)
{
struct zynq_gpio *gpio = dev_get_drvdata(dev);
struct irq_data *data = irq_get_irq_data(gpio->irq);
@@ -756,7 +756,7 @@ static int __maybe_unused zynq_gpio_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused zynq_gpio_resume(struct device *dev)
+static int zynq_gpio_resume(struct device *dev)
{
struct zynq_gpio *gpio = dev_get_drvdata(dev);
struct irq_data *data = irq_get_irq_data(gpio->irq);
@@ -779,7 +779,7 @@ static int __maybe_unused zynq_gpio_resume(struct device *dev)
return 0;
}
-static int __maybe_unused zynq_gpio_runtime_suspend(struct device *dev)
+static int zynq_gpio_runtime_suspend(struct device *dev)
{
struct zynq_gpio *gpio = dev_get_drvdata(dev);
@@ -788,7 +788,7 @@ static int __maybe_unused zynq_gpio_runtime_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused zynq_gpio_runtime_resume(struct device *dev)
+static int zynq_gpio_runtime_resume(struct device *dev)
{
struct zynq_gpio *gpio = dev_get_drvdata(dev);
@@ -814,9 +814,8 @@ static void zynq_gpio_free(struct gpio_chip *chip, unsigned int offset)
}
static const struct dev_pm_ops zynq_gpio_dev_pm_ops = {
- SET_SYSTEM_SLEEP_PM_OPS(zynq_gpio_suspend, zynq_gpio_resume)
- SET_RUNTIME_PM_OPS(zynq_gpio_runtime_suspend,
- zynq_gpio_runtime_resume, NULL)
+ SYSTEM_SLEEP_PM_OPS(zynq_gpio_suspend, zynq_gpio_resume)
+ RUNTIME_PM_OPS(zynq_gpio_runtime_suspend, zynq_gpio_runtime_resume, NULL)
};
static const struct zynq_platform_data versal_gpio_def = {
@@ -1022,7 +1021,7 @@ static void zynq_gpio_remove(struct platform_device *pdev)
static struct platform_driver zynq_gpio_driver = {
.driver = {
.name = DRIVER_NAME,
- .pm = &zynq_gpio_dev_pm_ops,
+ .pm = pm_ptr(&zynq_gpio_dev_pm_ops),
.of_match_table = zynq_gpio_of_match,
},
.probe = zynq_gpio_probe,
--
2.50.1
^ permalink raw reply related [flat|nested] 30+ messages in thread
* Re: [PATCH 01/16] gpio: dwapb: Use modern PM macros
2025-08-20 15:40 ` [PATCH 01/16] gpio: dwapb: " Jisheng Zhang
@ 2025-08-20 16:54 ` Andy Shevchenko
2025-08-20 17:10 ` Michael Büsch
0 siblings, 1 reply; 30+ messages in thread
From: Andy Shevchenko @ 2025-08-20 16:54 UTC (permalink / raw)
To: Jisheng Zhang
Cc: Doug Berger, Florian Fainelli, Linus Walleij, Bartosz Golaszewski,
Michael Buesch, Hoan Tran, Andy Shevchenko, Daniel Palmer,
Romain Perier, Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
Robert Jarzmik, Kunihiko Hayashi, Masami Hiramatsu,
Shubhrajyoti Datta, Srinivas Neeli, Michal Simek,
Broadcom internal kernel review list, linux-gpio,
linux-arm-kernel, linux-kernel, linux-omap, linux
On Wed, Aug 20, 2025 at 6:58 PM Jisheng Zhang <jszhang@kernel.org> wrote:
>
> Use the modern PM macros for the suspend and resume functions to be
> automatically dropped by the compiler when CONFIG_PM or
> CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
>
> This has the advantage of always compiling these functions in,
> independently of any Kconfig option. Thanks to that, bugs and other
> regressions are subsequently easier to catch.
>
> The dwapb_context structure is always embedded into struct
> dwapb_gpio_port to simplify code. Sure this brings a tiny 36 bytes
> data overhead for !CONFIG_PM_SLEP.
I don't think it's a good approach to add a lot of data for peanuts in
case of PM_SLEEP=n.
Can you just drop that part from the patch and we can discuss it separately?
...
> -#ifdef CONFIG_PM_SLEEP
> static int dwapb_irq_set_wake(struct irq_data *d, unsigned int enable)
> {
> struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
> struct dwapb_gpio *gpio = to_dwapb_gpio(gc);
> - struct dwapb_context *ctx = gpio->ports[0].ctx;
> + struct dwapb_context *ctx = &gpio->ports[0].ctx;
> irq_hw_number_t bit = irqd_to_hwirq(d);
>
> if (enable)
> @@ -372,9 +367,6 @@ static int dwapb_irq_set_wake(struct irq_data *d, unsigned int enable)
>
> return 0;
> }
> -#else
> -#define dwapb_irq_set_wake NULL
> -#endif
>
> static const struct irq_chip dwapb_irq_chip = {
> .name = DWAPB_DRIVER_NAME,
> @@ -384,7 +376,7 @@ static const struct irq_chip dwapb_irq_chip = {
> .irq_set_type = dwapb_irq_set_type,
> .irq_enable = dwapb_irq_enable,
> .irq_disable = dwapb_irq_disable,
> - .irq_set_wake = dwapb_irq_set_wake,
> + .irq_set_wake = pm_sleep_ptr(dwapb_irq_set_wake),
> .flags = IRQCHIP_IMMUTABLE,
> GPIOCHIP_IRQ_RESOURCE_HELPERS,
> };
This is an interesting piece. I haven't seen much similar in other
GPIO drivers, I would suggest to split it to a separate patch. Also, I
would always have a callback assigned.
...
> -static SIMPLE_DEV_PM_OPS(dwapb_gpio_pm_ops, dwapb_gpio_suspend,
> - dwapb_gpio_resume);
> +static DEFINE_SIMPLE_DEV_PM_OPS(dwapb_gpio_pm_ops, dwapb_gpio_suspend, dwapb_gpio_resume);
I think Bart wants the 80 limit to be enforced. Can you just make the
split rather logical?
static DEFINE_SIMPLE_DEV_PM_OPS(dwapb_gpio_pm_ops,
dwapb_gpio_suspend, dwapb_gpio_resume);
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 11/16] gpio: pch: Use modern PM macros
2025-08-20 15:40 ` [PATCH 11/16] gpio: pch: " Jisheng Zhang
@ 2025-08-20 16:55 ` Andy Shevchenko
0 siblings, 0 replies; 30+ messages in thread
From: Andy Shevchenko @ 2025-08-20 16:55 UTC (permalink / raw)
To: Jisheng Zhang
Cc: Doug Berger, Florian Fainelli, Linus Walleij, Bartosz Golaszewski,
Michael Buesch, Hoan Tran, Andy Shevchenko, Daniel Palmer,
Romain Perier, Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
Robert Jarzmik, Kunihiko Hayashi, Masami Hiramatsu,
Shubhrajyoti Datta, Srinivas Neeli, Michal Simek,
Broadcom internal kernel review list, linux-gpio,
linux-arm-kernel, linux-kernel, linux-omap, linux
On Wed, Aug 20, 2025 at 6:59 PM Jisheng Zhang <jszhang@kernel.org> wrote:
>
> Use the modern PM macros for the suspend and resume functions to be
> automatically dropped by the compiler when CONFIG_PM or
> CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused
Acked-by: Andy Shevchenko <andy@kernel.org>
in case Bart wants to take it inside the whole series.
Otherwise I can take it via my tree.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 07/16] gpio: ml-ioh: Use modern PM macros
2025-08-20 15:40 ` [PATCH 07/16] gpio: ml-ioh: " Jisheng Zhang
@ 2025-08-20 16:56 ` Andy Shevchenko
0 siblings, 0 replies; 30+ messages in thread
From: Andy Shevchenko @ 2025-08-20 16:56 UTC (permalink / raw)
To: Jisheng Zhang
Cc: Doug Berger, Florian Fainelli, Linus Walleij, Bartosz Golaszewski,
Michael Buesch, Hoan Tran, Andy Shevchenko, Daniel Palmer,
Romain Perier, Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
Robert Jarzmik, Kunihiko Hayashi, Masami Hiramatsu,
Shubhrajyoti Datta, Srinivas Neeli, Michal Simek,
Broadcom internal kernel review list, linux-gpio,
linux-arm-kernel, linux-kernel, linux-omap, linux
On Wed, Aug 20, 2025 at 6:59 PM Jisheng Zhang <jszhang@kernel.org> wrote:
>
> Use the modern PM macros for the suspend and resume functions to be
> automatically dropped by the compiler when CONFIG_PM or
> CONFIG_PM_SLEEP are disabled, without having to use __maybe_unused
Acked-by: Andy Shevchenko <andy@kernel.org>
in case Bart wants to take it inside the whole series.
Otherwise I can take it via my tree.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 03/16] gpio: bt8xx: Use modern PM macros
2025-08-20 15:40 ` [PATCH 03/16] gpio: bt8xx: " Jisheng Zhang
@ 2025-08-20 17:08 ` Michael Büsch
0 siblings, 0 replies; 30+ messages in thread
From: Michael Büsch @ 2025-08-20 17:08 UTC (permalink / raw)
To: Jisheng Zhang
Cc: Doug Berger, Florian Fainelli, Linus Walleij, Bartosz Golaszewski,
Michael Buesch, Hoan Tran, Andy Shevchenko, Daniel Palmer,
Romain Perier, Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
Robert Jarzmik, Kunihiko Hayashi, Masami Hiramatsu,
Shubhrajyoti Datta, Srinivas Neeli, Michal Simek,
Broadcom internal kernel review list, linux-gpio,
linux-arm-kernel, linux-kernel, linux-omap, linux
[-- Attachment #1: Type: text/plain, Size: 609 bytes --]
On Wed, 20 Aug 2025 23:40:24 +0800
Jisheng Zhang <jszhang@kernel.org> wrote:
> Use the modern PM macros for the suspend and resume functions to be
> automatically dropped by the compiler when CONFIG_PM or
> CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
>
> This has the advantage of always compiling these functions in,
> independently of any Kconfig option. Thanks to that, bugs and other
> regressions are subsequently easier to catch.
>
> Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Acked-by: Michael Büsch <m@bues.ch>
--
Michael Büsch
https://bues.ch/
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 01/16] gpio: dwapb: Use modern PM macros
2025-08-20 16:54 ` Andy Shevchenko
@ 2025-08-20 17:10 ` Michael Büsch
2025-08-20 19:04 ` Andy Shevchenko
0 siblings, 1 reply; 30+ messages in thread
From: Michael Büsch @ 2025-08-20 17:10 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Jisheng Zhang, Doug Berger, Florian Fainelli, Linus Walleij,
Bartosz Golaszewski, Michael Buesch, Hoan Tran, Andy Shevchenko,
Daniel Palmer, Romain Perier, Grygorii Strashko,
Santosh Shilimkar, Kevin Hilman, Robert Jarzmik, Kunihiko Hayashi,
Masami Hiramatsu, Shubhrajyoti Datta, Srinivas Neeli,
Michal Simek, Broadcom internal kernel review list, linux-gpio,
linux-arm-kernel, linux-kernel, linux-omap, linux
[-- Attachment #1: Type: text/plain, Size: 691 bytes --]
On Wed, 20 Aug 2025 19:54:44 +0300
Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
> > The dwapb_context structure is always embedded into struct
> > dwapb_gpio_port to simplify code. Sure this brings a tiny 36 bytes
> > data overhead for !CONFIG_PM_SLEP.
>
> I don't think it's a good approach to add a lot of data for peanuts in
> case of PM_SLEEP=n.
It wastes 36 bytes in case of PM=n.
The driver currently allocates the struct with kzalloc and stores a pointer to it
in case of PM=y.
So this probably has an overhead in the same order of magnitude (pointer +
malloc overhead/alignment/fragmentation) in case of PM=y now.
--
Michael Büsch
https://bues.ch/
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 01/16] gpio: dwapb: Use modern PM macros
2025-08-20 17:10 ` Michael Büsch
@ 2025-08-20 19:04 ` Andy Shevchenko
2025-08-21 16:44 ` Jisheng Zhang
0 siblings, 1 reply; 30+ messages in thread
From: Andy Shevchenko @ 2025-08-20 19:04 UTC (permalink / raw)
To: Michael Büsch
Cc: Jisheng Zhang, Doug Berger, Florian Fainelli, Linus Walleij,
Bartosz Golaszewski, Michael Buesch, Hoan Tran, Andy Shevchenko,
Daniel Palmer, Romain Perier, Grygorii Strashko,
Santosh Shilimkar, Kevin Hilman, Robert Jarzmik, Kunihiko Hayashi,
Masami Hiramatsu, Shubhrajyoti Datta, Srinivas Neeli,
Michal Simek, Broadcom internal kernel review list, linux-gpio,
linux-arm-kernel, linux-kernel, linux-omap, linux
On Wed, Aug 20, 2025 at 8:11 PM Michael Büsch <mb@bues.ch> wrote:
>
> On Wed, 20 Aug 2025 19:54:44 +0300
> Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
>
> > > The dwapb_context structure is always embedded into struct
> > > dwapb_gpio_port to simplify code. Sure this brings a tiny 36 bytes
> > > data overhead for !CONFIG_PM_SLEP.
> >
> > I don't think it's a good approach to add a lot of data for peanuts in
> > case of PM_SLEEP=n.
>
> It wastes 36 bytes in case of PM=n.
...per port.
> The driver currently allocates the struct with kzalloc and stores a pointer to it
> in case of PM=y.
> So this probably has an overhead in the same order of magnitude (pointer +
> malloc overhead/alignment/fragmentation) in case of PM=y now.
...per driver.
So, I can't say it's equal, but I leave this to maintainers to decide,
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 05/16] gpio: pl061: Use modern PM macros
2025-08-20 15:40 ` [PATCH 05/16] gpio: pl061: " Jisheng Zhang
@ 2025-08-21 11:52 ` Linus Walleij
2025-08-21 12:50 ` Andy Shevchenko
0 siblings, 1 reply; 30+ messages in thread
From: Linus Walleij @ 2025-08-21 11:52 UTC (permalink / raw)
To: Jisheng Zhang
Cc: Doug Berger, Florian Fainelli, Bartosz Golaszewski,
Michael Buesch, Hoan Tran, Andy Shevchenko, Daniel Palmer,
Romain Perier, Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
Robert Jarzmik, Kunihiko Hayashi, Masami Hiramatsu,
Shubhrajyoti Datta, Srinivas Neeli, Michal Simek,
Broadcom internal kernel review list, linux-gpio,
linux-arm-kernel, linux-kernel, linux-omap, linux
On Wed, Aug 20, 2025 at 5:58 PM Jisheng Zhang <jszhang@kernel.org> wrote:
> Use the modern PM macros for the suspend and resume functions to be
> automatically dropped by the compiler when CONFIG_PM or
> CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
>
> This has the advantage of always compiling these functions in,
> independently of any Kconfig option. Thanks to that, bugs and other
> regressions are subsequently easier to catch.
>
> The pl061_context_save_regs structure is always embedded into struct
> pl061 to simplify code, so this brings a tiny 8 bytes memory overhead
> for !CONFIG_PM_SLEP.
>
> Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Hm true, 8 bytes is not a big deal.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 05/16] gpio: pl061: Use modern PM macros
2025-08-21 11:52 ` Linus Walleij
@ 2025-08-21 12:50 ` Andy Shevchenko
0 siblings, 0 replies; 30+ messages in thread
From: Andy Shevchenko @ 2025-08-21 12:50 UTC (permalink / raw)
To: Linus Walleij
Cc: Jisheng Zhang, Doug Berger, Florian Fainelli, Bartosz Golaszewski,
Michael Buesch, Hoan Tran, Andy Shevchenko, Daniel Palmer,
Romain Perier, Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
Robert Jarzmik, Kunihiko Hayashi, Masami Hiramatsu,
Shubhrajyoti Datta, Srinivas Neeli, Michal Simek,
Broadcom internal kernel review list, linux-gpio,
linux-arm-kernel, linux-kernel, linux-omap, linux
On Thu, Aug 21, 2025 at 2:52 PM Linus Walleij <linus.walleij@linaro.org> wrote:
> On Wed, Aug 20, 2025 at 5:58 PM Jisheng Zhang <jszhang@kernel.org> wrote:
...
> > The pl061_context_save_regs structure is always embedded into struct
> > pl061 to simplify code, so this brings a tiny 8 bytes memory overhead
> > for !CONFIG_PM_SLEP.
> >
> > Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
>
> Hm true, 8 bytes is not a big deal.
It's better to double check. This data is per GPIO chip, the Q is how
many chips can be present on one system. Then the calculus will be N *
8 bytes.
Knowing gpio-dwapb (and having even a HW with it) the commit message
(there) seems like a slight manipulation as it doesn't clarify this
detail.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 01/16] gpio: dwapb: Use modern PM macros
2025-08-20 19:04 ` Andy Shevchenko
@ 2025-08-21 16:44 ` Jisheng Zhang
2025-08-21 19:32 ` Andy Shevchenko
0 siblings, 1 reply; 30+ messages in thread
From: Jisheng Zhang @ 2025-08-21 16:44 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Michael Büsch, Doug Berger, Florian Fainelli, Linus Walleij,
Bartosz Golaszewski, Michael Buesch, Hoan Tran, Andy Shevchenko,
Daniel Palmer, Romain Perier, Grygorii Strashko,
Santosh Shilimkar, Kevin Hilman, Robert Jarzmik, Kunihiko Hayashi,
Masami Hiramatsu, Shubhrajyoti Datta, Srinivas Neeli,
Michal Simek, Broadcom internal kernel review list, linux-gpio,
linux-arm-kernel, linux-kernel, linux-omap, linux
On Wed, Aug 20, 2025 at 10:04:39PM +0300, Andy Shevchenko wrote:
> On Wed, Aug 20, 2025 at 8:11 PM Michael Büsch <mb@bues.ch> wrote:
> >
> > On Wed, 20 Aug 2025 19:54:44 +0300
> > Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
> >
> > > > The dwapb_context structure is always embedded into struct
> > > > dwapb_gpio_port to simplify code. Sure this brings a tiny 36 bytes
> > > > data overhead for !CONFIG_PM_SLEP.
> > >
> > > I don't think it's a good approach to add a lot of data for peanuts in
> > > case of PM_SLEEP=n.
> >
> > It wastes 36 bytes in case of PM=n.
>
> ...per port.
>
> > The driver currently allocates the struct with kzalloc and stores a pointer to it
> > in case of PM=y.
> > So this probably has an overhead in the same order of magnitude (pointer +
> > malloc overhead/alignment/fragmentation) in case of PM=y now.
>
> ...per driver.
Before the patch, struct dwapb_context *ctx is also per port.
>
> So, I can't say it's equal, but I leave this to maintainers to decide,
What in my mind now: this is linux rather than RTOS. After greping the
the arm/arm64/riscv dts dir, the max port number is 6, the berlin2q
soc families, so this means current we have wasted 216 bytes memory which
is trivial compared to the system memory.
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 01/16] gpio: dwapb: Use modern PM macros
2025-08-21 16:44 ` Jisheng Zhang
@ 2025-08-21 19:32 ` Andy Shevchenko
2025-08-22 0:42 ` Jisheng Zhang
0 siblings, 1 reply; 30+ messages in thread
From: Andy Shevchenko @ 2025-08-21 19:32 UTC (permalink / raw)
To: Jisheng Zhang
Cc: Michael Büsch, Doug Berger, Florian Fainelli, Linus Walleij,
Bartosz Golaszewski, Michael Buesch, Hoan Tran, Andy Shevchenko,
Daniel Palmer, Romain Perier, Grygorii Strashko,
Santosh Shilimkar, Kevin Hilman, Robert Jarzmik, Kunihiko Hayashi,
Masami Hiramatsu, Shubhrajyoti Datta, Srinivas Neeli,
Michal Simek, Broadcom internal kernel review list, linux-gpio,
linux-arm-kernel, linux-kernel, linux-omap, linux
On Thu, Aug 21, 2025 at 8:02 PM Jisheng Zhang <jszhang@kernel.org> wrote:
> On Wed, Aug 20, 2025 at 10:04:39PM +0300, Andy Shevchenko wrote:
> > On Wed, Aug 20, 2025 at 8:11 PM Michael Büsch <mb@bues.ch> wrote:
> > > On Wed, 20 Aug 2025 19:54:44 +0300
> > > Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
> > >
> > > > > The dwapb_context structure is always embedded into struct
> > > > > dwapb_gpio_port to simplify code. Sure this brings a tiny 36 bytes
> > > > > data overhead for !CONFIG_PM_SLEP.
> > > >
> > > > I don't think it's a good approach to add a lot of data for peanuts in
> > > > case of PM_SLEEP=n.
> > >
> > > It wastes 36 bytes in case of PM=n.
> >
> > ...per port.
> >
> > > The driver currently allocates the struct with kzalloc and stores a pointer to it
> > > in case of PM=y.
> > > So this probably has an overhead in the same order of magnitude (pointer +
> > > malloc overhead/alignment/fragmentation) in case of PM=y now.
> >
> > ...per driver.
>
> Before the patch, struct dwapb_context *ctx is also per port.
OK. So the comparison is 4 or 8 bytes per port vs. 36 bytes per port, correct?
> > So, I can't say it's equal, but I leave this to maintainers to decide,
>
> What in my mind now: this is linux rather than RTOS. After greping the
> the arm/arm64/riscv dts dir, the max port number is 6, the berlin2q
> soc families, so this means current we have wasted 216 bytes memory which
> is trivial compared to the system memory.
Maybe, but this should be clarified in the commit message. And again,
I have no strong objection on this part, but it needs to be described
accurately at bare minimum.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 01/16] gpio: dwapb: Use modern PM macros
2025-08-21 19:32 ` Andy Shevchenko
@ 2025-08-22 0:42 ` Jisheng Zhang
0 siblings, 0 replies; 30+ messages in thread
From: Jisheng Zhang @ 2025-08-22 0:42 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Michael Büsch, Doug Berger, Florian Fainelli, Linus Walleij,
Bartosz Golaszewski, Michael Buesch, Hoan Tran, Andy Shevchenko,
Daniel Palmer, Romain Perier, Grygorii Strashko,
Santosh Shilimkar, Kevin Hilman, Robert Jarzmik, Kunihiko Hayashi,
Masami Hiramatsu, Shubhrajyoti Datta, Srinivas Neeli,
Michal Simek, Broadcom internal kernel review list, linux-gpio,
linux-arm-kernel, linux-kernel, linux-omap, linux
On Thu, Aug 21, 2025 at 10:32:01PM +0300, Andy Shevchenko wrote:
> On Thu, Aug 21, 2025 at 8:02 PM Jisheng Zhang <jszhang@kernel.org> wrote:
> > On Wed, Aug 20, 2025 at 10:04:39PM +0300, Andy Shevchenko wrote:
> > > On Wed, Aug 20, 2025 at 8:11 PM Michael Büsch <mb@bues.ch> wrote:
> > > > On Wed, 20 Aug 2025 19:54:44 +0300
> > > > Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
> > > >
> > > > > > The dwapb_context structure is always embedded into struct
> > > > > > dwapb_gpio_port to simplify code. Sure this brings a tiny 36 bytes
> > > > > > data overhead for !CONFIG_PM_SLEP.
> > > > >
> > > > > I don't think it's a good approach to add a lot of data for peanuts in
> > > > > case of PM_SLEEP=n.
> > > >
> > > > It wastes 36 bytes in case of PM=n.
> > >
> > > ...per port.
> > >
> > > > The driver currently allocates the struct with kzalloc and stores a pointer to it
> > > > in case of PM=y.
> > > > So this probably has an overhead in the same order of magnitude (pointer +
> > > > malloc overhead/alignment/fragmentation) in case of PM=y now.
> > >
> > > ...per driver.
> >
> > Before the patch, struct dwapb_context *ctx is also per port.
>
> OK. So the comparison is 4 or 8 bytes per port vs. 36 bytes per port, correct?
yep, I think so
>
> > > So, I can't say it's equal, but I leave this to maintainers to decide,
> >
> > What in my mind now: this is linux rather than RTOS. After greping the
> > the arm/arm64/riscv dts dir, the max port number is 6, the berlin2q
> > soc families, so this means current we have wasted 216 bytes memory which
> > is trivial compared to the system memory.
>
> Maybe, but this should be clarified in the commit message. And again,
> I have no strong objection on this part, but it needs to be described
> accurately at bare minimum.
Good idea, will do in v2.
>
> --
> With Best Regards,
> Andy Shevchenko
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 02/16] gpio: brcmstb: Use modern PM macros
2025-08-20 15:40 ` [PATCH 02/16] gpio: brcmstb: " Jisheng Zhang
@ 2025-08-26 21:47 ` Doug Berger
0 siblings, 0 replies; 30+ messages in thread
From: Doug Berger @ 2025-08-26 21:47 UTC (permalink / raw)
To: Jisheng Zhang, Florian Fainelli, Linus Walleij,
Bartosz Golaszewski, Michael Buesch, Hoan Tran, Andy Shevchenko,
Daniel Palmer, Romain Perier, Grygorii Strashko,
Santosh Shilimkar, Kevin Hilman, Robert Jarzmik, Kunihiko Hayashi,
Masami Hiramatsu, Shubhrajyoti Datta, Srinivas Neeli,
Michal Simek
Cc: Broadcom internal kernel review list, linux-gpio,
linux-arm-kernel, linux-kernel, linux-omap, linux
On 8/20/2025 8:40 AM, Jisheng Zhang wrote:
> Use the modern PM macros for the suspend and resume functions to be
> automatically dropped by the compiler when CONFIG_PM or
> CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
>
> This has the advantage of always compiling these functions in,
> independently of any Kconfig option. Thanks to that, bugs and other
> regressions are subsequently easier to catch.
>
> Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
> ---
> drivers/gpio/gpio-brcmstb.c | 12 +++---------
> 1 file changed, 3 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpio/gpio-brcmstb.c b/drivers/gpio/gpio-brcmstb.c
> index e29a9589b3cc..0ca3e0d8aa46 100644
> --- a/drivers/gpio/gpio-brcmstb.c
> +++ b/drivers/gpio/gpio-brcmstb.c
> @@ -534,7 +534,6 @@ static void brcmstb_gpio_shutdown(struct platform_device *pdev)
> brcmstb_gpio_quiesce(&pdev->dev, false);
> }
>
> -#ifdef CONFIG_PM_SLEEP
> static void brcmstb_gpio_bank_restore(struct brcmstb_gpio_priv *priv,
> struct brcmstb_gpio_bank *bank)
> {
> @@ -573,14 +572,9 @@ static int brcmstb_gpio_resume(struct device *dev)
> return 0;
> }
>
> -#else
> -#define brcmstb_gpio_suspend NULL
> -#define brcmstb_gpio_resume NULL
> -#endif /* CONFIG_PM_SLEEP */
> -
> static const struct dev_pm_ops brcmstb_gpio_pm_ops = {
> - .suspend_noirq = brcmstb_gpio_suspend,
> - .resume_noirq = brcmstb_gpio_resume,
> + .suspend_noirq = pm_sleep_ptr(brcmstb_gpio_suspend),
> + .resume_noirq = pm_sleep_ptr(brcmstb_gpio_resume),
> };
>
> static int brcmstb_gpio_probe(struct platform_device *pdev)
> @@ -747,7 +741,7 @@ static struct platform_driver brcmstb_gpio_driver = {
> .driver = {
> .name = "brcmstb-gpio",
> .of_match_table = brcmstb_gpio_of_match,
> - .pm = &brcmstb_gpio_pm_ops,
> + .pm = pm_sleep_ptr(&brcmstb_gpio_pm_ops),
> },
> .probe = brcmstb_gpio_probe,
> .remove = brcmstb_gpio_remove,
Acked-by: Doug Berger <opendmb@gmail.com>
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH 00/16] gpio: Use modern PM macros
2025-08-20 15:40 [PATCH 00/16] gpio: Use modern PM macros Jisheng Zhang
` (15 preceding siblings ...)
2025-08-20 15:40 ` [PATCH 16/16] gpio: zynq: " Jisheng Zhang
@ 2025-08-28 13:39 ` Bartosz Golaszewski
16 siblings, 0 replies; 30+ messages in thread
From: Bartosz Golaszewski @ 2025-08-28 13:39 UTC (permalink / raw)
To: Jisheng Zhang
Cc: Doug Berger, Florian Fainelli, Linus Walleij, Michael Buesch,
Hoan Tran, Andy Shevchenko, Daniel Palmer, Romain Perier,
Grygorii Strashko, Santosh Shilimkar, Kevin Hilman,
Robert Jarzmik, Kunihiko Hayashi, Masami Hiramatsu,
Shubhrajyoti Datta, Srinivas Neeli, Michal Simek,
Broadcom internal kernel review list, linux-gpio,
linux-arm-kernel, linux-kernel, linux-omap, linux
On Wed, Aug 20, 2025 at 5:58 PM Jisheng Zhang <jszhang@kernel.org> wrote:
>
> Use the modern PM macros for the suspend and resume functions to be
> automatically dropped by the compiler when CONFIG_PM or
> CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards or
> __maybe_unused.
>
> This has the advantage of always compiling these functions in,
> independently of any Kconfig option. Thanks to that, bugs and other
> regressions are subsequently easier to catch.
>
> Almost all drivers are converted, only gpio-tegra and gpio-mlxbf are
> left as is, because the memory for saving HW context is not trivial,
> if we convert them, then the two drivers' users may complain for
> !CONFIG_PM && !CONFIG_PM_SLEEP case. So I didn't touch them.
>
> patch to gpio-dwapb.c is tested on real HW, others are compile-tested only.
>
This doesn't apply on top of my gpio/for-next branch, can you rebase
and resend please?
Bart
^ permalink raw reply [flat|nested] 30+ messages in thread
end of thread, other threads:[~2025-08-28 17:27 UTC | newest]
Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-20 15:40 [PATCH 00/16] gpio: Use modern PM macros Jisheng Zhang
2025-08-20 15:40 ` [PATCH 01/16] gpio: dwapb: " Jisheng Zhang
2025-08-20 16:54 ` Andy Shevchenko
2025-08-20 17:10 ` Michael Büsch
2025-08-20 19:04 ` Andy Shevchenko
2025-08-21 16:44 ` Jisheng Zhang
2025-08-21 19:32 ` Andy Shevchenko
2025-08-22 0:42 ` Jisheng Zhang
2025-08-20 15:40 ` [PATCH 02/16] gpio: brcmstb: " Jisheng Zhang
2025-08-26 21:47 ` Doug Berger
2025-08-20 15:40 ` [PATCH 03/16] gpio: bt8xx: " Jisheng Zhang
2025-08-20 17:08 ` Michael Büsch
2025-08-20 15:40 ` [PATCH 04/16] gpio: htc-egpio: " Jisheng Zhang
2025-08-20 15:40 ` [PATCH 05/16] gpio: pl061: " Jisheng Zhang
2025-08-21 11:52 ` Linus Walleij
2025-08-21 12:50 ` Andy Shevchenko
2025-08-20 15:40 ` [PATCH 06/16] gpio: pxa: " Jisheng Zhang
2025-08-20 15:40 ` [PATCH 07/16] gpio: ml-ioh: " Jisheng Zhang
2025-08-20 16:56 ` Andy Shevchenko
2025-08-20 15:40 ` [PATCH 08/16] gpio: mlxbf2: " Jisheng Zhang
2025-08-20 15:40 ` [PATCH 09/16] gpio: msc313: " Jisheng Zhang
2025-08-20 15:40 ` [PATCH 10/16] gpio: omap: " Jisheng Zhang
2025-08-20 15:40 ` [PATCH 11/16] gpio: pch: " Jisheng Zhang
2025-08-20 16:55 ` Andy Shevchenko
2025-08-20 15:40 ` [PATCH 12/16] gpio: tqmx86: " Jisheng Zhang
2025-08-20 15:40 ` [PATCH 13/16] gpio: uniphier: " Jisheng Zhang
2025-08-20 15:40 ` [PATCH 14/16] gpio: xgene: " Jisheng Zhang
2025-08-20 15:40 ` [PATCH 15/16] gpio: xilinx: " Jisheng Zhang
2025-08-20 15:40 ` [PATCH 16/16] gpio: zynq: " Jisheng Zhang
2025-08-28 13:39 ` [PATCH 00/16] gpio: " Bartosz Golaszewski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).