Status of PCI-PCI bridge on UMAX S900
Quoted 3 lines
just a short followup to the message i sent to debian-powerpc, i applied the following diff and was able to move my usb board to the other side of
the
Quoted 16 lines
umax/s900 bridge w/o any ill effect:
prom.c Thu Dec 28 09:06:16 2000 renamed from prom.c.000 Thu Dec 28 08:43:12 2000 +2
-2@@ -1563,8 +1563,8 @@ } ip = (int *) get_property(np, "AAPL,interrupts", &l); - if (ip == 0) - ip = (int *) get_property(np, "interrupts", &l); + if (ip == 0 && np->parent != NULL) + ip = (int *) get_property(np->parent, "AAPL,interrupts", &l); if (ip != 0) { np->intrs = (struct interrupt_info *) mem_start;
Quoted 1 line
np->n_intrs = l / sizeof(int);
Doh! I didn't even think to check if the second get_property() call was returning > 0.. this fixes it! Thanks bunches for spotting that!
Quoted 10 lines
on a related, note, shouldnt the 'right' code be:
ip = (int *) get_property(np, "interrupts", &l); if (ip > 0) { /* find and assign interrupt -- see above */ }pci boards should only get an interrupt if they have the interrupt property (which seems to be the number of interrupts, not the interrupt
number)
Seems correct to me, but I'm no kernel guru, so I'll let someone else answer
authoritatively.
-j
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Quoted 2 lines · In message <[email protected]>,jingai writes:
Doh! I didn't even think to check if the second
get_property()call was returning > 0.. this fixes it! Thanks bunches for spotting that!
it seems like someone was confused about the meaning of the 'interrupts' property when they wrote prom.c. its basically the number of interrupts supported by this pci device. interpret_dbdma_props() also has the same confusion, so the following would be a more complete patch to prom.c. note that it checks to see if a pci node has an interrupt property before assigning one, otherwise devices on the far side of a pci bridge (that shares interrupts) would be assigned interrupts when they dont need them.
prom.c renamed from prom.c.000 +10 -4
@@ -1562,9 +1562,12 @@return mem_start; } +if ((ip = (int *)get_property (np,"interrupts" , &l)) ==0 ) +return mem_start; + ip = (int *)get_property (np,"AAPL,interrupts" , &l); -if (ip ==0 ) - ip = (int *)get_property (np,"interrupts" , &l); +if (ip ==0 && np->parent !=NULL ) + ip = (int *)get_property (np->parent,"AAPL,interrupts" , &l);if (ip !=0 ) { np->intrs = (struct interrupt_info *) mem_start; np->n_intrs = l /sizeof (int );
@@ -1615,9 +1618,12 @@if (use_of_interrupt_tree)return mem_start; +if ((ip = (int *)get_property (np,"interrupts" , &l)) ==0 ) +return mem_start; + ip = (int *)get_property (np,"AAPL,interrupts" , &l); -if (ip ==0 ) - ip = (int *)get_property (np,"interrupts" , &l); +if (ip ==0 && np->parent !=NULL ) + ip = (int *)get_property (np->parent,"AAPL,interrupts" , &l);if (ip !=0 ) { np->intrs = (struct interrupt_info *) mem_start; np->n_intrs = l /sizeof (int );
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Quoted 4 lines · Chas Williams
Quoted 2 lines · In message <[email protected]>,jingai writes:
Doh! I didn't even think to check if the second
get_property()call was returning > 0.. this fixes it! Thanks bunches for spotting that!
Quoted 8 lines
it seems like someone was confused about the meaning of the 'interrupts' property when they wrote
prom.c. its basically the number of interrupts supported by this pci device.interpret_dbdma_props()also has the same confusion, so the following would be a more complete patch toprom.c. note that it checks to see if a pci node has an interrupt property before assigning one, otherwise devices on the far side of a pci bridge (that shares interrupts) would be assigned interrupts when they dont need them.
Today I tried your patch. Well, I breaks the hole interrupt stuff. Now, even Mesh has trouble with interrupts (kernel crash), the console=ttyS0 doesn't work so no output from the booting ...
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Quoted 10 lines
Quoted 9 lines
it seems like someone was confused about the meaning of the 'interrupts' property when they wrote
prom.c. its basically the number of interrupts supported by this pci device.interpret_dbdma_props()also has the same confusion, so the following would be a more complete patch toprom.c. note that it checks to see if a pci node has an interrupt property before assigning one, otherwise devices on the far side of a pci bridge (that shares interrupts) would be assigned interrupts when they dont need them.
Quoted 3 lines
Today I tried your patch. Well, I breaks the hole interrupt stuff. Now, even Mesh has trouble with interrupts (kernel crash), the console=ttyS0 doesn't work so no output from the booting ...
The "interrupts" property can have various meanings depending on the OF version, I suggest you don't mess with it. Just check that if you find no AAPL,interrupts, and that pmac_newworld == 0, then look for parent AAPL,interrupts.
Ben.
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Benjamin Herrenschmidt writes:
Ben> The "interrupts" property can have various meanings depending on the OF Ben> version, I suggest you don't mess with it. Just check that if you find no Ben> AAPL,interrupts, and that pmac_newworld == 0, then look for parent Ben> AAPL,interrupts.
"interrupts" property is well-defined in the OF spec for each
device-tree node, but I do not think that prom.c currently has enough parsing ability to handle the complexity or makes too many assumption. And it does not need to fully parse that property, as Ben suggests.
David
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Quoted 5 lines
"interrupts" property is well-defined in the OF spec for each
device-tree node, but I do not think thatprom.ccurrently has enough parsing ability to handle the complexity or makes too many assumption. And it does not need to fully parse that property, as Ben suggests.
I didn't say it wasn't well defined ;) I said it's usage by Apple is not.
prom.c has an interrupt tree parser that is used only on newworld macs (they have a valid interrupt tree) and only when booting via Open Firmware (booting via MacOS kills too much infos from the device tree to be able to parse the interrupt tree any more).
I think it's also used on CHRP.
Ben.
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Quoted 7 lines
Quoted 5 lines
"interrupts" property is well-defined in the OF spec for each
device-tree node, but I do not think thatprom.ccurrently has enough parsing ability to handle the complexity or makes too many assumption. And it does not need to fully parse that property, as Ben suggests.I didn't say it wasn't well defined ;) I said it's usage by Apple is not.
Hrm.. in fact, it looks like _I_ was not very clear, sorry
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Quoted 5 lines
The "interrupts" property can have various meanings depending on the OF version, I suggest you don't mess with it. Just check that if you find no AAPL,interrupts, and that
pmac_newworld== 0, then look for parent AAPL,interrupts.
So, then does the following patch seem valid? If so, I'd appreciate it if others with different macs (newworld and oldworld) could try it and let me know if it breaks anything...
..and if not, how would one go about getting this into the official trees?
prom.c Thu Jan 4 17:44:02 2001 renamed from prom.c.old Wed Jan 3 20:31:59 2001 +6 -1
@@ -1564,8 +1564,15 @@ } ip = (int *) get_property(np, "AAPL,interrupts", &l); - if (ip == 0) + if (ip == 0) { + /* hack to force a look at the parent node for interrupts on + * oldworld macs with funky PCI<->PCI bridges (ie, UMAX S900) + */ + if (!pmac_newworld && np->parent != NULL) + ip = (int *) get_property(np->parent, "AAPL,interrupts",
&l);
+ else
ip = (int *) get_property(np, "interrupts", &l);
+ }
if (ip != 0) {
np->intrs = (struct interrupt_info *) mem_start;
np->n_intrs = l / sizeof(int);
@@ -1617,8 +1624,15 @@
return mem_start;
ip = (int *) get_property(np, "AAPL,interrupts", &l);- if (ip == 0)
+ if (ip == 0) {
+ /* hack to force a look at the parent node for interrupts on
+ * oldworld macs with funky PCI<->PCI bridges (ie, UMAX S900)
+ */
+ if (!pmac_newworld && np->parent != NULL)
+ ip = (int *) get_property(np->parent, "AAPL,interrupts",
&l);
+ else
ip = (int *) get_property(np, "interrupts", &l);
+ }
if (ip != 0) {
np->intrs = (struct interrupt_info *) mem_start;
np->n_intrs = l / sizeof(int);
@@ -1774,8 +1788,15 @@
return mem_start;
ip = (int *) get_property(np, "AAPL,interrupts", &l);- if (ip == 0)
+ if (ip == 0) {
+ /* hack to force a look at the parent node for interrupts on
+ * oldworld macs with funky PCI<->PCI bridges (ie, UMAX S900)
+ */
+ if (!pmac_newworld && np->parent != NULL)
+ ip = (int *) get_property(np->parent, "AAPL,interrupts",
&l);
+ else
ip = (int *) get_property(np, "interrupts", &l);
+ }
if (ip != 0) {
np->intrs = (struct interrupt_info *) mem_start;
np->n_intrs = l / sizeof(int);** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Do you only need to look at the immediate parent and not the
entire ancestor tree?
David
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Quoted 3 lines
Do you only need to look at the immediate parent and not the
entire ancestor tree?
My guess would be probably, to be thorough. But I'm no kernel expert, so anyone else have any comments?
Although (again just guessing), I don't think many (if any) systems will have more than one PCI controller, or more than one bridge chip for that matter...
Regards,
Jonathan
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Quoted 8 lines
My guess would be probably, to be thorough. But I'm no kernel expert, so anyone else have any comments?
Although (again just guessing), I don't think many (if any) systems will have more than one PCI controller, or more than one bridge chip for that matter...
The best solution is probably to cleanup the current parsing mecanism in prom.c to clearly separate the 3 cases:
- Real OF with interrupt tree (CHRP, newworld mac booting via OF). This
one is already more or less separate.
- OldWorld macs (booted either via OF or BootX/miBoot)
- Newworld macs booted via BootX/miBoot
Only the second case should iterate the AAPL,interrupts parents, and in this case, all parents should be iterated up to the top of the tree in case of cascaded bridges. For now, your patch may be enough, I'll look into cleaning all that up myself. The only "tricky" case is NewWorld macs booted via BootX/miBoot. Those machine should use the OF interrupt tree. Unfortunately, MacOS screws it up (we no longer have access to the phandle's, and so can't follow the interrupt-parent links). So we rely on other types of infos left by MacOS, but those seem to occasionally be different on older newworld macs and core99 machines.
Ben.
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
In message <[email protected]>,Tibor Pausz writ es:
Quoted 3 lines
Today I tried your patch. Well, I breaks the hole interrupt stuff. Now, even Mesh has trouble with interrupts (kernel crash), the console=ttyS0 doesn't work so no output from the booting ...
i was wrong about the checking for the interrupts property before allocating an interrupt. the correct patch follows:
prom.c renamed from prom.c.000 +4 -4
@@ -1563,8 +1563,8 @@ } ip = (int *)get_property (np,"AAPL,interrupts" , &l); -if (ip ==0 ) - ip = (int *)get_property (np,"interrupts" , &l); +if (ip ==0 && np->parent !=NULL ) + ip = (int *)get_property (np->parent,"AAPL,interrupts" , &l);if (ip !=0 ) { np->intrs = (struct interrupt_info *) mem_start; np->n_intrs = l /sizeof (int );
@@ -1616,8 +1616,8 @@return mem_start; ip = (int *)get_property (np,"AAPL,interrupts" , &l); -if (ip ==0 ) - ip = (int *)get_property (np,"interrupts" , &l); +if (ip ==0 && np->parent !=NULL ) + ip = (int *)get_property (np->parent,"AAPL,interrupts" , &l);if (ip !=0 ) { np->intrs = (struct interrupt_info *) mem_start; np->n_intrs = l /sizeof (int );
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Quoted 2 lines · Chas Williams
i was wrong about the checking for the interrupts property before allocating an interrupt. the correct patch follows:
It doesn't no longer crash the machine, but my ISDN card doesn't get a correct interrupt. Excatly the some stuff w/o the patch.
Well, I didn't know if the ISDN card works at all. So I swapped the SCSI card and the ISDN card. The ISDN card crashes now the machine, but without the ISDN card the SCSI cards fine behind the PCI bridge :-)
I don't have any problem (yet), hdparm cache trough put around 30MB/s.
(it's a SYM 53c875 card)
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/