rpms/kernel/devel linux-2.6-oprofile-cell.patch, NONE, 1.1 kernel.spec, 1.315, 1.316

David Woodhouse (dwmw2) fedora-extras-commits at redhat.com
Fri Dec 14 17:00:12 UTC 2007


Author: dwmw2

Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv23631

Modified Files:
	kernel.spec 
Added Files:
	linux-2.6-oprofile-cell.patch 
Log Message:
really apply the oprofile patch

admit to having fixed PS3 EHCI too


linux-2.6-oprofile-cell.patch:

--- NEW FILE linux-2.6-oprofile-cell.patch ---
>From arnd at arndb.de Fri Dec 14 14:33:15 2007
Return-path: <arnd at arndb.de>
Envelope-to: dwmw2 at baythorne.infradead.org
Delivery-date: Fri, 14 Dec 2007 14:33:15 +0000
Received: from pentafluge.infradead.org ([2001:770:15f::1]) by
	baythorne.infradead.org with esmtps (Exim 4.68 #1 (Red Hat Linux)) id
	1J3BbH-0003Zx-Ix for dwmw2 at baythorne.infradead.org; Fri, 14 Dec 2007
	14:33:15 +0000
Received: from moutng.kundenserver.de ([212.227.126.187]) by
	pentafluge.infradead.org with esmtp (Exim 4.68 #1 (Red Hat Linux)) id
	1J3Bb8-0001Xx-Tv for dwmw2 at infradead.org; Fri, 14 Dec 2007 14:33:15 +0000
Received: from dyn-9-152-242-83.boeblingen.de.ibm.com
	(blueice3n1.de.ibm.com [195.212.29.179]) by mrelayeu.kundenserver.de
	(node=mrelayeu2) with ESMTP (Nemesis) id 0MKwtQ-1J3BVl1UT9-0007bY; Fri, 14
	Dec 2007 15:27:36 +0100
From: Arnd Bergmann <arnd at arndb.de>
To: linuxppc-dev at ozlabs.org
Subject: [PATCH] OProfile: remove dependency on spufs module
Date: Fri, 14 Dec 2007 15:27:30 +0100
User-Agent: KMail/1.9.6 (enterprise 0.20070907.709405)
Cc: Paul Mackerras <paulus at samba.org>, jk at ozlabs.org, Bob Nelson <rrnelson at us.ibm.com>, David Woodhouse <dwmw2 at infradead.org>
References: <18274.3076.467791.719752 at cargo.ozlabs.ibm.com>
In-Reply-To: <18274.3076.467791.719752 at cargo.ozlabs.ibm.com>
X-Face:
	I@=L^?./?$U,EK.)V[4*>`zSqm0>65YtkOe>TFD'!aw?7OVv#~5xd\s,[~w]-J!)|%=]>=?utf-8?q?+=0A=09=7EohchhkRGW=3F=7C6=5FqTmkd=5Ft=3FLZC=23Q-=60=2E=60Y=2Ea=5E?=
	=?utf-8?q?3zb?=)
	=?utf-8?q?+U-JVN=5DWT=25cw=23=5BYo0=267C=26bL12wWGlZi=0A=09=7EJ=3B=5Cwg?=
	=?utf-8?q?=3B3zRnz?=,J"CT_)=\H'1/{?SR7GDu?WIopm.HaBG=QYj"NZD_[zrM\Gip^U
MIME-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
Content-Disposition: inline
Message-Id: <200712141527.31893.arnd at arndb.de>
X-Provags-ID: V01U2FsdGVkX19th/AYxZaVkGrRxkTCL2jM+PkNit8fiK8nf/n
	wx0AVFdcA5+NMXwk3/yn95/8z4OIiOYacWDxeTqM7AWfKBU+t9 xKNY5EKZ/IHBUqAUusULQ==
X-Bad-Reply: References and In-Reply-To but no 'Re:' in Subject.
X-Spam-Score: 0.0 (/)
X-Evolution-Source: imap://dwmw2@baythorne.infradead.org/
Content-Transfer-Encoding: 8bit

From: Bob Nelson <rrnelson at linux.vnet.ibm.com>

This is a patch removes an OProfile dependency on the spufs module.
This was causing a problem for multiplatform systems that are
built with support for Oprofile on Cell but try to load the
oprofile module on another system.

Signed-off-by: Bob Nelson <rrnelson at us.ibm.com>
Signed-off-by: Arnd Bergmann <arnd.bergmann at de.ibm.com>

---
On Friday 14 December 2007, Paul Mackerras wrote:
> Currently I have just this one bugfix queued up to go to Linus for
> 2.6.24:
> 
> Stephen Rothwell (1):
>       [POWERPC] iSeries: don't printk with HV spinlock held
> 
> Does anyone else have bugfixes that need to go in 2.6.24?

A few  people have asked me for including this one, I'd like
it to get that in still. It was broken ever since you could
enable support for spu oprofile.

Jeremy, please ack the spufs changes if you are ok with the patch.

Sorry for delaying this patch so long on my side everyone.

	Arnd <><

 arch/powerpc/platforms/cell/Kconfig          |    2 +-
 arch/powerpc/platforms/cell/Makefile         |    1 +
 arch/powerpc/platforms/cell/spu_notify.c     |   67 ++++++++++++++++++++++++++
 arch/powerpc/platforms/cell/spu_syscalls.c   |   14 +++++
 arch/powerpc/platforms/cell/spufs/context.c  |   16 ------
 arch/powerpc/platforms/cell/spufs/sched.c    |   29 +++--------
 arch/powerpc/platforms/cell/spufs/syscalls.c |    1 +
 include/asm-powerpc/spu.h                    |    4 ++
 8 files changed, 95 insertions(+), 39 deletions(-)
 create mode 100644 arch/powerpc/platforms/cell/spu_notify.c


Index: linux-2.6-new/arch/powerpc/platforms/cell/Kconfig
===================================================================
--- linux-2.6-new.orig/arch/powerpc/platforms/cell/Kconfig
+++ linux-2.6-new/arch/powerpc/platforms/cell/Kconfig
@@ -88,3 +88,8 @@ config CBE_CPUFREQ_PMI
 	  but also at lower core voltage.
 
 endmenu
+
+config OPROFILE_CELL
+	def_bool y
+	depends on PPC_CELL_NATIVE && (OPROFILE = m || OPROFILE = y)
+
Index: linux-2.6-new/arch/powerpc/platforms/cell/Makefile
===================================================================
--- linux-2.6-new.orig/arch/powerpc/platforms/cell/Makefile
+++ linux-2.6-new/arch/powerpc/platforms/cell/Makefile
@@ -19,6 +19,7 @@ spu-manage-$(CONFIG_PPC_CELLEB)		+= spu_
 spu-manage-$(CONFIG_PPC_CELL_NATIVE)	+= spu_manage.o
 
 obj-$(CONFIG_SPU_BASE)			+= spu_callbacks.o spu_base.o \
+					   spu_notify.o \
 					   spu_syscalls.o \
 					   $(spu-priv1-y) \
 					   $(spu-manage-y) \
Index: linux-2.6-new/arch/powerpc/platforms/cell/spu_notify.c
===================================================================
--- /dev/null
+++ linux-2.6-new/arch/powerpc/platforms/cell/spu_notify.c
@@ -0,0 +1,67 @@
+/*
+ * Move OProfile dependencies from spufs module to the kernel so it
+ * can run on non-cell PPC.
+ *
+ * Copyright (C) IBM 2005
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#undef DEBUG
+
+#include <linux/module.h>
+#include <asm/spu.h>
+#include "spufs/spufs.h"
+
+static BLOCKING_NOTIFIER_HEAD(spu_switch_notifier);
+
+void spu_switch_notify(struct spu *spu, struct spu_context *ctx)
+{
+	blocking_notifier_call_chain(&spu_switch_notifier,
+				     ctx ? ctx->object_id : 0, spu);
+}
+EXPORT_SYMBOL_GPL(spu_switch_notify);
+
+int spu_switch_event_register(struct notifier_block *n)
+{
+	int ret;
+	ret = blocking_notifier_chain_register(&spu_switch_notifier, n);
+	if (!ret)
+		notify_spus_active();
+	return ret;
+}
+EXPORT_SYMBOL_GPL(spu_switch_event_register);
+
+int spu_switch_event_unregister(struct notifier_block *n)
+{
+	return blocking_notifier_chain_unregister(&spu_switch_notifier, n);
+}
+EXPORT_SYMBOL_GPL(spu_switch_event_unregister);
+
+void spu_set_profile_private_kref(struct spu_context *ctx,
+				  struct kref *prof_info_kref,
+				  void (* prof_info_release) (struct kref *kref))
+{
+	ctx->prof_priv_kref = prof_info_kref;
+	ctx->prof_priv_release = prof_info_release;
+}
+EXPORT_SYMBOL_GPL(spu_set_profile_private_kref);
+
+void *spu_get_profile_private_kref(struct spu_context *ctx)
+{
+	return ctx->prof_priv_kref;
+}
+EXPORT_SYMBOL_GPL(spu_get_profile_private_kref);
+
Index: linux-2.6-new/arch/powerpc/platforms/cell/spu_syscalls.c
===================================================================
--- linux-2.6-new.orig/arch/powerpc/platforms/cell/spu_syscalls.c
+++ linux-2.6-new/arch/powerpc/platforms/cell/spu_syscalls.c
@@ -145,6 +145,20 @@ int elf_coredump_extra_notes_write(struc
 	return ret;
 }
 
+void notify_spus_active(void)
+{
+	struct spufs_calls *calls;
+
+	calls = spufs_calls_get();
+	if (!calls)
+		return;
+
+	calls->notify_spus_active();
+	spufs_calls_put(calls);
+
+	return;
+}
+
 int register_spu_syscalls(struct spufs_calls *calls)
 {
 	if (spufs_calls)
Index: linux-2.6-new/arch/powerpc/platforms/cell/spufs/context.c
===================================================================
--- linux-2.6-new.orig/arch/powerpc/platforms/cell/spufs/context.c
+++ linux-2.6-new/arch/powerpc/platforms/cell/spufs/context.c
@@ -190,19 +190,3 @@ void spu_release_saved(struct spu_contex
 	spu_release(ctx);
 }
 
-void spu_set_profile_private_kref(struct spu_context *ctx,
-				  struct kref *prof_info_kref,
-				  void ( * prof_info_release) (struct kref *kref))
-{
-	ctx->prof_priv_kref = prof_info_kref;
-	ctx->prof_priv_release = prof_info_release;
-}
-EXPORT_SYMBOL_GPL(spu_set_profile_private_kref);
-
-void *spu_get_profile_private_kref(struct spu_context *ctx)
-{
-	return ctx->prof_priv_kref;
-}
-EXPORT_SYMBOL_GPL(spu_get_profile_private_kref);
-
-
Index: linux-2.6-new/arch/powerpc/platforms/cell/spufs/sched.c
===================================================================
--- linux-2.6-new.orig/arch/powerpc/platforms/cell/spufs/sched.c
+++ linux-2.6-new/arch/powerpc/platforms/cell/spufs/sched.c
@@ -166,15 +166,7 @@ static int node_allowed(struct spu_conte
 	return rval;
 }
 
-static BLOCKING_NOTIFIER_HEAD(spu_switch_notifier);
-
-void spu_switch_notify(struct spu *spu, struct spu_context *ctx)
-{
-	blocking_notifier_call_chain(&spu_switch_notifier,
-			    ctx ? ctx->object_id : 0, spu);
-}
-
-static void notify_spus_active(void)
+void do_notify_spus_active(void)
 {
 	int node;
 
@@ -200,22 +192,15 @@ static void notify_spus_active(void)
 		mutex_unlock(&cbe_spu_info[node].list_mutex);
 	}
 }
+EXPORT_SYMBOL_GPL(do_notify_spus_active);
 
-int spu_switch_event_register(struct notifier_block * n)
-{
-	int ret;
-	ret = blocking_notifier_chain_register(&spu_switch_notifier, n);
-	if (!ret)
-		notify_spus_active();
-	return ret;
-}
-EXPORT_SYMBOL_GPL(spu_switch_event_register);
-
-int spu_switch_event_unregister(struct notifier_block * n)
+#ifndef MODULE
+void notify_spus_active(void)
 {
-	return blocking_notifier_chain_unregister(&spu_switch_notifier, n);
+	do_notify_spus_active();
 }
-EXPORT_SYMBOL_GPL(spu_switch_event_unregister);
+EXPORT_SYMBOL_GPL(notify_spus_active);
+#endif
 
 /**
  * spu_bind_context - bind spu context to physical spu
Index: linux-2.6-new/arch/powerpc/platforms/cell/spufs/syscalls.c
===================================================================
--- linux-2.6-new.orig/arch/powerpc/platforms/cell/spufs/syscalls.c
+++ linux-2.6-new/arch/powerpc/platforms/cell/spufs/syscalls.c
@@ -86,5 +86,6 @@ struct spufs_calls spufs_calls = {
 	.spu_run = do_spu_run,
 	.coredump_extra_notes_size = spufs_coredump_extra_notes_size,
 	.coredump_extra_notes_write = spufs_coredump_extra_notes_write,
+	.notify_spus_active = do_notify_spus_active,
 	.owner = THIS_MODULE,
 };
Index: linux-2.6-new/include/asm-powerpc/spu.h
===================================================================
--- linux-2.6-new.orig/include/asm-powerpc/spu.h
+++ linux-2.6-new/include/asm-powerpc/spu.h
@@ -246,6 +246,7 @@ struct spufs_calls {
 						__u32 __user *ustatus);
 	int (*coredump_extra_notes_size)(void);
 	int (*coredump_extra_notes_write)(struct file *file, loff_t *foffset);
+	void (*notify_spus_active)(void);
 	struct module *owner;
 };
 
@@ -298,6 +299,9 @@ struct notifier_block;
 int spu_switch_event_register(struct notifier_block * n);
 int spu_switch_event_unregister(struct notifier_block * n);
 
+extern void notify_spus_active(void);
+extern void do_notify_spus_active(void);
+
 /*
  * This defines the Local Store, Problem Area and Privlege Area of an SPU.
  */



Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.315
retrieving revision 1.316
diff -u -r1.315 -r1.316
--- kernel.spec	14 Dec 2007 16:52:50 -0000	1.315
+++ kernel.spec	14 Dec 2007 16:59:17 -0000	1.316
@@ -588,6 +588,7 @@
 Patch124: linux-2.6-gelic-fixups.patch
 Patch125: linux-2.6-gelic-wireless-v2.patch
 Patch126: linux-2.6-gelic-wireless-fix.patch
+Patch127: linux-2.6-oprofile-cell.patch
 Patch130: linux-2.6-powerpc-generic-suspend-001-pmu-no-lock-kernel.patch
 Patch131: linux-2.6-powerpc-generic-suspend-002-pmu-remove-dead-code.patch
 Patch132: linux-2.6-powerpc-generic-suspend-003-remove-adb-sleep-notifier.patch
@@ -1023,6 +1024,8 @@
 ApplyPatch linux-2.6-gelic-fixups.patch
 ApplyPatch linux-2.6-gelic-wireless-v2.patch
 ApplyPatch linux-2.6-gelic-wireless-fix.patch
+# Fix oprofile on !cell ppc64
+ApplyPatch linux-2.6-oprofile-cell.patch
 # Suspend through /sys/power/state
 ApplyPatch linux-2.6-powerpc-generic-suspend-001-pmu-no-lock-kernel.patch
 ApplyPatch linux-2.6-powerpc-generic-suspend-002-pmu-remove-dead-code.patch
@@ -1744,6 +1747,7 @@
 %changelog
 * Fri Dec 14 2007 David Woodhouse <dwmw2 at redhat.com>
 - Fix OProfile on non-Cell ppc64
+- Fix EHCI on PS3 to allow rebooting
 
 * Fri Dec 14 2007 Dave Jones <davej at redhat.com>
 - Anaconda still needs the old sysfs files, so reenable SYSFS_DEPRECATED




More information about the fedora-extras-commits mailing list