mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] irqchip: irq-bcm7120-l2: Use correct I/O accessors for irq_fwd_mask
@ 2017-08-29 18:43 Florian Fainelli
  2017-08-30 10:48 ` Marc Zyngier
  0 siblings, 1 reply; 3+ messages in thread
From: Florian Fainelli @ 2017-08-29 18:43 UTC (permalink / raw)
  To: linux-kernel
  Cc: opendmb, bcm-kernel-feedback-list, Florian Fainelli,
	Kevin Cernekee, Thomas Gleixner, Jason Cooper, Marc Zyngier,
	open list:BROADCOM BMIPS MIPS ARCHITECTURE

Initialization of irq_fwd_mask was done using __raw_readl() which
happens to work for all cases except when using ARM BE8 which requires
readl() (with the proper swapping). Move the initialization of the
irq_fwd_mask till later when we have correctly defined our I/O
accessors.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/irqchip/irq-bcm7120-l2.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/irqchip/irq-bcm7120-l2.c b/drivers/irqchip/irq-bcm7120-l2.c
index 64c2692070ef..983640eba418 100644
--- a/drivers/irqchip/irq-bcm7120-l2.c
+++ b/drivers/irqchip/irq-bcm7120-l2.c
@@ -250,12 +250,6 @@ static int __init bcm7120_l2_intc_probe(struct device_node *dn,
 	if (ret < 0)
 		goto out_free_l1_data;
 
-	for (idx = 0; idx < data->n_words; idx++) {
-		__raw_writel(data->irq_fwd_mask[idx],
-			     data->pair_base[idx] +
-			     data->en_offset[idx]);
-	}
-
 	for (irq = 0; irq < data->num_parent_irqs; irq++) {
 		ret = bcm7120_l2_intc_init_one(dn, data, irq, valid_mask);
 		if (ret)
@@ -297,6 +291,10 @@ static int __init bcm7120_l2_intc_probe(struct device_node *dn,
 		gc->reg_base = data->pair_base[idx];
 		ct->regs.mask = data->en_offset[idx];
 
+		/* gc->reg_base is defined and so is gc->writel */
+		irq_reg_writel(gc, data->irq_fwd_mask[idx],
+			       data->en_offset[idx]);
+
 		ct->chip.irq_mask = irq_gc_mask_clr_bit;
 		ct->chip.irq_unmask = irq_gc_mask_set_bit;
 		ct->chip.irq_ack = irq_gc_noop;
-- 
1.9.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] irqchip: irq-bcm7120-l2: Use correct I/O accessors for irq_fwd_mask
  2017-08-29 18:43 [PATCH] irqchip: irq-bcm7120-l2: Use correct I/O accessors for irq_fwd_mask Florian Fainelli
@ 2017-08-30 10:48 ` Marc Zyngier
  2017-08-31  0:36   ` Florian Fainelli
  0 siblings, 1 reply; 3+ messages in thread
From: Marc Zyngier @ 2017-08-30 10:48 UTC (permalink / raw)
  To: Florian Fainelli, linux-kernel
  Cc: opendmb, bcm-kernel-feedback-list, Kevin Cernekee,
	Thomas Gleixner, Jason Cooper,
	open list:BROADCOM BMIPS MIPS ARCHITECTURE

On 29/08/17 19:43, Florian Fainelli wrote:
> Initialization of irq_fwd_mask was done using __raw_readl() which
> happens to work for all cases except when using ARM BE8 which requires
> readl() (with the proper swapping). Move the initialization of the

s/readl/writel/, I presume?

> irq_fwd_mask till later when we have correctly defined our I/O
> accessors.
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
>  drivers/irqchip/irq-bcm7120-l2.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/irqchip/irq-bcm7120-l2.c b/drivers/irqchip/irq-bcm7120-l2.c
> index 64c2692070ef..983640eba418 100644
> --- a/drivers/irqchip/irq-bcm7120-l2.c
> +++ b/drivers/irqchip/irq-bcm7120-l2.c
> @@ -250,12 +250,6 @@ static int __init bcm7120_l2_intc_probe(struct device_node *dn,
>  	if (ret < 0)
>  		goto out_free_l1_data;
>  
> -	for (idx = 0; idx < data->n_words; idx++) {
> -		__raw_writel(data->irq_fwd_mask[idx],
> -			     data->pair_base[idx] +
> -			     data->en_offset[idx]);
> -	}
> -
>  	for (irq = 0; irq < data->num_parent_irqs; irq++) {
>  		ret = bcm7120_l2_intc_init_one(dn, data, irq, valid_mask);
>  		if (ret)
> @@ -297,6 +291,10 @@ static int __init bcm7120_l2_intc_probe(struct device_node *dn,
>  		gc->reg_base = data->pair_base[idx];
>  		ct->regs.mask = data->en_offset[idx];
>  
> +		/* gc->reg_base is defined and so is gc->writel */
> +		irq_reg_writel(gc, data->irq_fwd_mask[idx],
> +			       data->en_offset[idx]);
> +
>  		ct->chip.irq_mask = irq_gc_mask_clr_bit;
>  		ct->chip.irq_unmask = irq_gc_mask_set_bit;
>  		ct->chip.irq_ack = irq_gc_noop;
> 

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny...

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] irqchip: irq-bcm7120-l2: Use correct I/O accessors for irq_fwd_mask
  2017-08-30 10:48 ` Marc Zyngier
@ 2017-08-31  0:36   ` Florian Fainelli
  0 siblings, 0 replies; 3+ messages in thread
From: Florian Fainelli @ 2017-08-31  0:36 UTC (permalink / raw)
  To: Marc Zyngier, linux-kernel
  Cc: opendmb, bcm-kernel-feedback-list, Kevin Cernekee,
	Thomas Gleixner, Jason Cooper,
	open list:BROADCOM BMIPS MIPS ARCHITECTURE

On 08/30/2017 03:48 AM, Marc Zyngier wrote:
> On 29/08/17 19:43, Florian Fainelli wrote:
>> Initialization of irq_fwd_mask was done using __raw_readl() which
>> happens to work for all cases except when using ARM BE8 which requires
>> readl() (with the proper swapping). Move the initialization of the
> 
> s/readl/writel/, I presume?

Correct, just submitted a v2 with that fixed, thanks.
-- 
Florian

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-08-31  0:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-29 18:43 [PATCH] irqchip: irq-bcm7120-l2: Use correct I/O accessors for irq_fwd_mask Florian Fainelli
2017-08-30 10:48 ` Marc Zyngier
2017-08-31  0:36   ` Florian Fainelli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®