AHCI power management cleanup
Subsystems (8)
cover AHCI power management cleanup
Several AHCI drivers expose suspend/resume functions in a way that can be simplified. Using pre-processor operation can lead to errors, while relying on automatic kernel configuration is safer. It also shrinks the kernel size when CONFIG_PM_SLEEP is not used[1].
This has been compile-tested on x86, arm and arm64.
[1] https://lore.kernel.org/lkml/[email protected]/
---
Raphael Gallais-Pou (14):
ahci: brcm: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
ahci: ceva: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
ahci: da850: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
ahci: dm816: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
ahci: imx: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
ahci: mtk: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
ahci: platform: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
ahci: qoriq: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
ahci: seattle: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
ahci: sunxi: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
ahci: pata_arasan_cf: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
ahci: pata_imx: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
ahci: sata_highbank: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
ahci: sata_rcar: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
drivers/ata/ahci_brcm.c | 6 +++--- drivers/ata/ahci_ceva.c | 8 ++++---- drivers/ata/ahci_da850.c | 7 ++++--- drivers/ata/ahci_dm816.c | 8 ++++---- drivers/ata/ahci_imx.c | 6 ++---- drivers/ata/ahci_mtk.c | 7 ++++--- drivers/ata/ahci_platform.c | 7 ++++--- drivers/ata/ahci_qoriq.c | 9 ++++----- drivers/ata/ahci_seattle.c | 7 ++++--- drivers/ata/ahci_sunxi.c | 9 ++++----- drivers/ata/pata_arasan_cf.c | 6 ++---- drivers/ata/pata_imx.c | 6 ++---- drivers/ata/sata_highbank.c | 9 ++++----- drivers/ata/sata_rcar.c | 6 +----- 14 files changed, 46 insertions(+), 55 deletions(-)
---
base-commit: 5ffa57f6eecefababb8cbe327222ef171943b183
change-id: 20250113-pm_ata-dbc07b3b0df3
Best regards,
Signature · 1 line
Raphael Gallais-Pou <[email protected]>
RFC PATCH 1/14 ahci: brcm: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
Letting the compiler remove these functions when the kernel is built without CONFIG_PM_SLEEP support is simpler and less error prone than the use of #ifdef based kernel configuration guards.
--- drivers/ata/ahci_brcm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/ata/ahci_brcm.c +3 -3
@@ -362,7 +362,7 @@ static int brcm_ahci_suspend(struct device *dev)return ret; } -static int __maybe_unused brcm_ahci_resume (struct device *dev) +static int brcm_ahci_resume (struct device *dev) {struct ata_host *host =dev_get_drvdata (dev);struct ahci_host_priv *hpriv = host->private_data;
@@ -570,7 +570,7 @@ static void brcm_ahci_shutdown(struct platform_device *pdev)dev_err (&pdev->dev,"failed to shutdown\n" ); } -static SIMPLE_DEV_PM_OPS(ahci_brcm_pm_ops, brcm_ahci_suspend, brcm_ahci_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(ahci_brcm_pm_ops, brcm_ahci_suspend, brcm_ahci_resume);static struct platform_driver brcm_ahci_driver = { .probe = brcm_ahci_probe,
@@ -579,7 +579,7 @@ static struct platform_driver brcm_ahci_driver = { .driver = { .name = DRV_NAME, .of_match_table = ahci_of_match, - .pm = &ahci_brcm_pm_ops, + .pm = pm_sleep_ptr(&ahci_brcm_pm_ops), }, };module_platform_driver (brcm_ahci_driver);
Signature · 1 line
2.48.0
RFC PATCH 2/14 ahci: ceva: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
In reply to Raphael Gallais-PouLetting the compiler remove these functions when the kernel is built without CONFIG_PM_SLEEP support is simpler and less error prone than the use of #ifdef based kernel configuration guards.
--- drivers/ata/ahci_ceva.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/ata/ahci_ceva.c +4 -4
@@ -363,12 +363,12 @@ static int ceva_ahci_probe(struct platform_device *pdev)return rc; } -static int __maybe_unused ceva_ahci_suspend (struct device *dev) +static int ceva_ahci_suspend (struct device *dev) {return ahci_platform_suspend (dev); } -static int __maybe_unused ceva_ahci_resume (struct device *dev) +static int ceva_ahci_resume (struct device *dev) {struct ata_host *host =dev_get_drvdata (dev);struct ahci_host_priv *hpriv = host->private_data;
@@ -398,7 +398,7 @@ static int __maybe_unused ceva_ahci_resume(struct device *dev)return rc; } -static SIMPLE_DEV_PM_OPS(ahci_ceva_pm_ops, ceva_ahci_suspend, ceva_ahci_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(ahci_ceva_pm_ops, ceva_ahci_suspend, ceva_ahci_resume);static const struct of_device_id ceva_ahci_of_match[] = { { .compatible ="ceva,ahci-1v84" },
@@ -412,7 +412,7 @@ static struct platform_driver ceva_ahci_driver = { .driver = { .name = DRV_NAME, .of_match_table = ceva_ahci_of_match, - .pm = &ahci_ceva_pm_ops, + .pm = pm_sleep_ptr(&ahci_ceva_pm_ops), }, };module_platform_driver (ceva_ahci_driver);
Signature · 1 line
2.48.0
RFC PATCH 3/14 ahci: da850: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
In reply to Raphael Gallais-PouLetting the compiler remove these functions when the kernel is built without CONFIG_PM_SLEEP support is simpler and less error prone than the use of #ifdef based kernel configuration guards.
--- drivers/ata/ahci_da850.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/ata/ahci_da850.c +4 -3
@@ -227,8 +227,9 @@ static int ahci_da850_probe(struct platform_device *pdev)return rc; } -static SIMPLE_DEV_PM_OPS(ahci_da850_pm_ops, ahci_platform_suspend, - ahci_platform_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(ahci_da850_pm_ops, + ahci_platform_suspend, + ahci_platform_resume);static const struct of_device_id ahci_da850_of_match[] = { { .compatible ="ti,da850-ahci" , },
@@ -242,7 +243,7 @@ static struct platform_driver ahci_da850_driver = { .driver = { .name = DRV_NAME, .of_match_table = ahci_da850_of_match, - .pm = &ahci_da850_pm_ops, + .pm = pm_sleep_ptr(&ahci_da850_pm_ops), }, };module_platform_driver (ahci_da850_driver);
Signature · 1 line
2.48.0
RFC PATCH 4/14 ahci: dm816: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
In reply to Raphael Gallais-PouLetting the compiler remove these functions when the kernel is built without CONFIG_PM_SLEEP support is simpler and less error prone than the use of #ifdef based kernel configuration guards.
--- drivers/ata/ahci_dm816.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/ata/ahci_dm816.c +4 -4
@@ -170,9 +170,9 @@ static int ahci_dm816_probe(struct platform_device *pdev)return rc; } -static SIMPLE_DEV_PM_OPS(ahci_dm816_pm_ops, - ahci_platform_suspend, - ahci_platform_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(ahci_dm816_pm_ops, + ahci_platform_suspend, + ahci_platform_resume);static const struct of_device_id ahci_dm816_of_match[] = { { .compatible ="ti,dm816-ahci" , },
@@ -186,7 +186,7 @@ static struct platform_driver ahci_dm816_driver = { .driver = { .name = AHCI_DM816_DRV_NAME, .of_match_table = ahci_dm816_of_match, - .pm = &ahci_dm816_pm_ops, + .pm = pm_sleep_ptr(&ahci_dm816_pm_ops), }, };module_platform_driver (ahci_dm816_driver);
Signature · 1 line
2.48.0
RFC PATCH 5/14 ahci: imx: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
In reply to Raphael Gallais-PouLetting the compiler remove these functions when the kernel is built without CONFIG_PM_SLEEP support is simpler and less error prone than the use of #ifdef based kernel configuration guards.
--- drivers/ata/ahci_imx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/ata/ahci_imx.c +2 -4
@@ -993,7 +993,6 @@ static void ahci_imx_host_stop(struct ata_host *host)clk_disable_unprepare (imxpriv->sata_clk); } -#ifdef CONFIG_PM_SLEEP static int imx_ahci_suspend (struct device *dev) {struct ata_host *host =dev_get_drvdata (dev);
@@ -1021,9 +1020,8 @@ static int imx_ahci_resume(struct device *dev)return ahci_platform_resume_host (dev); } -#endif -static SIMPLE_DEV_PM_OPS(ahci_imx_pm_ops, imx_ahci_suspend, imx_ahci_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(ahci_imx_pm_ops, imx_ahci_suspend, imx_ahci_resume);static struct platform_driver imx_ahci_driver = { .probe = imx_ahci_probe,
@@ -1031,7 +1029,7 @@ static struct platform_driver imx_ahci_driver = { .driver = { .name = DRV_NAME, .of_match_table = imx_ahci_of_match, - .pm = &ahci_imx_pm_ops, + .pm = pm_sleep_ptr(&ahci_imx_pm_ops), }, };module_platform_driver (imx_ahci_driver);
Signature · 1 line
2.48.0
Re: [PATCH RFC 05/14] ahci: imx: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
Quoted 5 lines · Raphael Gallais-Pou
Letting the compiler remove these functions when the kernel is built without
CONFIG_PM_SLEEPsupport is simpler and less error prone than the use of #ifdef based kernel configuration guards.Signed-off-by Raphael Gallais-Pou <[email protected]>
Quoted 40 lines
--- drivers/ata/ahci_imx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)drivers/ata/ahci_imx.c +2
-5@@ -993,7 +993,6 @@ static void ahci_imx_host_stop(struct ata_host *host)clk_disable_unprepare (imxpriv->sata_clk); } -#ifdef CONFIG_PM_SLEEP static int imx_ahci_suspend (struct device *dev) {struct ata_host *host =dev_get_drvdata (dev);@@ -1021,9 +1020,8 @@ static int imx_ahci_resume(struct device *dev)return ahci_platform_resume_host (dev); } -#endif -static SIMPLE_DEV_PM_OPS(ahci_imx_pm_ops, imx_ahci_suspend, imx_ahci_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(ahci_imx_pm_ops, imx_ahci_suspend, imx_ahci_resume);static struct platform_driver imx_ahci_driver = { .probe = imx_ahci_probe,@@ -1031,7 +1029,7 @@ static struct platform_driver imx_ahci_driver = { .driver = { .name = DRV_NAME, .of_match_table = imx_ahci_of_match, - .pm = &ahci_imx_pm_ops, + .pm = pm_sleep_ptr(&ahci_imx_pm_ops), }, };module_platform_driver (imx_ahci_driver); --2.48.0
RFC PATCH 6/14 ahci: mtk: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
In reply to Raphael Gallais-PouLetting the compiler remove these functions when the kernel is built without CONFIG_PM_SLEEP support is simpler and less error prone than the use of #ifdef based kernel configuration guards.
--- drivers/ata/ahci_mtk.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/ata/ahci_mtk.c +4 -3
@@ -163,8 +163,9 @@ static int mtk_ahci_probe(struct platform_device *pdev)return err; } -static SIMPLE_DEV_PM_OPS(ahci_pm_ops, ahci_platform_suspend, - ahci_platform_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(ahci_pm_ops, + ahci_platform_suspend, + ahci_platform_resume);static const struct of_device_id ahci_of_match[] = { { .compatible ="mediatek,mtk-ahci" , },
@@ -178,7 +179,7 @@ static struct platform_driver mtk_ahci_driver = { .driver = { .name = DRV_NAME, .of_match_table = ahci_of_match, - .pm = &ahci_pm_ops, + .pm = pm_sleep_ptr(&ahci_pm_ops), }, };module_platform_driver (mtk_ahci_driver);
Signature · 1 line
2.48.0
RFC PATCH 7/14 ahci: platform: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
In reply to Raphael Gallais-PouLetting the compiler remove these functions when the kernel is built without CONFIG_PM_SLEEP support is simpler and less error prone than the use of #ifdef based kernel configuration guards.
--- drivers/ata/ahci_platform.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/ata/ahci_platform.c +4 -3
@@ -74,8 +74,9 @@ static int ahci_probe(struct platform_device *pdev)return rc; } -static SIMPLE_DEV_PM_OPS(ahci_pm_ops, ahci_platform_suspend, - ahci_platform_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(ahci_pm_ops, + ahci_platform_suspend, + ahci_platform_resume);static const struct of_device_id ahci_of_match[] = { { .compatible ="generic-ahci" , },
@@ -102,7 +103,7 @@ static struct platform_driver ahci_driver = { .name = DRV_NAME, .of_match_table = ahci_of_match, .acpi_match_table = ahci_acpi_match, - .pm = &ahci_pm_ops, + .pm = pm_sleep_ptr(&ahci_pm_ops), }, };module_platform_driver (ahci_driver);
Signature · 1 line
2.48.0
RFC PATCH 8/14 ahci: qoriq: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
In reply to Raphael Gallais-PouLetting the compiler remove these functions when the kernel is built without CONFIG_PM_SLEEP support is simpler and less error prone than the use of #ifdef based kernel configuration guards.
--- drivers/ata/ahci_qoriq.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/ata/ahci_qoriq.c +4 -5
@@ -319,7 +319,6 @@ static int ahci_qoriq_probe(struct platform_device *pdev)return rc; } -#ifdef CONFIG_PM_SLEEP static int ahci_qoriq_resume (struct device *dev) {struct ata_host *host =dev_get_drvdata (dev);
@@ -350,10 +349,10 @@ static int ahci_qoriq_resume(struct device *dev)return rc; } -#endif -static SIMPLE_DEV_PM_OPS(ahci_qoriq_pm_ops, ahci_platform_suspend, - ahci_qoriq_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(ahci_qoriq_pm_ops, + ahci_platform_suspend, + ahci_qoriq_resume);static struct platform_driver ahci_qoriq_driver = { .probe = ahci_qoriq_probe,
@@ -362,7 +361,7 @@ static struct platform_driver ahci_qoriq_driver = { .name = DRV_NAME, .of_match_table = ahci_qoriq_of_match, .acpi_match_table = ahci_qoriq_acpi_match, - .pm = &ahci_qoriq_pm_ops, + .pm = pm_sleep_ptr(&ahci_qoriq_pm_ops), }, };module_platform_driver (ahci_qoriq_driver);
Signature · 1 line
2.48.0
RFC PATCH 9/14 ahci: seattle: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
In reply to Raphael Gallais-PouLetting the compiler remove these functions when the kernel is built without CONFIG_PM_SLEEP support is simpler and less error prone than the use of #ifdef based kernel configuration guards.
--- drivers/ata/ahci_seattle.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/ata/ahci_seattle.c +4 -3
@@ -174,8 +174,9 @@ static int ahci_seattle_probe(struct platform_device *pdev)return rc; } -static SIMPLE_DEV_PM_OPS(ahci_pm_ops, ahci_platform_suspend, - ahci_platform_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(ahci_pm_ops, + ahci_platform_suspend, + ahci_platform_resume);static const struct acpi_device_id ahci_acpi_match[] = { {"AMDI0600" ,0 },
@@ -189,7 +190,7 @@ static struct platform_driver ahci_seattle_driver = { .driver = { .name = DRV_NAME, .acpi_match_table = ahci_acpi_match, - .pm = &ahci_pm_ops, + .pm = pm_sleep_ptr(&ahci_pm_ops), }, };module_platform_driver (ahci_seattle_driver);
Signature · 1 line
2.48.0
RFC PATCH 10/14 ahci: sunxi: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
In reply to Raphael Gallais-PouLetting the compiler remove these functions when the kernel is built without CONFIG_PM_SLEEP support is simpler and less error prone than the use of #ifdef based kernel configuration guards.
--- drivers/ata/ahci_sunxi.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/ata/ahci_sunxi.c +4 -5
@@ -253,7 +253,6 @@ static int ahci_sunxi_probe(struct platform_device *pdev)return rc; } -#ifdef CONFIG_PM_SLEEP static int ahci_sunxi_resume (struct device *dev) {struct ata_host *host =dev_get_drvdata (dev);
@@ -278,10 +277,10 @@ static int ahci_sunxi_resume(struct device *dev)ahci_platform_disable_resources (hpriv);return rc; } -#endif -static SIMPLE_DEV_PM_OPS(ahci_sunxi_pm_ops, ahci_platform_suspend, - ahci_sunxi_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(ahci_sunxi_pm_ops, + ahci_platform_suspend, + ahci_sunxi_resume);static const struct of_device_id ahci_sunxi_of_match[] = { { .compatible ="allwinner,sun4i-a10-ahci" , },
@@ -296,7 +295,7 @@ static struct platform_driver ahci_sunxi_driver = { .driver = { .name = DRV_NAME, .of_match_table = ahci_sunxi_of_match, - .pm = &ahci_sunxi_pm_ops, + .pm = pm_sleep_ptr(&ahci_sunxi_pm_ops), }, };module_platform_driver (ahci_sunxi_driver);
Signature · 1 line
2.48.0
Re: [PATCH RFC 10/14] ahci: sunxi: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
Dne ponedeljek, 27. januar 2025 ob 13:46:05 Srednjeevropski standardni čas je Raphael Gallais-Pou napisal(a):
Quoted 5 lines
Letting the compiler remove these functions when the kernel is built without
CONFIG_PM_SLEEPsupport is simpler and less error prone than the use of #ifdef based kernel configuration guards.Signed-off-by Raphael Gallais-Pou <[email protected]>
Best regards,
Jernej
RFC PATCH 11/14 ahci: pata_arasan_cf: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
In reply to Raphael Gallais-PouLetting the compiler remove these functions when the kernel is built without CONFIG_PM_SLEEP support is simpler and less error prone than the use of #ifdef based kernel configuration guards.
--- drivers/ata/pata_arasan_cf.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/ata/pata_arasan_cf.c +2 -4
@@ -926,7 +926,6 @@ static void arasan_cf_remove(struct platform_device *pdev)cf_exit (acdev); } -#ifdef CONFIG_PM_SLEEP static int arasan_cf_suspend (struct device *dev) {struct ata_host *host =dev_get_drvdata (dev);
@@ -950,9 +949,8 @@ static int arasan_cf_resume(struct device *dev)return 0 ; } -#endif -static SIMPLE_DEV_PM_OPS(arasan_cf_pm_ops, arasan_cf_suspend, arasan_cf_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(arasan_cf_pm_ops, arasan_cf_suspend, arasan_cf_resume);#ifdef CONFIG_OF static const struct of_device_id arasan_cf_id_table[] = {
@@ -967,7 +965,7 @@ static struct platform_driver arasan_cf_driver = { .remove = arasan_cf_remove, .driver = { .name = DRIVER_NAME, - .pm = &arasan_cf_pm_ops, + .pm = pm_sleep_ptr(&arasan_cf_pm_ops), .of_match_table = of_match_ptr(arasan_cf_id_table), }, };
Signature · 1 line
2.48.0
kernel test robot
build botRe: [PATCH RFC 11/14] ahci: pata_arasan_cf: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
kernel test robot noticed the following build errors:
Hi Raphael,
[This is a private test report for your RFC patch.] kernel test robot noticed the following build errors:
[auto build test ERROR on 5ffa57f6eecefababb8cbe327222ef171943b183]
url: https://github.com/intel-lab-lkp/linux/commits/Raphael-Gallais-Pou/ahci-brcm-Switch-from-CONFIG_PM_SLEEP-guards-to-pm_sleep_ptr/20250127-205128 base: 5ffa57f6eecefababb8cbe327222ef171943b183 patch link: https://lore.kernel.org/r/20250127-pm_ata-v1-11-f8f50c821a2a%40gmail.com patch subject: [PATCH RFC 11/14] ahci: pata_arasan_cf: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20250128/[email protected]/config) compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250128/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>):
In file included from drivers/ata/pata_arasan_cf.c:28:
In file included from include/linux/dmaengine.h:8:
In file included from include/linux/device.h:32:
In file included from include/linux/device/driver.h:21:
In file included from include/linux/module.h:19:
In file included from include/linux/elf.h:6:
In file included from arch/s390/include/asm/elf.h:181:
In file included from arch/s390/include/asm/mmu_context.h:11:
In file included from arch/s390/include/asm/pgalloc.h:18:
In file included from include/linux/mm.h:2224:
include/linux/vmstat.h:504:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
504 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
505 | item];
| ~~~~
include/linux/vmstat.h:511:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
511 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
512 | NR_VM_NUMA_EVENT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~~
include/linux/vmstat.h:524:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
524 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
525 | NR_VM_NUMA_EVENT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~~
>> drivers/ata/pata_arasan_cf.c:938:2: error: call to undeclared function 'ata_host_suspend'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
938 | ata_host_suspend(host, PMSG_SUSPEND);
| ^
>> drivers/ata/pata_arasan_cf.c:948:2: error: call to undeclared function 'ata_host_resume'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
948 | ata_host_resume(host);
| ^3 warnings and 2 errors generated.
vim +/ata_host_suspend +938 drivers/ata/pata_arasan_cf.c
a480167b23ef9b3 Viresh Kumar 2011-02-22 928
a480167b23ef9b3 Viresh Kumar 2011-02-22 929 static int arasan_cf_suspend(struct device *dev)
a480167b23ef9b3 Viresh Kumar 2011-02-22 930 {
90f0adf0936d464 Sergei Shtylyov 2011-10-12 931 struct ata_host *host = dev_get_drvdata(dev);
a480167b23ef9b3 Viresh Kumar 2011-02-22 932 struct arasan_cf_dev *acdev = host->ports[0]->private_data;
a480167b23ef9b3 Viresh Kumar 2011-02-22 933
40679b3ce9d993e Viresh Kumar 2012-02-23 934 if (acdev->dma_chan)
72b2caff4aac451 Vinod Koul 2014-10-11 935 dmaengine_terminate_all(acdev->dma_chan);
40679b3ce9d993e Viresh Kumar 2012-02-23 936
a480167b23ef9b3 Viresh Kumar 2011-02-22 937 cf_exit(acdev);
ec87cf3782f7b05 Sergey Shtylyov 2022-02-02 @938 ata_host_suspend(host, PMSG_SUSPEND);
ec87cf3782f7b05 Sergey Shtylyov 2022-02-02 939 return 0;
a480167b23ef9b3 Viresh Kumar 2011-02-22 940 }
a480167b23ef9b3 Viresh Kumar 2011-02-22 941
a480167b23ef9b3 Viresh Kumar 2011-02-22 942 static int arasan_cf_resume(struct device *dev)
a480167b23ef9b3 Viresh Kumar 2011-02-22 943 {
90f0adf0936d464 Sergei Shtylyov 2011-10-12 944 struct ata_host *host = dev_get_drvdata(dev);
a480167b23ef9b3 Viresh Kumar 2011-02-22 945 struct arasan_cf_dev *acdev = host->ports[0]->private_data;
a480167b23ef9b3 Viresh Kumar 2011-02-22 946
a480167b23ef9b3 Viresh Kumar 2011-02-22 947 cf_init(acdev);
a480167b23ef9b3 Viresh Kumar 2011-02-22 @948 ata_host_resume(host);
a480167b23ef9b3 Viresh Kumar 2011-02-22 949
a480167b23ef9b3 Viresh Kumar 2011-02-22 950 return 0;
a480167b23ef9b3 Viresh Kumar 2011-02-22 951 }
a480167b23ef9b3 Viresh Kumar 2011-02-22 952 Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
kernel test robot
build botRe: [PATCH RFC 11/14] ahci: pata_arasan_cf: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
In reply to Raphael Gallais-Poukernel test robot noticed the following build errors:
Hi Raphael,
[This is a private test report for your RFC patch.] kernel test robot noticed the following build errors:
[auto build test ERROR on 5ffa57f6eecefababb8cbe327222ef171943b183]
url: https://github.com/intel-lab-lkp/linux/commits/Raphael-Gallais-Pou/ahci-brcm-Switch-from-CONFIG_PM_SLEEP-guards-to-pm_sleep_ptr/20250127-205128 base: 5ffa57f6eecefababb8cbe327222ef171943b183 patch link: https://lore.kernel.org/r/20250127-pm_ata-v1-11-f8f50c821a2a%40gmail.com patch subject: [PATCH RFC 11/14] ahci: pata_arasan_cf: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() config: s390-allyesconfig (https://download.01.org/0day-ci/archive/20250128/[email protected]/config) compiler: s390-linux-gcc (GCC) 14.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250128/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>):
drivers/ata/pata_arasan_cf.c: In function 'arasan_cf_suspend':
>> drivers/ata/pata_arasan_cf.c:938:9: error: implicit declaration of function 'ata_host_suspend'; did you mean 'ata_sas_port_suspend'? [-Wimplicit-function-declaration]
938 | ata_host_suspend(host, PMSG_SUSPEND);
| ^~~~~~~~~~~~~~~~
| ata_sas_port_suspend
drivers/ata/pata_arasan_cf.c: In function 'arasan_cf_resume':
>> drivers/ata/pata_arasan_cf.c:948:9: error: implicit declaration of function 'ata_host_resume'; did you mean 'sata_link_resume'? [-Wimplicit-function-declaration]
948 | ata_host_resume(host);
| ^~~~~~~~~~~~~~~
| sata_link_resumevim +938 drivers/ata/pata_arasan_cf.c
a480167b23ef9b Viresh Kumar 2011-02-22 928
a480167b23ef9b Viresh Kumar 2011-02-22 929 static int arasan_cf_suspend(struct device *dev)
a480167b23ef9b Viresh Kumar 2011-02-22 930 {
90f0adf0936d46 Sergei Shtylyov 2011-10-12 931 struct ata_host *host = dev_get_drvdata(dev);
a480167b23ef9b Viresh Kumar 2011-02-22 932 struct arasan_cf_dev *acdev = host->ports[0]->private_data;
a480167b23ef9b Viresh Kumar 2011-02-22 933
40679b3ce9d993 Viresh Kumar 2012-02-23 934 if (acdev->dma_chan)
72b2caff4aac45 Vinod Koul 2014-10-11 935 dmaengine_terminate_all(acdev->dma_chan);
40679b3ce9d993 Viresh Kumar 2012-02-23 936
a480167b23ef9b Viresh Kumar 2011-02-22 937 cf_exit(acdev);
ec87cf3782f7b0 Sergey Shtylyov 2022-02-02 @938 ata_host_suspend(host, PMSG_SUSPEND);
ec87cf3782f7b0 Sergey Shtylyov 2022-02-02 939 return 0;
a480167b23ef9b Viresh Kumar 2011-02-22 940 }
a480167b23ef9b Viresh Kumar 2011-02-22 941
a480167b23ef9b Viresh Kumar 2011-02-22 942 static int arasan_cf_resume(struct device *dev)
a480167b23ef9b Viresh Kumar 2011-02-22 943 {
90f0adf0936d46 Sergei Shtylyov 2011-10-12 944 struct ata_host *host = dev_get_drvdata(dev);
a480167b23ef9b Viresh Kumar 2011-02-22 945 struct arasan_cf_dev *acdev = host->ports[0]->private_data;
a480167b23ef9b Viresh Kumar 2011-02-22 946
a480167b23ef9b Viresh Kumar 2011-02-22 947 cf_init(acdev);
a480167b23ef9b Viresh Kumar 2011-02-22 @948 ata_host_resume(host);
a480167b23ef9b Viresh Kumar 2011-02-22 949
a480167b23ef9b Viresh Kumar 2011-02-22 950 return 0;
a480167b23ef9b Viresh Kumar 2011-02-22 951 }
a480167b23ef9b Viresh Kumar 2011-02-22 952 Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
RFC PATCH 12/14 ahci: pata_imx: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
In reply to Raphael Gallais-PouLetting the compiler remove these functions when the kernel is built without CONFIG_PM_SLEEP support is simpler and less error prone than the use of #ifdef based kernel configuration guards.
--- drivers/ata/pata_imx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/ata/pata_imx.c +2 -4
@@ -201,7 +201,6 @@ static void pata_imx_remove(struct platform_device *pdev)__raw_writel (0 , priv->host_regs +PATA_IMX_ATA_INT_EN ); } -#ifdef CONFIG_PM_SLEEP static int pata_imx_suspend (struct device *dev) {struct ata_host *host =dev_get_drvdata (dev);
@@ -234,9 +233,8 @@ static int pata_imx_resume(struct device *dev)return 0 ; } -#endif -static SIMPLE_DEV_PM_OPS(pata_imx_pm_ops, pata_imx_suspend, pata_imx_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(pata_imx_pm_ops, pata_imx_suspend, pata_imx_resume);static const struct of_device_id imx_pata_dt_ids[] = { {
@@ -253,7 +251,7 @@ static struct platform_driver pata_imx_driver = { .driver = { .name = DRV_NAME, .of_match_table = imx_pata_dt_ids, - .pm = &pata_imx_pm_ops, + .pm = pm_sleep_ptr(&pata_imx_pm_ops), }, };
Signature · 1 line
2.48.0
RFC PATCH 13/14 ahci: sata_highbank: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
In reply to Raphael Gallais-PouLetting the compiler remove these functions when the kernel is built without CONFIG_PM_SLEEP support is simpler and less error prone than the use of #ifdef based kernel configuration guards.
--- drivers/ata/sata_highbank.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/ata/sata_highbank.c +4 -5
@@ -565,7 +565,6 @@ static int ahci_highbank_probe(struct platform_device *pdev)return rc; } -#ifdef CONFIG_PM_SLEEP static int ahci_highbank_suspend (struct device *dev) {struct ata_host *host =dev_get_drvdata (dev);
@@ -609,17 +608,17 @@ static int ahci_highbank_resume(struct device *dev)return 0 ; } -#endif -static SIMPLE_DEV_PM_OPS(ahci_highbank_pm_ops, - ahci_highbank_suspend, ahci_highbank_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(ahci_highbank_pm_ops, + ahci_highbank_suspend, + ahci_highbank_resume);static struct platform_driver ahci_highbank_driver = { .remove = ata_platform_remove_one, .driver = { .name ="highbank-ahci" , .of_match_table = ahci_of_match, - .pm = &ahci_highbank_pm_ops, + .pm =pm_sleep_ptr (&ahci_highbank_pm_ops), }, .probe = ahci_highbank_probe, };
Signature · 1 line
2.48.0
kernel test robot
build botRe: [PATCH RFC 13/14] ahci: sata_highbank: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
kernel test robot noticed the following build errors:
Hi Raphael,
[This is a private test report for your RFC patch.] kernel test robot noticed the following build errors:
[auto build test ERROR on 5ffa57f6eecefababb8cbe327222ef171943b183]
url: https://github.com/intel-lab-lkp/linux/commits/Raphael-Gallais-Pou/ahci-brcm-Switch-from-CONFIG_PM_SLEEP-guards-to-pm_sleep_ptr/20250127-205128 base: 5ffa57f6eecefababb8cbe327222ef171943b183 patch link: https://lore.kernel.org/r/20250127-pm_ata-v1-13-f8f50c821a2a%40gmail.com patch subject: [PATCH RFC 13/14] ahci: sata_highbank: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() config: csky-randconfig-002-20250127 (https://download.01.org/0day-ci/archive/20250127/[email protected]/config) compiler: csky-linux-gcc (GCC) 14.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250127/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
All errors (new ones prefixed by >>):
drivers/ata/sata_highbank.c: In function 'ahci_highbank_suspend':
>> drivers/ata/sata_highbank.c:590:9: error: implicit declaration of function 'ata_host_suspend'; did you mean 'ata_sas_port_suspend'? [-Wimplicit-function-declaration]
590 | ata_host_suspend(host, PMSG_SUSPEND);
| ^~~~~~~~~~~~~~~~
| ata_sas_port_suspend
drivers/ata/sata_highbank.c: In function 'ahci_highbank_resume':
>> drivers/ata/sata_highbank.c:607:9: error: implicit declaration of function 'ata_host_resume'; did you mean 'ahci_port_resume'? [-Wimplicit-function-declaration]
607 | ata_host_resume(host);
| ^~~~~~~~~~~~~~~
| ahci_port_resumevim +590 drivers/ata/sata_highbank.c
8996b89d6bc98ae Mark Langsdorf 2012-09-06 567
8996b89d6bc98ae Mark Langsdorf 2012-09-06 568 static int ahci_highbank_suspend(struct device *dev)
8996b89d6bc98ae Mark Langsdorf 2012-09-06 569 {
8996b89d6bc98ae Mark Langsdorf 2012-09-06 570 struct ata_host *host = dev_get_drvdata(dev);
8996b89d6bc98ae Mark Langsdorf 2012-09-06 571 struct ahci_host_priv *hpriv = host->private_data;
8996b89d6bc98ae Mark Langsdorf 2012-09-06 572 void __iomem *mmio = hpriv->mmio;
8996b89d6bc98ae Mark Langsdorf 2012-09-06 573 u32 ctl;
8996b89d6bc98ae Mark Langsdorf 2012-09-06 574
8996b89d6bc98ae Mark Langsdorf 2012-09-06 575 if (hpriv->flags & AHCI_HFLAG_NO_SUSPEND) {
8996b89d6bc98ae Mark Langsdorf 2012-09-06 576 dev_err(dev, "firmware update required for suspend/resume\n");
8996b89d6bc98ae Mark Langsdorf 2012-09-06 577 return -EIO;
8996b89d6bc98ae Mark Langsdorf 2012-09-06 578 }
8996b89d6bc98ae Mark Langsdorf 2012-09-06 579
8996b89d6bc98ae Mark Langsdorf 2012-09-06 580 /*
8996b89d6bc98ae Mark Langsdorf 2012-09-06 581 * AHCI spec rev1.1 section 8.3.3:
8996b89d6bc98ae Mark Langsdorf 2012-09-06 582 * Software must disable interrupts prior to requesting a
8996b89d6bc98ae Mark Langsdorf 2012-09-06 583 * transition of the HBA to D3 state.
8996b89d6bc98ae Mark Langsdorf 2012-09-06 584 */
8996b89d6bc98ae Mark Langsdorf 2012-09-06 585 ctl = readl(mmio + HOST_CTL);
8996b89d6bc98ae Mark Langsdorf 2012-09-06 586 ctl &= ~HOST_IRQ_EN;
8996b89d6bc98ae Mark Langsdorf 2012-09-06 587 writel(ctl, mmio + HOST_CTL);
8996b89d6bc98ae Mark Langsdorf 2012-09-06 588 readl(mmio + HOST_CTL); /* flush */
8996b89d6bc98ae Mark Langsdorf 2012-09-06 589
ec87cf3782f7b05 Sergey Shtylyov 2022-02-02 @590 ata_host_suspend(host, PMSG_SUSPEND);
ec87cf3782f7b05 Sergey Shtylyov 2022-02-02 591 return 0;
8996b89d6bc98ae Mark Langsdorf 2012-09-06 592 }
8996b89d6bc98ae Mark Langsdorf 2012-09-06 593
8996b89d6bc98ae Mark Langsdorf 2012-09-06 594 static int ahci_highbank_resume(struct device *dev)
8996b89d6bc98ae Mark Langsdorf 2012-09-06 595 {
8996b89d6bc98ae Mark Langsdorf 2012-09-06 596 struct ata_host *host = dev_get_drvdata(dev);
8996b89d6bc98ae Mark Langsdorf 2012-09-06 597 int rc;
8996b89d6bc98ae Mark Langsdorf 2012-09-06 598
8996b89d6bc98ae Mark Langsdorf 2012-09-06 599 if (dev->power.power_state.event == PM_EVENT_SUSPEND) {
8996b89d6bc98ae Mark Langsdorf 2012-09-06 600 rc = ahci_reset_controller(host);
8996b89d6bc98ae Mark Langsdorf 2012-09-06 601 if (rc)
8996b89d6bc98ae Mark Langsdorf 2012-09-06 602 return rc;
8996b89d6bc98ae Mark Langsdorf 2012-09-06 603
8996b89d6bc98ae Mark Langsdorf 2012-09-06 604 ahci_init_controller(host);
8996b89d6bc98ae Mark Langsdorf 2012-09-06 605 }
8996b89d6bc98ae Mark Langsdorf 2012-09-06 606
8996b89d6bc98ae Mark Langsdorf 2012-09-06 @607 ata_host_resume(host);
8996b89d6bc98ae Mark Langsdorf 2012-09-06 608
8996b89d6bc98ae Mark Langsdorf 2012-09-06 609 return 0;
8996b89d6bc98ae Mark Langsdorf 2012-09-06 610 }
8996b89d6bc98ae Mark Langsdorf 2012-09-06 611 Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
RFC PATCH 14/14 ahci: sata_rcar: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
In reply to Raphael Gallais-PouLetting the compiler remove these functions when the kernel is built without CONFIG_PM_SLEEP support is simpler and less error prone than the use of #ifdef based kernel configuration guards.
--- drivers/ata/sata_rcar.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/ata/sata_rcar.c +1 -5
@@ -927,7 +927,6 @@ static void sata_rcar_remove(struct platform_device *pdev)pm_runtime_disable (&pdev->dev); } -#ifdef CONFIG_PM_SLEEP static int sata_rcar_suspend (struct device *dev) {struct ata_host *host =dev_get_drvdata (dev);
@@ -1005,7 +1004,6 @@ static const struct dev_pm_ops sata_rcar_pm_ops = { .poweroff = sata_rcar_suspend, .restore = sata_rcar_restore, }; -#endif static struct platform_driver sata_rcar_driver = { .probe = sata_rcar_probe,
@@ -1013,9 +1011,7 @@ static struct platform_driver sata_rcar_driver = { .driver = { .name = DRV_NAME, .of_match_table = sata_rcar_match, -#ifdef CONFIG_PM_SLEEP - .pm = &sata_rcar_pm_ops, -#endif + .pm = pm_sleep_ptr(&sata_rcar_pm_ops), }, };
Signature · 1 line
2.48.0
Re: [PATCH RFC 14/14] ahci: sata_rcar: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
Hi Raphael,
Quoted 5 lines · Raphael Gallais-Pou
Letting the compiler remove these functions when the kernel is built without
CONFIG_PM_SLEEPsupport is simpler and less error prone than the use of #ifdef based kernel configuration guards.Signed-off-by Raphael Gallais-Pou <[email protected]>
Thanks for your patch!
The subsystem prefix is "ata", not "ahci" (not all ATA-drivers are AHCI-drivers).
Quoted 11 lines
drivers/ata/sata_rcar.c +0
-1@@ -927,7 +927,6 @@ static void sata_rcar_remove(struct platform_device *pdev)pm_runtime_disable (&pdev->dev); } -#ifdef CONFIG_PM_SLEEP static int sata_rcar_suspend (struct device *dev) {struct ata_host *host =dev_get_drvdata (dev);
drivers/ata/sata_rcar.c static const struct dev_pm_ops sata_rcar_pm_ops = { · line 1008
Quoted 4 lines
drivers/ata/sata_rcar.c +0
-1@@ -1005,7 +1004,6 @@ static const struct dev_pm_ops sata_rcar_pm_ops = { .poweroff = sata_rcar_suspend, .restore = sata_rcar_restore, }; -#endif
If CONFIG_PM_SLEEP is disabled (e.g. m68k allyesconfig):
drivers/ata/sata_rcar.c: In function ‘sata_rcar_suspend’:
drivers/ata/sata_rcar.c:936:9: error: implicit declaration of
function ‘ata_host_suspend’; did you mean ‘sata_rcar_suspend’? [-Werror=implicit-function-declaration]
936 | ata_host_suspend(host, PMSG_SUSPEND);
| ^~~~~~~~~~~~~~~~
| sata_rcar_suspend drivers/ata/sata_rcar.c: In function ‘sata_rcar_resume’:
drivers/ata/sata_rcar.c:973:9: error: implicit declaration of
function ‘ata_host_resume’; did you mean ‘sata_rcar_resume’? [-Werror=implicit-function-declaration]
973 | ata_host_resume(host);
| ^~~~~~~~~~~~~~~
| sata_rcar_resumedrivers/ata/sata_rcar.c static struct platform_driver sata_rcar_driver = { · line 1016
Quoted 13 lines
drivers/ata/sata_rcar.c +1
-3static struct platform_driver sata_rcar_driver = { .probe = sata_rcar_probe,@@ -1013,9 +1011,7 @@ static struct platform_driver sata_rcar_driver = { .driver = { .name = DRV_NAME, .of_match_table = sata_rcar_match, -#ifdef CONFIG_PM_SLEEP - .pm = &sata_rcar_pm_ops, -#endif + .pm = pm_sleep_ptr(&sata_rcar_pm_ops), }, };
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Damien Le Moal
maintainerRe: [PATCH RFC 14/14] ahci: sata_rcar: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
Quoted 7 lines · Geert Uytterhoeven
Hi Raphael,
Quoted 4 lines · Raphael Gallais-Pou
Letting the compiler remove these functions when the kernel is built without
CONFIG_PM_SLEEPsupport is simpler and less error prone than the use of #ifdef based kernel configuration guards.
Quoted 6 lines
Quoted 1 line
Signed-off-by Raphael Gallais-Pou <[email protected]>Thanks for your patch!
The subsystem prefix is "ata", not "ahci" (not all ATA-drivers are AHCI-drivers).
Yep. The convention is:
ata: driver_name: xxx
So it would be:
ata: sata_rcar: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr()
for this patch. And the same comment applies to all your other patches in the series.
Quoted 52 lines
Quoted 12 lines
drivers/ata/sata_rcar.c +0
-1@@ -927,7 +927,6 @@ static void sata_rcar_remove(struct platform_device *pdev)pm_runtime_disable (&pdev->dev); } -#ifdef CONFIG_PM_SLEEP static int sata_rcar_suspend (struct device *dev) {struct ata_host *host =dev_get_drvdata (dev);drivers/ata/sata_rcar.c static const struct dev_pm_ops sata_rcar_pm_ops = { · line 1008
Quoted 4 lines
drivers/ata/sata_rcar.c +0
-1@@ -1005,7 +1004,6 @@ static const struct dev_pm_ops sata_rcar_pm_ops = { .poweroff = sata_rcar_suspend, .restore = sata_rcar_restore, }; -#endif If
CONFIG_PM_SLEEPis disabled (e.g. m68k allyesconfig):
drivers/ata/sata_rcar.c: In function ‘sata_rcar_suspend’:
drivers/ata/sata_rcar.c:936:9: error: implicit declaration of
function ‘ata_host_suspend’; did you mean ‘sata_rcar_suspend’? [-Werror=implicit-function-declaration]936 | ata_host_suspend(host, PMSG_SUSPEND); | ^~~~~~~~~~~~~~~~ | sata_rcar_suspend
drivers/ata/sata_rcar.c: In function ‘sata_rcar_resume’:
drivers/ata/sata_rcar.c:973:9: error: implicit declaration of
function ‘ata_host_resume’; did you mean ‘sata_rcar_resume’? [-Werror=implicit-function-declaration]973 | ata_host_resume(host); | ^~~~~~~~~~~~~~~ | sata_rcar_resumedrivers/ata/sata_rcar.c static struct platform_driver sata_rcar_driver = { · line 1016
Quoted 13 lines
drivers/ata/sata_rcar.c +1
-3static struct platform_driver sata_rcar_driver = { .probe = sata_rcar_probe,@@ -1013,9 +1011,7 @@ static struct platform_driver sata_rcar_driver = { .driver = { .name = DRV_NAME, .of_match_table = sata_rcar_match, -#ifdef CONFIG_PM_SLEEP - .pm = &sata_rcar_pm_ops, -#endif + .pm = pm_sleep_ptr(&sata_rcar_pm_ops), }, };Gr{oetje,eeting}s,
Geert
Signature · 2 lines
Damien Le Moal Western Digital Research
Hi Raphael,
Quoted 4 lines · Raphael Gallais-Pou
Several AHCI drivers expose suspend/resume functions in a way that can be simplified. Using pre-processor operation can lead to errors, while relying on automatic kernel configuration is safer. It also shrinks the kernel size when
CONFIG_PM_SLEEPis not used[1].
m68k/allyesconfig:
drivers/ata/sata_highbank.c: In function ‘ahci_highbank_suspend’:drivers/ata/sata_highbank.c:590:9: error: implicit declaration of function ‘ata_host_suspend’; did you mean ‘ata_sas_port_suspend’? [-Werror=implicit-function-declaration] drivers/ata/sata_highbank.c: In function ‘ahci_highbank_resume’:drivers/ata/sata_highbank.c:607:9: error: implicit declaration of function ‘ata_host_resume’; did you mean ‘ahci_port_resume’? [-Werror=implicit-function-declaration] drivers/ata/pata_arasan_cf.c: In function ‘arasan_cf_suspend’:drivers/ata/pata_arasan_cf.c:938:9: error: implicit declaration of function ‘ata_host_suspend’; did you mean ‘ata_sas_port_suspend’? [-Werror=implicit-function-declaration] drivers/ata/pata_arasan_cf.c: In function ‘arasan_cf_resume’:drivers/ata/pata_arasan_cf.c:948:9: error: implicit declaration of function ‘ata_host_resume’; did you mean ‘sata_link_resume’? [-Werror=implicit-function-declaration] drivers/ata/sata_rcar.c: In function ‘sata_rcar_suspend’:drivers/ata/sata_rcar.c:936:9: error: implicit declaration of function ‘ata_host_suspend’; did you mean ‘sata_rcar_suspend’? [-Werror=implicit-function-declaration] drivers/ata/sata_rcar.c: In function ‘sata_rcar_resume’:drivers/ata/sata_rcar.c:973:9: error: implicit declaration of function ‘ata_host_resume’; did you mean ‘sata_rcar_resume’? [-Werror=implicit-function-declaration] drivers/ata/pata_imx.c: In function ‘pata_imx_suspend’:drivers/ata/pata_imx.c:209:9: error: implicit declaration of function ‘ata_host_suspend’; did you mean ‘pata_imx_suspend’? [-Werror=implicit-function-declaration] drivers/ata/pata_imx.c: In function ‘pata_imx_resume’:drivers/ata/pata_imx.c:232:9: error: implicit declaration of function ‘ata_host_resume’; did you mean ‘pata_imx_resume’? [-Werror=implicit-function-declaration]
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds