rpms/kernel/devel linux-2.6.11-kallsyms-extra-text.patch, NONE, 1.1 linux-2.6.12rc-ppc32-clockspreading-fix.patch, NONE, 1.1 kernel-2.6.spec, 1.1282, 1.1283 linux-2.6.11-ppc32-pmac-sleep-fix.patch, 1.2, 1.3

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Mon May 2 08:24:38 UTC 2005


Author: dwmw2

Update of /cvs/dist/rpms/kernel/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv20249

Modified Files:
	kernel-2.6.spec linux-2.6.11-ppc32-pmac-sleep-fix.patch 
Added Files:
	linux-2.6.11-kallsyms-extra-text.patch 
	linux-2.6.12rc-ppc32-clockspreading-fix.patch 
Log Message:
* Mon May  2 2005 David Woodhouse <dwmw2 at redhat.com>
- Make kallsyms include platform-specific symbols
- Fix might_sleep warning in pbook clock-spreading fix


linux-2.6.11-kallsyms-extra-text.patch:
 arch/ppc/kernel/vmlinux.lds.S  |    2 ++
 include/asm-generic/sections.h |    2 ++
 kernel/kallsyms.c              |   10 +++++++++-
 scripts/kallsyms.c             |   20 +++++++++++++-------
 4 files changed, 26 insertions(+), 8 deletions(-)

--- NEW FILE linux-2.6.11-kallsyms-extra-text.patch ---
The PPC32 kernel puts platform-specific functions into separate sections
so that unneeded parts of it can be freed when we've booted and actually
worked out what we're running on today. 

This makes kallsyms ignore those functions, because they're not between
_[se]text or _[se]inittext. Rather than teaching kallsyms about the
various pmac/chrp/etc sections, this patch adds '_[se]extratext' markers
for kallsyms.

Signed-off-by: David Woodhouse <dwmw2 at infradead.org> 

--- linux-2.6.11/arch/ppc/kernel/vmlinux.lds.S~	2005-05-01 10:43:10.000000000 +0100
+++ linux-2.6.11/arch/ppc/kernel/vmlinux.lds.S	2005-05-02 08:06:52.000000000 +0100
@@ -147,6 +147,7 @@ SECTIONS
   __init_end = .;
 
   . = ALIGN(4096);
+  _sextratext = .;
   __pmac_begin = .;
   .pmac.text : { *(.pmac.text) }
   .pmac.data : { *(.pmac.data) }
@@ -173,6 +174,7 @@ SECTIONS
   .openfirmware.data : { *(.openfirmware.data) }
   . = ALIGN(4096);
   __openfirmware_end = .;
+  _eextratext = .;
 
   __bss_start = .;
   .bss :
--- linux-2.6.11/include/asm-generic/sections.h~	2005-03-02 07:37:31.000000000 +0000
+++ linux-2.6.11/include/asm-generic/sections.h	2005-05-02 08:43:04.000000000 +0100
@@ -8,6 +8,8 @@ extern char _data[], _sdata[], _edata[];
 extern char __bss_start[], __bss_stop[];
 extern char __init_begin[], __init_end[];
 extern char _sinittext[], _einittext[];
+extern char _sextratext[] __attribute__((weak));
+extern char _eextratext[] __attribute__((weak));
 extern char _end[];
 
 #endif /* _ASM_GENERIC_SECTIONS_H_ */
--- linux-2.6.11/scripts/kallsyms.c~	2005-03-02 07:38:33.000000000 +0000
+++ linux-2.6.11/scripts/kallsyms.c	2005-05-02 08:09:11.000000000 +0100
@@ -67,7 +67,7 @@ struct sym_entry {
 
 static struct sym_entry *table;
 static int size, cnt;
-static unsigned long long _stext, _etext, _sinittext, _einittext;
+static unsigned long long _stext, _etext, _sinittext, _einittext, _sextratext, _eextratext;
 static int all_symbols = 0;
 
 struct token {
@@ -132,6 +132,10 @@ read_symbol(FILE *in, struct sym_entry *
 		_sinittext = s->addr;
 	else if (strcmp(str, "_einittext") == 0)
 		_einittext = s->addr;
+	else if (strcmp(str, "_sextratext") == 0)
+		_sextratext = s->addr;
+	else if (strcmp(str, "_eextratext") == 0)
+		_eextratext = s->addr;
 	else if (toupper(s->type) == 'A')
 	{
 		/* Keep these useful absolute symbols */
@@ -182,16 +186,18 @@ symbol_valid(struct sym_entry *s)
 	 * and inittext sections are discarded */
 	if (!all_symbols) {
 		if ((s->addr < _stext || s->addr > _etext)
-		    && (s->addr < _sinittext || s->addr > _einittext))
+		    && (s->addr < _sinittext || s->addr > _einittext) 
+		    && (s->addr < _sextratext || s->addr > _eextratext))
 			return 0;
 		/* Corner case.  Discard any symbols with the same value as
-		 * _etext or _einittext, they can move between pass 1 and 2
-		 * when the kallsyms data is added.  If these symbols move then
-		 * they may get dropped in pass 2, which breaks the kallsyms
-		 * rules.
+		 * _etext _einittext or _eextratext; they can move between pass 
+		 * 1 and 2 when the kallsyms data is added.  If these symbols 
+		 * move then they may get dropped in pass 2, which breaks the
+		 * kallsyms rules.
 		 */
 		if ((s->addr == _etext && strcmp(s->sym + 1, "_etext")) ||
-		    (s->addr == _einittext && strcmp(s->sym + 1, "_einittext")))
+		    (s->addr == _einittext && strcmp(s->sym + 1, "_einittext")) ||
+		    (s->addr == _eextratext && strcmp(s->sym + 1, "_eextratext")))
 			return 0;
 	}
 
--- linux-2.6.11/kernel/kallsyms.c~	2005-05-01 10:37:45.000000000 +0100
+++ linux-2.6.11/kernel/kallsyms.c	2005-05-02 08:42:59.000000000 +0100
@@ -46,6 +46,14 @@ static inline int is_kernel_inittext(uns
 	return 0;
 }
 
+static inline int is_kernel_extratext(unsigned long addr)
+{
+	if (addr >= (unsigned long)_sextratext
+	    && addr <= (unsigned long)_eextratext)
+		return 1;
+	return 0;
+}
+
 static inline int is_kernel_text(unsigned long addr)
 {
 	if (addr >= (unsigned long)_stext && addr <= (unsigned long)_etext)
@@ -169,7 +177,7 @@ const char *kallsyms_lookup(unsigned lon
 	namebuf[0] = 0;
 
 	if ((all_var && is_kernel(addr)) ||
-	    (!all_var && (is_kernel_text(addr) || is_kernel_inittext(addr)))) {
+	    (!all_var && (is_kernel_text(addr) || is_kernel_inittext(addr) || is_kernel_extratext(addr)))) {
 		unsigned long symbol_end=0;
 
 		/* do a binary search on the sorted kallsyms_addresses array */


-- 
dwmw2

_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev at ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

linux-2.6.12rc-ppc32-clockspreading-fix.patch:
 arch/ppc/platforms/pmac_feature.c |   12 ++++--------
 drivers/macintosh/via-pmu.c       |    9 +++++++--
 include/asm-ppc/pmac_feature.h    |    3 +++
 3 files changed, 14 insertions(+), 10 deletions(-)

--- NEW FILE linux-2.6.12rc-ppc32-clockspreading-fix.patch ---
>From benh at kernel.crashing.org Mon May  2 06:49:45 2005
Return-path: <benh at kernel.crashing.org>
Envelope-to: dwmw2 at baythorne.infradead.org
Delivery-date: Mon, 02 May 2005 06:49:45 +0100
Received: from phoenix.infradead.org ([2001:8b0:10b:1:2c0:f0ff:fe31:e18])
	by baythorne.infradead.org with esmtps (Exim 4.43 #1 (Red Hat Linux)) id
	1DSToP-0004ZQ-0C for dwmw2 at baythorne.infradead.org; Mon, 02 May 2005
	06:49:45 +0100
Received: from djurbala-pt.tunnel.tserv2.fmt.ipv6.he.net
	([2001:470:1f01:ffff::eb] helo=gate.crashing.org) by phoenix.infradead.org
	with esmtps (Exim 4.43 #1 (Red Hat Linux)) id 1DSTo5-0006nT-9H for
	dwmw2 at infradead.org; Mon, 02 May 2005 06:49:42 +0100
Received: from gaston (localhost [127.0.0.1]) by gate.crashing.org
	(8.12.8/8.12.8) with ESMTP id j425gNgJ017759 for <dwmw2 at infradead.org>;
	Mon, 2 May 2005 00:42:24 -0500
Subject: clock spreading fix
From: Benjamin Herrenschmidt <benh at kernel.crashing.org>
To: David Woodhouse <dwmw2 at infradead.org>
Content-Type: text/plain
Date: Mon, 02 May 2005 15:46:09 +1000
Message-Id: <1115012769.6155.6.camel at gaston>
Mime-Version: 1.0
X-Mailer: Evolution 2.2.2 
X-Spam-Score: 0.0 (/)
X-Evolution-Source: imap://dwmw2@pentafluge.infradead.org/
Content-Transfer-Encoding: 8bit

Index: linux-work/include/asm-ppc/pmac_feature.h
===================================================================
--- linux-work.orig/include/asm-ppc/pmac_feature.h	2005-05-02 10:49:57.000000000 +1000
+++ linux-work/include/asm-ppc/pmac_feature.h	2005-05-02 15:43:08.000000000 +1000
@@ -316,6 +316,9 @@
 extern void pmac_suspend_agp_for_card(struct pci_dev *dev);
 extern void pmac_resume_agp_for_card(struct pci_dev *dev);
 
+/* Used by the via-pmu driver for suspend/resume
+ */
+extern void pmac_tweak_clock_spreading(int enable);
 
 /*
  * The part below is for use by macio_asic.c only, do not rely
Index: linux-work/arch/ppc/platforms/pmac_feature.c
===================================================================
--- linux-work.orig/arch/ppc/platforms/pmac_feature.c	2005-05-02 13:16:22.000000000 +1000
+++ linux-work/arch/ppc/platforms/pmac_feature.c	2005-05-02 15:43:55.000000000 +1000
@@ -1591,8 +1591,10 @@
 }
 
 
-static void __pmac pmac_tweak_clock_spreading(struct macio_chip* macio, int enable)
+void __pmac pmac_tweak_clock_spreading(int enable)
 {
+	struct macio_chip* macio = &macio_chips[0];
+
 	/* Hack for doing clock spreading on some machines PowerBooks and
 	 * iBooks. This implements the "platform-do-clockspreading" OF
 	 * property as decoded manually on various models. For safety, we also
@@ -1707,9 +1709,6 @@
 	    macio->type != macio_intrepid)
 		return -ENODEV;
 
-	/* Disable clock spreading */
-	pmac_tweak_clock_spreading(macio, 0);
-
 	/* We power off the wireless slot in case it was not done
 	 * by the driver. We don't power it on automatically however
 	 */
@@ -1852,9 +1851,6 @@
 	UN_OUT(UNI_N_CLOCK_CNTL, save_unin_clock_ctl);
 	udelay(100);
 
-	/* Enable clock spreading */
-	pmac_tweak_clock_spreading(macio, 1);
-
 	return 0;
 }
 
@@ -2822,7 +2818,7 @@
 	 * clock spreading now. This should be a platform function but we
 	 * don't do these at the moment
 	 */
-	pmac_tweak_clock_spreading(&macio_chips[0], 1);
+	pmac_tweak_clock_spreading(1);
 
 #endif /* CONFIG_POWER4 */
 
Index: linux-work/drivers/macintosh/via-pmu.c
===================================================================
--- linux-work.orig/drivers/macintosh/via-pmu.c	2005-05-02 10:48:11.000000000 +1000
+++ linux-work/drivers/macintosh/via-pmu.c	2005-05-02 15:45:49.000000000 +1000
@@ -2351,6 +2351,10 @@
 		return -EBUSY;
 	}
 
+	/* Disable clock spreading on some machines */
+	pmac_tweak_clock_spreading(0);
+
+	/* Stop preemption */
 	preempt_disable();
 
 	/* Make sure the decrementer won't interrupt us */
@@ -2417,11 +2421,12 @@
 
 	/* Re-enable local CPU interrupts */
 	local_irq_enable();
-
 	mdelay(100);
-
 	preempt_enable();
 
+	/* Re-enable clock spreading on some machines */
+	pmac_tweak_clock_spreading(1);
+
 	/* Resume devices */
 	device_resume();
 

-- 
Benjamin Herrenschmidt <benh at kernel.crashing.org>



Index: kernel-2.6.spec
===================================================================
RCS file: /cvs/dist/rpms/kernel/devel/kernel-2.6.spec,v
retrieving revision 1.1282
retrieving revision 1.1283
diff -u -r1.1282 -r1.1283
--- kernel-2.6.spec	1 May 2005 21:31:04 -0000	1.1282
+++ kernel-2.6.spec	2 May 2005 08:24:36 -0000	1.1283
@@ -236,6 +236,8 @@
 Patch307: linux-2.6.11-mac-mini-sound.patch
 Patch308: linux-2.6.11-pmac-volume-save.patch
 Patch309: linux-2.6.11-pmac-ide-sleep.patch
+Patch310: linux-2.6.11-kallsyms-extra-text.patch
+Patch311: linux-2.6.12rc-ppc32-clockspreading-fix.patch
 
 # 400 - 499   ia64
 Patch400: linux-2.6.3-ia64-build.patch
@@ -554,6 +556,8 @@
 %patch307 -p1
 %patch308 -p1
 %patch309 -p1
+%patch310 -p1
+%patch311 -p1
 
 #
 # ia64
@@ -1201,6 +1205,10 @@
 %endif
 
 %changelog
+* Mon May  2 2005 David Woodhouse <dwmw2 at redhat.com>
+- Make kallsyms include platform-specific symbols
+- Fix might_sleep warning in pbook clock-spreading fix
+
 * Sun May  1 2005 Dave Jones <davej at redhat.com>
 - Fix yesterdays IDE fixes.
 - Blacklist another brainless SCSI scanner. (#155457)

linux-2.6.11-ppc32-pmac-sleep-fix.patch:
 pmac_cache.S |   56 +++++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 43 insertions(+), 13 deletions(-)

Index: linux-2.6.11-ppc32-pmac-sleep-fix.patch
===================================================================
RCS file: /cvs/dist/rpms/kernel/devel/linux-2.6.11-ppc32-pmac-sleep-fix.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- linux-2.6.11-ppc32-pmac-sleep-fix.patch	8 Apr 2005 12:48:03 -0000	1.2
+++ linux-2.6.11-ppc32-pmac-sleep-fix.patch	2 May 2005 08:24:36 -0000	1.3
@@ -1,19 +1,49 @@
+We are experiencing a problem when flushing the CPU caches before sleep
+on some laptop models using the 750FX CPU rev 1.X. While I haven't been
+able to figure out a proper explanation for what's going on, I do have a
+workaround that seem to work reliably and allows those machine to sleep
+and wakeup properly again. This should be applied for 2.6.12. I'll
+re-update that code if/when I ever find exactly what is happening with
+those CPU revisions.
+
+Signed-off-by: Benjamin Herrenschmidt <benh at kernel.crashing.org>
+
 Index: linux-work/arch/ppc/platforms/pmac_cache.S
 ===================================================================
---- linux-work.orig/arch/ppc/platforms/pmac_cache.S	2005-03-15 11:56:42.000000000 +1100
-+++ linux-work/arch/ppc/platforms/pmac_cache.S	2005-04-05 10:40:26.000000000 +1000
-@@ -65,7 +65,7 @@
- 	li	r4,0x4000
- 	mtctr	r4
+--- linux-work.orig/arch/ppc/platforms/pmac_cache.S	2005-04-24 11:37:38.000000000 +1000
++++ linux-work/arch/ppc/platforms/pmac_cache.S	2005-04-24 12:00:46.000000000 +1000
+@@ -64,27 +64,39 @@
+ 	mtspr	SPRN_HID0,r4		/* Disable DPM */
+ 	sync
+ 
+-	/* disp-flush L1 */
+-	li	r4,0x4000
+-	mtctr	r4
++	/* Disp-flush L1. We have a weird problem here that I never
++	 * totally figured out. On 750FX, using the ROM for the flush
++	 * results in a non-working flush. We use that workaround for
++	 * now until I finally understand what's going on. --BenH
++	 */
++
++	/* ROM base by default */
  	lis	r4,0xfff0
 -1:	lwzx	r0,r0,r4
++	mfpvr	r3
++	srwi	r3,r3,16
++	cmplwi	cr0,r3,0x7000
++	bne+	1f
++	/* RAM base on 750FX */
++	li	r4,0
++1:	li	r4,0x4000
++	mtctr	r4
 +1:	lwz	r0,0(r4)
  	addi	r4,r4,32
  	bdnz	1b
  	sync
-@@ -73,15 +73,15 @@
+ 	isync
  
- 	/* disable / invalidate / enable L1 data */
+-	/* disable / invalidate / enable L1 data */
++	/* Disable / invalidate / enable L1 data */
  	mfspr	r3,SPRN_HID0
 -	rlwinm	r0,r0,0,~HID0_DCE
 +	rlwinm	r3,r3,0,~(HID0_DCE | HID0_ICE)
@@ -30,7 +60,7 @@
  	mtspr	SPRN_HID0,r3
  	sync
  
-@@ -107,11 +107,20 @@
+@@ -110,11 +122,20 @@
  	lis	r4,2
  	mtctr	r4
  	lis	r4,0xfff0
@@ -52,11 +82,11 @@
  	/* now disable L2 */
  	rlwinm	r5,r5,0,~L2CR_L2E
  	b	2f
-@@ -132,6 +141,13 @@
+@@ -135,6 +156,13 @@
  	mtspr	SPRN_L2CR,r4
  	sync
  	isync
-+	
++
 +	/* Wait for the invalidation to complete */
 +1:	mfspr	r3,SPRN_L2CR
 +	rlwinm.	r0,r3,0,31,31
@@ -66,7 +96,7 @@
  	xoris	r4,r4,L2CR_L2I at h
  	sync
  	mtspr	SPRN_L2CR,r4
-@@ -139,16 +155,18 @@
+@@ -142,16 +170,18 @@
  
  	/* now disable the L1 data cache */
  	mfspr	r0,SPRN_HID0
@@ -84,11 +114,11 @@
 +	mtspr	SPRN_HID0,r0
  	sync
 -
-+	
++
  	/* restore DR and EE */
  	sync
  	mtmsr	r11
-@@ -198,7 +216,7 @@
+@@ -201,7 +231,7 @@
          mtctr   r4
   	li      r4,0
  1:
@@ -97,3 +127,9 @@
          addi    r4,r4,32                /* Go to start of next cache line */
          bdnz    1b
          isync
+
+
+_______________________________________________
+Linuxppc-dev mailing list
+Linuxppc-dev at ozlabs.org
+https://ozlabs.org/mailman/listinfo/linuxppc-dev




More information about the fedora-cvs-commits mailing list