linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* request region in the wrong spot?
@ 2000-08-06 21:33 Tom Gall
  2000-08-07  1:01 ` Jeff Garzik
  2000-08-08  5:48 ` Paul Mackerras
  0 siblings, 2 replies; 3+ messages in thread
From: Tom Gall @ 2000-08-06 21:33 UTC (permalink / raw)
  To: linuxppc-dev


Greetings,

  I've been working to get the Power3 work up and rolling with
2.4.0-test5.

  In arch/ppc/kernel/chrp_setup.c there is the following:

    236 void __init
    237 chrp_setup_arch(void)
    238 {
    239     extern char cmd_line[];
    240     struct device_node *device;
    241
    242     /* init to some ~sane value until calibrate_delay() runs */
    243     loops_per_sec = 50000000;
    244
    245 #ifdef CONFIG_BLK_DEV_INITRD
    246     /* this is fine for chrp */
    247     initrd_below_start_ok = 1;
    248
    249     if (initrd_start)
    250         ROOT_DEV = MKDEV(RAMDISK_MAJOR, 0);
    251     else
    252 #endif
    253         ROOT_DEV = to_kdev_t(0x0802); /* sda2 (sda1 is for the
kernel) */
    254     printk("Boot arguments: %s\n", cmd_line);
    255
    256     request_region(0x20,0x20,"pic1");
    257     request_region(0xa0,0x20,"pic2");
    258     request_region(0x00,0x20,"dma1");
    259     request_region(0x40,0x20,"timer");
    260     request_region(0x80,0x10,"dma page reg");
    261     request_region(0xc0,0x20,"dma2");

This is evil as request region does:

217 struct resource * __request_region(struct resource *parent, unsigned
long start, unsigned long n, const char *name)
218 {
219         struct resource *res = kmalloc(sizeof(*res), GFP_KERNEL);
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  Yes that's right a kmalloc. At this point if I am correct the kernel
is not ready to be doing kmallocs. This tanked my kernel.

  I propose moving this 6 request region calls to

  arch/ppc/kernel/setup.c in ppc_init()

  which is called by init/main do_basic_setup() fairly early.

  Is this a reasonable fix?

--
Regards,

Tom

-----------------------------------------------------------
Linux Guy          "My heart is human, my blood is boiling,
tgall@uswest.net    my brain IBM" -- Mr Roboto, Styxx

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

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

* Re: request region in the wrong spot?
  2000-08-06 21:33 request region in the wrong spot? Tom Gall
@ 2000-08-07  1:01 ` Jeff Garzik
  2000-08-08  5:48 ` Paul Mackerras
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff Garzik @ 2000-08-07  1:01 UTC (permalink / raw)
  To: Tom Gall; +Cc: linuxppc-dev


Tom Gall wrote:
>   I propose moving this 6 request region calls to
>
>   arch/ppc/kernel/setup.c in ppc_init()
>
>   which is called by init/main do_basic_setup() fairly early.
>
>   Is this a reasonable fix?

Generally pre-kmalloc request_region calls should occur in the form of
static struct resource variables being passed to __request_region.

	Jeff




--
Jeff Garzik              |
Building 1024            | Yossarian lives.
MandrakeSoft, Inc.       |

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

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

* Re: request region in the wrong spot?
  2000-08-06 21:33 request region in the wrong spot? Tom Gall
  2000-08-07  1:01 ` Jeff Garzik
@ 2000-08-08  5:48 ` Paul Mackerras
  1 sibling, 0 replies; 3+ messages in thread
From: Paul Mackerras @ 2000-08-08  5:48 UTC (permalink / raw)
  To: Tom Gall; +Cc: linuxppc-dev


Tom,

>   I propose moving this 6 request region calls to
>
>   arch/ppc/kernel/setup.c in ppc_init()
>
>   which is called by init/main do_basic_setup() fairly early.
>
>   Is this a reasonable fix?

I suggest you instead put the calls in chrp_init2 in chrp_setup.c.  I
have just about got 2.4.0-test6-pre6 working on the longtrail chrp
here, have a look at the linuxcare.com.au::linux-pmac-devel tree.

Paul.

--
Paul Mackerras, Senior Open Source Researcher, Linuxcare, Inc.
+61 2 6262 8990 tel, +61 2 6262 8991 fax
paulus@linuxcare.com.au, http://www.linuxcare.com.au/
Linuxcare.  Support for the revolution.

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

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

end of thread, other threads:[~2000-08-08  5:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-08-06 21:33 request region in the wrong spot? Tom Gall
2000-08-07  1:01 ` Jeff Garzik
2000-08-08  5:48 ` Paul Mackerras

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 NNTP newsgroup(s).