linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmc: mtk-sd: include bitfield header and fix incompatible pointer types
@ 2023-06-09  7:48 Wenbin Mei
  2023-06-09  8:05 ` AngeloGioacchino Del Regno
  2023-06-09  9:12 ` Adrian Hunter
  0 siblings, 2 replies; 4+ messages in thread
From: Wenbin Mei @ 2023-06-09  7:48 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Adrian Hunter, Ritesh Harjani, Asutosh Das, Chaotian Jing,
	Matthias Brugger, AngeloGioacchino Del Regno, Alexandre Mergnat,
	Wenbin Mei, linux-mmc, linux-kernel, linux-arm-kernel,
	linux-mediatek, kernel test robot

The following error appeared due to the patch:
364dae3e80a4 "mmc: mtk-sd: reduce CIT for better performance"

drivers/mmc/host/mtk-sd.c: In function 'msdc_cqe_cit_cal':
drivers/mmc/host/cqhci.h:27:41: error: implicit declaration of function 'FIELD_GET' [-Werror=implicit-function-declaration]

drivers/mmc/host/mtk-sd.c:2471:3: error: incompatible pointer types passing 'unsigned long *' to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Werror,-Wincompatible-pointer-types]
    2471 |                 do_div(hclk_freq, 1000);
         |                 ^~~~~~~~~~~~~~~~~~~~~~~
include/asm-generic/div64.h:238:22: note: expanded from macro 'do_div'
     238 |                 __rem = __div64_32(&(n), __base);       \
include/asm-generic/div64.h:213:38: note: passing argument to parameter 'dividend' here
     213 | extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor);
...

This patch corrects the issue.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Wenbin Mei <wenbin.mei@mediatek.com>
Fixes: 364dae3e80a4 ("mmc: mtk-sd: reduce CIT for better performance")
---
 drivers/mmc/host/cqhci.h  | 1 +
 drivers/mmc/host/mtk-sd.c | 5 ++---
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/host/cqhci.h b/drivers/mmc/host/cqhci.h
index e35c655edefc..1a12e40a02e6 100644
--- a/drivers/mmc/host/cqhci.h
+++ b/drivers/mmc/host/cqhci.h
@@ -5,6 +5,7 @@
 #define LINUX_MMC_CQHCI_H
 
 #include <linux/compiler.h>
+#include <linux/bitfield.h>
 #include <linux/bitops.h>
 #include <linux/spinlock_types.h>
 #include <linux/types.h>
diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c
index b582f19f82f2..99317fd9f084 100644
--- a/drivers/mmc/host/mtk-sd.c
+++ b/drivers/mmc/host/mtk-sd.c
@@ -2456,15 +2456,14 @@ static void msdc_cqe_cit_cal(struct msdc_host *host, u64 timer_ns)
 	struct mmc_host *mmc = mmc_from_priv(host);
 	struct cqhci_host *cq_host = mmc->cqe_private;
 	u8 itcfmul;
-	unsigned long hclk_freq;
-	u64 value;
+	u64 hclk_freq, value;
 
 	/*
 	 * On MediaTek SoCs the MSDC controller's CQE uses msdc_hclk as ITCFVAL
 	 * so we multiply/divide the HCLK frequency by ITCFMUL to calculate the
 	 * Send Status Command Idle Timer (CIT) value.
 	 */
-	hclk_freq = clk_get_rate(host->h_clk);
+	hclk_freq = (u64)clk_get_rate(host->h_clk);
 	itcfmul = CQHCI_ITCFMUL(cqhci_readl(cq_host, CQHCI_CAP));
 	switch (itcfmul) {
 	case 0x0:
-- 
2.25.1


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

* Re: [PATCH] mmc: mtk-sd: include bitfield header and fix incompatible pointer types
  2023-06-09  7:48 [PATCH] mmc: mtk-sd: include bitfield header and fix incompatible pointer types Wenbin Mei
@ 2023-06-09  8:05 ` AngeloGioacchino Del Regno
  2023-06-09  9:12 ` Adrian Hunter
  1 sibling, 0 replies; 4+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-06-09  8:05 UTC (permalink / raw)
  To: Wenbin Mei, Ulf Hansson
  Cc: Adrian Hunter, Ritesh Harjani, Asutosh Das, Chaotian Jing,
	Matthias Brugger, Alexandre Mergnat, linux-mmc, linux-kernel,
	linux-arm-kernel, linux-mediatek, kernel test robot

Il 09/06/23 09:48, Wenbin Mei ha scritto:
> The following error appeared due to the patch:
> 364dae3e80a4 "mmc: mtk-sd: reduce CIT for better performance"
> 
> drivers/mmc/host/mtk-sd.c: In function 'msdc_cqe_cit_cal':
> drivers/mmc/host/cqhci.h:27:41: error: implicit declaration of function 'FIELD_GET' [-Werror=implicit-function-declaration]
> 
> drivers/mmc/host/mtk-sd.c:2471:3: error: incompatible pointer types passing 'unsigned long *' to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Werror,-Wincompatible-pointer-types]
>      2471 |                 do_div(hclk_freq, 1000);
>           |                 ^~~~~~~~~~~~~~~~~~~~~~~
> include/asm-generic/div64.h:238:22: note: expanded from macro 'do_div'
>       238 |                 __rem = __div64_32(&(n), __base);       \
> include/asm-generic/div64.h:213:38: note: passing argument to parameter 'dividend' here
>       213 | extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor);
> ...
> 
> This patch corrects the issue.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Wenbin Mei <wenbin.mei@mediatek.com>
> Fixes: 364dae3e80a4 ("mmc: mtk-sd: reduce CIT for better performance")

Fixes tags go before others... anyway:

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

> ---
>   drivers/mmc/host/cqhci.h  | 1 +
>   drivers/mmc/host/mtk-sd.c | 5 ++---
>   2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mmc/host/cqhci.h b/drivers/mmc/host/cqhci.h
> index e35c655edefc..1a12e40a02e6 100644
> --- a/drivers/mmc/host/cqhci.h
> +++ b/drivers/mmc/host/cqhci.h
> @@ -5,6 +5,7 @@
>   #define LINUX_MMC_CQHCI_H
>   
>   #include <linux/compiler.h>
> +#include <linux/bitfield.h>
>   #include <linux/bitops.h>
>   #include <linux/spinlock_types.h>
>   #include <linux/types.h>
> diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c
> index b582f19f82f2..99317fd9f084 100644
> --- a/drivers/mmc/host/mtk-sd.c
> +++ b/drivers/mmc/host/mtk-sd.c
> @@ -2456,15 +2456,14 @@ static void msdc_cqe_cit_cal(struct msdc_host *host, u64 timer_ns)
>   	struct mmc_host *mmc = mmc_from_priv(host);
>   	struct cqhci_host *cq_host = mmc->cqe_private;
>   	u8 itcfmul;
> -	unsigned long hclk_freq;
> -	u64 value;
> +	u64 hclk_freq, value;
>   
>   	/*
>   	 * On MediaTek SoCs the MSDC controller's CQE uses msdc_hclk as ITCFVAL
>   	 * so we multiply/divide the HCLK frequency by ITCFMUL to calculate the
>   	 * Send Status Command Idle Timer (CIT) value.
>   	 */
> -	hclk_freq = clk_get_rate(host->h_clk);
> +	hclk_freq = (u64)clk_get_rate(host->h_clk);
>   	itcfmul = CQHCI_ITCFMUL(cqhci_readl(cq_host, CQHCI_CAP));
>   	switch (itcfmul) {
>   	case 0x0:

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

* Re: [PATCH] mmc: mtk-sd: include bitfield header and fix incompatible pointer types
  2023-06-09  7:48 [PATCH] mmc: mtk-sd: include bitfield header and fix incompatible pointer types Wenbin Mei
  2023-06-09  8:05 ` AngeloGioacchino Del Regno
@ 2023-06-09  9:12 ` Adrian Hunter
  2023-06-09  9:21   ` Wenbin Mei (梅文彬)
  1 sibling, 1 reply; 4+ messages in thread
From: Adrian Hunter @ 2023-06-09  9:12 UTC (permalink / raw)
  To: Wenbin Mei, Ulf Hansson
  Cc: Ritesh Harjani, Asutosh Das, Chaotian Jing, Matthias Brugger,
	AngeloGioacchino Del Regno, Alexandre Mergnat, linux-mmc,
	linux-kernel, linux-arm-kernel, linux-mediatek,
	kernel test robot

On 9/06/23 10:48, Wenbin Mei wrote:
> The following error appeared due to the patch:
> 364dae3e80a4 "mmc: mtk-sd: reduce CIT for better performance"
> 
> drivers/mmc/host/mtk-sd.c: In function 'msdc_cqe_cit_cal':
> drivers/mmc/host/cqhci.h:27:41: error: implicit declaration of function 'FIELD_GET' [-Werror=implicit-function-declaration]
> 
> drivers/mmc/host/mtk-sd.c:2471:3: error: incompatible pointer types passing 'unsigned long *' to parameter of type 'uint64_t *' (aka 'unsigned long long *') [-Werror,-Wincompatible-pointer-types]
>     2471 |                 do_div(hclk_freq, 1000);
>          |                 ^~~~~~~~~~~~~~~~~~~~~~~
> include/asm-generic/div64.h:238:22: note: expanded from macro 'do_div'
>      238 |                 __rem = __div64_32(&(n), __base);       \
> include/asm-generic/div64.h:213:38: note: passing argument to parameter 'dividend' here
>      213 | extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor);
> ...
> 
> This patch corrects the issue.

It doesn't look like Ulf has done a pull request for the original
patch, so it might be better to submit a new version of that.

> 
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Wenbin Mei <wenbin.mei@mediatek.com>
> Fixes: 364dae3e80a4 ("mmc: mtk-sd: reduce CIT for better performance")
> ---
>  drivers/mmc/host/cqhci.h  | 1 +
>  drivers/mmc/host/mtk-sd.c | 5 ++---
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/mmc/host/cqhci.h b/drivers/mmc/host/cqhci.h
> index e35c655edefc..1a12e40a02e6 100644
> --- a/drivers/mmc/host/cqhci.h
> +++ b/drivers/mmc/host/cqhci.h
> @@ -5,6 +5,7 @@
>  #define LINUX_MMC_CQHCI_H
>  
>  #include <linux/compiler.h>
> +#include <linux/bitfield.h>
>  #include <linux/bitops.h>
>  #include <linux/spinlock_types.h>
>  #include <linux/types.h>
> diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c
> index b582f19f82f2..99317fd9f084 100644
> --- a/drivers/mmc/host/mtk-sd.c
> +++ b/drivers/mmc/host/mtk-sd.c
> @@ -2456,15 +2456,14 @@ static void msdc_cqe_cit_cal(struct msdc_host *host, u64 timer_ns)
>  	struct mmc_host *mmc = mmc_from_priv(host);
>  	struct cqhci_host *cq_host = mmc->cqe_private;
>  	u8 itcfmul;
> -	unsigned long hclk_freq;
> -	u64 value;
> +	u64 hclk_freq, value;
>  
>  	/*
>  	 * On MediaTek SoCs the MSDC controller's CQE uses msdc_hclk as ITCFVAL
>  	 * so we multiply/divide the HCLK frequency by ITCFMUL to calculate the
>  	 * Send Status Command Idle Timer (CIT) value.
>  	 */
> -	hclk_freq = clk_get_rate(host->h_clk);
> +	hclk_freq = (u64)clk_get_rate(host->h_clk);
>  	itcfmul = CQHCI_ITCFMUL(cqhci_readl(cq_host, CQHCI_CAP));
>  	switch (itcfmul) {
>  	case 0x0:


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

* Re: [PATCH] mmc: mtk-sd: include bitfield header and fix incompatible pointer types
  2023-06-09  9:12 ` Adrian Hunter
@ 2023-06-09  9:21   ` Wenbin Mei (梅文彬)
  0 siblings, 0 replies; 4+ messages in thread
From: Wenbin Mei (梅文彬) @ 2023-06-09  9:21 UTC (permalink / raw)
  To: ulf.hansson, adrian.hunter
  Cc: lkp, linux-kernel, linux-mediatek, asutoshd, linux-mmc, riteshh,
	Chaotian Jing (井朝天),
	amergnat, linux-arm-kernel, matthias.bgg,
	angelogioacchino.delregno

On Fri, 2023-06-09 at 12:12 +0300, Adrian Hunter wrote:
>  	 
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
>  On 9/06/23 10:48, Wenbin Mei wrote:
> > The following error appeared due to the patch:
> > 364dae3e80a4 "mmc: mtk-sd: reduce CIT for better performance"
> > 
> > drivers/mmc/host/mtk-sd.c: In function 'msdc_cqe_cit_cal':
> > drivers/mmc/host/cqhci.h:27:41: error: implicit declaration of
> function 'FIELD_GET' [-Werror=implicit-function-declaration]
> > 
> > drivers/mmc/host/mtk-sd.c:2471:3: error: incompatible pointer types
> passing 'unsigned long *' to parameter of type 'uint64_t *' (aka
> 'unsigned long long *') [-Werror,-Wincompatible-pointer-types]
> >     2471 |                 do_div(hclk_freq, 1000);
> >          |                 ^~~~~~~~~~~~~~~~~~~~~~~
> > include/asm-generic/div64.h:238:22: note: expanded from macro
> 'do_div'
> >      238 |                 __rem = __div64_32(&(n),
> __base);       \
> > include/asm-generic/div64.h:213:38: note: passing argument to
> parameter 'dividend' here
> >      213 | extern uint32_t __div64_32(uint64_t *dividend, uint32_t
> divisor);
> > ...
> > 
> > This patch corrects the issue.
> 
> It doesn't look like Ulf has done a pull request for the original
> patch, so it might be better to submit a new version of that.
> 
If so, I will submit a new version of that.
And I wait for Ulf's reply, thanks

Begards,
Wenbin
> > 
> > Reported-by: kernel test robot <lkp@intel.com>
> > Signed-off-by: Wenbin Mei <wenbin.mei@mediatek.com>
> > Fixes: 364dae3e80a4 ("mmc: mtk-sd: reduce CIT for better
> performance")
> > ---
> >  drivers/mmc/host/cqhci.h  | 1 +
> >  drivers/mmc/host/mtk-sd.c | 5 ++---
> >  2 files changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/mmc/host/cqhci.h b/drivers/mmc/host/cqhci.h
> > index e35c655edefc..1a12e40a02e6 100644
> > --- a/drivers/mmc/host/cqhci.h
> > +++ b/drivers/mmc/host/cqhci.h
> > @@ -5,6 +5,7 @@
> >  #define LINUX_MMC_CQHCI_H
> >  
> >  #include <linux/compiler.h>
> > +#include <linux/bitfield.h>
> >  #include <linux/bitops.h>
> >  #include <linux/spinlock_types.h>
> >  #include <linux/types.h>
> > diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c
> > index b582f19f82f2..99317fd9f084 100644
> > --- a/drivers/mmc/host/mtk-sd.c
> > +++ b/drivers/mmc/host/mtk-sd.c
> > @@ -2456,15 +2456,14 @@ static void msdc_cqe_cit_cal(struct
> msdc_host *host, u64 timer_ns)
> >  struct mmc_host *mmc = mmc_from_priv(host);
> >  struct cqhci_host *cq_host = mmc->cqe_private;
> >  u8 itcfmul;
> > -unsigned long hclk_freq;
> > -u64 value;
> > +u64 hclk_freq, value;
> >  
> >  /*
> >   * On MediaTek SoCs the MSDC controller's CQE uses msdc_hclk as
> ITCFVAL
> >   * so we multiply/divide the HCLK frequency by ITCFMUL to
> calculate the
> >   * Send Status Command Idle Timer (CIT) value.
> >   */
> > -hclk_freq = clk_get_rate(host->h_clk);
> > +hclk_freq = (u64)clk_get_rate(host->h_clk);
> >  itcfmul = CQHCI_ITCFMUL(cqhci_readl(cq_host, CQHCI_CAP));
> >  switch (itcfmul) {
> >  case 0x0:
> 

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

end of thread, other threads:[~2023-06-09  9:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-09  7:48 [PATCH] mmc: mtk-sd: include bitfield header and fix incompatible pointer types Wenbin Mei
2023-06-09  8:05 ` AngeloGioacchino Del Regno
2023-06-09  9:12 ` Adrian Hunter
2023-06-09  9:21   ` Wenbin Mei (梅文彬)

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