* [PATCH] mlxsw: spectrum_ptp: fix 32-bit build
@ 2019-06-19 13:31 Arnd Bergmann
2019-06-19 13:42 ` Ido Schimmel
2019-06-20 8:53 ` Sergei Shtylyov
0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2019-06-19 13:31 UTC (permalink / raw)
To: Jiri Pirko, Ido Schimmel, David S. Miller
Cc: Arnd Bergmann, Shalom Toledo, Petr Machata, netdev, linux-kernel
On 32-bit architectures, we cannot easily device 64-bit numbers:
ERROR: "__aeabi_uldivmod" [drivers/net/ethernet/mellanox/mlxsw/mlxsw_spectrum.ko] undefined!
Use do_div() to annotate the fact that we know this is an
expensive operation.
Fixes: 992aa864dca0 ("mlxsw: spectrum_ptp: Add implementation for physical hardware clock operations")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c
index 2a9bbc90225e..618e329e1490 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c
@@ -87,7 +87,7 @@ mlxsw_sp1_ptp_phc_settime(struct mlxsw_sp_ptp_clock *clock, u64 nsec)
u32 next_sec;
int err;
- next_sec = nsec / NSEC_PER_SEC + 1;
+ next_sec = div_u64(nsec, NSEC_PER_SEC) + 1;
next_sec_in_nsec = next_sec * NSEC_PER_SEC;
spin_lock(&clock->lock);
--
2.20.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mlxsw: spectrum_ptp: fix 32-bit build
2019-06-19 13:31 [PATCH] mlxsw: spectrum_ptp: fix 32-bit build Arnd Bergmann
@ 2019-06-19 13:42 ` Ido Schimmel
2019-06-20 8:53 ` Sergei Shtylyov
1 sibling, 0 replies; 3+ messages in thread
From: Ido Schimmel @ 2019-06-19 13:42 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Jiri Pirko, Ido Schimmel, David S. Miller, Shalom Toledo,
Petr Machata, netdev, linux-kernel
On Wed, Jun 19, 2019 at 03:31:20PM +0200, Arnd Bergmann wrote:
> On 32-bit architectures, we cannot easily device 64-bit numbers:
>
> ERROR: "__aeabi_uldivmod" [drivers/net/ethernet/mellanox/mlxsw/mlxsw_spectrum.ko] undefined!
>
> Use do_div() to annotate the fact that we know this is an
> expensive operation.
>
> Fixes: 992aa864dca0 ("mlxsw: spectrum_ptp: Add implementation for physical hardware clock operations")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Arnd, thanks for the patch. We already patched this issue yesterday:
https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git/commit/?id=cd4bb2a3344cb53d9234cca232edfb2dce0f0a35
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mlxsw: spectrum_ptp: fix 32-bit build
2019-06-19 13:31 [PATCH] mlxsw: spectrum_ptp: fix 32-bit build Arnd Bergmann
2019-06-19 13:42 ` Ido Schimmel
@ 2019-06-20 8:53 ` Sergei Shtylyov
1 sibling, 0 replies; 3+ messages in thread
From: Sergei Shtylyov @ 2019-06-20 8:53 UTC (permalink / raw)
To: Arnd Bergmann, Jiri Pirko, Ido Schimmel, David S. Miller
Cc: Shalom Toledo, Petr Machata, netdev, linux-kernel
Hello!
On 19.06.2019 16:31, Arnd Bergmann wrote:
> On 32-bit architectures, we cannot easily device 64-bit numbers:
s/device/divide/?
> ERROR: "__aeabi_uldivmod" [drivers/net/ethernet/mellanox/mlxsw/mlxsw_spectrum.ko] undefined!
>
> Use do_div() to annotate the fact that we know this is an
div_u64() really?
> expensive operation.
>
> Fixes: 992aa864dca0 ("mlxsw: spectrum_ptp: Add implementation for physical hardware clock operations")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c
> index 2a9bbc90225e..618e329e1490 100644
> --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c
> +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c
> @@ -87,7 +87,7 @@ mlxsw_sp1_ptp_phc_settime(struct mlxsw_sp_ptp_clock *clock, u64 nsec)
> u32 next_sec;
> int err;
>
> - next_sec = nsec / NSEC_PER_SEC + 1;
> + next_sec = div_u64(nsec, NSEC_PER_SEC) + 1;
> next_sec_in_nsec = next_sec * NSEC_PER_SEC;
>
> spin_lock(&clock->lock);
MBR, Sergei
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-06-20 8:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-19 13:31 [PATCH] mlxsw: spectrum_ptp: fix 32-bit build Arnd Bergmann
2019-06-19 13:42 ` Ido Schimmel
2019-06-20 8:53 ` Sergei Shtylyov
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).