Skip to contentSkip to conversation

MIPS: AR7/BCM63xx: fix gpio_to_irq() return value

PATCH Yoichi Yuasa 4 participants 6 messages May 24, 2010 – May 27, 2010 MIPS

lore
Share & tools
lore
#0 lore raw

The return value of gpio_to_irq() is not a pointer. It's integer.

---
 arch/mips/include/asm/mach-ar7/gpio.h     |    2 +-
 arch/mips/include/asm/mach-bcm63xx/gpio.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
arch/mips/include/asm/mach-ar7/gpio.h +1 -1
index 73f9b16..abc317c 100644
@@ -24,7 +24,7 @@
 #define AR7_GPIO_MAX 32
 #define NR_BUILTIN_GPIO AR7_GPIO_MAX
 
-#define gpio_to_irq(gpio)	NULL
+#define gpio_to_irq(gpio)	-1
 
 #define gpio_get_value __gpio_get_value
 #define gpio_set_value __gpio_set_value
arch/mips/include/asm/mach-bcm63xx/gpio.h +1 -1
index 7cda8c0..1eb534d 100644
@@ -3,7 +3,7 @@
 
 #include <bcm63xx_gpio.h>
 
-#define gpio_to_irq(gpio)	NULL
+#define gpio_to_irq(gpio)	-1
 
 #define gpio_get_value __gpio_get_value
 #define gpio_set_value __gpio_set_value
Signature · 1 line
1.7.1
#1 lore raw

Kernel unaligned access

Hi list,

I am trying to run 32 bit RFS with a 64 bit kernel on a RM9000 based processor board. The board is equipped with 2 GB DIMM. When ever I initiate ftp transfer of 1 GB file I am getting following unaligned access error

ftp> get 1gfile
local: 1gfile remote: 1gfile
200 PORT command successful. Consider using PASV.
150 Opening BINARY mode data connection for 1gfile (1024000000 bytes). Unhandled kernel unaligned access[#1]:
Cpu 0

$ 0   : 0000000000000000 ffffffff804c7710 0000000000000000
0000000000000000
$ 4   : 9a5d9c1483fa8a60 ffffffffdc620000 0000000000000000
ffffffff8017f1f8
$ 8   : ffffffffdc620000 9800000001fd7ce0 980000003fa3e310
980000003fa3e3b0
$12   : ffffffff9400e0e0 000000001000001e 0000000000000000
ffffffff8055c000
$16   : 980000003fe16560 9800000001fd7ce0 980000003fe07810
0000000000000000
$20   : 0000000000000070 0000000000000038 0000000000200200
0000000000100100
$24   : 0000000000000000 000000002ad6afd8
$28   : 9800000001fd4000 9800000001fd7cb0 6800000000000000
ffffffff801041c0
Hi    : 0000000000000000
Lo    : 025d9c1482fa8a60
epc   : ffffffff8010b904 do_ade+0x1c4/0x470     Not tainted
ra    : ffffffff801041c0 handle_adel_int+0x28/0x48
Status: 9400e0e2    KX SX UX KERNEL EXL
Cause : 00000010
BadVA : 9a5d9c1483fa8a60
PrId  : 000034c1
Modules linked in: e1000 aoe bonding block2mtd
Process events/0 (pid: 4, threadinfo=9800000001fd4000,
task=9800000001fc0648)
Stack : 0000000000000000 980000003fe16560 0000000000000000
980000003fe07810
        980000003fe16570 ffffffff801041c0 0000000000000000
ffffffff80820000
        025d9c1482fa8a60 9a5d9c1483fa8a60 450805dc47954000
980000003fe07810
        0000000000000070 0000000000000010 0000000000000000
980000003f9ff440
        980000003fa3e310 980000003fa3e3b0 9800000001fd7fe0
000000000000e000
        0000000000000000 ffffffff8055c000 980000003fe16560
0000000000000000
        980000003fe07810 980000003fe16570 0000000000000070
0000000000000038
        0000000000200200 0000000000100100 0000000000000000
000000002ad6afd8
        9800000022ddf020 0000000000000000 9800000001fd4000
9800000001fd7e10
        6800000000000000 ffffffff8017f584 ffffffff9400e0e2
0000000000000000
        ...
Call Trace:
[<ffffffff8010b904>] do_ade+0x1c4/0x470
[<ffffffff801041c0>] handle_adel_int+0x28/0x48
Code: 00431024  5440005f  de220100 <68830000> 6c830007  24020000

08042e1d 00000000 3042001f

FTP of smaller files ( ~100MB) works without any issues.

If I limit memory size to 512MB from command line, ftp transfer of bigger files works as expected.

Kindly help me with your pointers to debug the issue. I am running 2.6.18 kernel.

Thanks
Anoop

#2 lore raw

Re: Kernel unaligned access

Quoted 4 lines · Anoop P.A.

I am trying to run 32 bit RFS with a 64 bit kernel on a RM9000 based processor board. The board is equipped with 2 GB DIMM. When ever I initiate ftp transfer of 1 GB file I am getting following unaligned access error

[...]

Quoted 2 lines

Kindly help me with your pointers to debug the issue. I am running 2.6.18 kernel.

Please try something less rotten. That version is almost four years old.
Lots of issues have been fixed since then. The current version is 2.6.34.

Maciej

#3 lore raw

RE: Kernel unaligned access

Hi Maciej,

Thanks for your reply but unfortunately we are not in a position to upgrade the kernel. It will be great if you can give me some pointers to debug the issue.

Thanks
Anoop

Quoted 13 lines

-----Original Message-----
From: Maciej W. Rozycki [mailto:[email protected]]
Sent: Tuesday, May 25, 2010 8:46 AM
To: Anoop P.A.
Cc: linux-mips; Ralf Baechle
Subject: Re: Kernel unaligned access

Quoted 4 lines · Anoop P.A.

I am trying to run 32 bit RFS with a 64 bit kernel on a RM9000 based processor board. The board is equipped with 2 GB DIMM. When ever I initiate ftp transfer of 1 GB file I am getting following unaligned access error

Quoted 5 lines

[...]

Quoted 2 lines

Kindly help me with your pointers to debug the issue. I am running 2.6.18 kernel.

Please try something less rotten. That version is almost four years

old.

Quoted 1 line

Lots of issues have been fixed since then. The current version is

2.6.34.

Quoted 2 lines

Maciej

#4 lore raw

RE: Kernel unaligned access

Quoted 3 lines · Anoop P.A.

Thanks for your reply but unfortunately we are not in a position to upgrade the kernel. It will be great if you can give me some pointers to debug the issue.

Well, you are on your own then.

Pointers? Well, first despite the confusing message it's not an
alignment error. The Linux kernel does not try to be particularly precise here and hardware does not always help either (the RM9000 isn't a MIPS64 architecture processor, is it?). Anyway, BadVAddr is 0x9a5d9c1483fa8a60, which clearly indicates this is a reference to an address outside the defined address space. I don't know off the head how many physical address bits the RM9000 implements, but the typical number is 40 and the extreme one is 44. Masking out the XKPHYS cache coherence mode and (optimistically) 44 address bits we are still left with 0x025d900000000000. These bits in the address are what the CPU complains about.

Second, the address looks remarkably similar to the value in $lo, that is
0x025d9c1482fa8a60. Go calculate the difference! That's probably an index to an array of some sort that went out of limits.

The rest you need to figure out yourself. It might be easier if you
disable the unaligned access emulator altogether (#ifdef it out or whatever) and let the kernel throw an error straight away. It might be that you're getting a nested fault. That's what the decoded value of EPC being do_ade+0x1c4/0x470 actually suggests.

Good luck!

Maciej