* arm32 build failure after 992aa864dca068554802a65a467a2640985cc213
@ 2019-06-18 1:46 Nathan Chancellor
2019-06-18 12:05 ` Shalom Toledo
0 siblings, 1 reply; 2+ messages in thread
From: Nathan Chancellor @ 2019-06-18 1:46 UTC (permalink / raw)
To: Shalom Toledo, Ido Schimmel, Jiri Pirko
Cc: Petr Machata, David S. Miller, netdev, linux-kernel
Hi all,
A 32-bit ARM allyesconfig fails to link after commit 992aa864dca0
("mlxsw: spectrum_ptp: Add implementation for physical hardware clock
operations") because of 64-bit division:
arm-linux-gnueabi-ld:
drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.o: in function
`mlxsw_sp1_ptp_phc_settime':
spectrum_ptp.c:(.text+0x39c): undefined reference to `__aeabi_uldivmod'
The following diff fixes it but I have no idea if it is proper or not
(hence reaching out before sending it, in case one of you has a more
proper idea).
Cheers,
Nathan
---
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c
index 2a9bbc90225e..65686f0b6834 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 = (u32)div64_u64(nsec, NSEC_PER_SEC + 1);
next_sec_in_nsec = next_sec * NSEC_PER_SEC;
spin_lock(&clock->lock);
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: arm32 build failure after 992aa864dca068554802a65a467a2640985cc213
2019-06-18 1:46 arm32 build failure after 992aa864dca068554802a65a467a2640985cc213 Nathan Chancellor
@ 2019-06-18 12:05 ` Shalom Toledo
0 siblings, 0 replies; 2+ messages in thread
From: Shalom Toledo @ 2019-06-18 12:05 UTC (permalink / raw)
To: Nathan Chancellor, Ido Schimmel, Jiri Pirko
Cc: Petr Machata, David S. Miller, netdev, linux-kernel
On 18/06/2019 4:46, Nathan Chancellor wrote:
> Hi all,
>
> A 32-bit ARM allyesconfig fails to link after commit 992aa864dca0
> ("mlxsw: spectrum_ptp: Add implementation for physical hardware clock
> operations") because of 64-bit division:
>
> arm-linux-gnueabi-ld:
> drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.o: in function
> `mlxsw_sp1_ptp_phc_settime':
> spectrum_ptp.c:(.text+0x39c): undefined reference to `__aeabi_uldivmod'
>
> The following diff fixes it but I have no idea if it is proper or not
> (hence reaching out before sending it, in case one of you has a more
> proper idea).
>
> Cheers,
> Nathan
>
> ---
>
> diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c
> index 2a9bbc90225e..65686f0b6834 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 = (u32)div64_u64(nsec, NSEC_PER_SEC + 1);
> next_sec_in_nsec = next_sec * NSEC_PER_SEC;
>
> spin_lock(&clock->lock);
>
>
Thanks for the report. I will send a fix.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-06-18 12:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-18 1:46 arm32 build failure after 992aa864dca068554802a65a467a2640985cc213 Nathan Chancellor
2019-06-18 12:05 ` Shalom Toledo
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).