Merge tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC driver updates from Olof Johansson: "This contains platform-related driver updates for ARM and ARM64. Highlights: - ARM SCMI (System Control & Management Interface) driver cleanups - Hisilicon support for LPC bus w/ ACPI - Reset driver updates for several platforms: Uniphier, - Rockchip power domain bindings and hardware descriptions for several SoCs. - Tegra memory controller reset improvements" * tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (59 commits) ARM: tegra: fix compile-testing PCI host driver soc: rockchip: power-domain: add power domain support for px30 dt-bindings: power: add binding for px30 power domains dt-bindings: power: add PX30 SoCs header for power-domain soc: rockchip: power-domain: add power domain support for rk3228 dt-bindings: power: add binding for rk3228 power domains dt-bindings: power: add RK3228 SoCs header for power-domain soc: rockchip: power-domain: add power domain support for rk3128 dt-bindings: power: add binding for rk3128 power domains dt-bindings: power: add RK3128 SoCs header for power-domain soc: rockchip: power-domain: add power domain support for rk3036 dt-bindings: power: add binding for rk3036 power domains dt-bindings: power: add RK3036 SoCs header for power-domain dt-bindings: memory: tegra: Remove Tegra114 SATA and AFI reset definitions memory: tegra: Remove Tegra114 SATA and AFI reset definitions memory: tegra: Register SMMU after MC driver became ready soc: mediatek: remove unneeded semicolon soc: mediatek: add a fixed wait for SRAM stable soc: mediatek: introduce a CAPS flag for scp_domain_data soc: mediatek: reuse regmap_read_poll_timeout helpers ...
This commit is contained in:
@@ -99,7 +99,7 @@ void knav_queue_notify(struct knav_queue_inst *inst)
|
||||
continue;
|
||||
if (WARN_ON(!qh->notifier_fn))
|
||||
continue;
|
||||
atomic_inc(&qh->stats.notifies);
|
||||
this_cpu_inc(qh->stats->notifies);
|
||||
qh->notifier_fn(qh->notifier_fn_arg);
|
||||
}
|
||||
rcu_read_unlock();
|
||||
@@ -230,6 +230,12 @@ static struct knav_queue *__knav_queue_open(struct knav_queue_inst *inst,
|
||||
if (!qh)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
qh->stats = alloc_percpu(struct knav_queue_stats);
|
||||
if (!qh->stats) {
|
||||
ret = -ENOMEM;
|
||||
goto err;
|
||||
}
|
||||
|
||||
qh->flags = flags;
|
||||
qh->inst = inst;
|
||||
id = inst->id - inst->qmgr->start_queue;
|
||||
@@ -245,13 +251,17 @@ static struct knav_queue *__knav_queue_open(struct knav_queue_inst *inst,
|
||||
if (range->ops && range->ops->open_queue)
|
||||
ret = range->ops->open_queue(range, inst, flags);
|
||||
|
||||
if (ret) {
|
||||
devm_kfree(inst->kdev->dev, qh);
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
if (ret)
|
||||
goto err;
|
||||
}
|
||||
list_add_tail_rcu(&qh->list, &inst->handles);
|
||||
return qh;
|
||||
|
||||
err:
|
||||
if (qh->stats)
|
||||
free_percpu(qh->stats);
|
||||
devm_kfree(inst->kdev->dev, qh);
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
|
||||
static struct knav_queue *
|
||||
@@ -427,6 +437,12 @@ static void knav_queue_debug_show_instance(struct seq_file *s,
|
||||
{
|
||||
struct knav_device *kdev = inst->kdev;
|
||||
struct knav_queue *qh;
|
||||
int cpu = 0;
|
||||
int pushes = 0;
|
||||
int pops = 0;
|
||||
int push_errors = 0;
|
||||
int pop_errors = 0;
|
||||
int notifies = 0;
|
||||
|
||||
if (!knav_queue_is_busy(inst))
|
||||
return;
|
||||
@@ -434,19 +450,22 @@ static void knav_queue_debug_show_instance(struct seq_file *s,
|
||||
seq_printf(s, "\tqueue id %d (%s)\n",
|
||||
kdev->base_id + inst->id, inst->name);
|
||||
for_each_handle_rcu(qh, inst) {
|
||||
seq_printf(s, "\t\thandle %p: ", qh);
|
||||
seq_printf(s, "pushes %8d, ",
|
||||
atomic_read(&qh->stats.pushes));
|
||||
seq_printf(s, "pops %8d, ",
|
||||
atomic_read(&qh->stats.pops));
|
||||
seq_printf(s, "count %8d, ",
|
||||
knav_queue_get_count(qh));
|
||||
seq_printf(s, "notifies %8d, ",
|
||||
atomic_read(&qh->stats.notifies));
|
||||
seq_printf(s, "push errors %8d, ",
|
||||
atomic_read(&qh->stats.push_errors));
|
||||
seq_printf(s, "pop errors %8d\n",
|
||||
atomic_read(&qh->stats.pop_errors));
|
||||
for_each_possible_cpu(cpu) {
|
||||
pushes += per_cpu_ptr(qh->stats, cpu)->pushes;
|
||||
pops += per_cpu_ptr(qh->stats, cpu)->pops;
|
||||
push_errors += per_cpu_ptr(qh->stats, cpu)->push_errors;
|
||||
pop_errors += per_cpu_ptr(qh->stats, cpu)->pop_errors;
|
||||
notifies += per_cpu_ptr(qh->stats, cpu)->notifies;
|
||||
}
|
||||
|
||||
seq_printf(s, "\t\thandle %p: pushes %8d, pops %8d, count %8d, notifies %8d, push errors %8d, pop errors %8d\n",
|
||||
qh,
|
||||
pushes,
|
||||
pops,
|
||||
knav_queue_get_count(qh),
|
||||
notifies,
|
||||
push_errors,
|
||||
pop_errors);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -563,6 +582,7 @@ void knav_queue_close(void *qhandle)
|
||||
if (range->ops && range->ops->close_queue)
|
||||
range->ops->close_queue(range, inst);
|
||||
}
|
||||
free_percpu(qh->stats);
|
||||
devm_kfree(inst->kdev->dev, qh);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(knav_queue_close);
|
||||
@@ -636,7 +656,7 @@ int knav_queue_push(void *qhandle, dma_addr_t dma,
|
||||
val = (u32)dma | ((size / 16) - 1);
|
||||
writel_relaxed(val, &qh->reg_push[0].ptr_size_thresh);
|
||||
|
||||
atomic_inc(&qh->stats.pushes);
|
||||
this_cpu_inc(qh->stats->pushes);
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(knav_queue_push);
|
||||
@@ -674,7 +694,7 @@ dma_addr_t knav_queue_pop(void *qhandle, unsigned *size)
|
||||
if (size)
|
||||
*size = ((val & DESC_SIZE_MASK) + 1) * 16;
|
||||
|
||||
atomic_inc(&qh->stats.pops);
|
||||
this_cpu_inc(qh->stats->pops);
|
||||
return dma;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(knav_queue_pop);
|
||||
|
Reference in New Issue
Block a user