RE: Upgrade to 2.6.26 results in Oops during request_irq

2010-04-13 Thread Sparks, Sam
>From: Sparks, Sam
>Sent: Thursday, April 08, 2010 4:15 PM
>
>Howdy All,
>
>I have (almost) successfully upgraded from Linux 2.6.22 to 2.6.26 (both
>downloaded from debian) on my mpc8347 powerpc, but I think I may be
>missing a required change to my dts regarding the IPIC or maybe a
change
>in how my driver requests IRQs.
>
>I have several modules that are maintained outside the kernel tree, and
>all but one is working correctly. The offending driver is attempting to
>register IRQ 23, and is accessing an invalid memory location. I am
>currently getting the following stack dump:

Aha! I have found that change that caused my module to break:
http://www.mail-archive.com/linuxppc-dev@lists.ozlabs.org/msg09748.html

This patch modified ipic_set_irq_type to override the handle_irq
function pointer.

Do I need to register a new function to handle falling edge triggered
external interrupts? It appears the default is NULL.

--Sam


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


RE: Upgrade to 2.6.26 results in Oops during request_irq

2010-04-09 Thread Sparks, Sam
>-Original Message-
>From: Sparks, Sam
>Sent: Thursday, April 08, 2010 4:15 PM

In the interest of making it easier for someone to help, I've been able
to replicate the problem with the following minimal kernel module:

#include 
#include 
#include 

static unsigned int cpld_virq = NO_IRQ;
unsigned value = 0xdeadbeef;

static irqreturn_t cpld_isr(int irq, void *dev_id) {
return IRQ_HANDLED;
}

void __exit cpld_cleanup(void) {
irq_dispose_mapping(cpld_virq);
return;
}

int __init cpld_init(void) {
int retval;
unsigned long cpld_interrupt = 23;

cpld_virq = irq_create_mapping(NULL, cpld_interrupt);
if (cpld_virq == NO_IRQ) {
printk(KERN_ERR "Could not map HW IRQ %lu\n", cpld_interrupt);
return -EBUSY;
}

retval =  request_irq(cpld_virq, cpld_isr,
IRQF_DISABLED | IRQF_SHARED | IRQF_TRIGGER_FALLING,
"CPLD", &value);
if (retval) {
irq_dispose_mapping(cpld_virq);
return retval;
}

return 0;
}

module_init(cpld_init);
module_exit(cpld_cleanup);
MODULE_LICENSE("Dual BSD/GPL");

It builds fine, but still gives me the same error when inserted into the
kernel:

# insmod /tmp/cpld.ko
Unable to handle kernel paging request for instruction fetch
Faulting instruction address: 0x
Oops: Kernel access of bad area, sig: 11 [#1]
PREEMPT SCPA-G2
Modules linked in: cpld(+) [last unloaded: immr]
NIP:  LR: c004bab8 CTR: 
REGS: dfb13df0 TRAP: 0400   Not tainted  (2.6.26-twacs-100.0.0)
MSR: 20001032   CR: 24244422  XER: 2000
TASK = df8b6c00[559] 'insmod' THREAD: dfb12000
GPR00:  dfb13ea0 df8b6c00 0017 0001 0001 
c02d1fb4
GPR08: 361a    44244484 10073f68 1ffcb000
007ffeb0
GPR16:   0080  b7f0  1006e3dc

GPR24: 0002 2000  9032 df9da620 dfb12000 c02d40e4
0017
NIP [] 0x0
LR [c004bab8] setup_irq+0x4e0/0x510
Call Trace:
[dfb13ea0] [c004ba70] setup_irq+0x498/0x510 (unreliable)
[dfb13ed0] [c004bd64] request_irq+0xe0/0x130
[dfb13f00] [e107804c] cpld_init+0x4c/0xe8 [cpld]
[dfb13f10] [c0048c4c] sys_init_module+0x14c/0x1d8
[dfb13f40] [c0010008] ret_from_syscall+0x0/0x38
--- Exception: c01 at 0xff27bb0
LR = 0x10019ca8
Instruction dump:
       
       
Kernel panic - not syncing: Fatal exception

Please let me know if I should be providing some additional information.
Thanks,
Sam

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev