Home
last modified time | relevance | path

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

12345678910>>...14

/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 …]
/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 …]
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.c103 struct counter_device *const counter = counter_from_dev(dev); in counter_comp_u8_show() local
109 err = a->comp.device_u8_read(counter, &data); in counter_comp_u8_show()
112 err = a->comp.signal_u8_read(counter, a->parent, &data); in counter_comp_u8_show()
115 err = a->comp.count_u8_read(counter, a->parent, &data); in counter_comp_u8_show()
135 struct counter_device *const counter = counter_from_dev(dev); in counter_comp_u8_store() local
150 err = a->comp.device_u8_write(counter, data); in counter_comp_u8_store()
153 err = a->comp.signal_u8_write(counter, a->parent, data); in counter_comp_u8_store()
156 err = a->comp.count_u8_write(counter, a->parent, data); in counter_comp_u8_store()
171 struct counter_device *const counter = counter_from_dev(dev); in counter_comp_u32_show() local
178 err = a->comp.device_u32_read(counter, &data); in counter_comp_u32_show()
[all …]
D104-quad-8.c135 static int quad8_signal_read(struct counter_device *counter, in quad8_signal_read() argument
139 const struct quad8 *const priv = counter_priv(counter); in quad8_signal_read()
153 static int quad8_count_read(struct counter_device *counter, in quad8_count_read() argument
156 struct quad8 *const priv = counter_priv(counter); in quad8_count_read()
177 static int quad8_count_write(struct counter_device *counter, in quad8_count_write() argument
180 struct quad8 *const priv = counter_priv(counter); in quad8_count_write()
249 static int quad8_function_read(struct counter_device *counter, in quad8_function_read() argument
253 struct quad8 *const priv = counter_priv(counter); in quad8_function_read()
266 static int quad8_function_write(struct counter_device *counter, in quad8_function_write() argument
270 struct quad8 *const priv = counter_priv(counter); in quad8_function_write()
[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 …]
Dintel-qep.c108 static int intel_qep_count_read(struct counter_device *counter, in intel_qep_count_read() argument
111 struct intel_qep *const qep = counter_priv(counter); in intel_qep_count_read()
124 static int intel_qep_function_read(struct counter_device *counter, in intel_qep_function_read() argument
137 static int intel_qep_action_read(struct counter_device *counter, in intel_qep_action_read() argument
175 static int intel_qep_ceiling_read(struct counter_device *counter, in intel_qep_ceiling_read() argument
178 struct intel_qep *qep = counter_priv(counter); in intel_qep_ceiling_read()
187 static int intel_qep_ceiling_write(struct counter_device *counter, in intel_qep_ceiling_write() argument
190 struct intel_qep *qep = counter_priv(counter); in intel_qep_ceiling_write()
212 static int intel_qep_enable_read(struct counter_device *counter, in intel_qep_enable_read() argument
215 struct intel_qep *qep = counter_priv(counter); in intel_qep_enable_read()
[all …]
Dftm-quaddec.c117 static int ftm_quaddec_get_prescaler(struct counter_device *counter, in ftm_quaddec_get_prescaler() argument
120 struct ftm_quaddec *ftm = counter_priv(counter); in ftm_quaddec_get_prescaler()
130 static int ftm_quaddec_set_prescaler(struct counter_device *counter, in ftm_quaddec_set_prescaler() argument
133 struct ftm_quaddec *ftm = counter_priv(counter); in ftm_quaddec_set_prescaler()
160 static int ftm_quaddec_count_read(struct counter_device *counter, in ftm_quaddec_count_read() argument
164 struct ftm_quaddec *const ftm = counter_priv(counter); in ftm_quaddec_count_read()
174 static int ftm_quaddec_count_write(struct counter_device *counter, in ftm_quaddec_count_write() argument
178 struct ftm_quaddec *const ftm = counter_priv(counter); in ftm_quaddec_count_write()
190 static int ftm_quaddec_count_function_read(struct counter_device *counter, in ftm_quaddec_count_function_read() argument
199 static int ftm_quaddec_action_read(struct counter_device *counter, in ftm_quaddec_action_read() argument
[all …]
Dmicrochip-tcb-capture.c69 static int mchp_tc_count_function_read(struct counter_device *counter, in mchp_tc_count_function_read() argument
73 struct mchp_tc_data *const priv = counter_priv(counter); in mchp_tc_count_function_read()
83 static int mchp_tc_count_function_write(struct counter_device *counter, in mchp_tc_count_function_write() argument
87 struct mchp_tc_data *const priv = counter_priv(counter); in mchp_tc_count_function_write()
145 static int mchp_tc_count_signal_read(struct counter_device *counter, in mchp_tc_count_signal_read() argument
149 struct mchp_tc_data *const priv = counter_priv(counter); in mchp_tc_count_signal_read()
165 static int mchp_tc_count_action_read(struct counter_device *counter, in mchp_tc_count_action_read() argument
170 struct mchp_tc_data *const priv = counter_priv(counter); in mchp_tc_count_action_read()
204 static int mchp_tc_count_action_write(struct counter_device *counter, in mchp_tc_count_action_write() argument
209 struct mchp_tc_data *const priv = counter_priv(counter); in mchp_tc_count_action_write()
[all …]
/drivers/comedi/drivers/
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 …]
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 …]
Dcomedi_8254.c184 unsigned int comedi_8254_status(struct comedi_8254 *i8254, unsigned int counter) in comedi_8254_status() argument
188 if (counter > 2) in comedi_8254_status()
191 cmd = I8254_CTRL_READBACK_STATUS | I8254_CTRL_READBACK_SEL_CTR(counter); in comedi_8254_status()
194 return __i8254_read(i8254, counter); in comedi_8254_status()
203 unsigned int comedi_8254_read(struct comedi_8254 *i8254, unsigned int counter) in comedi_8254_read() argument
207 if (counter > 2) in comedi_8254_read()
211 __i8254_write(i8254, I8254_CTRL_SEL_CTR(counter) | I8254_CTRL_LATCH, in comedi_8254_read()
215 val = __i8254_read(i8254, counter); in comedi_8254_read()
216 val |= (__i8254_read(i8254, counter) << 8); in comedi_8254_read()
229 unsigned int counter, unsigned int val) in comedi_8254_write() argument
[all …]
Dni_660x.c293 static void ni_660x_gpct_write(struct ni_gpct *counter, unsigned int bits, in ni_660x_gpct_write() argument
296 struct comedi_device *dev = counter->counter_dev->dev; in ni_660x_gpct_write()
298 ni_660x_write(dev, counter->chip_index, bits, reg); in ni_660x_gpct_write()
301 static unsigned int ni_660x_gpct_read(struct ni_gpct *counter, in ni_660x_gpct_read() argument
304 struct comedi_device *dev = counter->counter_dev->dev; in ni_660x_gpct_read()
306 return ni_660x_read(dev, counter->chip_index, reg); in ni_660x_gpct_read()
311 struct ni_gpct *counter) in ni_660x_set_dma_channel() argument
314 unsigned int chip = counter->chip_index; in ni_660x_set_dma_channel()
318 counter->counter_index); in ni_660x_set_dma_channel()
326 struct ni_gpct *counter) in ni_660x_unset_dma_channel() argument
[all …]
/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 …]
/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 …]
/drivers/iommu/intel/
Dperf.c48 lstat[type].counter[COUNTS_MIN] = UINT_MAX; in dmar_latency_enable()
81 lstat[type].counter[COUNTS_10e2]++; in dmar_latency_update()
83 lstat[type].counter[COUNTS_10e3]++; in dmar_latency_update()
85 lstat[type].counter[COUNTS_10e4]++; in dmar_latency_update()
87 lstat[type].counter[COUNTS_10e5]++; in dmar_latency_update()
89 lstat[type].counter[COUNTS_10e6]++; in dmar_latency_update()
91 lstat[type].counter[COUNTS_10e7]++; in dmar_latency_update()
93 lstat[type].counter[COUNTS_10e8_plus]++; in dmar_latency_update()
95 min = lstat[type].counter[COUNTS_MIN]; in dmar_latency_update()
96 max = lstat[type].counter[COUNTS_MAX]; in dmar_latency_update()
[all …]
/drivers/acpi/
Dacpi_lpit.c24 static int lpit_read_residency_counter_us(u64 *counter, bool io_mem) in lpit_read_residency_counter_us() argument
37 *counter = div64_u64(count * 1000000ULL, residency_info_mem.frequency); in lpit_read_residency_counter_us()
41 err = rdmsrl_safe(residency_info_ffh.gaddr.address, counter); in lpit_read_residency_counter_us()
47 *counter &= mask; in lpit_read_residency_counter_us()
48 *counter >>= residency_info_ffh.gaddr.bit_offset; in lpit_read_residency_counter_us()
49 *counter = div64_u64(*counter * 1000000ULL, residency_info_ffh.frequency); in lpit_read_residency_counter_us()
60 u64 counter; in low_power_idle_system_residency_us_show() local
63 ret = lpit_read_residency_counter_us(&counter, true); in low_power_idle_system_residency_us_show()
67 return sprintf(buf, "%llu\n", counter); in low_power_idle_system_residency_us_show()
75 u64 counter; in low_power_idle_cpu_residency_us_show() local
[all …]
/drivers/crypto/nx/
Dnx_debugfs.c41 root, &drv->stats.aes_ops.counter); in nx_debugfs_init()
43 root, &drv->stats.sha256_ops.counter); in nx_debugfs_init()
45 root, &drv->stats.sha512_ops.counter); in nx_debugfs_init()
47 root, &drv->stats.aes_bytes.counter); in nx_debugfs_init()
49 root, &drv->stats.sha256_bytes.counter); in nx_debugfs_init()
51 root, &drv->stats.sha512_bytes.counter); in nx_debugfs_init()
53 root, &drv->stats.errors.counter); in nx_debugfs_init()
55 root, &drv->stats.last_error.counter); in nx_debugfs_init()
57 root, &drv->stats.last_error_pid.counter); in nx_debugfs_init()
/drivers/net/wireguard/selftest/
Dcounter.c9 struct noise_replay_counter *counter; in wg_packet_counter_selftest() local
13 counter = kmalloc(sizeof(*counter), GFP_KERNEL); in wg_packet_counter_selftest()
14 if (unlikely(!counter)) { in wg_packet_counter_selftest()
20 memset(counter, 0, sizeof(*counter)); \ in wg_packet_counter_selftest()
21 spin_lock_init(&counter->lock); \ in wg_packet_counter_selftest()
26 if (counter_validate(counter, n) != (v)) { \ in wg_packet_counter_selftest()
108 kfree(counter); in wg_packet_counter_selftest()
/drivers/perf/
Dfsl_imx8_ddr_perf.c353 static void ddr_perf_free_counter(struct ddr_pmu *pmu, int counter) in ddr_perf_free_counter() argument
355 pmu->events[counter] = NULL; in ddr_perf_free_counter()
358 static u32 ddr_perf_read_counter(struct ddr_pmu *pmu, int counter) in ddr_perf_read_counter() argument
360 struct perf_event *event = pmu->events[counter]; in ddr_perf_read_counter()
370 return readl_relaxed(base + counter * 4); in ddr_perf_read_counter()
421 int counter, bool enable) in ddr_perf_counter_enable() argument
423 u8 reg = counter * 4 + COUNTER_CNTL; in ddr_perf_counter_enable()
443 if (counter == EVENT_CYCLES_COUNTER) in ddr_perf_counter_enable()
455 static bool ddr_perf_counter_overflow(struct ddr_pmu *pmu, int counter) in ddr_perf_counter_overflow() argument
459 val = readl_relaxed(pmu->base + counter * 4 + COUNTER_CNTL); in ddr_perf_counter_overflow()
[all …]
Dmarvell_cn10k_ddr_pmu.c318 static void cn10k_ddr_perf_free_counter(struct cn10k_ddr_pmu *pmu, int counter) in cn10k_ddr_perf_free_counter() argument
320 pmu->events[counter] = NULL; in cn10k_ddr_perf_free_counter()
355 int counter, bool enable) in cn10k_ddr_perf_counter_enable() argument
360 if (counter > DDRC_PERF_NUM_COUNTERS) { in cn10k_ddr_perf_counter_enable()
361 pr_err("Error: unsupported counter %d\n", counter); in cn10k_ddr_perf_counter_enable()
365 if (counter < DDRC_PERF_NUM_GEN_COUNTERS) { in cn10k_ddr_perf_counter_enable()
366 reg = DDRC_PERF_CFG(counter); in cn10k_ddr_perf_counter_enable()
378 if (counter == DDRC_PERF_READ_COUNTER_IDX) in cn10k_ddr_perf_counter_enable()
383 if (counter == DDRC_PERF_READ_COUNTER_IDX) in cn10k_ddr_perf_counter_enable()
392 static u64 cn10k_ddr_perf_read_counter(struct cn10k_ddr_pmu *pmu, int counter) in cn10k_ddr_perf_read_counter() argument
[all …]

12345678910>>...14