linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: ryan@bluewatersys.com (Ryan Mallon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/9] at91: use structure to store the current soc
Date: Thu, 12 May 2011 09:42:10 +1200	[thread overview]
Message-ID: <4DCB02B2.2000301@bluewatersys.com> (raw)
In-Reply-To: <4DCA4930.4070609@atmel.com>

On 05/11/2011 08:30 PM, Nicolas Ferre wrote:
> Hi all,
> 
> Le 11/05/2011 06:19, Jean-Christophe PLAGNIOL-VILLARD :
>> On 16:12 Wed 11 May     , Ryan Mallon wrote:
>>> On 05/11/2011 03:26 PM, Jean-Christophe PLAGNIOL-VILLARD wrote:
>>>> On 12:39 Wed 11 May     , Ryan Mallon wrote:
>>>>> On 05/11/2011 11:40 AM, Jean-Christophe PLAGNIOL-VILLARD wrote:

<snip>

>>>> furthermore we associate the subtype with the subtype name where each entry
>>>> are uniq
>>>
>>> You could add:
>>>
>>> 	const char *name;
>>> 	char *subtype_name;
>>>
>>> To at91_soc_data. The name field can be directly assigned in the
>>> at91xxx.c files and the subtype name can be assigned when it is detected
>>> (which is why it can't be const). The removes the need for the
>>> type/subtype lookup tables.
>> no as we need to stock all the soc name here and it much more clear to get
>> them together and link to the enum type
>>
>> and if the soc is not enable you can not have the name so impossible to inform
>> the user about which we detect and this will add too much ifdef
> 
> Yes, the main argument here is that we should tell the use which chips
> is actually detected even if its support is not included in the kernel
> configuration.
> 
> [..]

Yes, I didn't think of that. However, it should still be possible to
mark the name lookup tables as __initdata and then copy the correct
strings into the at91_soc_data struct. This means that we have the
ability to print the name of the detected soc at init time (in case the
soc is not compiled in), but also means that we can free the lookup
tables up once we know the correct soc, and the functions for getting
the names become direct pointer accesses.

<snip>

>>>>>>> I would still like to see if it is possible to reorder these patches so
>>>>>>> that this intermediate rewrite is not needed.
>>>>>> there is none intermedaite write
>>>>>
>>>>> You snipped it out in the reply :-). Patch 2/9 adds soc detection in
>>>>> at91_map_io via a series of 'if (cpu_is_xxx)' statements. This patch
>>>>> then removes that method and replaces it with the switch statement in
>>>>> soc_detect. It would be nice to try and avoid the intermediate step in
>>>>> at91_map_io since it only exists for three commits.
>>>> no this two different changes with huge impact
>>>> first one factorize the map_io and change the AT91_BASE_SYS
>>>>
>>>> so I do prefer to keep them seperated and bre able to bisect them
>>>
>>> This patch could be made the first patch in the series since it doesn't
>>> (AFAICT) depend on AT91_BASE_SYS being generic since it uses internal
>>> defines for the two DBGU bases. So this patch would introduce an
>>> (possibly unused) soc_detection function, which can be put into use by
>>> the subsequent patches.
>>>
>>> This would make the patch series easier to review since the change to
>>> move to soc detection only gets made once, not twice as it is now.
>>
>> no I prefer to change the AT91_BASE_SYS first and touch the board
>> then add the real soc detection
>>
>> The change of the memory must be first and it's impact alot of code
> 
> I think that there is no big requirement in relation with patches order.
> As long as the "bisect" is possible and that it has a reasonable order,
> I tend to think that it is ok.

The reason I would like to see the order change is that I think it will
reduce the size of each patch since the intermediate having the soc
detection in at91_map_io will not need to exist. This makes it easier to
review patches and means that there is no need to worry about bugs in
the intermediate steps which get fixed in the later steps. Bisecting
would still be possible.

~Ryan

-- 
Bluewater Systems Ltd - ARM Technology Solution Centre

Ryan Mallon         		5 Amuri Park, 404 Barbadoes St
ryan at bluewatersys.com         	PO Box 13 889, Christchurch 8013
http://www.bluewatersys.com	New Zealand
Phone: +64 3 3779127		Freecall: Australia 1800 148 751
Fax:   +64 3 3779135			  USA 1800 261 2934

  parent reply	other threads:[~2011-05-11 21:42 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-10 16:27 AT91: soc init factorisation and fix Jean-Christophe PLAGNIOL-VILLARD
2011-05-10 16:34 ` [PATCH 1/9] at91rm9200: introduce at91rm9200_set_type to specficy cpu package Jean-Christophe PLAGNIOL-VILLARD
2011-05-10 16:34 ` [PATCH 2/9] at91: introduce commom AT91_BASE_SYS Jean-Christophe PLAGNIOL-VILLARD
2011-05-10 16:34 ` [PATCH 3/9] at91: factorize at91 interrupts init to soc Jean-Christophe PLAGNIOL-VILLARD
2011-05-10 16:34 ` [PATCH 4/9] at91: remove AT91_DBGU offset from dbgu register macro Jean-Christophe PLAGNIOL-VILLARD
2011-05-10 16:34 ` [PATCH 5/9] at91: use structure to store the current soc Jean-Christophe PLAGNIOL-VILLARD
2011-05-10 21:54   ` Ryan Mallon
2011-05-10 23:40     ` Jean-Christophe PLAGNIOL-VILLARD
2011-05-11  0:39       ` Ryan Mallon
2011-05-11  3:26         ` Jean-Christophe PLAGNIOL-VILLARD
2011-05-11  4:12           ` Ryan Mallon
2011-05-11  4:19             ` Jean-Christophe PLAGNIOL-VILLARD
2011-05-11  7:30               ` Andrew Victor
2011-05-11  8:03                 ` Jean-Christophe PLAGNIOL-VILLARD
2011-05-11  8:30               ` Nicolas Ferre
2011-05-11  8:41                 ` Nicolas Ferre
2011-05-11 21:42                 ` Ryan Mallon [this message]
2011-05-10 16:34 ` [PATCH 6/9] at91: move clock subsystem init to soc generic init Jean-Christophe PLAGNIOL-VILLARD
2011-05-10 16:34 ` [PATCH 7/9] at91: move register clocks " Jean-Christophe PLAGNIOL-VILLARD
2011-05-10 16:34 ` [PATCH 8/9] at91: factorize sram init Jean-Christophe PLAGNIOL-VILLARD
2011-05-10 23:29 ` Jean-Christophe PLAGNIOL-VILLARD
2011-05-10 23:29 ` [PATCH 9/9] at91: add arch specific ioremap support Jean-Christophe PLAGNIOL-VILLARD

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DCB02B2.2000301@bluewatersys.com \
    --to=ryan@bluewatersys.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).