Subject: [POWERPC 1/9] spufs: return an error in spu_create is isolated create isnt supported

From: Arnd Bergmann <[email-masked]>
Date: Mon, 27 Nov 2006 19:18:52 +0100

From: Jeremy Kerr <[email-masked]>
This changes the spu_create system call to return an error (-ENODEV) if
and isolated spu context is requested on hardware that doesn't support
isolated mode.

Tested on systemsim with and without isolation support

Signed-off-by: Jeremy Kerr <[email-masked]>
Signed-off-by: Arnd Bergmann <[email-masked]>

Index: linux-2.6/arch/powerpc/platforms/cell/spufs/inode.c
===================================================================
--- linux-2.6.orig/arch/powerpc/platforms/cell/spufs/inode.c
+++ linux-2.6/arch/powerpc/platforms/cell/spufs/inode.c
@@ -323,6 +323,10 @@ static int spufs_create_context(struct i
 	    == SPU_CREATE_ISOLATE)
 		goto out_unlock;
 
+	ret = -ENODEV;
+	if ((flags & SPU_CREATE_ISOLATE) && !isolated_loader)
+		goto out_unlock;
+
 	ret = spufs_mkdir(inode, dentry, flags, mode & S_IRWXUGO);
 	if (ret)
 		goto out_unlock;

--