Subject: Ooops in kmalloc from request_region

From: Liam Davies <[email-masked]>
Date: Wed, 14 Feb 2001 14:00:38 +1000

I am currently at the stage of calling request_region in my irq_setup 
function.
The call to request_region does a kmalloc which oops. The box has 256Mb Ram.

Is this the right stage to be doing this call? Is there something that I 
have missed
in setting up the memory regions or paging?

Thanks
Liam Davies

Unable to handle kernel paging request at virtual address 10003278, epc 
== 80035314, ra == 800a1d60
Oops in fault.c:do_page_fault, line 172:

static void __init cobalt_irq_setup(void)
{
       set_cp0_status(ST0_IM, 0);

       set_except_vector(0, cobalt_handle_int);

---->> request_region(0xb0000020, 0x20, "pic1");
       request_region(0xb00000A0, 0x20, "pic2");
...

---

From: Steve Johnson <[email-masked]>
Date: Wed, 14 Feb 2001 06:16:08 -0700

Liam,

    You can't call kmalloc that early in the startup process.  Look at main.c,
and init_IRQ comes before any of the memory initialization.

    Steve

---

From: Geert Uytterhoeven <[email-masked]>
Date: Wed, 14 Feb 2001 14:19:31 +0100 (MET)

> > in setting up the memory regions or paging?

Hence use request_resource() while passing a statically allocated and
initialized struct resource instead.

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven ------------- Sony Software Development Center Europe (SDCE)
[email-masked] ------------------- Sint-Stevens-Woluwestraat 55
Voice +32-2-7248626 Fax +32-2-7262686 ---------------- B-1130 Brussels, Belgium