linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmc: sdhci-of-at91: make MMC_SDHCI_OF_AT91 depend on HAVE_CLK
@ 2020-04-22 15:34 Masahiro Yamada
  2020-04-22 16:04 ` Ulf Hansson
  2020-04-22 16:33 ` Randy Dunlap
  0 siblings, 2 replies; 3+ messages in thread
From: Masahiro Yamada @ 2020-04-22 15:34 UTC (permalink / raw)
  To: linux-mmc, Ulf Hansson
  Cc: Randy Dunlap, Adrian Hunter, Masahiro Yamada, Andrew Jeffery,
	Baolin Wang, Chunyan Zhang, Faiz Abbas, Manivannan Sadhasivam,
	Takao Orito, Thomas Gleixner, YueHaibing, linux-kernel

If sdhci-of-at91.c is compiled without CONFIG_HAVE_CLK, the line

  caps1 |= FIELD_PREP(SDHCI_CLOCK_MUL_MASK, clk_mul);

... emits "FIELD_PREP: value too large for the field" warning.

The compiler seems to decide clk_mul is constant (unsigned int)-1,
because clk_get_rate() returns 0 when CONFIG_HAVE_CLK is disabled.

Add HAVE_CLK to the depenency since this driver does not work without
the clock APIs anyway.

Link: https://lkml.org/lkml/2020/4/17/613
Fixes: linux-next ("mmc: sdhci: use FIELD_GET/PREP for capabilities bit masks")
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Suggested-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

Ulf,

I do not know how to fill the Fixes tag.
It is currently 8da1ff4f68a2 in linux-next, but I am not sure it is
stable. I just added 'linux-next'.

If you have a preferred way, please modify it.





 drivers/mmc/host/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
index 462b5352fea7..2aee844722d6 100644
--- a/drivers/mmc/host/Kconfig
+++ b/drivers/mmc/host/Kconfig
@@ -171,7 +171,7 @@ config MMC_SDHCI_OF_ASPEED
 config MMC_SDHCI_OF_AT91
 	tristate "SDHCI OF support for the Atmel SDMMC controller"
 	depends on MMC_SDHCI_PLTFM
-	depends on OF
+	depends on OF && HAVE_CLK
 	help
 	  This selects the Atmel SDMMC driver
 
-- 
2.25.1


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

* Re: [PATCH] mmc: sdhci-of-at91: make MMC_SDHCI_OF_AT91 depend on HAVE_CLK
  2020-04-22 15:34 [PATCH] mmc: sdhci-of-at91: make MMC_SDHCI_OF_AT91 depend on HAVE_CLK Masahiro Yamada
@ 2020-04-22 16:04 ` Ulf Hansson
  2020-04-22 16:33 ` Randy Dunlap
  1 sibling, 0 replies; 3+ messages in thread
From: Ulf Hansson @ 2020-04-22 16:04 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: linux-mmc, Randy Dunlap, Adrian Hunter, Andrew Jeffery,
	Baolin Wang, Chunyan Zhang, Faiz Abbas, Manivannan Sadhasivam,
	Takao Orito, Thomas Gleixner, YueHaibing,
	Linux Kernel Mailing List

On Wed, 22 Apr 2020 at 17:34, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
>
> If sdhci-of-at91.c is compiled without CONFIG_HAVE_CLK, the line
>
>   caps1 |= FIELD_PREP(SDHCI_CLOCK_MUL_MASK, clk_mul);
>
> ... emits "FIELD_PREP: value too large for the field" warning.
>
> The compiler seems to decide clk_mul is constant (unsigned int)-1,
> because clk_get_rate() returns 0 when CONFIG_HAVE_CLK is disabled.
>
> Add HAVE_CLK to the depenency since this driver does not work without
> the clock APIs anyway.
>
> Link: https://lkml.org/lkml/2020/4/17/613
> Fixes: linux-next ("mmc: sdhci: use FIELD_GET/PREP for capabilities bit masks")

I don't know about these, but I just decided to drop them.

> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Suggested-by: Adrian Hunter <adrian.hunter@intel.com>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

Applied for next, thanks!

Kind regards
Uffe

> ---
>
> Ulf,
>
> I do not know how to fill the Fixes tag.
> It is currently 8da1ff4f68a2 in linux-next, but I am not sure it is
> stable. I just added 'linux-next'.

...and there are no usefull commit hash to use from my tree either, as
I am occasionally rebasing my next branch.


>
> If you have a preferred way, please modify it.
>
>
>
>
>
>  drivers/mmc/host/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
> index 462b5352fea7..2aee844722d6 100644
> --- a/drivers/mmc/host/Kconfig
> +++ b/drivers/mmc/host/Kconfig
> @@ -171,7 +171,7 @@ config MMC_SDHCI_OF_ASPEED
>  config MMC_SDHCI_OF_AT91
>         tristate "SDHCI OF support for the Atmel SDMMC controller"
>         depends on MMC_SDHCI_PLTFM
> -       depends on OF
> +       depends on OF && HAVE_CLK
>         help
>           This selects the Atmel SDMMC driver
>
> --
> 2.25.1
>

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

* Re: [PATCH] mmc: sdhci-of-at91: make MMC_SDHCI_OF_AT91 depend on HAVE_CLK
  2020-04-22 15:34 [PATCH] mmc: sdhci-of-at91: make MMC_SDHCI_OF_AT91 depend on HAVE_CLK Masahiro Yamada
  2020-04-22 16:04 ` Ulf Hansson
@ 2020-04-22 16:33 ` Randy Dunlap
  1 sibling, 0 replies; 3+ messages in thread
From: Randy Dunlap @ 2020-04-22 16:33 UTC (permalink / raw)
  To: Masahiro Yamada, linux-mmc, Ulf Hansson
  Cc: Adrian Hunter, Andrew Jeffery, Baolin Wang, Chunyan Zhang,
	Faiz Abbas, Manivannan Sadhasivam, Takao Orito, Thomas Gleixner,
	YueHaibing, linux-kernel

On 4/22/20 8:34 AM, Masahiro Yamada wrote:
> If sdhci-of-at91.c is compiled without CONFIG_HAVE_CLK, the line
> 
>   caps1 |= FIELD_PREP(SDHCI_CLOCK_MUL_MASK, clk_mul);
> 
> ... emits "FIELD_PREP: value too large for the field" warning.
> 
> The compiler seems to decide clk_mul is constant (unsigned int)-1,
> because clk_get_rate() returns 0 when CONFIG_HAVE_CLK is disabled.
> 
> Add HAVE_CLK to the depenency since this driver does not work without
> the clock APIs anyway.
> 
> Link: https://lkml.org/lkml/2020/4/17/613
> Fixes: linux-next ("mmc: sdhci: use FIELD_GET/PREP for capabilities bit masks")
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Suggested-by: Adrian Hunter <adrian.hunter@intel.com>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested

Thanks.

> ---
> 
> Ulf,
> 
> I do not know how to fill the Fixes tag.
> It is currently 8da1ff4f68a2 in linux-next, but I am not sure it is
> stable. I just added 'linux-next'.
> 
> If you have a preferred way, please modify it.
> 
> 
> 
> 
> 
>  drivers/mmc/host/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig
> index 462b5352fea7..2aee844722d6 100644
> --- a/drivers/mmc/host/Kconfig
> +++ b/drivers/mmc/host/Kconfig
> @@ -171,7 +171,7 @@ config MMC_SDHCI_OF_ASPEED
>  config MMC_SDHCI_OF_AT91
>  	tristate "SDHCI OF support for the Atmel SDMMC controller"
>  	depends on MMC_SDHCI_PLTFM
> -	depends on OF
> +	depends on OF && HAVE_CLK
>  	help
>  	  This selects the Atmel SDMMC driver
>  
> 


-- 
~Randy

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

end of thread, other threads:[~2020-04-22 16:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-22 15:34 [PATCH] mmc: sdhci-of-at91: make MMC_SDHCI_OF_AT91 depend on HAVE_CLK Masahiro Yamada
2020-04-22 16:04 ` Ulf Hansson
2020-04-22 16:33 ` Randy Dunlap

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