[PATCH] gic: implement set_type

Abhijeet Dharmapurikar adharmap at codeaurora.org
Fri May 14 12:32:00 EDT 2010


> +static int gic_set_type(unsigned int irq, unsigned int type)
> +{
> +	void __iomem *base = gic_dist_base(irq);
> +	unsigned int gicirq = gic_irq(irq);
> +	u32 enablemask = 1 << (gicirq % 32);
> +	u32 enableoff = (gicirq / 32) * 4;
> +	u32 confmask = 0x2 << ((gicirq % 16) * 2);
> +	u32 confoff = (gicirq / 16) * 4;
> +	bool enabled = false;
> +	u32 val;
> +
> +	/* Only SPIs' interrupt configuration can be changed */
> +	if (gicirq < 32)
> +		return -EINVAL;


This causes drivers who are requesting PPI's with IRQF_TRIGGER_* flags 
to fail.


Note that it is "Implementation Defined" whether PPI's are programmable 
.http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ihi0048a/index.html

I would request to change gicirq < 32 to gicirq < 16 , the writes will 
be ignored if PPI's are not programmable.

Abhijeet




More information about the linux-arm-kernel mailing list