linux-mips
[Top] [All Lists]

Re: [PATCH 0/3] Alchemy: platform updates

To: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Subject: Re: [PATCH 0/3] Alchemy: platform updates
From: Manuel Lauss <mano@roarinelk.homelinux.net>
Date: Sun, 29 Mar 2009 14:38:02 +0200
Cc: Linux-MIPS <linux-mips@linux-mips.org>
In-reply-to: <49CF5CE6.1070003@ru.mvista.com>
Organization: Private
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1238318822-4772-1-git-send-email-mano@roarinelk.homelinux.net> <49CF5CE6.1070003@ru.mvista.com>
Sender: linux-mips-bounce@linux-mips.org
Hi Sergei,

> > Patch overview:
> >
> > #1: eliminate alchemy/common/platform.c.  Add platform device
> >     registration to all boards instead.
> >   
> 
>   I'm strongly voting against this, as it causes totally unneeded code 
> duplication. Please don't apply.

I know it seems like a lot of unecessary duplication.  My reasons for
doing this are

a) I want to get rid of the various cpu-type specific config symbols,
   (i.e. I want one kernel binary to run on 2 or more Alchemy boards
   with different cpu models.  There's no technical reason this
   shouldn't work.  The OHCI block for instance has different addresses
   on pre-Au1200 silicon; the easiest solution to that (for me) is
   to simply move device registration to the boards that need/want it.)

   (BTW, what do you think about this?  Please tell me now if I ever
    have a chance to get your approval on this, so I can stop wasting
    my and everybody else's time as soon as possible). 

b) the way it is now just seems wrong to me, probably comes from working
   on SH port where each board registers the devices it needs.  I know
   this is in no way a valid technical justification; but everytime I
   look at this file something tells me it is just wrong ;)

 
> >     I realize this is a lot of (needless) code duplication at first,
> >     but it seems a lot cleaner to me if each board registered the
> >     devices it needs/wants.
> >   
> 
>    No, it's certainly a step backwards. You could make the common code 
> more flexible by checking what devices are enabled and registering them 
> selectively


Please elaborate.  Shall I check for a config symbol or if bootloader
has enabled the peripherals?  The latter is IMO stupid since the
bootloader should only load an OS and not preemptively enable every
device which might some day be used just because the running OS doesn't
know what it wants...

        Manuel Lauss

<Prev in Thread] Current Thread [Next in Thread>