LinuxPPC-Dev Archive mirror
 help / color / mirror / Atom feed
* Upgrade to 2.6.26 results in Oops during request_irq
@ 2010-04-08 21:14 Sparks, Sam
  0 siblings, 0 replies; 3+ messages in thread
From: Sparks, Sam @ 2010-04-08 21:14 UTC (permalink / raw
  To: linuxppc-dev

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:

# insmod /tmp/cpld.ko
# insmod /tmp/dig_display.ko=20
Unable to handle kernel paging request for instruction fetch
Faulting instruction address: 0x00000000
Oops: Kernel access of bad area, sig: 11 [#1]
PREEMPT SCPA-G2
Modules linked in: dig_display(+) cpld immr_misc immr [last unloaded:
cpld]
NIP: 00000000 LR: c00496e8 CTR: 00000000
REGS: dfafbdb0 TRAP: 0400   Not tainted  (2.6.26-twacs-100.0.0)
MSR: 20001032 <ME,IR,DR>  CR: 24002422  XER: 20000000
TASK =3D df9d9800[579] 'insmod' THREAD: dfafa000
GPR00: 00000000 dfafbe60 df9d9800 00000017 00000002 00000020 c00498d0
c06fe640=20
GPR08: 00000008 00000000 00000017 00000000 84002428 10073f68 1ffcb000
007ffeb0=20
GPR16: 00000000 00000000 00800000 00000000 bffff7f0 00000000 1006e3e4
00000000=20
GPR24: 00000002 e90cffd0 00000000 00009032 dfa3aca0 00000017 dfafa000
c02d0e78=20
NIP [00000000] 0x0
LR [c00496e8] setup_irq+0x2d4/0x2e0
Call Trace:
[dfafbe60] [c00496b0] setup_irq+0x29c/0x2e0 (unreliable)
[dfafbe90] [c0049904] request_irq+0xb8/0xe8
[dfafbec0] [e107e174] init_module+0x174/0x320 [dig_display]
[dfafbf10] [c0046e68] sys_init_module+0x14c/0x1d8
[dfafbf40] [c0010008] ret_from_syscall+0x0/0x38
--- Exception: c01 at 0xff27bb0
    LR =3D 0x10019ca8
Instruction dump:
XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX=20
XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX=20
Kernel panic - not syncing: Fatal exception
Rebooting in 1 seconds..<0>------------[=20

I have traced the offending code through the setup_irq() call down to
kernel/irq/manage.c, where desc->chip->enable(irq) is being called.
However, enable is NULL resulting in the Oops.

I have verified enable and disable are set to valid addresses when
set_irq() is entered. However desc->chip->set_type() references
ipic_set_irq_type(), which overwrites enable and disable by setting
desc->chip to &ipic_edge_irq_chip.

At this point, I am at a loss. Does some additional step need to be
taken prior to calling request_irq() when upgrading from 2.6.22 to
2.6.26? Please let me know if you would like any additional information.
I don't want this email to get too difficult to follow.

Thanks for the help!
Sam

=20

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

* RE: Upgrade to 2.6.26 results in Oops during request_irq
       [not found] <6011A7C9CD0EE74792C3ED2A83556086B67190@mail.twacs.com>
@ 2010-04-09 18:39 ` Sparks, Sam
  2010-04-13 13:10 ` Sparks, Sam
  1 sibling, 0 replies; 3+ messages in thread
From: Sparks, Sam @ 2010-04-09 18:39 UTC (permalink / raw
  To: linuxppc-dev

>-----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 <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/module.h>

static unsigned int cpld_virq =3D NO_IRQ;
unsigned value =3D 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 =3D 23;

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

    retval =3D  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: 0x00000000
Oops: Kernel access of bad area, sig: 11 [#1]
PREEMPT SCPA-G2
Modules linked in: cpld(+) [last unloaded: immr]
NIP: 00000000 LR: c004bab8 CTR: 00000000
REGS: dfb13df0 TRAP: 0400   Not tainted  (2.6.26-twacs-100.0.0)
MSR: 20001032 <ME,IR,DR>  CR: 24244422  XER: 20000000
TASK =3D df8b6c00[559] 'insmod' THREAD: dfb12000
GPR00: 00000000 dfb13ea0 df8b6c00 00000017 00000001 00000001 00000000
c02d1fb4
GPR08: 0000361a 00000000 00000000 00000000 44244484 10073f68 1ffcb000
007ffeb0
GPR16: 00000000 00000000 00800000 00000000 bffff7f0 00000000 1006e3dc
00000000
GPR24: 00000002 20000000 00000000 00009032 df9da620 dfb12000 c02d40e4
00000017
NIP [00000000] 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 =3D 0x10019ca8
Instruction dump:
XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX
Kernel panic - not syncing: Fatal exception

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

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

* RE: Upgrade to 2.6.26 results in Oops during request_irq
       [not found] <6011A7C9CD0EE74792C3ED2A83556086B67190@mail.twacs.com>
  2010-04-09 18:39 ` Sparks, Sam
@ 2010-04-13 13:10 ` Sparks, Sam
  1 sibling, 0 replies; 3+ messages in thread
From: Sparks, Sam @ 2010-04-13 13:10 UTC (permalink / raw
  To: linuxppc-dev

>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

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

end of thread, other threads:[~2010-04-13 13:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-08 21:14 Upgrade to 2.6.26 results in Oops during request_irq Sparks, Sam
     [not found] <6011A7C9CD0EE74792C3ED2A83556086B67190@mail.twacs.com>
2010-04-09 18:39 ` Sparks, Sam
2010-04-13 13:10 ` Sparks, Sam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).