Patch "ice: Use div64_u64 instead of div_u64 in adjfine" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    ice: Use div64_u64 instead of div_u64 in adjfine

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     ice-use-div64_u64-instead-of-div_u64-in-adjfine.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit ba27ab5da18954fa15184cf141da6d79b3a28417
Author: Karol Kolacinski <karol.kolacinski@xxxxxxxxx>
Date:   Thu Nov 4 14:52:11 2021 +0100

    ice: Use div64_u64 instead of div_u64 in adjfine
    
    [ Upstream commit 0013881c1145d36bf26165bb70fdd7560a5507a3 ]
    
    Change the division in ice_ptp_adjfine from div_u64 to div64_u64.
    div_u64 is used when the divisor is 32 bit but in this case incval is
    64 bit and it caused incorrect calculations and incval adjustments.
    
    Fixes: 06c16d89d2cb ("ice: register 1588 PTP clock device object for E810 devices")
    Signed-off-by: Karol Kolacinski <karol.kolacinski@xxxxxxxxx>
    Tested-by: Gurucharan G <gurucharanx.g@xxxxxxxxx>
    Signed-off-by: Tony Nguyen <anthony.l.nguyen@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/intel/ice/ice_ptp.c b/drivers/net/ethernet/intel/ice/ice_ptp.c
index d1ef3d48a4b03..9df546984de25 100644
--- a/drivers/net/ethernet/intel/ice/ice_ptp.c
+++ b/drivers/net/ethernet/intel/ice/ice_ptp.c
@@ -459,7 +459,7 @@ static int ice_ptp_adjfine(struct ptp_clock_info *info, long scaled_ppm)
 		scaled_ppm = -scaled_ppm;
 	}
 
-	while ((u64)scaled_ppm > div_u64(U64_MAX, incval)) {
+	while ((u64)scaled_ppm > div64_u64(U64_MAX, incval)) {
 		/* handle overflow by scaling down the scaled_ppm and
 		 * the divisor, losing some precision
 		 */



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux