AnsweredAssumed Answered

How to make FIQ work with vanilla kernel 3.18?

Question asked by Joshua Clayton on Dec 31, 2014
Latest reply on Jan 12, 2015 by Joshua Clayton

I am having trouble getting a FIQ enabled wtih linux 3.18

 

We have an application that takes data from a FPGA over the EIM bus at 50kHz.

 

Porting to 3.18, the old code causes a panic.

I switch ed to use enable_fiq(), and it almost works. It just seems to fall back to the GIC. (I see about 50k interrupts per second in a spurious Irq handler that is set up with request_irq(), but not enabled)

 

More seriously, I cannot figure out how to put those irq's on cpu 3.

 

As a result of cpu0 resource contention with network irqs, my userspace application doesn't get all the data...

 

int evi_init_fiq(struct evifpga_device *dev)

{

        int ret;

 

        disable_fiq(dev->irq);

        ret = claim_fiq(&fiq_handle);

 

        if (ret) {

                printk(KERN_ALERT "EVi - Unable to claim FIQ\n");

                return ret;

        }          

 

        set_fiq_handler(&evi_fiq_handler, SZ_256);

        enable_fiq(dev->irq);

 

        if (ret) {

                printk(KERN_ALERT "EVi - Unable to enable FIQ on CPU %d\n", FIQ_CPU_TARGET);

                release_fiq(&fiq_handle);

                return ret;

        }          

        return 0;  

}

 

On 3.0.35  We used a FIQ interrupt on cpu core 3, and then added an isolcpu=3 to the kernel command line to get reliable 50k data.

fiq was enabled by the following:

 

void fiq_enable(void * data)

{

        unsigned long val;

        val = readl(GIC_CPU_CTRL);

        val |= GIC_CPU_CTRL_BITS_FIQEN;

        writel(val, GIC_CPU_CTRL);

}

I noticed that several of the needed address macros were not exported, and attempts to define them but leave the code otherwise untouched resulted in a kernel panic.

GIC_CPU_CTRL is defined as 0x0 (address ZERO!!!111!!) in 3.0.35, so I'm not sure how this ever worked, but it did.

 

Message was edited by: Joshua Clayton Remove the reference to initiating the FIQ on a specific cpu core. I don't need this anymore

Outcomes