Home
last modified time | relevance | path

Searched refs:counter (Results 1 – 25 of 1031) sorted by relevance

12345678910>>...42

/linux-6.6.21/drivers/net/ethernet/marvell/prestera/
Dprestera_counter.c50 static void prestera_counter_lock(struct prestera_counter *counter) in prestera_counter_lock() argument
52 mutex_lock(&counter->mtx); in prestera_counter_lock()
55 static void prestera_counter_unlock(struct prestera_counter *counter) in prestera_counter_unlock() argument
57 mutex_unlock(&counter->mtx); in prestera_counter_unlock()
89 prestera_counter_block_lookup_not_full(struct prestera_counter *counter, in prestera_counter_block_lookup_not_full() argument
94 prestera_counter_lock(counter); in prestera_counter_block_lookup_not_full()
95 for (i = 0; i < counter->block_list_len; i++) { in prestera_counter_block_lookup_not_full()
96 if (counter->block_list[i] && in prestera_counter_block_lookup_not_full()
97 counter->block_list[i]->client == client && in prestera_counter_block_lookup_not_full()
98 !counter->block_list[i]->full && in prestera_counter_block_lookup_not_full()
[all …]
/linux-6.6.21/drivers/counter/
Dcounter-chrdev.c68 struct counter_device *const counter = filp->private_data; in counter_chrdev_read() local
72 if (!counter->ops) in counter_chrdev_read()
79 if (kfifo_is_empty(&counter->events)) { in counter_chrdev_read()
83 err = wait_event_interruptible(counter->events_wait, in counter_chrdev_read()
84 !kfifo_is_empty(&counter->events) || in counter_chrdev_read()
85 !counter->ops); in counter_chrdev_read()
88 if (!counter->ops) in counter_chrdev_read()
92 if (mutex_lock_interruptible(&counter->events_out_lock)) in counter_chrdev_read()
94 err = kfifo_to_user(&counter->events, buf, len, &copied); in counter_chrdev_read()
95 mutex_unlock(&counter->events_out_lock); in counter_chrdev_read()
[all …]
Dcounter-core.c31 struct counter_device counter; member
42 struct counter_device *const counter = in counter_device_release() local
45 counter_chrdev_remove(counter); in counter_device_release()
48 kfree(container_of(counter, struct counter_device_allochelper, counter)); in counter_device_release()
69 void *counter_priv(const struct counter_device *const counter) in counter_priv() argument
72 container_of(counter, struct counter_device_allochelper, counter); in counter_priv()
90 struct counter_device *counter; in counter_alloc() local
98 counter = &ch->counter; in counter_alloc()
99 dev = &counter->dev; in counter_alloc()
107 mutex_init(&counter->ops_exist_lock); in counter_alloc()
[all …]
Drz-mtu3-cnt.c97 static inline struct rz_mtu3_channel *rz_mtu3_get_ch(struct counter_device *counter, int id) in rz_mtu3_get_ch() argument
99 struct rz_mtu3_cnt *const priv = counter_priv(counter); in rz_mtu3_get_ch()
105 static bool rz_mtu3_is_counter_invalid(struct counter_device *counter, int id) in rz_mtu3_is_counter_invalid() argument
107 struct rz_mtu3_cnt *const priv = counter_priv(counter); in rz_mtu3_is_counter_invalid()
123 static int rz_mtu3_lock_if_counter_is_valid(struct counter_device *counter, in rz_mtu3_lock_if_counter_is_valid() argument
135 if (rz_mtu3_is_counter_invalid(counter, id)) { in rz_mtu3_lock_if_counter_is_valid()
157 static int rz_mtu3_count_read(struct counter_device *counter, in rz_mtu3_count_read() argument
160 struct rz_mtu3_channel *const ch = rz_mtu3_get_ch(counter, count->id); in rz_mtu3_count_read()
161 struct rz_mtu3_cnt *const priv = counter_priv(counter); in rz_mtu3_count_read()
164 ret = rz_mtu3_lock_if_counter_is_valid(counter, ch, priv, count->id); in rz_mtu3_count_read()
[all …]
Dti-ecap-capture.c100 static u8 ecap_cnt_capture_get_evmode(struct counter_device *counter) in ecap_cnt_capture_get_evmode() argument
102 struct ecap_cnt_dev *ecap_dev = counter_priv(counter); in ecap_cnt_capture_get_evmode()
105 pm_runtime_get_sync(counter->parent); in ecap_cnt_capture_get_evmode()
107 pm_runtime_put_sync(counter->parent); in ecap_cnt_capture_get_evmode()
112 static void ecap_cnt_capture_set_evmode(struct counter_device *counter, u8 ev_mode) in ecap_cnt_capture_set_evmode() argument
114 struct ecap_cnt_dev *ecap_dev = counter_priv(counter); in ecap_cnt_capture_set_evmode()
116 pm_runtime_get_sync(counter->parent); in ecap_cnt_capture_set_evmode()
118 pm_runtime_put_sync(counter->parent); in ecap_cnt_capture_set_evmode()
121 static void ecap_cnt_capture_enable(struct counter_device *counter) in ecap_cnt_capture_enable() argument
123 struct ecap_cnt_dev *ecap_dev = counter_priv(counter); in ecap_cnt_capture_enable()
[all …]
Dinterrupt-cnt.c29 struct counter_device *counter = dev_id; in interrupt_cnt_isr() local
30 struct interrupt_cnt_priv *priv = counter_priv(counter); in interrupt_cnt_isr()
34 counter_push_event(counter, COUNTER_EVENT_CHANGE_OF_STATE, 0); in interrupt_cnt_isr()
39 static int interrupt_cnt_enable_read(struct counter_device *counter, in interrupt_cnt_enable_read() argument
42 struct interrupt_cnt_priv *priv = counter_priv(counter); in interrupt_cnt_enable_read()
49 static int interrupt_cnt_enable_write(struct counter_device *counter, in interrupt_cnt_enable_write() argument
52 struct interrupt_cnt_priv *priv = counter_priv(counter); in interrupt_cnt_enable_write()
77 static int interrupt_cnt_action_read(struct counter_device *counter, in interrupt_cnt_action_read() argument
87 static int interrupt_cnt_read(struct counter_device *counter, in interrupt_cnt_read() argument
90 struct interrupt_cnt_priv *priv = counter_priv(counter); in interrupt_cnt_read()
[all …]
Dti-eqep.c85 struct counter_device counter; member
90 static struct ti_eqep_cnt *ti_eqep_count_from_counter(struct counter_device *counter) in ti_eqep_count_from_counter() argument
92 return counter_priv(counter); in ti_eqep_count_from_counter()
95 static int ti_eqep_count_read(struct counter_device *counter, in ti_eqep_count_read() argument
98 struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter); in ti_eqep_count_read()
107 static int ti_eqep_count_write(struct counter_device *counter, in ti_eqep_count_write() argument
110 struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter); in ti_eqep_count_write()
120 static int ti_eqep_function_read(struct counter_device *counter, in ti_eqep_function_read() argument
124 struct ti_eqep_cnt *priv = ti_eqep_count_from_counter(counter); in ti_eqep_function_read()
147 static int ti_eqep_function_write(struct counter_device *counter, in ti_eqep_function_write() argument
[all …]
Dcounter-sysfs.c109 struct counter_device *const counter = counter_from_dev(dev); in counter_comp_u8_show() local
115 err = a->comp.device_u8_read(counter, &data); in counter_comp_u8_show()
118 err = a->comp.signal_u8_read(counter, a->parent, &data); in counter_comp_u8_show()
121 err = a->comp.count_u8_read(counter, a->parent, &data); in counter_comp_u8_show()
141 struct counter_device *const counter = counter_from_dev(dev); in counter_comp_u8_store() local
156 err = a->comp.device_u8_write(counter, data); in counter_comp_u8_store()
159 err = a->comp.signal_u8_write(counter, a->parent, data); in counter_comp_u8_store()
162 err = a->comp.count_u8_write(counter, a->parent, data); in counter_comp_u8_store()
177 struct counter_device *const counter = counter_from_dev(dev); in counter_comp_u32_show() local
184 err = a->comp.device_u32_read(counter, &data); in counter_comp_u32_show()
[all …]
Dstm32-lptimer-cnt.c140 static int stm32_lptim_cnt_read(struct counter_device *counter, in stm32_lptim_cnt_read() argument
143 struct stm32_lptim_cnt *const priv = counter_priv(counter); in stm32_lptim_cnt_read()
156 static int stm32_lptim_cnt_function_read(struct counter_device *counter, in stm32_lptim_cnt_function_read() argument
160 struct stm32_lptim_cnt *const priv = counter_priv(counter); in stm32_lptim_cnt_function_read()
175 static int stm32_lptim_cnt_function_write(struct counter_device *counter, in stm32_lptim_cnt_function_write() argument
179 struct stm32_lptim_cnt *const priv = counter_priv(counter); in stm32_lptim_cnt_function_write()
198 static int stm32_lptim_cnt_enable_read(struct counter_device *counter, in stm32_lptim_cnt_enable_read() argument
202 struct stm32_lptim_cnt *const priv = counter_priv(counter); in stm32_lptim_cnt_enable_read()
214 static int stm32_lptim_cnt_enable_write(struct counter_device *counter, in stm32_lptim_cnt_enable_write() argument
218 struct stm32_lptim_cnt *const priv = counter_priv(counter); in stm32_lptim_cnt_enable_write()
[all …]
Dstm32-timer-cnt.c46 static int stm32_count_read(struct counter_device *counter, in stm32_count_read() argument
49 struct stm32_timer_cnt *const priv = counter_priv(counter); in stm32_count_read()
58 static int stm32_count_write(struct counter_device *counter, in stm32_count_write() argument
61 struct stm32_timer_cnt *const priv = counter_priv(counter); in stm32_count_write()
71 static int stm32_count_function_read(struct counter_device *counter, in stm32_count_function_read() argument
75 struct stm32_timer_cnt *const priv = counter_priv(counter); in stm32_count_function_read()
98 static int stm32_count_function_write(struct counter_device *counter, in stm32_count_function_write() argument
102 struct stm32_timer_cnt *const priv = counter_priv(counter); in stm32_count_function_write()
138 static int stm32_count_direction_read(struct counter_device *counter, in stm32_count_direction_read() argument
142 struct stm32_timer_cnt *const priv = counter_priv(counter); in stm32_count_direction_read()
[all …]
/linux-6.6.21/drivers/comedi/drivers/
Dni_tiocmd.c38 static void ni_tio_configure_dma(struct ni_gpct *counter, in ni_tio_configure_dma() argument
41 struct ni_gpct_device *counter_dev = counter->counter_dev; in ni_tio_configure_dma()
42 unsigned int cidx = counter->counter_index; in ni_tio_configure_dma()
55 ni_tio_set_bits(counter, NITIO_INPUT_SEL_REG(cidx), mask, bits); in ni_tio_configure_dma()
69 ni_tio_set_bits(counter, NITIO_DMA_CFG_REG(cidx), mask, bits); in ni_tio_configure_dma()
78 struct ni_gpct *counter = s->private; in ni_tio_input_inttrig() local
86 spin_lock_irqsave(&counter->lock, flags); in ni_tio_input_inttrig()
87 if (counter->mite_chan) in ni_tio_input_inttrig()
88 mite_dma_arm(counter->mite_chan); in ni_tio_input_inttrig()
91 spin_unlock_irqrestore(&counter->lock, flags); in ni_tio_input_inttrig()
[all …]
Dni_tio.c149 void ni_tio_write(struct ni_gpct *counter, unsigned int value, in ni_tio_write() argument
153 counter->counter_dev->write(counter, value, reg); in ni_tio_write()
162 unsigned int ni_tio_read(struct ni_gpct *counter, enum ni_gpct_register reg) in ni_tio_read() argument
165 return counter->counter_dev->read(counter, reg); in ni_tio_read()
170 static void ni_tio_reset_count_and_disarm(struct ni_gpct *counter) in ni_tio_reset_count_and_disarm() argument
172 unsigned int cidx = counter->counter_index; in ni_tio_reset_count_and_disarm()
174 ni_tio_write(counter, GI_RESET(cidx), NITIO_RESET_REG(cidx)); in ni_tio_reset_count_and_disarm()
177 static int ni_tio_clock_period_ps(const struct ni_gpct *counter, in ni_tio_clock_period_ps() argument
201 *period_ps = counter->clock_period_ps; in ni_tio_clock_period_ps()
221 static void ni_tio_set_bits_transient(struct ni_gpct *counter, in ni_tio_set_bits_transient() argument
[all …]
/linux-6.6.21/tools/testing/selftests/netfilter/
Dnft_meta.sh30 counter iifcount {}
31 counter iifnamecount {}
32 counter iifgroupcount {}
33 counter iiftypecount {}
34 counter infproto4count {}
35 counter il4protocounter {}
36 counter imarkcounter {}
37 counter icpu0counter {}
38 counter ilastyearcounter {}
39 counter icurrentyearcounter {}
[all …]
/linux-6.6.21/drivers/infiniband/core/
Dcounters.c78 static void auto_mode_init_counter(struct rdma_counter *counter, in auto_mode_init_counter() argument
82 struct auto_mode_param *param = &counter->mode.param; in auto_mode_init_counter()
84 counter->mode.mode = RDMA_COUNTER_MODE_AUTO; in auto_mode_init_counter()
85 counter->mode.mask = new_mask; in auto_mode_init_counter()
91 static int __rdma_counter_bind_qp(struct rdma_counter *counter, in __rdma_counter_bind_qp() argument
96 if (qp->counter) in __rdma_counter_bind_qp()
102 mutex_lock(&counter->lock); in __rdma_counter_bind_qp()
103 ret = qp->device->ops.counter_bind_qp(counter, qp); in __rdma_counter_bind_qp()
104 mutex_unlock(&counter->lock); in __rdma_counter_bind_qp()
146 struct rdma_counter *counter; in alloc_and_bind() local
[all …]
/linux-6.6.21/drivers/net/ethernet/mellanox/mlx5/core/
Dfs_counters.c114 struct mlx5_fc *counter; in mlx5_fc_counters_lookup_next() local
120 counter, tmp, next_id) { in mlx5_fc_counters_lookup_next()
121 if (!list_empty(&counter->list)) in mlx5_fc_counters_lookup_next()
126 return counter ? &counter->list : &fc_stats->counters; in mlx5_fc_counters_lookup_next()
130 struct mlx5_fc *counter) in mlx5_fc_stats_insert() argument
132 struct list_head *next = mlx5_fc_counters_lookup_next(dev, counter->id); in mlx5_fc_stats_insert()
134 list_add_tail(&counter->list, next); in mlx5_fc_stats_insert()
138 struct mlx5_fc *counter) in mlx5_fc_stats_remove() argument
142 list_del(&counter->list); in mlx5_fc_stats_remove()
145 WARN_ON(!idr_remove(&fc_stats->counters_idr, counter->id)); in mlx5_fc_stats_remove()
[all …]
/linux-6.6.21/arch/arm/include/asm/
Datomic.h25 #define arch_atomic_read(v) READ_ONCE((v)->counter)
26 #define arch_atomic_set(v,i) WRITE_ONCE(((v)->counter), (i))
42 prefetchw(&v->counter); \
49 : "=&r" (result), "=&r" (tmp), "+Qo" (v->counter) \
50 : "r" (&v->counter), "Ir" (i) \
60 prefetchw(&v->counter); \
68 : "=&r" (result), "=&r" (tmp), "+Qo" (v->counter) \
69 : "r" (&v->counter), "Ir" (i) \
81 prefetchw(&v->counter); \
89 : "=&r" (result), "=&r" (val), "=&r" (tmp), "+Qo" (v->counter) \
[all …]
/linux-6.6.21/include/linux/
Dpage_counter.h47 static inline void page_counter_init(struct page_counter *counter, in page_counter_init() argument
50 atomic_long_set(&counter->usage, 0); in page_counter_init()
51 counter->max = PAGE_COUNTER_MAX; in page_counter_init()
52 counter->parent = parent; in page_counter_init()
55 static inline unsigned long page_counter_read(struct page_counter *counter) in page_counter_read() argument
57 return atomic_long_read(&counter->usage); in page_counter_read()
60 void page_counter_cancel(struct page_counter *counter, unsigned long nr_pages);
61 void page_counter_charge(struct page_counter *counter, unsigned long nr_pages);
62 bool page_counter_try_charge(struct page_counter *counter,
65 void page_counter_uncharge(struct page_counter *counter, unsigned long nr_pages);
[all …]
Dcounter.h157 int (*action_read)(struct counter_device *counter,
161 int (*device_u8_read)(struct counter_device *counter, u8 *val);
162 int (*count_u8_read)(struct counter_device *counter,
164 int (*signal_u8_read)(struct counter_device *counter,
166 int (*device_u32_read)(struct counter_device *counter,
168 int (*count_u32_read)(struct counter_device *counter,
170 int (*signal_u32_read)(struct counter_device *counter,
172 int (*device_u64_read)(struct counter_device *counter,
174 int (*count_u64_read)(struct counter_device *counter,
176 int (*signal_u64_read)(struct counter_device *counter,
[all …]
/linux-6.6.21/arch/x86/kernel/cpu/
Dperfctr-watchdog.c110 unsigned int counter; in reserve_perfctr_nmi() local
112 counter = nmi_perfctr_msr_to_bit(msr); in reserve_perfctr_nmi()
114 if (counter > NMI_MAX_COUNTER_BITS) in reserve_perfctr_nmi()
117 if (!test_and_set_bit(counter, perfctr_nmi_owner)) in reserve_perfctr_nmi()
125 unsigned int counter; in release_perfctr_nmi() local
127 counter = nmi_perfctr_msr_to_bit(msr); in release_perfctr_nmi()
129 if (counter > NMI_MAX_COUNTER_BITS) in release_perfctr_nmi()
132 clear_bit(counter, perfctr_nmi_owner); in release_perfctr_nmi()
138 unsigned int counter; in reserve_evntsel_nmi() local
140 counter = nmi_evntsel_msr_to_bit(msr); in reserve_evntsel_nmi()
[all …]
/linux-6.6.21/arch/powerpc/include/asm/
Datomic.h32 __asm__ __volatile__("lwz %0,0(%1)" : "=r"(t) : "b"(&v->counter)); in arch_atomic_read()
34 __asm__ __volatile__("lwz%U1%X1 %0,%1" : "=r"(t) : "m<>"(v->counter)); in arch_atomic_read()
43 __asm__ __volatile__("stw %1,0(%2)" : "=m"(v->counter) : "r"(i), "b"(&v->counter)); in arch_atomic_set()
45 __asm__ __volatile__("stw%U0%X0 %1,%0" : "=m<>"(v->counter) : "r"(i)); in arch_atomic_set()
58 : "=&r" (t), "+m" (v->counter) \
59 : "r"#sign (a), "r" (&v->counter) \
73 : "=&r" (t), "+m" (v->counter) \
74 : "r"#sign (a), "r" (&v->counter) \
90 : "=&r" (res), "=&r" (t), "+m" (v->counter) \
91 : "r"#sign (a), "r" (&v->counter) \
[all …]
/linux-6.6.21/arch/x86/include/asm/
Datomic64_64.h15 return __READ_ONCE((v)->counter); in arch_atomic64_read()
20 __WRITE_ONCE(v->counter, i); in arch_atomic64_set()
26 : "=m" (v->counter) in arch_atomic64_add()
27 : "er" (i), "m" (v->counter) : "memory"); in arch_atomic64_add()
33 : "=m" (v->counter) in arch_atomic64_sub()
34 : "er" (i), "m" (v->counter) : "memory"); in arch_atomic64_sub()
39 return GEN_BINARY_RMWcc(LOCK_PREFIX "subq", v->counter, e, "er", i); in arch_atomic64_sub_and_test()
46 : "=m" (v->counter) in arch_atomic64_inc()
47 : "m" (v->counter) : "memory"); in arch_atomic64_inc()
54 : "=m" (v->counter) in arch_atomic64_dec()
[all …]
Datomic.h23 return __READ_ONCE((v)->counter); in arch_atomic_read()
28 __WRITE_ONCE(v->counter, i); in arch_atomic_set()
34 : "+m" (v->counter) in arch_atomic_add()
41 : "+m" (v->counter) in arch_atomic_sub()
47 return GEN_BINARY_RMWcc(LOCK_PREFIX "subl", v->counter, e, "er", i); in arch_atomic_sub_and_test()
54 : "+m" (v->counter) :: "memory"); in arch_atomic_inc()
61 : "+m" (v->counter) :: "memory"); in arch_atomic_dec()
67 return GEN_UNARY_RMWcc(LOCK_PREFIX "decl", v->counter, e); in arch_atomic_dec_and_test()
73 return GEN_UNARY_RMWcc(LOCK_PREFIX "incl", v->counter, e); in arch_atomic_inc_and_test()
79 return GEN_BINARY_RMWcc(LOCK_PREFIX "addl", v->counter, s, "er", i); in arch_atomic_add_negative()
[all …]
/linux-6.6.21/arch/arm64/include/asm/
Darm_dsu_pmu.h53 static inline void __dsu_pmu_select_counter(int counter) in __dsu_pmu_select_counter() argument
55 write_sysreg_s(counter, CLUSTERPMSELR_EL1); in __dsu_pmu_select_counter()
59 static inline u64 __dsu_pmu_read_counter(int counter) in __dsu_pmu_read_counter() argument
61 __dsu_pmu_select_counter(counter); in __dsu_pmu_read_counter()
65 static inline void __dsu_pmu_write_counter(int counter, u64 val) in __dsu_pmu_write_counter() argument
67 __dsu_pmu_select_counter(counter); in __dsu_pmu_write_counter()
72 static inline void __dsu_pmu_set_event(int counter, u32 event) in __dsu_pmu_set_event() argument
74 __dsu_pmu_select_counter(counter); in __dsu_pmu_set_event()
90 static inline void __dsu_pmu_disable_counter(int counter) in __dsu_pmu_disable_counter() argument
92 write_sysreg_s(BIT(counter), CLUSTERPMCNTENCLR_EL1); in __dsu_pmu_disable_counter()
[all …]
/linux-6.6.21/mm/
Dpage_counter.c49 void page_counter_cancel(struct page_counter *counter, unsigned long nr_pages) in page_counter_cancel() argument
53 new = atomic_long_sub_return(nr_pages, &counter->usage); in page_counter_cancel()
58 atomic_long_set(&counter->usage, new); in page_counter_cancel()
60 propagate_protected_usage(counter, new); in page_counter_cancel()
70 void page_counter_charge(struct page_counter *counter, unsigned long nr_pages) in page_counter_charge() argument
74 for (c = counter; c; c = c->parent) { in page_counter_charge()
97 bool page_counter_try_charge(struct page_counter *counter, in page_counter_try_charge() argument
103 for (c = counter; c; c = c->parent) { in page_counter_try_charge()
142 for (c = counter; c != *fail; c = c->parent) in page_counter_try_charge()
153 void page_counter_uncharge(struct page_counter *counter, unsigned long nr_pages) in page_counter_uncharge() argument
[all …]
/linux-6.6.21/fs/nfsd/
Dstats.h31 struct percpu_counter counter[NFSD_STATS_COUNTERS_NUM]; member
48 percpu_counter_inc(&nfsdstats.counter[NFSD_STATS_RC_HITS]); in nfsd_stats_rc_hits_inc()
53 percpu_counter_inc(&nfsdstats.counter[NFSD_STATS_RC_MISSES]); in nfsd_stats_rc_misses_inc()
58 percpu_counter_inc(&nfsdstats.counter[NFSD_STATS_RC_NOCACHE]); in nfsd_stats_rc_nocache_inc()
63 percpu_counter_inc(&nfsdstats.counter[NFSD_STATS_FH_STALE]); in nfsd_stats_fh_stale_inc()
65 percpu_counter_inc(&exp->ex_stats.counter[EXP_STATS_FH_STALE]); in nfsd_stats_fh_stale_inc()
70 percpu_counter_add(&nfsdstats.counter[NFSD_STATS_IO_READ], amount); in nfsd_stats_io_read_add()
72 percpu_counter_add(&exp->ex_stats.counter[EXP_STATS_IO_READ], amount); in nfsd_stats_io_read_add()
77 percpu_counter_add(&nfsdstats.counter[NFSD_STATS_IO_WRITE], amount); in nfsd_stats_io_write_add()
79 percpu_counter_add(&exp->ex_stats.counter[EXP_STATS_IO_WRITE], amount); in nfsd_stats_io_write_add()
[all …]

12345678910>>...42