public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
* Problem with MPC8536 and external IRQs when using a loadable kernel module
@ 2010-12-09 20:45 Mark Pearson
  2010-12-09 23:33 ` Michael Ellerman
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Pearson @ 2010-12-09 20:45 UTC (permalink / raw)
  To: linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 3872 bytes --]

I have a curious problem. This is on a MPC8636 based platform with
36-bit address space (that may or may not be important).

 

I have a very simple driver that registers for one of the external IRQs
with a trivial interrupt handler. It works great when built in as part
of the kernel.

 

However, if I make it a loadable module I get the crash shown below
(blade_irq is my IRQ handler).

 

-----Console capture ----------------------------------------

Unable to handle kernel paging request for instruction fetch

Faulting instruction address: 0xf31200f8

Oops: Kernel access of bad area, sig: 11 [#1]

COMPASS

Modules linked in: blade_pnic blade_irq_drv blade_cpld_mmap_drv

NIP: f31200f8 LR: c006a26c CTR: f31200f8

REGS: c057bdd0 TRAP: 0400   Not tainted  (2.6.32.12-131)

MSR: 00029000 <EE,ME,CE>  CR: 24024048  XER: 00000000

TASK = c0544318[0] 'swapper' THREAD: c057a000

GPR00: 00000000 c057be80 c0544318 00000012 00000000 08f9cac0 c058177c
ef820000 

GPR08: 00000200 c04a0000 f31200f8 c058a368 2dc6c000 1012b250 3ffbd200
00000000 

GPR16: 3ff91140 3ffb22f8 00000000 00000000 00000000 00000000 00000000
00000000 

GPR24: 00000000 00000000 00001600 c049fe4c 00000000 00000000 00000012
ea7975c0 

NIP [f31200f8] blade_irq+0x0/0x110 [blade_irq_drv]

LR [c006a26c] handle_IRQ_event+0x64/0x13c

Call Trace:

[c057be80] [c0547b80] 0xc0547b80 (unreliable)

[c057bea0] [c006c41c] handle_fasteoi_irq+0x68/0xf4

[c057beb0] [c0004da0] do_IRQ+0x98/0xb4

[c057bed0] [c000fe0c] ret_from_except+0x0/0x18

[c057bf90] [c0008168] cpu_idle+0x50/0xd8

[c057bfb0] [c000237c] rest_init+0x5c/0x70

[c057bfc0] [c0516850] start_kernel+0x238/0x2c4

[c057bff0] [c000039c] skpinv+0x2b4/0x2f0

Instruction dump:

7d6903a6 4e800420 3d60c007 396bb59c 7d6903a6 4e800420 38000000 38600000 

90040068 4e800020 38600000 4e800020 <9421fff0> 7c0802a6 3d20f312
bfc10008 

Kernel panic - not syncing: Fatal exception in interrupt

Rebooting in 180 seconds..

----- End of Console capture --------------------------------

 

I've done a few things

 

-          Verified the symbol address and the NIP match. They seem
correct

-          Removed all code from the IRQ handler and just return
IRQ_HANDLED. Still crashes

-          Put an infinite loop at the start of the IRQ handler - loop
isn't hit and still crashes so I assume the handler itself is never run.

-          I'm able to call my IRQ handler from the module init code and
it runs successfully. The problem is only when running in an interrupt
context.

-          I also as a somewhat stupid test passed the physical address
rather than the virtual address when registering the handler. Still
crashes (not sure if that's a valid thing to do to be honest, but I
figured it might be a virtual memory paging issue...grasping at
straws.....).

 

I do have a ticket in with Freescale support but they suggested I post
here for quicker and wider responses and if there are any ideas out
there I'd really appreciate them. Any chance anyone else has hit this
and knows a workaround or solution? Are there any examples of working
driver modules that use interrupts on the 8536 out there in case I've
done something really goofy in my code? Any suggestions of things to
try?

 

Thanks in advance 

 

Mark

 

 

 



Confidentiality Notice: This message and any attachments may contain  privileged and confidential information. If you have reason to believe that you are not the intended recipient or a person responsible for delivering this information to an intended recipient, you are hereby notified that any review, dissemination, distribution, or copying of this message is strictly prohibited. Please contact the sender immediately by reply mail and destroy all copies of the original message.


[-- Attachment #2: Type: text/html, Size: 10961 bytes --]

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

* Re: Problem with MPC8536 and external IRQs when using a loadable kernel module
  2010-12-09 20:45 Problem with MPC8536 and external IRQs when using a loadable kernel module Mark Pearson
@ 2010-12-09 23:33 ` Michael Ellerman
  2010-12-10  1:20   ` Mark Pearson
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Ellerman @ 2010-12-09 23:33 UTC (permalink / raw)
  To: Mark Pearson; +Cc: linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 854 bytes --]

On Thu, 2010-12-09 at 12:45 -0800, Mark Pearson wrote:
> I have a curious problem. This is on a MPC8636 based platform with
> 36-bit address space (that may or may not be important).
> 
>  
> 
> I have a very simple driver that registers for one of the external
> IRQs with a trivial interrupt handler. It works great when built in as
> part of the kernel.
> 
>  
> 
> However, if I make it a loadable module I get the crash shown below
> (blade_irq is my IRQ handler).
> 
>  
> 
> -----Console capture ----------------------------------------
> 
> Unable to handle kernel paging request for instruction fetch
                                            ^^^^^^^^^^^^^^^^^

Your interrupt handler isn't mapped executable? Something wrong with
module loading?

Do you need 78e2e68a2b79f394b7cd61e07987a8a89af907f7 ?

cheers



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

* RE: Problem with MPC8536 and external IRQs when using a loadable kernel module
  2010-12-09 23:33 ` Michael Ellerman
@ 2010-12-10  1:20   ` Mark Pearson
  2010-12-10  3:07     ` Michael Ellerman
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Pearson @ 2010-12-10  1:20 UTC (permalink / raw)
  To: michael; +Cc: linuxppc-dev

TWFnaWNhbCAtIHRoYW5rIHlvdSB2ZXJ5IHZlcnkgbXVjaC4gVGhlIHBhdGNoIGZpeGVzIHRoZSBw
cm9ibGVtDQoNClJlYWxseSBhcHByZWNpYXRlIHRoZSBxdWljayByZXNwb25zZSAtIGFuZCBJIHdv
dWxkIG5ldmVyIGhhdmUgZm91bmQgdGhhdCBpbiBhIG1pbGxpb24geWVhcnMuDQoNCk1hcmsNCg0K
LS0tLS1PcmlnaW5hbCBNZXNzYWdlLS0tLS0NCkZyb206IE1pY2hhZWwgRWxsZXJtYW4gW21haWx0
bzptaWNoYWVsQGVsbGVybWFuLmlkLmF1XSANClNlbnQ6IFRodXJzZGF5LCBEZWNlbWJlciAwOSwg
MjAxMCA2OjMzIFBNDQpUbzogTWFyayBQZWFyc29uDQpDYz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AgICAgICAgICAgICAgICBeXl5eXl5eXl5eXl5eXl5eXg0K
DQpZb3VyIGludGVycnVwdCBoYW5kbGVyIGlzbid0IG1hcHBlZCBleGVjdXRhYmxlPyBTb21ldGhp
bmcgd3Jvbmcgd2l0aCBtb2R1bGUgbG9hZGluZz8NCg0KRG8geW91IG5lZWQgNzhlMmU2OGEyYjc5
ZjM5NGI3Y2Q2MWUwNzk4N2E4YTg5YWY5MDdmNyA/DQoNCmNoZWVycw0KDQoNCgpDb25maWRlbnRp
YWxpdHkgTm90aWNlOiBUaGlzIG1lc3NhZ2UgYW5kIGFueSBhdHRhY2htZW50cyBtYXkgY29udGFp
biAgcHJpdmlsZWdlZCBhbmQgY29uZmlkZW50aWFsIGluZm9ybWF0aW9uLiBJZiB5b3UgaGF2ZSBy
ZWFzb24gdG8gYmVsaWV2ZSB0aGF0IHlvdSBhcmUgbm90IHRoZSBpbnRlbmRlZCByZWNpcGllbnQg
b3IgYSBwZXJzb24gcmVzcG9uc2libGUgZm9yIGRlbGl2ZXJpbmcgdGhpcyBpbmZvcm1hdGlvbiB0
byBhbiBpbnRlbmRlZCByZWNpcGllbnQsIHlvdSBhcmUgaGVyZWJ5IG5vdGlmaWVkIHRoYXQgYW55
IHJldmlldywgZGlzc2VtaW5hdGlvbiwgZGlzdHJpYnV0aW9uLCBvciBjb3B5aW5nIG9mIHRoaXMg
bWVzc2FnZSBpcyBzdHJpY3RseSBwcm9oaWJpdGVkLiBQbGVhc2UgY29udGFjdCB0aGUgc2VuZGVy
IGltbWVkaWF0ZWx5IGJ5IHJlcGx5IG1haWwgYW5kIGRlc3Ryb3kgYWxsIGNvcGllcyBvZiB0aGUg
b3JpZ2luYWwgbWVzc2FnZS4K

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

* RE: Problem with MPC8536 and external IRQs when using a loadable kernel module
  2010-12-10  1:20   ` Mark Pearson
@ 2010-12-10  3:07     ` Michael Ellerman
  2010-12-10  8:03       ` Li Yang-R58472
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Ellerman @ 2010-12-10  3:07 UTC (permalink / raw)
  To: Mark Pearson; +Cc: b24347, linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 323 bytes --]

On Thu, 2010-12-09 at 17:20 -0800, Mark Pearson wrote:
> Magical - thank you very very much. The patch fixes the problem
> 
> Really appreciate the quick response - and I would never have found that in a million years.

No worries.

Looks like someone should send 78e2e68a2b to the stable crew. FSL guys?

cheers

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

* RE: Problem with MPC8536 and external IRQs when using a loadable kernel module
  2010-12-10  3:07     ` Michael Ellerman
@ 2010-12-10  8:03       ` Li Yang-R58472
  0 siblings, 0 replies; 5+ messages in thread
From: Li Yang-R58472 @ 2010-12-10  8:03 UTC (permalink / raw)
  To: michael, Mark Pearson; +Cc: Jin Qing-B24347, linuxppc-dev

Pk9uIFRodSwgMjAxMC0xMi0wOSBhdCAxNzoyMCAtMDgwMCwgTWFyayBQZWFyc29uIHdyb3RlOg0K
Pj4gTWFnaWNhbCAtIHRoYW5rIHlvdSB2ZXJ5IHZlcnkgbXVjaC4gVGhlIHBhdGNoIGZpeGVzIHRo
ZSBwcm9ibGVtDQo+Pg0KPj4gUmVhbGx5IGFwcHJlY2lhdGUgdGhlIHF1aWNrIHJlc3BvbnNlIC0g
YW5kIEkgd291bGQgbmV2ZXIgaGF2ZSBmb3VuZCB0aGF0DQo+aW4gYSBtaWxsaW9uIHllYXJzLg0K
Pg0KPk5vIHdvcnJpZXMuDQo+DQo+TG9va3MgbGlrZSBzb21lb25lIHNob3VsZCBzZW5kIDc4ZTJl
NjhhMmIgdG8gdGhlIHN0YWJsZSBjcmV3LiBGU0wgZ3V5cz8NCg0KSSB0aGluayBpdCBoYXMgYWxy
ZWFkeSBiZWVuIHNlbnQgdG8gdGhlIHN0YWJsZUBrZXJuZWwub3JnLiAgTm90IHN1cmUgaWYgaXQg
aGFzIGJlZW4gaW5jbHVkZWQgdGhvdWdoLg0KDQotIExlbw0KDQo=

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

end of thread, other threads:[~2010-12-10  8:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-09 20:45 Problem with MPC8536 and external IRQs when using a loadable kernel module Mark Pearson
2010-12-09 23:33 ` Michael Ellerman
2010-12-10  1:20   ` Mark Pearson
2010-12-10  3:07     ` Michael Ellerman
2010-12-10  8:03       ` Li Yang-R58472

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox