All of lore.kernel.org
 help / color / mirror / Atom feed
* [uml-devel] Re: [PATCH 12/16] UML - Memory hotplug
From: Daniel Phillips @ 2006-04-05 22:02 UTC (permalink / raw)
  To: Jeff Dike; +Cc: Andrew Morton, linux-kernel, user-mode-linux-devel
In-Reply-To: <20060325010524.GA8117@ccure.user-mode-linux.org>

Jeff Dike wrote:
> This is the big question with this patch.  How incestuous do I want to
> get with the VM system in order to get it to free up pages?  For now,
> I decided to be fairly hands-off, allocate as many pages as I can get,
> and return the total number to the host.  The host, if it wasn't happy
> with the results, can wait a bit while the UML notices that it is
> really low on memory and frees some up, and then hit up the UML for
> the remainder.

And also wrote:
> page = alloc_page(GFP_ATOMIC);

A slightly different objection than Andrew's: this will rapidly eat up
all the pages available for, e.g., receiving network packets, probably
not what you want.  How about flags=0?  This will dip a little way into
reserves but not as far as interrupts or realtime tasks, and will not
attempt any reclaim.  (Maybe we should have a GFP define for that.)

> INIT_LIST_HEAD(&unplugged->list);
> list_add(&unplugged->list, &unplugged_pages);

You don't need to initialize the list element you are adding.

Regards,

Daniel


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply

* Re: [PATCH 12/16] UML - Memory hotplug
From: Daniel Phillips @ 2006-04-05 22:02 UTC (permalink / raw)
  To: Jeff Dike; +Cc: Andrew Morton, linux-kernel, user-mode-linux-devel
In-Reply-To: <20060325010524.GA8117@ccure.user-mode-linux.org>

Jeff Dike wrote:
> This is the big question with this patch.  How incestuous do I want to
> get with the VM system in order to get it to free up pages?  For now,
> I decided to be fairly hands-off, allocate as many pages as I can get,
> and return the total number to the host.  The host, if it wasn't happy
> with the results, can wait a bit while the UML notices that it is
> really low on memory and frees some up, and then hit up the UML for
> the remainder.

And also wrote:
> page = alloc_page(GFP_ATOMIC);

A slightly different objection than Andrew's: this will rapidly eat up
all the pages available for, e.g., receiving network packets, probably
not what you want.  How about flags=0?  This will dip a little way into
reserves but not as far as interrupts or realtime tasks, and will not
attempt any reclaim.  (Maybe we should have a GFP define for that.)

> INIT_LIST_HEAD(&unplugged->list);
> list_add(&unplugged->list, &unplugged_pages);

You don't need to initialize the list element you are adding.

Regards,

Daniel

^ permalink raw reply

* HZ vs battery life
From: Brown, Len @ 2006-04-05 22:03 UTC (permalink / raw)
  To: linux-acpi, linux-laptop

I measured idle battery life at 250HZ, which is what my SL10.1-beta8
laptop has as the default.

I compiled the distro kernel with HZ=1000 and battery life got worse --
no surpose.

But then I built with HZ=100 and it was the same results as HZ=1000,
when I expected it to be better than HZ=250.

clues?
-Len

ps. yes, I'm running at init5.  I'll repeat at init1.

^ permalink raw reply

* [U-Boot-Users] [PATCH] objcopy for srec and bin files should be done on .o files
From: Martin Hicks @ 2006-04-05 22:03 UTC (permalink / raw)
  To: u-boot
In-Reply-To: <20060405210404.D8482352664@atlas.denx.de>

On Wed, Apr 05, 2006 at 11:04:04PM +0200, Wolfgang Denk wrote:
> 
> SSounds as if your Makefile  is  corrupted.  Of  course  there  is  a
> hello_world.srec target in it. Or your version of "make" is broken...

aha.  It's a make 3.80 vs. 3.81 problem...  Debian etch (testing)
already has 3.81 in it.  More people will start running into this
problem.

It still might be easier and less error prone to change the rule to use
the object files instead of the elf binary, but its up to you.

mh

-- 
Martin Hicks || mort at bork.org || PGP/GnuPG: 0x4C7F2BEE


[PATCH] Switch order of ELF and BIN objects for make 3.81

make 3.81 evaluates things a little differently.  Without this patch
the build fails as follows with make 3.81

make[1]: *** No rule to make target `hello_world.srec', needed by `all'.  Stop.
make[1]: Leaving directory `/home/mort/src/targa/u-boot/u-boot-TOT/examples'
make: *** [examples] Error 2

Compile tested with make 3.80 and 3.81

Signed-off-by: Martin Hicks <mort@bork.org>

---

 examples/Makefile |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

fee8cad056b09b76425e027b49144d4e9664662e
diff --git a/examples/Makefile b/examples/Makefile
index fee2674..5386339 100644
--- a/examples/Makefile
+++ b/examples/Makefile
@@ -60,44 +60,44 @@ endif
 include $(TOPDIR)/config.mk
 
 SREC	= hello_world.srec
-BIN	= hello_world.bin hello_world
+BIN	= hello_world hello_world.bin
 
 ifeq ($(CPU),mpc8xx)
 SREC	= test_burst.srec
-BIN	= test_burst.bin test_burst
+BIN	= test_burst test_burst.bin
 endif
 
 ifeq ($(ARCH),i386)
 SREC   += 82559_eeprom.srec
-BIN    += 82559_eeprom.bin 82559_eeprom
+BIN    += 82559_eeprom 82559_eeprom.bin
 endif
 
 ifeq ($(ARCH),ppc)
 SREC   += sched.srec
-BIN    += sched.bin sched
+BIN    += sched sched.bin
 endif
 
 ifeq ($(ARCH),blackfin)
 SREC	+= smc91111_eeprom.srec
-BIN 	+= smc91111_eeprom.bin smc91111_eeprom
+BIN 	+= smc91111_eeprom smc91111_eeprom.bin
 endif
 
 # The following example is pretty 8xx specific...
 ifeq ($(CPU),mpc8xx)
 SREC   += timer.srec
-BIN    += timer.bin timer
+BIN    += timer timer.bin
 endif
 
 # The following example is 8260 specific...
 ifeq ($(CPU),mpc8260)
 SREC   += mem_to_mem_idma2intr.srec
-BIN    += mem_to_mem_idma2intr.bin mem_to_mem_idma2intr
+BIN    += mem_to_mem_idma2intr mem_to_mem_idma2intr.bin
 endif
 
 # Utility for resetting i82559 EEPROM
 ifeq ($(BOARD),oxc)
 SREC   += eepro100_eeprom.srec
-BIN    += eepro100_eeprom.bin eepro100_eeprom
+BIN    += eepro100_eeprom eepro100_eeprom.bin
 endif
 
 ifeq ($(BIG_ENDIAN),y)
@@ -122,7 +122,7 @@ clibdir := $(shell dirname `$(CC) $(CFLA
 
 CPPFLAGS += -I..
 
-all:	.depend $(OBJS) $(LIB) $(SREC) $(BIN)
+all:	.depend $(OBJS) $(LIB) $(BIN) $(SREC)
 
 #########################################################################
 $(LIB): .depend $(LIBOBJS)
-- 
1.2.4

^ permalink raw reply related

* Re: Issues with symbol names
From: Andreas Schwab @ 2006-04-05 22:05 UTC (permalink / raw)
  To: Kristis Makris; +Cc: linux-kernel
In-Reply-To: <1144268838.8306.16.camel@syd.mkgnu.net>

Kristis Makris <kristis.makris@asu.edu> writes:

> My goal here is to use /proc/kallsyms to determine the size of a function
> image at runtime.

The size is also recorded in the symbol table.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply

* Re: [e1000 debug] KERNEL: assertion (!sk_forward_alloc) failed...
From: Jesse Brandeburg @ 2006-04-05 22:05 UTC (permalink / raw)
  To: Boris B. Zhmurov
  Cc: Phil Oester, Mark Nipper, Herbert Xu, David S. Miller,
	Brandeburg, Jesse, jrlundgren, cat, djani22, yoseph.basri, mykleb,
	olel, michal, chris, netdev, jesse.brandeburg, E1000-devel,
	Andi Kleen, Jeff Garzik
In-Reply-To: <44319AFF.4090101@kernelpanic.ru>



On Mon, 3 Apr 2006, Boris B. Zhmurov wrote:

> 
> Hello, Phil Oester.
> 
> On 04.04.2006 01:39 you said the following:
> 
> > On Mon, Apr 03, 2006 at 04:01:23PM -0500, Mark Nipper wrote:
> >
> >>        After three days and some hours, I finally saw another
> >>event:
> >
> >
> > Ack, same here.  Looked hopeful, but finally saw the error today.
> >
> > Phil
> 
> 
> [root@msk4 ~]# dmesg |grep assertion |wc -l
> 176
> 
> [root@msk4 ~]# uptime
>   02:00:01 up 3 days,  7:31,  2 users,  load average: 1.32, 0.59, 0.41
> 

Some earlier had proposed that this problem appeared in 2.6.12, which was 
the introduction of the 6.X series e1000 driver.

If someone would like to, can they try the 5.6.10.1 driver from the 
2.6.11.X kernel?

I'd like it if you can stick with your current kernel, and if you have 
trouble building the driver, go ahead and try the 5.6.10.1 driver from 
http://prdownloads.sf.net/e1000

I'll also send a patch today to back-rev the xmit routine to the 5.6.10.1 
state.

Jesse


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642

^ permalink raw reply

* Re: [PATCH] modules_install must not remove existing modules
From: Andreas Gruenbacher @ 2006-04-05 22:06 UTC (permalink / raw)
  To: Valdis.Kletnieks; +Cc: Sam Ravnborg, linux-kernel
In-Reply-To: <200604052152.k35LqtQ0032100@turing-police.cc.vt.edu>

On Wednesday 05 April 2006 23:52, Valdis.Kletnieks@vt.edu wrote:
> Can this be re-worked to ensure that it clears the target directory
> the *first* time?  It would suck mightily if a previous build of 2.6.17-rc2
> left a net_foo.ko lying around to get insmod'ed by accident (consider the
> case of CONFIG_NETFOO=m getting changed to y or n, and other possible
> horkage. Module versioning will catch some, but not all, of this crap....)

We could wipe away everything in the non-external modules_install case (not 
only everything below kernel/ as is done now). The problem here is that 
different external modules_install calls into the same dir conflict.

Andreas

^ permalink raw reply

* [PATCH] sysfs interface for Au1xxx power management
From: Rodolfo Giometti @ 2006-04-05 22:19 UTC (permalink / raw)
  To: Linux MIPS

[-- Attachment #1: Type: text/plain, Size: 538 bytes --]

Hello,

here a patch to support new sysfs interface for Au1xxx's power
management. Now we can put the system into sleeping mode by using:

   hostname:~# echo mem > /sys/power/state 

The patch keeps also the file "/proc/sys/pm/freq" from the old
interface.

Ciao,

Rodolfo

-- 

GNU/Linux Solutions                  e-mail:    giometti@enneenne.com
Linux Device Driver                             giometti@gnudd.com
Embedded Systems                     		giometti@linux.it
UNIX programming                     phone:     +39 349 2432127

[-- Attachment #2: patch-pm-sysfs --]
[-- Type: text/plain, Size: 12436 bytes --]

--- /home/develop/embedded/mipsel/linux/linux-mips.git/arch/mips/au1000/common/power.c	2006-03-31 16:57:26.000000000 +0200
+++ arch/mips/au1000/common/power.c	2006-04-06 00:08:59.000000000 +0200
@@ -1,6 +1,11 @@
 /*
  * BRIEF MODULE DESCRIPTION
- *	Au1000 Power Management routines.
+ *	Au1xxx Power Management routines (sysfs and procfs interfaces).
+ *
+ * Copyright 2006 Rodolfo Giometti <giometti@linux.it>
+ *
+ * Based on some previous version's functions, so I report below the previous
+ * copyright message:
  *
  * Copyright 2001 MontaVista Software Inc.
  * Author: MontaVista Software, Inc.
@@ -32,7 +37,6 @@
 #include <linux/config.h>
 #include <linux/init.h>
 #include <linux/pm.h>
-#include <linux/pm_legacy.h>
 #include <linux/slab.h>
 #include <linux/sysctl.h>
 #include <linux/jiffies.h>
@@ -43,18 +47,17 @@
 #include <asm/system.h>
 #include <asm/cacheflush.h>
 #include <asm/mach-au1x00/au1000.h>
+#include <asm/mach-au1x00/power.h>
 
-#ifdef CONFIG_PM
+static unsigned long cpu_freq;
 
-#define DEBUG 1
+//#define DEBUG 1
 #ifdef DEBUG
 #  define DPRINTK(fmt, args...)	printk("%s: " fmt, __FUNCTION__ , ## args)
 #else
 #  define DPRINTK(fmt, args...)
 #endif
 
-static void au1000_calibrate_delay(void);
-
 extern void set_au1x00_speed(unsigned int new_freq);
 extern unsigned int get_au1x00_speed(void);
 extern unsigned long get_au1x00_uart_baud_base(void);
@@ -64,9 +67,9 @@
 extern void local_enable_irq(unsigned int irq_nr);
 
 /* Quick acpi hack. This will have to change! */
-#define	CTL_ACPI 9999
-#define	ACPI_S1_SLP_TYP 19
-#define	ACPI_SLEEP 21
+#define	CTL_ACPI	9999
+#define	ACPI_S1_SLP_TYP	19
+#define	ACPI_SLEEP	21
 
 
 static DEFINE_SPINLOCK(pm_lock);
@@ -83,6 +86,7 @@
 static uint	sleep_aux_pll_cntrl;
 static uint	sleep_cpu_pll_cntrl;
 static uint	sleep_pin_function;
+static uint	sleep_gpio2_enable;
 static uint	sleep_uart0_inten;
 static uint	sleep_uart0_fifoctl;
 static uint	sleep_uart0_linectl;
@@ -92,16 +96,45 @@
 static uint	sleep_usbdev_enable;
 static uint	sleep_static_memctlr[4][3];
 
-/* Define this to cause the value you write to /proc/sys/pm/sleep to
- * set the TOY timer for the amount of time you want to sleep.
- * This is done mainly for testing, but may be useful in other cases.
- * The value is number of 32KHz ticks to sleep.
- */
-#define SLEEP_TEST_TIMEOUT 1
-#ifdef SLEEP_TEST_TIMEOUT
-static	int	sleep_ticks;
-void wakeup_counter0_set(int ticks);
-#endif
+/* This is the number of bits of precision for the loops_per_jiffy.  Each
+   bit takes on average 1.5/HZ seconds.  This (like the original) is a little
+   better than 1% */
+#define LPS_PREC 8
+
+static void au1000_calibrate_delay(void)
+{
+	unsigned long ticks, loopbit;
+	int lps_precision = LPS_PREC;
+
+	loops_per_jiffy = (1 << 12);
+
+	while (loops_per_jiffy <<= 1) {
+		/* wait for "start of" clock tick */
+		ticks = jiffies;
+		while (ticks == jiffies)
+			/* nothing */ ;
+		/* Go .. */
+		ticks = jiffies;
+		__delay(loops_per_jiffy);
+		ticks = jiffies - ticks;
+		if (ticks)
+			break;
+	}
+
+/* Do a binary approximation to get loops_per_jiffy set to equal one clock
+   (up to lps_precision bits) */
+	loops_per_jiffy >>= 1;
+	loopbit = loops_per_jiffy;
+	while (lps_precision-- && (loopbit >>= 1)) {
+		loops_per_jiffy |= loopbit;
+		ticks = jiffies;
+		while (ticks == jiffies);
+		ticks = jiffies;
+		__delay(loops_per_jiffy);
+		if (jiffies != ticks)	/* longer than 1 tick */
+			loops_per_jiffy &= ~loopbit;
+	}
+}
 
 static void
 save_core_regs(void)
@@ -147,6 +180,7 @@
 	sleep_cpu_pll_cntrl = au_readl(SYS_CPUPLL);
 
 	sleep_pin_function = au_readl(SYS_PINFUNC);
+	sleep_gpio2_enable = au_readl(GPIO2_ENABLE);
 
 	/* Save the static memory controller configuration.
 	*/
@@ -173,6 +207,7 @@
 	au_writel(sleep_aux_pll_cntrl, SYS_AUXPLL); au_sync();
 	au_writel(sleep_cpu_pll_cntrl, SYS_CPUPLL); au_sync();
 	au_writel(sleep_pin_function, SYS_PINFUNC); au_sync();
+	au_writel(sleep_gpio2_enable, GPIO2_ENABLE); au_sync();
 
 	/* Restore the static memory controller configuration.
 	*/
@@ -206,47 +241,48 @@
 	wakeup_counter0_adjust();
 }
 
-unsigned long suspend_mode;
-
-void wakeup_from_suspend(void)
-{
-	suspend_mode = 0;
-}
+void wakeup_counter0_set(int ticks);
+int (*board_before_sleep)(void);
+void (*board_after_sleep)(int reason);
 
-int au_sleep(void)
+int au_sleep(int reason, int force)
 {
+	int ticks = 0;
 	unsigned long wakeup, flags;
-	extern	void	save_and_sleep(void);
+	int board_reason = 0;
 
-	spin_lock_irqsave(&pm_lock,flags);
+	/* We need to configure the GPIO or timer interrupts that will bring
+	 * us out of sleep, so we use the specific board wake up source
+	 * (if present) */
+	if (board_before_sleep)
+		board_reason = board_before_sleep();
+	if (!force)
+		reason = board_reason;
+
+	spin_lock_irqsave(&pm_lock, flags);
 
 	save_core_regs();
 
 	flush_cache_all();
 
-	/** The code below is all system dependent and we should probably
-	 ** have a function call out of here to set this up.  You need
-	 ** to configure the GPIO or timer interrupts that will bring
-	 ** you out of sleep.
-	 ** For testing, the TOY counter wakeup is useful.
-	 **/
-
-#if 0
-	au_writel(au_readl(SYS_PINSTATERD) & ~(1 << 11), SYS_PINSTATERD);
-
-	/* gpio 6 can cause a wake up event */
-	wakeup = au_readl(SYS_WAKEMSK);
-	wakeup &= ~(1 << 8);	/* turn off match20 wakeup */
-	wakeup |= 1 << 6;	/* turn on gpio 6 wakeup   */
-#else
-	/* For testing, allow match20 to wake us up.
-	*/
-#ifdef SLEEP_TEST_TIMEOUT
-	wakeup_counter0_set(sleep_ticks);
-#endif
-	wakeup = 1 << 8;	/* turn on match20 wakeup   */
-	wakeup = 0;
-#endif
+	if (reason == 0)		/* machine_halt() */
+		wakeup = 0;
+	else if (reason < 0) {		/* TOY wake up */
+		ticks = -reason*HZ;
+		wakeup_counter0_set(ticks);
+		wakeup = 1<<8;		/* turn on match20 as wake up */
+	}
+	else {				/* GPIO[0-7] wake up */
+		/* FIXME: this setting for GPIO[6] should be into specific
+		 *        boards setup... */
+		/* We force pin GPIO[6]/SMROMCKE as gpio6 */
+		au_writel(au_readl(SYS_PINSTATERD)&~(1<<11), SYS_PINSTATERD);
+
+		wakeup = reason&0x0ff;	/* turn on selected gpio as wake up */
+	}
+	printk(KERN_DEBUG "%s - reason %x force %x wakeup %lx ticks %x\n",
+	       __FUNCTION__, reason, force, wakeup, ticks);
+
 	au_writel(1, SYS_WAKESRC);	/* clear cause */
 	au_sync();
 	au_writel(wakeup, SYS_WAKEMSK);
@@ -254,102 +290,52 @@
 
 	save_and_sleep();
 
-	/* after a wakeup, the cpu vectors back to 0x1fc00000 so
+	/* after a wake up, the cpu vectors back to 0x1fc00000 so
 	 * it's up to the boot code to get us back here.
 	 */
 	restore_core_regs();
-	spin_unlock_irqrestore(&pm_lock, flags);
-	return 0;
-}
-
-static int pm_do_sleep(ctl_table * ctl, int write, struct file *file,
-		       void __user *buffer, size_t * len, loff_t *ppos)
-{
-	int retval = 0;
-#ifdef SLEEP_TEST_TIMEOUT
-#define TMPBUFLEN2 16
-	char buf[TMPBUFLEN2], *p;
-#endif
-
-	if (!write) {
-		*len = 0;
-	} else {
-#ifdef SLEEP_TEST_TIMEOUT
-		if (*len > TMPBUFLEN2 - 1) {
-			return -EFAULT;
-		}
-		if (copy_from_user(buf, buffer, *len)) {
-			return -EFAULT;
-		}
-		buf[*len] = 0;
-		p = buf;
-		sleep_ticks = simple_strtoul(p, &p, 0);
-#endif
-		retval = pm_send_all(PM_SUSPEND, (void *) 2);
-
-		if (retval)
-			return retval;
-
-		au_sleep();
-		retval = pm_send_all(PM_RESUME, (void *) 0);
-	}
-	return retval;
-}
 
-static int pm_do_suspend(ctl_table * ctl, int write, struct file *file,
-			 void __user *buffer, size_t * len, loff_t *ppos)
-{
-	int retval = 0;
+	spin_unlock_irqrestore(&pm_lock, flags);
 
-	if (!write) {
-		*len = 0;
-	} else {
-		retval = pm_send_all(PM_SUSPEND, (void *) 2);
-		if (retval)
-			return retval;
-		suspend_mode = 1;
+	/* Get wake up source */
+	reason = au_readl(SYS_WAKESRC)>>18;
+	if (reason&(1<<8))		/* Wake up thanks to TOY */
+		reason = -ticks*HZ;
+
+	/* Call specific board routine */
+	if (board_after_sleep)
+		board_after_sleep(reason);
 
-		retval = pm_send_all(PM_RESUME, (void *) 0);
-	}
-	return retval;
+	return 0;
 }
 
-
-static int pm_do_freq(ctl_table * ctl, int write, struct file *file,
+static int au1xxx_pm_do_freq(ctl_table * ctl, int write, struct file *file,
 		      void __user *buffer, size_t * len, loff_t *ppos)
 {
 	int retval = 0, i;
-	unsigned long val, pll;
-#define TMPBUFLEN 64
-#define MAX_CPU_FREQ 396
-	char buf[TMPBUFLEN], *p;
+	unsigned long *valp = (unsigned long *) ctl->data;
+	unsigned long pll;
 	unsigned long flags, intc0_mask, intc1_mask;
 	unsigned long old_baud_base, old_cpu_freq, baud_rate, old_clk,
 	    old_refresh;
 	unsigned long new_baud_base, new_cpu_freq, new_clk, new_refresh;
 
 	spin_lock_irqsave(&pm_lock, flags);
-	if (!write) {
+
+	if (!write)
 		*len = 0;
-	} else {
-		/* Parse the new frequency */
-		if (*len > TMPBUFLEN - 1) {
-			spin_unlock_irqrestore(&pm_lock, flags);
-			return -EFAULT;
-		}
-		if (copy_from_user(buf, buffer, *len)) {
-			spin_unlock_irqrestore(&pm_lock, flags);
-			return -EFAULT;
-		}
-		buf[*len] = 0;
-		p = buf;
-		val = simple_strtoul(p, &p, 0);
-		if (val > MAX_CPU_FREQ) {
+
+	retval = proc_dointvec(ctl, write, file, buffer, len, ppos);
+
+#define MAX_CPU_FREQ 396
+	if (write) {
+		/* Check the new frequency */
+		if (*valp > MAX_CPU_FREQ) {
 			spin_unlock_irqrestore(&pm_lock, flags);
 			return -EFAULT;
 		}
 
-		pll = val / 12;
+		pll = *valp / 12;
 		if ((pll > 33) || (pll < 7)) {	/* 396 MHz max, 84 MHz min */
 			/* revisit this for higher speed cpus */
 			spin_unlock_irqrestore(&pm_lock, flags);
@@ -424,72 +410,66 @@
 	return retval;
 }
 
+/*
+ * Called after processes are frozen, but before we shut down devices.
+ */
+int au1xxx_pm_prepare(suspend_state_t state)
+{
+	DPRINTK("state = %d\n", state);
+	return 0;
+}
 
-static struct ctl_table pm_table[] = {
-	{ACPI_S1_SLP_TYP, "suspend", NULL, 0, 0600, NULL, &pm_do_suspend},
-	{ACPI_SLEEP, "sleep", NULL, 0, 0600, NULL, &pm_do_sleep},
-	{CTL_ACPI, "freq", NULL, 0, 0600, NULL, &pm_do_freq},
-	{0}
-};
-
-static struct ctl_table pm_dir_table[] = {
-	{CTL_ACPI, "pm", NULL, 0, 0555, pm_table},
-	{0}
-};
+/*
+ * Called after down devices.
+ */
+int au1xxx_pm_enter(suspend_state_t state)
+{
+	DPRINTK("state = %d\n", state);
+	return au_sleep(1<<6 /* GPIO 6 */, 1);
+	/* return au_sleep(-3, 1); */ /* wake up after 3 seconds */
+}
 
 /*
- * Initialize power interface
+ * Called after devices are re-setup, but before processes are thawed.
  */
-static int __init pm_init(void)
+int au1xxx_pm_finish(suspend_state_t state)
 {
-	register_sysctl_table(pm_dir_table, 1);
+	DPRINTK("state = %d\n", state);
 	return 0;
 }
 
-__initcall(pm_init);
-
+/*
+ * Set to PM_DISK_FIRMWARE so we can quickly veto suspend-to-disk.
+ */
+static struct pm_ops au1xxx_pm_ops = {
+	.pm_disk_mode	= PM_DISK_FIRMWARE,
+	.prepare	= au1xxx_pm_prepare,
+	.enter		= au1xxx_pm_enter,
+	.finish		= au1xxx_pm_finish,
+};
 
 /*
- * This is right out of init/main.c
+ * Set up the old "/proc/sys/pm" interface.
  */
+static struct ctl_table au1xxx_pm_table[] = {
+	{ CTL_ACPI, "freq", &cpu_freq, sizeof(int), 0600, NULL, &au1xxx_pm_do_freq },
+	{ 0 },
+};
 
-/* This is the number of bits of precision for the loops_per_jiffy.  Each
-   bit takes on average 1.5/HZ seconds.  This (like the original) is a little
-   better than 1% */
-#define LPS_PREC 8
+static struct ctl_table pm_dir_table[] = {
+	{ CTL_ACPI, "pm", NULL, 0, 0555, au1xxx_pm_table },
+	{ 0 },
+};
 
-static void au1000_calibrate_delay(void)
+static int __init au1xxx_pm_init(void)
 {
-	unsigned long ticks, loopbit;
-	int lps_precision = LPS_PREC;
-
-	loops_per_jiffy = (1 << 12);
+	/* The new interface */
+	pm_set_ops(&au1xxx_pm_ops);
 
-	while (loops_per_jiffy <<= 1) {
-		/* wait for "start of" clock tick */
-		ticks = jiffies;
-		while (ticks == jiffies)
-			/* nothing */ ;
-		/* Go .. */
-		ticks = jiffies;
-		__delay(loops_per_jiffy);
-		ticks = jiffies - ticks;
-		if (ticks)
-			break;
-	}
+	/* The old interface */
+	register_sysctl_table(pm_dir_table, 1);
 
-/* Do a binary approximation to get loops_per_jiffy set to equal one clock
-   (up to lps_precision bits) */
-	loops_per_jiffy >>= 1;
-	loopbit = loops_per_jiffy;
-	while (lps_precision-- && (loopbit >>= 1)) {
-		loops_per_jiffy |= loopbit;
-		ticks = jiffies;
-		while (ticks == jiffies);
-		ticks = jiffies;
-		__delay(loops_per_jiffy);
-		if (jiffies != ticks)	/* longer than 1 tick */
-			loops_per_jiffy &= ~loopbit;
-	}
+	return 0;
 }
-#endif				/* CONFIG_PM */
+
+device_initcall(au1xxx_pm_init);

^ permalink raw reply

* Re: Power management for au1000_eth.c
From: Rodolfo Giometti @ 2006-04-05 22:23 UTC (permalink / raw)
  To: Linux MIPS; +Cc: ppopov
In-Reply-To: <20060405154711.GL7029@enneenne.com>

On Wed, Apr 05, 2006 at 05:47:11PM +0200, Rodolfo Giometti wrote:
> Hello,
> 
> I'm trying to add power management support to au1000_eth.c driver.

Solved! :)

Here a patch to implement power management functions for au1000_eth.

Note that this patch needs my previous one who implements new power
management's sysfs interface.

Ciao,

Rodolfo

-- 

GNU/Linux Solutions                  e-mail:    giometti@enneenne.com
Linux Device Driver                             giometti@gnudd.com
Embedded Systems                     		giometti@linux.it
UNIX programming                     phone:     +39 349 2432127

^ permalink raw reply

* Re: [PATCH] modules_install must not remove existing modules
From: Sam Ravnborg @ 2006-04-05 22:12 UTC (permalink / raw)
  To: Andreas Gruenbacher; +Cc: linux-kernel
In-Reply-To: <200604052333.51085.agruen@suse.de>

On Wed, Apr 05, 2006 at 11:33:50PM +0200, Andreas Gruenbacher wrote:
> When installing external modules with `make modules_install', the
> first thing that happens is a rm -rf of the target directory. This
> works only once, and breaks when installing more than one (set of)
> external module(s). Bug introduced in:
>   http://www.kernel.org/hg/linux-2.6/?cs=bbb3915836f5
> 
> Sam, is this fix okay with you?
The removal was introduced to get rid of old modules from an earlier
build of the same kernel with potential more modules.
I was obvious when I played with an allmodconfig kernel IIRC.

The usecase you have in mind is with external modules only?
We could special case in that suation and avoid the removal.

I see no way to detect when it is OK to remove or not, so in the
principle of least suprise I prefer having the removal unconditional for
normal kernel builds, and no removal for external modules.

OK?

	Sam


> 
> Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
> 
> Index: linux-2.6.16/Makefile
> ===================================================================
> --- linux-2.6.16.orig/Makefile
> +++ linux-2.6.16/Makefile
> @@ -1131,7 +1131,6 @@ modules_install: _emodinst_ _emodinst_po
>  install-dir := $(if $(INSTALL_MOD_DIR),$(INSTALL_MOD_DIR),extra)	
>  .PHONY: _emodinst_
>  _emodinst_:
> -	$(Q)rm -rf $(MODLIB)/$(install-dir)
>  	$(Q)mkdir -p $(MODLIB)/$(install-dir)
>  	$(Q)$(MAKE) -rR -f $(srctree)/scripts/Makefile.modinst
> 
> -- 
> Andreas Gruenbacher <agruen@suse.de>
> Novell / SUSE Labs

^ permalink raw reply

* [lm-sensors] [Fwd: Re: [Fwd: Sensor readings from Gigabyte
From: Przemysław Kulik @ 2006-04-05 22:13 UTC (permalink / raw)
  To: lm-sensors

Hallo,

additional info: I've notice that now eeprom module fails to load at
sturtup. I'm pretty sure that has been working (giving the same temps
though)

Przemek
-------- Przesy?any list ----------
Od: Przemys?aw Kulik <przemek.kulik at neostrada.pl>
Dla: lm-sensors at lm-sensors.org
Temat: Re: [lm-sensors] [Fwd: Sensor readings from Gigabyte I915P Duo
Pro (IT8712F)]
Data: Wed, 05 Apr 2006 20:40:11 +0200

Dnia 05-04-2006, ?ro o godzinie 09:39 +0200, Rudolf Marek napisa?(a):
> 2) We can do the bios disassembly to see what is on BIOS screen. Unfortunately
>    this can take some time and I dont have one. You can check my homepage
>    http://assembler.cz (BIos hacking) if you have some assembly skills.
Unfortunately I do not
> 3) Unload the it87, get acpi working, modprobe thermal, can you see the
> temperature with the command acpi -V
>    If so I will need the cat /proc/apci/dsdt > dsdt.bin (put it somewhere online
>    or send me in private please, mailing list is dropping binary attachs)
Nothing here...
1) Here's my config:
[*] ACPI Support
  <M>   AC Adapter
  < >   Battery
  < >   Button
  <M>   Video
  < >   Generic Hotkey (EXPERIMENTAL)
  <M>   Fan
  <M>   Processor
  <M>     Thermal Zone
  < >   ASUS/Medion Laptop Extras
  < >   IBM ThinkPad Laptop Extras
  < >   Toshiba Laptop Extras
  (0)   Disable ACPI for systems before Jan 1st this year
  [ ]   Debug Statements
  [ ]   Power Management Timer Support
  < >   ACPI0004,PNP0A05 and PNP0A06 Container Driver (EXPERIMENTAL)

2) before modprobing
# lsmod
Module                  Size  Used by
hwmon_vid               3200  0
snd_pcm_oss            48800  0
snd_mixer_oss          17792  25 snd_pcm_oss
snd_seq_oss            34688  0
snd_seq_midi_event      6912  1 snd_seq_oss
snd_seq                51856  4 snd_seq_oss,snd_seq_midi_event
snd_seq_device          8076  2 snd_seq_oss,snd_seq
spca5xx               690832  0
8250_pnp                9344  0
8250                   23412  1 8250_pnp
serial_core            19200  1 8250
snd_hda_intel          15120  26
snd_hda_codec          87808  1 snd_hda_intel
snd_pcm                81540  3 snd_pcm_oss,snd_hda_intel,snd_hda_codec
snd_timer              22404  2 snd_seq,snd_pcm
snd                    49508  13
snd_pcm_oss,snd_mixer_oss,snd_seq_oss,snd_seq,snd_seq_device,snd_hda_intel,snd_hda_codec,snd_pcm,snd_timer
snd_page_alloc          9352  2 snd_hda_intel,snd_pcm
nvidia               3462748  22

# acpi -V
No support for device type: battery
No support for device type: thermal
No support for device type: ac_adapter

3) modprobing
# modprobe thermal

4) after modprobing
# lsmod
Module                  Size  Used by
thermal                11656  0
processor              16244  1 thermal
hwmon_vid               3200  0
snd_pcm_oss            48800  0
snd_mixer_oss          17792  25 snd_pcm_oss
snd_seq_oss            34688  0
snd_seq_midi_event      6912  1 snd_seq_oss
snd_seq                51856  4 snd_seq_oss,snd_seq_midi_event
snd_seq_device          8076  2 snd_seq_oss,snd_seq
spca5xx               690832  0
8250_pnp                9344  0
8250                   23412  1 8250_pnp
serial_core            19200  1 8250
snd_hda_intel          15120  26
snd_hda_codec          87808  1 snd_hda_intel
snd_pcm                81540  3 snd_pcm_oss,snd_hda_intel,snd_hda_codec
snd_timer              22404  2 snd_seq,snd_pcm
snd                    49508  13
snd_pcm_oss,snd_mixer_oss,snd_seq_oss,snd_seq,snd_seq_device,snd_hda_intel,snd_hda_codec,snd_pcm,snd_timer
snd_page_alloc          9352  2 snd_hda_intel,snd_pcm
nvidia               3462748  22

# acpi -V
No support for device type: battery
No support for device type: thermal
No support for device type: ac_adapter

Sorry for rhis, but I'm a n00b when it comes to hardware sensors.

Przemek



^ permalink raw reply

* Re: freescale lite 5200 board and kernel 2.6
From: John Rigby @ 2006-04-05 22:14 UTC (permalink / raw)
  To: linuxppc-embedded
In-Reply-To: <20060405212741.GC61331@server.idefix.loc>

Thanks Matthias now I don't have to say "we discussed this last week,
search the list" everytime this question comes up.

On 4/5/06, Matthias Fechner <idefix@fechner.net> wrote:
> Hello Domenico,
>
> * Domenico Andreoli <cavokz@gmail.com> [05-04-06 23:06]:
> > is there any patchset i can use for kernel 2.6? is it production-ready?
> > why isn't already in vanilla 2.6? has any sense to stay with kernel 2.4=
?
>
> I'm not sure if this helps, but I was successfully in getting a kernel
> 2.6 running with the icecube board. I have written a short docu in my
> wiki (booting with tftp and rootnfs over NFS):
> http://wiki.idefix.fechner.net/index.php/IceCube#Writing_kernel_modules_f=
or_2.6
>
> Maybe this will help.
> Please give me some feedback.
>
> Best regards,
> Matthias
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>

^ permalink raw reply

* [PATCH] Oops! - Re: Power management for au1000_eth.c
From: Rodolfo Giometti @ 2006-04-05 22:26 UTC (permalink / raw)
  To: Linux MIPS; +Cc: ppopov
In-Reply-To: <20060405222332.GO7029@enneenne.com>


[-- Attachment #1.1: Type: text/plain, Size: 751 bytes --]

On Thu, Apr 06, 2006 at 12:23:32AM +0200, Rodolfo Giometti wrote:
> On Wed, Apr 05, 2006 at 05:47:11PM +0200, Rodolfo Giometti wrote:
> > Hello,
> > 
> > I'm trying to add power management support to au1000_eth.c driver.
> 
> Solved! :)
> 
> Here a patch to implement power management functions for au1000_eth.
> 
> Note that this patch needs my previous one who implements new power
> management's sysfs interface.

The forgotten attachment. :)

Ciao,

Rodolfo

-- 

GNU/Linux Solutions                  e-mail:    giometti@enneenne.com
Linux Device Driver                             giometti@gnudd.com
Embedded Systems                     		giometti@linux.it
UNIX programming                     phone:     +39 349 2432127

[-- Attachment #1.2: patch-au1000_eth-pm --]
[-- Type: text/plain, Size: 22531 bytes --]

--- /home/develop/embedded/mipsel/linux/linux-mips.git/arch/mips/au1000/common/au1xxx_irqmap.c	2006-03-31 16:57:26.000000000 +0200
+++ arch/mips/au1000/common/au1xxx_irqmap.c	2006-04-03 17:50:49.000000000 +0200
@@ -118,7 +118,7 @@
 	{ AU1000_USB_DEV_SUS_INT, INTC_INT_RISE_EDGE, 0 },
 	{ AU1000_USB_HOST_INT, INTC_INT_LOW_LEVEL, 0 },
 	{ AU1000_ACSYNC_INT, INTC_INT_RISE_EDGE, 0 },
-	{ AU1500_MAC0_DMA_INT, INTC_INT_HIGH_LEVEL, 0},
+	{ AU1000_MAC0_DMA_INT, INTC_INT_HIGH_LEVEL, 0},
 	{ AU1500_MAC1_DMA_INT, INTC_INT_HIGH_LEVEL, 0},
 	{ AU1000_AC97C_INT, INTC_INT_RISE_EDGE, 0 },
 
@@ -152,7 +152,7 @@
 	{ AU1000_USB_DEV_SUS_INT, INTC_INT_RISE_EDGE, 0 },
 	{ AU1000_USB_HOST_INT, INTC_INT_LOW_LEVEL, 0 },
 	{ AU1000_ACSYNC_INT, INTC_INT_RISE_EDGE, 0 },
-	{ AU1100_MAC0_DMA_INT, INTC_INT_HIGH_LEVEL, 0},
+	{ AU1000_MAC0_DMA_INT, INTC_INT_HIGH_LEVEL, 0},
 	/*{ AU1000_GPIO215_208_INT, INTC_INT_HIGH_LEVEL, 0},*/
 	{ AU1100_LCD_INT, INTC_INT_HIGH_LEVEL, 0},
 	{ AU1000_AC97C_INT, INTC_INT_RISE_EDGE, 0 },
--- /home/develop/embedded/mipsel/linux/linux-mips.git/arch/mips/au1000/common/platform.c	2006-04-03 18:22:05.000000000 +0200
+++ arch/mips/au1000/common/platform.c	2006-04-05 23:08:55.000000000 +0200
@@ -16,6 +16,78 @@
 
 #include <asm/mach-au1x00/au1xxx.h>
 
+#if defined(CONFIG_MIPS_AU1X00_ENET) || defined(CONFIG_MIPS_AU1X00_ENET_MODULE)
+/* Ethernet controllers */
+static struct resource au1xxx_eth0_resources[] = {
+	[0] = {
+		.name	= "eth-base",
+		.start	= ETH0_BASE,
+		.end	= ETH0_BASE + 0x0ffff,
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+		.name	= "eth-mac",
+		.start	= MAC0_ENABLE,
+		.end	= MAC0_ENABLE + 0x0ffff,
+		.flags	= IORESOURCE_MEM,
+	},
+	[2] = {
+		.name	= "eth-irq",
+#if defined(CONFIG_SOC_AU1550)
+		.start	= AU1550_MAC0_DMA_INT,
+		.end	= AU1550_MAC0_DMA_INT,
+#else
+		.start	= AU1000_MAC0_DMA_INT,
+		.end	= AU1000_MAC0_DMA_INT,
+#endif
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+static struct platform_device au1xxx_eth0_device = {
+	.name		= "au1xxx-eth",
+ 	.id		= 0,
+	.num_resources	= ARRAY_SIZE(au1xxx_eth0_resources),
+	.resource	= au1xxx_eth0_resources,
+};
+
+#if defined(CONFIG_SOC_AU1000) || \
+    defined(CONFIG_SOC_AU1500) || defined(CONFIG_SOC_AU1550)
+static struct resource au1xxx_eth1_resources[] = {
+	[0] = {
+		.name	= "eth-base",
+		.start	= ETH1_BASE,
+		.end	= ETH1_BASE + 0x0ffff,
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+		.name	= "eth-mac",
+		.start	= MAC1_ENABLE,
+		.end	= MAC1_ENABLE + 0x0ffff,
+		.flags	= IORESOURCE_MEM,
+	},
+	[2] = {
+		.name	= "eth-irq",
+#if defined(CONFIG_SOC_AU1550)
+		.start	= AU1550_MAC1_DMA_INT,
+		.end	= AU1550_MAC1_DMA_INT,
+#else
+		.start	= AU1000_MAC1_DMA_INT,
+		.end	= AU1000_MAC1_DMA_INT,
+#endif
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+static struct platform_device au1xxx_eth1_device = {
+	.name		= "au1xxx-eth",
+ 	.id		= 1,
+	.num_resources	= ARRAY_SIZE(au1xxx_eth1_resources),
+	.resource	= au1xxx_eth1_resources,
+};
+#endif
+#endif
+
 /* OHCI (USB full speed host controller) */
 static struct resource au1xxx_usb_ohci_resources[] = {
 	[0] = {
@@ -272,6 +344,13 @@
 #endif
 
 static struct platform_device *au1xxx_platform_devices[] __initdata = {
+#if defined(CONFIG_MIPS_AU1X00_ENET) || defined(CONFIG_MIPS_AU1X00_ENET_MODULE)
+	&au1xxx_eth0_device,
+#if defined(CONFIG_SOC_AU1000) || \
+	    defined(CONFIG_SOC_AU1500) || defined(CONFIG_SOC_AU1550)
+	&au1xxx_eth1_device,
+#endif
+#endif
 	&au1xxx_usb_ohci_device,
 	&au1x00_pcmcia_device,
 #ifdef CONFIG_FB_AU1100
--- a/drivers/net/Kconfig	2 Jul 2005 06:46:30 -0000	1.1.1.1
+++ b/drivers/net/Kconfig	5 Apr 2006 21:20:30 -0000
@@ -440,12 +440,12 @@
 	  Say Y here to support the Ethernet subsystem on your GT96100 card.
 
 config MIPS_AU1X00_ENET
-	bool "MIPS AU1000 Ethernet support"
+	tristate "MIPS AU1000 Ethernet support"
 	depends on NET_ETHERNET && SOC_AU1X00
 	select CRC32
 	help
 	  If you have an Alchemy Semi AU1X00 based system
-	  say Y.  Otherwise, say N.
+	  say Y or M.  Otherwise, say N.
 
 config SGI_IOC3_ETH
 	bool "SGI IOC3 Ethernet"
--- /home/develop/embedded/mipsel/linux/linux-mips.git/drivers/net/au1000_eth.c	2006-04-03 18:23:17.000000000 +0200
+++ drivers/net/au1000_eth.c	2006-04-05 23:43:18.000000000 +0200
@@ -9,6 +9,9 @@
  * Update: 2004 Bjoern Riemer, riemer@fokus.fraunhofer.de 
  * or riemer@riemer-nt.de: fixed the link beat detection with 
  * ioctls (SIOCGMIIPHY)
+ * Update: 2006 Rodolfo Giometti: PM support, module support.
+ * Copyright 2006 Rodolfo Giometti <giometti@linux.it>
+ *
  * Author: MontaVista Software, Inc.
  *         	ppopov@mvista.com or source@mvista.com
  *
@@ -57,6 +60,7 @@
 #include <asm/io.h>
 #include <asm/processor.h>
 
+#include <linux/platform_device.h>
 #include <asm/mach-au1x00/au1000.h>
 #include <asm/cpu.h>
 #include "au1000_eth.h"
@@ -67,8 +71,8 @@
 static int au1000_debug = 3;
 #endif
 
-#define DRV_NAME	"au1000eth"
-#define DRV_VERSION	"1.5"
+#define DRV_NAME	"au1xxx-eth"
+#define DRV_VERSION	"1.6"
 #define DRV_AUTHOR	"Pete Popov <ppopov@embeddedalley.com>"
 #define DRV_DESC	"Au1xxx on-chip Ethernet driver"
 
@@ -79,7 +83,8 @@
 // prototypes
 static void hard_stop(struct net_device *);
 static void enable_rx_tx(struct net_device *dev);
-static struct net_device * au1000_probe(u32 ioaddr, int irq, int port_num);
+static int au1000_lowlevel_probe(struct net_device *ndev, u32 ioaddr, u32 macen_addr, int port_num);
+static void au1000_lowlevel_remove(struct net_device *ndev);
 static int au1000_init(struct net_device *);
 static int au1000_open(struct net_device *);
 static int au1000_close(struct net_device *);
@@ -432,6 +437,34 @@
 	return 0;
 }
 
+#ifdef CONFIG_PM
+int am79c874_suspend(struct net_device *dev, int phy_addr, int level)
+{
+	s16 mii_control;
+	
+	if (au1000_debug > 4)
+		printk("am79c874_suspend\n");
+
+	mii_control = mdio_read(dev, phy_addr, MII_CONTROL);
+	mdio_write(dev, phy_addr, MII_CONTROL, mii_control | MII_CNTL_PWRDWN);
+	mdelay(1);
+	return 0;
+}
+
+int am79c874_resume(struct net_device *dev, int phy_addr, int level)
+{
+	s16 mii_control;
+	
+	if (au1000_debug > 4)
+		printk("am79c874_resume\n");
+
+	mii_control = mdio_read(dev, phy_addr, MII_CONTROL);
+	mdio_write(dev, phy_addr, MII_CONTROL, mii_control & ~MII_CNTL_PWRDWN);
+	mdelay(1);
+	return 0;
+}
+#endif
+
 int lxt971a_init(struct net_device *dev, int phy_addr)
 {
 	if (au1000_debug > 4)
@@ -727,6 +760,10 @@
 	am79c874_init,
 	am79c874_reset,
 	am79c874_status,
+#ifdef CONFIG_PM
+	am79c874_suspend,
+	am79c874_resume,
+#endif
 };
 
 struct phy_ops am79c901_ops = {
@@ -1108,9 +1145,6 @@
 				dev->name, (unsigned)aup);
 
 	spin_lock_irqsave(&aup->lock, flags);
-	if (aup->timer.function == &au1000_timer) {/* check if timer initted */
-		del_timer(&aup->timer);
-	}
 
 	hard_stop(dev);
 	#ifdef CONFIG_BCM5222_DUAL_PHY
@@ -1158,84 +1192,6 @@
 	}
 }
 
-static struct {
-	int port;
-	u32 base_addr;
-	u32 macen_addr;
-	int irq;
-	struct net_device *dev;
-} iflist[2];
-
-static int num_ifs;
-
-/*
- * Setup the base address and interupt of the Au1xxx ethernet macs
- * based on cpu type and whether the interface is enabled in sys_pinfunc
- * register. The last interface is enabled if SYS_PF_NI2 (bit 4) is 0.
- */
-static int __init au1000_init_module(void)
-{
-	struct cpuinfo_mips *c = &current_cpu_data;
-	int ni = (int)((au_readl(SYS_PINFUNC) & (u32)(SYS_PF_NI2)) >> 4);
-	struct net_device *dev;
-	int i, found_one = 0;
-
-	switch (c->cputype) {
-#ifdef CONFIG_SOC_AU1000
-	case CPU_AU1000:
-		num_ifs = 2 - ni;
-		iflist[0].base_addr = AU1000_ETH0_BASE;
-		iflist[1].base_addr = AU1000_ETH1_BASE;
-		iflist[0].macen_addr = AU1000_MAC0_ENABLE;
-		iflist[1].macen_addr = AU1000_MAC1_ENABLE;
-		iflist[0].irq = AU1000_MAC0_DMA_INT;
-		iflist[1].irq = AU1000_MAC1_DMA_INT;
-		break;
-#endif
-#ifdef CONFIG_SOC_AU1100
-	case CPU_AU1100:
-		num_ifs = 1 - ni;
-		iflist[0].base_addr = AU1100_ETH0_BASE;
-		iflist[0].macen_addr = AU1100_MAC0_ENABLE;
-		iflist[0].irq = AU1100_MAC0_DMA_INT;
-		break;
-#endif
-#ifdef CONFIG_SOC_AU1500
-	case CPU_AU1500:
-		num_ifs = 2 - ni;
-		iflist[0].base_addr = AU1500_ETH0_BASE;
-		iflist[1].base_addr = AU1500_ETH1_BASE;
-		iflist[0].macen_addr = AU1500_MAC0_ENABLE;
-		iflist[1].macen_addr = AU1500_MAC1_ENABLE;
-		iflist[0].irq = AU1500_MAC0_DMA_INT;
-		iflist[1].irq = AU1500_MAC1_DMA_INT;
-		break;
-#endif
-#ifdef CONFIG_SOC_AU1550
-	case CPU_AU1550:
-		num_ifs = 2 - ni;
-		iflist[0].base_addr = AU1550_ETH0_BASE;
-		iflist[1].base_addr = AU1550_ETH1_BASE;
-		iflist[0].macen_addr = AU1550_MAC0_ENABLE;
-		iflist[1].macen_addr = AU1550_MAC1_ENABLE;
-		iflist[0].irq = AU1550_MAC0_DMA_INT;
-		iflist[1].irq = AU1550_MAC1_DMA_INT;
-		break;
-#endif
-	default:
-		num_ifs = 0;
-	}
-	for(i = 0; i < num_ifs; i++) {
-		dev = au1000_probe(iflist[i].base_addr, iflist[i].irq, i);
-		iflist[i].dev = dev;
-		if (dev)
-			found_one++;
-	}
-	if (!found_one)
-		return -ENODEV;
-	return 0;
-}
-
 static int au1000_setup_aneg(struct net_device *dev, u32 advertise)
 {
 	struct au1000_private *aup = (struct au1000_private *)dev->priv;
@@ -1435,40 +1391,14 @@
 	.get_link = au1000_get_link
 };
 
-static struct net_device *
-au1000_probe(u32 ioaddr, int irq, int port_num)
+static int 
+au1000_lowlevel_probe(struct net_device *ndev, u32 ioaddr, u32 macen_addr, int port_num)
 {
-	static unsigned version_printed = 0;
-	struct au1000_private *aup = NULL;
-	struct net_device *dev = NULL;
+	struct au1000_private *aup = ndev->priv;
 	db_dest_t *pDB, *pDBfree;
 	char *pmac, *argptr;
 	char ethaddr[6];
-	int i, err;
-
-	if (!request_mem_region(CPHYSADDR(ioaddr), MAC_IOSIZE, "Au1x00 ENET"))
-		return NULL;
-
-	if (version_printed++ == 0) 
-		printk("%s version %s %s\n", DRV_NAME, DRV_VERSION, DRV_AUTHOR);
-
-	dev = alloc_etherdev(sizeof(struct au1000_private));
-	if (!dev) {
-		printk (KERN_ERR "au1000 eth: alloc_etherdev failed\n");  
-		return NULL;
-	}
-
-	if ((err = register_netdev(dev))) {
-		printk(KERN_ERR "Au1x_eth Cannot register net device err %d\n",
-				err);
-		free_netdev(dev);
-		return NULL;
-	}
-
-	printk("%s: Au1x Ethernet found at 0x%x, irq %d\n", 
-			dev->name, ioaddr, irq);
-
-	aup = dev->priv;
+	int i, ret;
 
 	/* Allocate the data buffers */
 	/* Snooping works fine with eth on all au1xxx */
@@ -1477,15 +1407,16 @@
 			&aup->dma_addr,
 			0);
 	if (!aup->vaddr) {
-		free_netdev(dev);
-		release_mem_region(CPHYSADDR(ioaddr), MAC_IOSIZE);
-		return NULL;
+		printk(KERN_ERR "%s: cannot dma_alloc_noncoherent\n",
+		       ndev->name);
+		ret = -ENOMEM;
+		goto out;
 	}
 
 	/* aup->mac is the base address of the MAC's registers */
 	aup->mac = (volatile mac_reg_t *)((unsigned long)ioaddr);
 	/* Setup some variables for quick register address access */
-	if (ioaddr == iflist[0].base_addr)
+	if (port_num == 0)
 	{
 		/* check env variables first */
 		if (!get_ethernet_addr(ethaddr)) { 
@@ -1495,7 +1426,7 @@
 			argptr = prom_getcmdline();
 			if ((pmac = strstr(argptr, "ethaddr=")) == NULL) {
 				printk(KERN_INFO "%s: No mac address found\n", 
-						dev->name);
+						ndev->name);
 				/* use the hard coded mac addresses */
 			} else {
 				str2eaddr(ethaddr, pmac + strlen("ethaddr="));
@@ -1504,26 +1435,26 @@
 			}
 		}
 			aup->enable = (volatile u32 *) 
-				((unsigned long)iflist[0].macen_addr);
-		memcpy(dev->dev_addr, au1000_mac_addr, sizeof(au1000_mac_addr));
+				((unsigned long) macen_addr);
+		memcpy(ndev->dev_addr, au1000_mac_addr, sizeof(au1000_mac_addr));
 		setup_hw_rings(aup, MAC0_RX_DMA_ADDR, MAC0_TX_DMA_ADDR);
 		aup->mac_id = 0;
 		au_macs[0] = aup;
 	}
 		else
-	if (ioaddr == iflist[1].base_addr)
+	if (port_num == 1)
 	{
 			aup->enable = (volatile u32 *) 
-				((unsigned long)iflist[1].macen_addr);
-		memcpy(dev->dev_addr, au1000_mac_addr, sizeof(au1000_mac_addr));
-		dev->dev_addr[4] += 0x10;
+				((unsigned long) macen_addr);
+		memcpy(ndev->dev_addr, au1000_mac_addr, sizeof(au1000_mac_addr));
+		ndev->dev_addr[4] += 0x10;
 		setup_hw_rings(aup, MAC1_RX_DMA_ADDR, MAC1_TX_DMA_ADDR);
 		aup->mac_id = 1;
 		au_macs[1] = aup;
 	}
 	else
 	{
-		printk(KERN_ERR "%s: bad ioaddr\n", dev->name);
+		printk(KERN_ERR "%s: bad ioaddr\n", ndev->name);
 	}
 
 	/* bring the device out of reset, otherwise probing the mii
@@ -1536,7 +1467,8 @@
 
 	aup->mii = kmalloc(sizeof(struct mii_phy), GFP_KERNEL);
 	if (!aup->mii) {
-		printk(KERN_ERR "%s: out of memory\n", dev->name);
+		printk(KERN_ERR "%s: out of memory\n", ndev->name);
+		ret = -ENOMEM;
 		goto err_out;
 	}
 	aup->mii->next = NULL;
@@ -1545,7 +1477,8 @@
 	aup->mii->mii_control_reg = 0;
 	aup->mii->mii_data_reg = 0;
 
-	if (mii_probe(dev) != 0) {
+	if (mii_probe(ndev) != 0) {
+		ret = -EBUSY;
 		goto err_out;
 	}
 
@@ -1564,6 +1497,7 @@
 	for (i = 0; i < NUM_RX_DMA; i++) {
 		pDB = GetFreeDB(aup);
 		if (!pDB) {
+			ret = -ENOMEM;
 			goto err_out;
 		}
 		aup->rx_dma_ring[i]->buff_stat = (unsigned)pDB->dma_addr;
@@ -1572,6 +1506,7 @@
 	for (i = 0; i < NUM_TX_DMA; i++) {
 		pDB = GetFreeDB(aup);
 		if (!pDB) {
+			ret = -ENOMEM;
 			goto err_out;
 		}
 		aup->tx_dma_ring[i]->buff_stat = (unsigned)pDB->dma_addr;
@@ -1579,32 +1514,24 @@
 		aup->tx_db_inuse[i] = pDB;
 	}
 
-	spin_lock_init(&aup->lock);
-	dev->base_addr = ioaddr;
-	dev->irq = irq;
-	dev->open = au1000_open;
-	dev->hard_start_xmit = au1000_tx;
-	dev->stop = au1000_close;
-	dev->get_stats = au1000_get_stats;
-	dev->set_multicast_list = &set_rx_mode;
-	dev->do_ioctl = &au1000_ioctl;
-	SET_ETHTOOL_OPS(dev, &au1000_ethtool_ops);
-	dev->set_config = &au1000_set_config;
-	dev->tx_timeout = au1000_tx_timeout;
-	dev->watchdog_timeo = ETH_TX_TIMEOUT;
 
-	/* 
-	 * The boot code uses the ethernet controller, so reset it to start 
-	 * fresh.  au1000_init() expects that the device is in reset state.
-	 */
-	reset_mac(dev);
+	return 0;
 
-	return dev;
+err_out :
+	au1000_lowlevel_remove(ndev);
+out :
+	return ret;
+}
+
+static void
+au1000_lowlevel_remove(struct net_device *ndev)
+{
+	struct au1000_private *aup = ndev->priv;
+	int i;
 
-err_out:
 	/* here we should have a valid dev plus aup-> register addresses
 	 * so we can reset the mac properly.*/
-	reset_mac(dev);
+	reset_mac(ndev);
 	kfree(aup->mii);
 	for (i = 0; i < NUM_RX_DMA; i++) {
 		if (aup->rx_db_inuse[i])
@@ -1618,10 +1545,6 @@
 			MAX_BUF_SIZE * (NUM_TX_BUFFS+NUM_RX_BUFFS),
 			(void *)aup->vaddr,
 			aup->dma_addr);
-	unregister_netdev(dev);
-	free_netdev(dev);
-	release_mem_region(CPHYSADDR(ioaddr), MAC_IOSIZE);
-	return NULL;
 }
 
 /* 
@@ -1779,6 +1712,7 @@
 	if (au1000_debug > 4)
 		printk("%s: close: dev=%p\n", dev->name, dev);
 
+	del_timer_sync(&aup->timer);
 	reset_mac(dev);
 
 	spin_lock_irqsave(&aup->lock, flags);
@@ -1793,36 +1727,6 @@
 	return 0;
 }
 
-static void __exit au1000_cleanup_module(void)
-{
-	int i, j;
-	struct net_device *dev;
-	struct au1000_private *aup;
-
-	for (i = 0; i < num_ifs; i++) {
-		dev = iflist[i].dev;
-		if (dev) {
-			aup = (struct au1000_private *) dev->priv;
-			unregister_netdev(dev);
-			kfree(aup->mii);
-			for (j = 0; j < NUM_RX_DMA; j++) {
-				if (aup->rx_db_inuse[j])
-					ReleaseDB(aup, aup->rx_db_inuse[j]);
-			}
-			for (j = 0; j < NUM_TX_DMA; j++) {
-				if (aup->tx_db_inuse[j])
-					ReleaseDB(aup, aup->tx_db_inuse[j]);
-			}
-			dma_free_noncoherent(NULL,
-					MAX_BUF_SIZE * (NUM_TX_BUFFS+NUM_RX_BUFFS),
-					(void *)aup->vaddr,
-					aup->dma_addr);
-			free_netdev(dev);
-			release_mem_region(CPHYSADDR(iflist[i].base_addr), MAC_IOSIZE);
-		}
-	}
-}
-
 static void update_tx_stats(struct net_device *dev, u32 status)
 {
 	struct au1000_private *aup = (struct au1000_private *) dev->priv;
@@ -2255,5 +2162,232 @@
 	return 0;
 }
 
-module_init(au1000_init_module);
-module_exit(au1000_cleanup_module);
+/*
+ * Setup the base address and interupt of the Au1xxx ethernet macs
+ * based on cpu type and whether the interface is enabled in sys_pinfunc
+ * register. The last interface is enabled if SYS_PF_NI2 (bit 4) is 0.
+ */
+static int au1000_drv_probe(struct device *dev)
+{
+	struct platform_device *pdev = to_platform_device(dev);
+	struct net_device *ndev;
+	struct au1000_private *aup;
+	struct resource *res;
+	static unsigned version_printed = 0;
+	u32 base_addr, macen_addr;
+	int irq, ret;
+
+	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "eth-base");
+	if (!res) {
+		ret = -ENODEV;
+		goto out;
+	}
+	base_addr = res->start;
+	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "eth-mac");
+	if (!res) {
+		ret = -ENODEV;
+		goto out;
+	}
+	macen_addr = res->start;
+	res = platform_get_resource_byname(pdev, IORESOURCE_IRQ, "eth-irq");
+	if (!res) {
+		ret = -ENODEV;
+		goto out;
+	}
+	irq = res->start;
+
+	if (!request_mem_region(CPHYSADDR(base_addr), MAC_IOSIZE, "Au1x00 ENET")) {
+		ret = -EBUSY;
+		goto out;
+	}
+
+	if (version_printed++ == 0) 
+		printk("%s version %s %s\n", DRV_NAME, DRV_VERSION, DRV_AUTHOR);
+
+	ndev = alloc_etherdev(sizeof(struct au1000_private));
+	if (!ndev) {
+		printk (KERN_ERR "%s: alloc etherdev failed\n", DRV_NAME);  
+		ret = -ENOMEM;
+		goto out_release_io;
+	}
+	SET_MODULE_OWNER(ndev);
+	SET_NETDEV_DEV(ndev, dev);
+
+	ret = au1000_lowlevel_probe(ndev, base_addr, macen_addr, pdev->id);
+	if (ret < 0) {
+		printk (KERN_ERR "%s: low level probe failed\n", DRV_NAME);  
+		goto out_free_netdev;
+	}
+
+	aup = ndev->priv;
+
+	spin_lock_init(&aup->lock);
+	ndev->base_addr = base_addr;
+	ndev->irq = irq;
+	ndev->open = au1000_open;
+	ndev->hard_start_xmit = au1000_tx;
+	ndev->stop = au1000_close;
+	ndev->get_stats = au1000_get_stats;
+	ndev->set_multicast_list = &set_rx_mode;
+	ndev->do_ioctl = &au1000_ioctl;
+	SET_ETHTOOL_OPS(ndev, &au1000_ethtool_ops);
+	ndev->set_config = &au1000_set_config;
+	ndev->tx_timeout = au1000_tx_timeout;
+	ndev->watchdog_timeo = ETH_TX_TIMEOUT;
+
+	/* 
+	 * The boot code uses the ethernet controller, so reset it to start 
+	 * fresh.  au1000_init() expects that the device is in reset state.
+	 */
+	reset_mac(ndev);
+
+	ret = register_netdev(ndev);
+	if (ret) {
+		printk(KERN_ERR "%s: cannot register net device err %d\n",
+		       DRV_NAME, ret);
+		goto out_lowlevel_remove;
+	}
+
+	printk("%s: Au1x Ethernet found at 0x%x, irq %d\n", 
+			ndev->name, base_addr, irq);
+
+	dev_set_drvdata(dev, ndev);
+
+	return 0;
+
+out_lowlevel_remove :
+	au1000_lowlevel_remove(ndev);
+out_free_netdev :
+	free_netdev(ndev);
+out_release_io :
+	release_mem_region(CPHYSADDR(base_addr), MAC_IOSIZE);
+out :
+	printk("%s: not found (%d).\n", DRV_NAME, ret);
+
+	return ret;
+}
+
+static int au1000_drv_remove(struct device *dev)
+{
+	struct platform_device *pdev = to_platform_device(dev);
+	struct net_device *ndev = dev_get_drvdata(dev);
+	struct resource *res;
+
+	dev_set_drvdata(dev, NULL);
+
+	unregister_netdev(ndev);
+	au1000_lowlevel_remove(ndev);
+	free_netdev(ndev);
+
+	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "eth-base");
+	if (!res) {
+		printk(DRV_NAME ": warning! Invalid data!");
+		return -EINVAL;
+	}
+	release_mem_region(CPHYSADDR(res->start), MAC_IOSIZE);
+
+	return 0;
+}
+
+#ifdef CONFIG_PM
+static int au1000_drv_suspend(struct device *dev, pm_message_t state, u32 level)
+{
+	struct net_device *ndev = dev_get_drvdata(dev);
+	struct au1000_private *aup = (struct au1000_private *) ndev->priv;
+
+	if (!ndev)
+		return 0;
+
+	switch (level) {
+	case SUSPEND_DISABLE :
+		if (netif_running(ndev))
+			netif_device_detach(ndev);
+
+		break;
+	
+	case SUSPEND_SAVE_STATE :
+		/* bring the device out of reset, otherwise accessing to mii
+	 	 * will hang */
+		*aup->enable = MAC_EN_CLOCK_ENABLE;
+		au_sync_delay(2);
+		*aup->enable = MAC_EN_RESET0 | MAC_EN_RESET1 | 
+				MAC_EN_RESET2 | MAC_EN_CLOCK_ENABLE;
+		au_sync_delay(2);
+
+		if (aup->phy_ops->phy_suspend)
+			aup->phy_ops->phy_suspend(ndev, aup->phy_addr, level);
+
+		au1000_lowlevel_remove(ndev);
+
+		break;
+
+	case SUSPEND_POWER_DOWN :
+
+		break;
+	}
+
+	return 0;
+}
+
+static int au1000_drv_resume(struct device *dev, u32 level)
+{
+	struct net_device *ndev = dev_get_drvdata(dev);
+	struct au1000_private *aup = (struct au1000_private *) ndev->priv;
+	int ret;
+
+	if (!ndev)
+		return 0;
+
+	switch (level) {
+	case RESUME_RESTORE_STATE :
+		ret = au1000_lowlevel_probe(ndev, aup->mac, aup->enable, aup->mac_id);
+		if (ret < 0) {
+			printk (KERN_ERR "%s: low level probe failed\n", DRV_NAME);  
+			return ret;
+		}
+
+		if (aup->phy_ops->phy_resume)
+			aup->phy_ops->phy_resume(ndev, aup->phy_addr, level);
+		aup->phy_ops->phy_init(ndev, aup->phy_addr);
+
+		/* au1000_init() expects that the device is in reset state.
+		 */
+		reset_mac(ndev); /* au1000_init() expects the device in reset */
+		au1000_init(ndev);
+
+		break;
+
+	case RESUME_ENABLE :
+		if (netif_running(ndev))
+			netif_device_attach(ndev);
+
+		break;
+	}
+
+	return 0;
+}
+#endif
+
+static struct device_driver au1000_driver = {
+	.name		= DRV_NAME,
+	.bus		= &platform_bus_type,
+	.probe          = au1000_drv_probe,
+	.remove         = au1000_drv_remove,
+#ifdef CONFIG_PM
+	.suspend        = au1000_drv_suspend,
+	.resume         = au1000_drv_resume,
+#endif
+};
+
+static int __init au1000_eth_init(void)
+{
+	return driver_register(&au1000_driver);
+}
+
+static void __exit au1000_eth_cleanup(void)
+{
+	driver_unregister(&au1000_driver);
+}
+
+module_init(au1000_eth_init);
+module_exit(au1000_eth_cleanup);
--- /home/develop/embedded/mipsel/linux/linux-mips.git/drivers/net/au1000_eth.h	2006-03-31 16:58:55.000000000 +0200
+++ drivers/net/au1000_eth.h	2006-04-05 12:55:56.000000000 +0200
@@ -152,6 +152,8 @@
 	int (*phy_init) (struct net_device *, int);
 	int (*phy_reset) (struct net_device *, int);
 	int (*phy_status) (struct net_device *, int, u16 *, u16 *);
+	int (*phy_suspend) (struct net_device *, int, int);
+	int (*phy_resume) (struct net_device *, int, int);
 };
 
 /* 

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply

* Re: [PATCH 0/5] clocksource patches
From: Thomas Gleixner @ 2006-04-05 22:18 UTC (permalink / raw)
  To: Roman Zippel; +Cc: johnstul, linux-kernel, Andrew Morton, Ingo Molnar
In-Reply-To: <Pine.LNX.4.64.0604051723190.32445@scrub.home>

Roman,

On Wed, 2006-04-05 at 22:44 +0200, Roman Zippel wrote:
> What I had in mind is the _current_ setup, that e.g. the scheduler tick 
> can be generated by a clock event is a possibility, but since your 
> clockevent patch is not even in -mm, it wasn't something I had in mind 
> when I wrote this comment. This comment was specifically about the 
> _current_ way time.c sets up the timer interrupt and i8253.c sets up the 
> timer hardware.
> I also specifically said "This is not important right now, but ... 
> something to keep in mind" to indicate this needs further discussion, 
> nowhere did I ever exclude the possibility to do this via clock events, 
> but you just jumped at me with "this is wrong".

Can we stop missquoting on both sides please ? I did not jump in. I
said:

> I don't think so. Coupling the clock sources to clock event sources is
> wrong.

I unfortunately forgot to add an IMHO to every single sentence, but "I
don't think so." should have made it clear, that this is my opinion.
Maybe my knowledge of the English language is worse than I thought.

> > Why are those seperate items ?
> > 
> > Looking at the various hardware implementations there are three types of
> > devices:
> > 
> > 1. Read only devices (e.g. TSC)
> > 2. Next interrupt only devices (e.g. various timer implementations on
> > SoC CPUs)
> > 3. Devices which combine both functions
> > 
> > Building an abstraction layer which handles all device types requires
> > either 
> > 
> > - that e.g. a read only device needs to be combined with a next
> > interrupt device in some way. This introduces artifical combos of
> > functionality which can and should be handled completely seperate.
> > 
> > or 
> > 
> > - to handle all the corner cases where a device has to be handled which
> > only provides one of the functionalies. Also the selection of different
> > combinations of devices will introduce extra handling code.
> 
> Neither excludes a basic clock source abstraction, which can create any 
> kind of clock events. The basic question is should any clock source be 
> able to create every kind of clock events?

At least should the design allow that. Making restrictions in such a
layer upfront due to requirements of some known hardware devices would
be bad.

> The problem here is that we may have to synchronize reading time with the 
> timer interrupt. To make an extreme example let's assume the TSC clock is 
> updated every 1msec and the PIT generates an interrupt every 1.01msec, 
> this means jiffies is updated every 100th interrupt by 2. Also the NTP 
> error adjustment algorithm works better with small offsets, my latest 
> version compensates better for that, but a smaller offset still means a 
> smaller jitter.

Why does this require a hard coupled design ? You want a periodic event
for X with as much precision as available. Let the system choose one
which fits this best.
 
> > This is a clear seperation and there is no combined functionality.
> 
> Unfortunately it's not that simple, e.g. generating gettimeofday() 
> requires a periodic event.

It does not necessarily require a periodic event. It depends on the type
of clock source you are using and the requirements of synchronization.
The DCF-77 card in one of my boxen gives me auto sychronized time with
1nsec resolution without any periodic event. Also embedded systems which
do not use NTP do not need a periodic event for gettimeofday() when
there is a continous clock source available.

If the NTP mechanisms needs a precise periodic event, then it can
request it from the layer which manages those events.

>  At some point you have to combine 
> functionality, whether it's done inside the clocksource or by something 
> else is a different discussion. My proposal to do it inside the clock 
> source was because we don't have that "something else" yet (which may be 
> your clock events, I don't know).

So we move it into clock source because there is nothing else right
now ? That sounds like moving the mess you identified in x386 from there
to a another place.

IMO this is well worth a discussion how we want to solve this in a solid
and generic way.

> I have to skip the rest of your mail, as it's so generic and so out of 
> context that I don't really disagree with it, if there was something 
> important, please put back it into some context.

Sorry Roman, your way of discussion is not understandable to me. On one
hand you ask for explanations. When you get them, you just brush them
aside. Thanks for reminding me that my efforts to communicate with you
just produce unimportant blurb.

	tglx



^ permalink raw reply

* USB 2.0 CF card reader gets reset+offlined immediately with 2.6.16
From: Bernhard Rosenkraenzer @ 2006-04-05 22:12 UTC (permalink / raw)
  To: linux-kernel

Attempting to use a USB 2.0 CF card reader in 2.6.16 and 2.6.16-mm2 (known to 
work back in 2.4 days, unused since) results in this:

usb 1-6: new high speed USB device using ehci_hcd and address 2
usb 1-6: new device found, idVendor=0dda, idProduct=2005
usb 1-6: new device strings: Mfr=3, Product=4, SerialNumber=5
usb 1-6: Product: Card Reader
usb 1-6: Manufacturer: Hama
usb 1-6: SerialNumber: 000000000013
usb 1-6: configuration #1 chosen from 1 choice
usbcore: registered new driver libusual
Initializing USB Mass Storage driver...
scsi0 : SCSI emulation for USB Mass Storage devices
usbcore: registered new driver usb-storage
USB Mass Storage support registered.
usb-storage: device found at 2
usb-storage: waiting for device to settle before scanning
  Vendor: Hama      Model: CF  Card Reader   Rev: 9317
  Type:   Direct-Access                      ANSI SCSI revision: 00
usb 1-6: reset high speed USB device using ehci_hcd and address 2
usb 1-6: reset high speed USB device using ehci_hcd and address 2
usb 1-6: reset high speed USB device using ehci_hcd and address 2
usb 1-6: reset high speed USB device using ehci_hcd and address 2
usb 1-6: reset high speed USB device using ehci_hcd and address 2
sd 0:0:0:0: scsi: Device offlined - not ready after error recovery
sd 0:0:0:0: rejecting I/O to offline device
sd 0:0:0:0: rejecting I/O to offline device
sd 0:0:0:0: rejecting I/O to offline device
sda : READ CAPACITY failed.
sda : status=0, message=00, host=1, driver=00
sda : sense not available.
sd 0:0:0:0: rejecting I/O to offline device
sda: Write Protect is off
sda: Mode Sense: 00 00 00 00
sda: assuming drive cache: write through
sd 0:0:0:0: Attached scsi removable disk sda
  Vendor: Hama      Model: SM  Card Reader   Rev: 9317
  Type:   Direct-Access                      ANSI SCSI revision: 00
usb 1-6: reset high speed USB device using ehci_hcd and address 2
usb 1-6: reset high speed USB device using ehci_hcd and address 2
usb 1-6: reset high speed USB device using ehci_hcd and address 2
usb 1-6: reset high speed USB device using ehci_hcd and address 2
usb 1-6: reset high speed USB device using ehci_hcd and address 2
sd 0:0:0:1: scsi: Device offlined - not ready after error recovery
sd 0:0:0:1: rejecting I/O to offline device
sd 0:0:0:1: rejecting I/O to offline device
sd 0:0:0:1: rejecting I/O to offline device
sdb : READ CAPACITY failed.
sdb : status=0, message=00, host=1, driver=00
sdb : sense not available.
sd 0:0:0:1: rejecting I/O to offline device
sdb: Write Protect is off
sdb: Mode Sense: 00 00 00 00
sdb: assuming drive cache: write through
sd 0:0:0:1: Attached scsi removable disk sdb
usb 1-6: reset high speed USB device using ehci_hcd and address 2
  Vendor: Hama      Model: SD  Card Reader   Rev: 9317
  Type:   Direct-Access                      ANSI SCSI revision: 00
usb 1-6: reset high speed USB device using ehci_hcd and address 2
usb 1-6: reset high speed USB device using ehci_hcd and address 2
usb 1-6: reset high speed USB device using ehci_hcd and address 2
usb 1-6: reset high speed USB device using ehci_hcd and address 2
usb 1-6: reset high speed USB device using ehci_hcd and address 2
sd 0:0:0:2: scsi: Device offlined - not ready after error recovery
sd 0:0:0:2: rejecting I/O to offline device
sd 0:0:0:2: rejecting I/O to offline device
sd 0:0:0:2: rejecting I/O to offline device
sdc : READ CAPACITY failed.
sdc : status=0, message=00, host=1, driver=00
sdc : sense not available.
sd 0:0:0:2: rejecting I/O to offline device
sdc: Write Protect is off
sdc: Mode Sense: 00 00 00 00
sdc: assuming drive cache: write through
sd 0:0:0:2: Attached scsi removable disk sdc
usb 1-6: reset high speed USB device using ehci_hcd and address 2
  Vendor: Hama      Model: MS  Card Reader   Rev: 9317
  Type:   Direct-Access                      ANSI SCSI revision: 00
usb 1-6: reset high speed USB device using ehci_hcd and address 2
usb 1-6: reset high speed USB device using ehci_hcd and address 2
usb 1-6: reset high speed USB device using ehci_hcd and address 2
usb 1-6: reset high speed USB device using ehci_hcd and address 2
usb 1-6: reset high speed USB device using ehci_hcd and address 2
sd 0:0:0:3: scsi: Device offlined - not ready after error recovery
sd 0:0:0:3: rejecting I/O to offline device
sd 0:0:0:3: rejecting I/O to offline device
sd 0:0:0:3: rejecting I/O to offline device
sdd : READ CAPACITY failed.
sdd : status=0, message=00, host=1, driver=00
sdd : sense not available.
sd 0:0:0:3: rejecting I/O to offline device
sdd: Write Protect is off
sdd: Mode Sense: 00 00 00 00
sdd: assuming drive cache: write through
sd 0:0:0:3: Attached scsi removable disk sdd
usb-storage: device scan complete


Any attempt to access the devices afterwards results in ENXIO (but 
the /sys/block entries for sda to sdd remain there).

^ permalink raw reply

* readers-writers mutex
From: Joshua Hudson @ 2006-04-05 22:21 UTC (permalink / raw)
  To: linux-kernel

Since we are moving from semaphores to mutex, there should be a
mutex_rw. I had a try
at creating one (might as well convert from sem_rw). I'll bet somebody
here can do a
lot better, but this will do if need be.

--- linux-2.6.16.1-stock/include/linux/mutex_rw.h       1969-12-31
16:00:00.000000000 -0800
+++ linux-2.6.16.1-nvl/include/linux/mutex_rw.h 2006-04-04
18:11:56.000000000 -0700
@@ -0,0 +1,60 @@
+/* Linux RW mutex
+ * This file: GNU GPL v2 or later, Joshua Hudson <joshudson@gmail.com>
+ *
+ * Somebody else can make this fast. I just made this work.
+ *
+ * DANGER! Change of this file will break module binaries if any
+ *  rw mutex is shared between main kernel and modules or between
+ *  modules with a different version.
+ */
+
+#ifndef __KERNEL_MUTEX_RW
+#define __KERNEL_MUTEX_RW
+#ifdef __KERNEL__
+
+#include <linux/mutex.h>
+
+struct rw_mutex {
+       struct mutex r_mutex;
+       struct mutex w_mutex;
+       unsigned n_readers;
+};
+
+static inline void rw_mutex_init(struct rw_mutex *rw)
+{
+       mutex_init(&rw->r_mutex);
+       mutex_init(&rw->w_mutex);
+       rw->n_readers = 0;
+}
+
+static inline void rw_mutex_destroy(struct rw_mutex *rw)
+{
+       mutex_destroy(&rw->r_mutex);
+       mutex_destroy(&rw->w_mutex);
+}
+
+static inline void mutex_lock_w(struct rw_mutex *rw)
+{
+       mutex_lock(&rw->w_mutex);
+}
+
+static inline void mutex_unlock_w(struct rw_mutex *rw)
+{
+       mutex_unlock(&rw->w_mutex);
+}
+
+static inline void mutex_lock_r(struct rw_mutex *rw)
+{
+       mutex_lock(&rw->r_mutex);
+       if (++rw->n_readers == 1)
+               mutex_lock(&rw->w_mutex);
+       mutex_unlock(&rw->r_mutex);
+}
+
+static inline void mutex_unlock_r(struct rw_mutex *rw)
+{
+       mutex_lock(&rw->r_mutex);
+       if (--rw->n_readers == 0)
+               mutex_unlock(&rw->w_mutex);
+       mutex_unlock(&rw->r_mutex);
+}
+
+#endif
+#endif

^ permalink raw reply

* Re: [PATCH] modules_install must not remove existing modules
From: Andreas Gruenbacher @ 2006-04-05 22:21 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: linux-kernel
In-Reply-To: <20060405221229.GA8972@mars.ravnborg.org>

On Thursday 06 April 2006 00:12, Sam Ravnborg wrote:
> The removal was introduced to get rid of old modules from an earlier
> build of the same kernel with potential more modules.
> I was obvious when I played with an allmodconfig kernel IIRC.

The in-tree modules all install below kernel/, so I don't see why removing the 
external modules directory (extra or whatever) is necessary for that. It 
might still be that there are other external modules 
below /lib/modules/$KERNELRELEASE, though.

> The usecase you have in mind is with external modules only?

Yes, with more than one set of them, each of which using modules_install.

> We could special case in that suation and avoid the removal.
>
> I see no way to detect when it is OK to remove or not, so in the
> principle of least suprise I prefer having the removal unconditional for
> normal kernel builds, and no removal for external modules.
>
> OK?

That would be okay for me, yes.

Thanks,
Andreas

^ permalink raw reply

* [U-Boot-Users] [PATCH] objcopy for srec and bin files should be done on .o files
From: Wolfgang Denk @ 2006-04-05 22:25 UTC (permalink / raw)
  To: u-boot
In-Reply-To: <20060405220344.GX27792@bork.org>

In message <20060405220344.GX27792@bork.org> you wrote:
> 
> aha.  It's a make 3.80 vs. 3.81 problem...  Debian etch (testing)
> already has 3.81 in it.  More people will start running into this
> problem.

Then either it's a bug in the existing make rules, which I would like
to understand and fix, or it's a bug in make, which needs fixing.

> It still might be easier and less error prone to change the rule to use
> the object files instead of the elf binary, but its up to you.

No, This is the way of least  resistence  which  will  leave  unknown
error  conditions  here and there which will bite again later. Please
don't ignore errors, fix them!

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
As far as the laws of mathematics refer to reality, they are not cer-
tain, and as far as they are certain, they do not refer  to  reality.
                                                   -- Albert Einstein

^ permalink raw reply

* [PATCH] Tweaks to make asciidoc play nice.
From: Francis Daly @ 2006-04-05 22:25 UTC (permalink / raw)
  To: git; +Cc: Marco Roeland

Once the content has been generated, the formatting elves can reorder
it to be pretty...

Signed-off-by: Francis Daly <francis@daoine.org>

---

The manpage formatting needed to stop things being ugly is
nontrivial. In this case, an option has multi-paragraph content,
some of which should be displayed preformatted.

"+" means "this next paragraph is a continuation of the same section"
"--" means "the next paragraphs are all continuations -- don't worry
     about all the other "+"s
"------" means "the next content is preformatted"
"------", the blank line, and the extra indentation within ------ are 
     there because docbook-xsl stylesheets are odd in different ways.
     This combination makes the preformatted text be visually distinct 
     with both versions 1.68 and 1.69. Without that oddness, we could
     use either just ------ or just indentation. Ho hum.

 Documentation/git-commit.txt |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

e46caf57bc2d09c032b992f9024226acd2d68fbc
diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt
index ec8b562..0a7365b 100644
--- a/Documentation/git-commit.txt
+++ b/Documentation/git-commit.txt
@@ -83,15 +83,16 @@ OPTIONS
 	the current tip as parents -- so the current top commit is
 	discarded.
 +
+--
 It is a rough equivalent for:
-+
-$ git reset --soft HEAD^
-+
-$ ... do something else to come up with the right tree ...
-+
-$ git commit -c ORIG_HEAD
-+
+------
+	$ git reset --soft HEAD^
+	$ ... do something else to come up with the right tree ...
+	$ git commit -c ORIG_HEAD
+
+------
 but can be used to amend a merge commit.
+--
 
 -i|--include::
 	Instead of committing only the files specified on the
-- 
1.2.4.g3488

-- 
Francis Daly        francis@daoine.org

^ permalink raw reply related

* Re: [PATCH 00/15] powerpc: move some header files
From: Paul Mackerras @ 2006-04-05 22:28 UTC (permalink / raw)
  To: Kumar Gala; +Cc: Stephen Rothwell, linuxppc-dev
In-Reply-To: <C1CE62AD-7989-4DCA-B7B3-8A107ACBD153@kernel.crashing.org>

Kumar Gala writes:

> > I guess that would work, but Paulus is going to not like me as he  
> > already
> > put all these patches into the powerpc tree.  :-)
> 
> That's Paulus own doing for his premature pull :)

For now I have reverted the powerpc.git tree to remove those commits
of Stephen's, so all it has now (compared to v2.6.17-rc1) are a CHRP
booting fix and the "iSeries has only 256 IRQs" patch.

Everyone, if you have done a pull from powerpc.git in the last 24
hours, please do this on your repository:

git reset b86756ae76dc5e7ecff3ca52a5842155e6d457de

That will get us back into sync.  Sorry about the to-ing and fro-ing
on this.

Paul.

^ permalink raw reply

* Re: Q on audit, audit-syscall
From: Chris Wright @ 2006-04-05 22:30 UTC (permalink / raw)
  To: Herbert Rosmanith
  Cc: Valdis.Kletnieks, Kyle Moffett, Robin Holt, linux-kernel
In-Reply-To: <200604052147.k35LlOpK010229@wildsau.enemy.org>

* Herbert Rosmanith (kernel@wildsau.enemy.org) wrote:
> anyway, the manpage describes how auditd/libaudit works - not how it has been
> implemented/how it communicates with the kernel.
> I want to know how it works "under the hood", not just how to use it.

Then grab the source, and read its READMEs.

> LSM depends
> on CONFIG_AUDIT* (this is correct, isn't it?)

No.

^ permalink raw reply

* Re: [PATCH] modules_install must not remove existing modules
From: Gene Heskett @ 2006-04-05 22:33 UTC (permalink / raw)
  To: linux-kernel
In-Reply-To: <200604052152.k35LqtQ0032100@turing-police.cc.vt.edu>

On Wednesday 05 April 2006 17:52, Valdis.Kletnieks@vt.edu wrote:
>On Wed, 05 Apr 2006 23:33:50 +0200, Andreas Gruenbacher said:
>> When installing external modules with `make modules_install', the
>> first thing that happens is a rm -rf of the target directory. This
>> works only once, and breaks when installing more than one (set of)
>> external module(s).
>
>Can this be re-worked to ensure that it clears the target directory
>the *first* time?  It would suck mightily if a previous build of
> 2.6.17-rc2 left a net_foo.ko lying around to get insmod'ed by
> accident (consider the case of CONFIG_NETFOO=m getting changed to y
> or n, and other possible horkage. Module versioning will catch some,
> but not all, of this crap....)

I avoid this in my own makeit script by mv'ing all that stuff to 
a /lib/modules/version_number.old, ditto for vmlinuz and initrd.  That 
way, if the new one doesn't work, I can choose some other kernel in the 
grub startup, boot it it, then just mv the stuff back, and voila!  
Another reboot and I'm back on the last kernel that worked.

-- 
Cheers, Gene
People having trouble with vz bouncing email to me should add the word
'online' between the 'verizon', and the dot which bypasses vz's
stupid bounce rules.  I do use spamassassin too. :-)
Yahoo.com and AOL/TW attorneys please note, additions to the above
message by Gene Heskett are:
Copyright 2006 by Maurice Eugene Heskett, all rights reserved.

^ permalink raw reply

* Re: Q on audit, audit-syscall
From: Andrew Morton @ 2006-04-05 22:37 UTC (permalink / raw)
  To: linux-audit
In-Reply-To: <200604052004.k35K4u56010157@wildsau.enemy.org>

Herbert Rosmanith <kernel@wildsau.enemy.org> wrote:
>
> (2) in linux/Documentation/devices.txt I've found an "audit device":
> 
>          103 block       Audit device
>                            0 = /dev/audit        Audit device
> 

hm.  I don't think that's true, is it?  If not, can we clean
it up please?

^ permalink raw reply

* [RFC/PATCH] date parsing: be friendlier to our European friends.
From: Junio C Hamano @ 2006-04-05 22:39 UTC (permalink / raw)
  To: git
In-Reply-To: <7virpo4jxf.fsf@assigned-by-dhcp.cox.net>

This does three things, only applies to cases where the user
manually tries to override the author/commit time by environment
variables, with non-ISO, non-2822 format date-string:

 - Refuses to use the interpretation to put the date in the
   future; recent kernel history has a commit made with
   10/03/2006 which is recorded as October 3rd.

 - Adds '.' as the possible year-month-date separator.  We
   learned from our European friends on the #git channel that
   dd.mm.yyyy is the norm there.

 - When the separator is '.', we prefer dd.mm.yyyy over
   mm.dd.yyyy; otherwise mm/dd/yy[yy] takes precedence over
   dd/mm/yy[yy].

Signed-off-by: Junio C Hamano <junkio@cox.net>

---

 * This is more of a RFC than ready-to-be-merged patch.
   Alternative patches and improvements are welcome.

 date.c |   77 +++++++++++++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 56 insertions(+), 21 deletions(-)

b9065540826426ac0e4959e869ba7e08d1ae65d8
diff --git a/date.c b/date.c
index 376d25d..034d722 100644
--- a/date.c
+++ b/date.c
@@ -197,26 +197,43 @@ static int match_alpha(const char *date,
 	return skip_alpha(date);
 }
 
-static int is_date(int year, int month, int day, struct tm *tm)
+static int is_date(int year, int month, int day, struct tm *now_tm, time_t now, struct tm *tm)
 {
 	if (month > 0 && month < 13 && day > 0 && day < 32) {
+		struct tm check = *tm;
+		struct tm *r = (now_tm ? &check : tm);
+		time_t specified;
+
+		r->tm_mon = month - 1;
+		r->tm_mday = day;
 		if (year == -1) {
-			tm->tm_mon = month-1;
-			tm->tm_mday = day;
-			return 1;
+			if (!now_tm)
+				return 1;
+			r->tm_year = now_tm->tm_year;
 		}
-		if (year >= 1970 && year < 2100) {
-			year -= 1900;
-		} else if (year > 70 && year < 100) {
-			/* ok */
-		} else if (year < 38) {
-			year += 100;
-		} else
+		else if (year >= 1970 && year < 2100)
+			r->tm_year = year - 1900;
+		else if (year > 70 && year < 100)
+			r->tm_year = year;
+		else if (year < 38)
+			r->tm_year = year + 100;
+		else
 			return 0;
+		if (!now_tm)
+			return 1;
+
+		specified = my_mktime(r);
 
-		tm->tm_mon = month-1;
-		tm->tm_mday = day;
-		tm->tm_year = year;
+		/* Be it commit time or author time, it does not make
+		 * sense to specify timestamp way into the future.  Make
+		 * sure it is not later than ten days from now...
+		 */
+		if (now + 10*24*3600 < specified)
+			return 0;
+		tm->tm_mon = r->tm_mon;
+		tm->tm_mday = r->tm_mday;
+		if (year != -1)
+			tm->tm_year = r->tm_year;
 		return 1;
 	}
 	return 0;
@@ -224,6 +241,9 @@ static int is_date(int year, int month, 
 
 static int match_multi_number(unsigned long num, char c, const char *date, char *end, struct tm *tm)
 {
+	time_t now;
+	struct tm now_tm;
+	struct tm *refuse_future;
 	long num2, num3;
 
 	num2 = strtol(end+1, &end, 10);
@@ -246,19 +266,33 @@ static int match_multi_number(unsigned l
 
 	case '-':
 	case '/':
+	case '.':
+		now = time(NULL);
+		refuse_future = NULL;
+		if (gmtime_r(&now, &now_tm))
+			refuse_future = &now_tm;
+
 		if (num > 70) {
 			/* yyyy-mm-dd? */
-			if (is_date(num, num2, num3, tm))
+			if (is_date(num, num2, num3, refuse_future, now, tm))
 				break;
 			/* yyyy-dd-mm? */
-			if (is_date(num, num3, num2, tm))
+			if (is_date(num, num3, num2, refuse_future, now, tm))
 				break;
 		}
-		/* mm/dd/yy ? */
-		if (is_date(num3, num, num2, tm))
+		/* Our eastern European friends say dd.mm.yy[yy]
+		 * is the norm there, so giving precedence to
+		 * mm/dd/yy[yy] form only when separator is not '.'
+		 */
+		if (c != '.' &&
+		    is_date(num3, num, num2, refuse_future, now, tm))
+			break;
+		/* European dd.mm.yy[yy] or funny US dd/mm/yy[yy] */
+		if (is_date(num3, num2, num, refuse_future, now, tm))
 			break;
-		/* dd/mm/yy ? */
-		if (is_date(num3, num2, num, tm))
+		/* Funny European mm.dd.yy */
+		if (c == '.' &&
+		    is_date(num3, num, num2, refuse_future, now, tm))
 			break;
 		return 0;
 	}
@@ -288,10 +322,11 @@ static int match_digit(const char *date,
 	}
 
 	/*
-	 * Check for special formats: num[:-/]num[same]num
+	 * Check for special formats: num[-.:/]num[same]num
 	 */
 	switch (*end) {
 	case ':':
+	case '.':
 	case '/':
 	case '-':
 		if (isdigit(end[1])) {
-- 
1.3.0.rc2.g1b83

^ permalink raw reply related

* Re: [PATCH] powerpc: Disable and EOI interrupts in machine_crash_shutdown()
From: Haren Myneni @ 2006-04-05 22:50 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: linuxppc-dev, Paul Mackerras, Milton Miller
In-Reply-To: <20060404114306.8DC0F679EF@ozlabs.org>

[-- Attachment #1: Type: text/plain, Size: 2775 bytes --]

linuxppc-dev-bounces+hbabu=us.ibm.com@ozlabs.org wrote on 04/04/2006 
04:43:01 AM:

> We've seen several bugs caused by interrupt weirdness in the kdump 
kernel.
> Panicking from an interrupt handler means we fail to EOI the interrupt, 
and
> so the second kernel never gets that interrupt ever again. We also see 
hangs
> on JS20 where we take interrupts in the second kernel early during boot.
> 
> This patch fixes both those problems, and although it adds more code to 
the
> crash path I think it is the best solution.
> 

Michael,
        Noticing the following issues when invoked kdump boot using 
soft-reset. But the kdump boot is successful. Not a problem using sysrq-c 
or Oops.

rtas_call retuned these error messages
"xics_disable_irq: irq=655360: ibm_set_xive(0xff) returned -3" for IRQ# 
182

"xics_disable_irq: irq=589825: ibm_set_xive(0xff) returned -3" for IRQ# 
216

cat /proc/interrupts
18:       2997       3401       1317       1442   XICS      Edge      IPI
134:          0          0          0          0   XICS      Edge 
ehci_hcd:usb1, ohci_hcd:usb2, ohci_hcd:usb3
167:       2169          0          0          0   XICS      Edge      ipr
182:         55          0          0          0   XICS      Edge 
hvc_console
216:          0          0          0          0   XICS      Edge RAS_EPOW
BAD:        117

Thanks
Haren
> Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
> ---
> 
>  arch/powerpc/kernel/crash.c |   13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> Index: kdump/arch/powerpc/kernel/crash.c
> ===================================================================
> --- kdump.orig/arch/powerpc/kernel/crash.c
> +++ kdump/arch/powerpc/kernel/crash.c
> @@ -22,6 +22,7 @@
>  #include <linux/elf.h>
>  #include <linux/elfcore.h>
>  #include <linux/init.h>
> +#include <linux/irq.h>
>  #include <linux/types.h>
> 
>  #include <asm/processor.h>
> @@ -174,6 +175,8 @@ static void crash_kexec_prepare_cpus(voi
> 
>  void default_machine_crash_shutdown(struct pt_regs *regs)
>  {
> +   unsigned int irq;
> +
>     /*
>      * This function is only called after the system
>      * has paniced or is otherwise in a critical state.
> @@ -186,6 +189,16 @@ void default_machine_crash_shutdown(stru
>      */
>     local_irq_disable();
> 
> +   for_each_irq(irq) {
> +      struct irq_desc *desc = irq_descp(irq);
> +
> +      if (desc->status & IRQ_INPROGRESS)
> +         desc->handler->end(irq);
> +
> +      if (!(desc->status & IRQ_DISABLED))
> +         desc->handler->disable(irq);
> +   }
> +
>     if (ppc_md.kexec_cpu_down)
>        ppc_md.kexec_cpu_down(1, 0);
> 
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev

[-- Attachment #2: Type: text/html, Size: 4485 bytes --]

^ permalink raw reply


This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.