Lennert Buytenhek | 1 Dec 2010 01:10

Re: [PATCH 30/54] ARM: msm: irq_data conversion.

On Tue, Nov 30, 2010 at 02:57:55PM -0800, Daniel Walker wrote:

> > -static void msm_irq_ack(unsigned int irq)
> > +static void msm_irq_ack(struct irq_data *d)
> >  {
> > -       void __iomem *reg = VIC_INT_TO_REG_ADDR(VIC_INT_CLEAR0, irq);
> > -       irq = 1 << (irq & 31);
> > -       writel(irq, reg);
> > +       void __iomem *reg = VIC_INT_TO_REG_ADDR(VIC_INT_CLEAR0, d->irq);
> > +       writel(1 << (d->irq & 31), reg);
> >  } 
> 
> I haven't really looked over this patch set as a whole, but I was
> looking at this section and I noticed that your doing a small clean up
> here. If your doing this kind of conversion it's much nicer if you do
> any cleanups prior to submitting the conversion. Everyone might agree on
> the conversion that your doing, but when you interleave cleanups then
> people may be agreeing to things that are hidden inside the conversion..

Since:

	irq = 1 << (irq & 31);

modifies an argument to the function, I couldn't just change this
into:

	d->irq = 1 << (d->irq & 31);

as that would clobber d->irq permanently.

(Continue reading)

Scott Branden | 1 Dec 2010 01:12
Favicon

RE: [PATCH 10/54] ARM: bcmring: irq_data conversion.


> -----Original Message-----
> From: Lennert Buytenhek [mailto:buytenh <at> wantstofly.org]
> Sent: November 30, 2010 5:26 AM
> To: linux-arm-kernel <at> lists.infradead.org
> Cc: Leo (Hao) Chen; Scott Branden
> Subject: [PATCH 10/54] ARM: bcmring: irq_data conversion.
> 
> Signed-off-by: Lennert Buytenhek <buytenh <at> secretlab.ca>
Simple change.
Acked-by: Scott Branden <sbranden <at> broacom.com>
> ---
>  arch/arm/mach-bcmring/irq.c |   42 +++++++++++++++++++++--------------
> -------
>  1 files changed, 21 insertions(+), 21 deletions(-)
> 
> diff --git a/arch/arm/mach-bcmring/irq.c b/arch/arm/mach-bcmring/irq.c
> index e315263..84dcda0 100644
> --- a/arch/arm/mach-bcmring/irq.c
> +++ b/arch/arm/mach-bcmring/irq.c
>  <at>  <at>  -30,61 +30,61  <at>  <at> 
>  #include <mach/csp/intcHw_reg.h>
>  #include <mach/csp/mm_io.h>
> 
> -static void bcmring_mask_irq0(unsigned int irq)
> +static void bcmring_mask_irq0(struct irq_data *d)
>  {
> -	writel(1 << (irq - IRQ_INTC0_START),
> +	writel(1 << (d->irq - IRQ_INTC0_START),
>  	       MM_IO_BASE_INTC0 + INTCHW_INTENCLEAR);
(Continue reading)

Daniel Walker | 1 Dec 2010 01:15

Re: [PATCH 30/54] ARM: msm: irq_data conversion.

On Wed, 2010-12-01 at 01:10 +0100, Lennert Buytenhek wrote:
> On Tue, Nov 30, 2010 at 02:57:55PM -0800, Daniel Walker wrote:
> 
> > > -static void msm_irq_ack(unsigned int irq)
> > > +static void msm_irq_ack(struct irq_data *d)
> > >  {
> > > -       void __iomem *reg = VIC_INT_TO_REG_ADDR(VIC_INT_CLEAR0, irq);
> > > -       irq = 1 << (irq & 31);
> > > -       writel(irq, reg);
> > > +       void __iomem *reg = VIC_INT_TO_REG_ADDR(VIC_INT_CLEAR0, d->irq);
> > > +       writel(1 << (d->irq & 31), reg);
> > >  } 
> > 
> > I haven't really looked over this patch set as a whole, but I was
> > looking at this section and I noticed that your doing a small clean up
> > here. If your doing this kind of conversion it's much nicer if you do
> > any cleanups prior to submitting the conversion. Everyone might agree on
> > the conversion that your doing, but when you interleave cleanups then
> > people may be agreeing to things that are hidden inside the conversion..
> 
> Since:
> 
> 	irq = 1 << (irq & 31);
> 
> modifies an argument to the function, I couldn't just change this
> into:
> 
> 	d->irq = 1 << (d->irq & 31);
> 
> as that would clobber d->irq permanently.
(Continue reading)

Lennert Buytenhek | 1 Dec 2010 01:19

Re: [PATCH 15/54] ARM: ep93xx: irq_data conversion.

On Wed, Dec 01, 2010 at 08:33:25AM +1300, Ryan Mallon wrote:

> > -static int ep93xx_gpio_irq_type(unsigned int irq, unsigned int type)
> > +static int ep93xx_gpio_irq_type(struct irq_data *d, unsigned int type)
> >  {
> > -	struct irq_desc *desc = irq_desc + irq;
> > -	const int gpio = irq_to_gpio(irq);
> > +	struct irq_desc *desc = irq_desc + d->irq;
> 
> Is this still correct? I haven't followed much of the irq_data
> discussion, but this post (https://patchwork.kernel.org/patch/230221/)
> says that with sparse irq converting irq number to irq_desc is now a
> radix tree lookup.
> 
> I get the impression from the above email that we should be avoiding
> using irq_desc directly in these functions?

You are correct in that this construct is no longer valid with
CONFIG_SPARSE_IRQ.  It should be using irq_to_desc() instead, or
actually, it should not be looking at the irq_desc here at all.

What ep93xx wants to achieve should be possible to achieve by just
calling set_irq_handler() instead of frobbing fields in the irq_desc
directly -- that would work, right?
Ben Dooks | 1 Dec 2010 01:22

Re: [PATCH v5] ARM: s3c244x: Fix mess with gpio {set, get}_pull callbacks

On 30/11/10 20:12, Vasily Khoruzhick wrote:
> Currently the {set,get}_pull callbacks of the s3c24xx_gpiocfg_default structure
> are initalized via s3c_gpio_{get,set}pull_1up. This results in a linker
> error when only CONFIG_CPU_S3C2442 is selected:
> 
> arch/arm/plat-s3c24xx/built-in.o:(.data+0x13f4): undefined reference to
> `s3c_gpio_getpull_1up'
> arch/arm/plat-s3c24xx/built-in.o:(.data+0x13f8): undefined reference to
> `s3c_gpio_setpull_1up'
> 
> The s3c2442 has pulldowns instead of pullups compared to the s3c2440.
> The method of controlling them is the same though.
> So this patch modifies the existing s3c_gpio_{get,set}pull_1up helper functions
> to take an additional parameter deciding whether the pin has a pullup or pulldown.
> The s3c_gpio_{get,set}pull_1{down,up} functions then wrap that functions passing
> either S3C_GPIO_PULL_UP or S3C_GPIO_PULL_DOWN.
> 
> Furthermore this patch sets up the s3c24xx_gpiocfg_default.{get,set}_pull fields
> in the s3c244{0,2}_map_io function to the new pulldown helper functions.
> 
> Based on patch from "Lars-Peter Clausen" <lars <at> metafoo.de>

Ok, I think this is the best solution. I'll apply it tomorrow
if there's nothing else I can think of.
Ryan Mallon | 1 Dec 2010 01:26
Favicon

Re: [PATCH 15/54] ARM: ep93xx: irq_data conversion.

On 12/01/2010 01:19 PM, Lennert Buytenhek wrote:
> On Wed, Dec 01, 2010 at 08:33:25AM +1300, Ryan Mallon wrote:
> 
>>> -static int ep93xx_gpio_irq_type(unsigned int irq, unsigned int type)
>>> +static int ep93xx_gpio_irq_type(struct irq_data *d, unsigned int type)
>>>  {
>>> -	struct irq_desc *desc = irq_desc + irq;
>>> -	const int gpio = irq_to_gpio(irq);
>>> +	struct irq_desc *desc = irq_desc + d->irq;
>>
>> Is this still correct? I haven't followed much of the irq_data
>> discussion, but this post (https://patchwork.kernel.org/patch/230221/)
>> says that with sparse irq converting irq number to irq_desc is now a
>> radix tree lookup.
>>
>> I get the impression from the above email that we should be avoiding
>> using irq_desc directly in these functions?
> 
> You are correct in that this construct is no longer valid with
> CONFIG_SPARSE_IRQ.  It should be using irq_to_desc() instead, or
> actually, it should not be looking at the irq_desc here at all.
> 
> What ep93xx wants to achieve should be possible to achieve by just
> calling set_irq_handler() instead of frobbing fields in the irq_desc
> directly -- that would work, right?

I think set_irq_handler should be okay. The other way would be to use
irq_to_desc for the lookup.

~Ryan
(Continue reading)

Nicolas Pitre | 1 Dec 2010 01:54

Re: [PATCH 52/54] ARM: plat-orion: irq_data conversion.

On Tue, 30 Nov 2010, Lennert Buytenhek wrote:

> Signed-off-by: Lennert Buytenhek <buytenh <at> secretlab.ca>

Acked-by: Nicolas Pitre <nico <at> fluxnic.net>

> ---
>  arch/arm/plat-orion/gpio.c |   37 ++++++++++++++++++-------------------
>  arch/arm/plat-orion/irq.c  |   18 +++++++++---------
>  2 files changed, 27 insertions(+), 28 deletions(-)
> 
> diff --git a/arch/arm/plat-orion/gpio.c b/arch/arm/plat-orion/gpio.c
> index e814803..5f35223 100644
> --- a/arch/arm/plat-orion/gpio.c
> +++ b/arch/arm/plat-orion/gpio.c
>  <at>  <at>  -232,20 +232,19  <at>  <at>  EXPORT_SYMBOL(orion_gpio_set_blink);
>   *        polarity    LEVEL          mask
>   *
>   ****************************************************************************/
> -
> -static void gpio_irq_ack(u32 irq)
> +static void gpio_irq_ack(struct irq_data *d)
>  {
> -	int type = irq_desc[irq].status & IRQ_TYPE_SENSE_MASK;
> +	int type = irq_desc[d->irq].status & IRQ_TYPE_SENSE_MASK;
>  	if (type & (IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING)) {
> -		int pin = irq_to_gpio(irq);
> +		int pin = irq_to_gpio(d->irq);
>  		writel(~(1 << (pin & 31)), GPIO_EDGE_CAUSE(pin));
>  	}
(Continue reading)

Nicolas Pitre | 1 Dec 2010 01:55

Re: [PATCH 13/54] ARM: dove: irq_data conversion.

On Tue, 30 Nov 2010, Lennert Buytenhek wrote:

> Signed-off-by: Lennert Buytenhek <buytenh <at> secretlab.ca>

Acked-by: Nicolas Pitre <nico <at> fluxnic.net>

> ---
>  arch/arm/mach-dove/irq.c |   18 +++++++++---------
>  1 files changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/arch/arm/mach-dove/irq.c b/arch/arm/mach-dove/irq.c
> index 61bfcb3..9317f05 100644
> --- a/arch/arm/mach-dove/irq.c
> +++ b/arch/arm/mach-dove/irq.c
>  <at>  <at>  -36,9 +36,9  <at>  <at>  static void gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
>  	}
>  }
>  
> -static void pmu_irq_mask(unsigned int irq)
> +static void pmu_irq_mask(struct irq_data *d)
>  {
> -	int pin = irq_to_pmu(irq);
> +	int pin = irq_to_pmu(d->irq);
>  	u32 u;
>  
>  	u = readl(PMU_INTERRUPT_MASK);
>  <at>  <at>  -46,9 +46,9  <at>  <at>  static void pmu_irq_mask(unsigned int irq)
>  	writel(u, PMU_INTERRUPT_MASK);
>  }
>  
(Continue reading)

Abhijeet Dharmapurikar | 1 Dec 2010 02:08

Re: [PATCH 03/54] ARM: gic: irq_data conversion.

Works on msm 8660 surf.

Acked-by: Abhijeet Dharmapurikar <adharmap <at> codeaurora.org>

Lennert Buytenhek wrote:
> Signed-off-by: Lennert Buytenhek <buytenh <at> secretlab.ca>
> ---
>  arch/arm/common/gic.c |   62 ++++++++++++++++++++++++------------------------
>  1 files changed, 31 insertions(+), 31 deletions(-)
> 
> diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c
> index 772f95f..1118f40 100644
> --- a/arch/arm/common/gic.c
> +++ b/arch/arm/common/gic.c
>  <at>  <at>  -47,57 +47,56  <at>  <at>  struct gic_chip_data {
>  
Wan ZongShun | 1 Dec 2010 02:46
Picon

Re: [PATCH 48/54] ARM: w90x900: irq_data conversion.

2010/11/30 Lennert Buytenhek <buytenh <at> wantstofly.org>:
> Signed-off-by: Lennert Buytenhek <buytenh <at> secretlab.ca>
> ---
>  arch/arm/mach-w90x900/irq.c |   20 ++++++++++----------
>  1 files changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/arch/arm/mach-w90x900/irq.c b/arch/arm/mach-w90x900/irq.c
> index 0ce9d8e..9c35010 100644
> --- a/arch/arm/mach-w90x900/irq.c
> +++ b/arch/arm/mach-w90x900/irq.c
>  <at>  <at>  -92,15 +92,15  <at>  <at>  static void nuc900_group_enable(struct group_irq *gpirq, int enable)
>        __raw_writel(regval, REG_AIC_GEN);
>  }
>
> -static void nuc900_irq_mask(unsigned int irq)
> +static void nuc900_irq_mask(struct irq_data *d)
>  {
>        struct group_irq *group_irq;
>
>        group_irq = NULL;
>
> -       __raw_writel(1 << irq, REG_AIC_MDCR);
> +       __raw_writel(1 << d->irq, REG_AIC_MDCR);
>
> -       switch (irq) {
> +       switch (d->irq) {
>        case IRQ_GROUP0:
>                group_irq = &group_nirq0;
>                break;
>  <at>  <at>  -143,20 +143,20  <at>  <at>  static void nuc900_irq_mask(unsigned int irq)
(Continue reading)


Gmane