Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'timers-cleanups-2025-07-27' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull timer cleanups from Thomas Gleixner:
"A treewide cleanup of struct cycle_counter const annotations.

The initial idea of making them const was correct as they were
seperate instances. When they got embedded into larger data
structures, which are even modified by the callback this got moot. The
only reason why this went unnoticed is that the required
container_of() casts the const attribute forcefully away.

Stop pretending that it is const"

* tag 'timers-cleanups-2025-07-27' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
time/timecounter: Fix the lie that struct cyclecounter is const

+34 -34
+1 -1
arch/microblaze/kernel/timer.c
··· 193 193 .cc = NULL, 194 194 }; 195 195 196 - static u64 xilinx_cc_read(const struct cyclecounter *cc) 196 + static u64 xilinx_cc_read(struct cyclecounter *cc) 197 197 { 198 198 return xilinx_read(NULL); 199 199 }
+1 -1
drivers/clocksource/arm_arch_timer.c
··· 243 243 return arch_timer_read_counter(); 244 244 } 245 245 246 - static u64 arch_counter_read_cc(const struct cyclecounter *cc) 246 + static u64 arch_counter_read_cc(struct cyclecounter *cc) 247 247 { 248 248 return arch_timer_read_counter(); 249 249 }
+1 -1
drivers/net/can/rockchip/rockchip_canfd-timestamp.c
··· 8 8 9 9 #include "rockchip_canfd.h" 10 10 11 - static u64 rkcanfd_timestamp_read(const struct cyclecounter *cc) 11 + static u64 rkcanfd_timestamp_read(struct cyclecounter *cc) 12 12 { 13 13 const struct rkcanfd_priv *priv = container_of(cc, struct rkcanfd_priv, cc); 14 14
+1 -1
drivers/net/can/spi/mcp251xfd/mcp251xfd-timestamp.c
··· 11 11 12 12 #include "mcp251xfd.h" 13 13 14 - static u64 mcp251xfd_timestamp_raw_read(const struct cyclecounter *cc) 14 + static u64 mcp251xfd_timestamp_raw_read(struct cyclecounter *cc) 15 15 { 16 16 const struct mcp251xfd_priv *priv; 17 17 u32 ts_raw = 0;
+1 -1
drivers/net/can/usb/gs_usb.c
··· 420 420 return 0; 421 421 } 422 422 423 - static u64 gs_usb_timestamp_read(const struct cyclecounter *cc) __must_hold(&dev->tc_lock) 423 + static u64 gs_usb_timestamp_read(struct cyclecounter *cc) __must_hold(&dev->tc_lock) 424 424 { 425 425 struct gs_usb *parent = container_of(cc, struct gs_usb, cc); 426 426 u32 timestamp = 0;
+1 -1
drivers/net/dsa/mv88e6xxx/chip.h
··· 732 732 }; 733 733 734 734 struct mv88e6xxx_ptp_ops { 735 - u64 (*clock_read)(const struct cyclecounter *cc); 735 + u64 (*clock_read)(struct cyclecounter *cc); 736 736 int (*ptp_enable)(struct ptp_clock_info *ptp, 737 737 struct ptp_clock_request *rq, int on); 738 738 int (*ptp_verify)(struct ptp_clock_info *ptp, unsigned int pin,
+3 -3
drivers/net/dsa/mv88e6xxx/ptp.c
··· 138 138 } 139 139 } 140 140 141 - static u64 mv88e6352_ptp_clock_read(const struct cyclecounter *cc) 141 + static u64 mv88e6352_ptp_clock_read(struct cyclecounter *cc) 142 142 { 143 143 struct mv88e6xxx_chip *chip = cc_to_chip(cc); 144 144 u16 phc_time[2]; ··· 152 152 return ((u32)phc_time[1] << 16) | phc_time[0]; 153 153 } 154 154 155 - static u64 mv88e6165_ptp_clock_read(const struct cyclecounter *cc) 155 + static u64 mv88e6165_ptp_clock_read(struct cyclecounter *cc) 156 156 { 157 157 struct mv88e6xxx_chip *chip = cc_to_chip(cc); 158 158 u16 phc_time[2]; ··· 483 483 (1 << HWTSTAMP_FILTER_PTP_V2_DELAY_REQ), 484 484 }; 485 485 486 - static u64 mv88e6xxx_ptp_clock_read(const struct cyclecounter *cc) 486 + static u64 mv88e6xxx_ptp_clock_read(struct cyclecounter *cc) 487 487 { 488 488 struct mv88e6xxx_chip *chip = cc_to_chip(cc); 489 489
+1 -1
drivers/net/ethernet/amd/xgbe/xgbe-ptp.c
··· 13 13 #include "xgbe.h" 14 14 #include "xgbe-common.h" 15 15 16 - static u64 xgbe_cc_read(const struct cyclecounter *cc) 16 + static u64 xgbe_cc_read(struct cyclecounter *cc) 17 17 { 18 18 struct xgbe_prv_data *pdata = container_of(cc, 19 19 struct xgbe_prv_data,
+1 -1
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
··· 15176 15176 } 15177 15177 15178 15178 /* Read the PHC */ 15179 - static u64 bnx2x_cyclecounter_read(const struct cyclecounter *cc) 15179 + static u64 bnx2x_cyclecounter_read(struct cyclecounter *cc) 15180 15180 { 15181 15181 struct bnx2x *bp = container_of(cc, struct bnx2x, cyclecounter); 15182 15182 int port = BP_PORT(bp);
+1 -1
drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c
··· 702 702 (BNXT_PTP_GRC_WIN - 1) * 4); 703 703 } 704 704 705 - static u64 bnxt_cc_read(const struct cyclecounter *cc) 705 + static u64 bnxt_cc_read(struct cyclecounter *cc) 706 706 { 707 707 struct bnxt_ptp_cfg *ptp = container_of(cc, struct bnxt_ptp_cfg, cc); 708 708 u64 ns = 0;
+1 -1
drivers/net/ethernet/cavium/common/cavium_ptp.c
··· 209 209 return -EOPNOTSUPP; 210 210 } 211 211 212 - static u64 cavium_ptp_cc_read(const struct cyclecounter *cc) 212 + static u64 cavium_ptp_cc_read(struct cyclecounter *cc) 213 213 { 214 214 struct cavium_ptp *clock = 215 215 container_of(cc, struct cavium_ptp, cycle_counter);
+1 -1
drivers/net/ethernet/freescale/fec_ptp.c
··· 96 96 * cyclecounter structure used to construct a ns counter from the 97 97 * arbitrary fixed point registers 98 98 */ 99 - static u64 fec_ptp_read(const struct cyclecounter *cc) 99 + static u64 fec_ptp_read(struct cyclecounter *cc) 100 100 { 101 101 struct fec_enet_private *fep = 102 102 container_of(cc, struct fec_enet_private, cc);
+1 -1
drivers/net/ethernet/intel/e1000e/netdev.c
··· 4436 4436 * e1000e_cyclecounter_read - read raw cycle counter (used by time counter) 4437 4437 * @cc: cyclecounter structure 4438 4438 **/ 4439 - static u64 e1000e_cyclecounter_read(const struct cyclecounter *cc) 4439 + static u64 e1000e_cyclecounter_read(struct cyclecounter *cc) 4440 4440 { 4441 4441 struct e1000_adapter *adapter = container_of(cc, struct e1000_adapter, 4442 4442 cc);
+2 -2
drivers/net/ethernet/intel/igb/igb_ptp.c
··· 73 73 static void igb_ptp_sdp_init(struct igb_adapter *adapter); 74 74 75 75 /* SYSTIM read access for the 82576 */ 76 - static u64 igb_ptp_read_82576(const struct cyclecounter *cc) 76 + static u64 igb_ptp_read_82576(struct cyclecounter *cc) 77 77 { 78 78 struct igb_adapter *igb = container_of(cc, struct igb_adapter, cc); 79 79 struct e1000_hw *hw = &igb->hw; ··· 90 90 } 91 91 92 92 /* SYSTIM read access for the 82580 */ 93 - static u64 igb_ptp_read_82580(const struct cyclecounter *cc) 93 + static u64 igb_ptp_read_82580(struct cyclecounter *cc) 94 94 { 95 95 struct igb_adapter *igb = container_of(cc, struct igb_adapter, cc); 96 96 struct e1000_hw *hw = &igb->hw;
+2 -2
drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c
··· 327 327 * result of SYSTIME is 32bits of "billions of cycles" and 32 bits of 328 328 * "cycles", rather than seconds and nanoseconds. 329 329 */ 330 - static u64 ixgbe_ptp_read_X550(const struct cyclecounter *cc) 330 + static u64 ixgbe_ptp_read_X550(struct cyclecounter *cc) 331 331 { 332 332 struct ixgbe_adapter *adapter = 333 333 container_of(cc, struct ixgbe_adapter, hw_cc); ··· 364 364 * cyclecounter structure used to construct a ns counter from the 365 365 * arbitrary fixed point registers 366 366 */ 367 - static u64 ixgbe_ptp_read_82599(const struct cyclecounter *cc) 367 + static u64 ixgbe_ptp_read_82599(struct cyclecounter *cc) 368 368 { 369 369 struct ixgbe_adapter *adapter = 370 370 container_of(cc, struct ixgbe_adapter, hw_cc);
+1 -1
drivers/net/ethernet/marvell/octeontx2/nic/otx2_ptp.c
··· 193 193 return otx2_sync_mbox_msg(&ptp->nic->mbox); 194 194 } 195 195 196 - static u64 ptp_cc_read(const struct cyclecounter *cc) 196 + static u64 ptp_cc_read(struct cyclecounter *cc) 197 197 { 198 198 struct otx2_ptp *ptp = container_of(cc, struct otx2_ptp, cycle_counter); 199 199
+1 -1
drivers/net/ethernet/mellanox/mlx4/en_clock.c
··· 38 38 39 39 /* mlx4_en_read_clock - read raw cycle counter (to be used by time counter) 40 40 */ 41 - static u64 mlx4_en_read_clock(const struct cyclecounter *tc) 41 + static u64 mlx4_en_read_clock(struct cyclecounter *tc) 42 42 { 43 43 struct mlx4_en_dev *mdev = 44 44 container_of(tc, struct mlx4_en_dev, cycles);
+1 -1
drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c
··· 343 343 (u64)timer_l | (u64)timer_h1 << 32; 344 344 } 345 345 346 - static u64 read_internal_timer(const struct cyclecounter *cc) 346 + static u64 read_internal_timer(struct cyclecounter *cc) 347 347 { 348 348 struct mlx5_timer *timer = container_of(cc, struct mlx5_timer, cycles); 349 349 struct mlx5_clock *clock = container_of(timer, struct mlx5_clock, timer);
+1 -1
drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c
··· 131 131 return (u64) frc_l | (u64) frc_h2 << 32; 132 132 } 133 133 134 - static u64 mlxsw_sp1_ptp_read_frc(const struct cyclecounter *cc) 134 + static u64 mlxsw_sp1_ptp_read_frc(struct cyclecounter *cc) 135 135 { 136 136 struct mlxsw_sp1_ptp_clock *clock = 137 137 container_of(cc, struct mlxsw_sp1_ptp_clock, cycles);
+1 -1
drivers/net/ethernet/pensando/ionic/ionic_phc.c
··· 290 290 return (u64)tick_low | ((u64)tick_high << 32); 291 291 } 292 292 293 - static u64 ionic_cc_read(const struct cyclecounter *cc) 293 + static u64 ionic_cc_read(struct cyclecounter *cc) 294 294 { 295 295 struct ionic_phc *phc = container_of(cc, struct ionic_phc, cc); 296 296 struct ionic *ionic = phc->lif->ionic;
+1 -1
drivers/net/ethernet/qlogic/qede/qede_ptp.c
··· 181 181 } 182 182 183 183 /* Read the PHC. This API is invoked with ptp_lock held. */ 184 - static u64 qede_ptp_read_cc(const struct cyclecounter *cc) 184 + static u64 qede_ptp_read_cc(struct cyclecounter *cc) 185 185 { 186 186 struct qede_dev *edev; 187 187 struct qede_ptp *ptp;
+1 -1
drivers/net/ethernet/ti/cpts.c
··· 181 181 } 182 182 EXPORT_SYMBOL_GPL(cpts_misc_interrupt); 183 183 184 - static u64 cpts_systim_read(const struct cyclecounter *cc) 184 + static u64 cpts_systim_read(struct cyclecounter *cc) 185 185 { 186 186 struct cpts *cpts = container_of(cc, struct cpts, cc); 187 187
+1 -1
drivers/net/ethernet/wangxun/libwx/wx_ptp.c
··· 652 652 return 0; 653 653 } 654 654 655 - static u64 wx_ptp_read(const struct cyclecounter *hw_cc) 655 + static u64 wx_ptp_read(struct cyclecounter *hw_cc) 656 656 { 657 657 struct wx *wx = container_of(hw_cc, struct wx, hw_cc); 658 658
+1 -1
drivers/ptp/ptp_mock.c
··· 41 41 spinlock_t lock; 42 42 }; 43 43 44 - static u64 mock_phc_cc_read(const struct cyclecounter *cc) 44 + static u64 mock_phc_cc_read(struct cyclecounter *cc) 45 45 { 46 46 return ktime_get_raw_ns(); 47 47 }
+1 -1
drivers/ptp/ptp_vclock.c
··· 164 164 .do_aux_work = ptp_vclock_refresh, 165 165 }; 166 166 167 - static u64 ptp_vclock_read(const struct cyclecounter *cc) 167 + static u64 ptp_vclock_read(struct cyclecounter *cc) 168 168 { 169 169 struct ptp_vclock *vclock = cc_to_vclock(cc); 170 170 struct ptp_clock *ptp = vclock->pclock;
+3 -3
include/linux/timecounter.h
··· 28 28 * @shift: cycle to nanosecond divisor (power of two) 29 29 */ 30 30 struct cyclecounter { 31 - u64 (*read)(const struct cyclecounter *cc); 31 + u64 (*read)(struct cyclecounter *cc); 32 32 u64 mask; 33 33 u32 mult; 34 34 u32 shift; ··· 53 53 * @frac: accumulated fractional nanoseconds 54 54 */ 55 55 struct timecounter { 56 - const struct cyclecounter *cc; 56 + struct cyclecounter *cc; 57 57 u64 cycle_last; 58 58 u64 nsec; 59 59 u64 mask; ··· 100 100 * the time stamp counter by the number of elapsed nanoseconds. 101 101 */ 102 102 extern void timecounter_init(struct timecounter *tc, 103 - const struct cyclecounter *cc, 103 + struct cyclecounter *cc, 104 104 u64 start_tstamp); 105 105 106 106 /**
+1 -1
kernel/time/timecounter.c
··· 6 6 #include <linux/timecounter.h> 7 7 8 8 void timecounter_init(struct timecounter *tc, 9 - const struct cyclecounter *cc, 9 + struct cyclecounter *cc, 10 10 u64 start_tstamp) 11 11 { 12 12 tc->cc = cc;
+1 -1
sound/hda/core/stream.c
··· 634 634 } 635 635 EXPORT_SYMBOL_GPL(snd_hdac_stream_set_params); 636 636 637 - static u64 azx_cc_read(const struct cyclecounter *cc) 637 + static u64 azx_cc_read(struct cyclecounter *cc) 638 638 { 639 639 struct hdac_stream *azx_dev = container_of(cc, struct hdac_stream, cc); 640 640