linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmc: brcmstb: Fix sdhci_pltfm_suspend link error
@ 2021-01-25 12:50 Arnd Bergmann
  2021-01-25 17:40 ` Florian Fainelli
  2021-01-25 18:39 ` Nicolas Schichan
  0 siblings, 2 replies; 5+ messages in thread
From: Arnd Bergmann @ 2021-01-25 12:50 UTC (permalink / raw)
  To: Al Cooper, Adrian Hunter, Ulf Hansson, Florian Fainelli,
	bcm-kernel-feedback-list
  Cc: Arnd Bergmann, stable, Douglas Anderson, Krzysztof Kozlowski,
	linux-mmc, linux-arm-kernel, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

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
>>> 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")
Cc: stable@vger.kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
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(-)

diff --git a/drivers/mmc/host/sdhci-brcmstb.c b/drivers/mmc/host/sdhci-brcmstb.c
index f9780c65ebe9..dc9280b149db 100644
--- a/drivers/mmc/host/sdhci-brcmstb.c
+++ b/drivers/mmc/host/sdhci-brcmstb.c
@@ -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);
-- 
2.29.2


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

* Re: [PATCH] mmc: brcmstb: Fix sdhci_pltfm_suspend link error
  2021-01-25 12:50 [PATCH] mmc: brcmstb: Fix sdhci_pltfm_suspend link error Arnd Bergmann
@ 2021-01-25 17:40 ` Florian Fainelli
  2021-01-26  9:55   ` Ulf Hansson
  2021-01-25 18:39 ` Nicolas Schichan
  1 sibling, 1 reply; 5+ messages in thread
From: Florian Fainelli @ 2021-01-25 17:40 UTC (permalink / raw)
  To: Arnd Bergmann, Al Cooper, Adrian Hunter, Ulf Hansson,
	bcm-kernel-feedback-list, Nicolas Schichan
  Cc: Arnd Bergmann, stable, Douglas Anderson, Krzysztof Kozlowski,
	linux-mmc, linux-arm-kernel, linux-kernel

+Nicolas,

On 1/25/2021 4:50 AM, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> 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
>>>> 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")
> Cc: stable@vger.kernel.org
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> 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.
-- 
Florian

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

* Re: [PATCH] mmc: brcmstb: Fix sdhci_pltfm_suspend link error
  2021-01-25 12:50 [PATCH] mmc: brcmstb: Fix sdhci_pltfm_suspend link error Arnd Bergmann
  2021-01-25 17:40 ` Florian Fainelli
@ 2021-01-25 18:39 ` Nicolas Schichan
  1 sibling, 0 replies; 5+ messages in thread
From: Nicolas Schichan @ 2021-01-25 18:39 UTC (permalink / raw)
  To: Arnd Bergmann, Al Cooper, Adrian Hunter, Ulf Hansson,
	Florian Fainelli, bcm-kernel-feedback-list
  Cc: Arnd Bergmann, linux-mmc, Douglas Anderson, Krzysztof Kozlowski,
	linux-kernel, stable, linux-arm-kernel

On 25/01/2021 13:50, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> 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
>>>> 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")
> Cc: stable@vger.kernel.org
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> 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.

Tested-by: Nicolas Schichan <nschichan@freebox.fr>

> ---
>  drivers/mmc/host/sdhci-brcmstb.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/sdhci-brcmstb.c b/drivers/mmc/host/sdhci-brcmstb.c
> index f9780c65ebe9..dc9280b149db 100644
> --- a/drivers/mmc/host/sdhci-brcmstb.c
> +++ b/drivers/mmc/host/sdhci-brcmstb.c
> @@ -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);
> 


-- 
Nicolas Schichan
Freebox SAS

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

* Re: [PATCH] mmc: brcmstb: Fix sdhci_pltfm_suspend link error
  2021-01-25 17:40 ` Florian Fainelli
@ 2021-01-26  9:55   ` Ulf Hansson
  2021-01-26 16:41     ` Alan Cooper
  0 siblings, 1 reply; 5+ messages in thread
From: Ulf Hansson @ 2021-01-26  9:55 UTC (permalink / raw)
  To: Florian Fainelli, Arnd Bergmann, Nicolas Schichan
  Cc: Al Cooper, Adrian Hunter, BCM Kernel Feedback, Arnd Bergmann,
	# 4.0+,
	Douglas Anderson, Krzysztof Kozlowski, linux-mmc, Linux ARM,
	Linux Kernel Mailing List

On Mon, 25 Jan 2021 at 18:40, Florian Fainelli <f.fainelli@gmail.com> wrote:
>
> +Nicolas,
>
> On 1/25/2021 4:50 AM, Arnd Bergmann wrote:
> > From: Arnd Bergmann <arnd@arndb.de>
> >
> > 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
> >>>> 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")
> > Cc: stable@vger.kernel.org
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > ---
> > 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.
> --
> 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

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

* Re: [PATCH] mmc: brcmstb: Fix sdhci_pltfm_suspend link error
  2021-01-26  9:55   ` Ulf Hansson
@ 2021-01-26 16:41     ` Alan Cooper
  0 siblings, 0 replies; 5+ messages in thread
From: Alan Cooper @ 2021-01-26 16:41 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Florian Fainelli, Arnd Bergmann, Nicolas Schichan, Adrian Hunter,
	BCM Kernel Feedback, Arnd Bergmann, # 4.0+,
	Douglas Anderson, Krzysztof Kozlowski, linux-mmc, Linux ARM,
	Linux Kernel Mailing List

> 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 <alcooperx@gmail.com>

Thanks
Al



On Tue, Jan 26, 2021 at 4:55 AM Ulf Hansson <ulf.hansson@linaro.org> wrote:
>
> On Mon, 25 Jan 2021 at 18:40, Florian Fainelli <f.fainelli@gmail.com> wrote:
> >
> > +Nicolas,
> >
> > On 1/25/2021 4:50 AM, Arnd Bergmann wrote:
> > > From: Arnd Bergmann <arnd@arndb.de>
> > >
> > > 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
> > >>>> 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")
> > > Cc: stable@vger.kernel.org
> > > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > > ---
> > > 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.
> > --
> > 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

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

end of thread, other threads:[~2021-01-27  0:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-25 12:50 [PATCH] mmc: brcmstb: Fix sdhci_pltfm_suspend link error Arnd Bergmann
2021-01-25 17:40 ` Florian Fainelli
2021-01-26  9:55   ` Ulf Hansson
2021-01-26 16:41     ` Alan Cooper
2021-01-25 18:39 ` Nicolas Schichan

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).