Skip to content

Commit

Permalink
irqchips: Replace __this_cpu_ptr uses
Browse files Browse the repository at this point in the history
[ARM specific]

These are generally replaced with raw_cpu_ptr. However, in
gic_get_percpu_base() we immediately dereference the pointer. This is
equivalent to a raw_cpu_read. So use that operation there.

Cc: nicolas.pitre@linaro.org
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
  • Loading branch information
Christoph Lameter authored and Tejun Heo committed Aug 26, 2014
1 parent eee8492 commit 532d0d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions drivers/irqchip/irq-gic.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ static struct gic_chip_data gic_data[MAX_GIC_NR] __read_mostly;
#ifdef CONFIG_GIC_NON_BANKED
static void __iomem *gic_get_percpu_base(union gic_base *base)
{
return *__this_cpu_ptr(base->percpu_base);
return raw_cpu_read(base->percpu_base);
}

static void __iomem *gic_get_common_base(union gic_base *base)
Expand Down Expand Up @@ -504,11 +504,11 @@ static void gic_cpu_save(unsigned int gic_nr)
if (!dist_base || !cpu_base)
return;

ptr = __this_cpu_ptr(gic_data[gic_nr].saved_ppi_enable);
ptr = raw_cpu_ptr(gic_data[gic_nr].saved_ppi_enable);
for (i = 0; i < DIV_ROUND_UP(32, 32); i++)
ptr[i] = readl_relaxed(dist_base + GIC_DIST_ENABLE_SET + i * 4);

ptr = __this_cpu_ptr(gic_data[gic_nr].saved_ppi_conf);
ptr = raw_cpu_ptr(gic_data[gic_nr].saved_ppi_conf);
for (i = 0; i < DIV_ROUND_UP(32, 16); i++)
ptr[i] = readl_relaxed(dist_base + GIC_DIST_CONFIG + i * 4);

Expand All @@ -530,11 +530,11 @@ static void gic_cpu_restore(unsigned int gic_nr)
if (!dist_base || !cpu_base)
return;

ptr = __this_cpu_ptr(gic_data[gic_nr].saved_ppi_enable);
ptr = raw_cpu_ptr(gic_data[gic_nr].saved_ppi_enable);
for (i = 0; i < DIV_ROUND_UP(32, 32); i++)
writel_relaxed(ptr[i], dist_base + GIC_DIST_ENABLE_SET + i * 4);

ptr = __this_cpu_ptr(gic_data[gic_nr].saved_ppi_conf);
ptr = raw_cpu_ptr(gic_data[gic_nr].saved_ppi_conf);
for (i = 0; i < DIV_ROUND_UP(32, 16); i++)
writel_relaxed(ptr[i], dist_base + GIC_DIST_CONFIG + i * 4);

Expand Down
2 changes: 1 addition & 1 deletion kernel/irq/chip.c
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ void handle_percpu_devid_irq(unsigned int irq, struct irq_desc *desc)
{
struct irq_chip *chip = irq_desc_get_chip(desc);
struct irqaction *action = desc->action;
void *dev_id = __this_cpu_ptr(action->percpu_dev_id);
void *dev_id = raw_cpu_ptr(action->percpu_dev_id);
irqreturn_t res;

kstat_incr_irqs_this_cpu(irq, desc);
Expand Down

0 comments on commit 532d0d0

Please sign in to comment.