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

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 ME,IR,DR  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


Upgrade to 2.6.26 results in Oops during request_irq

2010-04-08 Thread Sparks, Sam
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 
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: dig_display(+) cpld immr_misc immr [last unloaded:
cpld]
NIP:  LR: c00496e8 CTR: 
REGS: dfafbdb0 TRAP: 0400   Not tainted  (2.6.26-twacs-100.0.0)
MSR: 20001032 ME,IR,DR  CR: 24002422  XER: 2000
TASK = df9d9800[579] 'insmod' THREAD: dfafa000
GPR00:  dfafbe60 df9d9800 0017 0002 0020 c00498d0
c06fe640 
GPR08: 0008  0017  84002428 10073f68 1ffcb000
007ffeb0 
GPR16:   0080  b7f0  1006e3e4
 
GPR24: 0002 e90cffd0  9032 dfa3aca0 0017 dfafa000
c02d0e78 
NIP [] 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 = 0x10019ca8
Instruction dump:
        
        
Kernel panic - not syncing: Fatal exception
Rebooting in 1 seconds..0[ 

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

 

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


Compact flash on mpc8349eITX

2008-08-01 Thread Sparks, Sam
I'm trying to get the compact flash up and running on an mpc8349eITX,
and am continually running into issues where the IRQ is not processed,
and the mmio commands are not getting response. At this point, I am
starting to suspect a HW issue, but I was hoping to verify that I am
using a known good kernel configuration.

Has anyone successfully communicated with a compact flash device in true
IDE mode on the MPC8349eITX? If so, do you happen to know the kernel
configuration and/or revision?

I appreciate any help, as I am really getting stuck here.
Regards,
Sam

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


RE: Compact flash on mpc8349eITX

2008-08-01 Thread Sparks, Sam
From: Anton Vorontsov
Sent: Friday, August 01, 2008 11:51 AM

Works like a charm here. I use quite outdated u-boot though. Which one
you use? I could try it (if it is community u-boot).

I'm using the head, which I grabbed last week: U-Boot
1.3.4-rc1-00012-g1953d12
TIA for checking your itx with this version.


As for the backtrace you posted recently, I remeber I've noticed the
similar issue long ago on some mITX board. I believe the board had
hw issues indeed (or CF card I tested with). The problem could be in
the IRQ line itself (for some reason it always low), or it could be
IDE cmd/data lines at fault, so that IDE can't receive status read
command and does not deassert the interrupt line... quite hard to
tell.

Thanks for confirming.. I was losing my mind :-)
This looks like it is indeed a HW problem with the ITX. Are you aware of
any threads/documents describing the issue? We based our custom HW off
the ITX schematic with regards to the CF, and I hope we didn't copy over
_that_ problem :-/

Cheers,
Sam

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


Compact Flash on 8349mITX

2008-07-31 Thread Sparks, Sam
Hello All,

I'm using the latest 2.2.26 kernel image from
linux/kernel/git/benh/powerpc.git on a mpc8349mITX, and trying to get
Compact Flash to work. The kernel booted fine, but I was surprised to
see Compact Flash IRQ was not being handled. Does irq polling need to be
used for compact flash to work with this version of the kernel on this
board?

Here's snip of the unhandled IRQ, for your edification.

irq 23: nobody cared (try booting with the irqpoll option)
Call Trace:
[cf829a30] [c00087d4] 0xc00087d4 (unreliable)
[cf829a60] [c0052844] 0xc0052844
[cf829a80] [c0052ac4] 0xc0052ac4
[cf829ac0] [c0053520] 0xc0053520
[cf829ad0] [c000581c] 0xc000581c
[cf829ae0] [c0012adc] 0xc0012adc
--- Exception: 501 at 0xc002f1e0
LR = 0xc00058c8
[cf829ba0] [c02d4ef8] 0xc02d4ef8 (unreliable)
[cf829bd0] [c00058c8] 0xc00058c8
[cf829be0] [c002f394] 0xc002f394
[cf829bf0] [c0005820] 0xc0005820
[cf829c00] [c0012adc] 0xc0012adc
--- Exception: 501 at 0xc0052450
LR = 0xc0052574
[cf829cf0] [c00527e0] 0xc00527e0
[cf829d20] [c0053a04] 0xc0053a04
[cf829d40] [c01a7d88] 0xc01a7d88
[cf829d70] [c029a5bc] 0xc029a5bc
[cf829db0] [c029a8b4] 0xc029a8b4
[cf829e40] [c0202d10] 0xc0202d10
[cf829e60] [c017ab60] 0xc017ab60
[cf829e80] [c017ad6c] 0xc017ad6c
[cf829ea0] [c0179758] 0xc0179758
[cf829ed0] [c017adc4] 0xc017adc4
[cf829ee0] [c017a180] 0xc017a180
[cf829f10] [c017b39c] 0xc017b39c
[cf829f30] [c0202f80] 0xc0202f80
[cf829f40] [c0320750] 0xc0320750
[cf829f50] [c03007ac] 0xc03007ac
[cf829fd0] [c0300994] 0xc0300994
[cf829ff0] [c0012268] 0xc0012268
handlers:
[c01b35c0]
Disabling IRQ #23


Thanks for the help,
Sam

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


RE: Compact Flash on 8349mITX

2008-07-31 Thread Sparks, Sam
From: Sparks, Sam 
Sent: Thursday, July 31, 2008 8:15 AM
Does irq polling need to be used for compact flash to work 
with this version of the kernel on this board?

When I remove the interrupt definition from the DTS (to cause
irqpolling), the ata driver gets stuck in a loop displaying the
following. Does anyone have any insight?
ata1.00: status: { DRDY }
ata1.00: qc timeout (cmd 0xec)
ata1.00: failed to IDENTIFY (I/O error, err_mask=0x4)
ata1.00: revalidation failed (errno=-5)
ata1: hard resetting link
ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
ata1.00: configured for UDMA/100
ata1: EH complete
ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
ata1.00: cmd c8/00:08:00:00:00/00:00:00:00:00/e0 tag 0 dma 4096 in
 res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x20 (host bus
error)

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


mpc8349mITX developement repository

2008-07-29 Thread Sparks, Sam
Which repository on kernel.org should I use to pick up the
latest-greatest software for the mpc8349mITX?
 
I've tried linux/kernel/git/vitb/linux-2.6-8xx.git, but the dts doesn't
contain compact flash nodes.
I've tried linux/kernel/git/paulus/powerpc.git, but the kernel hangs
while trying to uncompress.
 
TIA,
Sam

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


mpc8349-mITX DTB load failure

2008-07-28 Thread Sparks, Sam
Hello All,

I am trying to boot the mpc8349-mITX board with Compact flash support,
and am unable to boot the Linux kernel. Here is the pertinant versioning
information:
DTC 1.2.0-rc2-g17773b0e
U-Boot 1.3.4-rc1-00012-g1953d12
Linux-2.6.26-05752-g93ded9b

I've built the DTB using the following two commands - neither change the
error I get during boot-up.
$ ../dtc/dtc -b 0 -I dts -O dtb -R 4 -S 0x3000 -o
/tftproot/ssparks/itx/cf2/itx.dtb -V 17
arch/powerpc/boot/dts/mpc8349emitx.dts
$ ../dtc/dtc -I dts -O dtb -o /tftproot/ssparks/itx/cf2/itx2.dtb
arch/powerpc/boot/dts/mpc8349emitx.dts

Can anyone shed any light onto what I am doing to cause the following
error? I haven't been able to find this error message in the mailing
list or by asking google...
## Booting kernel from Legacy Image at 01001000 ...
   Image Name:   Linux-2.6.26-05752-g93ded9b
   Created:  2008-07-24  20:40:59 UTC
   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
   Data Size:1708661 Bytes =  1.6 MB
   Load Address: 
   Entry Point:  
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
## Flattened Device Tree blob at 0100
   Booting using the fdt blob at 0x100
   Loading Device Tree to 007fb000, end 007ff526 ... OK
WARNING: could not create /chosen FDT_ERR_BADSTRUCTURE.
ERROR: /chosen node create failed - must RESET the board to recover.
Resetting the board.

Thanks for the help,
Sam

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


RE: mpc8349-mITX DTB load failure

2008-07-28 Thread Sparks, Sam
 From: Grant Likely
 Sent: Monday, July 28, 2008 12:17 PM
 
 On Mon, Jul 28, 2008 at 11:10:47AM -0500, Sparks, Sam wrote:
  Hello All,
  
  I am trying to boot the mpc8349-mITX board with Compact 
 flash support, 
  and am unable to boot the Linux kernel. Here is the pertinant 
  versioning
  information:
  DTC 1.2.0-rc2-g17773b0e
  U-Boot 1.3.4-rc1-00012-g1953d12
  Linux-2.6.26-05752-g93ded9b
  
  I've built the DTB using the following two commands - 
 neither change 
  the error I get during boot-up.
  $ ../dtc/dtc -b 0 -I dts -O dtb -R 4 -S 0x3000 -o 
  /tftproot/ssparks/itx/cf2/itx.dtb -V 17 
  arch/powerpc/boot/dts/mpc8349emitx.dts
  $ ../dtc/dtc -I dts -O dtb -o /tftproot/ssparks/itx/cf2/itx2.dtb
  arch/powerpc/boot/dts/mpc8349emitx.dts
 
 Try adding -p 0x3000 to ensure that you get padding to the blob.
 
 g.
 

No luck there, either. I ran into a issue with space a year ago, and was
getting the FDT_ERR_NOSPACE error until I added the -S 0x3000 option.
This looks like something completely different.

Thanks tho,
Sam

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


RE: mpc8349-mITX DTB load failure

2008-07-28 Thread Sparks, Sam
 From: Grant Likely
 Sent: Monday, July 28, 2008 1:03 PM
 Does your dts source file already have a chosen node?  There 
 had been an issue where u-boot cacks if chosen was pre-created.

Nope, there is no reference to chosen in the dts

--Sam

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


RE: mpc8349-mITX DTB load failure

2008-07-28 Thread Sparks, Sam
 From: Kim Phillips
 Sent: Monday, July 28, 2008 1:31 PM
  ## Booting kernel from Legacy Image at 01001000 ...
 
  ## Flattened Device Tree blob at 0100
 
 so the dtb is being loaded only 0x1000 bytes from the kernel, 
 yet it's probably bigger than that.  Can you try different 
 load addresses, preferably with the two images at least 
 0x3000 bytes apart?

Ouch. Thanks for pointing that out, it worked. :-)

--Sam

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