All of lore.kernel.org
 help / color / mirror / Atom feed
From: Conor Dooley <conor@kernel.org>
To: Jesse Taube <mr.bossman075@gmail.com>
Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
	Yimin Gu <ustcymgu@gmail.com>,
	Waldemar Brodkorb <wbx@openadk.org>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Conor Dooley <conor.dooley@microchip.com>,
	kernel test robot <lkp@intel.com>
Subject: Re: [PATCH v2 1/3] clk: k210: remove an implicit 64-bit division
Date: Mon, 13 Feb 2023 19:42:32 +0000	[thread overview]
Message-ID: <Y+qSqHDhcFZNqOMg@spud> (raw)
In-Reply-To: <20230212205506.1992714-2-Mr.Bossman075@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1475 bytes --]

On Sun, Feb 12, 2023 at 03:55:04PM -0500, Jesse Taube wrote:
> From: Conor Dooley <conor.dooley@microchip.com>
> 
> The K210 clock driver depends on SOC_CANAAN, which is only selectable
> when !MMU on RISC-V. !MMU is not possible on 32-bit yet, but patches
> have been sent for its enabling. The kernel test robot reported this
> implicit 64-bit division there.
> 
> Replace the implicit division with an explicit one.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Link: https://lore.kernel.org/linux-riscv/202301201538.zNlqgE4L-lkp@intel.com/
> Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
> Signed-off-by: Jesse Taube <Mr.Bossman075@gmail.com>

btw, you'll need to run get_maintainer.pl on this patch so that the k210
and clock maintainers are CCed.

It's also worth adding Damien Le Moal <damien.lemoal@wdc.com>

> ---
>  drivers/clk/clk-k210.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/clk-k210.c b/drivers/clk/clk-k210.c
> index 67a7cb3503c3..4eed667eddaf 100644
> --- a/drivers/clk/clk-k210.c
> +++ b/drivers/clk/clk-k210.c
> @@ -495,7 +495,7 @@ static unsigned long k210_pll_get_rate(struct clk_hw *hw,
>  	f = FIELD_GET(K210_PLL_CLKF, reg) + 1;
>  	od = FIELD_GET(K210_PLL_CLKOD, reg) + 1;
>  
> -	return (u64)parent_rate * f / (r * od);
> +	return div_u64((u64)parent_rate * f, r * od);
>  }
>  
>  static const struct clk_ops k210_pll_ops = {
> -- 
> 2.39.0
> 

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 161 bytes --]

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

WARNING: multiple messages have this Message-ID (diff)
From: Conor Dooley <conor@kernel.org>
To: Jesse Taube <mr.bossman075@gmail.com>
Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
	Yimin Gu <ustcymgu@gmail.com>,
	Waldemar Brodkorb <wbx@openadk.org>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Conor Dooley <conor.dooley@microchip.com>,
	kernel test robot <lkp@intel.com>
Subject: Re: [PATCH v2 1/3] clk: k210: remove an implicit 64-bit division
Date: Mon, 13 Feb 2023 19:42:32 +0000	[thread overview]
Message-ID: <Y+qSqHDhcFZNqOMg@spud> (raw)
In-Reply-To: <20230212205506.1992714-2-Mr.Bossman075@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1475 bytes --]

On Sun, Feb 12, 2023 at 03:55:04PM -0500, Jesse Taube wrote:
> From: Conor Dooley <conor.dooley@microchip.com>
> 
> The K210 clock driver depends on SOC_CANAAN, which is only selectable
> when !MMU on RISC-V. !MMU is not possible on 32-bit yet, but patches
> have been sent for its enabling. The kernel test robot reported this
> implicit 64-bit division there.
> 
> Replace the implicit division with an explicit one.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Link: https://lore.kernel.org/linux-riscv/202301201538.zNlqgE4L-lkp@intel.com/
> Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
> Signed-off-by: Jesse Taube <Mr.Bossman075@gmail.com>

btw, you'll need to run get_maintainer.pl on this patch so that the k210
and clock maintainers are CCed.

It's also worth adding Damien Le Moal <damien.lemoal@wdc.com>

> ---
>  drivers/clk/clk-k210.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/clk-k210.c b/drivers/clk/clk-k210.c
> index 67a7cb3503c3..4eed667eddaf 100644
> --- a/drivers/clk/clk-k210.c
> +++ b/drivers/clk/clk-k210.c
> @@ -495,7 +495,7 @@ static unsigned long k210_pll_get_rate(struct clk_hw *hw,
>  	f = FIELD_GET(K210_PLL_CLKF, reg) + 1;
>  	od = FIELD_GET(K210_PLL_CLKOD, reg) + 1;
>  
> -	return (u64)parent_rate * f / (r * od);
> +	return div_u64((u64)parent_rate * f, r * od);
>  }
>  
>  static const struct clk_ops k210_pll_ops = {
> -- 
> 2.39.0
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2023-02-13 19:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-12 20:55 [PATCH v2 0/3] Add RISC-V 32 NOMMU support Jesse Taube
2023-02-12 20:55 ` Jesse Taube
2023-02-12 20:55 ` [PATCH v2 1/3] clk: k210: remove an implicit 64-bit division Jesse Taube
2023-02-12 20:55   ` Jesse Taube
2023-02-13 19:42   ` Conor Dooley [this message]
2023-02-13 19:42     ` Conor Dooley
2023-02-12 20:55 ` [PATCH v2 2/3] riscv: Kconfig: Allow RV32 to build with no MMU Jesse Taube
2023-02-12 20:55   ` Jesse Taube
2023-02-12 20:55 ` [PATCH v2 3/3] riscv: configs: Add nommu defconfig for RV32 Jesse Taube
2023-02-12 20:55   ` Jesse Taube
2023-02-13 19:49   ` Conor Dooley
2023-02-13 19:49     ` Conor Dooley
2023-02-13 21:44     ` Jesse Taube
2023-02-13 21:44       ` Jesse Taube
2023-02-13 21:48       ` Conor Dooley
2023-02-13 21:48         ` Conor Dooley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y+qSqHDhcFZNqOMg@spud \
    --to=conor@kernel.org \
    --cc=aou@eecs.berkeley.edu \
    --cc=conor.dooley@microchip.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=lkp@intel.com \
    --cc=mr.bossman075@gmail.com \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=ustcymgu@gmail.com \
    --cc=wbx@openadk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.