aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Huth <thuth@linux.vnet.ibm.com>2011-11-25 12:35:35 +0100
committerThomas Huth <thuth@linux.vnet.ibm.com>2011-11-25 12:35:35 +0100
commit525e3b393b52ec04348d794b451c305a52e53337 (patch)
tree214400631afcef31b8864fd0c973993b18b461dd
parent54539073a963971b9e98dc64299a97b7e98cfd19 (diff)
downloadSLOF-qemu-slof-20111128.zip
SLOF-qemu-slof-20111128.tar.gz
SLOF-qemu-slof-20111128.tar.bz2
Fixed crash during "quiesce" when USB OHCI controller is enabledqemu-slof-20111128
The OHCI code unmaps the allocated DMA buffers during "quiesce". For this the dma-map-out and dma-free functions were using the $call-parent function that requires a valid current instance ("my-self"). However, there is no current instance available during "quiesce" so $call-parent aborted the boot process. To fix the problem, the dma-* functions now use $call-static again so that they also work without a current instance. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
-rw-r--r--board-qemu/slof/pci-phb.fs2
-rw-r--r--board-qemu/slof/vio-vscsi.fs6
-rw-r--r--slof/fs/instance.fs2
-rw-r--r--slof/fs/pci-device.fs20
4 files changed, 19 insertions, 11 deletions
diff --git a/board-qemu/slof/pci-phb.fs b/board-qemu/slof/pci-phb.fs
index 08eaba1..4e91fa5 100644
--- a/board-qemu/slof/pci-phb.fs
+++ b/board-qemu/slof/pci-phb.fs
@@ -111,7 +111,7 @@ setup-puid
\ in the PCI device node instead of the bus node, so we've got to use the
\ "calling-child" variable here to get to the node that initiated the call.
: (init-dma-window-vars) ( -- )
- s" ibm,dma-window" calling-child ihandle>phandle
+ s" ibm,dma-window" calling-child
get-property ABORT" no dma-window property available"
decode-int TO dma-window-liobn
decode-64 TO dma-window-base
diff --git a/board-qemu/slof/vio-vscsi.fs b/board-qemu/slof/vio-vscsi.fs
index 77e358e..0976cba 100644
--- a/board-qemu/slof/vio-vscsi.fs
+++ b/board-qemu/slof/vio-vscsi.fs
@@ -404,11 +404,9 @@ CREATE sector d# 512 allot
\ Cleanup behind us
: vscsi-cleanup
- ." VSCSI: Cleaning up" cr
-
+ \ ." VSCSI: Cleaning up" cr
crq-cleanup
-
- \ Disable TCE bypass
+ \ Disable TCE bypass:
vscsi-unit 0 rtas-set-tce-bypass
;
diff --git a/slof/fs/instance.fs b/slof/fs/instance.fs
index 4ba42e5..9fc4bb0 100644
--- a/slof/fs/instance.fs
+++ b/slof/fs/instance.fs
@@ -151,7 +151,7 @@ CONSTANT <instancevariable>
0 VALUE calling-child
: $call-parent
- my-self TO calling-child
+ my-self ihandle>phandle TO calling-child
my-parent $call-method
0 TO calling-child
;
diff --git a/slof/fs/pci-device.fs b/slof/fs/pci-device.fs
index 3e90464..afad756 100644
--- a/slof/fs/pci-device.fs
+++ b/slof/fs/pci-device.fs
@@ -10,8 +10,10 @@
\ * IBM Corporation - initial implementation
\ ****************************************************************************/
+get-node CONSTANT my-phandle
+
\ get the PUID from the node above
-s" my-puid" get-node parent $call-static CONSTANT my-puid
+s" my-puid" my-phandle parent $call-static CONSTANT my-puid
\ define the config reads
: config-b@ puid >r my-puid TO puid my-space + rtas-config-b@ r> TO puid ;
@@ -54,19 +56,27 @@ s" my-puid" get-node parent $call-static CONSTANT my-puid
\ DMA memory allocation functions
: dma-alloc ( size -- virt )
- s" dma-alloc" $call-parent
+ my-phandle TO calling-child
+ s" dma-alloc" my-phandle parent $call-static
+ 0 TO calling-child
;
: dma-free ( virt size -- )
- s" dma-free" $call-parent
+ my-phandle TO calling-child
+ s" dma-free" my-phandle parent $call-static
+ 0 TO calling-child
;
: dma-map-in ( virt size cacheable? -- devaddr )
- s" dma-map-in" $call-parent
+ my-phandle TO calling-child
+ s" dma-map-in" my-phandle parent $call-static
+ 0 TO calling-child
;
: dma-map-out ( virt devaddr size -- )
- s" dma-map-out" $call-parent
+ my-phandle TO calling-child
+ s" dma-map-out" my-phandle parent $call-static
+ 0 TO calling-child
;