* possible endless loop in PROM initialization
@ 2007-08-20 7:59 Markus Dahms
2007-08-20 8:06 ` David Miller
2007-08-20 8:50 ` Odp: " Krzysztof Helt
0 siblings, 2 replies; 8+ messages in thread
From: Markus Dahms @ 2007-08-20 7:59 UTC (permalink / raw)
To: sparclinux; +Cc: linux-kernel
Hey,
while trying to define a non-unique devalias at the Sun PROM prompt
(the SPARCclassic X has wrong aliases for scsi, disk1, etc. in the
PROM, at least mine) I fell over a bug resulting in an endless loop
while booting the kernel.
The problem is the getting the properties list of the /aliases node.
As the next element in this list is identified by name and the
function which retrieves this property always returns the first
occurrence this goes forever....
I could track down the issue to the function __prom_nextprop() in
arch/sparc/prom/tree.c, but I am now looking for the definition of
prom_nodeops->no_nextprop() without success.
My naive solution would be to return not the first but the last
occurrence of a property.
Greetings,
Markus
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: possible endless loop in PROM initialization
2007-08-20 7:59 possible endless loop in PROM initialization Markus Dahms
@ 2007-08-20 8:06 ` David Miller
2007-08-20 10:53 ` Markus Dahms
2007-08-20 8:50 ` Odp: " Krzysztof Helt
1 sibling, 1 reply; 8+ messages in thread
From: David Miller @ 2007-08-20 8:06 UTC (permalink / raw)
To: mad; +Cc: sparclinux, linux-kernel
From: Markus Dahms <mad@automagically.de>
Date: Mon, 20 Aug 2007 09:59:49 +0200
> I could track down the issue to the function __prom_nextprop() in
> arch/sparc/prom/tree.c, but I am now looking for the definition of
> prom_nodeops->no_nextprop() without success.
When we boot the firmware provides a vector of function
pointers, and this is prom_nodeops. So prom_nodeops->no_nextprop()
is a routine inside the PROM.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: possible endless loop in PROM initialization
2007-08-20 8:06 ` David Miller
@ 2007-08-20 10:53 ` Markus Dahms
2007-08-20 11:43 ` Chris Newport
2007-08-20 18:19 ` Krzysztof Helt
0 siblings, 2 replies; 8+ messages in thread
From: Markus Dahms @ 2007-08-20 10:53 UTC (permalink / raw)
To: David Miller; +Cc: sparclinux, linux-kernel
Hello again,
David Miller wrote:
> When we boot the firmware provides a vector of function
> pointers, and this is prom_nodeops. So prom_nodeops->no_nextprop()
> is a routine inside the PROM.
Thanks. So there is no real chance to fix it but to override this
function?
The strange thing is that the PROM prompt handles it correctly:
| ok devalias scsi /iommu/sbus/espdma/esp
| scsi isn't unique
| ok cd /aliases
| ok .attributes
| scsi /iommu/sbus/espdma/esp
| screen /iommu@0,10000000/sbus@0,10001000/cgthree@3,0
| net-g net:,SUNXT_KERNEL.SUN4M
| ttyb /obio/zs@0,100000:b
| ttya /obio/zs@0,100000:a
| keyboard! /obio/zs@0,0:forcemode
| keyboard /obio/zs@0,0
| floppy /obio/SUNW,fdtwo
| scsi /iommu/sbus/espdma@4,8400000/esp@4,8800000
| net-aui /iommu/sbus/ledma@4,8400010:aui/le@4,8c00000
| net-tpe /iommu/sbus/ledma@4,8400010:tpe/le@4,8c00000
| [...]
| name aliases
Linux PROM initialization goes this way:
| scsi
| screen
| net-g
| ttyb
| ttya
| keyboard!
| keyboard
| floppy
| scsi
| screen
| net-g
[...]
As I'm not sure anymore whether the device tree (show-devs) or the aliases
(devalias) are broken on the Classic X (I "upgraded" mine to a Classic by
changing some NVRAM bytes) this may be a non-issue. But it is still an
endless loop where it don't has to be.
Markus
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: possible endless loop in PROM initialization
2007-08-20 10:53 ` Markus Dahms
@ 2007-08-20 11:43 ` Chris Newport
2007-08-20 13:19 ` Markus Dahms
2007-08-20 18:19 ` Krzysztof Helt
1 sibling, 1 reply; 8+ messages in thread
From: Chris Newport @ 2007-08-20 11:43 UTC (permalink / raw)
To: Markus Dahms; +Cc: David Miller, sparclinux, linux-kernel
Markus Dahms wrote:
>Hello again,
>
>David Miller wrote:
>
>
>>When we boot the firmware provides a vector of function
>>pointers, and this is prom_nodeops. So prom_nodeops->no_nextprop()
>>is a routine inside the PROM.
>>
>>
>
>Thanks. So there is no real chance to fix it but to override this
>function?
>The strange thing is that the PROM prompt handles it correctly:
>
>| ok devalias scsi /iommu/sbus/espdma/esp
>| scsi isn't unique
>
>
Non-unique devalias entries are NASTY. Get rid of them, for example
your second definition of scsi could be changed to scsidisk.
You should also check that any nvramrc entries do not cause conflicts,
it is common for nvramrc entries to refer to devalias entries, so you
may need to also change an nvramrc entry to match any devalias change.
You can disable the use of nvramrc from the OBP prompt with
setenv if the entry isnon-essential, they are most commonly used
where there is a mirrored root disk.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: possible endless loop in PROM initialization
2007-08-20 11:43 ` Chris Newport
@ 2007-08-20 13:19 ` Markus Dahms
0 siblings, 0 replies; 8+ messages in thread
From: Markus Dahms @ 2007-08-20 13:19 UTC (permalink / raw)
To: Chris Newport; +Cc: David Miller, sparclinux, linux-kernel
Hi,
>> | ok devalias scsi /iommu/sbus/espdma/esp
>> | scsi isn't unique
> Non-unique devalias entries are NASTY. Get rid of them, for example
> your second definition of scsi could be changed to scsidisk.
Yes, it is nasty and I don't really want to use it. But it is possible
and IMHO Linux should handle it one way or the other.
Originally I tried to workaround an Oops in esp on the Classic X which
I connected to some broken PROM entries. The PROM booted from SCSI disk
(using another device path as the scsi aliases are broken or so), but
Linux crashes on loading the SCSI driver. As already said now I use the
"recommended workaround": patching the Classic X to be a Classic.
Markus
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: possible endless loop in PROM initialization
2007-08-20 10:53 ` Markus Dahms
2007-08-20 11:43 ` Chris Newport
@ 2007-08-20 18:19 ` Krzysztof Helt
1 sibling, 0 replies; 8+ messages in thread
From: Krzysztof Helt @ 2007-08-20 18:19 UTC (permalink / raw)
To: Markus Dahms; +Cc: David Miller, sparclinux, linux-kernel
On Mon, 20 Aug 2007 12:53:20 +0200
Markus Dahms <mad@automagically.de> wrote:
> Hello again,
> As I'm not sure anymore whether the device tree (show-devs) or the aliases
> (devalias) are broken on the Classic X (I "upgraded" mine to a Classic by
> changing some NVRAM bytes) this may be a non-issue. But it is still an
> endless loop where it don't has to be.
>
I understand your problem now. The only rational solution is
to stop building the list in the build_one_prop() if the property
with already found name is defined.
Changing way the *_nextprop() works seems not a good
idea to me.
My two cents,
Krzysztof
^ permalink raw reply [flat|nested] 8+ messages in thread
* Odp: possible endless loop in PROM initialization
2007-08-20 7:59 possible endless loop in PROM initialization Markus Dahms
2007-08-20 8:06 ` David Miller
@ 2007-08-20 8:50 ` Krzysztof Helt
2007-08-20 10:34 ` Markus Dahms
1 sibling, 1 reply; 8+ messages in thread
From: Krzysztof Helt @ 2007-08-20 8:50 UTC (permalink / raw)
To: Markus Dahms; +Cc: sparclinux, linux-kernel
Dnia 20-08-2007 o godz. 9:59 Markus Dahms napisał(a):
> Hey,
>
> while trying to define a non-unique devalias at the Sun PROM prompt
> (the SPARCclassic X has wrong aliases for scsi, disk1, etc. in the
> PROM, at least mine) I fell over a bug resulting in an endless loop
> while booting the kernel.
>
> The problem is the getting the properties list of the /aliases
node.
> As the next element in this list is identified by name and the
> function which retrieves this property always returns the first
> occurrence this goes forever....
>
Could you give name of the function which contains this endless loop?
When I looked into the tree.c file for the first time I thought
it had a bug
in handling the prom_nextprop, but later I concluded that this is ok.
Maybe there is a bug there after all.
Regards,
Krzysztof
----------------------------------------------------
Wielka siatkówka we wrześniu w Starych Jabłonkach
zobacz gwiazdy siatkówki plażowej na żywo!
Mistrzostwa Świata w siatkówce plażowej 5-9.09.2007
Kliknij: http://klik.wp.pl/?adr=http%3A%2F%2Fadv.reklama.wp.pl%2Fas%2Fstarejablonki.html&sid=1262
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Odp: possible endless loop in PROM initialization
2007-08-20 8:50 ` Odp: " Krzysztof Helt
@ 2007-08-20 10:34 ` Markus Dahms
0 siblings, 0 replies; 8+ messages in thread
From: Markus Dahms @ 2007-08-20 10:34 UTC (permalink / raw)
To: Krzysztof Helt; +Cc: sparclinux, linux-kernel
Krzysztof Helt wrote,
> Could you give name of the function which contains this endless loop?
> When I looked into the tree.c file for the first time I thought
> it had a bug
> in handling the prom_nextprop, but later I concluded that this is ok.
> Maybe there is a bug there after all.
if I understood it correctly the following functions are called in this
order:
* prom_init() # arch/sparc/kernel/head.S
[...]
* create_node() # arch/sparc/kernel/prom.c
* build_prop_list() # arch/sparc/kernel/prom.c
* build_one_prop() # arch/sparc/kernel/prom.c
* prom_nextprop() # arch/sparc/prom/tree.c
* __prom_nextprop() # arch/sparc/prom/tree.c
* prom_nodeops->no_nextprop() # PROM
And this loops while getting the attributes/properties of the /aliases
node.
Greetings,
Markus
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2007-08-20 18:14 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-20 7:59 possible endless loop in PROM initialization Markus Dahms
2007-08-20 8:06 ` David Miller
2007-08-20 10:53 ` Markus Dahms
2007-08-20 11:43 ` Chris Newport
2007-08-20 13:19 ` Markus Dahms
2007-08-20 18:19 ` Krzysztof Helt
2007-08-20 8:50 ` Odp: " Krzysztof Helt
2007-08-20 10:34 ` Markus Dahms
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox