Skip to contentSkip to conversation

mmc: brcmstb: Fix sdhci_pltfm_suspend link error

PATCH In review Arnd Bergmann 5 participants 5 messages Jan 25, 2021 – Jan 26, 2021

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: brcmstb: Fix sdhci_pltfm_suspend link error

From: Arnd Bergmann <[email protected]>

sdhci_pltfm_suspend() is only available when CONFIG_PM_SLEEP support is built into the kernel, which caused a regression in a recent bugfix:

ld.lld: error: undefined symbol: sdhci_pltfm_suspend

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

referenced by sdhci-brcmstb.c
mmc/host/sdhci-brcmstb.o:(sdhci_brcmstb_shutdown) in archive drivers/built-in.a

Making the call conditional on the symbol fixes the link error.

Fixes 5b191dcba719 ("mmc: sdhci-brcmstb: Fix mmc timeout errors on S5 suspend")
Fixes e7b5d63a82fe ("mmc: sdhci-brcmstb: Add shutdown callback")

---
It would be helpful if someone could test this to ensure that the driver works correctly even when CONFIG_PM_SLEEP is disabled

---
 drivers/mmc/host/sdhci-brcmstb.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/mmc/host/sdhci-brcmstb.c +2 -1
index f9780c65ebe9..dc9280b149db 100644
@@ -314,7 +314,8 @@ static int sdhci_brcmstb_probe(struct platform_device *pdev)
 
 static void sdhci_brcmstb_shutdown(struct platform_device *pdev)
 {
-	sdhci_pltfm_suspend(&pdev->dev);
+	if (IS_ENABLED(CONFIG_PM_SLEEP))
+		sdhci_pltfm_suspend(&pdev->dev);
 }
 
 MODULE_DEVICE_TABLE(of, sdhci_brcm_of_match);
Signature · 7 lines
2.29.2


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#1 lore raw

+Nicolas,

Quoted 13 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

sdhci_pltfm_suspend() is only available when CONFIG_PM_SLEEP support is built into the kernel, which caused a regression in a recent bugfix:

ld.lld: error: undefined symbol: sdhci_pltfm_suspend

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

referenced by sdhci-brcmstb.c
mmc/host/sdhci-brcmstb.o:(sdhci_brcmstb_shutdown) in archive drivers/built-in.a

Making the call conditional on the symbol fixes the link error.

Quoted 7 lines
Fixes 5b191dcba719 ("mmc: sdhci-brcmstb: Fix mmc timeout errors on S5 suspend")
Fixes e7b5d63a82fe ("mmc: sdhci-brcmstb: Add shutdown callback")

---
It would be helpful if someone could test this to ensure that the driver works correctly even when CONFIG_PM_SLEEP is disabled

Why not create stubs for sdhci_pltfm_suspend() when CONFIG_PM_SLEEP=n? I don't think this is going to be a functional issue given that the purpose of having the .shutdown() function is to save power if we cannot that is fine, too.

Signature · 6 lines
Florian

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Tested-by on v1 1/1
#4 lore raw
In reply to Arnd Bergmann
Quoted 13 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

sdhci_pltfm_suspend() is only available when CONFIG_PM_SLEEP support is built into the kernel, which caused a regression in a recent bugfix:

ld.lld: error: undefined symbol: sdhci_pltfm_suspend

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

referenced by sdhci-brcmstb.c
mmc/host/sdhci-brcmstb.o:(sdhci_brcmstb_shutdown) in archive drivers/built-in.a

Making the call conditional on the symbol fixes the link error.

Quoted 7 lines
Fixes 5b191dcba719 ("mmc: sdhci-brcmstb: Fix mmc timeout errors on S5 suspend")
Fixes e7b5d63a82fe ("mmc: sdhci-brcmstb: Add shutdown callback")

---
It would be helpful if someone could test this to ensure that the driver works correctly even when CONFIG_PM_SLEEP is disabled

Good evening Arnd,

I have just given this patch a test, and the driver works fine on my side, afterwards.

Quoted 19 lines
---
 drivers/mmc/host/sdhci-brcmstb.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/mmc/host/sdhci-brcmstb.c +2 -1
index f9780c65ebe9..dc9280b149db 100644
@@ -314,7 +314,8 @@ static int sdhci_brcmstb_probe(struct platform_device *pdev)
 
 static void sdhci_brcmstb_shutdown(struct platform_device *pdev)
 {
-	sdhci_pltfm_suspend(&pdev->dev);
+	if (IS_ENABLED(CONFIG_PM_SLEEP))
+		sdhci_pltfm_suspend(&pdev->dev);
 }
 
 MODULE_DEVICE_TABLE(of, sdhci_brcm_of_match);
Signature · 7 lines
Nicolas Schichan
Freebox SAS

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#2 lore raw
In reply to Florian Fainelli
Quoted 25 lines · Florian Fainelli

+Nicolas,

Quoted 13 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

sdhci_pltfm_suspend() is only available when CONFIG_PM_SLEEP support is built into the kernel, which caused a regression in a recent bugfix:

ld.lld: error: undefined symbol: sdhci_pltfm_suspend

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

referenced by sdhci-brcmstb.c
mmc/host/sdhci-brcmstb.o:(sdhci_brcmstb_shutdown) in archive drivers/built-in.a

Making the call conditional on the symbol fixes the link error.

Quoted 7 lines
Fixes 5b191dcba719 ("mmc: sdhci-brcmstb: Fix mmc timeout errors on S5 suspend")
Fixes e7b5d63a82fe ("mmc: sdhci-brcmstb: Add shutdown callback")

---
It would be helpful if someone could test this to ensure that the driver works correctly even when CONFIG_PM_SLEEP is disabled

Quoted 6 lines

Why not create stubs for sdhci_pltfm_suspend() when CONFIG_PM_SLEEP=n? I don't think this is going to be a functional issue given that the purpose of having the .shutdown() function is to save power if we cannot that is fine, too.
--
Florian

I would prefer this approach - we shouldn't leave stub functions unimplemented, which is what looks to me.

I just posted a new patch for this, please have a look and test it.

Kind regards
Uffe

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

maintainer
#3 lore raw
Quoted 4 lines

I just posted a new patch for this, please have a look and test it.

Kind regards
Uffe

I tested your new patch and it works.

Reviewed-and-tested-by Al Cooper <[email protected]>

Thanks
Al

Quoted 34 lines · Ulf Hansson
Quoted 25 lines · Florian Fainelli

+Nicolas,

Quoted 13 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

sdhci_pltfm_suspend() is only available when CONFIG_PM_SLEEP support is built into the kernel, which caused a regression in a recent bugfix:

ld.lld: error: undefined symbol: sdhci_pltfm_suspend

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

referenced by sdhci-brcmstb.c
mmc/host/sdhci-brcmstb.o:(sdhci_brcmstb_shutdown) in archive drivers/built-in.a

Making the call conditional on the symbol fixes the link error.

Quoted 7 lines
Fixes 5b191dcba719 ("mmc: sdhci-brcmstb: Fix mmc timeout errors on S5 suspend")
Fixes e7b5d63a82fe ("mmc: sdhci-brcmstb: Add shutdown callback")

---
It would be helpful if someone could test this to ensure that the driver works correctly even when CONFIG_PM_SLEEP is disabled

Quoted 6 lines

Why not create stubs for sdhci_pltfm_suspend() when CONFIG_PM_SLEEP=n? I don't think this is going to be a functional issue given that the purpose of having the .shutdown() function is to save power if we cannot that is fine, too.
--
Florian

Quoted 7 lines

I would prefer this approach - we shouldn't leave stub functions unimplemented, which is what looks to me.

I just posted a new patch for this, please have a look and test it.

Kind regards
Uffe

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel