[kernel] r12240 - in dists/sid/linux-2.6/debian: . patches/bugfix/parisc patches/series

Dann Frazier dannf at alioth.debian.org
Fri Sep 19 16:44:31 UTC 2008


Author: dannf
Date: Fri Sep 19 16:44:30 2008
New Revision: 12240

Log:
* [hppa] Enable the FPU before using it, fixes booting on A500s
  with our CONFIG_PRINTK_TIME=y setting. (closes: #499458)

Added:
   dists/sid/linux-2.6/debian/patches/bugfix/parisc/
   dists/sid/linux-2.6/debian/patches/bugfix/parisc/add-lockless-fw-funcs.patch
   dists/sid/linux-2.6/debian/patches/bugfix/parisc/hijack-jump-to-start_kernel.patch
Modified:
   dists/sid/linux-2.6/debian/changelog
   dists/sid/linux-2.6/debian/patches/series/6

Modified: dists/sid/linux-2.6/debian/changelog
==============================================================================
--- dists/sid/linux-2.6/debian/changelog	(original)
+++ dists/sid/linux-2.6/debian/changelog	Fri Sep 19 16:44:30 2008
@@ -9,7 +9,11 @@
   [ Martin Michlmayr ]
   * Fix dead 21041 ethernet after ifconfig down (Thomas Bogendoerfer).
 
- -- maximilian attems <maks at debian.org>  Wed, 10 Sep 2008 14:35:24 +0200
+  [ dann frazier ]
+  * [hppa] Enable the FPU before using it, fixes booting on A500s
+    with our CONFIG_PRINTK_TIME=y setting. (closes: #499458)
+
+ -- dann frazier <dannf at debian.org>  Thu, 18 Sep 2008 15:02:09 -0600
 
 linux-2.6 (2.6.26-5) unstable; urgency=low
 

Added: dists/sid/linux-2.6/debian/patches/bugfix/parisc/add-lockless-fw-funcs.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/parisc/add-lockless-fw-funcs.patch	Fri Sep 19 16:44:30 2008
@@ -0,0 +1,135 @@
+From: Kyle McMartin <kyle at mcmartin.ca>
+Date: Tue, 29 Jul 2008 04:09:22 +0000 (-0400)
+Subject: parisc: add pdc_coproc_cfg_unlocked and set_firmware_width_unlocked
+X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fkyle%2Fparisc-2.6.git;a=commitdiff_plain;h=8735c10cff8486d58e03ee692ae9720f10cf9806
+
+parisc: add pdc_coproc_cfg_unlocked and set_firmware_width_unlocked
+
+These functions are called only when bringing up the monarch cpu,
+so it is safe to call them without taking the pdc spinlock. In the
+future, this may become relevant for lockdep, since these functions were
+taking spinlocks before start_kernel called the lockdep initializers.
+---
+
+Adjusted to apply to Debian's 2.6.26 by dann frazier <dannf at debian.org>
+
+diff -urpN linux-source-2.6.26.orig/arch/parisc/kernel/firmware.c linux-source-2.6.26/arch/parisc/kernel/firmware.c
+--- linux-source-2.6.26.orig/arch/parisc/kernel/firmware.c	2008-07-13 15:51:29.000000000 -0600
++++ linux-source-2.6.26/arch/parisc/kernel/firmware.c	2008-09-18 16:28:07.000000000 -0600
+@@ -150,26 +150,40 @@ static void convert_to_wide(unsigned lon
+ #endif
+ }
+ 
++#ifdef CONFIG_64BIT
++void __init set_firmware_width_unlocked(void)
++{
++	int ret;
++
++	ret = mem_pdc_call(PDC_MODEL, PDC_MODEL_CAPABILITIES,
++		__pa(pdc_result), 0);
++	convert_to_wide(pdc_result);
++	if (pdc_result[0] != NARROW_FIRMWARE)
++		parisc_narrow_firmware = 0;
++}
++	
+ /**
+  * set_firmware_width - Determine if the firmware is wide or narrow.
+  * 
+- * This function must be called before any pdc_* function that uses the convert_to_wide
+- * function.
++ * This function must be called before any pdc_* function that uses the
++ * convert_to_wide function.
+  */
+ void __init set_firmware_width(void)
+ {
+-#ifdef CONFIG_64BIT
+-	int retval;
+ 	unsigned long flags;
++	spin_lock_irqsave(&pdc_lock, flags);
++	set_firmware_width_unlocked();
++	spin_unlock_irqrestore(&pdc_lock, flags);
++}
++#else
++void __init set_firmware_width_unlocked(void) {
++	return;
++}
+ 
+-        spin_lock_irqsave(&pdc_lock, flags);
+-	retval = mem_pdc_call(PDC_MODEL, PDC_MODEL_CAPABILITIES, __pa(pdc_result), 0);
+-	convert_to_wide(pdc_result);
+-	if(pdc_result[0] != NARROW_FIRMWARE)
+-		parisc_narrow_firmware = 0;
+-        spin_unlock_irqrestore(&pdc_lock, flags);
+-#endif
++void __init set_firmware_width(void) {
++	return;
+ }
++#endif /*CONFIG_64BIT*/
+ 
+ /**
+  * pdc_emergency_unlock - Unlock the linux pdc lock
+@@ -288,6 +302,20 @@ int pdc_chassis_warn(unsigned long *warn
+ 	return retval;
+ }
+ 
++int __init pdc_coproc_cfg_unlocked(struct pdc_coproc_cfg *pdc_coproc_info)
++{
++	int ret;
++
++	ret = mem_pdc_call(PDC_COPROC, PDC_COPROC_CFG, __pa(pdc_result));
++	convert_to_wide(pdc_result);
++	pdc_coproc_info->ccr_functional = pdc_result[0];
++	pdc_coproc_info->ccr_present = pdc_result[1];
++	pdc_coproc_info->revision = pdc_result[17];
++	pdc_coproc_info->model = pdc_result[18];
++
++	return ret;
++}
++
+ /**
+  * pdc_coproc_cfg - To identify coprocessors attached to the processor.
+  * @pdc_coproc_info: Return buffer address.
+@@ -297,19 +325,14 @@ int pdc_chassis_warn(unsigned long *warn
+  */
+ int __init pdc_coproc_cfg(struct pdc_coproc_cfg *pdc_coproc_info)
+ {
+-        int retval;
++	int ret;
+ 	unsigned long flags;
+ 
+-        spin_lock_irqsave(&pdc_lock, flags);
+-        retval = mem_pdc_call(PDC_COPROC, PDC_COPROC_CFG, __pa(pdc_result));
+-        convert_to_wide(pdc_result);
+-        pdc_coproc_info->ccr_functional = pdc_result[0];
+-        pdc_coproc_info->ccr_present = pdc_result[1];
+-        pdc_coproc_info->revision = pdc_result[17];
+-        pdc_coproc_info->model = pdc_result[18];
+-        spin_unlock_irqrestore(&pdc_lock, flags);
++	spin_lock_irqsave(&pdc_lock, flags);
++	ret = pdc_coproc_cfg_unlocked(pdc_coproc_info);
++	spin_unlock_irqrestore(&pdc_lock, flags);
+ 
+-        return retval;
++	return ret;
+ }
+ 
+ /**
+diff -urpN linux-source-2.6.26.orig/include/asm-parisc/pdc.h linux-source-2.6.26/include/asm-parisc/pdc.h
+--- linux-source-2.6.26.orig/include/asm-parisc/pdc.h	2008-07-13 15:51:29.000000000 -0600
++++ linux-source-2.6.26/include/asm-parisc/pdc.h	2008-09-18 16:28:07.000000000 -0600
+@@ -600,6 +600,7 @@ int pdc_chassis_info(struct pdc_chassis_
+ int pdc_chassis_disp(unsigned long disp);
+ int pdc_chassis_warn(unsigned long *warn);
+ int pdc_coproc_cfg(struct pdc_coproc_cfg *pdc_coproc_info);
++int pdc_coproc_cfg_unlocked(struct pdc_coproc_cfg *pdc_coproc_info);
+ int pdc_iodc_read(unsigned long *actcnt, unsigned long hpa, unsigned int index,
+ 		  void *iodc_data, unsigned int iodc_data_size);
+ int pdc_system_map_find_mods(struct pdc_system_map_mod_info *pdc_mod_info,
+@@ -638,6 +639,7 @@ int pdc_mem_mem_table(struct pdc_memory_
+ #endif
+ 
+ void set_firmware_width(void);
++void set_firmware_width_unlocked(void);
+ int pdc_do_firm_test_reset(unsigned long ftc_bitmap);
+ int pdc_do_reset(void);
+ int pdc_soft_power_info(unsigned long *power_reg);

Added: dists/sid/linux-2.6/debian/patches/bugfix/parisc/hijack-jump-to-start_kernel.patch
==============================================================================
--- (empty file)
+++ dists/sid/linux-2.6/debian/patches/bugfix/parisc/hijack-jump-to-start_kernel.patch	Fri Sep 19 16:44:30 2008
@@ -0,0 +1,68 @@
+From: Kyle McMartin <kyle at mcmartin.ca>
+Date: Tue, 29 Jul 2008 04:11:13 +0000 (-0400)
+Subject: parisc: hijack jump to start_kernel
+X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fkyle%2Fparisc-2.6.git;a=commitdiff_plain;h=1a189c07f9f65305442d6e99efac9ac44f86bc04
+
+parisc: hijack jump to start_kernel
+
+Bang in our own start_parisc call, which initializes the PDC
+width, and turns on the FPU.
+
+Previously, if CONFIG_PRINTK_TIME was on, we'd attempt to use
+the FPU before we had enabled it, resulting in a difficult
+to diagnose panic.
+
+This patch causes init_per_cpu to redundantly set these for
+cpu0, but this is harmless.
+---
+
+diff --git a/arch/parisc/kernel/head.S b/arch/parisc/kernel/head.S
+index a84e31e..0e3d9f9 100644
+--- a/arch/parisc/kernel/head.S
++++ b/arch/parisc/kernel/head.S
+@@ -121,7 +121,7 @@ $pgt_fill_loop:
+ 	copy		%r0,%r2
+ 
+ 	/* And the RFI Target address too */
+-	load32		start_kernel,%r11
++	load32		start_parisc,%r11
+ 
+ 	/* And the initial task pointer */
+ 	load32		init_thread_union,%r6
+diff --git a/arch/parisc/kernel/setup.c b/arch/parisc/kernel/setup.c
+index 39e7c5a..a59b71e 100644
+--- a/arch/parisc/kernel/setup.c
++++ b/arch/parisc/kernel/setup.c
+@@ -368,6 +368,31 @@ static int __init parisc_init(void)
+ 
+ 	return 0;
+ }
+-
+ arch_initcall(parisc_init);
+ 
++void start_parisc(void)
++{
++	extern void start_kernel(void);
++
++	int ret, cpunum;
++	struct pdc_coproc_cfg coproc_cfg;
++
++	cpunum = smp_processor_id();
++
++	set_firmware_width_unlocked();
++
++	ret = pdc_coproc_cfg_unlocked(&coproc_cfg);
++	if (ret >= 0 && coproc_cfg.ccr_functional) {
++		mtctl(coproc_cfg.ccr_functional, 10);
++
++		cpu_data[cpunum].fp_rev = coproc_cfg.revision;
++		cpu_data[cpunum].fp_model = coproc_cfg.model;
++
++		asm volatile ("fstd	%fr0,8(%sp)");
++	} else {
++		panic("must have an fpu to boot linux");
++	}
++
++	start_kernel();
++	// not reached
++}

Modified: dists/sid/linux-2.6/debian/patches/series/6
==============================================================================
--- dists/sid/linux-2.6/debian/patches/series/6	(original)
+++ dists/sid/linux-2.6/debian/patches/series/6	Fri Sep 19 16:44:30 2008
@@ -1 +1,3 @@
 + bugfix/mips/fix_dead_21041_after_ifconfig_down.patch
++ bugfix/parisc/add-lockless-fw-funcs.patch
++ bugfix/parisc/hijack-jump-to-start_kernel.patch



More information about the Kernel-svn-changes mailing list