[AVR32] Add nwait and tdf parameters to SMC configuration

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=068d9f6eb9369a00eb45be91c07653cfef65f4a0
Commit: 068d9f6eb9369a00eb45be91c07653cfef65f4a0
Parent: 9c8f8e752431f3f7ed6ea6ea6e491ce12057f572
Author: Hans-Christian Egtvedt <[EMAIL PROTECTED]>
AuthorDate: Wed Jan 31 18:01:45 2007 +0100
Committer:  Haavard Skinnemoen <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 13:43:27 2007 +0200

[AVR32] Add nwait and tdf parameters to SMC configuration

Complete the SMC configuration code by adding nwait and tdf
parameter. After this change, we support the same parameters as the
hardware.

Signed-off-by: Haavard Skinnemoen <[EMAIL PROTECTED]>
---
 arch/avr32/mach-at32ap/hsmc.c   |   23 +++
 include/asm-avr32/arch-at32ap/smc.h |   22 ++
 2 files changed, 45 insertions(+), 0 deletions(-)

diff --git a/arch/avr32/mach-at32ap/hsmc.c b/arch/avr32/mach-at32ap/hsmc.c
index 7691721..5e22a75 100644
--- a/arch/avr32/mach-at32ap/hsmc.c
+++ b/arch/avr32/mach-at32ap/hsmc.c
@@ -75,12 +75,35 @@ int smc_set_configuration(int cs, const struct smc_config 
*config)
return -EINVAL;
}
 
+   switch (config->nwait_mode) {
+   case 0:
+   mode |= HSMC_BF(EXNW_MODE, HSMC_EXNW_MODE_DISABLED);
+   break;
+   case 1:
+   mode |= HSMC_BF(EXNW_MODE, HSMC_EXNW_MODE_RESERVED);
+   break;
+   case 2:
+   mode |= HSMC_BF(EXNW_MODE, HSMC_EXNW_MODE_FROZEN);
+   break;
+   case 3:
+   mode |= HSMC_BF(EXNW_MODE, HSMC_EXNW_MODE_READY);
+   break;
+   default:
+   return -EINVAL;
+   }
+
+   if (config->tdf_cycles) {
+   mode |= HSMC_BF(TDF_CYCLES, config->tdf_cycles);
+   }
+
if (config->nrd_controlled)
mode |= HSMC_BIT(READ_MODE);
if (config->nwe_controlled)
mode |= HSMC_BIT(WRITE_MODE);
if (config->byte_write)
mode |= HSMC_BIT(BAT);
+   if (config->tdf_mode)
+   mode |= HSMC_BIT(TDF_MODE);
 
pr_debug("smc cs%d: setup/%08x pulse/%08x cycle/%08x mode/%08x\n",
 cs, setup, pulse, cycle, mode);
diff --git a/include/asm-avr32/arch-at32ap/smc.h 
b/include/asm-avr32/arch-at32ap/smc.h
index 3732b32..07152b7 100644
--- a/include/asm-avr32/arch-at32ap/smc.h
+++ b/include/asm-avr32/arch-at32ap/smc.h
@@ -48,10 +48,32 @@ struct smc_config {
unsigned intnwe_controlled:1;
 
/*
+* 0: NWAIT is disabled
+* 1: Reserved
+* 2: NWAIT is frozen mode
+* 3: NWAIT in ready mode
+*/
+   unsigned intnwait_mode:2;
+
+   /*
 * 0: Byte select access type
 * 1: Byte write access type
 */
unsigned intbyte_write:1;
+
+   /*
+* Number of clock cycles before data is released after
+* the rising edge of the read controlling signal
+*
+* Total cycles from SMC is tdf_cycles + 1
+*/
+   unsigned inttdf_cycles:4;
+
+   /*
+* 0: TDF optimization disabled
+* 1: TDF optimization enabled
+*/
+   unsigned inttdf_mode:1;
 };
 
 extern int smc_set_configuration(int cs, const struct smc_config *config);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[AVR32] Add mach-specific Kconfig

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=228e845fd243bf42033998afab792357444e9e4a
Commit: 228e845fd243bf42033998afab792357444e9e4a
Parent: 068d9f6eb9369a00eb45be91c07653cfef65f4a0
Author: Haavard Skinnemoen <[EMAIL PROTECTED]>
AuthorDate: Wed Mar 7 15:24:34 2007 +0100
Committer:  Haavard Skinnemoen <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 13:43:27 2007 +0200

[AVR32] Add mach-specific Kconfig

Include at32ap-specific Kconfig file from top-level Kconfig file. The
at32ap Kconfig is currently empty, but it will grow some machine-
specific options soon.

Signed-off-by: Haavard Skinnemoen <[EMAIL PROTECTED]>
---
 arch/avr32/Kconfig |2 ++
 arch/avr32/mach-at32ap/Kconfig |7 +++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/arch/avr32/Kconfig b/arch/avr32/Kconfig
index ce4013a..257b836 100644
--- a/arch/avr32/Kconfig
+++ b/arch/avr32/Kconfig
@@ -116,6 +116,8 @@ config  LOADER_U_BOOT
bool "U-Boot (or similar) bootloader"
 endchoice
 
+source "arch/avr32/mach-at32ap/Kconfig"
+
 config LOAD_ADDRESS
hex
default 0x1000 if LOADER_U_BOOT=y && CPU_AT32AP7000=y
diff --git a/arch/avr32/mach-at32ap/Kconfig b/arch/avr32/mach-at32ap/Kconfig
new file mode 100644
index 000..d749771
--- /dev/null
+++ b/arch/avr32/mach-at32ap/Kconfig
@@ -0,0 +1,7 @@
+if PLATFORM_AT32AP
+
+menu "Atmel AVR32 AP options"
+
+endmenu
+
+endif
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Change default dirty-writeback limits

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=07db59bd6b0f279c31044cba6787344f63be87ea
Commit: 07db59bd6b0f279c31044cba6787344f63be87ea
Parent: de46c33745f5e2ad594c72f2cf5f490861b16ce1
Author: Linus Torvalds <[EMAIL PROTECTED]>
AuthorDate: Fri Apr 27 09:10:47 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 09:10:47 2007 -0700

Change default dirty-writeback limits

Do this really early in the 2.6.22-rc series, so that we'll get
feedback.  And don't change by half measures.  Just cut the default
dirty limit to a quarter of what it was, and see if anybody even
notices.

Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 mm/page-writeback.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index f469e3c..a794945 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -67,12 +67,12 @@ static inline long sync_writeback_pages(void)
 /*
  * Start background writeback (via pdflush) at this percentage
  */
-int dirty_background_ratio = 10;
+int dirty_background_ratio = 5;
 
 /*
  * The generator of dirty data starts writeback at this percentage
  */
-int vm_dirty_ratio = 40;
+int vm_dirty_ratio = 10;
 
 /*
  * The interval between `kupdate'-style writebacks, in jiffies
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[AVR32] Add basic HMATRIX support

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9c8f8e752431f3f7ed6ea6ea6e491ce12057f572
Commit: 9c8f8e752431f3f7ed6ea6ea6e491ce12057f572
Parent: de46c33745f5e2ad594c72f2cf5f490861b16ce1
Author: Haavard Skinnemoen <[EMAIL PROTECTED]>
AuthorDate: Thu Feb 1 16:34:10 2007 +0100
Committer:  Haavard Skinnemoen <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 12:58:50 2007 +0200

[AVR32] Add basic HMATRIX support

This adds register and clock definitions for the High-speed bus Matrix
(HMATRIX) as well as a function that can be used to configure special
EBI functionality like CompactFlash and NAND flash support.

Signed-off-by: Haavard Skinnemoen <[EMAIL PROTECTED]>
---
 arch/avr32/mach-at32ap/at32ap7000.c |   38 +++
 arch/avr32/mach-at32ap/hmatrix.h|  182 +++
 2 files changed, 220 insertions(+), 0 deletions(-)

diff --git a/arch/avr32/mach-at32ap/at32ap7000.c 
b/arch/avr32/mach-at32ap/at32ap7000.c
index 472703f..32c7045 100644
--- a/arch/avr32/mach-at32ap/at32ap7000.c
+++ b/arch/avr32/mach-at32ap/at32ap7000.c
@@ -18,6 +18,7 @@
 #include 
 
 #include "clock.h"
+#include "hmatrix.h"
 #include "pio.h"
 #include "sm.h"
 
@@ -467,6 +468,42 @@ static struct clk pico_clk = {
 };
 
 /* 
+ * HMATRIX
+ *  */
+
+static struct clk hmatrix_clk = {
+   .name   = "hmatrix_clk",
+   .parent = &pbb_clk,
+   .mode   = pbb_clk_mode,
+   .get_rate   = pbb_clk_get_rate,
+   .index  = 2,
+   .users  = 1,
+};
+#define HMATRIX_BASE   ((void __iomem *)0xfff00800)
+
+#define hmatrix_readl(reg) \
+   __raw_readl((HMATRIX_BASE) + HMATRIX_##reg)
+#define hmatrix_writel(reg,value)  \
+   __raw_writel((value), (HMATRIX_BASE) + HMATRIX_##reg)
+
+/*
+ * Set bits in the HMATRIX Special Function Register (SFR) used by the
+ * External Bus Interface (EBI). This can be used to enable special
+ * features like CompactFlash support, NAND Flash support, etc. on
+ * certain chipselects.
+ */
+static inline void set_ebi_sfr_bits(u32 mask)
+{
+   u32 sfr;
+
+   clk_enable(&hmatrix_clk);
+   sfr = hmatrix_readl(SFR4);
+   sfr |= mask;
+   hmatrix_writel(SFR4, sfr);
+   clk_disable(&hmatrix_clk);
+}
+
+/* 
  *  PIO
  *  */
 
@@ -950,6 +987,7 @@ struct clk *at32_clock_list[] = {
&pbb_clk,
&at32_sm_pclk,
&at32_intc0_pclk,
+   &hmatrix_clk,
&ebi_clk,
&hramc_clk,
&smc0_pclk,
diff --git a/arch/avr32/mach-at32ap/hmatrix.h b/arch/avr32/mach-at32ap/hmatrix.h
new file mode 100644
index 000..d10bfb6
--- /dev/null
+++ b/arch/avr32/mach-at32ap/hmatrix.h
@@ -0,0 +1,182 @@
+/*
+ * Register definitions for High-Speed Bus Matrix
+ */
+#ifndef __HMATRIX_H
+#define __HMATRIX_H
+
+/* HMATRIX register offsets */
+#define HMATRIX_MCFG0  0x
+#define HMATRIX_MCFG1  0x0004
+#define HMATRIX_MCFG2  0x0008
+#define HMATRIX_MCFG3  0x000c
+#define HMATRIX_MCFG4  0x0010
+#define HMATRIX_MCFG5  0x0014
+#define HMATRIX_MCFG6  0x0018
+#define HMATRIX_MCFG7  0x001c
+#define HMATRIX_MCFG8  0x0020
+#define HMATRIX_MCFG9  0x0024
+#define HMATRIX_MCFG10 0x0028
+#define HMATRIX_MCFG11 0x002c
+#define HMATRIX_MCFG12 0x0030
+#define HMATRIX_MCFG13 0x0034
+#define HMATRIX_MCFG14 0x0038
+#define HMATRIX_MCFG15 0x003c
+#define HMATRIX_SCFG0  0x0040
+#define HMATRIX_SCFG1  0x0044
+#define HMATRIX_SCFG2  0x0048
+#define HMATRIX_SCFG3  0x004c
+#define HMATRIX_SCFG4  0x0050
+#define HMATRIX_SCFG5  0x0054
+#define HMATRIX_SCFG6  0x0058
+#define HMATRIX_SCFG7  0x005c
+#define HMATRIX_SCFG8  0x0060
+#define HMATRIX_SCFG9  0x0064
+#define HMATRIX_SCFG10 0x0068
+#define HMATRIX_SCFG11 0x006c
+#define HMATRIX_SCFG12 0x0070
+#define HMATRIX_SCFG13 0x0074
+#define HMATRIX_SCFG14 0x0078
+#define HMATRIX_SCFG15 0x007c
+#define HMATRIX_PRAS0 

[AVR32] Change system timer from count-compare to Timer/Counter 0

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7760989e5e2900e484e9115e6e690c6ce0b0221c
Commit: 7760989e5e2900e484e9115e6e690c6ce0b0221c
Parent: 228e845fd243bf42033998afab792357444e9e4a
Author: Hans-Christian Egtvedt <[EMAIL PROTECTED]>
AuthorDate: Mon Mar 12 18:15:16 2007 +0100
Committer:  Haavard Skinnemoen <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 13:44:12 2007 +0200

[AVR32] Change system timer from count-compare to Timer/Counter 0

Due to limitation of the count-compare system timer (not able to
count when CPU is in sleep), the system timer had to be changed to
use a peripheral timer/counter.

The old COUNT-COMPARE code is still present in time.c as weak
functions. The new timer is added to the architecture directory.

This patch sets up TC0 as system timer The new timer has been tested
on AT32AP7000/ATSTK1000 at 100 Hz, 250 Hz, 300 Hz and 1000 Hz.

For more details about the timer/counter see the datasheet for
AT32AP700x available at

http://www.atmel.com/dyn/products/product_card.asp?part_id=3903

Signed-off-by: Hans-Christian Egtvedt <[EMAIL PROTECTED]>
Signed-off-by: Haavard Skinnemoen <[EMAIL PROTECTED]>
---
 arch/avr32/kernel/time.c |  150 
 arch/avr32/mach-at32ap/Makefile  |1 +
 arch/avr32/mach-at32ap/at32ap7000.c  |   18 +++
 arch/avr32/mach-at32ap/time-tc.c |  217 ++
 include/asm-avr32/arch-at32ap/time.h |  112 +
 5 files changed, 425 insertions(+), 73 deletions(-)

diff --git a/arch/avr32/kernel/time.c b/arch/avr32/kernel/time.c
index c10833f..7014a35 100644
--- a/arch/avr32/kernel/time.c
+++ b/arch/avr32/kernel/time.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2004-2006 Atmel Corporation
+ * Copyright (C) 2004-2007 Atmel Corporation
  *
  * Based on MIPS implementation arch/mips/kernel/time.c
  *   Copyright 2001 MontaVista Software Inc.
@@ -20,18 +20,25 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
 #include 
 #include 
 
-static cycle_t read_cycle_count(void)
+/* how many counter cycles in a jiffy? */
+static u32 cycles_per_jiffy;
+
+/* the count value for the next timer interrupt */
+static u32 expirelo;
+
+cycle_t __weak read_cycle_count(void)
 {
return (cycle_t)sysreg_read(COUNT);
 }
 
-static struct clocksource clocksource_avr32 = {
+struct clocksource __weak clocksource_avr32 = {
.name   = "avr32",
.rating = 350,
.read   = read_cycle_count,
@@ -40,12 +47,20 @@ static struct clocksource clocksource_avr32 = {
.flags  = CLOCK_SOURCE_IS_CONTINUOUS,
 };
 
+irqreturn_t __weak timer_interrupt(int irq, void *dev_id);
+
+struct irqaction timer_irqaction = {
+   .handler= timer_interrupt,
+   .flags  = IRQF_DISABLED,
+   .name   = "timer",
+};
+
 /*
  * By default we provide the null RTC ops
  */
 static unsigned long null_rtc_get_time(void)
 {
-   return mktime(2004, 1, 1, 0, 0, 0);
+   return mktime(2007, 1, 1, 0, 0, 0);
 }
 
 static int null_rtc_set_time(unsigned long sec)
@@ -56,23 +71,14 @@ static int null_rtc_set_time(unsigned long sec)
 static unsigned long (*rtc_get_time)(void) = null_rtc_get_time;
 static int (*rtc_set_time)(unsigned long) = null_rtc_set_time;
 
-/* how many counter cycles in a jiffy? */
-static unsigned long cycles_per_jiffy;
-
-/* cycle counter value at the previous timer interrupt */
-static unsigned int timerhi, timerlo;
-
-/* the count value for the next timer interrupt */
-static unsigned int expirelo;
-
 static void avr32_timer_ack(void)
 {
-   unsigned int count;
+   u32 count;
 
/* Ack this timer interrupt and set the next one */
expirelo += cycles_per_jiffy;
+   /* setting COMPARE to 0 stops the COUNT-COMPARE */
if (expirelo == 0) {
-   printk(KERN_DEBUG "expirelo == 0\n");
sysreg_write(COMPARE, expirelo + 1);
} else {
sysreg_write(COMPARE, expirelo);
@@ -86,27 +92,56 @@ static void avr32_timer_ack(void)
}
 }
 
-static unsigned int avr32_hpt_read(void)
+int __weak avr32_hpt_init(void)
 {
-   return sysreg_read(COUNT);
+   int ret;
+   unsigned long mult, shift, count_hz;
+
+   count_hz = clk_get_rate(boot_cpu_data.clk);
+   shift = clocksource_avr32.shift;
+   mult = clocksource_hz2mult(count_hz, shift);
+   clocksource_avr32.mult = mult;
+
+   {
+   u64 tmp;
+
+   tmp = TICK_NSEC;
+   tmp <<= shift;
+   tmp += mult / 2;
+   do_div(tmp, mult);
+
+   cycles_per_jiffy = tmp;
+   }
+
+   ret = setup_irq(0, &timer_irqaction);
+   if (ret) {
+   pr_debug("timer: could not request IRQ 0: %d\n", ret);
+   return -ENODEV;
+   }
+
+   printk(KERN_INFO "timer: AT32AP C

[AVR32] Put cpu in sleep 0 when idle.

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=19b7ce8bad718a2850ea19aeb7383f1728596c24
Commit: 19b7ce8bad718a2850ea19aeb7383f1728596c24
Parent: 7760989e5e2900e484e9115e6e690c6ce0b0221c
Author: Hans-Christian Egtvedt <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 26 13:50:43 2007 +0100
Committer:  Haavard Skinnemoen <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 13:44:12 2007 +0200

[AVR32] Put cpu in sleep 0 when idle.

This patch puts the CPU in sleep 0 when doing nothing, idle. This will
turn of the CPU clock and thus save power. The CPU is waken again when
an interrupt occurs.

Signed-off-by: Hans-Christian Egtvedt <[EMAIL PROTECTED]>
Signed-off-by: Haavard Skinnemoen <[EMAIL PROTECTED]>
---
 arch/avr32/kernel/entry-avr32b.S |   42 +
 arch/avr32/kernel/process.c  |5 ++-
 include/asm-avr32/thread_info.h  |2 +
 3 files changed, 42 insertions(+), 7 deletions(-)

diff --git a/arch/avr32/kernel/entry-avr32b.S b/arch/avr32/kernel/entry-avr32b.S
index eeb6679..5f5f7e4 100644
--- a/arch/avr32/kernel/entry-avr32b.S
+++ b/arch/avr32/kernel/entry-avr32b.S
@@ -630,9 +630,12 @@ irq_level\level:
rcall   do_IRQ
 
lddsp   r4, sp[REG_SR]
-   andhr4, (MODE_MASK >> 16), COH
+   bfextu  r4, r4, SYSREG_M0_OFFSET, 3
+   cp.wr4, MODE_SUPERVISOR >> SYSREG_M0_OFFSET
+   breq2f
+   cp.wr4, MODE_USER >> SYSREG_M0_OFFSET
 #ifdef CONFIG_PREEMPT
-   brne2f
+   brne3f
 #else
brne1f
 #endif
@@ -649,9 +652,18 @@ irq_level\level:
sub sp, -4  /* ignore r12_orig */
rete
 
+2: get_thread_info r0
+   ld.wr1, r0[TI_flags]
+   bld r1, TIF_CPU_GOING_TO_SLEEP
 #ifdef CONFIG_PREEMPT
-2:
-   get_thread_info r0
+   brcc3f
+#else
+   brcc1b
+#endif
+   sub r1, pc, . - cpu_idle_skip_sleep
+   stdsp   sp[REG_PC], r1
+#ifdef CONFIG_PREEMPT
+3: get_thread_info r0
ld.wr2, r0[TI_preempt_count]
cp.wr2, 0
brne1b
@@ -662,12 +674,32 @@ irq_level\level:
bld r4, SYSREG_GM_OFFSET
brcs1b
rcall   preempt_schedule_irq
-   rjmp1b
 #endif
+   rjmp1b
.endm
 
.section .irq.text,"ax",@progbits
 
+.global cpu_idle_sleep
+cpu_idle_sleep:
+   mask_interrupts
+   get_thread_info r8
+   ld.wr9, r8[TI_flags]
+   bld r9, TIF_NEED_RESCHED
+   brcscpu_idle_enable_int_and_exit
+   sbr r9, TIF_CPU_GOING_TO_SLEEP
+   st.wr8[TI_flags], r9
+   unmask_interrupts
+   sleep 0
+cpu_idle_skip_sleep:
+   mask_interrupts
+   ld.wr9, r8[TI_flags]
+   cbr r9, TIF_CPU_GOING_TO_SLEEP
+   st.wr8[TI_flags], r9
+cpu_idle_enable_int_and_exit:
+   unmask_interrupts
+   retal   r12
+
.global irq_level0
.global irq_level1
.global irq_level2
diff --git a/arch/avr32/kernel/process.c b/arch/avr32/kernel/process.c
index 0b43259..4f8d2d4 100644
--- a/arch/avr32/kernel/process.c
+++ b/arch/avr32/kernel/process.c
@@ -19,6 +19,8 @@
 void (*pm_power_off)(void) = NULL;
 EXPORT_SYMBOL(pm_power_off);
 
+extern void cpu_idle_sleep(void);
+
 /*
  * This file handles the architecture-dependent parts of process handling..
  */
@@ -27,9 +29,8 @@ void cpu_idle(void)
 {
/* endless idle loop with no priority at all */
while (1) {
-   /* TODO: Enter sleep mode */
while (!need_resched())
-   cpu_relax();
+   cpu_idle_sleep();
preempt_enable_no_resched();
schedule();
preempt_disable();
diff --git a/include/asm-avr32/thread_info.h b/include/asm-avr32/thread_info.h
index d1f5b35..a2e606d 100644
--- a/include/asm-avr32/thread_info.h
+++ b/include/asm-avr32/thread_info.h
@@ -83,6 +83,7 @@ static inline struct thread_info *current_thread_info(void)
 #define TIF_SINGLE_STEP6   /* single step after next break 
*/
 #define TIF_MEMDIE 7
 #define TIF_RESTORE_SIGMASK8   /* restore signal mask in do_signal */
+#define TIF_CPU_GOING_TO_SLEEP 9   /* CPU is entering sleep 0 mode */
 #define TIF_USERSPACE  31  /* true if FS sets userspace */
 
 #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
@@ -94,6 +95,7 @@ static inline struct thread_info *current_thread_info(void)
 #define _TIF_SINGLE_STEP   (1 << TIF_SINGLE_STEP)
 #define _TIF_MEMDIE(1 << TIF_MEMDIE)
 #define _TIF_RESTORE_SIGMASK   (1 << TIF_RESTORE_SIGMASK)
+#define _TIF_CPU_GOING_TO_SLEEP (1 << TIF_CPU_GOING_TO_SLEEP)
 
 /* XXX: These two masks must never span more than 16 bits! */
 /* work to do on interrupt/exception return */
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  h

[AVR32] Don't enable clocks with no users

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=188ff65d49dadf7b0e9b6718abc3fe98a5098711
Commit: 188ff65d49dadf7b0e9b6718abc3fe98a5098711
Parent: 19b7ce8bad718a2850ea19aeb7383f1728596c24
Author: Haavard Skinnemoen <[EMAIL PROTECTED]>
AuthorDate: Wed Mar 14 13:23:44 2007 +0100
Committer:  Haavard Skinnemoen <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 13:44:13 2007 +0200

[AVR32] Don't enable clocks with no users

Bring the code that sets the initial PM clock masks in line with the
comment preceding it by only enabling clocks that have users != 0.
Fix SM clock definition and avr32_hpt_init() so that the SM and TC0
clocks keep ticking.

Signed-off-by: Haavard Skinnemoen <[EMAIL PROTECTED]>
---
 arch/avr32/mach-at32ap/at32ap7000.c |   14 +-
 arch/avr32/mach-at32ap/time-tc.c|1 +
 2 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/arch/avr32/mach-at32ap/at32ap7000.c 
b/arch/avr32/mach-at32ap/at32ap7000.c
index 6eeda60..56db45b 100644
--- a/arch/avr32/mach-at32ap/at32ap7000.c
+++ b/arch/avr32/mach-at32ap/at32ap7000.c
@@ -417,7 +417,15 @@ struct platform_device at32_sm_device = {
.resource   = sm_resource,
.num_resources  = ARRAY_SIZE(sm_resource),
 };
-DEV_CLK(pclk, at32_sm, pbb, 0);
+static struct clk at32_sm_pclk = {
+   .name   = "pclk",
+   .dev= &at32_sm_device.dev,
+   .parent = &pbb_clk,
+   .mode   = pbb_clk_mode,
+   .get_rate   = pbb_clk_get_rate,
+   .users  = 1,
+   .index  = 0,
+};
 
 static struct resource intc0_resource[] = {
PBMEM(0xfff00400),
@@ -443,6 +451,7 @@ static struct clk hramc_clk = {
.mode   = hsb_clk_mode,
.get_rate   = hsb_clk_get_rate,
.users  = 1,
+   .index  = 3,
 };
 
 static struct resource smc0_resource[] = {
@@ -1080,6 +1089,9 @@ void __init at32_clock_init(void)
for (i = 0; i < ARRAY_SIZE(at32_clock_list); i++) {
struct clk *clk = at32_clock_list[i];
 
+   if (clk->users == 0)
+   continue;
+
if (clk->mode == &cpu_clk_mode)
cpu_mask |= 1 << clk->index;
else if (clk->mode == &hsb_clk_mode)
diff --git a/arch/avr32/mach-at32ap/time-tc.c b/arch/avr32/mach-at32ap/time-tc.c
index 7ac0e94..e3070bd 100644
--- a/arch/avr32/mach-at32ap/time-tc.c
+++ b/arch/avr32/mach-at32ap/time-tc.c
@@ -135,6 +135,7 @@ int avr32_hpt_init(unsigned int count)
pr_debug("timer: could not get clk: %ld\n", PTR_ERR(pclk));
goto out_error;
}
+   clk_enable(pclk);
 
regs = platform_get_resource(&at32_systc0_device, IORESOURCE_MEM, 0);
if (!regs) {
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[AVR32] Clean up asm/sysreg.h

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=535c806c26ef602d578792083df52b31803b961e
Commit: 535c806c26ef602d578792083df52b31803b961e
Parent: 188ff65d49dadf7b0e9b6718abc3fe98a5098711
Author: Haavard Skinnemoen <[EMAIL PROTECTED]>
AuthorDate: Tue Mar 13 14:17:14 2007 +0100
Committer:  Haavard Skinnemoen <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 13:44:13 2007 +0200

[AVR32] Clean up asm/sysreg.h

Fix indentation and remove spurious comments in asm-avr32/sysreg.h

Signed-off-by: Haavard Skinnemoen <[EMAIL PROTECTED]>
---
 include/asm-avr32/sysreg.h |  543 
 1 files changed, 249 insertions(+), 294 deletions(-)

diff --git a/include/asm-avr32/sysreg.h b/include/asm-avr32/sysreg.h
index f91975f..c02bc83 100644
--- a/include/asm-avr32/sysreg.h
+++ b/include/asm-avr32/sysreg.h
@@ -7,326 +7,281 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-#ifndef __ASM_AVR32_SYSREG_H__
-#define __ASM_AVR32_SYSREG_H__
+#ifndef __ASM_AVR32_SYSREG_H
+#define __ASM_AVR32_SYSREG_H
 
 /* sysreg register offsets */
-#define SYSREG_SR   0x
-#define SYSREG_EVBA 0x0004
-#define SYSREG_ACBA 0x0008
-#define SYSREG_CPUCR0x000c
-#define SYSREG_ECR  0x0010
-#define SYSREG_RSR_SUP  0x0014
-#define SYSREG_RSR_INT0 0x0018
-#define SYSREG_RSR_INT1 0x001c
-#define SYSREG_RSR_INT2 0x0020
-#define SYSREG_RSR_INT3 0x0024
-#define SYSREG_RSR_EX   0x0028
-#define SYSREG_RSR_NMI  0x002c
-#define SYSREG_RSR_DBG  0x0030
-#define SYSREG_RAR_SUP  0x0034
-#define SYSREG_RAR_INT0 0x0038
-#define SYSREG_RAR_INT1 0x003c
-#define SYSREG_RAR_INT2 0x0040
-#define SYSREG_RAR_INT3 0x0044
-#define SYSREG_RAR_EX   0x0048
-#define SYSREG_RAR_NMI  0x004c
-#define SYSREG_RAR_DBG  0x0050
-#define SYSREG_JECR 0x0054
-#define SYSREG_JOSP 0x0058
-#define SYSREG_JAVA_LV0 0x005c
-#define SYSREG_JAVA_LV1 0x0060
-#define SYSREG_JAVA_LV2 0x0064
-#define SYSREG_JAVA_LV3 0x0068
-#define SYSREG_JAVA_LV4 0x006c
-#define SYSREG_JAVA_LV5 0x0070
-#define SYSREG_JAVA_LV6 0x0074
-#define SYSREG_JAVA_LV7 0x0078
-#define SYSREG_JTBA 0x007c
-#define SYSREG_JBCR 0x0080
-#define SYSREG_CONFIG0  0x0100
-#define SYSREG_CONFIG1  0x0104
-#define SYSREG_COUNT0x0108
-#define SYSREG_COMPARE  0x010c
-#define SYSREG_TLBEHI   0x0110
-#define SYSREG_TLBELO   0x0114
-#define SYSREG_PTBR 0x0118
-#define SYSREG_TLBEAR   0x011c
-#define SYSREG_MMUCR0x0120
-#define SYSREG_TLBARLO  0x0124
-#define SYSREG_TLBARHI  0x0128
-#define SYSREG_PCCNT0x012c
-#define SYSREG_PCNT00x0130
-#define SYSREG_PCNT10x0134
-#define SYSREG_PCCR 0x0138
-#define SYSREG_BEAR 0x013c
+#define SYSREG_SR  0x
+#define SYSREG_EVBA0x0004
+#define SYSREG_ACBA0x0008
+#define SYSREG_CPUCR   0x000c
+#define SYSREG_ECR 0x0010
+#define SYSREG_RSR_SUP 0x0014
+#define SYSREG_RSR_INT00x0018
+#define SYSREG_RSR_INT10x001c
+#define SYSREG_RSR_INT20x0020
+#define SYSREG_RSR_INT30x0024
+#define SYSREG_RSR_EX  0x0028
+#define SYSREG_RSR_NMI 0x002c
+#define SYSREG_RSR_DBG 0x0030
+#define SYSREG_RAR_SUP 0x0034
+#define SYSREG_RAR_INT00x0038
+#define SYSREG_RAR_INT10x003c
+#define SYSREG_RAR_INT20x0040
+#define SYSREG_RAR_INT30x0

[AVR32] Clean up cpu identification and add features bitmap

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3b328c98093702c584692bffabd440800b383d73
Commit: 3b328c98093702c584692bffabd440800b383d73
Parent: 535c806c26ef602d578792083df52b31803b961e
Author: Haavard Skinnemoen <[EMAIL PROTECTED]>
AuthorDate: Tue Mar 13 15:30:38 2007 +0100
Committer:  Haavard Skinnemoen <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 13:44:13 2007 +0200

[AVR32] Clean up cpu identification and add features bitmap

Clean up the cpu identification code, using definitions from
 instead of hardcoded constants. Also, add a features
bitmap to struct avr32_cpuinfo to allow other code to make decisions
based upon what the running cpu is actually capable of.

Signed-off-by: Haavard Skinnemoen <[EMAIL PROTECTED]>
---
 arch/avr32/kernel/cpu.c   |   64 -
 include/asm-avr32/processor.h |9 ++
 2 files changed, 53 insertions(+), 20 deletions(-)

diff --git a/arch/avr32/kernel/cpu.c b/arch/avr32/kernel/cpu.c
index 2e72fd2..2714cf6 100644
--- a/arch/avr32/kernel/cpu.c
+++ b/arch/avr32/kernel/cpu.c
@@ -209,16 +209,17 @@ static const char *mmu_types[] = {
 void __init setup_processor(void)
 {
unsigned long config0, config1;
+   unsigned long features;
unsigned cpu_id, cpu_rev, arch_id, arch_rev, mmu_type;
unsigned tmp;
 
-   config0 = sysreg_read(CONFIG0); /* 0x013e; */
-   config1 = sysreg_read(CONFIG1); /* 0x01f689a2; */
-   cpu_id = config0 >> 24;
-   cpu_rev = (config0 >> 16) & 0xff;
-   arch_id = (config0 >> 13) & 0x07;
-   arch_rev = (config0 >> 10) & 0x07;
-   mmu_type = (config0 >> 7) & 0x03;
+   config0 = sysreg_read(CONFIG0);
+   config1 = sysreg_read(CONFIG1);
+   cpu_id = SYSREG_BFEXT(PROCESSORID, config0);
+   cpu_rev = SYSREG_BFEXT(PROCESSORREVISION, config0);
+   arch_id = SYSREG_BFEXT(AT, config0);
+   arch_rev = SYSREG_BFEXT(AR, config0);
+   mmu_type = SYSREG_BFEXT(MMUT, config0);
 
boot_cpu_data.arch_type = arch_id;
boot_cpu_data.cpu_type = cpu_id;
@@ -226,16 +227,16 @@ void __init setup_processor(void)
boot_cpu_data.cpu_revision = cpu_rev;
boot_cpu_data.tlb_config = mmu_type;
 
-   tmp = (config1 >> 13) & 0x07;
+   tmp = SYSREG_BFEXT(ILSZ, config1);
if (tmp) {
-   boot_cpu_data.icache.ways = 1 << ((config1 >> 10) & 0x07);
-   boot_cpu_data.icache.sets = 1 << ((config1 >> 16) & 0x0f);
+   boot_cpu_data.icache.ways = 1 << SYSREG_BFEXT(IASS, config1);
+   boot_cpu_data.icache.sets = 1 << SYSREG_BFEXT(ISET, config1);
boot_cpu_data.icache.linesz = 1 << (tmp + 1);
}
-   tmp = (config1 >> 3) & 0x07;
+   tmp = SYSREG_BFEXT(DLSZ, config1);
if (tmp) {
-   boot_cpu_data.dcache.ways = 1 << (config1 & 0x07);
-   boot_cpu_data.dcache.sets = 1 << ((config1 >> 6) & 0x0f);
+   boot_cpu_data.dcache.ways = 1 << SYSREG_BFEXT(DASS, config1);
+   boot_cpu_data.dcache.sets = 1 << SYSREG_BFEXT(DSET, config1);
boot_cpu_data.dcache.linesz = 1 << (tmp + 1);
}
 
@@ -250,16 +251,39 @@ void __init setup_processor(void)
cpu_names[cpu_id], cpu_id, cpu_rev,
arch_names[arch_id], arch_rev);
printk ("CPU: MMU configuration: %s\n", mmu_types[mmu_type]);
+
printk ("CPU: features:");
-   if (config0 & (1 << 6))
-   printk(" fpu");
-   if (config0 & (1 << 5))
-   printk(" java");
-   if (config0 & (1 << 4))
-   printk(" perfctr");
-   if (config0 & (1 << 3))
+   features = 0;
+   if (config0 & SYSREG_BIT(CONFIG0_R)) {
+   features |= AVR32_FEATURE_RMW;
+   printk(" rmw");
+   }
+   if (config0 & SYSREG_BIT(CONFIG0_D)) {
+   features |= AVR32_FEATURE_DSP;
+   printk(" dsp");
+   }
+   if (config0 & SYSREG_BIT(CONFIG0_S)) {
+   features |= AVR32_FEATURE_SIMD;
+   printk(" simd");
+   }
+   if (config0 & SYSREG_BIT(CONFIG0_O)) {
+   features |= AVR32_FEATURE_OCD;
printk(" ocd");
+   }
+   if (config0 & SYSREG_BIT(CONFIG0_P)) {
+   features |= AVR32_FEATURE_PCTR;
+   printk(" perfctr");
+   }
+   if (config0 & SYSREG_BIT(CONFIG0_J)) {
+   features |= AVR32_FEATURE_JAVA;
+   printk(" java");
+   }
+   if (config0 & SYSREG_BIT(CONFIG0_F)) {
+   features |= AVR32_FEATURE_FPU;
+   printk(" fpu");
+   }
printk("\n");
+   boot_cpu_data.features = features;
 }
 
 #ifdef CONFIG_PROC_FS
diff --git a/include/asm-avr32/processor.h b/include/asm-avr32/processor.h
index f691377..cbb89cc 100644
--- a/include/asm-avr32/processor.h
+++ b/include/asm-avr32/processor.h
@@ -40,6 +40,14 

[AVR32] Clean up exception handling code

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=623b0355d5b1f9c6d05005b649a2f3a7b9fd7816
Commit: 623b0355d5b1f9c6d05005b649a2f3a7b9fd7816
Parent: 3b328c98093702c584692bffabd440800b383d73
Author: Haavard Skinnemoen <[EMAIL PROTECTED]>
AuthorDate: Tue Mar 13 17:59:11 2007 +0100
Committer:  Haavard Skinnemoen <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 13:44:13 2007 +0200

[AVR32] Clean up exception handling code

  * Use generic BUG() handling
  * Remove some useless debug statements
  * Use a common function _exception() to send signals or oops when
an exception can't be handled. This makes sure init doesn't
enter an infinite exception loop as well. Borrowed from powerpc.
  * Add some basic exception tracing support to the page fault code.
  * Rework dump_stack(), show_regs() and friends and move everything
into process.c
  * Print information about configuration options and chip type when
oopsing

Signed-off-by: Haavard Skinnemoen <[EMAIL PROTECTED]>
---
 arch/avr32/Kconfig  |5 +
 arch/avr32/kernel/module.c  |   11 +-
 arch/avr32/kernel/process.c |  188 --
 arch/avr32/kernel/traps.c   |  421 ---
 arch/avr32/kernel/vmlinux.lds.c |9 +-
 arch/avr32/mm/fault.c   |  116 ---
 include/asm-avr32/bug.h |   50 -
 include/asm-avr32/processor.h   |6 +-
 include/asm-avr32/system.h  |   13 +-
 9 files changed, 402 insertions(+), 417 deletions(-)

diff --git a/arch/avr32/Kconfig b/arch/avr32/Kconfig
index 257b836..7a1eb44 100644
--- a/arch/avr32/Kconfig
+++ b/arch/avr32/Kconfig
@@ -68,6 +68,11 @@ config GENERIC_CALIBRATE_DELAY
bool
default y
 
+config GENERIC_BUG
+   bool
+   default y
+   depends on BUG
+
 source "init/Kconfig"
 
 menu "System Type and features"
diff --git a/arch/avr32/kernel/module.c b/arch/avr32/kernel/module.c
index b599eae..1167fe9 100644
--- a/arch/avr32/kernel/module.c
+++ b/arch/avr32/kernel/module.c
@@ -12,10 +12,11 @@
  * published by the Free Software Foundation.
  */
 
-#include 
-#include 
-#include 
+#include 
 #include 
+#include 
+#include 
+#include 
 #include 
 
 void *module_alloc(unsigned long size)
@@ -315,10 +316,10 @@ int module_finalize(const Elf_Ehdr *hdr, const Elf_Shdr 
*sechdrs,
vfree(module->arch.syminfo);
module->arch.syminfo = NULL;
 
-   return 0;
+   return module_bug_finalize(hdr, sechdrs, module);
 }
 
 void module_arch_cleanup(struct module *module)
 {
-
+   module_bug_cleanup(module);
 }
diff --git a/arch/avr32/kernel/process.c b/arch/avr32/kernel/process.c
index 4f8d2d4..4e4181e 100644
--- a/arch/avr32/kernel/process.c
+++ b/arch/avr32/kernel/process.c
@@ -11,6 +11,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -115,39 +116,178 @@ void release_thread(struct task_struct *dead_task)
/* do nothing */
 }
 
+static void dump_mem(const char *str, const char *log_lvl,
+unsigned long bottom, unsigned long top)
+{
+   unsigned long p;
+   int i;
+
+   printk("%s%s(0x%08lx to 0x%08lx)\n", log_lvl, str, bottom, top);
+
+   for (p = bottom & ~31; p < top; ) {
+   printk("%s%04lx: ", log_lvl, p & 0x);
+
+   for (i = 0; i < 8; i++, p += 4) {
+   unsigned int val;
+
+   if (p < bottom || p >= top)
+   printk(" ");
+   else {
+   if (__get_user(val, (unsigned int __user *)p)) {
+   printk("\n");
+   goto out;
+   }
+   printk("%08x ", val);
+   }
+   }
+   printk("\n");
+   }
+
+out:
+   return;
+}
+
+static inline int valid_stack_ptr(struct thread_info *tinfo, unsigned long p)
+{
+   return (p > (unsigned long)tinfo)
+   && (p < (unsigned long)tinfo + THREAD_SIZE - 3);
+}
+
+#ifdef CONFIG_FRAME_POINTER
+static void show_trace_log_lvl(struct task_struct *tsk, unsigned long *sp,
+  struct pt_regs *regs, const char *log_lvl)
+{
+   unsigned long lr, fp;
+   struct thread_info *tinfo;
+
+   if (regs)
+   fp = regs->r7;
+   else if (tsk == current)
+   asm("mov %0, r7" : "=r"(fp));
+   else
+   fp = tsk->thread.cpu_context.r7;
+
+   /*
+* Walk the stack as long as the frame pointer (a) is within
+* the kernel stack of the task, and (b) it doesn't move
+* downwards.
+*/
+   tinfo = task_thread_info(tsk);
+   printk("%sCall trace:\n", log_lvl);
+   while (valid_stack_ptr(tinfo, fp)) {
+   unsigned long new_fp;
+
+   lr = *(u

[AVR32] Fix NMI handler

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=92b728c147adb8c690b520304f4c9ee3eee43c21
Commit: 92b728c147adb8c690b520304f4c9ee3eee43c21
Parent: 623b0355d5b1f9c6d05005b649a2f3a7b9fd7816
Author: Haavard Skinnemoen <[EMAIL PROTECTED]>
AuthorDate: Tue Mar 13 10:06:37 2007 +0100
Committer:  Haavard Skinnemoen <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 13:44:13 2007 +0200

[AVR32] Fix NMI handler

Fix a problem with the NMI handler entry code related to the NMI handler
sharing some code with the exception handlers. This is not a good idea
because the RSR and RAR registers are not the same, and the NMI handler
runs with interrupts masked the whole time so there's no need to check
for pending work.

Open-code the low-level NMI handling logic instead so that the pt_regs
layout is actually correct when the higher-level handler is called.

Signed-off-by: Haavard Skinnemoen <[EMAIL PROTECTED]>
---
 arch/avr32/kernel/entry-avr32b.S |   28 +---
 1 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/arch/avr32/kernel/entry-avr32b.S b/arch/avr32/kernel/entry-avr32b.S
index 5f5f7e4..484e083 100644
--- a/arch/avr32/kernel/entry-avr32b.S
+++ b/arch/avr32/kernel/entry-avr32b.S
@@ -340,12 +340,34 @@ do_bus_error_read:
 do_nmi_ll:
sub sp, 4
stmts   --sp, r0-lr
-   /* FIXME: Make sure RAR_NMI and RSR_NMI are pushed instead of *_EX */
-   rcall   save_full_context_ex
+   mfsrr9, SYSREG_RSR_NMI
+   mfsrr8, SYSREG_RAR_NMI
+   bfextu  r0, r9, MODE_SHIFT, 3
+   brne2f
+
+1: pushm   r8, r9  /* PC and SR */
mfsrr12, SYSREG_ECR
mov r11, sp
rcall   do_nmi
-   rjmpbad_return
+   popmr8-r9
+   mtsrSYSREG_RAR_NMI, r8
+   tst r0, r0
+   mtsrSYSREG_RSR_NMI, r9
+   brne3f
+
+   ldmts   sp++, r0-lr
+   sub sp, -4  /* skip r12_orig */
+   rete
+
+2: sub r10, sp, -(FRAME_SIZE_FULL - REG_LR)
+   stdsp   sp[4], r10  /* replace saved SP */
+   rjmp1b
+
+3: popmlr
+   sub sp, -4  /* skip sp */
+   popmr0-r12
+   sub sp, -4  /* skip r12_orig */
+   rete
 
 handle_address_fault:
sub sp, 4
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[AVR32] Move setup_bootmem() from mm/init.c to kernel/setup.c

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5539f59ac40473730806580f212c4eac6e769f01
Commit: 5539f59ac40473730806580f212c4eac6e769f01
Parent: e3e7d8d4ea37b8372ee417452d03171c5dc55125
Author: Haavard Skinnemoen <[EMAIL PROTECTED]>
AuthorDate: Wed Mar 21 15:39:18 2007 +0100
Committer:  Haavard Skinnemoen <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 13:44:14 2007 +0200

[AVR32] Move setup_bootmem() from mm/init.c to kernel/setup.c

Signed-off-by: Haavard Skinnemoen <[EMAIL PROTECTED]>
---
 arch/avr32/kernel/setup.c |  238 +
 arch/avr32/mm/init.c  |  238 -
 include/asm-avr32/setup.h |1 -
 3 files changed, 238 insertions(+), 239 deletions(-)

diff --git a/arch/avr32/kernel/setup.c b/arch/avr32/kernel/setup.c
index a1a7c3c..53a1ff0 100644
--- a/arch/avr32/kernel/setup.c
+++ b/arch/avr32/kernel/setup.c
@@ -8,12 +8,14 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -260,6 +262,242 @@ static void __init parse_tags(struct tag *t)
   t->hdr.tag);
 }
 
+static void __init print_memory_map(const char *what,
+   struct tag_mem_range *mem)
+{
+   printk ("%s:\n", what);
+   for (; mem; mem = mem->next) {
+   printk ("  %08lx - %08lx\n",
+   (unsigned long)mem->addr,
+   (unsigned long)(mem->addr + mem->size));
+   }
+}
+
+#define MAX_LOWMEM HIGHMEM_START
+#define MAX_LOWMEM_PFN PFN_DOWN(MAX_LOWMEM)
+
+/*
+ * Sort a list of memory regions in-place by ascending address.
+ *
+ * We're using bubble sort because we only have singly linked lists
+ * with few elements.
+ */
+static void __init sort_mem_list(struct tag_mem_range **pmem)
+{
+   int done;
+   struct tag_mem_range **a, **b;
+
+   if (!*pmem)
+   return;
+
+   do {
+   done = 1;
+   a = pmem, b = &(*pmem)->next;
+   while (*b) {
+   if ((*a)->addr > (*b)->addr) {
+   struct tag_mem_range *tmp;
+   tmp = (*b)->next;
+   (*b)->next = *a;
+   *a = *b;
+   *b = tmp;
+   done = 0;
+   }
+   a = &(*a)->next;
+   b = &(*a)->next;
+   }
+   } while (!done);
+}
+
+/*
+ * Find a free memory region large enough for storing the
+ * bootmem bitmap.
+ */
+static unsigned long __init
+find_bootmap_pfn(const struct tag_mem_range *mem)
+{
+   unsigned long bootmap_pages, bootmap_len;
+   unsigned long node_pages = PFN_UP(mem->size);
+   unsigned long bootmap_addr = mem->addr;
+   struct tag_mem_range *reserved = mem_reserved;
+   struct tag_mem_range *ramdisk = mem_ramdisk;
+   unsigned long kern_start = __pa(_stext);
+   unsigned long kern_end = __pa(_end);
+
+   bootmap_pages = bootmem_bootmap_pages(node_pages);
+   bootmap_len = bootmap_pages << PAGE_SHIFT;
+
+   /*
+* Find a large enough region without reserved pages for
+* storing the bootmem bitmap. We can take advantage of the
+* fact that all lists have been sorted.
+*
+* We have to check explicitly reserved regions as well as the
+* kernel image and any RAMDISK images...
+*
+* Oh, and we have to make sure we don't overwrite the taglist
+* since we're going to use it until the bootmem allocator is
+* fully up and running.
+*/
+   while (1) {
+   if ((bootmap_addr < kern_end) &&
+   ((bootmap_addr + bootmap_len) > kern_start))
+   bootmap_addr = kern_end;
+
+   while (reserved &&
+  (bootmap_addr >= (reserved->addr + reserved->size)))
+   reserved = reserved->next;
+
+   if (reserved &&
+   ((bootmap_addr + bootmap_len) >= reserved->addr)) {
+   bootmap_addr = reserved->addr + reserved->size;
+   continue;
+   }
+
+   while (ramdisk &&
+  (bootmap_addr >= (ramdisk->addr + ramdisk->size)))
+   ramdisk = ramdisk->next;
+
+   if (!ramdisk ||
+   ((bootmap_addr + bootmap_len) < ramdisk->addr))
+   break;
+
+   bootmap_addr = ramdisk->addr + ramdisk->size;
+   }
+
+   if ((PFN_UP(bootmap_addr) + bootmap_len) >= (mem->addr + mem->size))
+   return ~0UL;
+
+   return PFN_UP(bootmap_addr);
+}
+
+static void __init setup_bootmem(void)
+{
+   unsigned bootmap_size;
+   unsigne

[AVR32] Simplify early handling of memory regions

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d8011768e6bdd0d9de5cc7bdbd3077b4b4fab8c7
Commit: d8011768e6bdd0d9de5cc7bdbd3077b4b4fab8c7
Parent: 5539f59ac40473730806580f212c4eac6e769f01
Author: Haavard Skinnemoen <[EMAIL PROTECTED]>
AuthorDate: Wed Mar 21 16:02:57 2007 +0100
Committer:  Haavard Skinnemoen <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 13:44:14 2007 +0200

[AVR32] Simplify early handling of memory regions

Use struct resource to specify both physical memory regions and
reserved regions and push everything into the same framework,
including kernel code/data and initrd memory. This allows us to get
rid of many special cases in the bootmem initialization and will also
make it easier to implement more robust handling of framebuffer
memory later.

Signed-off-by: Haavard Skinnemoen <[EMAIL PROTECTED]>
---
 arch/avr32/kernel/setup.c |  495 +
 include/asm-avr32/setup.h |   10 +-
 2 files changed, 234 insertions(+), 271 deletions(-)

diff --git a/arch/avr32/kernel/setup.c b/arch/avr32/kernel/setup.c
index 53a1ff0..d0a35a1 100644
--- a/arch/avr32/kernel/setup.c
+++ b/arch/avr32/kernel/setup.c
@@ -32,13 +32,6 @@
 extern int root_mountflags;
 
 /*
- * Bootloader-provided information about physical memory
- */
-struct tag_mem_range *mem_phys;
-struct tag_mem_range *mem_reserved;
-struct tag_mem_range *mem_ramdisk;
-
-/*
  * Initialize loops_per_jiffy as 500 (500MIPS).
  * Better make it too large than too small...
  */
@@ -50,32 +43,153 @@ EXPORT_SYMBOL(boot_cpu_data);
 static char __initdata command_line[COMMAND_LINE_SIZE];
 
 /*
- * Should be more than enough, but if you have a _really_ complex
- * setup, you might need to increase the size of this...
+ * Standard memory resources
  */
-static struct tag_mem_range __initdata mem_range_cache[32];
-static unsigned mem_range_next_free;
+static struct resource __initdata kernel_data = {
+   .name   = "Kernel data",
+   .start  = 0,
+   .end= 0,
+   .flags  = IORESOURCE_MEM,
+};
+static struct resource __initdata kernel_code = {
+   .name   = "Kernel code",
+   .start  = 0,
+   .end= 0,
+   .flags  = IORESOURCE_MEM,
+   .sibling = &kernel_data,
+};
 
 /*
- * Standard memory resources
+ * Available system RAM and reserved regions as singly linked
+ * lists. These lists are traversed using the sibling pointer in
+ * struct resource and are kept sorted at all times.
  */
-static struct resource mem_res[] = {
-   {
-   .name   = "Kernel code",
-   .start  = 0,
-   .end= 0,
-   .flags  = IORESOURCE_MEM
-   },
-   {
-   .name   = "Kernel data",
-   .start  = 0,
-   .end= 0,
-   .flags  = IORESOURCE_MEM,
-   },
-};
+static struct resource *__initdata system_ram;
+static struct resource *__initdata reserved = &kernel_code;
+
+/*
+ * We need to allocate these before the bootmem allocator is up and
+ * running, so we need this "cache". 32 entries are probably enough
+ * for all but the most insanely complex systems.
+ */
+static struct resource __initdata res_cache[32];
+static unsigned int __initdata res_cache_next_free;
+
+static void __init resource_init(void)
+{
+   struct resource *mem, *res;
+   struct resource *new;
+
+   kernel_code.start = __pa(init_mm.start_code);
+
+   for (mem = system_ram; mem; mem = mem->sibling) {
+   new = alloc_bootmem_low(sizeof(struct resource));
+   memcpy(new, mem, sizeof(struct resource));
+
+   new->sibling = NULL;
+   if (request_resource(&iomem_resource, new))
+   printk(KERN_WARNING "Bad RAM resource %08x-%08x\n",
+  mem->start, mem->end);
+   }
+
+   for (res = reserved; res; res = res->sibling) {
+   new = alloc_bootmem_low(sizeof(struct resource));
+   memcpy(new, res, sizeof(struct resource));
+
+   new->sibling = NULL;
+   if (insert_resource(&iomem_resource, new))
+   printk(KERN_WARNING
+  "Bad reserved resource %s (%08x-%08x)\n",
+  res->name, res->start, res->end);
+   }
+}
+
+static void __init
+add_physical_memory(resource_size_t start, resource_size_t end)
+{
+   struct resource *new, *next, **pprev;
+
+   for (pprev = &system_ram, next = system_ram; next;
+pprev = &next->sibling, next = next->sibling) {
+   if (end < next->start)
+   break;
+   if (start <= next->end) {
+   printk(KERN_WARNING
+  "Warning: Physical memory map is broken\n");
+   printk(KERN_WARNING
+  "Warning: %08x-%08x overlaps %08x-%08x\n",
+

[AVR32] Reserve framebuffer memory in early_parse_fbmem()

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f9692b9501c339ec90647d8cd6ee5c106f072f9f
Commit: f9692b9501c339ec90647d8cd6ee5c106f072f9f
Parent: d8011768e6bdd0d9de5cc7bdbd3077b4b4fab8c7
Author: Haavard Skinnemoen <[EMAIL PROTECTED]>
AuthorDate: Wed Mar 21 16:16:50 2007 +0100
Committer:  Haavard Skinnemoen <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 13:44:14 2007 +0200

[AVR32] Reserve framebuffer memory in early_parse_fbmem()

With the current strategy of using the bootmem allocator to allocate
or reserve framebuffer memory, there's a slight chance that the
requested area has been taken by the boot allocator bitmap before we
get around to reserving it.

By inserting the framebuffer region as a reserved region as early as
possible, we improve our chances for success and we make the region
visible as a reserved region in dmesg and /proc/iomem without any
extra work.

Signed-off-by: Haavard Skinnemoen <[EMAIL PROTECTED]>
---
 arch/avr32/kernel/setup.c |   68 
 1 files changed, 61 insertions(+), 7 deletions(-)

diff --git a/arch/avr32/kernel/setup.c b/arch/avr32/kernel/setup.c
index d0a35a1..1682e2d 100644
--- a/arch/avr32/kernel/setup.c
+++ b/arch/avr32/kernel/setup.c
@@ -191,21 +191,45 @@ find_free_region(const struct resource *mem, 
resource_size_t size,
return target;
 }
 
+static int __init
+alloc_reserved_region(resource_size_t *start, resource_size_t size,
+ resource_size_t align, const char *name)
+{
+   struct resource *mem;
+   resource_size_t target;
+   int ret;
+
+   for (mem = system_ram; mem; mem = mem->sibling) {
+   target = find_free_region(mem, size, align);
+   if (target <= mem->end) {
+   ret = add_reserved_region(target, target + size - 1,
+ name);
+   if (!ret)
+   *start = target;
+   return ret;
+   }
+   }
+
+   return -ENOMEM;
+}
+
 /*
  * Early framebuffer allocation. Works as follows:
  *   - If fbmem_size is zero, nothing will be allocated or reserved.
  *   - If fbmem_start is zero when setup_bootmem() is called,
- * fbmem_size bytes will be allocated from the bootmem allocator.
+ * a block of fbmem_size bytes will be reserved before bootmem
+ * initialization. It will be aligned to the largest page size
+ * that fbmem_size is a multiple of.
  *   - If fbmem_start is nonzero, an area of size fbmem_size will be
- * reserved at the physical address fbmem_start if necessary. If
- * the area isn't in a memory region known to the kernel, it will
- * be left alone.
+ * reserved at the physical address fbmem_start if possible. If
+ * it collides with other reserved memory, a different block of
+ * same size will be allocated, just as if fbmem_start was zero.
  *
  * Board-specific code may use these variables to set up platform data
  * for the framebuffer driver if fbmem_size is nonzero.
  */
-static unsigned long __initdata fbmem_start;
-static unsigned long __initdata fbmem_size;
+static resource_size_t __initdata fbmem_start;
+static resource_size_t __initdata fbmem_size;
 
 /*
  * "fbmem=xxx[kKmM]" allocates the specified amount of boot memory for
@@ -219,9 +243,39 @@ static unsigned long __initdata fbmem_size;
  */
 static int __init early_parse_fbmem(char *p)
 {
+   int ret;
+   unsigned long align;
+
fbmem_size = memparse(p, &p);
-   if (*p == '@')
+   if (*p == '@') {
fbmem_start = memparse(p, &p);
+   ret = add_reserved_region(fbmem_start,
+ fbmem_start + fbmem_size - 1,
+ "Framebuffer");
+   if (ret) {
+   printk(KERN_WARNING
+  "Failed to reserve framebuffer memory\n");
+   fbmem_start = 0;
+   }
+   }
+
+   if (!fbmem_start) {
+   if ((fbmem_size & 0x000fUL) == 0)
+   align = 0x10;   /* 1 MiB */
+   else if ((fbmem_size & 0xUL) == 0)
+   align = 0x1;/* 64 KiB */
+   else
+   align = 0x1000; /* 4 KiB */
+
+   ret = alloc_reserved_region(&fbmem_start, fbmem_size,
+   align, "Framebuffer");
+   if (ret) {
+   printk(KERN_WARNING
+  "Failed to allocate framebuffer memory\n");
+   fbmem_size = 0;
+   }
+   }
+
return 0;
 }
 early_param("fbmem", early_parse_fbmem);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of

[AVR32] Get rid of board_setup_fbmem()

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d80e2bb12606906fd0b5b5592f519852de8b0113
Commit: d80e2bb12606906fd0b5b5592f519852de8b0113
Parent: f9692b9501c339ec90647d8cd6ee5c106f072f9f
Author: Haavard Skinnemoen <[EMAIL PROTECTED]>
AuthorDate: Wed Mar 21 16:23:41 2007 +0100
Committer:  Haavard Skinnemoen <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 13:44:15 2007 +0200

[AVR32] Get rid of board_setup_fbmem()

Since the core setup code takes care of both allocation and
reservation of framebuffer memory, there's no need for this board-
specific hook anymore. Replace it with two global variables,
fbmem_start and fbmem_size, which can be used directly.

Signed-off-by: Haavard Skinnemoen <[EMAIL PROTECTED]>
---
 arch/avr32/boards/atstk1000/atstk1002.c |4 +++-
 arch/avr32/boards/atstk1000/setup.c |   30 --
 arch/avr32/kernel/setup.c   |7 ++-
 include/asm-avr32/setup.h   |4 ++--
 4 files changed, 7 insertions(+), 38 deletions(-)

diff --git a/arch/avr32/boards/atstk1000/atstk1002.c 
b/arch/avr32/boards/atstk1000/atstk1002.c
index 5974768..abe6ca2 100644
--- a/arch/avr32/boards/atstk1000/atstk1002.c
+++ b/arch/avr32/boards/atstk1000/atstk1002.c
@@ -33,7 +33,7 @@ struct eth_addr {
 static struct eth_addr __initdata hw_addr[2];
 
 static struct eth_platform_data __initdata eth_data[2];
-extern struct lcdc_platform_data atstk1000_fb0_data;
+static struct lcdc_platform_data atstk1000_fb0_data;
 
 static struct spi_board_info spi0_board_info[] __initdata = {
{
@@ -148,6 +148,8 @@ static int __init atstk1002_init(void)
set_hw_addr(at32_add_device_eth(0, ð_data[0]));
 
at32_add_device_spi(0, spi0_board_info, ARRAY_SIZE(spi0_board_info));
+   atstk1000_fb0_data.fbmem_start = fbmem_start;
+   atstk1000_fb0_data.fbmem_size = fbmem_size;
at32_add_device_lcdc(0, &atstk1000_fb0_data);
 
return 0;
diff --git a/arch/avr32/boards/atstk1000/setup.c 
b/arch/avr32/boards/atstk1000/setup.c
index 272c011..2bc4b88 100644
--- a/arch/avr32/boards/atstk1000/setup.c
+++ b/arch/avr32/boards/atstk1000/setup.c
@@ -18,33 +18,3 @@
 
 /* Initialized by bootloader-specific startup code. */
 struct tag *bootloader_tags __initdata;
-
-struct lcdc_platform_data __initdata atstk1000_fb0_data;
-
-void __init board_setup_fbmem(unsigned long fbmem_start,
- unsigned long fbmem_size)
-{
-   if (!fbmem_size)
-   return;
-
-   if (!fbmem_start) {
-   void *fbmem;
-
-   fbmem = alloc_bootmem_low_pages(fbmem_size);
-   fbmem_start = __pa(fbmem);
-   } else {
-   pg_data_t *pgdat;
-
-   for_each_online_pgdat(pgdat) {
-   if (fbmem_start >= pgdat->bdata->node_boot_start
-   && fbmem_start <= pgdat->bdata->node_low_pfn)
-   reserve_bootmem_node(pgdat, fbmem_start,
-fbmem_size);
-   }
-   }
-
-   printk("%luKiB framebuffer memory at address 0x%08lx\n",
-  fbmem_size >> 10, fbmem_start);
-   atstk1000_fb0_data.fbmem_start = fbmem_start;
-   atstk1000_fb0_data.fbmem_size = fbmem_size;
-}
diff --git a/arch/avr32/kernel/setup.c b/arch/avr32/kernel/setup.c
index 1682e2d..b279d66 100644
--- a/arch/avr32/kernel/setup.c
+++ b/arch/avr32/kernel/setup.c
@@ -228,8 +228,8 @@ alloc_reserved_region(resource_size_t *start, 
resource_size_t size,
  * Board-specific code may use these variables to set up platform data
  * for the framebuffer driver if fbmem_size is nonzero.
  */
-static resource_size_t __initdata fbmem_start;
-static resource_size_t __initdata fbmem_size;
+resource_size_t __initdata fbmem_start;
+resource_size_t __initdata fbmem_size;
 
 /*
  * "fbmem=xxx[kKmM]" allocates the specified amount of boot memory for
@@ -561,13 +561,10 @@ void __init setup_arch (char **cmdline_p)
 
setup_bootmem();
 
-   board_setup_fbmem(fbmem_start, fbmem_size);
-
 #ifdef CONFIG_VT
conswitchp = &dummy_con;
 #endif
 
paging_init();
-
resource_init();
 }
diff --git a/include/asm-avr32/setup.h b/include/asm-avr32/setup.h
index bca2ee1..1ff1a21 100644
--- a/include/asm-avr32/setup.h
+++ b/include/asm-avr32/setup.h
@@ -126,10 +126,10 @@ struct tagtable {
 
 extern struct tag *bootloader_tags;
 
+extern resource_size_t fbmem_start;
+extern resource_size_t fbmem_size;
 
 void setup_processor(void);
-extern void board_setup_fbmem(unsigned long fbmem_start,
- unsigned long fbmem_size);
 
 #endif /* !__ASSEMBLY__ */
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[AVR32] Use memcpy/memset in memcpy_{from,to}_io and memset_io

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2c1a2a3441a754a9b5a8e7184071154f8a9bd61b
Commit: 2c1a2a3441a754a9b5a8e7184071154f8a9bd61b
Parent: d80e2bb12606906fd0b5b5592f519852de8b0113
Author: Haavard Skinnemoen <[EMAIL PROTECTED]>
AuthorDate: Wed Mar 7 10:40:44 2007 +0100
Committer:  Haavard Skinnemoen <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 13:44:15 2007 +0200

[AVR32] Use memcpy/memset in memcpy_{from,to}_io and memset_io

Using readb/writeb to implement these breaks NOR flash support. I
can't see any reason why regular memcpy and memset shouldn't work.

Signed-off-by: Haavard Skinnemoen <[EMAIL PROTECTED]>
---
 include/asm-avr32/io.h |   17 +++--
 1 files changed, 3 insertions(+), 14 deletions(-)

diff --git a/include/asm-avr32/io.h b/include/asm-avr32/io.h
index 27b1523..e30d4b3 100644
--- a/include/asm-avr32/io.h
+++ b/include/asm-avr32/io.h
@@ -240,30 +240,19 @@ BUILDSTRING(l, u32)
 static inline void memcpy_fromio(void * to, const volatile void __iomem *from,
 unsigned long count)
 {
-   char *p = to;
-   volatile const char __iomem *addr = from;
-
-   while (count--)
-   *p++ = readb(addr++);
+   memcpy(to, (const void __force *)from, count);
 }
 
 static inline void  memcpy_toio(volatile void __iomem *to, const void * from,
unsigned long count)
 {
-   const char *p = from;
-   volatile char __iomem *addr = to;
-
-   while (count--)
-   writeb(*p++, addr++);
+   memcpy((void __force *)to, from, count);
 }
 
 static inline void memset_io(volatile void __iomem *addr, unsigned char val,
 unsigned long count)
 {
-   volatile char __iomem *p = addr;
-
-   while (count--)
-   writeb(val, p++);
+   memset((void __force *)addr, val, count);
 }
 
 #define IO_SPACE_LIMIT 0x
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[AVR32] Make I/O access macros work with external devices

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e3e7d8d4ea37b8372ee417452d03171c5dc55125
Commit: e3e7d8d4ea37b8372ee417452d03171c5dc55125
Parent: 92b728c147adb8c690b520304f4c9ee3eee43c21
Author: Haavard Skinnemoen <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 12 16:28:56 2007 +0100
Committer:  Haavard Skinnemoen <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 13:44:14 2007 +0200

[AVR32] Make I/O access macros work with external devices

Fix the I/O access macros so that they work with externally connected
devices accessed in little-endian mode over any bus width:

* Use a set of macros to define I/O port- and memory operations
  borrowed from MIPS.
* Allow subarchitecture to specify address- and data-mangling
* Implement at32ap-specific port mangling (with build-time
  configurable bus width. Only one bus width at a time supported
  for now.)
* Rewrite iowriteN and friends to use write[bwl] and friends
  (not the __raw counterparts.)

This has been tested using pata_pcmcia to access a CompactFlash card
connected to the EBI (16-bit bus width.)

Signed-off-by: Haavard Skinnemoen <[EMAIL PROTECTED]>
---
 arch/avr32/mach-at32ap/Kconfig |   26 +++-
 include/asm-avr32/arch-at32ap/io.h |   39 
 include/asm-avr32/io.h |  335 
 3 files changed, 247 insertions(+), 153 deletions(-)

diff --git a/arch/avr32/mach-at32ap/Kconfig b/arch/avr32/mach-at32ap/Kconfig
index d749771..eb30783 100644
--- a/arch/avr32/mach-at32ap/Kconfig
+++ b/arch/avr32/mach-at32ap/Kconfig
@@ -2,6 +2,30 @@ if PLATFORM_AT32AP
 
 menu "Atmel AVR32 AP options"
 
+choice
+   prompt "AT32AP7000 static memory bus width"
+   depends on CPU_AT32AP7000
+   default AP7000_16_BIT_SMC
+   help
+ Define the width of the AP7000 external static memory interface.
+ This is used to determine how to mangle the address and/or data
+ when doing little-endian port access.
+
+ The current code can only support a single external memory bus
+ width for all chip selects, excluding the flash (which is using
+ raw access and is thus not affected by any of this.)
+
+config AP7000_32_BIT_SMC
+   bool "32 bit"
+
+config AP7000_16_BIT_SMC
+   bool "16 bit"
+
+config AP7000_8_BIT_SMC
+   bool "8 bit"
+
+endchoice
+
 endmenu
 
-endif
+endif # PLATFORM_AT32AP
diff --git a/include/asm-avr32/arch-at32ap/io.h 
b/include/asm-avr32/arch-at32ap/io.h
new file mode 100644
index 000..ee59e40
--- /dev/null
+++ b/include/asm-avr32/arch-at32ap/io.h
@@ -0,0 +1,39 @@
+#ifndef __ASM_AVR32_ARCH_AT32AP_IO_H
+#define __ASM_AVR32_ARCH_AT32AP_IO_H
+
+/* For "bizarre" halfword swapping */
+#include 
+
+#if defined(CONFIG_AP7000_32_BIT_SMC)
+# define __swizzle_addr_b(addr)(addr ^ 3UL)
+# define __swizzle_addr_w(addr)(addr ^ 2UL)
+# define __swizzle_addr_l(addr)(addr)
+# define ioswabb(a, x) (x)
+# define ioswabw(a, x) (x)
+# define ioswabl(a, x) (x)
+# define __mem_ioswabb(a, x)   (x)
+# define __mem_ioswabw(a, x)   swab16(x)
+# define __mem_ioswabl(a, x)   swab32(x)
+#elif defined(CONFIG_AP7000_16_BIT_SMC)
+# define __swizzle_addr_b(addr)(addr ^ 1UL)
+# define __swizzle_addr_w(addr)(addr)
+# define __swizzle_addr_l(addr)(addr)
+# define ioswabb(a, x) (x)
+# define ioswabw(a, x) (x)
+# define ioswabl(a, x) swahw32(x)
+# define __mem_ioswabb(a, x)   (x)
+# define __mem_ioswabw(a, x)   swab16(x)
+# define __mem_ioswabl(a, x)   swahb32(x)
+#else
+# define __swizzle_addr_b(addr)(addr)
+# define __swizzle_addr_w(addr)(addr)
+# define __swizzle_addr_l(addr)(addr)
+# define ioswabb(a, x) (x)
+# define ioswabw(a, x) swab16(x)
+# define ioswabl(a, x) swab32(x)
+# define __mem_ioswabb(a, x)   (x)
+# define __mem_ioswabw(a, x)   (x)
+# define __mem_ioswabl(a, x)   (x)
+#endif
+
+#endif /* __ASM_AVR32_ARCH_AT32AP_IO_H */
diff --git a/include/asm-avr32/io.h b/include/asm-avr32/io.h
index c08e810..27b1523 100644
--- a/include/asm-avr32/io.h
+++ b/include/asm-avr32/io.h
@@ -1,13 +1,15 @@
 #ifndef __ASM_AVR32_IO_H
 #define __ASM_AVR32_IO_H
 
+#include 
 #include 
-
-#ifdef __KERNEL__
+#include 
 
 #include 
 #include 
 
+#include 
+
 /* virt_to_phys will only work when address is in P1 or P2 */
 static __inline__ unsigned long virt_to_phys(volatile void *address)
 {
@@ -36,204 +38,235 @@ extern void __raw_readsb(const void __iomem *addr, void 
*data, int bytelen);
 extern void __raw_readsw(const void __iomem *addr, void *data, int wordlen);
 extern void __raw_readsl(const void __iomem *addr, void *data, int longlen);
 
-static inline void writeb(unsigned char b, volatile void __iomem *addr)
+static inline void __raw_writeb(u8 v, volatile void __iomem *addr)
 {
-   *(volatile unsigned char __force *)addr = b;
+   *(vol

[AVR32] Board code for ATNGW100

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9ca20a8366462c553c27216161c735937f9de108
Commit: 9ca20a8366462c553c27216161c735937f9de108
Parent: 2c1a2a3441a754a9b5a8e7184071154f8a9bd61b
Author: Haavard Skinnemoen <[EMAIL PROTECTED]>
AuthorDate: Thu Apr 12 17:26:57 2007 +0200
Committer:  Haavard Skinnemoen <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 13:44:15 2007 +0200

[AVR32] Board code for ATNGW100

Add board code and defconfig for the ATNGW100 Network Gateway kit.
For more information about this board, see

http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4102

Signed-off-by: Haavard Skinnemoen <[EMAIL PROTECTED]>
---
 arch/avr32/Kconfig|3 +
 arch/avr32/Makefile   |1 +
 arch/avr32/boards/atngw100/Makefile   |1 +
 arch/avr32/boards/atngw100/flash.c|   95 +++
 arch/avr32/boards/atngw100/setup.c|  124 
 arch/avr32/configs/atngw100_defconfig | 1085 +
 6 files changed, 1309 insertions(+), 0 deletions(-)

diff --git a/arch/avr32/Kconfig b/arch/avr32/Kconfig
index 7a1eb44..50fee54 100644
--- a/arch/avr32/Kconfig
+++ b/arch/avr32/Kconfig
@@ -111,6 +111,9 @@ choice
 config BOARD_ATSTK1000
bool "ATSTK1000 evaluation board"
select BOARD_ATSTK1002 if CPU_AT32AP7000
+
+config BOARD_ATNGW100
+   bool "ATNGW100 Network Gateway"
 endchoice
 
 choice
diff --git a/arch/avr32/Makefile b/arch/avr32/Makefile
index 7b842e9..6115fc1 100644
--- a/arch/avr32/Makefile
+++ b/arch/avr32/Makefile
@@ -27,6 +27,7 @@ head-$(CONFIG_LOADER_U_BOOT)  += 
arch/avr32/boot/u-boot/head.o
 head-y += arch/avr32/kernel/head.o
 core-$(CONFIG_PLATFORM_AT32AP) += arch/avr32/mach-at32ap/
 core-$(CONFIG_BOARD_ATSTK1000) += arch/avr32/boards/atstk1000/
+core-$(CONFIG_BOARD_ATNGW100)  += arch/avr32/boards/atngw100/
 core-$(CONFIG_LOADER_U_BOOT)   += arch/avr32/boot/u-boot/
 core-y += arch/avr32/kernel/
 core-y += arch/avr32/mm/
diff --git a/arch/avr32/boards/atngw100/Makefile 
b/arch/avr32/boards/atngw100/Makefile
new file mode 100644
index 000..c740aa1
--- /dev/null
+++ b/arch/avr32/boards/atngw100/Makefile
@@ -0,0 +1 @@
+obj-y  += setup.o flash.o
diff --git a/arch/avr32/boards/atngw100/flash.c 
b/arch/avr32/boards/atngw100/flash.c
new file mode 100644
index 000..f9b32a8
--- /dev/null
+++ b/arch/avr32/boards/atngw100/flash.c
@@ -0,0 +1,95 @@
+/*
+ * ATNGW100 board-specific flash initialization
+ *
+ * Copyright (C) 2005-2006 Atmel Corporation
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+static struct smc_config flash_config __initdata = {
+   .ncs_read_setup = 0,
+   .nrd_setup  = 40,
+   .ncs_write_setup= 0,
+   .nwe_setup  = 10,
+
+   .ncs_read_pulse = 80,
+   .nrd_pulse  = 40,
+   .ncs_write_pulse= 65,
+   .nwe_pulse  = 55,
+
+   .read_cycle = 120,
+   .write_cycle= 120,
+
+   .bus_width  = 2,
+   .nrd_controlled = 1,
+   .nwe_controlled = 1,
+   .byte_write = 1,
+};
+
+static struct mtd_partition flash_parts[] = {
+   {
+   .name   = "u-boot",
+   .offset = 0x,
+   .size   = 0x0002,   /* 128 KiB */
+   .mask_flags = MTD_WRITEABLE,
+   },
+   {
+   .name   = "root",
+   .offset = 0x0002,
+   .size   = 0x007d,
+   },
+   {
+   .name   = "env",
+   .offset = 0x007f,
+   .size   = 0x0001,
+   .mask_flags = MTD_WRITEABLE,
+   },
+};
+
+static struct physmap_flash_data flash_data = {
+   .width  = 2,
+   .nr_parts   = ARRAY_SIZE(flash_parts),
+   .parts  = flash_parts,
+};
+
+static struct resource flash_resource = {
+   .start  = 0x,
+   .end= 0x007f,
+   .flags  = IORESOURCE_MEM,
+};
+
+static struct platform_device flash_device = {
+   .name   = "physmap-flash",
+   .id = 0,
+   .resource   = &flash_resource,
+   .num_resources  = 1,
+   .dev= {
+   .platform_data = &flash_data,
+   },
+};
+
+/* This needs to be called after the SMC has been initialized */
+static int __init atngw100_flash_init(void)
+{
+   int ret;
+
+   ret = smc_set_

[AVR32] Optimize the TLB miss handler

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c0c3e81608fc300027f2131e351e67ab118cf24c
Commit: c0c3e81608fc300027f2131e351e67ab118cf24c
Parent: 9ca20a8366462c553c27216161c735937f9de108
Author: Haavard Skinnemoen <[EMAIL PROTECTED]>
AuthorDate: Wed Mar 14 13:59:13 2007 +0100
Committer:  Haavard Skinnemoen <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 13:44:15 2007 +0200

[AVR32] Optimize the TLB miss handler

Reorder some instructions and change the register usage to reduce
the number of pipeline stalls. Also use the bfextu and bfins
instructions for bitfield manipulations instead of shifting and
masking.

This makes gzipping a 80MB file approximately 2% faster.

Signed-off-by: Haavard Skinnemoen <[EMAIL PROTECTED]>
---
 arch/avr32/kernel/entry-avr32b.S |   54 +-
 1 files changed, 24 insertions(+), 30 deletions(-)

diff --git a/arch/avr32/kernel/entry-avr32b.S b/arch/avr32/kernel/entry-avr32b.S
index 484e083..42657f1 100644
--- a/arch/avr32/kernel/entry-avr32b.S
+++ b/arch/avr32/kernel/entry-avr32b.S
@@ -100,55 +100,49 @@ dtlb_miss_write:
 
.global tlb_miss_common
 tlb_miss_common:
-   mfsrr0, SYSREG_PTBR
-   mfsrr1, SYSREG_TLBEAR
+   mfsrr0, SYSREG_TLBEAR
+   mfsrr1, SYSREG_PTBR
 
/* Is it the vmalloc space? */
-   bld r1, 31
+   bld r0, 31
brcshandle_vmalloc_miss
 
/* First level lookup */
 pgtbl_lookup:
-   lsr r2, r1, PGDIR_SHIFT
-   ld.wr0, r0[r2 << 2]
-   bld r0, _PAGE_BIT_PRESENT
+   lsr r2, r0, PGDIR_SHIFT
+   ld.wr3, r1[r2 << 2]
+   bfextu  r1, r0, PAGE_SHIFT, PGDIR_SHIFT - PAGE_SHIFT
+   bld r3, _PAGE_BIT_PRESENT
brccpage_table_not_present
 
-   /* TODO: Check access rights on page table if necessary */
-
/* Translate to virtual address in P1. */
-   andlr0, 0xf000
-   sbr r0, 31
+   andlr3, 0xf000
+   sbr r3, 31
 
/* Second level lookup */
-   lsl r1, (32 - PGDIR_SHIFT)
-   lsr r1, (32 - PGDIR_SHIFT) + PAGE_SHIFT
-   add r2, r0, r1 << 2
-   ld.wr1, r2[0]
-   bld r1, _PAGE_BIT_PRESENT
+   ld.wr2, r3[r1 << 2]
+   mfsrr0, SYSREG_TLBARLO
+   bld r2, _PAGE_BIT_PRESENT
brccpage_not_present
 
/* Mark the page as accessed */
-   sbr r1, _PAGE_BIT_ACCESSED
-   st.wr2[0], r1
+   sbr r2, _PAGE_BIT_ACCESSED
+   st.wr3[r1 << 2], r2
 
/* Drop software flags */
-   andlr1, _PAGE_FLAGS_HARDWARE_MASK & 0x
-   mtsrSYSREG_TLBELO, r1
+   andlr2, _PAGE_FLAGS_HARDWARE_MASK & 0x
+   mtsrSYSREG_TLBELO, r2
 
/* Figure out which entry we want to replace */
-   mfsrr0, SYSREG_TLBARLO
+   mfsrr1, SYSREG_MMUCR
clz r2, r0
brcc1f
-   mov r1, -1  /* All entries have been accessed, */
-   mtsrSYSREG_TLBARLO, r1  /* so reset TLBAR */
-   mov r2, 0   /* and start at 0 */
-1: mfsrr1, SYSREG_MMUCR
-   lsl r2, 14
-   andlr1, 0x3fff, COH
-   or  r1, r2
-   mtsrSYSREG_MMUCR, r1
+   mov r3, -1  /* All entries have been accessed, */
+   mov r2, 0   /* so start at 0 */
+   mtsrSYSREG_TLBARLO, r3  /* and reset TLBAR */
 
+1: bfins   r1, r2, SYSREG_DRP_OFFSET, SYSREG_DRP_SIZE
+   mtsrSYSREG_MMUCR, r1
tlbw
 
tlbmiss_restore
@@ -156,8 +150,8 @@ pgtbl_lookup:
 
 handle_vmalloc_miss:
/* Simply do the lookup in init's page table */
-   mov r0, lo(swapper_pg_dir)
-   orh r0, hi(swapper_pg_dir)
+   mov r1, lo(swapper_pg_dir)
+   orh r1, hi(swapper_pg_dir)
rjmppgtbl_lookup
 
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


AVR32: Remove useless config option "GENERIC_BUST_SPINLOCK".

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0277b378c3779e3c8a413afb7d4ee00fa24a5a26
Commit: 0277b378c3779e3c8a413afb7d4ee00fa24a5a26
Parent: c0c3e81608fc300027f2131e351e67ab118cf24c
Author: Robert P. J. Day <[EMAIL PROTECTED]>
AuthorDate: Thu Apr 26 08:53:38 2007 -0400
Committer:  Haavard Skinnemoen <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 13:45:26 2007 +0200

AVR32: Remove useless config option "GENERIC_BUST_SPINLOCK".

Remove the clearly useless config option GENERIC_BUST_SPINLOCK, which
is not used anywhere in the tree.

Signed-off-by: Robert P. J. Day <[EMAIL PROTECTED]>
Signed-off-by: Haavard Skinnemoen <[EMAIL PROTECTED]>
---
 arch/avr32/Kconfig |3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/arch/avr32/Kconfig b/arch/avr32/Kconfig
index 50fee54..3ec7658 100644
--- a/arch/avr32/Kconfig
+++ b/arch/avr32/Kconfig
@@ -57,9 +57,6 @@ config ARCH_HAS_ILOG2_U64
bool
default n
 
-config GENERIC_BUST_SPINLOCK
-   bool
-
 config GENERIC_HWEIGHT
bool
default y
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


avr32: remove unneeded cast in atomic.h

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a4022b0d6005b117a985cec64559e048981a4244
Commit: a4022b0d6005b117a985cec64559e048981a4244
Parent: 0277b378c3779e3c8a413afb7d4ee00fa24a5a26
Author: Mathieu Desnoyers <[EMAIL PROTECTED]>
AuthorDate: Tue Apr 10 18:23:09 2007 -0400
Committer:  Haavard Skinnemoen <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 13:54:02 2007 +0200

avr32: remove unneeded cast in atomic.h

This int cast is superfluous since system.h cmpxchg already casts it in
(typeof(*(ptr))).

Signed-off-by: Mathieu Desnoyers <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Haavard Skinnemoen <[EMAIL PROTECTED]>
---
 include/asm-avr32/atomic.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/asm-avr32/atomic.h b/include/asm-avr32/atomic.h
index c40b603..b9c2548 100644
--- a/include/asm-avr32/atomic.h
+++ b/include/asm-avr32/atomic.h
@@ -173,7 +173,7 @@ static inline int atomic_sub_if_positive(int i, atomic_t *v)
 }
 
 #define atomic_xchg(v, new)(xchg(&((v)->counter), new))
-#define atomic_cmpxchg(v, o, n)((int)cmpxchg(&((v)->counter), (o), 
(n)))
+#define atomic_cmpxchg(v, o, n)(cmpxchg(&((v)->counter), (o), (n)))
 
 #define atomic_sub(i, v)   (void)atomic_sub_return(i, v)
 #define atomic_add(i, v)   (void)atomic_add_return(i, v)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[AVR32] Fix compile error with gcc 4.1

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8224ca195874525533665bbcd23b6da1e575aa4d
Commit: 8224ca195874525533665bbcd23b6da1e575aa4d
Parent: a4022b0d6005b117a985cec64559e048981a4244
Author: Haavard Skinnemoen <[EMAIL PROTECTED]>
AuthorDate: Fri Apr 27 14:21:47 2007 +0200
Committer:  Haavard Skinnemoen <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 14:21:47 2007 +0200

[AVR32] Fix compile error with gcc 4.1

gcc 4.1 doesn't seem to like const variables as inline assembly
outputs. Drop support for reading 64-bit values using get_user() so
that we can use an unsigned long to hold the result regardless of the
actual size. This should be safe since many architectures, including
i386, doesn't support reading 64-bit values with get_user().

Signed-off-by: Haavard Skinnemoen <[EMAIL PROTECTED]>
---
 include/asm-avr32/uaccess.h |   13 -
 1 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/include/asm-avr32/uaccess.h b/include/asm-avr32/uaccess.h
index 74a679e..ed09239 100644
--- a/include/asm-avr32/uaccess.h
+++ b/include/asm-avr32/uaccess.h
@@ -181,24 +181,23 @@ extern int __put_user_bad(void);
 
 #define __get_user_nocheck(x, ptr, size)   \
 ({ \
-   typeof(*(ptr)) __gu_val = (typeof(*(ptr)) __force)0;\
+   unsigned long __gu_val = 0; \
int __gu_err = 0;   \
\
switch (size) { \
case 1: __get_user_asm("ub", __gu_val, ptr, __gu_err); break;   \
case 2: __get_user_asm("uh", __gu_val, ptr, __gu_err); break;   \
case 4: __get_user_asm("w", __gu_val, ptr, __gu_err); break;\
-   case 8: __get_user_asm("d", __gu_val, ptr, __gu_err); break;\
default: __gu_err = __get_user_bad(); break;\
}   \
\
-   x = __gu_val;   \
+   x = (typeof(*(ptr)))__gu_val;   \
__gu_err;   \
 })
 
 #define __get_user_check(x, ptr, size) \
 ({ \
-   typeof(*(ptr)) __gu_val = (typeof(*(ptr)) __force)0;\
+   unsigned long __gu_val = 0; \
const typeof(*(ptr)) __user * __gu_addr = (ptr);\
int __gu_err = 0;   \
\
@@ -216,10 +215,6 @@ extern int __put_user_bad(void);
__get_user_asm("w", __gu_val, __gu_addr,\
   __gu_err);   \
break;  \
-   case 8: \
-   __get_user_asm("d", __gu_val, __gu_addr,\
-  __gu_err);   \
-   break;  \
default:\
__gu_err = __get_user_bad();\
break;  \
@@ -227,7 +222,7 @@ extern int __put_user_bad(void);
} else {\
__gu_err = -EFAULT; \
}   \
-   x = __gu_val;   \
+   x = (typeof(*(ptr)))__gu_val;   \
__gu_err;   \
 })
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[S390] memory detection: stop at first memory hole.

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=29c380f5f06d0c5a320b9bb6f8987065e7b81c91
Commit: 29c380f5f06d0c5a320b9bb6f8987065e7b81c91
Parent: de46c33745f5e2ad594c72f2cf5f490861b16ce1
Author: Heiko Carstens <[EMAIL PROTECTED]>
AuthorDate: Fri Apr 27 16:01:04 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:01:12 2007 +0200

[S390] memory detection: stop at first memory hole.

If both sclp and diag memory detection don't work stop at the first
memory hole. Otherwise the code might loop forever...

Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
Signed-off-by: Heiko Carstens <[EMAIL PROTECTED]>
---
 arch/s390/kernel/early.c |7 +++
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c
index 5e47936..50538e5 100644
--- a/arch/s390/kernel/early.c
+++ b/arch/s390/kernel/early.c
@@ -253,11 +253,10 @@ static noinline __init void find_memory_chunks(unsigned 
long memsize)
break;
 #endif
/*
-* Finish memory detection at the first hole, unless
-* - we reached the hsa -> skip it.
-* - we know there must be more.
+* Finish memory detection at the first hole
+* if storage size is unknown.
 */
-   if (cc == -1UL && !memsize && old_addr != ADDR2G)
+   if (cc == -1UL && !memsize)
break;
if (memsize && addr >= memsize)
break;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[S390] cio/ipl: Clean interface between cio and ipl code.

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6fc321fd7dd91f0592f37503219196835314fbb7
Commit: 6fc321fd7dd91f0592f37503219196835314fbb7
Parent: 29c380f5f06d0c5a320b9bb6f8987065e7b81c91
Author: Heiko Carstens <[EMAIL PROTECTED]>
AuthorDate: Fri Apr 27 16:01:25 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:01:38 2007 +0200

[S390] cio/ipl: Clean interface between cio and ipl code.

Clean interface between cio and ipl code, so Peter stops complaining.

Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
Signed-off-by: Heiko Carstens <[EMAIL PROTECTED]>
---
 arch/s390/kernel/ipl.c |   23 ++-
 drivers/s390/cio/cio.c |   38 ++
 include/asm-s390/cio.h |7 +++
 include/asm-s390/ipl.h |3 +--
 4 files changed, 40 insertions(+), 31 deletions(-)

diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c
index f731185..a83cf1f 100644
--- a/arch/s390/kernel/ipl.c
+++ b/arch/s390/kernel/ipl.c
@@ -47,7 +47,7 @@ enum ipl_type {
  * Must be in data section since the bss section
  * is not cleared when these are accessed.
  */
-u16 ipl_devno __attribute__((__section__(".data"))) = 0;
+static u16 ipl_devno __attribute__((__section__(".data"))) = 0;
 u32 ipl_flags __attribute__((__section__(".data"))) = 0;
 
 static char *ipl_type_str(enum ipl_type type)
@@ -1038,6 +1038,27 @@ static int __init s390_ipl_init(void)
 
 __initcall(s390_ipl_init);
 
+void __init ipl_save_parameters(void)
+{
+   struct cio_iplinfo iplinfo;
+   unsigned int *ipl_ptr;
+   void *src, *dst;
+
+   if (cio_get_iplinfo(&iplinfo))
+   return;
+
+   ipl_devno = iplinfo.devno;
+   ipl_flags |= IPL_DEVNO_VALID;
+   if (!iplinfo.is_qdio)
+   return;
+   ipl_flags |= IPL_PARMBLOCK_VALID;
+   ipl_ptr = (unsigned int *)__LC_IPL_PARMBLOCK_PTR;
+   src = (void *)(unsigned long)*ipl_ptr;
+   dst = (void *)IPL_PARMBLOCK_ORIGIN;
+   memmove(dst, src, PAGE_SIZE);
+   *ipl_ptr = IPL_PARMBLOCK_ORIGIN;
+}
+
 static LIST_HEAD(rcall);
 static DEFINE_MUTEX(rcall_mutex);
 
diff --git a/drivers/s390/cio/cio.c b/drivers/s390/cio/cio.c
index 9cb129a..21af446 100644
--- a/drivers/s390/cio/cio.c
+++ b/drivers/s390/cio/cio.c
@@ -1048,37 +1048,19 @@ void reipl_ccw_dev(struct ccw_dev_id *devid)
do_reipl_asm(*((__u32*)&schid));
 }
 
-static struct schib __initdata ipl_schib;
-
-/*
- * ipl_save_parameters gets called very early. It is not allowed to access
- * anything in the bss section at all. The bss section is not cleared yet,
- * but may contain some ipl parameters written by the firmware.
- * These parameters (if present) are copied to 0x2000.
- * To avoid corruption of the ipl parameters, all variables used by this
- * function must reside on the stack or in the data section.
- */
-void ipl_save_parameters(void)
+int __init cio_get_iplinfo(struct cio_iplinfo *iplinfo)
 {
struct subchannel_id schid;
-   unsigned int *ipl_ptr;
-   void *src, *dst;
+   struct schib schib;
 
schid = *(struct subchannel_id *)__LC_SUBCHANNEL_ID;
if (!schid.one)
-   return;
-   if (stsch(schid, &ipl_schib))
-   return;
-   if (!ipl_schib.pmcw.dnv)
-   return;
-   ipl_devno = ipl_schib.pmcw.dev;
-   ipl_flags |= IPL_DEVNO_VALID;
-   if (!ipl_schib.pmcw.qf)
-   return;
-   ipl_flags |= IPL_PARMBLOCK_VALID;
-   ipl_ptr = (unsigned int *)__LC_IPL_PARMBLOCK_PTR;
-   src = (void *)(unsigned long)*ipl_ptr;
-   dst = (void *)IPL_PARMBLOCK_ORIGIN;
-   memmove(dst, src, PAGE_SIZE);
-   *ipl_ptr = IPL_PARMBLOCK_ORIGIN;
+   return -ENODEV;
+   if (stsch(schid, &schib))
+   return -ENODEV;
+   if (!schib.pmcw.dnv)
+   return -ENODEV;
+   iplinfo->devno = schib.pmcw.dev;
+   iplinfo->is_qdio = schib.pmcw.qf;
+   return 0;
 }
diff --git a/include/asm-s390/cio.h b/include/asm-s390/cio.h
index d927850..0db017b 100644
--- a/include/asm-s390/cio.h
+++ b/include/asm-s390/cio.h
@@ -292,6 +292,13 @@ extern void css_schedule_reprobe(void);
 
 extern void reipl_ccw_dev(struct ccw_dev_id *id);
 
+struct cio_iplinfo {
+   u16 devno;
+   int is_qdio;
+};
+
+extern int cio_get_iplinfo(struct cio_iplinfo *iplinfo);
+
 #endif
 
 #endif
diff --git a/include/asm-s390/ipl.h b/include/asm-s390/ipl.h
index 0eb6408..15bb0b5 100644
--- a/include/asm-s390/ipl.h
+++ b/include/asm-s390/ipl.h
@@ -74,10 +74,9 @@ struct ipl_parameter_block {
 } __attribute__((packed));
 
 /*
- * IPL validity flags and parameters as detected in head.S
+ * IPL validity flags
  */
 extern u32 ipl_flags;
-extern u16 ipl_devno;
 
 extern u32 dump_prefix_page;
 extern void do_reipl(void);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PRO

[S390] cio: Allow 0 and 1 as input for channel path status attribute.

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d120b2a4e60cc9e62e7cc5dcf049100af3745cc4
Commit: d120b2a4e60cc9e62e7cc5dcf049100af3745cc4
Parent: f86635fad14c4a6810cf0e08488fc9129a3b3b32
Author: Peter Oberparleiter <[EMAIL PROTECTED]>
AuthorDate: Fri Apr 27 16:01:27 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:01:38 2007 +0200

[S390] cio: Allow 0 and 1 as input for channel path status attribute.

Channel path status can now be modified by writing '0' and '1'
to the sysfs status attribute in addition to 'offline' and
'online' respectively.

Signed-off-by: Peter Oberparleiter <[EMAIL PROTECTED]>
Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
Signed-off-by: Heiko Carstens <[EMAIL PROTECTED]>
---
 drivers/s390/cio/chsc.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c
index bb6f876..b329851 100644
--- a/drivers/s390/cio/chsc.c
+++ b/drivers/s390/cio/chsc.c
@@ -1169,9 +1169,9 @@ chp_status_write(struct device *dev, struct 
device_attribute *attr, const char *
if (!num_args)
return count;
 
-   if (!strnicmp(cmd, "on", 2))
+   if (!strnicmp(cmd, "on", 2) || !strcmp(cmd, "1"))
error = s390_vary_chpid(cp->chpid, 1);
-   else if (!strnicmp(cmd, "off", 3))
+   else if (!strnicmp(cmd, "off", 3) || !strcmp(cmd, "0"))
error = s390_vary_chpid(cp->chpid, 0);
else
error = -EINVAL;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[S390] cio: Introduce struct chp_id.

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f86635fad14c4a6810cf0e08488fc9129a3b3b32
Commit: f86635fad14c4a6810cf0e08488fc9129a3b3b32
Parent: 6fc321fd7dd91f0592f37503219196835314fbb7
Author: Peter Oberparleiter <[EMAIL PROTECTED]>
AuthorDate: Fri Apr 27 16:01:26 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:01:38 2007 +0200

[S390] cio: Introduce struct chp_id.

Introduce data type for channel-path IDs.

Signed-off-by: Peter Oberparleiter <[EMAIL PROTECTED]>
Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
Signed-off-by: Heiko Carstens <[EMAIL PROTECTED]>
---
 drivers/s390/cio/chpid.h  |   51 
 drivers/s390/cio/chsc.c   |  178 ++--
 drivers/s390/cio/chsc.h   |8 ++-
 drivers/s390/cio/cio.c|5 +-
 drivers/s390/cio/device_fsm.c |6 +-
 drivers/s390/cio/ioasm.h  |5 +-
 6 files changed, 167 insertions(+), 86 deletions(-)

diff --git a/drivers/s390/cio/chpid.h b/drivers/s390/cio/chpid.h
new file mode 100644
index 000..44cc00e
--- /dev/null
+++ b/drivers/s390/cio/chpid.h
@@ -0,0 +1,51 @@
+/*
+ *  drivers/s390/cio/chpid.h
+ *
+ *Copyright IBM Corp. 2007
+ *Author(s): Peter Oberparleiter <[EMAIL PROTECTED]>
+ */
+
+#ifndef S390_CHP_ID_H
+#define S390_CHP_ID_H S390_CHP_ID_H
+
+#include 
+#include 
+#include "css.h"
+
+struct chp_id {
+   u8 reserved1;
+   u8 cssid;
+   u8 reserved2;
+   u8 id;
+} __attribute__((packed));
+
+static inline void chp_id_init(struct chp_id *chpid)
+{
+   memset(chpid, 0, sizeof(struct chp_id));
+}
+
+static inline int chp_id_is_equal(struct chp_id *a, struct chp_id *b)
+{
+   return (a->id == b->id) && (a->cssid == b->cssid);
+}
+
+static inline void chp_id_next(struct chp_id *chpid)
+{
+   if (chpid->id < __MAX_CHPID)
+   chpid->id++;
+   else {
+   chpid->id = 0;
+   chpid->cssid++;
+   }
+}
+
+static inline int chp_id_is_valid(struct chp_id *chpid)
+{
+   return (chpid->cssid <= __MAX_CSSID);
+}
+
+
+#define chp_id_for_each(c) \
+   for (chp_id_init(c); chp_id_is_valid(c); chp_id_next(c))
+
+#endif /* S390_CHP_ID_H */
diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c
index 6f05a44..bb6f876 100644
--- a/drivers/s390/cio/chsc.c
+++ b/drivers/s390/cio/chsc.c
@@ -20,43 +20,48 @@
 #include "cio.h"
 #include "cio_debug.h"
 #include "ioasm.h"
+#include "chpid.h"
 #include "chsc.h"
 
 static void *sei_page;
 
-static int new_channel_path(int chpid);
+static int new_channel_path(struct chp_id chpid);
 
-static inline void
-set_chp_logically_online(int chp, int onoff)
+static inline struct channel_path *chpid_to_chp(struct chp_id chpid)
 {
-   css[0]->chps[chp]->state = onoff;
+   return css[chpid.cssid]->chps[chpid.id];
 }
 
-static int
-get_chp_status(int chp)
+static void set_chp_logically_online(struct chp_id chpid, int onoff)
 {
-   return (css[0]->chps[chp] ? css[0]->chps[chp]->state : -ENODEV);
+   chpid_to_chp(chpid)->state = onoff;
 }
 
-void
-chsc_validate_chpids(struct subchannel *sch)
+static int get_chp_status(struct chp_id chpid)
+{
+   return (chpid_to_chp(chpid) ? chpid_to_chp(chpid)->state : -ENODEV);
+}
+
+void chsc_validate_chpids(struct subchannel *sch)
 {
int mask, chp;
+   struct chp_id chpid;
 
+   chp_id_init(&chpid);
for (chp = 0; chp <= 7; chp++) {
mask = 0x80 >> chp;
-   if (!get_chp_status(sch->schib.pmcw.chpid[chp]))
+   chpid.id = sch->schib.pmcw.chpid[chp];
+   if (!get_chp_status(chpid))
/* disable using this path */
sch->opm &= ~mask;
}
 }
 
-void
-chpid_is_actually_online(int chp)
+void chpid_is_actually_online(struct chp_id chpid)
 {
int state;
 
-   state = get_chp_status(chp);
+   state = get_chp_status(chpid);
if (state < 0) {
need_rescan = 1;
queue_work(slow_path_wq, &slow_path_work);
@@ -200,11 +205,14 @@ css_get_ssd_info(struct subchannel *sch)
spin_unlock_irq(sch->lock);
free_page((unsigned long)page);
if (!ret) {
-   int j, chpid, mask;
+   int j, mask;
+   struct chp_id chpid;
+
+   chp_id_init(&chpid);
/* Allocate channel path structures, if needed. */
for (j = 0; j < 8; j++) {
mask = 0x80 >> j;
-   chpid = sch->ssd_info.chpid[j];
+   chpid.id = sch->ssd_info.chpid[j];
if ((sch->schib.pmcw.pim & mask) &&
(get_chp_status(chpid) < 0))
new_channel_path(chpid);
@@ -227,7 +235,7 @@ s390_subchannel_remove_chpid(struct device *dev, void *data)
for (j = 0; j < 8; j++) {

[S390] cio: observe chpid valid flag

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c9182e0f42c5646e670c2166b6d6638052d574af
Commit: c9182e0f42c5646e670c2166b6d6638052d574af
Parent: e6b6e10ac1de116fc6d2288f185393014851cccf
Author: Peter Oberparleiter <[EMAIL PROTECTED]>
AuthorDate: Fri Apr 27 16:01:29 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:01:39 2007 +0200

[S390] cio: observe chpid valid flag

Check validity flag of CHPID description data before continuing with
channel-path initialization.

Signed-off-by: Peter Oberparleiter <[EMAIL PROTECTED]>
Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
---
 drivers/s390/cio/chp.c |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/s390/cio/chp.c b/drivers/s390/cio/chp.c
index 6e04521..8a58391 100644
--- a/drivers/s390/cio/chp.c
+++ b/drivers/s390/cio/chp.c
@@ -339,6 +339,10 @@ int chp_new(struct chp_id chpid)
ret = chsc_determine_channel_path_description(chpid, &chp->desc);
if (ret)
goto out_free;
+   if ((chp->desc.flags & 0x80) == 0) {
+   ret = -ENODEV;
+   goto out_free;
+   }
/* Get channel-measurement characteristics. */
if (css_characteristics_avail && css_chsc_characteristics.scmc
&& css_chsc_characteristics.secm) {
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[S390] cio: Introduce separate files for channel-path related code.

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e6b6e10ac1de116fc6d2288f185393014851cccf
Commit: e6b6e10ac1de116fc6d2288f185393014851cccf
Parent: d120b2a4e60cc9e62e7cc5dcf049100af3745cc4
Author: Peter Oberparleiter <[EMAIL PROTECTED]>
AuthorDate: Fri Apr 27 16:01:28 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:01:38 2007 +0200

[S390] cio: Introduce separate files for channel-path related code.

Signed-off-by: Peter Oberparleiter <[EMAIL PROTECTED]>
Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
Signed-off-by: Heiko Carstens <[EMAIL PROTECTED]>
---
 drivers/s390/cio/Makefile |2 +-
 drivers/s390/cio/chp.c|  433 +
 drivers/s390/cio/chp.h|   37 
 drivers/s390/cio/chsc.c   |  473 -
 drivers/s390/cio/chsc.h   |   28 +--
 drivers/s390/cio/cio.c|8 +-
 drivers/s390/cio/css.h|1 +
 drivers/s390/cio/device_fsm.c |6 +-
 drivers/s390/cio/device_ops.c |7 +-
 drivers/s390/s390mach.c   |1 +
 10 files changed, 534 insertions(+), 462 deletions(-)

diff --git a/drivers/s390/cio/Makefile b/drivers/s390/cio/Makefile
index c490c2a..fe7b3ff 100644
--- a/drivers/s390/cio/Makefile
+++ b/drivers/s390/cio/Makefile
@@ -2,7 +2,7 @@
 # Makefile for the S/390 common i/o drivers
 #
 
-obj-y += airq.o blacklist.o chsc.o cio.o css.o
+obj-y += airq.o blacklist.o chsc.o cio.o css.o chp.o
 ccw_device-objs += device.o device_fsm.o device_ops.o
 ccw_device-objs += device_id.o device_pgid.o device_status.o
 obj-y += ccw_device.o cmf.o
diff --git a/drivers/s390/cio/chp.c b/drivers/s390/cio/chp.c
new file mode 100644
index 000..6e04521
--- /dev/null
+++ b/drivers/s390/cio/chp.c
@@ -0,0 +1,433 @@
+/*
+ *  drivers/s390/cio/chp.c
+ *
+ *Copyright IBM Corp. 1999,2007
+ *Author(s): Cornelia Huck ([EMAIL PROTECTED])
+ *  Arnd Bergmann ([EMAIL PROTECTED])
+ *  Peter Oberparleiter <[EMAIL PROTECTED]>
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+#include "chpid.h"
+#include "cio.h"
+#include "css.h"
+#include "ioasm.h"
+#include "cio_debug.h"
+#include "chp.h"
+
+#define to_channelpath(device) container_of(device, struct channel_path, dev)
+
+/* Return channel_path struct for given chpid. */
+static inline struct channel_path *chpid_to_chp(struct chp_id chpid)
+{
+   return css[chpid.cssid]->chps[chpid.id];
+}
+
+/* Set vary state for given chpid. */
+static void set_chp_logically_online(struct chp_id chpid, int onoff)
+{
+   chpid_to_chp(chpid)->state = onoff;
+}
+
+/* On succes return 0 if channel-path is varied offline, 1 if it is varied
+ * online. Return -ENODEV if channel-path is not registered. */
+int chp_get_status(struct chp_id chpid)
+{
+   return (chpid_to_chp(chpid) ? chpid_to_chp(chpid)->state : -ENODEV);
+}
+
+/**
+ * chp_get_sch_opm - return opm for subchannel
+ * @sch: subchannel
+ *
+ * Calculate and return the operational path mask (opm) based on the chpids
+ * used by the subchannel and the status of the associated channel-paths.
+ */
+u8 chp_get_sch_opm(struct subchannel *sch)
+{
+   struct chp_id chpid;
+   int opm;
+   int i;
+
+   opm = 0;
+   chp_id_init(&chpid);
+   for (i=0; i < 8; i++) {
+   opm <<= 1;
+   chpid.id = sch->schib.pmcw.chpid[i];
+   if (chp_get_status(chpid) != 0)
+   opm |= 1;
+   }
+   return opm;
+}
+
+/**
+ * chp_is_registered - check if a channel-path is registered
+ * @chpid: channel-path ID
+ *
+ * Return non-zero if a channel-path with the given chpid is registered,
+ * zero otherwise.
+ */
+int chp_is_registered(struct chp_id chpid)
+{
+   return chpid_to_chp(chpid) != NULL;
+}
+
+/*
+ * Function: s390_vary_chpid
+ * Varies the specified chpid online or offline
+ */
+static int s390_vary_chpid(struct chp_id chpid, int on)
+{
+   char dbf_text[15];
+   int status;
+
+   sprintf(dbf_text, on?"varyon%x.%02x":"varyoff%x.%02x", chpid.cssid,
+   chpid.id);
+   CIO_TRACE_EVENT( 2, dbf_text);
+
+   status = chp_get_status(chpid);
+   if (status < 0) {
+   printk(KERN_ERR "Can't vary unknown chpid %x.%02x\n",
+  chpid.cssid, chpid.id);
+   return -EINVAL;
+   }
+
+   if (!on && !status) {
+   printk(KERN_ERR "chpid %x.%02x is already offline\n",
+  chpid.cssid, chpid.id);
+   return -EINVAL;
+   }
+
+   set_chp_logically_online(chpid, on);
+   chsc_chp_vary(chpid, on);
+   return 0;
+}
+
+/*
+ * Channel measurement related functions
+ */
+static ssize_t chp_measurement_chars_read(struct kobject *kobj, char *buf,
+ loff_t off, size_t count)
+{
+   struct channel_path *chp;
+   unsigned int size;
+
+ 

[S390] cio: Clean up online_store.

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f5ba6c863617c15d22cce5f8666ff4c832773025
Commit: f5ba6c863617c15d22cce5f8666ff4c832773025
Parent: c9182e0f42c5646e670c2166b6d6638052d574af
Author: Cornelia Huck <[EMAIL PROTECTED]>
AuthorDate: Fri Apr 27 16:01:30 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:01:39 2007 +0200

[S390] cio: Clean up online_store.

Detangle the online_store code and make it more readable.

Signed-off-by: Cornelia Huck <[EMAIL PROTECTED]>
Signed-off-by: Heiko Carstens <[EMAIL PROTECTED]>
Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
---
 drivers/s390/cio/device.c |  109 +---
 1 files changed, 62 insertions(+), 47 deletions(-)

diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c
index e322111..c3fc205 100644
--- a/drivers/s390/cio/device.c
+++ b/drivers/s390/cio/device.c
@@ -413,11 +413,60 @@ ccw_device_set_online(struct ccw_device *cdev)
return (ret == 0) ? -ENODEV : ret;
 }
 
-static ssize_t
-online_store (struct device *dev, struct device_attribute *attr, const char 
*buf, size_t count)
+static void online_store_handle_offline(struct ccw_device *cdev)
+{
+   if (cdev->private->state == DEV_STATE_DISCONNECTED)
+   ccw_device_remove_disconnected(cdev);
+   else if (cdev->drv && cdev->drv->set_offline)
+   ccw_device_set_offline(cdev);
+}
+
+static int online_store_recog_and_online(struct ccw_device *cdev)
+{
+   int ret;
+
+   /* Do device recognition, if needed. */
+   if (cdev->id.cu_type == 0) {
+   ret = ccw_device_recognition(cdev);
+   if (ret) {
+   printk(KERN_WARNING"Couldn't start recognition "
+  "for device %s (ret=%d)\n",
+  cdev->dev.bus_id, ret);
+   return ret;
+   }
+   wait_event(cdev->private->wait_q,
+  cdev->private->flags.recog_done);
+   }
+   if (cdev->drv && cdev->drv->set_online)
+   ccw_device_set_online(cdev);
+   return 0;
+}
+static void online_store_handle_online(struct ccw_device *cdev, int force)
+{
+   int ret;
+
+   ret = online_store_recog_and_online(cdev);
+   if (ret)
+   return;
+   if (force && cdev->private->state == DEV_STATE_BOXED) {
+   ret = ccw_device_stlck(cdev);
+   if (ret) {
+   printk(KERN_WARNING"ccw_device_stlck for device %s "
+  "returned %d!\n", cdev->dev.bus_id, ret);
+   return;
+   }
+   if (cdev->id.cu_type == 0)
+   cdev->private->state = DEV_STATE_NOT_OPER;
+   online_store_recog_and_online(cdev);
+   }
+
+}
+
+static ssize_t online_store (struct device *dev, struct device_attribute *attr,
+const char *buf, size_t count)
 {
struct ccw_device *cdev = to_ccwdev(dev);
-   int i, force, ret;
+   int i, force;
char *tmp;
 
if (atomic_cmpxchg(&cdev->private->onoff, 0, 1) != 0)
@@ -434,51 +483,17 @@ online_store (struct device *dev, struct device_attribute 
*attr, const char *buf
force = 0;
i = simple_strtoul(buf, &tmp, 16);
}
-   if (i == 1) {
-   /* Do device recognition, if needed. */
-   if (cdev->id.cu_type == 0) {
-   ret = ccw_device_recognition(cdev);
-   if (ret) {
-   printk(KERN_WARNING"Couldn't start recognition "
-  "for device %s (ret=%d)\n",
-  cdev->dev.bus_id, ret);
-   goto out;
-   }
-   wait_event(cdev->private->wait_q,
-  cdev->private->flags.recog_done);
-   }
-   if (cdev->drv && cdev->drv->set_online)
-   ccw_device_set_online(cdev);
-   } else if (i == 0) {
-   if (cdev->private->state == DEV_STATE_DISCONNECTED)
-   ccw_device_remove_disconnected(cdev);
-   else if (cdev->drv && cdev->drv->set_offline)
-   ccw_device_set_offline(cdev);
-   }
-   if (force && cdev->private->state == DEV_STATE_BOXED) {
-   ret = ccw_device_stlck(cdev);
-   if (ret) {
-   printk(KERN_WARNING"ccw_device_stlck for device %s "
-  "returned %d!\n", cdev->dev.bus_id, ret);
-   goto out;
-   }
-   /* Do device recognition, if needed. */
-   if (cdev->id.cu_type == 0) {
-   cdev->private->state = DEV_ST

[S390] cio: Re-start path verification after aborting internal I/O.

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=387b734fc2b55f776b192c7afdfd892ba42347d4
Commit: 387b734fc2b55f776b192c7afdfd892ba42347d4
Parent: cfbe9bb2fb5de1da58d351432a9465c22d6d3ee5
Author: Stefan Bader <[EMAIL PROTECTED]>
AuthorDate: Fri Apr 27 16:01:33 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:01:40 2007 +0200

[S390] cio: Re-start path verification after aborting internal I/O.

Path verification triggered by changes to the available CHPIDs will be
interrupted by another change but not re-started. This results in an
invalid path mask.
To solve this make sure to completely re-start path verification when
changing the available paths.

Signed-off-by: Stefan Bader <[EMAIL PROTECTED]>
Signed-off-by: Heiko Carstens <[EMAIL PROTECTED]>
Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
---
 drivers/s390/cio/chsc.c |  108 +++---
 1 files changed, 54 insertions(+), 54 deletions(-)

diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c
index 3dec460..02615eb 100644
--- a/drivers/s390/cio/chsc.c
+++ b/drivers/s390/cio/chsc.c
@@ -178,6 +178,38 @@ css_get_ssd_info(struct subchannel *sch)
return ret;
 }
 
+static int check_for_io_on_path(struct subchannel *sch, int mask)
+{
+   int cc;
+
+   cc = stsch(sch->schid, &sch->schib);
+   if (cc)
+   return 0;
+   if (sch->schib.scsw.actl && sch->schib.pmcw.lpum == mask)
+   return 1;
+   return 0;
+}
+
+static void terminate_internal_io(struct subchannel *sch)
+{
+   if (cio_clear(sch)) {
+   /* Recheck device in case clear failed. */
+   sch->lpm = 0;
+   if (device_trigger_verify(sch) != 0) {
+   if(css_enqueue_subchannel_slow(sch->schid)) {
+   css_clear_subchannel_slow_list();
+   need_rescan = 1;
+   }
+   }
+   return;
+   }
+   /* Request retry of internal operation. */
+   device_set_intretry(sch);
+   /* Call handler. */
+   if (sch->driver && sch->driver->termination)
+   sch->driver->termination(&sch->dev);
+}
+
 static int
 s390_subchannel_remove_chpid(struct device *dev, void *data)
 {
@@ -208,37 +240,33 @@ s390_subchannel_remove_chpid(struct device *dev, void 
*data)
if (sch->schib.pmcw.pim == 0x80)
goto out_unreg;
 
-   if ((sch->schib.scsw.actl & SCSW_ACTL_DEVACT) &&
-   (sch->schib.scsw.actl & SCSW_ACTL_SCHACT) &&
-   (sch->schib.pmcw.lpum == mask)) {
-   int cc;
-
-   cc = cio_clear(sch);
-   if (cc == -ENODEV)
+   if (check_for_io_on_path(sch, mask)) {
+   if (device_is_online(sch))
+   device_kill_io(sch);
+   else {
+   terminate_internal_io(sch);
+   /* Re-start path verification. */
+   if (sch->driver && sch->driver->verify)
+   sch->driver->verify(&sch->dev);
+   }
+   } else {
+   /* trigger path verification. */
+   if (sch->driver && sch->driver->verify)
+   sch->driver->verify(&sch->dev);
+   else if (sch->lpm == mask)
goto out_unreg;
-   /* Request retry of internal operation. */
-   device_set_intretry(sch);
-   /* Call handler. */
-   if (sch->driver && sch->driver->termination)
-   sch->driver->termination(&sch->dev);
-   goto out_unlock;
}
 
-   /* trigger path verification. */
-   if (sch->driver && sch->driver->verify)
-   sch->driver->verify(&sch->dev);
-   else if (sch->lpm == mask)
-   goto out_unreg;
-out_unlock:
spin_unlock_irq(sch->lock);
return 0;
+
 out_unreg:
-   spin_unlock_irq(sch->lock);
sch->lpm = 0;
if (css_enqueue_subchannel_slow(sch->schid)) {
css_clear_subchannel_slow_list();
need_rescan = 1;
}
+   spin_unlock_irq(sch->lock);
return 0;
 }
 
@@ -683,38 +711,6 @@ int chsc_chp_online(struct chp_id chpid)
return rc;
 }
 
-static int check_for_io_on_path(struct subchannel *sch, int index)
-{
-   int cc;
-
-   cc = stsch(sch->schid, &sch->schib);
-   if (cc)
-   return 0;
-   if (sch->schib.scsw.actl && sch->schib.pmcw.lpum == (0x80 >> index))
-   return 1;
-   return 0;
-}
-
-static void terminate_internal_io(struct subchannel *sch)
-{
-   if (cio_clear(sch)) {
-   /* Recheck device in case clear failed. */
-   sch->lpm = 0;
-   if (device_trigger_verify(sch) != 0) {
-  

[S390] cio: replace subchannel evaluation queue with bitmap

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=83b3370c79b91b9be3f6540c3c914e689134b45f
Commit: 83b3370c79b91b9be3f6540c3c914e689134b45f
Parent: 387b734fc2b55f776b192c7afdfd892ba42347d4
Author: Peter Oberparleiter <[EMAIL PROTECTED]>
AuthorDate: Fri Apr 27 16:01:34 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:01:40 2007 +0200

[S390] cio: replace subchannel evaluation queue with bitmap

Use a bitmap for indicating which subchannels require evaluation
instead of allocating memory for each evaluation request. This
approach reduces memory consumption during recovery in case of
massive evaluation request occurrence and removes the need for
memory allocation failure handling.

Cc: Heiko Carstens <[EMAIL PROTECTED]>
Signed-off-by: Peter Oberparleiter <[EMAIL PROTECTED]>
Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
---
 drivers/s390/cio/Makefile |2 +-
 drivers/s390/cio/chp.c|8 +--
 drivers/s390/cio/chp.h|2 +-
 drivers/s390/cio/chsc.c   |  130 +---
 drivers/s390/cio/chsc.h   |4 +-
 drivers/s390/cio/css.c|  148 +
 drivers/s390/cio/css.h|   10 +--
 drivers/s390/cio/device_fsm.c |6 +-
 drivers/s390/cio/idset.c  |  112 +++
 drivers/s390/cio/idset.h  |   25 +++
 drivers/s390/s390mach.c   |   24 ++-
 11 files changed, 235 insertions(+), 236 deletions(-)

diff --git a/drivers/s390/cio/Makefile b/drivers/s390/cio/Makefile
index fe7b3ff..cfaf77b 100644
--- a/drivers/s390/cio/Makefile
+++ b/drivers/s390/cio/Makefile
@@ -2,7 +2,7 @@
 # Makefile for the S/390 common i/o drivers
 #
 
-obj-y += airq.o blacklist.o chsc.o cio.o css.o chp.o
+obj-y += airq.o blacklist.o chsc.o cio.o css.o chp.o idset.o
 ccw_device-objs += device.o device_fsm.o device_ops.o
 ccw_device-objs += device_id.o device_pgid.o device_status.o
 obj-y += ccw_device.o cmf.o
diff --git a/drivers/s390/cio/chp.c b/drivers/s390/cio/chp.c
index 0e92c8c..ac289e6 100644
--- a/drivers/s390/cio/chp.c
+++ b/drivers/s390/cio/chp.c
@@ -491,7 +491,7 @@ void *chp_get_chp_desc(struct chp_id chpid)
  * Handle channel-report-words indicating that the status of a channel-path
  * has changed.
  */
-int chp_process_crw(int id, int status)
+void chp_process_crw(int id, int status)
 {
struct chp_id chpid;
 
@@ -500,11 +500,9 @@ int chp_process_crw(int id, int status)
if (status) {
if (!chp_is_registered(chpid))
chp_new(chpid);
-   return chsc_chp_online(chpid);
-   } else {
+   chsc_chp_online(chpid);
+   } else
chsc_chp_offline(chpid);
-   return 0;
-   }
 }
 
 static inline int info_bit_num(struct chp_id id)
diff --git a/drivers/s390/cio/chp.h b/drivers/s390/cio/chp.h
index 862af69..6528656 100644
--- a/drivers/s390/cio/chp.h
+++ b/drivers/s390/cio/chp.h
@@ -42,7 +42,7 @@ int chp_get_status(struct chp_id chpid);
 u8 chp_get_sch_opm(struct subchannel *sch);
 int chp_is_registered(struct chp_id chpid);
 void *chp_get_chp_desc(struct chp_id chpid);
-int chp_process_crw(int id, int available);
+void chp_process_crw(int id, int available);
 void chp_remove_cmg_attr(struct channel_path *chp);
 int chp_add_cmg_attr(struct channel_path *chp);
 int chp_new(struct chp_id chpid);
diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c
index 02615eb..89a130a 100644
--- a/drivers/s390/cio/chsc.c
+++ b/drivers/s390/cio/chsc.c
@@ -195,12 +195,8 @@ static void terminate_internal_io(struct subchannel *sch)
if (cio_clear(sch)) {
/* Recheck device in case clear failed. */
sch->lpm = 0;
-   if (device_trigger_verify(sch) != 0) {
-   if(css_enqueue_subchannel_slow(sch->schid)) {
-   css_clear_subchannel_slow_list();
-   need_rescan = 1;
-   }
-   }
+   if (device_trigger_verify(sch) != 0)
+   css_schedule_eval(sch->schid);
return;
}
/* Request retry of internal operation. */
@@ -262,11 +258,8 @@ s390_subchannel_remove_chpid(struct device *dev, void 
*data)
 
 out_unreg:
sch->lpm = 0;
-   if (css_enqueue_subchannel_slow(sch->schid)) {
-   css_clear_subchannel_slow_list();
-   need_rescan = 1;
-   }
spin_unlock_irq(sch->lock);
+   css_schedule_eval(sch->schid);
return 0;
 }
 
@@ -281,9 +274,6 @@ void chsc_chp_offline(struct chp_id chpid)
return;
bus_for_each_dev(&css_bus_type, NULL, &chpid,
 s390_subchannel_remove_chpid);
-
-   if (need_rescan || css_slow_subchannels_exist())
-   queue_work(slow_path_wq,

[S390] cio: Use add_uevent_var.

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=cfbe9bb2fb5de1da58d351432a9465c22d6d3ee5
Commit: cfbe9bb2fb5de1da58d351432a9465c22d6d3ee5
Parent: e5854a5839fa426a7873f038080f63587de5f1f1
Author: Cornelia Huck <[EMAIL PROTECTED]>
AuthorDate: Fri Apr 27 16:01:32 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:01:40 2007 +0200

[S390] cio: Use add_uevent_var.

Convert ccw_uevent to use add_uevent_var and adapt snprint_alias.

Signed-off-by: Cornelia Huck <[EMAIL PROTECTED]>
Signed-off-by: Heiko Carstens <[EMAIL PROTECTED]>
Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
---
 drivers/s390/cio/device.c |   66 +---
 1 files changed, 26 insertions(+), 40 deletions(-)

diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c
index c3fc205..34e7d77 100644
--- a/drivers/s390/cio/device.c
+++ b/drivers/s390/cio/device.c
@@ -56,13 +56,12 @@ ccw_bus_match (struct device * dev, struct device_driver * 
drv)
 /* Store modalias string delimited by prefix/suffix string into buffer with
  * specified size. Return length of resulting string (excluding trailing '\0')
  * even if string doesn't fit buffer (snprintf semantics). */
-static int snprint_alias(char *buf, size_t size, const char *prefix,
+static int snprint_alias(char *buf, size_t size,
 struct ccw_device_id *id, const char *suffix)
 {
int len;
 
-   len = snprintf(buf, size, "%sccw:t%04Xm%02X", prefix, id->cu_type,
-  id->cu_model);
+   len = snprintf(buf, size, "ccw:t%04Xm%02X", id->cu_type, id->cu_model);
if (len > size)
return len;
buf += len;
@@ -85,53 +84,40 @@ static int ccw_uevent(struct device *dev, char **envp, int 
num_envp,
struct ccw_device *cdev = to_ccwdev(dev);
struct ccw_device_id *id = &(cdev->id);
int i = 0;
-   int len;
+   int len = 0;
+   int ret;
+   char modalias_buf[30];
 
/* CU_TYPE= */
-   len = snprintf(buffer, buffer_size, "CU_TYPE=%04X", id->cu_type) + 1;
-   if (len > buffer_size || i >= num_envp)
-   return -ENOMEM;
-   envp[i++] = buffer;
-   buffer += len;
-   buffer_size -= len;
+   ret = add_uevent_var(envp, num_envp, &i, buffer, buffer_size, &len,
+"CU_TYPE=%04X", id->cu_type);
+   if (ret)
+   return ret;
 
/* CU_MODEL= */
-   len = snprintf(buffer, buffer_size, "CU_MODEL=%02X", id->cu_model) + 1;
-   if (len > buffer_size || i >= num_envp)
-   return -ENOMEM;
-   envp[i++] = buffer;
-   buffer += len;
-   buffer_size -= len;
+   ret = add_uevent_var(envp, num_envp, &i, buffer, buffer_size, &len,
+"CU_MODEL=%02X", id->cu_model);
+   if (ret)
+   return ret;
 
/* The next two can be zero, that's ok for us */
/* DEV_TYPE= */
-   len = snprintf(buffer, buffer_size, "DEV_TYPE=%04X", id->dev_type) + 1;
-   if (len > buffer_size || i >= num_envp)
-   return -ENOMEM;
-   envp[i++] = buffer;
-   buffer += len;
-   buffer_size -= len;
+   ret = add_uevent_var(envp, num_envp, &i, buffer, buffer_size, &len,
+"DEV_TYPE=%04X", id->dev_type);
+   if (ret)
+   return ret;
 
/* DEV_MODEL= */
-   len = snprintf(buffer, buffer_size, "DEV_MODEL=%02X",
-   (unsigned char) id->dev_model) + 1;
-   if (len > buffer_size || i >= num_envp)
-   return -ENOMEM;
-   envp[i++] = buffer;
-   buffer += len;
-   buffer_size -= len;
+   ret = add_uevent_var(envp, num_envp, &i, buffer, buffer_size, &len,
+"DEV_MODEL=%02X", id->dev_model);
+   if (ret)
+   return ret;
 
/* MODALIAS=  */
-   len = snprint_alias(buffer, buffer_size, "MODALIAS=", id, "") + 1;
-   if (len > buffer_size || i >= num_envp)
-   return -ENOMEM;
-   envp[i++] = buffer;
-   buffer += len;
-   buffer_size -= len;
-
-   envp[i] = NULL;
-
-   return 0;
+   snprint_alias(modalias_buf, sizeof(modalias_buf), id, "");
+   ret = add_uevent_var(envp, num_envp, &i, buffer, buffer_size, &len,
+"MODALIAS=%s", modalias_buf);
+   return ret;
 }
 
 struct bus_type ccw_bus_type;
@@ -280,7 +266,7 @@ modalias_show (struct device *dev, struct device_attribute 
*attr, char *buf)
struct ccw_device_id *id = &(cdev->id);
int len;
 
-   len = snprint_alias(buf, PAGE_SIZE, "", id, "\n") + 1;
+   len = snprint_alias(buf, PAGE_SIZE, id, "\n") + 1;
 
return len > PAGE_SIZE ? PAGE_SIZE : len;
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More 

[S390] cio: Dont call css_update_ssd_info from interrupt context.

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=82b7ac058f60e0c92f9237fbaf440671f437ecdf
Commit: 82b7ac058f60e0c92f9237fbaf440671f437ecdf
Parent: 7ad6a24970325294a22a08446d473384c15b928e
Author: Cornelia Huck <[EMAIL PROTECTED]>
AuthorDate: Fri Apr 27 16:01:36 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:01:41 2007 +0200

[S390] cio: Dont call css_update_ssd_info from interrupt context.

Signed-off-by: Cornelia Huck <[EMAIL PROTECTED]>
Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
---
 drivers/s390/cio/device.c |3 ++-
 drivers/s390/cio/device_fsm.c |1 -
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c
index 7bb44e7..3b56f37 100644
--- a/drivers/s390/cio/device.c
+++ b/drivers/s390/cio/device.c
@@ -743,6 +743,7 @@ static int io_subchannel_recog(struct ccw_device *, struct 
subchannel *);
 static void sch_attach_device(struct subchannel *sch,
  struct ccw_device *cdev)
 {
+   css_update_ssd_info(sch);
spin_lock_irq(sch->lock);
sch->dev.driver_data = cdev;
cdev->private->schid = sch->schid;
@@ -878,7 +879,7 @@ io_subchannel_register(struct work_struct *work)
priv = container_of(work, struct ccw_device_private, kick_work);
cdev = priv->cdev;
sch = to_subchannel(cdev->dev.parent);
-
+   css_update_ssd_info(sch);
/*
 * io_subchannel_register() will also be called after device
 * recognition has been done for a boxed device (which will already
diff --git a/drivers/s390/cio/device_fsm.c b/drivers/s390/cio/device_fsm.c
index aadd2fd..898ec3b 100644
--- a/drivers/s390/cio/device_fsm.c
+++ b/drivers/s390/cio/device_fsm.c
@@ -246,7 +246,6 @@ ccw_device_recog_done(struct ccw_device *cdev, int state)
 */
old_lpm = sch->lpm;
stsch(sch->schid, &sch->schib);
-   css_update_ssd_info(sch);
sch->lpm = sch->schib.pmcw.pam & sch->opm;
/* Check since device may again have become not operational. */
if (!sch->schib.pmcw.dnv)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[S390] cio: fix subchannel channel-path data usage

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7ad6a24970325294a22a08446d473384c15b928e
Commit: 7ad6a24970325294a22a08446d473384c15b928e
Parent: 83b3370c79b91b9be3f6540c3c914e689134b45f
Author: Peter Oberparleiter <[EMAIL PROTECTED]>
AuthorDate: Fri Apr 27 16:01:35 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:01:40 2007 +0200

[S390] cio: fix subchannel channel-path data usage

Ensure that channel-path related subchannel data is only retrieved and
used when it is valid and that it is updated when it may have changed.

Signed-off-by: Peter Oberparleiter <[EMAIL PROTECTED]>
Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
---
 drivers/s390/cio/chsc.c   |  303 +++--
 drivers/s390/cio/chsc.h   |   10 ++-
 drivers/s390/cio/cio.h|   16 +--
 drivers/s390/cio/css.c|   53 +++-
 drivers/s390/cio/css.h|1 +
 drivers/s390/cio/device.c |   12 ++-
 drivers/s390/cio/device_fsm.c |1 +
 7 files changed, 179 insertions(+), 217 deletions(-)

diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c
index 89a130a..0841e16 100644
--- a/drivers/s390/cio/chsc.c
+++ b/drivers/s390/cio/chsc.c
@@ -26,155 +26,84 @@
 
 static void *sei_page;
 
-/* FIXME: this is _always_ called for every subchannel. shouldn't we
- *   process more than one at a time? */
-static int
-chsc_get_sch_desc_irq(struct subchannel *sch, void *page)
-{
-   int ccode, j;
+struct chsc_ssd_area {
+   struct chsc_header request;
+   u16 :10;
+   u16 ssid:2;
+   u16 :4;
+   u16 f_sch;/* first subchannel */
+   u16 :16;
+   u16 l_sch;/* last subchannel */
+   u32 :32;
+   struct chsc_header response;
+   u32 :32;
+   u8 sch_valid : 1;
+   u8 dev_valid : 1;
+   u8 st: 3; /* subchannel type */
+   u8 zeroes: 3;
+   u8  unit_addr;/* unit address */
+   u16 devno;/* device number */
+   u8 path_mask;
+   u8 fla_valid_mask;
+   u16 sch;  /* subchannel */
+   u8 chpid[8];  /* chpids 0-7 */
+   u16 fla[8];   /* full link addresses 0-7 */
+} __attribute__ ((packed));
 
-   struct {
-   struct chsc_header request;
-   u16 reserved1a:10;
-   u16 ssid:2;
-   u16 reserved1b:4;
-   u16 f_sch;/* first subchannel */
-   u16 reserved2;
-   u16 l_sch;/* last subchannel */
-   u32 reserved3;
-   struct chsc_header response;
-   u32 reserved4;
-   u8 sch_valid : 1;
-   u8 dev_valid : 1;
-   u8 st: 3; /* subchannel type */
-   u8 zeroes: 3;
-   u8  unit_addr;/* unit address */
-   u16 devno;/* device number */
-   u8 path_mask;
-   u8 fla_valid_mask;
-   u16 sch;  /* subchannel */
-   u8 chpid[8];  /* chpids 0-7 */
-   u16 fla[8];   /* full link addresses 0-7 */
-   } __attribute__ ((packed)) *ssd_area;
-
-   ssd_area = page;
+int chsc_get_ssd_info(struct subchannel_id schid, struct chsc_ssd_info *ssd)
+{
+   unsigned long page;
+   struct chsc_ssd_area *ssd_area;
+   int ccode;
+   int ret;
+   int i;
+   int mask;
 
+   page = get_zeroed_page(GFP_KERNEL | GFP_DMA);
+   if (!page)
+   return -ENOMEM;
+   ssd_area = (struct chsc_ssd_area *) page;
ssd_area->request.length = 0x0010;
ssd_area->request.code = 0x0004;
-
-   ssd_area->ssid = sch->schid.ssid;
-   ssd_area->f_sch = sch->schid.sch_no;
-   ssd_area->l_sch = sch->schid.sch_no;
+   ssd_area->ssid = schid.ssid;
+   ssd_area->f_sch = schid.sch_no;
+   ssd_area->l_sch = schid.sch_no;
 
ccode = chsc(ssd_area);
+   /* Check response. */
if (ccode > 0) {
-   pr_debug("chsc returned with ccode = %d\n", ccode);
-   return (ccode == 3) ? -ENODEV : -EBUSY;
+   ret = (ccode == 3) ? -ENODEV : -EBUSY;
+   goto out_free;
}
-
-   switch (ssd_area->response.code) {
-   case 0x0001: /* everything ok */
-   break;
-   case 0x0002:
-   CIO_CRW_EVENT(2, "Invalid command!\n");
-   return -EINVAL;
-   case 0x0003:
-   CIO_CRW_EVENT(2, "Error in chsc request block!\n");
-   return -EINVAL;
-   case 0x0004:
-   CIO_CRW_EVENT(2, "Model does not provide ssd\n");
-   return -EOPNOTSUPP;
-   default:
-   CIO_CRW_EVENT(2, "Unknown CHSC response %d\n",
+   if (ssd_area->response.code != 0x0001) {
+   CIO_MSG_EVENT(2, "chsc: ssd failed for 0.%x.%04x (rc=%04x)\n",
+  

[S390] cio: ccwgroup register vs. unregister.

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d76123eb357a4baa653714183df286c1bb99f707
Commit: d76123eb357a4baa653714183df286c1bb99f707
Parent: 82b7ac058f60e0c92f9237fbaf440671f437ecdf
Author: Cornelia Huck <[EMAIL PROTECTED]>
AuthorDate: Fri Apr 27 16:01:37 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:01:41 2007 +0200

[S390] cio: ccwgroup register vs. unregister.

Introduce a mutex for struct ccwgroup to prevent simuntaneous
register/unregister on the same ccwgroup device.

Signed-off-by: Cornelia Huck <[EMAIL PROTECTED]>
Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
---
 drivers/s390/cio/ccwgroup.c |   33 ++---
 include/asm-s390/ccwgroup.h |1 +
 2 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/drivers/s390/cio/ccwgroup.c b/drivers/s390/cio/ccwgroup.c
index 5aeb68e..e5ccda6 100644
--- a/drivers/s390/cio/ccwgroup.c
+++ b/drivers/s390/cio/ccwgroup.c
@@ -75,8 +75,10 @@ static void ccwgroup_ungroup_callback(struct device *dev)
 {
struct ccwgroup_device *gdev = to_ccwgroupdev(dev);
 
+   mutex_lock(&gdev->reg_mutex);
__ccwgroup_remove_symlinks(gdev);
device_unregister(dev);
+   mutex_unlock(&gdev->reg_mutex);
 }
 
 static ssize_t
@@ -173,7 +175,8 @@ ccwgroup_create(struct device *root,
return -ENOMEM;
 
atomic_set(&gdev->onoff, 0);
-
+   mutex_init(&gdev->reg_mutex);
+   mutex_lock(&gdev->reg_mutex);
for (i = 0; i < argc; i++) {
gdev->cdev[i] = get_ccwdev_by_busid(cdrv, argv[i]);
 
@@ -183,12 +186,12 @@ ccwgroup_create(struct device *root,
|| gdev->cdev[i]->id.driver_info !=
gdev->cdev[0]->id.driver_info) {
rc = -EINVAL;
-   goto free_dev;
+   goto error;
}
/* Don't allow a device to belong to more than one group. */
if (gdev->cdev[i]->dev.driver_data) {
rc = -EINVAL;
-   goto free_dev;
+   goto error;
}
gdev->cdev[i]->dev.driver_data = gdev;
}
@@ -203,9 +206,8 @@ ccwgroup_create(struct device *root,
gdev->cdev[0]->dev.bus_id);
 
rc = device_register(&gdev->dev);
-   
if (rc)
-   goto free_dev;
+   goto error;
get_device(&gdev->dev);
rc = device_create_file(&gdev->dev, &dev_attr_ungroup);
 
@@ -216,6 +218,7 @@ ccwgroup_create(struct device *root,
 
rc = __ccwgroup_create_symlinks(gdev);
if (!rc) {
+   mutex_unlock(&gdev->reg_mutex);
put_device(&gdev->dev);
return 0;
}
@@ -224,19 +227,12 @@ ccwgroup_create(struct device *root,
 error:
for (i = 0; i < argc; i++)
if (gdev->cdev[i]) {
-   put_device(&gdev->cdev[i]->dev);
-   gdev->cdev[i]->dev.driver_data = NULL;
-   }
-   put_device(&gdev->dev);
-   return rc;
-free_dev:
-   for (i = 0; i < argc; i++)
-   if (gdev->cdev[i]) {
if (gdev->cdev[i]->dev.driver_data == gdev)
gdev->cdev[i]->dev.driver_data = NULL;
put_device(&gdev->cdev[i]->dev);
}
-   kfree(gdev);
+   mutex_unlock(&gdev->reg_mutex);
+   put_device(&gdev->dev);
return rc;
 }
 
@@ -422,8 +418,12 @@ ccwgroup_driver_unregister (struct ccwgroup_driver 
*cdriver)
get_driver(&cdriver->driver);
while ((dev = driver_find_device(&cdriver->driver, NULL, NULL,
 __ccwgroup_match_all))) {
-   __ccwgroup_remove_symlinks(to_ccwgroupdev(dev));
+   struct ccwgroup_device *gdev = to_ccwgroupdev(dev);
+
+   mutex_lock(&gdev->reg_mutex);
+   __ccwgroup_remove_symlinks(gdev);
device_unregister(dev);
+   mutex_unlock(&gdev->reg_mutex);
put_device(dev);
}
put_driver(&cdriver->driver);
@@ -444,8 +444,10 @@ __ccwgroup_get_gdev_by_cdev(struct ccw_device *cdev)
if (cdev->dev.driver_data) {
gdev = (struct ccwgroup_device *)cdev->dev.driver_data;
if (get_device(&gdev->dev)) {
+   mutex_lock(&gdev->reg_mutex);
if (device_is_registered(&gdev->dev))
return gdev;
+   mutex_unlock(&gdev->reg_mutex);
put_device(&gdev->dev);
}
return NULL;
@@ -465,6 +467,7 @@ ccwgroup_remove_ccwdev(struct ccw_device *cdev)
if (gdev) {
__ccwgroup_remove_symlinks(gdev);
device_unregister

[S390] cio: Unregister ccw devices directly.

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ef99516c9646802c3d38c3eb83de302e05b3c1b5
Commit: ef99516c9646802c3d38c3eb83de302e05b3c1b5
Parent: 8c4941c53b14e5a08ed2f270e9f087b410a9abcc
Author: Cornelia Huck <[EMAIL PROTECTED]>
AuthorDate: Fri Apr 27 16:01:39 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:01:42 2007 +0200

[S390] cio: Unregister ccw devices directly.

We used to unregister ccw devices not directly from the I/O
subchannel remove function in order to avoid lifelocks on the
css bus semaphore. This semaphore is gone, and there is no reason
to not unregister the ccw device directly (it is even better since
it is more in keeping with the goal of immediate disconnect).

Signed-off-by: Cornelia Huck <[EMAIL PROTECTED]>
Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
---
 drivers/s390/cio/device.c |   56 +---
 1 files changed, 12 insertions(+), 44 deletions(-)

diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c
index 3b56f37..0335590 100644
--- a/drivers/s390/cio/device.c
+++ b/drivers/s390/cio/device.c
@@ -290,16 +290,10 @@ int ccw_device_is_orphan(struct ccw_device *cdev)
return sch_is_pseudo_sch(to_subchannel(cdev->dev.parent));
 }
 
-static void ccw_device_unregister(struct work_struct *work)
+static void ccw_device_unregister(struct ccw_device *cdev)
 {
-   struct ccw_device_private *priv;
-   struct ccw_device *cdev;
-
-   priv = container_of(work, struct ccw_device_private, kick_work);
-   cdev = priv->cdev;
if (test_and_clear_bit(1, &cdev->private->registered))
-   device_unregister(&cdev->dev);
-   put_device(&cdev->dev);
+   device_del(&cdev->dev);
 }
 
 static void
@@ -316,11 +310,8 @@ ccw_device_remove_disconnected(struct ccw_device *cdev)
spin_lock_irqsave(cdev->ccwlock, flags);
cdev->private->state = DEV_STATE_NOT_OPER;
spin_unlock_irqrestore(cdev->ccwlock, flags);
-   if (get_device(&cdev->dev)) {
-   PREPARE_WORK(&cdev->private->kick_work,
-ccw_device_unregister);
-   queue_work(ccw_device_work, &cdev->private->kick_work);
-   }
+   ccw_device_unregister(cdev);
+   put_device(&cdev->dev);
return ;
}
sch = to_subchannel(cdev->dev.parent);
@@ -555,17 +546,10 @@ static struct attribute_group ccwdev_attr_group = {
.attrs = ccwdev_attrs,
 };
 
-static int
-device_add_files (struct device *dev)
-{
-   return sysfs_create_group(&dev->kobj, &ccwdev_attr_group);
-}
-
-static void
-device_remove_files(struct device *dev)
-{
-   sysfs_remove_group(&dev->kobj, &ccwdev_attr_group);
-}
+struct attribute_group *ccwdev_attr_groups[] = {
+   &ccwdev_attr_group,
+   NULL,
+};
 
 /* this is a simple abstraction for device_register that sets the
  * correct bus type and adds the bus specific files */
@@ -580,10 +564,6 @@ static int ccw_device_register(struct ccw_device *cdev)
return ret;
 
set_bit(1, &cdev->private->registered);
-   if ((ret = device_add_files(dev))) {
-   if (test_and_clear_bit(1, &cdev->private->registered))
-   device_del(dev);
-   }
return ret;
 }
 
@@ -655,10 +635,6 @@ ccw_device_add_changed(struct work_struct *work)
return;
}
set_bit(1, &cdev->private->registered);
-   if (device_add_files(&cdev->dev)) {
-   if (test_and_clear_bit(1, &cdev->private->registered))
-   device_unregister(&cdev->dev);
-   }
 }
 
 void ccw_device_do_unreg_rereg(struct work_struct *work)
@@ -671,9 +647,7 @@ void ccw_device_do_unreg_rereg(struct work_struct *work)
cdev = priv->cdev;
sch = to_subchannel(cdev->dev.parent);
 
-   device_remove_files(&cdev->dev);
-   if (test_and_clear_bit(1, &cdev->private->registered))
-   device_del(&cdev->dev);
+   ccw_device_unregister(cdev);
PREPARE_WORK(&cdev->private->kick_work,
 ccw_device_add_changed);
queue_work(ccw_device_work, &cdev->private->kick_work);
@@ -712,6 +686,7 @@ static int io_subchannel_initialize_dev(struct subchannel 
*sch,
cdev->dev.parent = &sch->dev;
cdev->dev.release = ccw_device_release;
INIT_LIST_HEAD(&cdev->private->kick_work.entry);
+   cdev->dev.groups = ccwdev_attr_groups;
/* Do first half of device_register. */
device_initialize(&cdev->dev);
if (!get_device(&sch->dev)) {
@@ -1141,15 +1116,8 @@ io_subchannel_remove (struct subchannel *sch)
sch->dev.driver_data = NULL;
cdev->private->state = DEV_STATE_NOT_OPER;
spin_unlock_irqrestore(cdev->ccwlock, flags);
-   /*
- 

[S390] cio: cm_enable memory leak.

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8c4941c53b14e5a08ed2f270e9f087b410a9abcc
Commit: 8c4941c53b14e5a08ed2f270e9f087b410a9abcc
Parent: d76123eb357a4baa653714183df286c1bb99f707
Author: Cornelia Huck <[EMAIL PROTECTED]>
AuthorDate: Fri Apr 27 16:01:38 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:01:41 2007 +0200

[S390] cio: cm_enable memory leak.

We allocage two pages when channel path measurements are enabled
via cm_enable. We must not forget to free them again when
channel path measurements are disabled again.

Signed-off-by: Cornelia Huck <[EMAIL PROTECTED]>
Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
---
 drivers/s390/cio/chsc.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c
index 0841e16..ea92ac4 100644
--- a/drivers/s390/cio/chsc.c
+++ b/drivers/s390/cio/chsc.c
@@ -818,7 +818,7 @@ chsc_secm(struct channel_subsystem *css, int enable)
} else
chsc_remove_cmg_attr(css);
}
-   if (enable && !css->cm_enabled) {
+   if (!css->cm_enabled) {
free_page((unsigned long)css->cub_addr1);
free_page((unsigned long)css->cub_addr2);
}
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[S390] System call cleanup.

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=03ff9a235a0602724fc54916469b6e0939c62c9b
Commit: 03ff9a235a0602724fc54916469b6e0939c62c9b
Parent: ef99516c9646802c3d38c3eb83de302e05b3c1b5
Author: Martin Schwidefsky <[EMAIL PROTECTED]>
AuthorDate: Fri Apr 27 16:01:40 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:01:42 2007 +0200

[S390] System call cleanup.

Remove system call glue for sys_clone, sys_fork, sys_vfork, sys_execve,
sys_sigreturn, sys_rt_sigreturn and sys_sigaltstack. Call do_execve from
kernel_execve directly, move pt_regs to the right place and branch to
sysc_return to start the user space program. This removes the last
in-kernel system call.

Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
Signed-off-by: Heiko Carstens <[EMAIL PROTECTED]>
---
 arch/s390/kernel/compat_linux.c  |   60 --
 arch/s390/kernel/compat_signal.c |   14 +++--
 arch/s390/kernel/entry.S |   87 -
 arch/s390/kernel/entry64.S   |  100 +++---
 arch/s390/kernel/process.c   |   82 ++-
 arch/s390/kernel/signal.c|   10 ++--
 arch/s390/kernel/sys_s390.c  |   20 
 arch/s390/kernel/syscalls.S  |   14 +++---
 8 files changed, 162 insertions(+), 225 deletions(-)

diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c
index 664c669..5236fdb 100644
--- a/arch/s390/kernel/compat_linux.c
+++ b/arch/s390/kernel/compat_linux.c
@@ -495,29 +495,34 @@ sys32_rt_sigqueueinfo(int pid, int sig, compat_siginfo_t 
__user *uinfo)
  * sys32_execve() executes a new program after the asm stub has set
  * things up for us.  This should basically do what I want it to.
  */
-asmlinkage long
-sys32_execve(struct pt_regs regs)
+asmlinkage long sys32_execve(void)
 {
-int error;
-char * filename;
+   struct pt_regs *regs = task_pt_regs(current);
+   char *filename;
+   unsigned long result;
+   int rc;
 
-filename = getname(compat_ptr(regs.orig_gpr2));
-error = PTR_ERR(filename);
-if (IS_ERR(filename))
+   filename = getname(compat_ptr(regs->orig_gpr2));
+   if (IS_ERR(filename)) {
+   result = PTR_ERR(filename);
 goto out;
-error = compat_do_execve(filename, compat_ptr(regs.gprs[3]),
-compat_ptr(regs.gprs[4]), ®s);
-   if (error == 0)
-   {
-   task_lock(current);
-   current->ptrace &= ~PT_DTRACE;
-   task_unlock(current);
-   current->thread.fp_regs.fpc=0;
-   asm volatile("sfpc %0,0" : : "d" (0));
}
+   rc = compat_do_execve(filename, compat_ptr(regs->gprs[3]),
+ compat_ptr(regs->gprs[4]), regs);
+   if (rc) {
+   result = rc;
+   goto out_putname;
+   }
+   task_lock(current);
+   current->ptrace &= ~PT_DTRACE;
+   task_unlock(current);
+   current->thread.fp_regs.fpc=0;
+   asm volatile("sfpc %0,0" : : "d" (0));
+   result = regs->gprs[2];
+out_putname:
 putname(filename);
 out:
-return error;
+   return result;
 }
 
 
@@ -918,19 +923,20 @@ asmlinkage long sys32_write(unsigned int fd, char __user 
* buf, size_t count)
return sys_write(fd, buf, count);
 }
 
-asmlinkage long sys32_clone(struct pt_regs regs)
+asmlinkage long sys32_clone(void)
 {
-unsigned long clone_flags;
-unsigned long newsp;
+   struct pt_regs *regs = task_pt_regs(current);
+   unsigned long clone_flags;
+   unsigned long newsp;
int __user *parent_tidptr, *child_tidptr;
 
-clone_flags = regs.gprs[3] & 0xUL;
-newsp = regs.orig_gpr2 & 0x7fffUL;
-   parent_tidptr = compat_ptr(regs.gprs[4]);
-   child_tidptr = compat_ptr(regs.gprs[5]);
-if (!newsp)
-newsp = regs.gprs[15];
-return do_fork(clone_flags, newsp, ®s, 0,
+   clone_flags = regs->gprs[3] & 0xUL;
+   newsp = regs->orig_gpr2 & 0x7fffUL;
+   parent_tidptr = compat_ptr(regs->gprs[4]);
+   child_tidptr = compat_ptr(regs->gprs[5]);
+   if (!newsp)
+   newsp = regs->gprs[15];
+   return do_fork(clone_flags, newsp, regs, 0,
   parent_tidptr, child_tidptr);
 }
 
diff --git a/arch/s390/kernel/compat_signal.c b/arch/s390/kernel/compat_signal.c
index 887a988..80a54a0 100644
--- a/arch/s390/kernel/compat_signal.c
+++ b/arch/s390/kernel/compat_signal.c
@@ -255,9 +255,9 @@ sys32_rt_sigaction(int sig, const struct sigaction32 __user 
*act,
 }
 
 asmlinkage long
-sys32_sigaltstack(const stack_t32 __user *uss, stack_t32 __user *uoss,
-   struct pt_regs *regs)
+sys32_sigaltstack(const stack_t32 __use

[S390] cio: Channel-path configure function.

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e5854a5839fa426a7873f038080f63587de5f1f1
Commit: e5854a5839fa426a7873f038080f63587de5f1f1
Parent: f5ba6c863617c15d22cce5f8666ff4c832773025
Author: Peter Oberparleiter <[EMAIL PROTECTED]>
AuthorDate: Fri Apr 27 16:01:31 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:01:39 2007 +0200

[S390] cio: Channel-path configure function.

Add a new attribute to the channel-path sysfs directory through which
channel-path configure operations can be triggered. Also listen for
hardware events requesting channel-path configure operations and
process them accordingly.

Signed-off-by: Peter Oberparleiter <[EMAIL PROTECTED]>
Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
Signed-off-by: Heiko Carstens <[EMAIL PROTECTED]>
---
 drivers/s390/char/Makefile|2 +-
 drivers/s390/char/sclp_chp.c  |  196 
 drivers/s390/cio/chp.c|  250 -
 drivers/s390/cio/chp.h|   20 +++-
 drivers/s390/cio/chpid.h  |   51 -
 drivers/s390/cio/chsc.c   |   44 +++-
 drivers/s390/cio/chsc.h   |2 +-
 drivers/s390/cio/cio.c|1 +
 drivers/s390/cio/cio.h|1 +
 drivers/s390/cio/css.h|4 +-
 drivers/s390/cio/device_fsm.c |2 +-
 drivers/s390/cio/device_ops.c |2 +-
 drivers/s390/cio/ioasm.h  |2 +-
 include/asm-s390/chpid.h  |   53 +
 include/asm-s390/cio.h|1 +
 include/asm-s390/sclp.h   |   12 ++
 16 files changed, 581 insertions(+), 62 deletions(-)

diff --git a/drivers/s390/char/Makefile b/drivers/s390/char/Makefile
index 293e667..5fd581c 100644
--- a/drivers/s390/char/Makefile
+++ b/drivers/s390/char/Makefile
@@ -3,7 +3,7 @@
 #
 
 obj-y += ctrlchar.o keyboard.o defkeymap.o sclp.o sclp_rw.o sclp_quiesce.o \
-sclp_info.o
+sclp_info.o sclp_chp.o
 
 obj-$(CONFIG_TN3270) += raw3270.o
 obj-$(CONFIG_TN3270_CONSOLE) += con3270.o
diff --git a/drivers/s390/char/sclp_chp.c b/drivers/s390/char/sclp_chp.c
new file mode 100644
index 000..a66b914
--- /dev/null
+++ b/drivers/s390/char/sclp_chp.c
@@ -0,0 +1,196 @@
+/*
+ *  drivers/s390/char/sclp_chp.c
+ *
+ *Copyright IBM Corp. 2007
+ *Author(s): Peter Oberparleiter <[EMAIL PROTECTED]>
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "sclp.h"
+
+#define TAG"sclp_chp: "
+
+#define SCLP_CMDW_CONFIGURE_CHANNEL_PATH   0x000f0001
+#define SCLP_CMDW_DECONFIGURE_CHANNEL_PATH 0x000e0001
+#define SCLP_CMDW_READ_CHANNEL_PATH_INFORMATION0x00030001
+
+static inline sclp_cmdw_t get_configure_cmdw(struct chp_id chpid)
+{
+   return SCLP_CMDW_CONFIGURE_CHANNEL_PATH | chpid.id << 8;
+}
+
+static inline sclp_cmdw_t get_deconfigure_cmdw(struct chp_id chpid)
+{
+   return SCLP_CMDW_DECONFIGURE_CHANNEL_PATH | chpid.id << 8;
+}
+
+static void chp_callback(struct sclp_req *req, void *data)
+{
+   struct completion *completion = data;
+
+   complete(completion);
+}
+
+struct chp_cfg_sccb {
+   struct sccb_header header;
+   u8 ccm;
+   u8 reserved[6];
+   u8 cssid;
+} __attribute__((packed));
+
+struct chp_cfg_data {
+   struct chp_cfg_sccb sccb;
+   struct sclp_req req;
+   struct completion completion;
+} __attribute__((packed));
+
+static int do_configure(sclp_cmdw_t cmd)
+{
+   struct chp_cfg_data *data;
+   int rc;
+
+   /* Prepare sccb. */
+   data = (struct chp_cfg_data *) get_zeroed_page(GFP_KERNEL | GFP_DMA);
+   if (!data)
+   return -ENOMEM;
+   data->sccb.header.length = sizeof(struct chp_cfg_sccb);
+   data->req.command = cmd;
+   data->req.sccb = &(data->sccb);
+   data->req.status = SCLP_REQ_FILLED;
+   data->req.callback = chp_callback;
+   data->req.callback_data = &(data->completion);
+   init_completion(&data->completion);
+
+   /* Perform sclp request. */
+   rc = sclp_add_request(&(data->req));
+   if (rc)
+   goto out;
+   wait_for_completion(&data->completion);
+
+   /* Check response .*/
+   if (data->req.status != SCLP_REQ_DONE) {
+   printk(KERN_WARNING TAG "configure channel-path request failed "
+  "(status=0x%02x)\n", data->req.status);
+   rc = -EIO;
+   goto out;
+   }
+   switch (data->sccb.header.response_code) {
+   case 0x0020:
+   case 0x0120:
+   case 0x0440:
+   case 0x0450:
+   break;
+   default:
+   printk(KERN_WARNING TAG "configure channel-path failed "
+  "(cmd=0x%08x, response=0x%04x)\n", cmd,
+  data->sccb.header.response_code);
+   rc = -EIO;
+   break;
+   }
+out:
+   free_page((unsigned long) data);
+
+   return rc;

[S390] Improved oops output.

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bb11e3bdbac08f773a89f3ca287024a956ee8a12
Commit: bb11e3bdbac08f773a89f3ca287024a956ee8a12
Parent: 03ff9a235a0602724fc54916469b6e0939c62c9b
Author: Martin Schwidefsky <[EMAIL PROTECTED]>
AuthorDate: Fri Apr 27 16:01:41 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:01:42 2007 +0200

[S390] Improved oops output.

This patch adds two improvements to the oops output. First it adds an
additional line after the PSW which decodes the different fields of it.
Second a disassembler is added that decodes the instructions surrounding
the faulting PSW. The output of a test oops now looks like this:

kernel BUG at init/main.c:419
illegal operation: 0001 [#1]
CPU:0Not tainted
Process swapper (pid: 0, task: 00464968, ksp: 004be000)
Krnl PSW : 07018000 000120b6 (rest_init+0x36/0x38)
   R:0 T:1 IO:1 EX:1 Key:0 M:0 W:0 P:0 AS:0 CC:0 PM:0 EA:3
Krnl GPRS: 0003 004ba017 0022 
0001
   0003a5f6  004be6a8 

    004b8200 3a50 
8000
   00516368 0033d008 000120b2 
004bdee0
Krnl Code: 000120a6: e3e0f0980024   stg %r14,152(%r15)
   000120ac: c0e500014296   brasl   %r14,3a5d8
   000120b2: a7f40001   brc 15,120b4
  >000120b6: 0707   bcr 0,%r7
   000120b8: eb7ff0500024   stmg%r7,%r15,80(%r15)
   000120be: c0d000195825   larl%r13,33d108
   000120c4: a7f13f00   tmll%r15,16128
   000120c8: a7840001   brc 8,120ca
Call Trace:
([<000120b2>] rest_init+0x32/0x38)
 [<004be614>] start_kernel+0x37c/0x410
 [<00012020>] _ehead+0x20/0x80

Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
Signed-off-by: Heiko Carstens <[EMAIL PROTECTED]>
---
 arch/s390/kernel/Makefile|2 +-
 arch/s390/kernel/dis.c   | 1278 ++
 arch/s390/kernel/traps.c |   55 +--
 include/asm-s390/processor.h |1 +
 4 files changed, 1297 insertions(+), 39 deletions(-)

diff --git a/arch/s390/kernel/Makefile b/arch/s390/kernel/Makefile
index 5492d25..3195d37 100644
--- a/arch/s390/kernel/Makefile
+++ b/arch/s390/kernel/Makefile
@@ -6,7 +6,7 @@ EXTRA_AFLAGS:= -traditional
 
 obj-y  :=  bitmap.o traps.o time.o process.o base.o early.o \
 setup.o sys_s390.o ptrace.o signal.o cpcmd.o ebcdic.o \
-   semaphore.o s390_ext.o debug.o irq.o ipl.o
+   semaphore.o s390_ext.o debug.o irq.o ipl.o dis.o
 
 obj-y  += $(if $(CONFIG_64BIT),entry64.o,entry.o)
 obj-y  += $(if $(CONFIG_64BIT),reipl64.o,reipl.o)
diff --git a/arch/s390/kernel/dis.c b/arch/s390/kernel/dis.c
new file mode 100644
index 000..dabaf98
--- /dev/null
+++ b/arch/s390/kernel/dis.c
@@ -0,0 +1,1278 @@
+/*
+ * arch/s390/kernel/dis.c
+ *
+ * Disassemble s390 instructions.
+ *
+ * Copyright IBM Corp. 2007
+ * Author(s): Martin Schwidefsky ([EMAIL PROTECTED]),
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#ifndef CONFIG_64BIT
+#define ONELONG "%08lx: "
+#else /* CONFIG_64BIT */
+#define ONELONG "%016lx: "
+#endif /* CONFIG_64BIT */
+
+#define OPERAND_GPR0x1 /* Operand printed as %rx */
+#define OPERAND_FPR0x2 /* Operand printed as %fx */
+#define OPERAND_AR 0x4 /* Operand printed as %ax */
+#define OPERAND_CR 0x8 /* Operand printed as %cx */
+#define OPERAND_DISP   0x10/* Operand printed as displacement */
+#define OPERAND_BASE   0x20/* Operand printed as base register */
+#define OPERAND_INDEX  0x40/* Operand printed as index register */
+#define OPERAND_PCREL  0x80/* Operand printed as pc-relative symbol */
+#define OPERAND_SIGNED 0x100   /* Operand printed as signed value */
+#define OPERAND_LENGTH 0x200   /* Operand printed as length (+1) */
+
+enum {
+   UNUSED, /* Indicates the end of the operand list */
+   R_8,/* GPR starting at position 8 */
+   R_12,   /* GPR starting at position 12 */
+   R_16,   /* GPR starting at position 16 */
+   R_20,   /* GPR starting at position 20 */
+   R_24,   /* GPR starting at position 24 */
+   R_28,   /* GPR starting at position 28 */
+   R_32,   /* GPR starting at position 32 */
+   F_8,/* FPR starting at position 8 */
+   F_12,   /* FP

[S390] Use generic bug.

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c0007f1a65762eaf55633d403b380130ec60adad
Commit: c0007f1a65762eaf55633d403b380130ec60adad
Parent: bb11e3bdbac08f773a89f3ca287024a956ee8a12
Author: Heiko Carstens <[EMAIL PROTECTED]>
AuthorDate: Fri Apr 27 16:01:42 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:01:42 2007 +0200

[S390] Use generic bug.

Generic bug implementation for s390. Will increase the value of the
console output on BUG() statements since registers r0-r5,r14 will
not be clobbered by a printk() call that was previously done before
the illegal instruction of BUG() was hit.
Also implements an architecture specific WARN_ON(). Output of that
could be increased but requires common code change.

Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
Signed-off-by: Heiko Carstens <[EMAIL PROTECTED]>
---
 arch/s390/Kconfig  |5 ++
 arch/s390/defconfig|2 +
 arch/s390/kernel/module.c  |4 +-
 arch/s390/kernel/traps.c   |   17 ++-
 arch/s390/kernel/vmlinux.lds.S |   10 -
 include/asm-s390/bug.h |   97 +---
 6 files changed, 103 insertions(+), 32 deletions(-)

diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index 0f293aa..0f9517b 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -41,6 +41,11 @@ config GENERIC_HWEIGHT
 config GENERIC_TIME
def_bool y
 
+config GENERIC_BUG
+   bool
+   depends on BUG
+   default y
+
 config NO_IOMEM
def_bool y
 
diff --git a/arch/s390/defconfig b/arch/s390/defconfig
index 741d2bb..80046d9 100644
--- a/arch/s390/defconfig
+++ b/arch/s390/defconfig
@@ -12,6 +12,7 @@ CONFIG_RWSEM_XCHGADD_ALGORITHM=y
 # CONFIG_ARCH_HAS_ILOG2_U64 is not set
 CONFIG_GENERIC_HWEIGHT=y
 CONFIG_GENERIC_TIME=y
+CONFIG_GENERIC_BUG=y
 CONFIG_NO_IOMEM=y
 CONFIG_S390=y
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
@@ -705,6 +706,7 @@ CONFIG_DEBUG_MUTEXES=y
 CONFIG_DEBUG_SPINLOCK_SLEEP=y
 # CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
 # CONFIG_DEBUG_KOBJECT is not set
+CONFIG_DEBUG_BUGVERBOSE=y
 # CONFIG_DEBUG_INFO is not set
 # CONFIG_DEBUG_VM is not set
 # CONFIG_DEBUG_LIST is not set
diff --git a/arch/s390/kernel/module.c b/arch/s390/kernel/module.c
index 39d1dd7..59b4e79 100644
--- a/arch/s390/kernel/module.c
+++ b/arch/s390/kernel/module.c
@@ -31,6 +31,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #if 0
 #define DEBUGP printk
@@ -398,9 +399,10 @@ int module_finalize(const Elf_Ehdr *hdr,
struct module *me)
 {
vfree(me->arch.syminfo);
-   return 0;
+   return module_bug_finalize(hdr, sechdrs, me);
 }
 
 void module_arch_cleanup(struct module *mod)
 {
+   module_bug_cleanup(mod);
 }
diff --git a/arch/s390/kernel/traps.c b/arch/s390/kernel/traps.c
index a654094..49dec83 100644
--- a/arch/s390/kernel/traps.c
+++ b/arch/s390/kernel/traps.c
@@ -30,7 +30,7 @@
 #include 
 #include 
 #include 
-
+#include 
 #include 
 #include 
 #include 
@@ -297,6 +297,11 @@ report_user_fault(long interruption_code, struct pt_regs 
*regs)
 #endif
 }
 
+int is_valid_bugaddr(unsigned long addr)
+{
+   return 1;
+}
+
 static void __kprobes inline do_trap(long interruption_code, int signr,
char *str, struct pt_regs *regs,
siginfo_t *info)
@@ -323,8 +328,14 @@ static void __kprobes inline do_trap(long 
interruption_code, int signr,
 fixup = search_exception_tables(regs->psw.addr & 
PSW_ADDR_INSN);
 if (fixup)
 regs->psw.addr = fixup->fixup | PSW_ADDR_AMODE;
-else
-die(str, regs, interruption_code);
+   else {
+   enum bug_trap_type btt;
+
+   btt = report_bug(regs->psw.addr & PSW_ADDR_INSN);
+   if (btt == BUG_TRAP_TYPE_WARN)
+   return;
+   die(str, regs, interruption_code);
+   }
 }
 }
 
diff --git a/arch/s390/kernel/vmlinux.lds.S b/arch/s390/kernel/vmlinux.lds.S
index c30716a..418f642 100644
--- a/arch/s390/kernel/vmlinux.lds.S
+++ b/arch/s390/kernel/vmlinux.lds.S
@@ -45,6 +45,8 @@ SECTIONS
   __ex_table : { *(__ex_table) }
   __stop___ex_table = .;
 
+  BUG_TABLE
+
   .data : {/* Data */
*(.data)
CONSTRUCTORS
@@ -77,6 +79,12 @@ SECTIONS
*(.init.text)
_einittext = .;
   }
+  /*
+   * .exit.text is discarded at runtime, not link time,
+   * to deal with references from __bug_table
+   */
+  .exit.text :  { *(.exit.text) }
+
   .init.data : { *(.init.data) }
   . = ALIGN(256);
   __setup_start = .;
@@ -116,7 +124,7 @@ SECTIONS
 
   /* Sections to be discarded */
   /DISCARD/ : {
-   *(.exit.text) *(.exit.data) *(.exitcall.exit)

[S390] Minor fault path optimization.

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=10c1031f706bbe0690d84cdbccad15b11c6dc661
Commit: 10c1031f706bbe0690d84cdbccad15b11c6dc661
Parent: c0007f1a65762eaf55633d403b380130ec60adad
Author: Martin Schwidefsky <[EMAIL PROTECTED]>
AuthorDate: Fri Apr 27 16:01:43 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:01:43 2007 +0200

[S390] Minor fault path optimization.

The minor fault path has grown a lot in terms of cycles. In particular
the kprobes hook is very costly. Optimize the path to save a couple of
cycles. If kprobes is enabled more than 300 cycles can be avoided if
kprobes_running() is false.

Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
Signed-off-by: Heiko Carstens <[EMAIL PROTECTED]>
---
 arch/s390/mm/fault.c |  259 +++---
 1 files changed, 141 insertions(+), 118 deletions(-)

diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
index 7462aeb..8bc3518 100644
--- a/arch/s390/mm/fault.c
+++ b/arch/s390/mm/fault.c
@@ -63,21 +63,25 @@ int unregister_page_fault_notifier(struct notifier_block 
*nb)
return atomic_notifier_chain_unregister(¬ify_page_fault_chain, nb);
 }
 
-static inline int notify_page_fault(enum die_val val, const char *str,
-   struct pt_regs *regs, long err, int trap, int sig)
+static int __kprobes __notify_page_fault(struct pt_regs *regs, long err)
 {
-   struct die_args args = {
-   .regs = regs,
-   .str = str,
-   .err = err,
-   .trapnr = trap,
-   .signr = sig
-   };
-   return atomic_notifier_call_chain(¬ify_page_fault_chain, val, &args);
+   struct die_args args = { .str = "page fault",
+.trapnr = 14,
+.signr = SIGSEGV };
+   args.regs = regs;
+   args.err = err;
+   return atomic_notifier_call_chain(¬ify_page_fault_chain,
+ DIE_PAGE_FAULT, &args);
+}
+
+static inline int notify_page_fault(struct pt_regs *regs, long err)
+{
+   if (unlikely(kprobe_running()))
+   return __notify_page_fault(regs, err);
+   return NOTIFY_DONE;
 }
 #else
-static inline int notify_page_fault(enum die_val val, const char *str,
-   struct pt_regs *regs, long err, int trap, int sig)
+static inline int notify_page_fault(struct pt_regs *regs, long err)
 {
return NOTIFY_DONE;
 }
@@ -170,6 +174,89 @@ static void do_sigsegv(struct pt_regs *regs, unsigned long 
error_code,
force_sig_info(SIGSEGV, &si, current);
 }
 
+static void do_no_context(struct pt_regs *regs, unsigned long error_code,
+ unsigned long address)
+{
+   const struct exception_table_entry *fixup;
+
+   /* Are we prepared to handle this kernel fault?  */
+   fixup = search_exception_tables(regs->psw.addr & __FIXUP_MASK);
+   if (fixup) {
+   regs->psw.addr = fixup->fixup | PSW_ADDR_AMODE;
+   return;
+   }
+
+   /*
+* Oops. The kernel tried to access some bad page. We'll have to
+* terminate things with extreme prejudice.
+*/
+   if (check_space(current) == 0)
+   printk(KERN_ALERT "Unable to handle kernel pointer dereference"
+  " at virtual kernel address %p\n", (void *)address);
+   else
+   printk(KERN_ALERT "Unable to handle kernel paging request"
+  " at virtual user address %p\n", (void *)address);
+
+   die("Oops", regs, error_code);
+   do_exit(SIGKILL);
+}
+
+static void do_low_address(struct pt_regs *regs, unsigned long error_code)
+{
+   /* Low-address protection hit in kernel mode means
+  NULL pointer write access in kernel mode.  */
+   if (regs->psw.mask & PSW_MASK_PSTATE) {
+   /* Low-address protection hit in user mode 'cannot happen'. */
+   die ("Low-address protection", regs, error_code);
+   do_exit(SIGKILL);
+   }
+
+   do_no_context(regs, error_code, 0);
+}
+
+/*
+ * We ran out of memory, or some other thing happened to us that made
+ * us unable to handle the page fault gracefully.
+ */
+static int do_out_of_memory(struct pt_regs *regs, unsigned long error_code,
+   unsigned long address)
+{
+   struct task_struct *tsk = current;
+   struct mm_struct *mm = tsk->mm;
+
+   up_read(&mm->mmap_sem);
+   if (is_init(tsk)) {
+   yield();
+   down_read(&mm->mmap_sem);
+   return 1;
+   }
+   printk("VM: killing process %s\n", tsk->comm);
+   if (regs->psw.mask & PSW_MASK_PSTATE)
+   do_exit(SIGKILL);
+   do_no_context(regs, error_code, address);
+   return 0;
+}
+
+static void do_sigbus(struct pt_regs *regs, unsigned long erro

[S390] No execute support cleanup.

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=be5ec363e958982454ac9b3138b0e78c032e758d
Commit: be5ec363e958982454ac9b3138b0e78c032e758d
Parent: 10c1031f706bbe0690d84cdbccad15b11c6dc661
Author: Martin Schwidefsky <[EMAIL PROTECTED]>
AuthorDate: Fri Apr 27 16:01:44 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:01:43 2007 +0200

[S390] No execute support cleanup.

Simplify the signal_return function that checks for the two special
system calls sigreturn and rt_sigreturn. No need to do a page table
walk, a call to copy_from_user while disabled page faults will work
as well.

Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
Signed-off-by: Heiko Carstens <[EMAIL PROTECTED]>
---
 arch/s390/mm/fault.c |   72 ++---
 1 files changed, 21 insertions(+), 51 deletions(-)

diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
index 8bc3518..2b76a87 100644
--- a/arch/s390/mm/fault.c
+++ b/arch/s390/mm/fault.c
@@ -26,9 +26,9 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -263,68 +263,38 @@ extern long sys_rt_sigreturn(struct pt_regs *regs);
 extern long sys32_sigreturn(struct pt_regs *regs);
 extern long sys32_rt_sigreturn(struct pt_regs *regs);
 
-static inline void do_sigreturn(struct mm_struct *mm, struct pt_regs *regs,
-   int rt)
+static int signal_return(struct mm_struct *mm, struct pt_regs *regs,
+unsigned long address, unsigned long error_code)
 {
+   u16 instruction;
+   int rc, compat;
+
+   pagefault_disable();
+   rc = __get_user(instruction, (u16 __user *) regs->psw.addr);
+   pagefault_enable();
+   if (rc)
+   return -EFAULT;
+
up_read(&mm->mmap_sem);
clear_tsk_thread_flag(current, TIF_SINGLE_STEP);
 #ifdef CONFIG_COMPAT
-   if (test_tsk_thread_flag(current, TIF_31BIT)) {
-   if (rt)
-   sys32_rt_sigreturn(regs);
-   else
-   sys32_sigreturn(regs);
-   return;
-   }
-#endif /* CONFIG_COMPAT */
-   if (rt)
-   sys_rt_sigreturn(regs);
+   compat = test_tsk_thread_flag(current, TIF_31BIT);
+   if (compat && instruction == 0x0a77)
+   sys32_sigreturn(regs);
+   else if (compat && instruction == 0x0aad)
+   sys32_rt_sigreturn(regs);
else
+#endif
+   if (instruction == 0x0a77)
sys_sigreturn(regs);
-   return;
-}
-
-static int signal_return(struct mm_struct *mm, struct pt_regs *regs,
-unsigned long address, unsigned long error_code)
-{
-   pgd_t *pgd;
-   pmd_t *pmd;
-   pte_t *pte;
-   u16 *instruction;
-   unsigned long pfn, uaddr = regs->psw.addr;
-
-   spin_lock(&mm->page_table_lock);
-   pgd = pgd_offset(mm, uaddr);
-   if (pgd_none(*pgd) || unlikely(pgd_bad(*pgd)))
-   goto out_fault;
-   pmd = pmd_offset(pgd, uaddr);
-   if (pmd_none(*pmd) || unlikely(pmd_bad(*pmd)))
-   goto out_fault;
-   pte = pte_offset_map(pmd_offset(pgd_offset(mm, uaddr), uaddr), uaddr);
-   if (!pte || !pte_present(*pte))
-   goto out_fault;
-   pfn = pte_pfn(*pte);
-   if (!pfn_valid(pfn))
-   goto out_fault;
-   spin_unlock(&mm->page_table_lock);
-
-   instruction = (u16 *) ((pfn << PAGE_SHIFT) + (uaddr & (PAGE_SIZE-1)));
-   if (*instruction == 0x0a77)
-   do_sigreturn(mm, regs, 0);
-   else if (*instruction == 0x0aad)
-   do_sigreturn(mm, regs, 1);
+   else if (instruction == 0x0aad)
+   sys_rt_sigreturn(regs);
else {
-   printk("- XXX - do_exception: task = %s, primary, NO EXEC "
-  "-> SIGSEGV\n", current->comm);
-   up_read(&mm->mmap_sem);
current->thread.prot_addr = address;
current->thread.trap_no = error_code;
do_sigsegv(regs, error_code, SEGV_MAPERR, address);
}
return 0;
-out_fault:
-   spin_unlock(&mm->page_table_lock);
-   return -EFAULT;
 }
 #endif /* CONFIG_S390_EXEC_PROTECT */
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[S390] Get rid of console setup functions.

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=60691d3c2c0fe9ecc264741ff41f283fef579b8a
Commit: 60691d3c2c0fe9ecc264741ff41f283fef579b8a
Parent: be5ec363e958982454ac9b3138b0e78c032e758d
Author: Heiko Carstens <[EMAIL PROTECTED]>
AuthorDate: Fri Apr 27 16:01:45 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:01:43 2007 +0200

[S390] Get rid of console setup functions.

We get this:

Section mismatch: reference to .init.text:con3270_consetup from .data
  between 'con3270' (at offset 0x45c8) and 'con3270_fn'
Section mismatch: reference to .init.text:con3215_consetup from .data
  between 'con3215' (at offset 0x4678) and
  'raw3215_ccw_driver'

Since there is no difference between a non present console setup
function and one that returns only 0 remove them.

Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
Signed-off-by: Heiko Carstens <[EMAIL PROTECTED]>
---
 drivers/s390/char/con3215.c |7 ---
 drivers/s390/char/con3270.c |7 ---
 2 files changed, 0 insertions(+), 14 deletions(-)

diff --git a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c
index 9a328f1..6000bde 100644
--- a/drivers/s390/char/con3215.c
+++ b/drivers/s390/char/con3215.c
@@ -813,12 +813,6 @@ con3215_unblank(void)
spin_unlock_irqrestore(get_ccwdev_lock(raw->cdev), flags);
 }
 
-static int __init 
-con3215_consetup(struct console *co, char *options)
-{
-   return 0;
-}
-
 /*
  *  The console structure for the 3215 console
  */
@@ -827,7 +821,6 @@ static struct console con3215 = {
.write   = con3215_write,
.device  = con3215_device,
.unblank = con3215_unblank,
-   .setup   = con3215_consetup,
.flags   = CON_PRINTBUFFER,
 };
 
diff --git a/drivers/s390/char/con3270.c b/drivers/s390/char/con3270.c
index 8e7f2d7..fd34791 100644
--- a/drivers/s390/char/con3270.c
+++ b/drivers/s390/char/con3270.c
@@ -555,12 +555,6 @@ con3270_unblank(void)
spin_unlock_irqrestore(&cp->view.lock, flags);
 }
 
-static int __init 
-con3270_consetup(struct console *co, char *options)
-{
-   return 0;
-}
-
 /*
  *  The console structure for the 3270 console
  */
@@ -569,7 +563,6 @@ static struct console con3270 = {
.write   = con3270_write,
.device  = con3270_device,
.unblank = con3270_unblank,
-   .setup   = con3270_consetup,
.flags   = CON_PRINTBUFFER,
 };
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[S390] dasd: Add sysfs attribute status and generate uevents.

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4dfd5c4593e69e9d399dd9e01d184dc534408f7e
Commit: 4dfd5c4593e69e9d399dd9e01d184dc534408f7e
Parent: be7962856d299a0f231ac36f89f4a89cbecfe0ff
Author: Horst Hummel <[EMAIL PROTECTED]>
AuthorDate: Fri Apr 27 16:01:47 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:01:44 2007 +0200

[S390] dasd: Add sysfs attribute status and generate uevents.

This patch adds a sysfs-attribute 'status' to make the DASD device-status
accessible from user-space. In addition, the DASD driver generates an
uevent(CHANGE) for the ccw-device on each device-status change.
This enables user-space applications (e.g. udev) to do related processing.

Signed-off-by: Horst Hummel <[EMAIL PROTECTED]>
Signed-off-by: Heiko Carstens <[EMAIL PROTECTED]>
Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
---
 drivers/s390/block/dasd.c|3 ++
 drivers/s390/block/dasd_devmap.c |   41 ++
 2 files changed, 44 insertions(+), 0 deletions(-)

diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
index eb5dc62..e71929d 100644
--- a/drivers/s390/block/dasd.c
+++ b/drivers/s390/block/dasd.c
@@ -398,6 +398,9 @@ dasd_change_state(struct dasd_device *device)
 
if (device->state == device->target)
wake_up(&dasd_init_waitq);
+
+   /* let user-space know that the device status changed */
+   kobject_uevent(&device->cdev->dev.kobj, KOBJ_CHANGE);
 }
 
 /*
diff --git a/drivers/s390/block/dasd_devmap.c b/drivers/s390/block/dasd_devmap.c
index ed70852..66958b8 100644
--- a/drivers/s390/block/dasd_devmap.c
+++ b/drivers/s390/block/dasd_devmap.c
@@ -829,6 +829,46 @@ dasd_discipline_show(struct device *dev, struct 
device_attribute *attr,
 static DEVICE_ATTR(discipline, 0444, dasd_discipline_show, NULL);
 
 static ssize_t
+dasd_device_status_show(struct device *dev, struct device_attribute *attr,
+char *buf)
+{
+   struct dasd_device *device;
+   ssize_t len;
+
+   device = dasd_device_from_cdev(to_ccwdev(dev));
+   if (!IS_ERR(device)) {
+   switch (device->state) {
+   case DASD_STATE_NEW:
+   len = snprintf(buf, PAGE_SIZE, "new\n");
+   break;
+   case DASD_STATE_KNOWN:
+   len = snprintf(buf, PAGE_SIZE, "detected\n");
+   break;
+   case DASD_STATE_BASIC:
+   len = snprintf(buf, PAGE_SIZE, "basic\n");
+   break;
+   case DASD_STATE_UNFMT:
+   len = snprintf(buf, PAGE_SIZE, "unformatted\n");
+   break;
+   case DASD_STATE_READY:
+   len = snprintf(buf, PAGE_SIZE, "ready\n");
+   break;
+   case DASD_STATE_ONLINE:
+   len = snprintf(buf, PAGE_SIZE, "online\n");
+   break;
+   default:
+   len = snprintf(buf, PAGE_SIZE, "no stat\n");
+   break;
+   }
+   dasd_put_device(device);
+   } else
+   len = snprintf(buf, PAGE_SIZE, "unknown\n");
+   return len;
+}
+
+static DEVICE_ATTR(status, 0444, dasd_device_status_show, NULL);
+
+static ssize_t
 dasd_alias_show(struct device *dev, struct device_attribute *attr, char *buf)
 {
struct dasd_devmap *devmap;
@@ -939,6 +979,7 @@ static DEVICE_ATTR(eer_enabled, 0644, dasd_eer_show, 
dasd_eer_store);
 static struct attribute * dasd_attrs[] = {
&dev_attr_readonly.attr,
&dev_attr_discipline.attr,
+   &dev_attr_status.attr,
&dev_attr_alias.attr,
&dev_attr_vendor.attr,
&dev_attr_uid.attr,
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[S390] ctc: kmalloc->kzalloc/casting cleanups.

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b7127dfeed3252a76aa31f016aac5fba53d99711
Commit: b7127dfeed3252a76aa31f016aac5fba53d99711
Parent: 411ed3225733dbd83b4cbaaa992ef80d6ec1534e
Author: Ahmed S. Darwish <[EMAIL PROTECTED]>
AuthorDate: Fri Apr 27 16:01:50 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:01:45 2007 +0200

[S390] ctc: kmalloc->kzalloc/casting cleanups.

A patch for the CTC / ESCON network driver.  Switch from kmalloc to kzalloc
when appropriate, remove some unnecessary kmalloc casts too.  Since I have 
no
s390 machine, I didn't compile it but I examined it carefully.

Signed-off-by: "Ahmed S. Darwish" <[EMAIL PROTECTED]>
Cc: Frank Pavlic <[EMAIL PROTECTED]>
Cc: Ursula Braun <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Heiko Carstens <[EMAIL PROTECTED]>
Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
---
 drivers/s390/net/ctcmain.c |   23 +--
 1 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/drivers/s390/net/ctcmain.c b/drivers/s390/net/ctcmain.c
index 0d6d5fc..570a960 100644
--- a/drivers/s390/net/ctcmain.c
+++ b/drivers/s390/net/ctcmain.c
@@ -1638,21 +1638,19 @@ add_channel(struct ccw_device *cdev, enum channel_types 
type)
struct channel *ch;
 
DBF_TEXT(trace, 2, __FUNCTION__);
-   if ((ch =
-(struct channel *) kmalloc(sizeof (struct channel),
-   GFP_KERNEL)) == NULL) {
+   ch = kzalloc(sizeof(struct channel), GFP_KERNEL);
+   if (!ch) {
ctc_pr_warn("ctc: Out of memory in add_channel\n");
return -1;
}
-   memset(ch, 0, sizeof (struct channel));
-   if ((ch->ccw = kmalloc(8*sizeof(struct ccw1),
-  GFP_KERNEL | GFP_DMA)) == NULL) {
+   /* assure all flags and counters are reset */
+   ch->ccw = kzalloc(8 * sizeof(struct ccw1), GFP_KERNEL | GFP_DMA);
+   if (!ch->ccw) {
kfree(ch);
ctc_pr_warn("ctc: Out of memory in add_channel\n");
return -1;
}
 
-   memset(ch->ccw, 0, 8*sizeof(struct ccw1));  // assure all flags and 
counters are reset
 
/**
 * "static" ccws are used in the following way:
@@ -1692,15 +1690,14 @@ add_channel(struct ccw_device *cdev, enum channel_types 
type)
return -1;
}
fsm_newstate(ch->fsm, CH_STATE_IDLE);
-   if ((ch->irb = kmalloc(sizeof (struct irb),
- GFP_KERNEL)) == NULL) {
+   ch->irb = kzalloc(sizeof(struct irb), GFP_KERNEL);
+   if (!ch->irb) {
ctc_pr_warn("ctc: Out of memory in add_channel\n");
kfree_fsm(ch->fsm);
kfree(ch->ccw);
kfree(ch);
return -1;
}
-   memset(ch->irb, 0, sizeof (struct irb));
while (*c && less_than((*c)->id, ch->id))
c = &(*c)->next;
if (*c && (!strncmp((*c)->id, ch->id, CTC_ID_SIZE))) {
@@ -2745,14 +2742,13 @@ ctc_probe_device(struct ccwgroup_device *cgdev)
if (!get_device(&cgdev->dev))
return -ENODEV;
 
-   priv = kmalloc(sizeof (struct ctc_priv), GFP_KERNEL);
+   priv = kzalloc(sizeof(struct ctc_priv), GFP_KERNEL);
if (!priv) {
ctc_pr_err("%s: Out of memory\n", __func__);
put_device(&cgdev->dev);
return -ENOMEM;
}
 
-   memset(priv, 0, sizeof (struct ctc_priv));
rc = ctc_add_files(&cgdev->dev);
if (rc) {
kfree(priv);
@@ -2793,10 +2789,9 @@ ctc_init_netdevice(struct net_device * dev, int 
alloc_device,
DBF_TEXT(setup, 3, __FUNCTION__);
 
if (alloc_device) {
-   dev = kmalloc(sizeof (struct net_device), GFP_KERNEL);
+   dev = kzalloc(sizeof(struct net_device), GFP_KERNEL);
if (!dev)
return NULL;
-   memset(dev, 0, sizeof (struct net_device));
}
 
dev->priv = privptr;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[S390] dasd: Add ipldev parameter.

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7039d3a11c4b4b59f9ef933b4b0a28304bdd07d1
Commit: 7039d3a11c4b4b59f9ef933b4b0a28304bdd07d1
Parent: 4dfd5c4593e69e9d399dd9e01d184dc534408f7e
Author: Peter Oberparleiter <[EMAIL PROTECTED]>
AuthorDate: Fri Apr 27 16:01:48 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:01:44 2007 +0200

[S390] dasd: Add ipldev parameter.

Specifying 'ipldev' in the dasd= kernel parameter will automatically
activate the boot device for use by the dasd driver.

Signed-off-by: Peter Oberparleiter <[EMAIL PROTECTED]>
Signed-off-by: Heiko Carstens <[EMAIL PROTECTED]>
Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
---
 drivers/s390/block/dasd_devmap.c |   17 +
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/drivers/s390/block/dasd_devmap.c b/drivers/s390/block/dasd_devmap.c
index 66958b8..6a89cef 100644
--- a/drivers/s390/block/dasd_devmap.c
+++ b/drivers/s390/block/dasd_devmap.c
@@ -19,6 +19,7 @@
 
 #include 
 #include 
+#include 
 
 /* This is ugly... */
 #define PRINTK_HEADER "dasd_devmap:"
@@ -133,6 +134,8 @@ dasd_call_setup(char *str)
 __setup ("dasd=", dasd_call_setup);
 #endif /* #ifndef MODULE */
 
+#defineDASD_IPLDEV "ipldev"
+
 /*
  * Read a device busid/devno from a string.
  */
@@ -141,6 +144,20 @@ dasd_busid(char **str, int *id0, int *id1, int *devno)
 {
int val, old_style;
 
+   /* Interpret ipldev busid */
+   if (strncmp(DASD_IPLDEV, *str, strlen(DASD_IPLDEV)) == 0) {
+   if (ipl_info.type != IPL_TYPE_CCW) {
+   MESSAGE(KERN_ERR, "%s", "ipl device is not a ccw "
+   "device");
+   return -EINVAL;
+   }
+   *id0 = 0;
+   *id1 = ipl_info.data.ccw.dev_id.ssid;
+   *devno = ipl_info.data.ccw.dev_id.devno;
+   *str += strlen(DASD_IPLDEV);
+
+   return 0;
+   }
/* check for leading '0x' */
old_style = 0;
if ((*str)[0] == '0' && (*str)[1] == 'x') {
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[S390] Improved kernel stack overflow checking.

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=be7962856d299a0f231ac36f89f4a89cbecfe0ff
Commit: be7962856d299a0f231ac36f89f4a89cbecfe0ff
Parent: 60691d3c2c0fe9ecc264741ff41f283fef579b8a
Author: Martin Schwidefsky <[EMAIL PROTECTED]>
AuthorDate: Fri Apr 27 16:01:46 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:01:43 2007 +0200

[S390] Improved kernel stack overflow checking.

Recent cvs versions of gcc have support for an improved stack overflow
checking that calculates the size of the guard size for each function.
If the compiler accepts -mstack-size without -mstack-guard then the
new stack check is available. We always want to use the new stack
checker.

Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
Signed-off-by: Heiko Carstens <[EMAIL PROTECTED]>
---
 arch/s390/Makefile |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/s390/Makefile b/arch/s390/Makefile
index b1e5584..ece5adc 100644
--- a/arch/s390/Makefile
+++ b/arch/s390/Makefile
@@ -67,8 +67,10 @@ endif
 
 ifeq ($(call cc-option-yn,-mstack-size=8192 -mstack-guard=128),y)
 cflags-$(CONFIG_CHECK_STACK) += -mstack-size=$(STACK_SIZE)
+ifneq ($(call cc-option-yn,-mstack-size=8192),y)
 cflags-$(CONFIG_CHECK_STACK) += -mstack-guard=$(CONFIG_STACK_GUARD)
 endif
+endif
 
 ifeq ($(call cc-option-yn,-mwarn-dynamicstack),y)
 cflags-$(CONFIG_WARN_STACK) += -mwarn-dynamicstack
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[S390] zfcpdump support.

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=411ed3225733dbd83b4cbaaa992ef80d6ec1534e
Commit: 411ed3225733dbd83b4cbaaa992ef80d6ec1534e
Parent: 7039d3a11c4b4b59f9ef933b4b0a28304bdd07d1
Author: Michael Holzheu <[EMAIL PROTECTED]>
AuthorDate: Fri Apr 27 16:01:49 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:01:44 2007 +0200

[S390] zfcpdump support.

s390 machines provide hardware support for creating Linux dumps on SCSI
disks. For creating a dump a special purpose dump Linux is used. The first
32 MB of memory are saved by the hardware before the dump Linux is
booted. Via an SCLP interface, the saved memory can be accessed from
Linux. This patch exports memory and registers of the crashed Linux to
userspace via a debugfs file. For more information refer to
Documentation/s390/zfcpdump.txt, which is included in this patch.

Signed-off-by: Michael Holzheu <[EMAIL PROTECTED]>
Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
Signed-off-by: Heiko Carstens <[EMAIL PROTECTED]>
---
 Documentation/s390/zfcpdump.txt |   87 ++
 arch/s390/Kconfig   |8 +
 arch/s390/Makefile  |3 +
 arch/s390/defconfig |1 +
 arch/s390/kernel/head64.S   |   72 +-
 arch/s390/kernel/ipl.c  |  232 +-
 arch/s390/kernel/setup.c|   38 ++-
 arch/s390/kernel/smp.c  |   62 
 drivers/s390/char/Makefile  |3 +
 drivers/s390/char/sclp.h|2 +
 drivers/s390/char/sclp_sdias.c  |  255 +++
 drivers/s390/char/zcore.c   |  651 +++
 include/asm-s390/ipl.h  |   32 ++
 include/asm-s390/lowcore.h  |   46 +++
 include/asm-s390/sclp.h |2 +
 include/asm-s390/setup.h|2 +
 include/asm-s390/smp.h  |1 +
 17 files changed, 1411 insertions(+), 86 deletions(-)

diff --git a/Documentation/s390/zfcpdump.txt b/Documentation/s390/zfcpdump.txt
new file mode 100644
index 000..cf45d27
--- /dev/null
+++ b/Documentation/s390/zfcpdump.txt
@@ -0,0 +1,87 @@
+s390 SCSI dump tool (zfcpdump)
+
+System z machines (z900 or higher) provide hardware support for creating system
+dumps on SCSI disks. The dump process is initiated by booting a dump tool, 
which
+has to create a dump of the current (probably crashed) Linux image. In order to
+not overwrite memory of the crashed Linux with data of the dump tool, the
+hardware saves some memory plus the register sets of the boot cpu before the
+dump tool is loaded. There exists an SCLP hardware interface to obtain the 
saved
+memory afterwards. Currently 32 MB are saved.
+
+This zfcpdump implementation consists of a Linux dump kernel together with
+a userspace dump tool, which are loaded together into the saved memory region
+below 32 MB. zfcpdump is installed on a SCSI disk using zipl (as contained in
+the s390-tools package) to make the device bootable. The operator of a Linux
+system can then trigger a SCSI dump by booting the SCSI disk, where zfcpdump
+resides on.
+
+The kernel part of zfcpdump is implemented as a debugfs file under "zcore/mem",
+which exports memory and registers of the crashed Linux in an s390
+standalone dump format. It can be used in the same way as e.g. /dev/mem. The
+dump format defines a 4K header followed by plain uncompressed memory. The
+register sets are stored in the prefix pages of the respective cpus. To build a
+dump enabled kernel with the zcore driver, the kernel config option
+CONFIG_ZFCPDUMP has to be set. When reading from "zcore/mem", the part of
+memory, which has been saved by hardware is read by the driver via the SCLP
+hardware interface. The second part is just copied from the non overwritten 
real
+memory.
+
+The userspace application of zfcpdump can reside e.g. in an intitramfs or an
+initrd. It reads from zcore/mem and writes the system dump to a file on a
+SCSI disk.
+
+To build a zfcpdump kernel use the following settings in your kernel
+configuration:
+ * CONFIG_ZFCPDUMP=y
+ * Enable ZFCP driver
+ * Enable SCSI driver
+ * Enable ext2 and ext3 filesystems
+ * Disable as many features as possible to keep the kernel small.
+   E.g. network support is not needed at all.
+
+To use the zfcpdump userspace application in an initramfs you have to do the
+following:
+
+ * Copy the zfcpdump executable somewhere into your Linux tree.
+   E.g. to "arch/s390/boot/zfcpdump. If you do not want to include
+   shared libraries, compile the tool with the "-static" gcc option.
+ * If you want to include e2fsck, add it to your source tree, too. The zfcpdump
+   application attempts to start /sbin/e2fsck from the ramdisk.
+ * Use an initramfs config file like the following:
+
+   dir /dev 755 0 0
+   nod /dev/console 644 0 0 c 5 1
+   nod /dev/null 644 0 0 c 1 3
+   nod /dev/sda1 644 0 0 b 8 1
+   nod /dev/sda2 644 0 0 b 8 2
+   nod /dev/sda3 64

[S390] sclp: fix coding style.

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6d4740c89c187ee8f5ac7355c4eeffda26493d1f
Commit: 6d4740c89c187ee8f5ac7355c4eeffda26493d1f
Parent: 66b494a7178cbd84d8fc0e5f1e92d81fb6ec9f6e
Author: Stefan Haberland <[EMAIL PROTECTED]>
AuthorDate: Fri Apr 27 16:01:53 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:01:45 2007 +0200

[S390] sclp: fix coding style.

Use only capital letters for defines.

Cc: Peter Oberparleiter <[EMAIL PROTECTED]>
Signed-off-by: Stefan Haberland <[EMAIL PROTECTED]>
Signed-off-by: Heiko Carstens <[EMAIL PROTECTED]>
Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
---
 drivers/s390/char/sclp.c |2 +-
 drivers/s390/char/sclp.h |   72 +++---
 drivers/s390/char/sclp_cpi.c |4 +-
 drivers/s390/char/sclp_quiesce.c |2 +-
 drivers/s390/char/sclp_rw.c  |   16 
 drivers/s390/char/sclp_sdias.c   |6 ++--
 drivers/s390/char/sclp_tty.c |6 ++--
 drivers/s390/char/sclp_vt220.c   |8 ++--
 8 files changed, 58 insertions(+), 58 deletions(-)

diff --git a/drivers/s390/char/sclp.c b/drivers/s390/char/sclp.c
index bd219ab..fa62e69 100644
--- a/drivers/s390/char/sclp.c
+++ b/drivers/s390/char/sclp.c
@@ -511,7 +511,7 @@ sclp_state_change_cb(struct evbuf_header *evbuf)
 }
 
 static struct sclp_register sclp_state_change_event = {
-   .receive_mask = EvTyp_StateChange_Mask,
+   .receive_mask = EVTYP_STATECHANGE_MASK,
.receiver_fn = sclp_state_change_cb
 };
 
diff --git a/drivers/s390/char/sclp.h b/drivers/s390/char/sclp.h
index 6402e94..e03dcf4 100644
--- a/drivers/s390/char/sclp.h
+++ b/drivers/s390/char/sclp.h
@@ -19,35 +19,35 @@
 #define MAX_KMEM_PAGES (sizeof(unsigned long) << 3)
 #define MAX_CONSOLE_PAGES  4
 
-#define EvTyp_OpCmd0x01
-#define EvTyp_Msg  0x02
-#define EvTyp_StateChange  0x08
-#define EvTyp_PMsgCmd  0x09
-#define EvTyp_CntlProgOpCmd0x20
-#define EvTyp_CntlProgIdent0x0B
-#define EvTyp_SigQuiesce   0x1D
-#define EvTyp_VT220Msg 0x1A
-#define EvTyp_SDIAS0x1C
-
-#define EvTyp_OpCmd_Mask   0x8000
-#define EvTyp_Msg_Mask 0x4000
-#define EvTyp_StateChange_Mask 0x0100
-#define EvTyp_PMsgCmd_Mask 0x0080
-#define EvTyp_CtlProgOpCmd_Mask0x0001
-#define EvTyp_CtlProgIdent_Mask0x0020
-#define EvTyp_SigQuiesce_Mask  0x0008
-#define EvTyp_VT220Msg_Mask0x0040
-#define EvTyp_SDIAS_Mask   0x0010
-
-#define GnrlMsgFlgs_DOM0x8000
-#define GnrlMsgFlgs_SndAlrm0x4000
-#define GnrlMsgFlgs_HoldMsg0x2000
-
-#define LnTpFlgs_CntlText  0x8000
-#define LnTpFlgs_LabelText 0x4000
-#define LnTpFlgs_DataText  0x2000
-#define LnTpFlgs_EndText   0x1000
-#define LnTpFlgs_PromptText0x0800
+#define EVTYP_OPCMD0x01
+#define EVTYP_MSG  0x02
+#define EVTYP_STATECHANGE  0x08
+#define EVTYP_PMSGCMD  0x09
+#define EVTYP_CNTLPROGOPCMD0x20
+#define EVTYP_CNTLPROGIDENT0x0B
+#define EVTYP_SIGQUIESCE   0x1D
+#define EVTYP_VT220MSG 0x1A
+#define EVTYP_SDIAS0x1C
+
+#define EVTYP_OPCMD_MASK   0x8000
+#define EVTYP_MSG_MASK 0x4000
+#define EVTYP_STATECHANGE_MASK 0x0100
+#define EVTYP_PMSGCMD_MASK 0x0080
+#define EVTYP_CTLPROGOPCMD_MASK0x0001
+#define EVTYP_CTLPROGIDENT_MASK0x0020
+#define EVTYP_SIGQUIESCE_MASK  0x0008
+#define EVTYP_VT220MSG_MASK0x0040
+#define EVTYP_SDIAS_MASK   0x0010
+
+#define GNRLMSGFLGS_DOM0x8000
+#define GNRLMSGFLGS_SNDALRM0x4000
+#define GNRLMSGFLGS_HOLDMSG0x2000
+
+#define LNTPFLGS_CNTLTEXT  0x8000
+#define LNTPFLGS_LABELTEXT 0x4000
+#define LNTPFLGS_DATATEXT  0x2000
+#define LNTPFLGS_ENDTEXT   0x1000
+#define LNTPFLGS_PROMPTTEXT0x0800
 
 typedef unsigned int sclp_cmdw_t;
 
@@ -58,15 +58,15 @@ typedef unsigned int sclp_cmdw_t;
 #define SCLP_CMDW_READ_SCP_INFO_FORCED 0x00120001
 
 #define GDS_ID_MDSMU   0x1310
-#define GDS_ID_MDSRouteInfo0x1311
-#define GDS_ID_AgUnWrkCorr 0x1549
-#define GDS_ID_SNACondReport   0x1532
+#define GDS_ID_MDSROUTEINFO0x1311
+#define GDS_ID_AGUNWRKCORR 0x1549
+#define GDS_ID_SNACONDREPORT   0x1532
 #define GDS_ID_CPMSU   0x1212
-#define GDS_ID_RoutTargInstr   0x154D
-#define GDS_ID_OpReq   0x8070
-#define GDS_ID_TextCmd 0x1320
+#define GDS_ID_ROUTTARGINSTR   0x154D
+#define GDS_ID_OPREQ   0x8070
+#define GDS_ID_TEXTCMD 0x1320
 
-#define GDS_KEY_SelfDefTextMsg 0x31
+#define GDS_KEY_SELFDEFTEXTMSG 0x31
 
 typedef u32 sccb_mask_t;   /* ATTENTION: assumes 32bit mask !!! */
 
diff --git a/drivers/s390/char/sclp_cpi.c b/drivers/s390/char/sclp_cpi.c
index 65aa2c8..29fe2a5 100644
--- a/drivers/s390/char/sclp_cpi.c
+++ b/

[S390] sclp: initialize early.

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b3d00c3b9278876b84a808bc513048b145fdef90
Commit: b3d00c3b9278876b84a808bc513048b145fdef90
Parent: b7127dfeed3252a76aa31f016aac5fba53d99711
Author: Peter Oberparleiter <[EMAIL PROTECTED]>
AuthorDate: Fri Apr 27 16:01:51 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:01:45 2007 +0200

[S390] sclp: initialize early.

Add explicit sclp initialization for those sclp users that do not
register with the interface.

Signed-off-by: Peter Oberparleiter <[EMAIL PROTECTED]>
Signed-off-by: Heiko Carstens <[EMAIL PROTECTED]>
Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
---
 drivers/s390/char/sclp.c |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/s390/char/sclp.c b/drivers/s390/char/sclp.c
index f171de3..bd219ab 100644
--- a/drivers/s390/char/sclp.c
+++ b/drivers/s390/char/sclp.c
@@ -15,6 +15,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -930,3 +931,10 @@ sclp_init(void)
sclp_init_mask(1);
return 0;
 }
+
+static __init int sclp_initcall(void)
+{
+   return sclp_init();
+}
+
+arch_initcall(sclp_initcall);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[S390] vmlogrdr: stop IUCV connection in vmlogrdr_release.

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=66b494a7178cbd84d8fc0e5f1e92d81fb6ec9f6e
Commit: 66b494a7178cbd84d8fc0e5f1e92d81fb6ec9f6e
Parent: b3d00c3b9278876b84a808bc513048b145fdef90
Author: Ursula Braun <[EMAIL PROTECTED]>
AuthorDate: Fri Apr 27 16:01:52 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:01:45 2007 +0200

[S390] vmlogrdr: stop IUCV connection in vmlogrdr_release.

Reopen of /dev/account failed. The IUCV path has to be terminated
in vmlogrdr_release.

Signed-off-by: Ursula Braun <[EMAIL PROTECTED]>
Signed-off-by: Heiko Carstens <[EMAIL PROTECTED]>
Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
---
 drivers/s390/char/vmlogrdr.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/s390/char/vmlogrdr.c b/drivers/s390/char/vmlogrdr.c
index b87d3b0..08797fa 100644
--- a/drivers/s390/char/vmlogrdr.c
+++ b/drivers/s390/char/vmlogrdr.c
@@ -385,6 +385,9 @@ static int vmlogrdr_release (struct inode *inode, struct 
file *filp)
 
struct vmlogrdr_priv_t * logptr = filp->private_data;
 
+   iucv_path_sever(logptr->path, NULL);
+   kfree(logptr->path);
+   logptr->path = NULL;
if (logptr->autorecording) {
ret = vmlogrdr_recording(logptr,0,logptr->autopurge);
if (ret)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[S390] vtime: cleanup per_cpu usage.

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=db77aa5f3d01fe6a6cc629dbd37936b1fdd129ba
Commit: db77aa5f3d01fe6a6cc629dbd37936b1fdd129ba
Parent: 131a395c18af43d824841642038e5cc0d48f0bd2
Author: Jan Glauber <[EMAIL PROTECTED]>
AuthorDate: Fri Apr 27 16:01:55 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:01:46 2007 +0200

[S390] vtime: cleanup per_cpu usage.

Replace per_cpu(... , smp_processor_id()) with __get_cpu_var()

Signed-off-by: Jan Glauber <[EMAIL PROTECTED]>
Signed-off-by: Heiko Carstens <[EMAIL PROTECTED]>
Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
---
 arch/s390/kernel/vtime.c |   16 +++-
 1 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/arch/s390/kernel/vtime.c b/arch/s390/kernel/vtime.c
index 9d5b028..1e1a6ee 100644
--- a/arch/s390/kernel/vtime.c
+++ b/arch/s390/kernel/vtime.c
@@ -128,7 +128,7 @@ static inline void set_vtimer(__u64 expires)
S390_lowcore.last_update_timer = expires;
 
/* store expire time for this CPU timer */
-   per_cpu(virt_cpu_timer, smp_processor_id()).to_expire = expires;
+   __get_cpu_var(virt_cpu_timer).to_expire = expires;
 }
 #else
 static inline void set_vtimer(__u64 expires)
@@ -137,7 +137,7 @@ static inline void set_vtimer(__u64 expires)
asm volatile ("SPT %0" : : "m" (S390_lowcore.last_update_timer));
 
/* store expire time for this CPU timer */
-   per_cpu(virt_cpu_timer, smp_processor_id()).to_expire = expires;
+   __get_cpu_var(virt_cpu_timer).to_expire = expires;
 }
 #endif
 
@@ -145,7 +145,7 @@ static void start_cpu_timer(void)
 {
struct vtimer_queue *vt_list;
 
-   vt_list = &per_cpu(virt_cpu_timer, smp_processor_id());
+   vt_list = &__get_cpu_var(virt_cpu_timer);
 
/* CPU timer interrupt is pending, don't reprogramm it */
if (vt_list->idle & 1LL<<63)
@@ -159,7 +159,7 @@ static void stop_cpu_timer(void)
 {
struct vtimer_queue *vt_list;
 
-   vt_list = &per_cpu(virt_cpu_timer, smp_processor_id());
+   vt_list = &__get_cpu_var(virt_cpu_timer);
 
/* nothing to do */
if (list_empty(&vt_list->list)) {
@@ -219,7 +219,7 @@ static void do_callbacks(struct list_head *cb_list)
if (list_empty(cb_list))
return;
 
-   vt_list = &per_cpu(virt_cpu_timer, smp_processor_id());
+   vt_list = &__get_cpu_var(virt_cpu_timer);
 
list_for_each_entry_safe(event, tmp, cb_list, entry) {
fn = event->function;
@@ -244,7 +244,6 @@ static void do_callbacks(struct list_head *cb_list)
  */
 static void do_cpu_timer_interrupt(__u16 error_code)
 {
-   int cpu;
__u64 next, delta;
struct vtimer_queue *vt_list;
struct vtimer_list *event, *tmp;
@@ -253,8 +252,7 @@ static void do_cpu_timer_interrupt(__u16 error_code)
struct list_head cb_list;
 
INIT_LIST_HEAD(&cb_list);
-   cpu = smp_processor_id();
-   vt_list = &per_cpu(virt_cpu_timer, cpu);
+   vt_list = &__get_cpu_var(virt_cpu_timer);
 
/* walk timer list, fire all expired events */
spin_lock(&vt_list->lock);
@@ -534,7 +532,7 @@ void init_cpu_vtimer(void)
/* enable cpu timer interrupts */
__ctl_set_bit(0,10);
 
-   vt_list = &per_cpu(virt_cpu_timer, smp_processor_id());
+   vt_list = &__get_cpu_var(virt_cpu_timer);
INIT_LIST_HEAD(&vt_list->list);
spin_lock_init(&vt_list->lock);
vt_list->to_expire = 0;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[S390] crypto: cleanup.

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=131a395c18af43d824841642038e5cc0d48f0bd2
Commit: 131a395c18af43d824841642038e5cc0d48f0bd2
Parent: 6d4740c89c187ee8f5ac7355c4eeffda26493d1f
Author: Jan Glauber <[EMAIL PROTECTED]>
AuthorDate: Fri Apr 27 16:01:54 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:01:46 2007 +0200

[S390] crypto: cleanup.

Cleanup code and remove obsolete documentation.

Signed-off-by: Jan Glauber <[EMAIL PROTECTED]>
Signed-off-by: Heiko Carstens <[EMAIL PROTECTED]>
Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
---
 Documentation/s390/crypto/crypto-API.txt |   83 ---
 arch/s390/crypto/sha1_s390.c |  129 +++---
 arch/s390/crypto/sha256_s390.c   |   38 -
 3 files changed, 81 insertions(+), 169 deletions(-)

diff --git a/Documentation/s390/crypto/crypto-API.txt 
b/Documentation/s390/crypto/crypto-API.txt
deleted file mode 100644
index 71ae6ca..000
--- a/Documentation/s390/crypto/crypto-API.txt
+++ /dev/null
@@ -1,83 +0,0 @@
-crypto-API support for z990 Message Security Assist (MSA) instructions
-~~
-
-AUTHOR:Thomas Spatzier ([EMAIL PROTECTED])
-
-
-1. Introduction crypto-API
-~~
-See Documentation/crypto/api-intro.txt for an introduction/description of the
-kernel crypto API.
-According to api-intro.txt support for z990 crypto instructions has been added
-in the algorithm api layer of the crypto API. Several files containing z990
-optimized implementations of crypto algorithms are placed in the
-arch/s390/crypto directory.
-
-
-2. Probing for availability of MSA
-~~
-It should be possible to use Kernels with the z990 crypto implementations both
-on machines with MSA available and on those without MSA (pre z990 or z990
-without MSA). Therefore a simple probing mechanism has been implemented:
-In the init function of each crypto module the availability of MSA and of the
-respective crypto algorithm in particular will be tested. If the algorithm is
-available the module will load and register its algorithm with the crypto API.
-
-If the respective crypto algorithm is not available, the init function will
-return -ENOSYS. In that case a fallback to the standard software implementation
-of the crypto algorithm must be taken ( -> the standard crypto modules are
-also built when compiling the kernel).
-
-
-3. Ensuring z990 crypto module preference
-~
-If z990 crypto instructions are available the optimized modules should be
-preferred instead of standard modules.
-
-3.1. compiled-in modules
-
-For compiled-in modules it has to be ensured that the z990 modules are linked
-before the standard crypto modules. Then, on system startup the init functions
-of z990 crypto modules will be called first and query for availability of z990
-crypto instructions. If instruction is available, the z990 module will register
-its crypto algorithm implementation -> the load of the standard module will 
fail
-since the algorithm is already registered.
-If z990 crypto instruction is not available the load of the z990 module will
-fail -> the standard module will load and register its algorithm.
-
-3.2. dynamic modules
-
-A system administrator has to take care of giving preference to z990 crypto
-modules. If MSA is available appropriate lines have to be added to
-/etc/modprobe.conf.
-
-Example:   z990 crypto instruction for SHA1 algorithm is available
-
-   add the following line to /etc/modprobe.conf (assuming the
-   z990 crypto modules for SHA1 is called sha1_z990):
-
-   alias sha1 sha1_z990
-
-   -> when the sha1 algorithm is requested through the crypto API
-   (which has a module autoloader) the z990 module will be loaded.
-
-TBD:   a userspace module probing mechanism
-   something like 'probe sha1 sha1_z990 sha1' in modprobe.conf
-   -> try module sha1_z990, if it fails to load standard module sha1
-   the 'probe' statement is currently not supported in modprobe.conf
-
-
-4. Currently implemented z990 crypto algorithms
-~~~
-The following crypto algorithms with z990 MSA support are currently 
implemented.
-The name of each algorithm under which it is registered in crypto API and the
-name of the respective module is given in square brackets.
-
-- SHA1 Digest Algorithm [sha1 -> sha1_z990]
-- DES Encrypt/Decrypt Algorithm (64bit key) [des -> des_z990]
-- Triple DES Encrypt/Decrypt Algorithm (128bit key) [des3_ede128 -> des_z990]
-- Triple DES Encrypt/Decrypt Algorithm (192bit key) [des3_ede -> des_z990]
-
-In order to load, for example, the sha1_z990 module when the sha1 algo

[S390] split page_test_and_clear_dirty.

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6c210482ae4a9a5bb9377ad250feaacec3faa3cd
Commit: 6c210482ae4a9a5bb9377ad250feaacec3faa3cd
Parent: 2fc2d1e9ffcde78af7ab63ed640d9a4901797de2
Author: Martin Schwidefsky <[EMAIL PROTECTED]>
AuthorDate: Fri Apr 27 16:01:57 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:01:46 2007 +0200

[S390] split page_test_and_clear_dirty.

The page_test_and_clear_dirty primitive really consists of two
operations, page_test_dirty and the page_clear_dirty. The combination
of the two is not an atomic operation, so it makes more sense to have
two separate operations instead of one.
In addition to the improved readability of the s390 version of
SetPageUptodate, it now avoids the page_test_dirty operation which is
an insert-storage-key-extended (iske) instruction which is an expensive
operation.

Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
---
 include/asm-generic/pgtable.h |   11 +--
 include/asm-s390/pgtable.h|   15 ---
 include/linux/page-flags.h|2 +-
 mm/rmap.c |8 ++--
 4 files changed, 24 insertions(+), 12 deletions(-)

diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
index 6d7e279..dc8f99e 100644
--- a/include/asm-generic/pgtable.h
+++ b/include/asm-generic/pgtable.h
@@ -139,8 +139,15 @@ static inline void ptep_set_wrprotect(struct mm_struct 
*mm, unsigned long addres
 #define pte_same(A,B)  (pte_val(A) == pte_val(B))
 #endif
 
-#ifndef __HAVE_ARCH_PAGE_TEST_AND_CLEAR_DIRTY
-#define page_test_and_clear_dirty(page) (0)
+#ifndef __HAVE_ARCH_PAGE_TEST_DIRTY
+#define page_test_dirty(page)  (0)
+#endif
+
+#ifndef __HAVE_ARCH_PAGE_CLEAR_DIRTY
+#define page_clear_dirty(page) do { } while (0)
+#endif
+
+#ifndef __HAVE_ARCH_PAGE_TEST_DIRTY
 #define pte_maybe_dirty(pte)   pte_dirty(pte)
 #else
 #define pte_maybe_dirty(pte)   (1)
diff --git a/include/asm-s390/pgtable.h b/include/asm-s390/pgtable.h
index 13c1654..8fe8d42 100644
--- a/include/asm-s390/pgtable.h
+++ b/include/asm-s390/pgtable.h
@@ -753,14 +753,14 @@ ptep_establish(struct vm_area_struct *vma,
  * should therefore only be called if it is not mapped in any
  * address space.
  */
-static inline int page_test_and_clear_dirty(struct page *page)
+static inline int page_test_dirty(struct page *page)
 {
-   unsigned long physpage = page_to_phys(page);
-   int skey = page_get_storage_key(physpage);
+   return (page_get_storage_key(page_to_phys(page)) & _PAGE_CHANGED) != 0;
+}
 
-   if (skey & _PAGE_CHANGED)
-   page_set_storage_key(physpage, skey & ~_PAGE_CHANGED);
-   return skey & _PAGE_CHANGED;
+static inline void page_clear_dirty(struct page *page)
+{
+   page_set_storage_key(page_to_phys(page), PAGE_DEFAULT_KEY);
 }
 
 /*
@@ -953,7 +953,8 @@ extern void memmap_init(unsigned long, int, unsigned long, 
unsigned long);
 #define __HAVE_ARCH_PTEP_CLEAR_FLUSH
 #define __HAVE_ARCH_PTEP_SET_WRPROTECT
 #define __HAVE_ARCH_PTE_SAME
-#define __HAVE_ARCH_PAGE_TEST_AND_CLEAR_DIRTY
+#define __HAVE_ARCH_PAGE_TEST_DIRTY
+#define __HAVE_ARCH_PAGE_CLEAR_DIRTY
 #define __HAVE_ARCH_PAGE_TEST_AND_CLEAR_YOUNG
 #include 
 
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 9cd0d0e..9632659 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -133,7 +133,7 @@
 static inline void SetPageUptodate(struct page *page)
 {
if (!test_and_set_bit(PG_uptodate, &page->flags))
-   page_test_and_clear_dirty(page);
+   page_clear_dirty(page);
 }
 #else
 #define SetPageUptodate(page)  set_bit(PG_uptodate, &(page)->flags)
diff --git a/mm/rmap.c b/mm/rmap.c
index b82146e..59da5b7 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -498,8 +498,10 @@ int page_mkclean(struct page *page)
struct address_space *mapping = page_mapping(page);
if (mapping)
ret = page_mkclean_file(mapping, page);
-   if (page_test_and_clear_dirty(page))
+   if (page_test_dirty(page)) {
+   page_clear_dirty(page);
ret = 1;
+   }
}
 
return ret;
@@ -605,8 +607,10 @@ void page_remove_rmap(struct page *page, struct 
vm_area_struct *vma)
 * Leaving it set also helps swapoff to reinstate ptes
 * faster for those pages still in swapcache.
 */
-   if (page_test_and_clear_dirty(page))
+   if (page_test_dirty(page)) {
+   page_clear_dirty(page);
set_page_dirty(page);
+   }
__dec_zone_page_state(page,
PageAnon(page) ? NR_ANON_PAGES : 
NR_FILE_MAPPED);
}
-
To unsubscribe from this list: send the line "uns

[S390] Processor degradation notification.

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2fc2d1e9ffcde78af7ab63ed640d9a4901797de2
Commit: 2fc2d1e9ffcde78af7ab63ed640d9a4901797de2
Parent: db77aa5f3d01fe6a6cc629dbd37936b1fdd129ba
Author: Heiko Carstens <[EMAIL PROTECTED]>
AuthorDate: Fri Apr 27 16:01:56 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:01:46 2007 +0200

[S390] Processor degradation notification.

Generate uevents for all cpus if cpu capability changes. This can
happen e.g. because the cpus are overheating. The cpu capability can
be read via /sys/devices/system/cpu/cpuN/capability.

Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
Signed-off-by: Heiko Carstens <[EMAIL PROTECTED]>
---
 arch/s390/kernel/smp.c  |   48 ++---
 drivers/s390/char/Makefile  |2 +-
 drivers/s390/char/sclp.h|2 +
 drivers/s390/char/sclp_config.c |   75 +++
 drivers/s390/sysinfo.c  |   18 +
 include/asm-s390/processor.h|1 +
 6 files changed, 140 insertions(+), 6 deletions(-)

diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index 7c0143f..2c5de92 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -821,19 +821,57 @@ int setup_profiling_timer(unsigned int multiplier)
 
 static DEFINE_PER_CPU(struct cpu, cpu_devices);
 
+static ssize_t show_capability(struct sys_device *dev, char *buf)
+{
+   unsigned int capability;
+   int rc;
+
+   rc = get_cpu_capability(&capability);
+   if (rc)
+   return rc;
+   return sprintf(buf, "%u\n", capability);
+}
+static SYSDEV_ATTR(capability, 0444, show_capability, NULL);
+
+static int __cpuinit smp_cpu_notify(struct notifier_block *self,
+   unsigned long action, void *hcpu)
+{
+   unsigned int cpu = (unsigned int)(long)hcpu;
+   struct cpu *c = &per_cpu(cpu_devices, cpu);
+   struct sys_device *s = &c->sysdev;
+
+   switch (action) {
+   case CPU_ONLINE:
+   if (sysdev_create_file(s, &attr_capability))
+   return NOTIFY_BAD;
+   break;
+   case CPU_DEAD:
+   sysdev_remove_file(s, &attr_capability);
+   break;
+   }
+   return NOTIFY_OK;
+}
+
+static struct notifier_block __cpuinitdata smp_cpu_nb = {
+   .notifier_call  = smp_cpu_notify,
+};
+
 static int __init topology_init(void)
 {
int cpu;
-   int ret;
+
+   register_cpu_notifier(&smp_cpu_nb);
 
for_each_possible_cpu(cpu) {
struct cpu *c = &per_cpu(cpu_devices, cpu);
+   struct sys_device *s = &c->sysdev;
 
c->hotpluggable = 1;
-   ret = register_cpu(c, cpu);
-   if (ret)
-   printk(KERN_WARNING "topology_init: register_cpu %d "
-  "failed (%d)\n", cpu, ret);
+   register_cpu(c, cpu);
+   if (!cpu_online(cpu))
+   continue;
+   s = &c->sysdev;
+   sysdev_create_file(s, &attr_capability);
}
return 0;
 }
diff --git a/drivers/s390/char/Makefile b/drivers/s390/char/Makefile
index a0f6db2..c210784 100644
--- a/drivers/s390/char/Makefile
+++ b/drivers/s390/char/Makefile
@@ -3,7 +3,7 @@
 #
 
 obj-y += ctrlchar.o keyboard.o defkeymap.o sclp.o sclp_rw.o sclp_quiesce.o \
-sclp_info.o sclp_chp.o
+sclp_info.o sclp_config.o sclp_chp.o
 
 obj-$(CONFIG_TN3270) += raw3270.o
 obj-$(CONFIG_TN3270_CONSOLE) += con3270.o
diff --git a/drivers/s390/char/sclp.h b/drivers/s390/char/sclp.h
index e03dcf4..87ac4a3 100644
--- a/drivers/s390/char/sclp.h
+++ b/drivers/s390/char/sclp.h
@@ -27,6 +27,7 @@
 #define EVTYP_CNTLPROGIDENT0x0B
 #define EVTYP_SIGQUIESCE   0x1D
 #define EVTYP_VT220MSG 0x1A
+#define EVTYP_CONFMGMDATA  0x04
 #define EVTYP_SDIAS0x1C
 
 #define EVTYP_OPCMD_MASK   0x8000
@@ -37,6 +38,7 @@
 #define EVTYP_CTLPROGIDENT_MASK0x0020
 #define EVTYP_SIGQUIESCE_MASK  0x0008
 #define EVTYP_VT220MSG_MASK0x0040
+#define EVTYP_CONFMGMDATA_MASK 0x1000
 #define EVTYP_SDIAS_MASK   0x0010
 
 #define GNRLMSGFLGS_DOM0x8000
diff --git a/drivers/s390/char/sclp_config.c b/drivers/s390/char/sclp_config.c
new file mode 100644
index 000..5322e5e
--- /dev/null
+++ b/drivers/s390/char/sclp_config.c
@@ -0,0 +1,75 @@
+/*
+ *  drivers/s390/char/sclp_config.c
+ *
+ *Copyright IBM Corp. 2007
+ *Author(s): Heiko Carstens <[EMAIL PROTECTED]>
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "sclp.h"
+
+#define TAG"sclp_config: "
+
+struct conf_mgm_data {
+   u8 reserved;
+   u8 ev_qualifier;
+} __attribute__((packed));
+
+#define EV_QUAL_CAP_CHANGE 3
+
+static struct work_struct sclp_cpu_capability_work;
+
+static void

[S390] Switch etr from tasklet to workqueue.

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ecdcc0234b27472b561378ac59e2beeea06ec6ff
Commit: ecdcc0234b27472b561378ac59e2beeea06ec6ff
Parent: 6c210482ae4a9a5bb9377ad250feaacec3faa3cd
Author: Martin Schwidefsky <[EMAIL PROTECTED]>
AuthorDate: Fri Apr 27 16:01:58 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:01:47 2007 +0200

[S390] Switch etr from tasklet to workqueue.

The clock synchronization of the ETR code requires an smp_call_function
to synchronize all cpus. Calling smp_call_function from a tasklet is
illegal. Replace the tasklet with a job on the global workqueue.
ETR work is rare and can be postponed to a be done by a kernel thread.

Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
---
 arch/s390/kernel/time.c |   34 +-
 1 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index e1ad464..711dae8 100644
--- a/arch/s390/kernel/time.c
+++ b/arch/s390/kernel/time.c
@@ -280,7 +280,6 @@ static void clock_comparator_interrupt(__u16 code)
 }
 
 static void etr_reset(void);
-static void etr_init(void);
 static void etr_ext_handler(__u16);
 
 /*
@@ -355,7 +354,6 @@ void __init time_init(void)
 #ifdef CONFIG_VIRT_TIMER
vtime_init();
 #endif
-   etr_init();
 }
 
 /*
@@ -426,11 +424,11 @@ static struct etr_aib etr_port1;
 static int etr_port1_uptodate;
 static unsigned long etr_events;
 static struct timer_list etr_timer;
-static struct tasklet_struct etr_tasklet;
 static DEFINE_PER_CPU(atomic_t, etr_sync_word);
 
 static void etr_timeout(unsigned long dummy);
-static void etr_tasklet_fn(unsigned long dummy);
+static void etr_work_fn(struct work_struct *work);
+static DECLARE_WORK(etr_work, etr_work_fn);
 
 /*
  * The etr get_clock function. It will write the current clock value
@@ -507,29 +505,31 @@ static void etr_reset(void)
}
 }
 
-static void etr_init(void)
+static int __init etr_init(void)
 {
struct etr_aib aib;
 
if (test_bit(ETR_FLAG_ENOSYS, &etr_flags))
-   return;
+   return 0;
/* Check if this machine has the steai instruction. */
if (etr_steai(&aib, ETR_STEAI_STEPPING_PORT) == 0)
set_bit(ETR_FLAG_STEAI, &etr_flags);
setup_timer(&etr_timer, etr_timeout, 0UL);
-   tasklet_init(&etr_tasklet, etr_tasklet_fn, 0);
if (!etr_port0_online && !etr_port1_online)
set_bit(ETR_FLAG_EACCES, &etr_flags);
if (etr_port0_online) {
set_bit(ETR_EVENT_PORT0_CHANGE, &etr_events);
-   tasklet_hi_schedule(&etr_tasklet);
+   schedule_work(&etr_work);
}
if (etr_port1_online) {
set_bit(ETR_EVENT_PORT1_CHANGE, &etr_events);
-   tasklet_hi_schedule(&etr_tasklet);
+   schedule_work(&etr_work);
}
+   return 0;
 }
 
+arch_initcall(etr_init);
+
 /*
  * Two sorts of ETR machine checks. The architecture reads:
  * "When a machine-check niterruption occurs and if a switch-to-local or
@@ -549,7 +549,7 @@ void etr_switch_to_local(void)
return;
etr_disable_sync_clock(NULL);
set_bit(ETR_EVENT_SWITCH_LOCAL, &etr_events);
-   tasklet_hi_schedule(&etr_tasklet);
+   schedule_work(&etr_work);
 }
 
 /*
@@ -564,7 +564,7 @@ void etr_sync_check(void)
return;
etr_disable_sync_clock(NULL);
set_bit(ETR_EVENT_SYNC_CHECK, &etr_events);
-   tasklet_hi_schedule(&etr_tasklet);
+   schedule_work(&etr_work);
 }
 
 /*
@@ -591,13 +591,13 @@ static void etr_ext_handler(__u16 code)
 * Both ports are not up-to-date now.
 */
set_bit(ETR_EVENT_PORT_ALERT, &etr_events);
-   tasklet_hi_schedule(&etr_tasklet);
+   schedule_work(&etr_work);
 }
 
 static void etr_timeout(unsigned long dummy)
 {
set_bit(ETR_EVENT_UPDATE, &etr_events);
-   tasklet_hi_schedule(&etr_tasklet);
+   schedule_work(&etr_work);
 }
 
 /*
@@ -927,7 +927,7 @@ static struct etr_eacr etr_handle_update(struct etr_aib 
*aib,
if (!eacr.e0 && !eacr.e1)
return eacr;
 
-   /* Update port0 or port1 with aib stored in etr_tasklet_fn. */
+   /* Update port0 or port1 with aib stored in etr_work_fn. */
if (aib->esw.q == 0) {
/* Information for port 0 stored. */
if (eacr.p0 && !etr_port0_uptodate) {
@@ -1007,7 +1007,7 @@ static void etr_update_eacr(struct etr_eacr eacr)
  * particular this is the only function that calls etr_update_eacr(),
  * it "controls" the etr control register.
  */
-static void etr_tasklet_fn(unsigned long dummy)
+static void etr_work_fn(struct work_struct *work)
 {
unsigned long long now;
struct etr_eacr eacr;
@@ -1220,13 +1220,13 @@ static ssize_t etr_online_store(struct sys_device *d

[S390] Clean up smp code in preparation for some larger changes.

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=39ce010d38bf6703b49f59eb73bef030b1d659f2
Commit: 39ce010d38bf6703b49f59eb73bef030b1d659f2
Parent: 9ff6f4577e69801a43c0d58606a80040aecbc4bc
Author: Heiko Carstens <[EMAIL PROTECTED]>
AuthorDate: Fri Apr 27 16:02:00 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:01:47 2007 +0200

[S390] Clean up smp code in preparation for some larger changes.

Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
Signed-off-by: Heiko Carstens <[EMAIL PROTECTED]>
---
 arch/s390/kernel/smp.c |  261 ++-
 include/asm-s390/smp.h |5 -
 2 files changed, 100 insertions(+), 166 deletions(-)

diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index 2c5de92..3754e20 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -1,12 +1,12 @@
 /*
  *  arch/s390/kernel/smp.c
  *
- *Copyright (C) IBM Corp. 1999,2006
+ *Copyright IBM Corp. 1999,2007
  *Author(s): Denis Joseph Barrow ([EMAIL PROTECTED],[EMAIL PROTECTED]),
- *   Martin Schwidefsky ([EMAIL PROTECTED])
- *   Heiko Carstens ([EMAIL PROTECTED])
+ *  Martin Schwidefsky ([EMAIL PROTECTED])
+ *  Heiko Carstens ([EMAIL PROTECTED])
  *
- *  based on other smp stuff by 
+ *  based on other smp stuff by
  *(c) 1995 Alan Cox, CymruNET Ltd  <[EMAIL PROTECTED]>
  *(c) 1998 Ingo Molnar
  *
@@ -43,16 +43,17 @@
 #include 
 #include 
 
-extern volatile int __cpu_logical_map[];
-
 /*
  * An array with a pointer the lowcore of every CPU.
  */
-
 struct _lowcore *lowcore_ptr[NR_CPUS];
+EXPORT_SYMBOL(lowcore_ptr);
 
 cpumask_t cpu_online_map = CPU_MASK_NONE;
+EXPORT_SYMBOL(cpu_online_map);
+
 cpumask_t cpu_possible_map = CPU_MASK_NONE;
+EXPORT_SYMBOL(cpu_possible_map);
 
 static struct task_struct *current_set[NR_CPUS];
 
@@ -72,7 +73,7 @@ struct call_data_struct {
int wait;
 };
 
-static struct call_data_struct * call_data;
+static struct call_data_struct *call_data;
 
 /*
  * 'Call function' interrupt callback
@@ -152,8 +153,8 @@ out:
  *
  * Run a function on all other CPUs.
  *
- * You must not call this function with disabled interrupts or from a
- * hardware interrupt handler. You may call it from a bottom half.
+ * You must not call this function with disabled interrupts, from a
+ * hardware interrupt handler or from a bottom half.
  */
 int smp_call_function(void (*func) (void *info), void *info, int nonatomic,
  int wait)
@@ -179,11 +180,11 @@ EXPORT_SYMBOL(smp_call_function);
  *
  * Run a function on one processor.
  *
- * You must not call this function with disabled interrupts or from a
- * hardware interrupt handler. You may call it from a bottom half.
+ * You must not call this function with disabled interrupts, from a
+ * hardware interrupt handler or from a bottom half.
  */
 int smp_call_function_on(void (*func) (void *info), void *info, int nonatomic,
- int wait, int cpu)
+int wait, int cpu)
 {
cpumask_t map = CPU_MASK_NONE;
 
@@ -197,9 +198,9 @@ EXPORT_SYMBOL(smp_call_function_on);
 
 static void do_send_stop(void)
 {
-int cpu, rc;
+   int cpu, rc;
 
-/* stop all processors */
+   /* stop all processors */
for_each_online_cpu(cpu) {
if (cpu == smp_processor_id())
continue;
@@ -211,9 +212,9 @@ static void do_send_stop(void)
 
 static void do_store_status(void)
 {
-int cpu, rc;
+   int cpu, rc;
 
-/* store status of all processors in their lowcores (real 0) */
+   /* store status of all processors in their lowcores (real 0) */
for_each_online_cpu(cpu) {
if (cpu == smp_processor_id())
continue;
@@ -221,8 +222,8 @@ static void do_store_status(void)
rc = signal_processor_p(
(__u32)(unsigned long) lowcore_ptr[cpu], cpu,
sigp_store_status_at_address);
-   } while(rc == sigp_busy);
-}
+   } while (rc == sigp_busy);
+   }
 }
 
 static void do_wait_for_stop(void)
@@ -233,7 +234,7 @@ static void do_wait_for_stop(void)
for_each_online_cpu(cpu) {
if (cpu == smp_processor_id())
continue;
-   while(!smp_cpu_not_running(cpu))
+   while (!smp_cpu_not_running(cpu))
cpu_relax();
}
 }
@@ -247,7 +248,7 @@ void smp_send_stop(void)
/* Disable all interrupts/machine checks */
__load_psw_mask(psw_kernel_bits & ~PSW_MASK_MCHECK);
 
-/* write magic number to zero page (absolute 0) */
+   /* write magic number to zero page (absolute 0) */
lowcore_ptr[smp_processor_id()]->panic_magic = __PANIC_MAGIC;
 
/* stop other processor

[MIPS] Fix AP/SP to work in the reality of modern kernels.

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7f5a7716dc0b380fd3c85ca5a5841969555feaa7
Commit: 7f5a7716dc0b380fd3c85ca5a5841969555feaa7
Parent: de46c33745f5e2ad594c72f2cf5f490861b16ce1
Author: Ralf Baechle <[EMAIL PROTECTED]>
AuthorDate: Wed Apr 25 15:08:57 2007 +0100
Committer:  Ralf Baechle <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:20:23 2007 +0100

[MIPS] Fix AP/SP to work in the reality of modern kernels.

Signed-off-by: Ralf Baechle <[EMAIL PROTECTED]>
---
 arch/mips/kernel/kspd.c |5 +
 arch/mips/kernel/rtlx.c |7 ---
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/arch/mips/kernel/kspd.c b/arch/mips/kernel/kspd.c
index 29eadd4..c658001 100644
--- a/arch/mips/kernel/kspd.c
+++ b/arch/mips/kernel/kspd.c
@@ -17,6 +17,7 @@
  */
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -198,7 +199,6 @@ void sp_work_handle_request(void)
int cmd;
 
char *vcwd;
-   mm_segment_t old_fs;
int size;
 
ret.retval = -1;
@@ -241,8 +241,6 @@ void sp_work_handle_request(void)
if ((ret.retval = sp_syscall(__NR_gettimeofday, (int)&tv,
 (int)&tz, 0,0)) == 0)
ret.retval = tv.tv_sec;
-
-   ret.errno = errno;
break;
 
case MTSP_SYSCALL_EXIT:
@@ -279,7 +277,6 @@ void sp_work_handle_request(void)
if (cmd >= 0) {
ret.retval = sp_syscall(cmd, generic.arg0, generic.arg1,
generic.arg2, generic.arg3);
-   ret.errno = errno;
} else
printk(KERN_WARNING
   "KSPD: Unknown SP syscall number %d\n", sc.cmd);
diff --git a/arch/mips/kernel/rtlx.c b/arch/mips/kernel/rtlx.c
index e6e3047..bfc8ca1 100644
--- a/arch/mips/kernel/rtlx.c
+++ b/arch/mips/kernel/rtlx.c
@@ -289,7 +289,7 @@ unsigned int rtlx_write_poll(int index)
return write_spacefree(chan->rt_read, chan->rt_write, 
chan->buffer_size);
 }
 
-ssize_t rtlx_read(int index, void __user *buff, size_t count, int user)
+ssize_t rtlx_read(int index, void __user *buff, size_t count)
 {
size_t lx_write, fl = 0L;
struct rtlx_channel *lx;
@@ -331,9 +331,10 @@ out:
return count;
 }
 
-ssize_t rtlx_write(int index, const void __user *buffer, size_t count, int 
user)
+ssize_t rtlx_write(int index, const void __user *buffer, size_t count)
 {
struct rtlx_channel *rt;
+   unsigned long failed;
size_t rt_read;
size_t fl;
 
@@ -363,7 +364,7 @@ ssize_t rtlx_write(int index, const void __user *buffer, 
size_t count, int user)
}
 
 out:
-   count -= cailed;
+   count -= failed;
 
smp_wmb();
rt->rt_write = (rt->rt_write + count) % rt->buffer_size;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[S390] SPIN_LOCK_UNLOCKED cleanup in drivers/s390

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=cb629a01bb5bca951287e761c590a5686c6ca416
Commit: cb629a01bb5bca951287e761c590a5686c6ca416
Parent: 39ce010d38bf6703b49f59eb73bef030b1d659f2
Author: Milind Arun Choudhary <[EMAIL PROTECTED]>
AuthorDate: Fri Apr 27 16:02:01 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:01:48 2007 +0200

[S390] SPIN_LOCK_UNLOCKED cleanup in drivers/s390

SPIN_LOCK_UNLOCKED cleanup,use __SPIN_LOCK_UNLOCKED instead.

Signed-off-by: Milind Arun Choudhary <[EMAIL PROTECTED]>
Cc: Heiko Carstens <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
---
 drivers/s390/char/vmlogrdr.c |6 +++---
 drivers/s390/cio/cmf.c   |2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/s390/char/vmlogrdr.c b/drivers/s390/char/vmlogrdr.c
index 08797fa..a5a00e9 100644
--- a/drivers/s390/char/vmlogrdr.c
+++ b/drivers/s390/char/vmlogrdr.c
@@ -125,7 +125,7 @@ static struct vmlogrdr_priv_t sys_ser[] = {
  .recording_name = "EREP",
  .minor_num  = 0,
  .buffer_free= 1,
- .priv_lock  = SPIN_LOCK_UNLOCKED,
+ .priv_lock  = __SPIN_LOCK_UNLOCKED(sys_ser[0].priv_lock),
  .autorecording  = 1,
  .autopurge  = 1,
},
@@ -134,7 +134,7 @@ static struct vmlogrdr_priv_t sys_ser[] = {
  .recording_name = "ACCOUNT",
  .minor_num  = 1,
  .buffer_free= 1,
- .priv_lock  = SPIN_LOCK_UNLOCKED,
+ .priv_lock  = __SPIN_LOCK_UNLOCKED(sys_ser[1].priv_lock),
  .autorecording  = 1,
  .autopurge  = 1,
},
@@ -143,7 +143,7 @@ static struct vmlogrdr_priv_t sys_ser[] = {
  .recording_name = "SYMPTOM",
  .minor_num  = 2,
  .buffer_free= 1,
- .priv_lock  = SPIN_LOCK_UNLOCKED,
+ .priv_lock  = __SPIN_LOCK_UNLOCKED(sys_ser[2].priv_lock),
  .autorecording  = 1,
  .autopurge  = 1,
}
diff --git a/drivers/s390/cio/cmf.c b/drivers/s390/cio/cmf.c
index 90b22fa..28abd69 100644
--- a/drivers/s390/cio/cmf.c
+++ b/drivers/s390/cio/cmf.c
@@ -476,7 +476,7 @@ struct cmb_area {
 };
 
 static struct cmb_area cmb_area = {
-   .lock = SPIN_LOCK_UNLOCKED,
+   .lock = __SPIN_LOCK_UNLOCKED(cmb_area.lock),
.list = LIST_HEAD_INIT(cmb_area.list),
.num_channels  = 1024,
 };
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[S390] Remove debugging junk.

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9ff6f4577e69801a43c0d58606a80040aecbc4bc
Commit: 9ff6f4577e69801a43c0d58606a80040aecbc4bc
Parent: ecdcc0234b27472b561378ac59e2beeea06ec6ff
Author: Martin Schwidefsky <[EMAIL PROTECTED]>
AuthorDate: Fri Apr 27 16:01:59 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:01:47 2007 +0200

[S390] Remove debugging junk.

arch/s390/appldata/appldata_base.c has some confusing debugging code left
over to allow compiling it as a module. In practice, it cannot be configured
as module and there is no need to keep that code.

Signed-off-by: Gerald Schaefer <[EMAIL PROTECTED]>
Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
---
 arch/s390/appldata/appldata_base.c |   38 
 1 files changed, 0 insertions(+), 38 deletions(-)

diff --git a/arch/s390/appldata/appldata_base.c 
b/arch/s390/appldata/appldata_base.c
index 0c3cf4b..ee89b33 100644
--- a/arch/s390/appldata/appldata_base.c
+++ b/arch/s390/appldata/appldata_base.c
@@ -668,45 +668,7 @@ EXPORT_SYMBOL_GPL(appldata_register_ops);
 EXPORT_SYMBOL_GPL(appldata_unregister_ops);
 EXPORT_SYMBOL_GPL(appldata_diag);
 
-#ifdef MODULE
-/*
- * Kernel symbols needed by appldata_mem and appldata_os modules.
- * However, if this file is compiled as a module (for testing only), these
- * symbols are not exported. In this case, we define them locally and export
- * those.
- */
-void si_swapinfo(struct sysinfo *val)
-{
-   val->freeswap = -1ul;
-   val->totalswap = -1ul;
-}
-
-unsigned long avenrun[3] = {-1 - FIXED_1/200, -1 - FIXED_1/200,
-   -1 - FIXED_1/200};
-int nr_threads = -1;
-
-void get_full_page_state(struct page_state *ps)
-{
-   memset(ps, -1, sizeof(struct page_state));
-}
-
-unsigned long nr_running(void)
-{
-   return -1;
-}
-
-unsigned long nr_iowait(void)
-{
-   return -1;
-}
-
-/*unsigned long nr_context_switches(void)
-{
-   return -1;
-}*/
-#endif /* MODULE */
 EXPORT_SYMBOL_GPL(si_swapinfo);
 EXPORT_SYMBOL_GPL(nr_threads);
 EXPORT_SYMBOL_GPL(nr_running);
 EXPORT_SYMBOL_GPL(nr_iowait);
-//EXPORT_SYMBOL_GPL(nr_context_switches);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] Cobalt: clean up include files

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=cc50b67dcd84c6215232c0e1c95e24786e555782
Commit: cc50b67dcd84c6215232c0e1c95e24786e555782
Parent: 7f5a7716dc0b380fd3c85ca5a5841969555feaa7
Author: Yoichi Yuasa <[EMAIL PROTECTED]>
AuthorDate: Tue Mar 6 21:34:44 2007 +0900
Committer:  Ralf Baechle <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:20:23 2007 +0100

[MIPS] Cobalt: clean up include files

Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]>
---
 arch/mips/cobalt/console.c |8 +++-
 arch/mips/cobalt/irq.c |2 +-
 arch/mips/cobalt/reset.c   |   11 ---
 arch/mips/cobalt/setup.c   |4 +---
 4 files changed, 9 insertions(+), 16 deletions(-)

diff --git a/arch/mips/cobalt/console.c b/arch/mips/cobalt/console.c
index ca56b41..0485d51 100644
--- a/arch/mips/cobalt/console.c
+++ b/arch/mips/cobalt/console.c
@@ -1,13 +1,11 @@
 /*
  * (C) P. Horton 2006
  */
-
-#include 
-#include 
-#include 
 #include 
+
 #include 
-#include 
+
+#include 
 
 void prom_putchar(char c)
 {
diff --git a/arch/mips/cobalt/irq.c b/arch/mips/cobalt/irq.c
index fe93b84..950ad1e 100644
--- a/arch/mips/cobalt/irq.c
+++ b/arch/mips/cobalt/irq.c
@@ -17,7 +17,7 @@
 #include 
 #include 
 
-#include 
+#include 
 
 /*
  * We have two types of interrupts that we handle, ones that come in through
diff --git a/arch/mips/cobalt/reset.c b/arch/mips/cobalt/reset.c
index 753dfcc..43cca21 100644
--- a/arch/mips/cobalt/reset.c
+++ b/arch/mips/cobalt/reset.c
@@ -8,15 +8,12 @@
  * Copyright (C) 1995, 1996, 1997 by Ralf Baechle
  * Copyright (C) 2001 by Liam Davies ([EMAIL PROTECTED])
  */
-#include 
-#include 
-#include 
+#include 
+
 #include 
-#include 
 #include 
-#include 
-#include 
-#include 
+
+#include 
 
 void cobalt_machine_halt(void)
 {
diff --git a/arch/mips/cobalt/setup.c b/arch/mips/cobalt/setup.c
index 88d34f1..db0d83c 100644
--- a/arch/mips/cobalt/setup.c
+++ b/arch/mips/cobalt/setup.c
@@ -19,12 +19,10 @@
 #include 
 #include 
 #include 
-#include 
-#include 
 #include 
 #include 
 
-#include 
+#include 
 
 extern void cobalt_machine_restart(char *command);
 extern void cobalt_machine_halt(void);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] Cobalt: Split PCI codes from setup.c

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2a9effc67804102d6d5182eb0116520588ae2256
Commit: 2a9effc67804102d6d5182eb0116520588ae2256
Parent: cc50b67dcd84c6215232c0e1c95e24786e555782
Author: Yoichi Yuasa <[EMAIL PROTECTED]>
AuthorDate: Mon Mar 5 19:10:03 2007 +0900
Committer:  Ralf Baechle <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:20:23 2007 +0100

[MIPS] Cobalt: Split PCI codes from setup.c

It's removed #ifdef CONFIG_PCI/#endif from cobalt setup.c .

Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]>
Signed-off-by: Ralf Baechle <[EMAIL PROTECTED]>
---
 arch/mips/cobalt/Makefile |1 +
 arch/mips/cobalt/pci.c|   47 +
 arch/mips/cobalt/setup.c  |   28 --
 3 files changed, 48 insertions(+), 28 deletions(-)

diff --git a/arch/mips/cobalt/Makefile b/arch/mips/cobalt/Makefile
index b36dd8f..de017c1 100644
--- a/arch/mips/cobalt/Makefile
+++ b/arch/mips/cobalt/Makefile
@@ -4,5 +4,6 @@
 
 obj-y   := irq.o reset.o setup.o
 
+obj-$(CONFIG_PCI)  += pci.o
 obj-$(CONFIG_EARLY_PRINTK) += console.o
 obj-$(CONFIG_MTD_PHYSMAP)  += mtd.o
diff --git a/arch/mips/cobalt/pci.c b/arch/mips/cobalt/pci.c
new file mode 100644
index 000..d016006
--- /dev/null
+++ b/arch/mips/cobalt/pci.c
@@ -0,0 +1,47 @@
+/*
+ * Register PCI controller.
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1996, 1997, 2004, 05 by Ralf Baechle ([EMAIL PROTECTED])
+ * Copyright (C) 2001, 2002, 2003 by Liam Davies ([EMAIL PROTECTED])
+ *
+ */
+#include 
+#include 
+
+#include 
+
+extern struct pci_ops gt64111_pci_ops;
+
+static struct resource cobalt_mem_resource = {
+   .start  = GT_DEF_PCI0_MEM0_BASE,
+   .end= GT_DEF_PCI0_MEM0_BASE + GT_DEF_PCI0_MEM0_SIZE - 1,
+   .name   = "PCI memory",
+   .flags  = IORESOURCE_MEM,
+};
+
+static struct resource cobalt_io_resource = {
+   .start  = 0x1000,
+   .end= GT_DEF_PCI0_IO_SIZE - 1,
+   .name   = "PCI I/O",
+   .flags  = IORESOURCE_IO,
+};
+
+static struct pci_controller cobalt_pci_controller = {
+   .pci_ops= >64111_pci_ops,
+   .mem_resource   = &cobalt_mem_resource,
+   .io_resource= &cobalt_io_resource,
+   .io_offset  = 0 - GT_DEF_PCI0_IO_BASE,
+};
+
+static int __init cobalt_pci_init(void)
+{
+   register_pci_controller(&cobalt_pci_controller);
+
+   return 0;
+}
+
+arch_initcall(cobalt_pci_init);
diff --git a/arch/mips/cobalt/setup.c b/arch/mips/cobalt/setup.c
index db0d83c..d0dd817 100644
--- a/arch/mips/cobalt/setup.c
+++ b/arch/mips/cobalt/setup.c
@@ -61,22 +61,6 @@ void __init plat_timer_setup(struct irqaction *irq)
GT_WRITE(GT_INTRMASK_OFS, GT_INTR_T0EXP_MSK | GT_READ(GT_INTRMASK_OFS));
 }
 
-extern struct pci_ops gt64111_pci_ops;
-
-static struct resource cobalt_mem_resource = {
-   .start  = GT_DEF_PCI0_MEM0_BASE,
-   .end= GT_DEF_PCI0_MEM0_BASE + GT_DEF_PCI0_MEM0_SIZE - 1,
-   .name   = "PCI memory",
-   .flags  = IORESOURCE_MEM
-};
-
-static struct resource cobalt_io_resource = {
-   .start  = 0x1000,
-   .end= 0x,
-   .name   = "PCI I/O",
-   .flags  = IORESOURCE_IO
-};
-
 /*
  * Cobalt doesn't have PS/2 keyboard/mouse interfaces,
  * keyboard conntroller is never used.
@@ -109,14 +93,6 @@ static struct resource cobalt_reserved_resources[] = {
},
 };
 
-static struct pci_controller cobalt_pci_controller = {
-   .pci_ops= >64111_pci_ops,
-   .mem_resource   = &cobalt_mem_resource,
-   .mem_offset = 0,
-   .io_resource= &cobalt_io_resource,
-   .io_offset  = 0 - GT_DEF_PCI0_IO_BASE,
-};
-
 void __init plat_mem_setup(void)
 {
static struct uart_port uart;
@@ -144,10 +120,6 @@ void __init plat_mem_setup(void)
 
printk("Cobalt board ID: %d\n", cobalt_board_id);
 
-#ifdef CONFIG_PCI
-   register_pci_controller(&cobalt_pci_controller);
-#endif
-
if (cobalt_board_id > COBALT_BRD_ID_RAQ1) {
 #ifdef CONFIG_SERIAL_8250
uart.line   = 0;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] merge GT64111 PCI routines and GT64120 PCI_0 routines

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=252161eccd1a44f32a506d0fedb424d4ff84e4dc
Commit: 252161eccd1a44f32a506d0fedb424d4ff84e4dc
Parent: 2a9effc67804102d6d5182eb0116520588ae2256
Author: Yoichi Yuasa <[EMAIL PROTECTED]>
AuthorDate: Wed Mar 14 21:51:26 2007 +0900
Committer:  Ralf Baechle <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:20:23 2007 +0100

[MIPS] merge GT64111 PCI routines and GT64120 PCI_0 routines

This patch has merged GT64111 PCI routines and GT64120 PCI_0 routines.
GT64111 PCI is almost the same as GT64120's PCI_0.
This patch don't change GT64120 PCI routines.

Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]>
Signed-off-by: Ralf Baechle <[EMAIL PROTECTED]>
---
 arch/mips/Kconfig   |   19 ++---
 arch/mips/cobalt/pci.c  |4 +-
 arch/mips/gt64120/wrppmc/pci.c  |4 +-
 arch/mips/mips-boards/generic/pci.c |4 +-
 arch/mips/pci/Makefile  |3 +-
 arch/mips/pci/ops-gt64111.c |  100 ---
 arch/mips/pci/ops-gt64120.c |  152 ---
 arch/mips/pci/ops-gt64xxx_pci0.c|  152 +++
 arch/mips/pci/pci-lasat.c   |4 +-
 arch/mips/pci/pci-ocelot.c  |2 +-
 10 files changed, 170 insertions(+), 274 deletions(-)

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index c78b143..2fd82e5 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -165,7 +165,7 @@ config MIPS_COBALT
select HW_HAS_PCI
select I8259
select IRQ_CPU
-   select MIPS_GT64111
+   select PCI_GT64XXX_PCI0
select SYS_HAS_CPU_NEVADA
select SYS_HAS_EARLY_PRINTK
select SYS_SUPPORTS_32BIT_KERNEL
@@ -207,7 +207,7 @@ config MIPS_EV64120
depends on EXPERIMENTAL
select DMA_NONCOHERENT
select HW_HAS_PCI
-   select MIPS_GT64120
+   select PCI_GT64XXX_PCI0
select SYS_HAS_CPU_R5000
select SYS_SUPPORTS_32BIT_KERNEL
select SYS_SUPPORTS_64BIT_KERNEL
@@ -245,7 +245,7 @@ config LASAT
select DMA_NONCOHERENT
select SYS_HAS_EARLY_PRINTK
select HW_HAS_PCI
-   select MIPS_GT64120
+   select PCI_GT64XXX_PCI0
select MIPS_NILE4
select R5000_CPU_SCACHE
select SYS_HAS_CPU_R5000
@@ -263,7 +263,7 @@ config MIPS_ATLAS
select HW_HAS_PCI
select MIPS_BOARDS_GEN
select MIPS_BONITO64
-   select MIPS_GT64120
+   select PCI_GT64XXX_PCI0
select MIPS_MSC
select RM7000_CPU_SCACHE
select SWAP_IO_SPACE
@@ -296,7 +296,7 @@ config MIPS_MALTA
select MIPS_BOARDS_GEN
select MIPS_BONITO64
select MIPS_CPU_SCACHE
-   select MIPS_GT64120
+   select PCI_GT64XXX_PCI0
select MIPS_MSC
select SWAP_IO_SPACE
select SYS_HAS_CPU_MIPS32_R1
@@ -340,7 +340,7 @@ config WR_PPMC
select BOOT_ELF32
select DMA_NONCOHERENT
select HW_HAS_PCI
-   select MIPS_GT64120
+   select PCI_GT64XXX_PCI0
select SWAP_IO_SPACE
select SYS_HAS_CPU_MIPS32_R1
select SYS_HAS_CPU_MIPS32_R2
@@ -398,7 +398,7 @@ config MOMENCO_OCELOT
select HW_HAS_PCI
select IRQ_CPU
select IRQ_CPU_RM7K
-   select MIPS_GT64120
+   select PCI_GT64XXX_PCI0
select RM7000_CPU_SCACHE
select SWAP_IO_SPACE
select SYS_HAS_CPU_RM7000
@@ -999,10 +999,7 @@ config DDB5XXX_COMMON
 config MIPS_BOARDS_GEN
bool
 
-config MIPS_GT64111
-   bool
-
-config MIPS_GT64120
+config PCI_GT64XXX_PCI0
bool
 
 config MIPS_TX3927
diff --git a/arch/mips/cobalt/pci.c b/arch/mips/cobalt/pci.c
index d016006..d91027f 100644
--- a/arch/mips/cobalt/pci.c
+++ b/arch/mips/cobalt/pci.c
@@ -14,7 +14,7 @@
 
 #include 
 
-extern struct pci_ops gt64111_pci_ops;
+extern struct pci_ops gt64xxx_pci0_ops;
 
 static struct resource cobalt_mem_resource = {
.start  = GT_DEF_PCI0_MEM0_BASE,
@@ -31,7 +31,7 @@ static struct resource cobalt_io_resource = {
 };
 
 static struct pci_controller cobalt_pci_controller = {
-   .pci_ops= >64111_pci_ops,
+   .pci_ops= >64xxx_pci0_ops,
.mem_resource   = &cobalt_mem_resource,
.io_resource= &cobalt_io_resource,
.io_offset  = 0 - GT_DEF_PCI0_IO_BASE,
diff --git a/arch/mips/gt64120/wrppmc/pci.c b/arch/mips/gt64120/wrppmc/pci.c
index 2fbe934..0d5289b 100644
--- a/arch/mips/gt64120/wrppmc/pci.c
+++ b/arch/mips/gt64120/wrppmc/pci.c
@@ -13,7 +13,7 @@
 #include 
 #include 
 
-extern struct pci_ops gt64120_pci_ops;
+extern struct pci_ops gt64xxx_pci0_ops;
 
 static struct resource pci0_io_resource = {
.name  = "pci_0 io",
@@ -30,7 +30,7 @@ static struct resource pci0_mem_resource = {
 };
 
 static struct pci_controller hose_0 = {
-   .pci_ops= >64120_pci_ops,
+   .pci_ops= >64xxx_pci0_ops,
.io_resource   

[MIPS] IP22: Get rid of volatile in IP22 core code.

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=78709b9df35346965b214e0e548412748d147776
Commit: 78709b9df35346965b214e0e548412748d147776
Parent: 2127435e57a15f1fea8d6969e264eeb05b28ba4b
Author: Ralf Baechle <[EMAIL PROTECTED]>
AuthorDate: Thu Apr 26 15:46:24 2007 +0100
Committer:  Ralf Baechle <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:20:23 2007 +0100

[MIPS] IP22: Get rid of volatile in IP22 core code.

Signed-off-by: Ralf Baechle <[EMAIL PROTECTED]>
---
 arch/mips/sgi-ip22/ip22-nvram.c |   24 
 arch/mips/sgi-ip22/ip22-time.c  |   14 +++---
 include/asm-mips/sgi/hpc3.h |2 +-
 include/asm-mips/sgi/ip22.h |2 +-
 include/asm-mips/sgi/mc.h   |2 +-
 5 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/arch/mips/sgi-ip22/ip22-nvram.c b/arch/mips/sgi-ip22/ip22-nvram.c
index fd29fd4..e19d60d 100644
--- a/arch/mips/sgi-ip22/ip22-nvram.c
+++ b/arch/mips/sgi-ip22/ip22-nvram.c
@@ -52,8 +52,7 @@
  * national semiconductor nv ram chip the op code is 3 bits and
  * the address is 6/8 bits.
  */
-static inline void eeprom_cmd(volatile unsigned int *ctrl, unsigned cmd,
- unsigned reg)
+static inline void eeprom_cmd(unsigned int *ctrl, unsigned cmd, unsigned reg)
 {
unsigned short ser_cmd;
int i;
@@ -61,33 +60,34 @@ static inline void eeprom_cmd(volatile unsigned int *ctrl, 
unsigned cmd,
ser_cmd = cmd | (reg << (16 - BITS_IN_COMMAND));
for (i = 0; i < BITS_IN_COMMAND; i++) {
if (ser_cmd & (1<<15))  /* if high order bit set */
-   *ctrl |= EEPROM_DATO;
+   writel(readl(ctrl) | EEPROM_DATO, ctrl);
else
-   *ctrl &= ~EEPROM_DATO;
-   *ctrl &= ~EEPROM_ECLK;
-   *ctrl |= EEPROM_ECLK;
+   writel(readl(ctrl) & ~EEPROM_DATO, ctrl);
+   writel(readl(ctrl) & ~EEPROM_ECLK, ctrl);
+   writel(readl(ctrl) | EEPROM_ECLK, ctrl);
ser_cmd <<= 1;
}
-   *ctrl &= ~EEPROM_DATO;  /* see data sheet timing diagram */
+   /* see data sheet timing diagram */
+   writel(readl(ctrl) & ~EEPROM_DATO, ctrl);
 }
 
-unsigned short ip22_eeprom_read(volatile unsigned int *ctrl, int reg)
+unsigned short ip22_eeprom_read(unsigned int *ctrl, int reg)
 {
unsigned short res = 0;
int i;
 
-   *ctrl &= ~EEPROM_EPROT;
+   writel(readl(ctrl) & ~EEPROM_EPROT, ctrl);
eeprom_cs_on(ctrl);
eeprom_cmd(ctrl, EEPROM_READ, reg);
 
/* clock the data ouf of serial mem */
for (i = 0; i < 16; i++) {
-   *ctrl &= ~EEPROM_ECLK;
+   writel(readl(ctrl) & ~EEPROM_ECLK, ctrl);
delay();
-   *ctrl |= EEPROM_ECLK;
+   writel(readl(ctrl) | EEPROM_ECLK, ctrl);
delay();
res <<= 1;
-   if (*ctrl & EEPROM_DATI)
+   if (readl(ctrl) & EEPROM_DATI)
res |= 1;
}
 
diff --git a/arch/mips/sgi-ip22/ip22-time.c b/arch/mips/sgi-ip22/ip22-time.c
index 2055547..8e88a44 100644
--- a/arch/mips/sgi-ip22/ip22-time.c
+++ b/arch/mips/sgi-ip22/ip22-time.c
@@ -94,7 +94,7 @@ static int indy_rtc_set_time(unsigned long tim)
 static unsigned long dosample(void)
 {
u32 ct0, ct1;
-   volatile u8 msb, lsb;
+   u8 msb, lsb;
 
/* Start the counter. */
sgint->tcword = (SGINT_TCWORD_CNT2 | SGINT_TCWORD_CALL |
@@ -107,21 +107,21 @@ static unsigned long dosample(void)
 
/* Latch and spin until top byte of counter2 is zero */
do {
-   sgint->tcword = SGINT_TCWORD_CNT2 | SGINT_TCWORD_CLAT;
-   lsb = sgint->tcnt2;
-   msb = sgint->tcnt2;
+   writeb(SGINT_TCWORD_CNT2 | SGINT_TCWORD_CLAT, &sgint->tcword);
+   lsb = readb(&sgint->tcnt2);
+   msb = readb(&sgint->tcnt2);
ct1 = read_c0_count();
} while (msb);
 
/* Stop the counter. */
-   sgint->tcword = (SGINT_TCWORD_CNT2 | SGINT_TCWORD_CALL |
-SGINT_TCWORD_MSWST);
+   writeb(sgint->tcword, (SGINT_TCWORD_CNT2 | SGINT_TCWORD_CALL |
+  SGINT_TCWORD_MSWST));
/*
 * Return the difference, this is how far the r4k counter increments
 * for every 1/HZ seconds. We round off the nearest 1 MHz of master
 * clock (= 100 / HZ / 2).
 */
-   /*return (ct1 - ct0 + (50/HZ/2)) / (50/HZ) * (50/HZ);*/
+
return (ct1 - ct0) / (50/HZ) * (50/HZ);
 }
 
diff --git a/include/asm-mips/sgi/hpc3.h b/include/asm-mips/sgi/hpc3.h
index fcec52b..c4729f5 100644
--- a/include/asm-mips/sgi/hpc3.h
+++ b/include/asm-mips/sgi/hpc3.h
@@ -206,7 +206,7 @@ struct hpc3_regs {
 #define HPC3_GIOMISC_ERTIME0x1 /* Enable external timer real time.

[MIPS] Remove unused argument from kunmap_coherent().

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=eacb9d61919db56482dcea7ec943c9508175dc16
Commit: eacb9d61919db56482dcea7ec943c9508175dc16
Parent: e3cf10e93f42171224e88b06c226d450f3b3a55f
Author: Ralf Baechle <[EMAIL PROTECTED]>
AuthorDate: Thu Apr 26 15:46:25 2007 +0100
Committer:  Ralf Baechle <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:20:24 2007 +0100

[MIPS] Remove unused argument from kunmap_coherent().

Signed-off-by: Ralf Baechle <[EMAIL PROTECTED]>
---
 arch/mips/mm/cache.c  |2 +-
 arch/mips/mm/init.c   |8 
 include/asm-mips/cacheflush.h |2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/mips/mm/cache.c b/arch/mips/mm/cache.c
index 4e8f1b6..abf99b1 100644
--- a/arch/mips/mm/cache.c
+++ b/arch/mips/mm/cache.c
@@ -96,7 +96,7 @@ void __flush_anon_page(struct page *page, unsigned long 
vmaddr)
 
kaddr = kmap_coherent(page, vmaddr);
flush_data_cache_page((unsigned long)kaddr);
-   kunmap_coherent(kaddr);
+   kunmap_coherent();
}
 }
 
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index 8800c88..2d1c2c0 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -177,7 +177,7 @@ void *kmap_coherent(struct page *page, unsigned long addr)
 
 #define UNIQUE_ENTRYHI(idx) (CKSEG0 + ((idx) << (PAGE_SHIFT + 1)))
 
-void kunmap_coherent(struct page *page)
+void kunmap_coherent(void)
 {
 #ifndef CONFIG_MIPS_MT_SMTC
unsigned int wired;
@@ -210,7 +210,7 @@ void copy_user_highpage(struct page *to, struct page *from,
if (cpu_has_dc_aliases) {
vfrom = kmap_coherent(from, vaddr);
copy_page(vto, vfrom);
-   kunmap_coherent(from);
+   kunmap_coherent();
} else {
vfrom = kmap_atomic(from, KM_USER0);
copy_page(vto, vfrom);
@@ -233,7 +233,7 @@ void copy_to_user_page(struct vm_area_struct *vma,
if (cpu_has_dc_aliases) {
void *vto = kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK);
memcpy(vto, src, len);
-   kunmap_coherent(page);
+   kunmap_coherent();
} else
memcpy(dst, src, len);
if ((vma->vm_flags & VM_EXEC) && !cpu_has_ic_fills_f_dc)
@@ -250,7 +250,7 @@ void copy_from_user_page(struct vm_area_struct *vma,
void *vfrom =
kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK);
memcpy(dst, vfrom, len);
-   kunmap_coherent(page);
+   kunmap_coherent();
} else
memcpy(dst, src, len);
 }
diff --git a/include/asm-mips/cacheflush.h b/include/asm-mips/cacheflush.h
index 28d907d..4933b49 100644
--- a/include/asm-mips/cacheflush.h
+++ b/include/asm-mips/cacheflush.h
@@ -96,6 +96,6 @@ extern void (*flush_data_cache_page)(unsigned long addr);
 unsigned long __init run_uncached(void *func);
 
 extern void *kmap_coherent(struct page *page, unsigned long addr);
-extern void kunmap_coherent(struct page *page);
+extern void kunmap_coherent(void);
 
 #endif /* _ASM_CACHEFLUSH_H */
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] Malta: Delete unused prototype of mips_timer_interrupt.

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e3cf10e93f42171224e88b06c226d450f3b3a55f
Commit: e3cf10e93f42171224e88b06c226d450f3b3a55f
Parent: 05502339332564ffd545be9ca37b208296a2eaad
Author: Ralf Baechle <[EMAIL PROTECTED]>
AuthorDate: Thu Apr 26 15:46:25 2007 +0100
Committer:  Ralf Baechle <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:20:24 2007 +0100

[MIPS] Malta: Delete unused prototype of mips_timer_interrupt.

Signed-off-by: Ralf Baechle <[EMAIL PROTECTED]>
---
 arch/mips/mips-boards/malta/malta_int.c |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/arch/mips/mips-boards/malta/malta_int.c 
b/arch/mips/mips-boards/malta/malta_int.c
index 3842856..83d7602 100644
--- a/arch/mips/mips-boards/malta/malta_int.c
+++ b/arch/mips/mips-boards/malta/malta_int.c
@@ -42,8 +42,6 @@
 #include 
 #include 
 
-extern void mips_timer_interrupt(void);
-
 static DEFINE_SPINLOCK(mips_irq_lock);
 
 static inline int mips_pcibios_iack(void)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] Select ZONE_DMA only if GENERIC_ISA_DMA selected

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=05502339332564ffd545be9ca37b208296a2eaad
Commit: 05502339332564ffd545be9ca37b208296a2eaad
Parent: f197465384bf7ef1af184c2ed1a4e268911a91e3
Author: Atsushi Nemoto <[EMAIL PROTECTED]>
AuthorDate: Wed Mar 21 00:36:02 2007 +0900
Committer:  Ralf Baechle <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:20:24 2007 +0100

[MIPS] Select ZONE_DMA only if GENERIC_ISA_DMA selected

Signed-off-by: Atsushi Nemoto <[EMAIL PROTECTED]>
Signed-off-by: Ralf Baechle <[EMAIL PROTECTED]>
---
 arch/mips/Kconfig   |3 ++-
 arch/mips/mm/init.c |   17 +++--
 2 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index acceae0..f9c4ba5 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -10,7 +10,6 @@ menu "Machine selection"
 
 config ZONE_DMA
bool
-   default y
 
 choice
prompt "System type"
@@ -923,6 +922,7 @@ config SYS_HAS_EARLY_PRINTK
 
 config GENERIC_ISA_DMA
bool
+   select ZONE_DMA
 
 config I8259
bool
@@ -946,6 +946,7 @@ config MIPS_DISABLE_OBSOLETE_IDE
 
 config GENERIC_ISA_DMA_SUPPORT_BROKEN
bool
+   select ZONE_DMA
 
 #
 # Endianess selection.  Sufficiently obscure so many users don't know what to
diff --git a/arch/mips/mm/init.c b/arch/mips/mm/init.c
index e9951c0..8800c88 100644
--- a/arch/mips/mm/init.c
+++ b/arch/mips/mm/init.c
@@ -351,18 +351,15 @@ void __init paging_init(void)
 #endif
kmap_coherent_init();
 
-#ifdef CONFIG_ISA
-   if (max_low_pfn >= MAX_DMA_PFN)
-   if (min_low_pfn >= MAX_DMA_PFN) {
-   zones_size[ZONE_DMA] = 0;
-   zones_size[ZONE_NORMAL] = max_low_pfn - min_low_pfn;
-   } else {
-   zones_size[ZONE_DMA] = MAX_DMA_PFN - min_low_pfn;
-   zones_size[ZONE_NORMAL] = max_low_pfn - MAX_DMA_PFN;
-   }
+#ifdef CONFIG_ZONE_DMA
+   if (min_low_pfn < MAX_DMA_PFN && MAX_DMA_PFN <= max_low_pfn) {
+   zones_size[ZONE_DMA] = MAX_DMA_PFN - min_low_pfn;
+   zones_size[ZONE_NORMAL] = max_low_pfn - MAX_DMA_PFN;
+   } else if (max_low_pfn < MAX_DMA_PFN)
+   zones_size[ZONE_DMA] = max_low_pfn - min_low_pfn;
else
 #endif
-   zones_size[ZONE_DMA] = max_low_pfn - min_low_pfn;
+   zones_size[ZONE_NORMAL] = max_low_pfn - min_low_pfn;
 
 #ifdef CONFIG_HIGHMEM
zones_size[ZONE_HIGHMEM] = highend_pfn - highstart_pfn;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] MIPS Tech: Get rid of volatile in core code.

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f197465384bf7ef1af184c2ed1a4e268911a91e3
Commit: f197465384bf7ef1af184c2ed1a4e268911a91e3
Parent: 78709b9df35346965b214e0e548412748d147776
Author: Ralf Baechle <[EMAIL PROTECTED]>
AuthorDate: Thu Apr 26 15:46:24 2007 +0100
Committer:  Ralf Baechle <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:20:24 2007 +0100

[MIPS] MIPS Tech: Get rid of volatile in core code.

Signed-off-by: Ralf Baechle <[EMAIL PROTECTED]>
---
 arch/mips/mips-boards/generic/display.c   |8 
 arch/mips/mips-boards/generic/reset.c |   12 ++--
 arch/mips/mips-boards/malta/malta_int.c   |2 +-
 arch/mips/mips-boards/malta/malta_setup.c |4 ++--
 4 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/arch/mips/mips-boards/generic/display.c 
b/arch/mips/mips-boards/generic/display.c
index f653946..548dbe5 100644
--- a/arch/mips/mips-boards/generic/display.c
+++ b/arch/mips/mips-boards/generic/display.c
@@ -24,16 +24,16 @@
 
 void mips_display_message(const char *str)
 {
-   static volatile unsigned int *display = NULL;
+   static unsigned int __iomem *display = NULL;
int i;
 
if (unlikely(display == NULL))
-   display = (volatile unsigned int 
*)ioremap(ASCII_DISPLAY_POS_BASE, 16*sizeof(int));
+   display = ioremap(ASCII_DISPLAY_POS_BASE, 16*sizeof(int));
 
for (i = 0; i <= 14; i=i+2) {
 if (*str)
-display[i] = *str++;
+writel(*str++, display + i);
 else
-display[i] = ' ';
+writel(' ', display + i);
}
 }
diff --git a/arch/mips/mips-boards/generic/reset.c 
b/arch/mips/mips-boards/generic/reset.c
index 0996ba3..7a1bb51 100644
--- a/arch/mips/mips-boards/generic/reset.c
+++ b/arch/mips/mips-boards/generic/reset.c
@@ -39,24 +39,24 @@ static void atlas_machine_power_off(void);
 
 static void mips_machine_restart(char *command)
 {
-volatile unsigned int *softres_reg = (unsigned int *)ioremap 
(SOFTRES_REG, sizeof(unsigned int));
+   unsigned int __iomem *softres_reg = ioremap(SOFTRES_REG, 
sizeof(unsigned int));
 
-   *softres_reg = GORESET;
+   writew(GORESET, softres_reg);
 }
 
 static void mips_machine_halt(void)
 {
-volatile unsigned int *softres_reg = (unsigned int *)ioremap 
(SOFTRES_REG, sizeof(unsigned int));
+unsigned int __iomem *softres_reg = ioremap(SOFTRES_REG, 
sizeof(unsigned int));
 
-   *softres_reg = GORESET;
+   writew(GORESET, softres_reg);
 }
 
 #if defined(CONFIG_MIPS_ATLAS)
 static void atlas_machine_power_off(void)
 {
-volatile unsigned int *psustby_reg = (unsigned int 
*)ioremap(ATLAS_PSUSTBY_REG, sizeof(unsigned int));
+   unsigned int __iomem *psustby_reg = ioremap(ATLAS_PSUSTBY_REG, 
sizeof(unsigned int));
 
-   *psustby_reg = ATLAS_GOSTBY;
+   writew(ATLAS_GOSTBY, psustby_reg);
 }
 #endif
 
diff --git a/arch/mips/mips-boards/malta/malta_int.c 
b/arch/mips/mips-boards/malta/malta_int.c
index 3c206bb..3842856 100644
--- a/arch/mips/mips-boards/malta/malta_int.c
+++ b/arch/mips/mips-boards/malta/malta_int.c
@@ -85,7 +85,7 @@ static inline int mips_pcibios_iack(void)
dummy = BONITO_PCIMAP_CFG;
iob();/* sync */
 
-   irq = *(volatile u32 *)(_pcictrl_bonito_pcicfg);
+   irq = readl((u32 *)_pcictrl_bonito_pcicfg);
iob();/* sync */
irq &= 0xff;
BONITO_PCIMAP_CFG = 0;
diff --git a/arch/mips/mips-boards/malta/malta_setup.c 
b/arch/mips/mips-boards/malta/malta_setup.c
index 56ea766..7873932 100644
--- a/arch/mips/mips-boards/malta/malta_setup.c
+++ b/arch/mips/mips-boards/malta/malta_setup.c
@@ -145,7 +145,8 @@ void __init plat_mem_setup(void)
 #ifdef CONFIG_BLK_DEV_IDE
/* Check PCI clock */
{
-   int jmpr = (*((volatile unsigned int *)ioremap(MALTA_JMPRS_REG, 
sizeof(unsigned int))) >> 2) & 0x07;
+   unsigned int __iomem *jmpr_p = (unsigned int *) 
ioremap(MALTA_JMPRS_REG, sizeof(unsigned int));
+   int jmpr = (readw(jmpr_p) >> 2) & 0x07;
static const int pciclocks[] __initdata = {
33, 20, 25, 30, 12, 16, 37, 10
};
@@ -179,7 +180,6 @@ void __init plat_mem_setup(void)
};
 #endif
 #endif
-
mips_reboot_setup();
 
board_time_init = mips_time_init;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] Updated Sibyte headers

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8deab1144b553548fb2f1b51affdd36dcd652aaa
Commit: 8deab1144b553548fb2f1b51affdd36dcd652aaa
Parent: eacb9d61919db56482dcea7ec943c9508175dc16
Author: Mark Mason <[EMAIL PROTECTED]>
AuthorDate: Wed Mar 28 14:40:25 2007 -0700
Committer:  Ralf Baechle <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:20:24 2007 +0100

[MIPS] Updated Sibyte headers

This is an update to the earlier patch for the sibyte headers, and 
superceeds
the previous patch.  Changes were necessary to get the tbprof driver working
on the bcm1480.

Patch to update Sibyte header files to match master versions maintained
at Broadcom.  This patch also corrects some whitespace problems, and
(hopefully) shouldn't introduce any new ones.

Signed-off-by: Mark Mason <[EMAIL PROTECTED]>
Signed-off-by: Ralf Baechle <[EMAIL PROTECTED]>
---
 include/asm-mips/sibyte/bcm1480_int.h  |2 +
 include/asm-mips/sibyte/bcm1480_mc.h   |   32 +--
 include/asm-mips/sibyte/bcm1480_regs.h |   20 +++
 include/asm-mips/sibyte/bcm1480_scd.h  |   94 +++-
 include/asm-mips/sibyte/board.h|   14 -
 include/asm-mips/sibyte/carmel.h   |1 -
 include/asm-mips/sibyte/sb1250_int.h   |5 +--
 include/asm-mips/sibyte/sb1250_mac.h   |   24 
 include/asm-mips/sibyte/sb1250_mc.h|2 +-
 include/asm-mips/sibyte/sb1250_regs.h  |   46 +---
 include/asm-mips/sibyte/sb1250_scd.h   |   30 +++
 include/asm-mips/sibyte/swarm.h|   12 
 12 files changed, 175 insertions(+), 107 deletions(-)

diff --git a/include/asm-mips/sibyte/bcm1480_int.h 
b/include/asm-mips/sibyte/bcm1480_int.h
index 42d4cf0..c0d5206 100644
--- a/include/asm-mips/sibyte/bcm1480_int.h
+++ b/include/asm-mips/sibyte/bcm1480_int.h
@@ -157,6 +157,7 @@
  * Mask values for each interrupt
  */
 
+#define _BCM1480_INT_MASK(w,n)  _SB_MAKEMASK(w,((n) & 0x3F))
 #define _BCM1480_INT_MASK1(n)   _SB_MAKEMASK1(((n) & 0x3F))
 #define _BCM1480_INT_OFFSET(n)  (((n) & 0x40) << 6)
 
@@ -195,6 +196,7 @@
 #define M_BCM1480_INT_PMI_HIGH  
_BCM1480_INT_MASK1(K_BCM1480_INT_PMI_HIGH)
 #define M_BCM1480_INT_PMO_LOW   
_BCM1480_INT_MASK1(K_BCM1480_INT_PMO_LOW)
 #define M_BCM1480_INT_PMO_HIGH  
_BCM1480_INT_MASK1(K_BCM1480_INT_PMO_HIGH)
+#define M_BCM1480_INT_MBOX_ALL  
_BCM1480_INT_MASK(8,K_BCM1480_INT_MBOX_0_0)
 #define M_BCM1480_INT_MBOX_0_0  
_BCM1480_INT_MASK1(K_BCM1480_INT_MBOX_0_0)
 #define M_BCM1480_INT_MBOX_0_1  
_BCM1480_INT_MASK1(K_BCM1480_INT_MBOX_0_1)
 #define M_BCM1480_INT_MBOX_0_2  
_BCM1480_INT_MASK1(K_BCM1480_INT_MBOX_0_2)
diff --git a/include/asm-mips/sibyte/bcm1480_mc.h 
b/include/asm-mips/sibyte/bcm1480_mc.h
index 6bdc941..a6a4374 100644
--- a/include/asm-mips/sibyte/bcm1480_mc.h
+++ b/include/asm-mips/sibyte/bcm1480_mc.h
@@ -382,6 +382,10 @@
 #define M_BCM1480_MC_CS6_SB_MAKEMASK1(10)
 #define M_BCM1480_MC_CS7_SB_MAKEMASK1(11)
 
+#define M_BCM1480_MC_CS  _SB_MAKEMASK(8,S_BCM1480_MC_CS0)
+#define V_BCM1480_MC_CS(x)   _SB_MAKEVALUE(x,S_BCM1480_MC_CS0)
+#define G_BCM1480_MC_CS(x)   
_SB_GETVALUE(x,S_BCM1480_MC_CS0,M_BCM1480_MC_CS0)
+
 #define M_BCM1480_MC_CMD_ACTIVE _SB_MAKEMASK1(16)
 
 /*
@@ -412,6 +416,8 @@
 #define K_BCM1480_MC_DRAM_TYPE_DDR22
 #endif
 
+#define K_BCM1480_MC_DRAM_TYPE_DDR2_PASS1   0
+
 #define V_BCM1480_MC_DRAM_TYPE_JEDEC
V_BCM1480_MC_DRAM_TYPE(K_BCM1480_MC_DRAM_TYPE_JEDEC)
 #define V_BCM1480_MC_DRAM_TYPE_FCRAM
V_BCM1480_MC_DRAM_TYPE(K_BCM1480_MC_DRAM_TYPE_FCRAM)
 
@@ -511,6 +517,22 @@
 #define M_BCM1480_MC_WR_ODT6_CS6   _SB_MAKEMASK1(31)
 
 #define M_BCM1480_MC_CS_ODD_ODT_EN _SB_MAKEMASK1(32)
+
+#define S_BCM1480_MC_ODT0  0
+#define M_BCM1480_MC_ODT0  _SB_MAKEMASK(8,S_BCM1480_MC_ODT0)
+#define V_BCM1480_MC_ODT0(x)   _SB_MAKEVALUE(x,S_BCM1480_MC_ODT0)
+
+#define S_BCM1480_MC_ODT2  8
+#define M_BCM1480_MC_ODT2  _SB_MAKEMASK(8,S_BCM1480_MC_ODT2)
+#define V_BCM1480_MC_ODT2(x)   _SB_MAKEVALUE(x,S_BCM1480_MC_ODT2)
+
+#define S_BCM1480_MC_ODT4  16
+#define M_BCM1480_MC_ODT4  _SB_MAKEMASK(8,S_BCM1480_MC_ODT4)
+#define V_BCM1480_MC_ODT4(x)   _SB_MAKEVALUE(x,S_BCM1480_MC_ODT4)
+
+#define S_BCM1480_MC_ODT6  24
+#define M_BCM1480_MC_ODT6  _SB_MAKEMASK(8,S_BCM1480_MC_ODT6)
+#define V_BCM1480_MC_ODT6(x)   _SB_MAKEVALUE(x,S_BCM1480_MC_ODT6)
 #endif
 
 /*
@@ -588,11 +610,11 @@
 #defineM_BCM1480_MC_DQO_SHIFT_SB_MAKEMASK1(47)
 #endif
 
-#define S_BCM1480_MC_DLL_DEFAULT48
-#define M_BCM1480_MC_DLL_DEFAULT
_SB_MAKEMASK

[MIPS] Add bcm1480 ZBus trace support, fix wait related bugs

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d619f38fdacb5cec0c841798bbadeaf903868852
Commit: d619f38fdacb5cec0c841798bbadeaf903868852
Parent: 8deab1144b553548fb2f1b51affdd36dcd652aaa
Author: Mark Mason <[EMAIL PROTECTED]>
AuthorDate: Thu Mar 29 11:39:56 2007 -0700
Committer:  Ralf Baechle <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:20:25 2007 +0100

[MIPS] Add bcm1480 ZBus trace support, fix wait related bugs

Make ZBus tracing generic - moving it to a common direcotry under
arch/mips/sibyte, add bcm1480 support and fix some wait related
bugs (thanks to Ralf for assistance on that).

Signed-off-by: Mark Mason <[EMAIL PROTECTED]>
Signed-off-by: Ralf Baechle <[EMAIL PROTECTED]>
---
 arch/mips/Makefile   |6 +-
 arch/mips/sibyte/Kconfig |2 +
 arch/mips/sibyte/common/Makefile |5 +
 arch/mips/sibyte/common/sb_tbprof.c  |  601 ++
 arch/mips/sibyte/sb1250/Makefile |1 -
 arch/mips/sibyte/sb1250/bcm1250_tbprof.c |  571 
 6 files changed, 613 insertions(+), 573 deletions(-)

diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 92bca6a..f2f742d 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -530,25 +530,29 @@ cflags-$(CONFIG_SGI_IP32) += -Iinclude/asm-mips/mach-ip32
 load-$(CONFIG_SGI_IP32)+= 0x80004000
 
 #
-# Sibyte SB1250 SOC
+# Sibyte SB1250/BCM1480 SOC
 #
 # This is a LIB so that it links at the end, and initcalls are later
 # the sequence; but it is built as an object so that modules don't get
 # removed (as happens, even if they have __initcall/module_init)
 #
 core-$(CONFIG_SIBYTE_BCM112X)  += arch/mips/sibyte/sb1250/
+core-$(CONFIG_SIBYTE_BCM112X)  += arch/mips/sibyte/common/
 cflags-$(CONFIG_SIBYTE_BCM112X)+= -Iinclude/asm-mips/mach-sibyte \
-DSIBYTE_HDR_FEATURES=SIBYTE_HDR_FMASK_1250_112x_ALL
 
 core-$(CONFIG_SIBYTE_SB1250)   += arch/mips/sibyte/sb1250/
+core-$(CONFIG_SIBYTE_SB1250)   += arch/mips/sibyte/common/
 cflags-$(CONFIG_SIBYTE_SB1250) += -Iinclude/asm-mips/mach-sibyte \
-DSIBYTE_HDR_FEATURES=SIBYTE_HDR_FMASK_1250_112x_ALL
 
 core-$(CONFIG_SIBYTE_BCM1x55)  += arch/mips/sibyte/bcm1480/
+core-$(CONFIG_SIBYTE_BCM1x55)  += arch/mips/sibyte/common/
 cflags-$(CONFIG_SIBYTE_BCM1x55)+= -Iinclude/asm-mips/mach-sibyte \
-DSIBYTE_HDR_FEATURES=SIBYTE_HDR_FMASK_1480_ALL
 
 core-$(CONFIG_SIBYTE_BCM1x80)  += arch/mips/sibyte/bcm1480/
+core-$(CONFIG_SIBYTE_BCM1x80)  += arch/mips/sibyte/common/
 cflags-$(CONFIG_SIBYTE_BCM1x80)+= -Iinclude/asm-mips/mach-sibyte \
-DSIBYTE_HDR_FEATURES=SIBYTE_HDR_FMASK_1480_ALL
 
diff --git a/arch/mips/sibyte/Kconfig b/arch/mips/sibyte/Kconfig
index bdf24a7..e6b003e 100644
--- a/arch/mips/sibyte/Kconfig
+++ b/arch/mips/sibyte/Kconfig
@@ -2,6 +2,7 @@ config SIBYTE_SB1250
bool
select HW_HAS_PCI
select SIBYTE_ENABLE_LDT_IF_PCI
+   select SIBYTE_HAS_ZBUS_PROFILING
select SIBYTE_SB1xxx_SOC
select SYS_SUPPORTS_SMP
 
@@ -34,6 +35,7 @@ config SIBYTE_BCM112X
 config SIBYTE_BCM1x80
bool
select HW_HAS_PCI
+   select SIBYTE_HAS_ZBUS_PROFILING
select SIBYTE_SB1xxx_SOC
select SYS_SUPPORTS_SMP
 
diff --git a/arch/mips/sibyte/common/Makefile b/arch/mips/sibyte/common/Makefile
new file mode 100644
index 000..8a06a4f
--- /dev/null
+++ b/arch/mips/sibyte/common/Makefile
@@ -0,0 +1,5 @@
+obj-y :=
+
+obj-$(CONFIG_SIBYTE_TBPROF)+= sb_tbprof.o
+
+EXTRA_AFLAGS := $(CFLAGS)
diff --git a/arch/mips/sibyte/common/sb_tbprof.c 
b/arch/mips/sibyte/common/sb_tbprof.c
new file mode 100644
index 000..4fcdaa8
--- /dev/null
+++ b/arch/mips/sibyte/common/sb_tbprof.c
@@ -0,0 +1,601 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * Copyright (C) 2001, 2002, 2003 Broadcom Corporation
+ * Copyright (C) 2007 Ralf Baechle <[EMAIL PROTECTED]>
+ * Copyright (C) 2007 MIPS Technologies, Inc.
+ *written by Ralf Baechle <[EMAIL PROTECTED]>
+ */
+
+#undef DEBUG
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#i

[MIPS] Register PCI host bridge resource earlier

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=639702bd725b3cc1a9bd442a7822c83849d66e91
Commit: 639702bd725b3cc1a9bd442a7822c83849d66e91
Parent: 3c5e370600c2dda8a4f59f841f323df04e6ce7b2
Author: Thomas Bogendoerfer <[EMAIL PROTECTED]>
AuthorDate: Sun Apr 8 13:28:44 2007 +0200
Committer:  Ralf Baechle <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:20:25 2007 +0100

[MIPS] Register PCI host bridge resource earlier

PCI based SNI RM machines have their EISA bus behind an Intel PCI/EISA
bridge. So the PCI IO range must start at 0x. Changing that will
break the PCI bus, because i8259.c already has registered it's IO
addresses before the PCI bus gets initialized. Below is a patch,
which will register the PCI host bridge resources inside
register_pci_controller(). It also changes i8259.c to use insert_region(),
because request_resource() will fail, if the IO space of the PIT hanging
of the PCI host bridge (maybe passing the resource parent to
init_i8259_irqs() is a cleaner fix for that).

Signed-off-by: Thomas Bogendoerfer <[EMAIL PROTECTED]>
Signed-off-by: Ralf Baechle <[EMAIL PROTECTED]>
---
 arch/mips/kernel/i8259.c |4 ++--
 arch/mips/pci/pci.c  |   25 -
 2 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/arch/mips/kernel/i8259.c b/arch/mips/kernel/i8259.c
index 9c79703..2345160 100644
--- a/arch/mips/kernel/i8259.c
+++ b/arch/mips/kernel/i8259.c
@@ -328,8 +328,8 @@ void __init init_i8259_irqs (void)
 {
int i;
 
-   request_resource(&ioport_resource, &pic1_io_resource);
-   request_resource(&ioport_resource, &pic2_io_resource);
+   insert_resource(&ioport_resource, &pic1_io_resource);
+   insert_resource(&ioport_resource, &pic2_io_resource);
 
init_8259A(0);
 
diff --git a/arch/mips/pci/pci.c b/arch/mips/pci/pci.c
index de7cfc5..8108231 100644
--- a/arch/mips/pci/pci.c
+++ b/arch/mips/pci/pci.c
@@ -77,6 +77,13 @@ pcibios_align_resource(void *data, struct resource *res,
 
 void __init register_pci_controller(struct pci_controller *hose)
 {
+   if (request_resource(&iomem_resource, hose->mem_resource) < 0)
+   goto out;
+   if (request_resource(&ioport_resource, hose->io_resource) < 0) {
+   release_resource(hose->mem_resource);
+   goto out;
+   }
+
*hose_tail = hose;
hose_tail = &hose->next;
 
@@ -87,6 +94,11 @@ void __init register_pci_controller(struct pci_controller 
*hose)
printk(KERN_WARNING
   "registering PCI controller with io_map_base unset\n");
}
+   return;
+
+out:
+   printk(KERN_WARNING
+  "Skipping PCI bus scan due to resource conflict\n");
 }
 
 /* Most MIPS systems have straight-forward swizzling needs.  */
@@ -121,11 +133,6 @@ static int __init pcibios_init(void)
/* Scan all of the recorded PCI controllers.  */
for (next_busno = 0, hose = hose_head; hose; hose = hose->next) {
 
-   if (request_resource(&iomem_resource, hose->mem_resource) < 0)
-   goto out;
-   if (request_resource(&ioport_resource, hose->io_resource) < 0)
-   goto out_free_mem_resource;
-
if (!hose->iommu)
PCI_DMA_BUS_IS_PHYS = 1;
 
@@ -144,14 +151,6 @@ static int __init pcibios_init(void)
need_domain_info = 1;
}
}
-   continue;
-
-out_free_mem_resource:
-   release_resource(hose->mem_resource);
-
-out:
-   printk(KERN_WARNING
-  "Skipping PCI bus scan due to resource conflict\n");
}
 
if (!pci_probe_only)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] Remove pnx8550-v2pci_defconfig

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3c5e370600c2dda8a4f59f841f323df04e6ce7b2
Commit: 3c5e370600c2dda8a4f59f841f323df04e6ce7b2
Parent: d619f38fdacb5cec0c841798bbadeaf903868852
Author: Yoichi Yuasa <[EMAIL PROTECTED]>
AuthorDate: Wed Apr 4 16:40:52 2007 +0900
Committer:  Ralf Baechle <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:20:25 2007 +0100

[MIPS] Remove pnx8550-v2pci_defconfig

Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]>
Signed-off-by: Ralf Baechle <[EMAIL PROTECTED]>
---
 arch/mips/configs/pnx8550-v2pci_defconfig | 1540 -
 1 files changed, 0 insertions(+), 1540 deletions(-)

diff --git a/arch/mips/configs/pnx8550-v2pci_defconfig 
b/arch/mips/configs/pnx8550-v2pci_defconfig
deleted file mode 100644
index 3d6c2d7..000
--- a/arch/mips/configs/pnx8550-v2pci_defconfig
+++ /dev/null
@@ -1,1540 +0,0 @@
-#
-# Automatically generated make config: don't edit
-# Linux kernel version: 2.6.20
-# Tue Feb 20 21:47:39 2007
-#
-CONFIG_MIPS=y
-
-#
-# Machine selection
-#
-CONFIG_ZONE_DMA=y
-# CONFIG_MIPS_MTX1 is not set
-# CONFIG_MIPS_BOSPORUS is not set
-# CONFIG_MIPS_PB1000 is not set
-# CONFIG_MIPS_PB1100 is not set
-# CONFIG_MIPS_PB1500 is not set
-# CONFIG_MIPS_PB1550 is not set
-# CONFIG_MIPS_PB1200 is not set
-# CONFIG_MIPS_DB1000 is not set
-# CONFIG_MIPS_DB1100 is not set
-# CONFIG_MIPS_DB1500 is not set
-# CONFIG_MIPS_DB1550 is not set
-# CONFIG_MIPS_DB1200 is not set
-# CONFIG_MIPS_MIRAGE is not set
-# CONFIG_BASLER_EXCITE is not set
-# CONFIG_MIPS_COBALT is not set
-# CONFIG_MACH_DECSTATION is not set
-# CONFIG_MIPS_EV64120 is not set
-# CONFIG_MACH_JAZZ is not set
-# CONFIG_LASAT is not set
-# CONFIG_MIPS_ATLAS is not set
-# CONFIG_MIPS_MALTA is not set
-# CONFIG_MIPS_SEAD is not set
-# CONFIG_WR_PPMC is not set
-# CONFIG_MIPS_SIM is not set
-# CONFIG_MOMENCO_JAGUAR_ATX is not set
-# CONFIG_MOMENCO_OCELOT is not set
-# CONFIG_MOMENCO_OCELOT_3 is not set
-# CONFIG_MOMENCO_OCELOT_C is not set
-# CONFIG_MOMENCO_OCELOT_G is not set
-# CONFIG_MIPS_XXS1500 is not set
-# CONFIG_PNX8550_JBS is not set
-# CONFIG_PNX8550_STB810 is not set
-# CONFIG_DDB5477 is not set
-# CONFIG_MACH_VR41XX is not set
-# CONFIG_PMC_YOSEMITE is not set
-# CONFIG_QEMU is not set
-# CONFIG_MARKEINS is not set
-# CONFIG_SGI_IP22 is not set
-# CONFIG_SGI_IP27 is not set
-# CONFIG_SGI_IP32 is not set
-# CONFIG_SIBYTE_BIGSUR is not set
-# CONFIG_SIBYTE_SWARM is not set
-# CONFIG_SIBYTE_SENTOSA is not set
-# CONFIG_SIBYTE_RHONE is not set
-# CONFIG_SIBYTE_CARMEL is not set
-# CONFIG_SIBYTE_PTSWARM is not set
-# CONFIG_SIBYTE_LITTLESUR is not set
-# CONFIG_SIBYTE_CRHINE is not set
-# CONFIG_SIBYTE_CRHONE is not set
-# CONFIG_SNI_RM is not set
-# CONFIG_TOSHIBA_JMR3927 is not set
-# CONFIG_TOSHIBA_RBTX4927 is not set
-# CONFIG_TOSHIBA_RBTX4938 is not set
-CONFIG_RWSEM_GENERIC_SPINLOCK=y
-# CONFIG_ARCH_HAS_ILOG2_U32 is not set
-# CONFIG_ARCH_HAS_ILOG2_U64 is not set
-CONFIG_GENERIC_FIND_NEXT_BIT=y
-CONFIG_GENERIC_HWEIGHT=y
-CONFIG_GENERIC_CALIBRATE_DELAY=y
-CONFIG_GENERIC_TIME=y
-CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y
-CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
-CONFIG_DMA_NONCOHERENT=y
-CONFIG_DMA_NEED_PCI_MAP_STATE=y
-# CONFIG_CPU_BIG_ENDIAN is not set
-CONFIG_CPU_LITTLE_ENDIAN=y
-CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y
-CONFIG_PNX8550=y
-CONFIG_SOC_PNX8550=y
-CONFIG_MIPS_L1_CACHE_SHIFT=5
-
-#
-# CPU selection
-#
-CONFIG_CPU_MIPS32_R1=y
-# CONFIG_CPU_MIPS32_R2 is not set
-# CONFIG_CPU_MIPS64_R1 is not set
-# CONFIG_CPU_MIPS64_R2 is not set
-# CONFIG_CPU_R3000 is not set
-# CONFIG_CPU_TX39XX is not set
-# CONFIG_CPU_VR41XX is not set
-# CONFIG_CPU_R4300 is not set
-# CONFIG_CPU_R4X00 is not set
-# CONFIG_CPU_TX49XX is not set
-# CONFIG_CPU_R5000 is not set
-# CONFIG_CPU_R5432 is not set
-# CONFIG_CPU_R6000 is not set
-# CONFIG_CPU_NEVADA is not set
-# CONFIG_CPU_R8000 is not set
-# CONFIG_CPU_R1 is not set
-# CONFIG_CPU_RM7000 is not set
-# CONFIG_CPU_RM9000 is not set
-# CONFIG_CPU_SB1 is not set
-CONFIG_SYS_HAS_CPU_MIPS32_R1=y
-CONFIG_CPU_MIPS32=y
-CONFIG_CPU_MIPSR1=y
-CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y
-CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y
-
-#
-# Kernel type
-#
-CONFIG_32BIT=y
-# CONFIG_64BIT is not set
-CONFIG_PAGE_SIZE_4KB=y
-# CONFIG_PAGE_SIZE_8KB is not set
-# CONFIG_PAGE_SIZE_16KB is not set
-# CONFIG_PAGE_SIZE_64KB is not set
-CONFIG_CPU_HAS_PREFETCH=y
-CONFIG_MIPS_MT_DISABLED=y
-# CONFIG_MIPS_MT_SMP is not set
-# CONFIG_MIPS_MT_SMTC is not set
-# CONFIG_MIPS_VPE_LOADER is not set
-# CONFIG_64BIT_PHYS_ADDR is not set
-CONFIG_CPU_HAS_LLSC=y
-CONFIG_CPU_HAS_SYNC=y
-CONFIG_GENERIC_HARDIRQS=y
-CONFIG_GENERIC_IRQ_PROBE=y
-CONFIG_CPU_SUPPORTS_HIGHMEM=y
-CONFIG_ARCH_FLATMEM_ENABLE=y
-CONFIG_SELECT_MEMORY_MODEL=y
-CONFIG_FLATMEM_MANUAL=y
-# CONFIG_DISCONTIGMEM_MANUAL is not set
-# CONFIG_SPARSEMEM_MANUAL is not set
-CONFIG_FLATMEM=y
-CONFIG_FLAT_NODE_MEM_MAP=y
-# CONFIG_SPARSEMEM_STATIC is not set
-CONFIG_SPLIT_PTLOCK_CPUS=4
-# C

[MIPS] Change PCI host bridge setup/resources

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bea771751c116a690054581902b4144fe5a4520e
Commit: bea771751c116a690054581902b4144fe5a4520e
Parent: 639702bd725b3cc1a9bd442a7822c83849d66e91
Author: Thomas Bogendoerfer <[EMAIL PROTECTED]>
AuthorDate: Sun Apr 8 13:34:57 2007 +0200
Committer:  Ralf Baechle <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:20:25 2007 +0100

[MIPS] Change PCI host bridge setup/resources

PCI host bridge setup for SNI RM machines with PCI is quite broken, now
that Linux does it's resource setup own its own. It will use IO addresses,
which are needed by the EISA config detection and assigns PCI memory
addresses, which overlap with ISA legacy addresses (video ram). Below
is a patch, which changes the way how the PCI memory addresses are
used and sets the minimum IO address to give enough IO space for
8 EISA slots). This patch needs the other PCI resource change, I've
posted.

Signed-off-by: Thomas Bogendoerfer <[EMAIL PROTECTED]>
Signed-off-by: Ralf Baechle <[EMAIL PROTECTED]>
---
 arch/mips/sni/pcimt.c |  105 --
 arch/mips/sni/pcit.c  |  122 +
 2 files changed, 32 insertions(+), 195 deletions(-)

diff --git a/arch/mips/sni/pcimt.c b/arch/mips/sni/pcimt.c
index 8e8593b..9ee208d 100644
--- a/arch/mips/sni/pcimt.c
+++ b/arch/mips/sni/pcimt.c
@@ -91,7 +91,7 @@ static struct platform_device pcimt_serial8250_device = {
 };
 
 static struct resource sni_io_resource = {
-   .start  = 0x1000UL,
+   .start  = 0xUL,
.end= 0x03bfUL,
.name   = "PCIMT IO MEM",
.flags  = IORESOURCE_IO,
@@ -132,107 +132,19 @@ static struct resource pcimt_io_resources[] = {
 };
 
 static struct resource sni_mem_resource = {
-   .start  = 0x1000UL,
-   .end= 0xUL,
+   .start  = 0x1800UL,
+   .end= 0x1fbfUL,
.name   = "PCIMT PCI MEM",
.flags  = IORESOURCE_MEM
 };
 
-/*
- * The RM200/RM300 has a few holes in it's PCI/EISA memory address space used
- * for other purposes.  Be paranoid and allocate all of the before the PCI
- * code gets a chance to to map anything else there ...
- *
- * This leaves the following areas available:
- *
- * 0x1000 - 0x1009 (640kB) PCI/EISA/ISA Bus Memory
- * 0x1010 - 0x13ff ( 15MB) PCI/EISA/ISA Bus Memory
- * 0x1800 - 0x1fbf (124MB) PCI/EISA Bus Memory
- * 0x1ff08000 - 0x1ffe (816kB) PCI/EISA Bus Memory
- * 0xa000 - 0x (1.5GB) PCI/EISA Bus Memory
- */
-static struct resource pcimt_mem_resources[] = {
-   {
-   .start  = 0x100a,
-   .end= 0x100b,
-   .name   = "Video RAM area",
-   .flags  = IORESOURCE_BUSY
-   }, {
-   .start  = 0x100c,
-   .end= 0x100f,
-   .name   = "ISA Reserved",
-   .flags  = IORESOURCE_BUSY
-   }, {
-   .start  = 0x1400,
-   .end= 0x17bf,
-   .name   = "PCI IO",
-   .flags  = IORESOURCE_BUSY
-   }, {
-   .start  = 0x17c0,
-   .end= 0x17ff,
-   .name   = "Cache Replacement Area",
-   .flags  = IORESOURCE_BUSY
-   }, {
-   .start  = 0x1a00,
-   .end= 0x1a03,
-   .name   = "PCI INT Acknowledge",
-   .flags  = IORESOURCE_BUSY
-   }, {
-   .start  = 0x1fc0,
-   .end= 0x1fc7,
-   .name   = "Boot PROM",
-   .flags  = IORESOURCE_BUSY
-   }, {
-   .start  = 0x1fc8,
-   .end= 0x1fcf,
-   .name   = "Diag PROM",
-   .flags  = IORESOURCE_BUSY
-   }, {
-   .start  = 0x1fd0,
-   .end= 0x1fdf,
-   .name   = "X-Bus",
-   .flags  = IORESOURCE_BUSY
-   }, {
-   .start  = 0x1fe0,
-   .end= 0x1fef,
-   .name   = "BIOS map",
-   .flags  = IORESOURCE_BUSY
-   }, {
-   .start  = 0x1ff0,
-   .end= 0x1ff7,
-   .name   = "NVRAM / EEPROM",
-   .flags  = IORESOURCE_BUSY
-   }, {
-   .start  = 0x1fff,
-   .end= 0x1fffefff,
-   .name   = "ASIC PCI",
-   .flags  = IORESOURCE_BUSY
-   }, {
-   .start  = 0x1000,
-   .end= 0x1fff,
-   .name   = "MP Agent",
-   .flags  = IORESOURCE_BUSY
-   }, {
-   .start  = 0x2000,
-   .end= 0x9fff,
-   .name   = "Main Memory",
-   .flags  = IORESOURCE_BUSY
-   }
-};
-
 static void __init sni_pcimt_resource_init(v

[MIPS] Remove unused _THREAD_SIZE_ORDER from asm-offset.c.

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=05bc284a719b778243f51e23c88fe6cefe6b219b
Commit: 05bc284a719b778243f51e23c88fe6cefe6b219b
Parent: bea771751c116a690054581902b4144fe5a4520e
Author: Ralf Baechle <[EMAIL PROTECTED]>
AuthorDate: Thu Apr 26 15:46:28 2007 +0100
Committer:  Ralf Baechle <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:20:25 2007 +0100

[MIPS] Remove unused _THREAD_SIZE_ORDER from asm-offset.c.

Signed-off-by: Ralf Baechle <[EMAIL PROTECTED]>
---
 arch/mips/kernel/asm-offsets.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/arch/mips/kernel/asm-offsets.c b/arch/mips/kernel/asm-offsets.c
index 222de46..761a779 100644
--- a/arch/mips/kernel/asm-offsets.c
+++ b/arch/mips/kernel/asm-offsets.c
@@ -102,7 +102,6 @@ void output_thread_info_defines(void)
offset("#define TI_ADDR_LIMIT  ", struct thread_info, addr_limit);
offset("#define TI_RESTART_BLOCK   ", struct thread_info, 
restart_block);
offset("#define TI_REGS", struct thread_info, regs);
-   constant("#define _THREAD_SIZE_ORDER ", THREAD_SIZE_ORDER);
constant("#define _THREAD_SIZE   ", THREAD_SIZE);
constant("#define _THREAD_MASK   ", THREAD_MASK);
linefeed;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] Use DEFINE_SPINLOCK instead of SPIN_LOCK_UNLOCKED.

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=820c229f6c82bb91c0dbfbce90f7e6eb9639c7ab
Commit: 820c229f6c82bb91c0dbfbce90f7e6eb9639c7ab
Parent: a4c9bb7d22aa61ec585984f46df185669e557e3d
Author: Milind Arun Choudhary <[EMAIL PROTECTED]>
AuthorDate: Thu Apr 19 15:05:16 2007 +0530
Committer:  Ralf Baechle <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:20:25 2007 +0100

[MIPS] Use DEFINE_SPINLOCK instead of SPIN_LOCK_UNLOCKED.

Signed-off-by: Milind Arun Choudhary <[EMAIL PROTECTED]>
Signed-off-by: Ralf Baechle <[EMAIL PROTECTED]>
---
 arch/mips/basler/excite/excite_setup.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/mips/basler/excite/excite_setup.c 
b/arch/mips/basler/excite/excite_setup.c
index 42f0eda..2f0e4c0 100644
--- a/arch/mips/basler/excite/excite_setup.c
+++ b/arch/mips/basler/excite/excite_setup.c
@@ -63,7 +63,7 @@ volatile void __iomem * const ocd_base = (void *) 
(EXCITE_ADDR_OCD);
 volatile void __iomem * const titan_base = (void *) (EXCITE_ADDR_TITAN);
 
 /* Protect access to shared GPI registers */
-spinlock_t titan_lock = SPIN_LOCK_UNLOCKED;
+DEFINE_SPINLOCK(titan_lock);
 int titan_irqflags;
 
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] Replace old fashioned "__typeof" with "__typeof__".

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a4c9bb7d22aa61ec585984f46df185669e557e3d
Commit: a4c9bb7d22aa61ec585984f46df185669e557e3d
Parent: 05bc284a719b778243f51e23c88fe6cefe6b219b
Author: Robert P. J. Day <[EMAIL PROTECTED]>
AuthorDate: Tue Apr 10 06:23:27 2007 -0400
Committer:  Ralf Baechle <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:20:25 2007 +0100

[MIPS] Replace old fashioned "__typeof" with "__typeof__".

[Robert's original log message said this was a bug but it isn't, it's
just very old fashioned syntax that is not (no longer?) documented in the
gcc documentation.  So for the sake of uniformity I'm applying his
patch but with a modified log message. -- Ralf]

Signed-off-by: Robert P. J. Day <[EMAIL PROTECTED]>
Signed-off-by: Ralf Baechle <[EMAIL PROTECTED]>
---
 include/asm-mips/paccess.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/asm-mips/paccess.h b/include/asm-mips/paccess.h
index 147844e..8c08fa9 100644
--- a/include/asm-mips/paccess.h
+++ b/include/asm-mips/paccess.h
@@ -34,7 +34,7 @@ struct __large_pstruct { unsigned long buf[100]; };
 #define __get_dbe(x,ptr,size)  \
 ({ \
long __gu_err;  \
-   __typeof(*(ptr)) __gu_val;  \
+   __typeof__(*(ptr)) __gu_val;\
unsigned long __gu_addr;\
__asm__("":"=r" (__gu_val));\
__gu_addr = (unsigned long) (ptr);  \
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] remove 2 select entries for VR41xx

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=678f4e34a66eb364f4f8e7dc82746c3df14dc1e8
Commit: 678f4e34a66eb364f4f8e7dc82746c3df14dc1e8
Parent: 74142d65b23b46587ea329202e957c901d9a57a1
Author: Yoichi Yuasa <[EMAIL PROTECTED]>
AuthorDate: Thu Apr 26 19:51:31 2007 +0900
Committer:  Ralf Baechle <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:20:26 2007 +0100

[MIPS] remove 2 select entries for VR41xx

This patch has removed 2 select entries for VR41xx.
These entries are selected in arch/mips/vr41xx/Kconfig.

Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]>
Signed-off-by: Ralf Baechle <[EMAIL PROTECTED]>
---
 arch/mips/Kconfig |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index 4edff8d..130d825 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -502,8 +502,6 @@ config DDB5477
 config MACH_VR41XX
bool "NEC VR4100 series based machines"
select SYS_HAS_CPU_VR41XX
-   select SYS_SUPPORTS_32BIT_KERNEL
-   select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL
select GENERIC_HARDIRQS_NO__DO_IRQ
 
 config PMC_YOSEMITE
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] rename VR41XX to VR4100 series

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=74142d65b23b46587ea329202e957c901d9a57a1
Commit: 74142d65b23b46587ea329202e957c901d9a57a1
Parent: 820c229f6c82bb91c0dbfbce90f7e6eb9639c7ab
Author: Yoichi Yuasa <[EMAIL PROTECTED]>
AuthorDate: Thu Apr 26 19:45:09 2007 +0900
Committer:  Ralf Baechle <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:20:25 2007 +0100

[MIPS] rename VR41XX to VR4100 series

This patch has renamed VR41XX to VR4100 series.
That's better.

Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]>
Signed-off-by: Ralf Baechle <[EMAIL PROTECTED]>
---
 arch/mips/Kconfig |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig
index f9c4ba5..4edff8d 100644
--- a/arch/mips/Kconfig
+++ b/arch/mips/Kconfig
@@ -500,7 +500,7 @@ config DDB5477
  ether port USB, AC97, PCI, etc.
 
 config MACH_VR41XX
-   bool "NEC VR41XX-based machines"
+   bool "NEC VR4100 series based machines"
select SYS_HAS_CPU_VR41XX
select SYS_SUPPORTS_32BIT_KERNEL
select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[MIPS] update vr41xx Kconfig

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c4be17370b76bc6c23a239ca512fe360785d2369
Commit: c4be17370b76bc6c23a239ca512fe360785d2369
Parent: 678f4e34a66eb364f4f8e7dc82746c3df14dc1e8
Author: Yoichi Yuasa <[EMAIL PROTECTED]>
AuthorDate: Thu Apr 26 19:53:59 2007 +0900
Committer:  Ralf Baechle <[EMAIL PROTECTED]>
CommitDate: Fri Apr 27 16:20:26 2007 +0100

[MIPS] update vr41xx Kconfig

This patch has updated vr41xx/Kconfig.

Signed-off-by: Yoichi Yuasa <[EMAIL PROTECTED]>
Signed-off-by: Ralf Baechle <[EMAIL PROTECTED]>
---
 arch/mips/vr41xx/Kconfig |   92 --
 1 files changed, 56 insertions(+), 36 deletions(-)

diff --git a/arch/mips/vr41xx/Kconfig b/arch/mips/vr41xx/Kconfig
index 92f41f6..8f4d3e7 100644
--- a/arch/mips/vr41xx/Kconfig
+++ b/arch/mips/vr41xx/Kconfig
@@ -1,6 +1,10 @@
-config CASIO_E55
-   bool "Support for CASIO CASSIOPEIA E-10/15/55/65"
+choice
+   prompt "Machine type"
depends on MACH_VR41XX
+   default TANBAC_TB022X
+
+config CASIO_E55
+   bool "CASIO CASSIOPEIA E-10/15/55/65"
select DMA_NONCOHERENT
select IRQ_CPU
select ISA
@@ -8,8 +12,7 @@ config CASIO_E55
select SYS_SUPPORTS_LITTLE_ENDIAN
 
 config IBM_WORKPAD
-   bool "Support for IBM WorkPad z50"
-   depends on MACH_VR41XX
+   bool "IBM WorkPad z50"
select DMA_NONCOHERENT
select IRQ_CPU
select ISA
@@ -17,26 +20,18 @@ config IBM_WORKPAD
select SYS_SUPPORTS_LITTLE_ENDIAN
 
 config NEC_CMBVR4133
-   bool "Support for NEC CMB-VR4133"
-   depends on MACH_VR41XX
+   bool "NEC CMB-VR4133"
select DMA_NONCOHERENT
select IRQ_CPU
select HW_HAS_PCI
select SYS_SUPPORTS_32BIT_KERNEL
select SYS_SUPPORTS_LITTLE_ENDIAN
 
-config ROCKHOPPER
-   bool "Support for Rockhopper baseboard"
-   depends on NEC_CMBVR4133
-   select I8259
-   select HAVE_STD_PC_SERIAL_PORT
-
 config TANBAC_TB022X
-   bool "Support for TANBAC VR4131 multichip module and TANBAC VR4131DIMM"
-   depends on MACH_VR41XX
+   bool "TANBAC VR4131 multichip module and TANBAC VR4131DIMM"
select DMA_NONCOHERENT
-   select HW_HAS_PCI
select IRQ_CPU
+   select HW_HAS_PCI
select SYS_SUPPORTS_32BIT_KERNEL
select SYS_SUPPORTS_LITTLE_ENDIAN
help
@@ -46,40 +41,65 @@ config TANBAC_TB022X
  Please refer to 
  about VR4131 multichip module and VR4131DIMM.
 
-config TANBAC_TB0226
-   bool "Support for TANBAC Mbase(TB0226)"
+config VICTOR_MPC30X
+   bool "Victor MP-C303/304"
+   select DMA_NONCOHERENT
+   select IRQ_CPU
+   select HW_HAS_PCI
+   select PCI_VR41XX
+   select SYS_SUPPORTS_32BIT_KERNEL
+   select SYS_SUPPORTS_LITTLE_ENDIAN
+
+config ZAO_CAPCELLA
+   bool "ZAO Networks Capcella"
+   select DMA_NONCOHERENT
+   select IRQ_CPU
+   select HW_HAS_PCI
+   select PCI_VR41XX
+   select SYS_SUPPORTS_32BIT_KERNEL
+   select SYS_SUPPORTS_LITTLE_ENDIAN
+
+endchoice
+
+config ROCKHOPPER
+   bool "Support for Rockhopper base board"
+   depends on NEC_CMBVR4133
+   select PCI_VR41XX
+   select I8259
+   select HAVE_STD_PC_SERIAL_PORT
+
+choice
+   prompt "Base board type"
depends on TANBAC_TB022X
+   default TANBAC_TB0287
+
+config TANBAC_TB0219
+   bool "TANBAC DIMM Evaluation Kit(TB0219)"
select GPIO_VR41XX
+   select PCI_VR41XX
+   help
+ The TANBAC DIMM Evaluation Kit(TB0219) is a MIPS-based platform
+ manufactured by TANBAC.
+ Please refer to  about DIMM Evaluation Kit.
+
+config TANBAC_TB0226
+   bool "TANBAC Mbase(TB0226)"
+   select GPIO_VR41XX
+   select PCI_VR41XX
help
  The TANBAC Mbase(TB0226) is a MIPS-based platform
  manufactured by TANBAC.
  Please refer to  about Mbase.
 
 config TANBAC_TB0287
-   bool "Support for TANBAC Mini-ITX DIMM base(TB0287)"
-   depends on TANBAC_TB022X
+   bool "TANBAC Mini-ITX DIMM base(TB0287)"
+   select PCI_VR41XX
help
  The TANBAC Mini-ITX DIMM base(TB0287) is a MIPS-based platform
  manufactured by TANBAC.
  Please refer to  about Mini-ITX DIMM base.
 
-config VICTOR_MPC30X
-   bool "Support for Victor MP-C303/304"
-   depends on MACH_VR41XX
-   select DMA_NONCOHERENT
-   select HW_HAS_PCI
-   select IRQ_CPU
-   select SYS_SUPPORTS_32BIT_KERNEL
-   select SYS_SUPPORTS_LITTLE_ENDIAN
-
-config ZAO_CAPCELLA
-   bool "Support for ZAO Networks Capcella"
-   depends on MACH_VR41XX
-   select DMA_NONCOHERENT
-   select HW_HAS_PCI
-   select IRQ_CPU
-   select SYS_SUPPORTS_32BIT_KERNEL
-   select SYS_SUPPORTS_LITTLE_

[TCP] FRTO: Incorrectly clears TCPCB_EVER_RETRANS bit

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=522e7548a9bd40305df41c0beae69448b7620d6b
Commit: 522e7548a9bd40305df41c0beae69448b7620d6b
Parent: de46c33745f5e2ad594c72f2cf5f490861b16ce1
Author: Ilpo Järvinen <[EMAIL PROTECTED]>
AuthorDate: Wed Feb 21 22:54:52 2007 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Apr 25 22:23:00 2007 -0700

[TCP] FRTO: Incorrectly clears TCPCB_EVER_RETRANS bit

FRTO was slightly too brave... Should only clear
TCPCB_SACKED_RETRANS bit.

Signed-off-by: Ilpo Järvinen <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/ipv4/tcp_input.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 1a14191..b21e232 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1266,7 +1266,7 @@ void tcp_enter_frto(struct sock *sk)
tp->undo_retrans = 0;
 
sk_stream_for_retrans_queue(skb, sk) {
-   TCP_SKB_CB(skb)->sacked &= ~TCPCB_RETRANS;
+   TCP_SKB_CB(skb)->sacked &= ~TCPCB_SACKED_RETRANS;
}
tcp_sync_left_out(tp);
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[TCP] FRTO: Consecutive RTOs keep prior_ssthresh and ssthresh

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7487c48c4fd15d1e2542be1183b783562cfe10bc
Commit: 7487c48c4fd15d1e2542be1183b783562cfe10bc
Parent: 30935cf4f915c3178ce63331d6ff4c82163e26af
Author: Ilpo Järvinen <[EMAIL PROTECTED]>
AuthorDate: Wed Feb 21 23:02:30 2007 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Apr 25 22:23:04 2007 -0700

[TCP] FRTO: Consecutive RTOs keep prior_ssthresh and ssthresh

In case a latency spike causes more than one RTO, the later should not
cause the already reduced ssthresh to propagate into the prior_ssthresh
since FRTO declares all such RTOs spurious at once or none of them. In
treating of ssthresh, we mimic what tcp_enter_loss() does.

The previous state (in frto_counter) must be available until we have
checked it in tcp_enter_frto(), and also ACK information flag in
process_frto().

Signed-off-by: Ilpo Järvinen <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/ipv4/tcp_input.c |   20 ++--
 1 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 561e5d4..194e880 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1252,6 +1252,10 @@ int tcp_use_frto(const struct sock *sk)
 /* RTO occurred, but do not yet enter Loss state. Instead, defer RTO
  * recovery a bit and use heuristics in tcp_process_frto() to detect if
  * the RTO was spurious.
+ *
+ * Do like tcp_enter_loss() would; when RTO expires the second time it
+ * does:
+ *  "Reduce ssthresh if it has not yet been made inside this window."
  */
 void tcp_enter_frto(struct sock *sk)
 {
@@ -1259,11 +1263,10 @@ void tcp_enter_frto(struct sock *sk)
struct tcp_sock *tp = tcp_sk(sk);
struct sk_buff *skb;
 
-   tp->frto_counter = 1;
-
-   if (icsk->icsk_ca_state <= TCP_CA_Disorder ||
+   if ((!tp->frto_counter && icsk->icsk_ca_state <= TCP_CA_Disorder) ||
tp->snd_una == tp->high_seq ||
-   (icsk->icsk_ca_state == TCP_CA_Loss && !icsk->icsk_retransmits)) {
+   ((icsk->icsk_ca_state == TCP_CA_Loss || tp->frto_counter) &&
+!icsk->icsk_retransmits)) {
tp->prior_ssthresh = tcp_current_ssthresh(sk);
tp->snd_ssthresh = icsk->icsk_ca_ops->ssthresh(sk);
tcp_ca_event(sk, CA_EVENT_FRTO);
@@ -1285,6 +1288,7 @@ void tcp_enter_frto(struct sock *sk)
 
tcp_set_ca_state(sk, TCP_CA_Open);
tp->frto_highmark = tp->snd_nxt;
+   tp->frto_counter = 1;
 }
 
 /* Enter Loss state after F-RTO was applied. Dupack arrived after RTO,
@@ -2513,12 +2517,16 @@ static void tcp_conservative_spur_to_response(struct 
tcp_sock *tp)
  * to prove that the RTO is indeed spurious. It transfers the control
  * from F-RTO to the conventional RTO recovery
  */
-static void tcp_process_frto(struct sock *sk, u32 prior_snd_una)
+static void tcp_process_frto(struct sock *sk, u32 prior_snd_una, int flag)
 {
struct tcp_sock *tp = tcp_sk(sk);
 
tcp_sync_left_out(tp);
 
+   /* Duplicate the behavior from Loss state (fastretrans_alert) */
+   if (flag&FLAG_DATA_ACKED)
+   inet_csk(sk)->icsk_retransmits = 0;
+
if (tp->snd_una == prior_snd_una ||
!before(tp->snd_una, tp->frto_highmark)) {
tcp_enter_frto_loss(sk);
@@ -2607,7 +2615,7 @@ static int tcp_ack(struct sock *sk, struct sk_buff *skb, 
int flag)
flag |= tcp_clean_rtx_queue(sk, &seq_rtt);
 
if (tp->frto_counter)
-   tcp_process_frto(sk, prior_snd_una);
+   tcp_process_frto(sk, prior_snd_una, flag);
 
if (tcp_ack_is_dubious(sk, flag)) {
/* Advance CWND, if state allows this. */
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[TCP] FRTO: Ignore some uninteresting ACKs

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6408d206c7484615ecae54bf6474a02c94e9e862
Commit: 6408d206c7484615ecae54bf6474a02c94e9e862
Parent: 7b0eb22b1d3b049306813a4aaa52966650f7491c
Author: Ilpo Järvinen <[EMAIL PROTECTED]>
AuthorDate: Wed Feb 21 23:04:11 2007 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Apr 25 22:23:06 2007 -0700

[TCP] FRTO: Ignore some uninteresting ACKs

Handles RFC4138 shortcoming (in step 2); it should also have case
c) which ignores ACKs that are not duplicates nor advance window
(opposite dir data, winupdate).

Signed-off-by: Ilpo Järvinen <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/ipv4/tcp_input.c |   13 ++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index e806839..e990d56 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2495,9 +2495,9 @@ static void tcp_conservative_spur_to_response(struct 
tcp_sock *tp)
 
 /* F-RTO spurious RTO detection algorithm (RFC4138)
  *
- * F-RTO affects during two new ACKs following RTO. State (ACK number) is kept
- * in frto_counter. When ACK advances window (but not to or beyond highest
- * sequence sent before RTO):
+ * F-RTO affects during two new ACKs following RTO (well, almost, see inline
+ * comments). State (ACK number) is kept in frto_counter. When ACK advances
+ * window (but not to or beyond highest sequence sent before RTO):
  *   On First ACK,  send two new segments out.
  *   On Second ACK, RTO was likely spurious. Do spurious response (response
  *  algorithm is not part of the F-RTO detection algorithm
@@ -2527,6 +2527,13 @@ static void tcp_process_frto(struct sock *sk, u32 
prior_snd_una, int flag)
if (flag&FLAG_DATA_ACKED)
inet_csk(sk)->icsk_retransmits = 0;
 
+   /* RFC4138 shortcoming in step 2; should also have case c): ACK isn't
+* duplicate nor advances window, e.g., opposite dir data, winupdate
+*/
+   if ((tp->snd_una == prior_snd_una) && (flag&FLAG_NOT_DUP) &&
+   !(flag&FLAG_FORWARD_PROGRESS))
+   return;
+
if (tp->snd_una == prior_snd_una ||
!before(tp->snd_una, tp->frto_highmark)) {
tcp_enter_frto_loss(sk);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[TCP] FRTO: Use Disorder state during operation instead of Open

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7b0eb22b1d3b049306813a4aaa52966650f7491c
Commit: 7b0eb22b1d3b049306813a4aaa52966650f7491c
Parent: 7487c48c4fd15d1e2542be1183b783562cfe10bc
Author: Ilpo Järvinen <[EMAIL PROTECTED]>
AuthorDate: Wed Feb 21 23:03:35 2007 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Apr 25 22:23:05 2007 -0700

[TCP] FRTO: Use Disorder state during operation instead of Open

Retransmission counter assumptions are to be changed. Forcing
reason to do this exist: Using sysctl in check would be racy
as soon as FRTO starts to ignore some ACKs (doing that in the
following patches). Userspace may disable it at any moment
giving nice oops if timing is right. frto_counter would be
inaccessible from userspace, but with SACK enhanced FRTO
retrans_out can include other than head, and possibly leaving
it non-zero after spurious RTO, boom again.

Luckily, solution seems rather simple: never go directly to Open
state but use Disorder instead. This does not really change much,
since TCP could anyway change its state to Disorder during FRTO
using path tcp_fastretrans_alert -> tcp_try_to_open (e.g., when
a SACK block makes ACK dubious). Besides, Disorder seems to be
the state where TCP should be if not recovering (in Recovery or
Loss state) while having some retransmissions in-flight (see
tcp_try_to_open), which is exactly what happens with FRTO.

Signed-off-by: Ilpo Järvinen <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/ipv4/tcp_input.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 194e880..e806839 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1286,7 +1286,8 @@ void tcp_enter_frto(struct sock *sk)
}
tcp_sync_left_out(tp);
 
-   tcp_set_ca_state(sk, TCP_CA_Open);
+   tcp_set_ca_state(sk, TCP_CA_Disorder);
+   tp->high_seq = tp->snd_nxt;
tp->frto_highmark = tp->snd_nxt;
tp->frto_counter = 1;
 }
@@ -2014,8 +2015,7 @@ tcp_fastretrans_alert(struct sock *sk, u32 prior_snd_una,
/* E. Check state exit conditions. State can be terminated
 *when high_seq is ACKed. */
if (icsk->icsk_ca_state == TCP_CA_Open) {
-   if (!sysctl_tcp_frto)
-   BUG_TRAP(tp->retrans_out == 0);
+   BUG_TRAP(tp->retrans_out == 0);
tp->retrans_stamp = 0;
} else if (!before(tp->snd_una, tp->high_seq)) {
switch (icsk->icsk_ca_state) {
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[TCP] FRTO: Response should reset also snd_cwnd_cnt

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=aa8b6a7ad147dfbaaf10368ff15df9418b670d8b
Commit: aa8b6a7ad147dfbaaf10368ff15df9418b670d8b
Parent: 95c4922bf9330eb2c71b752359dd89c4e166f3c5
Author: Ilpo Järvinen <[EMAIL PROTECTED]>
AuthorDate: Wed Feb 21 23:06:03 2007 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Apr 25 22:23:08 2007 -0700

[TCP] FRTO: Response should reset also snd_cwnd_cnt

Since purpose is to reduce CWND, we prevent immediate growth. This
is not a major issue nor is "the correct way" specified anywhere.

Signed-off-by: Ilpo Järvinen <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/ipv4/tcp_input.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index cc935c8..924b2e6 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2490,6 +2490,7 @@ static int tcp_ack_update_window(struct sock *sk, struct 
tcp_sock *tp,
 static void tcp_conservative_spur_to_response(struct tcp_sock *tp)
 {
tp->snd_cwnd = min(tp->snd_cwnd, tp->snd_ssthresh);
+   tp->snd_cwnd_cnt = 0;
tcp_moderate_cwnd(tp);
 }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[TCP] FRTO: fixes fallback to conventional recovery

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=95c4922bf9330eb2c71b752359dd89c4e166f3c5
Commit: 95c4922bf9330eb2c71b752359dd89c4e166f3c5
Parent: 6408d206c7484615ecae54bf6474a02c94e9e862
Author: Ilpo Järvinen <[EMAIL PROTECTED]>
AuthorDate: Wed Feb 21 23:05:18 2007 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Apr 25 22:23:07 2007 -0700

[TCP] FRTO: fixes fallback to conventional recovery

The FRTO detection did not care how ACK pattern affects to cwnd
calculation of the conventional recovery. This caused incorrect
setting of cwnd when the fallback becames necessary. The
knowledge tcp_process_frto() has about the incoming ACK is now
passed on to tcp_enter_frto_loss() in allowed_segments parameter
that gives the number of segments that must be added to
packets-in-flight while calculating the new cwnd.

Instead of snd_una we use FLAG_DATA_ACKED in duplicate ACK
detection because RFC4138 states (in Section 2.2):
  If the first acknowledgment after the RTO retransmission
  does not acknowledge all of the data that was retransmitted
  in step 1, the TCP sender reverts to the conventional RTO
  recovery.  Otherwise, a malicious receiver acknowledging
  partial segments could cause the sender to declare the
  timeout spurious in a case where data was lost.

If the next ACK after RTO is duplicate, we do not retransmit
anything, which is equal to what conservative conventional
recovery does in such case.

Signed-off-by: Ilpo Järvinen <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/ipv4/tcp_input.c |   14 +-
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index e990d56..cc935c8 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1296,7 +1296,7 @@ void tcp_enter_frto(struct sock *sk)
  * which indicates that we should follow the traditional RTO recovery,
  * i.e. mark everything lost and do go-back-N retransmission.
  */
-static void tcp_enter_frto_loss(struct sock *sk)
+static void tcp_enter_frto_loss(struct sock *sk, int allowed_segments)
 {
struct tcp_sock *tp = tcp_sk(sk);
struct sk_buff *skb;
@@ -1326,7 +1326,7 @@ static void tcp_enter_frto_loss(struct sock *sk)
}
tcp_sync_left_out(tp);
 
-   tp->snd_cwnd = tp->frto_counter + tcp_packets_in_flight(tp)+1;
+   tp->snd_cwnd = tcp_packets_in_flight(tp) + allowed_segments;
tp->snd_cwnd_cnt = 0;
tp->snd_cwnd_stamp = tcp_time_stamp;
tp->undo_marker = 0;
@@ -2527,6 +2527,11 @@ static void tcp_process_frto(struct sock *sk, u32 
prior_snd_una, int flag)
if (flag&FLAG_DATA_ACKED)
inet_csk(sk)->icsk_retransmits = 0;
 
+   if (!before(tp->snd_una, tp->frto_highmark)) {
+   tcp_enter_frto_loss(sk, tp->frto_counter + 1);
+   return;
+   }
+
/* RFC4138 shortcoming in step 2; should also have case c): ACK isn't
 * duplicate nor advances window, e.g., opposite dir data, winupdate
 */
@@ -2534,9 +2539,8 @@ static void tcp_process_frto(struct sock *sk, u32 
prior_snd_una, int flag)
!(flag&FLAG_FORWARD_PROGRESS))
return;
 
-   if (tp->snd_una == prior_snd_una ||
-   !before(tp->snd_una, tp->frto_highmark)) {
-   tcp_enter_frto_loss(sk);
+   if (!(flag&FLAG_DATA_ACKED)) {
+   tcp_enter_frto_loss(sk, (tp->frto_counter == 1 ? 0 : 3));
return;
}
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[TCP] FRTO: frto_counter modulo-op converted to two assignments

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=94d0ea7786714d78d7cb73144bb850254dd0bb78
Commit: 94d0ea7786714d78d7cb73144bb850254dd0bb78
Parent: 52c63f1e86ebb18ef4b710b5b647e552a041e5ca
Author: Ilpo Järvinen <[EMAIL PROTECTED]>
AuthorDate: Wed Feb 21 23:07:27 2007 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Apr 25 22:23:10 2007 -0700

[TCP] FRTO: frto_counter modulo-op converted to two assignments

Signed-off-by: Ilpo Järvinen <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/ipv4/tcp_input.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 7213740..9dc5754 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2551,11 +2551,11 @@ static void tcp_process_frto(struct sock *sk, u32 
prior_snd_una, int flag)
 
if (tp->frto_counter == 1) {
tp->snd_cwnd = tcp_packets_in_flight(tp) + 2;
+   tp->frto_counter = 2;
} else /* frto_counter == 2 */ {
tcp_conservative_spur_to_response(tp);
+   tp->frto_counter = 0;
}
-
-   tp->frto_counter = (tp->frto_counter + 1) % 3;
 }
 
 /* This routine deals with incoming acks, but not outgoing ones. */
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[TCP]: Don't enter to fast recovery while using FRTO

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=52c63f1e86ebb18ef4b710b5b647e552a041e5ca
Commit: 52c63f1e86ebb18ef4b710b5b647e552a041e5ca
Parent: aa8b6a7ad147dfbaaf10368ff15df9418b670d8b
Author: Ilpo Järvinen <[EMAIL PROTECTED]>
AuthorDate: Wed Feb 21 23:06:52 2007 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Apr 25 22:23:09 2007 -0700

[TCP]: Don't enter to fast recovery while using FRTO

Because TCP is not in Loss state during FRTO recovery, fast
recovery could be triggered by accident. Non-SACK FRTO is more
robust than not yet included SACK-enhanced version (that can
receiver high number of duplicate ACKs with SACK blocks during
FRTO), at least with unidirectional transfers, but under
extraordinary patterns fast recovery can be incorrectly
triggered, e.g., Data loss+ACK losses => cumulative ACK with
enough SACK blocks to meet sacked_out >= dupthresh condition).

Signed-off-by: Ilpo Järvinen <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/ipv4/tcp_input.c |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 924b2e6..7213740 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1547,6 +1547,10 @@ static int tcp_time_to_recover(struct sock *sk, struct 
tcp_sock *tp)
 {
__u32 packets_out;
 
+   /* Do not perform any recovery during FRTO algorithm */
+   if (tp->frto_counter)
+   return 0;
+
/* Trick#1: The loss is proven. */
if (tp->lost_out)
return 1;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[TCP]: Prevent unrelated cwnd adjustment while using FRTO

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7c9a4a5b67926dd186d427bc5b9fce6ccbde154c
Commit: 7c9a4a5b67926dd186d427bc5b9fce6ccbde154c
Parent: 94d0ea7786714d78d7cb73144bb850254dd0bb78
Author: Ilpo Järvinen <[EMAIL PROTECTED]>
AuthorDate: Wed Feb 21 23:08:34 2007 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Apr 25 22:23:11 2007 -0700

[TCP]: Prevent unrelated cwnd adjustment while using FRTO

FRTO controls cwnd when it still processes the ACK input or it
has just reverted back to conventional RTO recovery; the normal
rules apply when FRTO has reverted to standard congestion
control.

Signed-off-by: Ilpo Järvinen <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/ipv4/tcp_input.c |   18 +++---
 1 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 9dc5754..723cee6 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2522,7 +2522,7 @@ static void tcp_conservative_spur_to_response(struct 
tcp_sock *tp)
  * to prove that the RTO is indeed spurious. It transfers the control
  * from F-RTO to the conventional RTO recovery
  */
-static void tcp_process_frto(struct sock *sk, u32 prior_snd_una, int flag)
+static int tcp_process_frto(struct sock *sk, u32 prior_snd_una, int flag)
 {
struct tcp_sock *tp = tcp_sk(sk);
 
@@ -2534,7 +2534,7 @@ static void tcp_process_frto(struct sock *sk, u32 
prior_snd_una, int flag)
 
if (!before(tp->snd_una, tp->frto_highmark)) {
tcp_enter_frto_loss(sk, tp->frto_counter + 1);
-   return;
+   return 1;
}
 
/* RFC4138 shortcoming in step 2; should also have case c): ACK isn't
@@ -2542,20 +2542,22 @@ static void tcp_process_frto(struct sock *sk, u32 
prior_snd_una, int flag)
 */
if ((tp->snd_una == prior_snd_una) && (flag&FLAG_NOT_DUP) &&
!(flag&FLAG_FORWARD_PROGRESS))
-   return;
+   return 1;
 
if (!(flag&FLAG_DATA_ACKED)) {
tcp_enter_frto_loss(sk, (tp->frto_counter == 1 ? 0 : 3));
-   return;
+   return 1;
}
 
if (tp->frto_counter == 1) {
tp->snd_cwnd = tcp_packets_in_flight(tp) + 2;
tp->frto_counter = 2;
+   return 1;
} else /* frto_counter == 2 */ {
tcp_conservative_spur_to_response(tp);
tp->frto_counter = 0;
}
+   return 0;
 }
 
 /* This routine deals with incoming acks, but not outgoing ones. */
@@ -2569,6 +2571,7 @@ static int tcp_ack(struct sock *sk, struct sk_buff *skb, 
int flag)
u32 prior_in_flight;
s32 seq_rtt;
int prior_packets;
+   int frto_cwnd = 0;
 
/* If the ack is newer than sent or older than previous acks
 * then we can probably ignore it.
@@ -2631,15 +2634,16 @@ static int tcp_ack(struct sock *sk, struct sk_buff 
*skb, int flag)
flag |= tcp_clean_rtx_queue(sk, &seq_rtt);
 
if (tp->frto_counter)
-   tcp_process_frto(sk, prior_snd_una, flag);
+   frto_cwnd = tcp_process_frto(sk, prior_snd_una, flag);
 
if (tcp_ack_is_dubious(sk, flag)) {
/* Advance CWND, if state allows this. */
-   if ((flag & FLAG_DATA_ACKED) && tcp_may_raise_cwnd(sk, flag))
+   if ((flag & FLAG_DATA_ACKED) && !frto_cwnd &&
+   tcp_may_raise_cwnd(sk, flag))
tcp_cong_avoid(sk, ack,  seq_rtt, prior_in_flight, 0);
tcp_fastretrans_alert(sk, prior_snd_una, prior_packets, flag);
} else {
-   if ((flag & FLAG_DATA_ACKED))
+   if ((flag & FLAG_DATA_ACKED) && !frto_cwnd)
tcp_cong_avoid(sk, ack, seq_rtt, prior_in_flight, 1);
}
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[TCP] FRTO: Entry is allowed only during (New)Reno like recovery

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=46d0de4ed92650b95f27acae09914996bbe624e7
Commit: 46d0de4ed92650b95f27acae09914996bbe624e7
Parent: 7c9a4a5b67926dd186d427bc5b9fce6ccbde154c
Author: Ilpo Järvinen <[EMAIL PROTECTED]>
AuthorDate: Wed Feb 21 23:10:39 2007 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Apr 25 22:23:12 2007 -0700

[TCP] FRTO: Entry is allowed only during (New)Reno like recovery

This interpretation comes from RFC4138:
"If the sender implements some loss recovery algorithm other
 than Reno or NewReno [FHG04], the F-RTO algorithm SHOULD
 NOT be entered when earlier fast recovery is underway."

I think the RFC means to say (especially in the light of
Appendix B) that ...recovery is underway (not just fast recovery)
or was underway when it was interrupted by an earlier (F-)RTO
that hasn't yet been resolved (snd_una has not advanced enough).
Thus, my interpretation is that whenever TCP has ever
retransmitted other than head, basic version cannot be used
because then the order assumptions which are used as FRTO basis
do not hold.

NewReno has only the head segment retransmitted at a time.
Therefore, walk up to the segment that has not been SACKed, if
that segment is not retransmitted nor anything before it, we know
for sure, that nothing after the non-SACKed segment should be
either. This assumption is valid because TCPCB_EVER_RETRANS does
not leave holes but each non-SACKed segment is rexmitted
in-order.

Check for retrans_out > 1 avoids more expensive walk through the
skb list, as we can know the result beforehand: F-RTO will not be
allowed.

SACKed skb can turn into non-SACked only in the extremely rare
case of SACK reneging, in this case we might fail to detect
retransmissions if there were them for any other than head. To
get rid of that feature, whole rexmit queue would have to be
walked (always) or FRTO should be prevented when SACK reneging
happens. Of course RTO should still trigger after reneging which
makes this issue even less likely to show up. And as long as the
response is as conservative as it's now, nothing bad happens even
then.

Signed-off-by: Ilpo Järvinen <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 include/net/tcp.h|2 +-
 net/ipv4/tcp_input.c |   25 +
 2 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/include/net/tcp.h b/include/net/tcp.h
index 572a77b..7fd6b77 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -341,7 +341,7 @@ extern struct sock *tcp_check_req(struct 
sock *sk,struct sk_buff *skb,
 extern int tcp_child_process(struct sock *parent,
  struct sock *child,
  struct sk_buff *skb);
-extern int tcp_use_frto(const struct sock *sk);
+extern int tcp_use_frto(struct sock *sk);
 extern voidtcp_enter_frto(struct sock *sk);
 extern voidtcp_enter_loss(struct sock *sk, int how);
 extern voidtcp_clear_retrans(struct tcp_sock *tp);
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 723cee6..a283fc1 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1239,14 +1239,31 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff 
*ack_skb, u32 prior_snd_
 /* F-RTO can only be used if these conditions are satisfied:
  *  - there must be some unsent new data
  *  - the advertised window should allow sending it
+ *  - TCP has never retransmitted anything other than head
  */
-int tcp_use_frto(const struct sock *sk)
+int tcp_use_frto(struct sock *sk)
 {
const struct tcp_sock *tp = tcp_sk(sk);
+   struct sk_buff *skb;
+
+   if (!sysctl_tcp_frto || !sk->sk_send_head ||
+   after(TCP_SKB_CB(sk->sk_send_head)->end_seq,
+ tp->snd_una + tp->snd_wnd))
+   return 0;
 
-   return (sysctl_tcp_frto && sk->sk_send_head &&
-   !after(TCP_SKB_CB(sk->sk_send_head)->end_seq,
-  tp->snd_una + tp->snd_wnd));
+   /* Avoid expensive walking of rexmit queue if possible */
+   if (tp->retrans_out > 1)
+   return 0;
+
+   skb = skb_peek(&sk->sk_write_queue)->next;  /* Skips head */
+   sk_stream_for_retrans_queue_from(skb, sk) {
+   if (TCP_SKB_CB(skb)->sacked&TCPCB_RETRANS)
+   return 0;
+   /* Short-circuit when first non-SACKed skb has been checked */
+   if (!(TCP_SKB_CB(skb)->sacked&TCPCB_SACKED_ACKED))
+   break;
+   }
+   return 1;
 }
 
 /* RTO occurred, but do not yet enter Loss state. Instead, defer

[TCP]: SACK enhanced FRTO

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4dc2665e3634d720a62bd27128fc8781fcdad2dc
Commit: 4dc2665e3634d720a62bd27128fc8781fcdad2dc
Parent: 288035f915686a9a9e85e0358c5392bb5d7ae58d
Author: Ilpo Järvinen <[EMAIL PROTECTED]>
AuthorDate: Wed Feb 21 23:16:11 2007 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Apr 25 22:23:16 2007 -0700

[TCP]: SACK enhanced FRTO

Implements the SACK-enhanced FRTO given in RFC4138 using the
variant given in Appendix B.

RFC4138, Appendix B:
  "This means that in order to declare timeout spurious, the TCP
   sender must receive an acknowledgment for non-retransmitted
   segment between SND.UNA and RecoveryPoint in algorithm step 3.
   RecoveryPoint is defined in conservative SACK-recovery
   algorithm [RFC3517]"

The basic version of the FRTO algorithm can still be used also
when SACK is enabled. To enabled SACK-enhanced version, tcp_frto
sysctl is set to 2.

Signed-off-by: Ilpo Järvinen <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/ipv4/tcp_input.c |   76 ++---
 1 files changed, 65 insertions(+), 11 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index df516d4..bb3f234 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -100,6 +100,7 @@ int sysctl_tcp_abc __read_mostly;
 #define FLAG_ECE   0x40 /* ECE in this ACK 
*/
 #define FLAG_DATA_LOST 0x80 /* SACK detected data lossage. 
*/
 #define FLAG_SLOWPATH  0x100 /* Do not skip RFC checks for window 
update.*/
+#define FLAG_ONLY_ORIG_SACKED  0x200 /* SACKs only non-rexmit sent before RTO 
*/
 
 #define FLAG_ACKED (FLAG_DATA_ACKED|FLAG_SYN_ACKED)
 #define FLAG_NOT_DUP   (FLAG_DATA|FLAG_WIN_UPDATE|FLAG_ACKED)
@@ -110,6 +111,8 @@ int sysctl_tcp_abc __read_mostly;
 #define IsFack(tp) ((tp)->rx_opt.sack_ok & 2)
 #define IsDSack(tp) ((tp)->rx_opt.sack_ok & 4)
 
+#define IsSackFrto() (sysctl_tcp_frto == 0x2)
+
 #define TCP_REMNANT (TCP_FLAG_FIN|TCP_FLAG_URG|TCP_FLAG_SYN|TCP_FLAG_PSH)
 
 /* Adapt the MSS value used to make delayed ack decision to the
@@ -1159,6 +1162,18 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff 
*ack_skb, u32 prior_snd_
/* clear lost hint */
tp->retransmit_skb_hint = NULL;
}
+   /* SACK enhanced F-RTO detection.
+* Set flag if and only if non-rexmitted
+* segments below frto_highmark are
+* SACKed (RFC4138; Appendix B).
+* Clearing correct due to in-order walk
+*/
+   if (after(end_seq, tp->frto_highmark)) {
+   flag &= ~FLAG_ONLY_ORIG_SACKED;
+   } else {
+   if (!(sacked & TCPCB_RETRANS))
+   flag |= 
FLAG_ONLY_ORIG_SACKED;
+   }
}
 
TCP_SKB_CB(skb)->sacked |= TCPCB_SACKED_ACKED;
@@ -1240,7 +1255,8 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff 
*ack_skb, u32 prior_snd_
 /* F-RTO can only be used if these conditions are satisfied:
  *  - there must be some unsent new data
  *  - the advertised window should allow sending it
- *  - TCP has never retransmitted anything other than head
+ *  - TCP has never retransmitted anything other than head (SACK enhanced
+ *variant from Appendix B of RFC4138 is more robust here)
  */
 int tcp_use_frto(struct sock *sk)
 {
@@ -1252,6 +1268,9 @@ int tcp_use_frto(struct sock *sk)
  tp->snd_una + tp->snd_wnd))
return 0;
 
+   if (IsSackFrto())
+   return 1;
+
/* Avoid expensive walking of rexmit queue if possible */
if (tp->retrans_out > 1)
return 0;
@@ -1328,9 +1347,18 @@ void tcp_enter_frto(struct sock *sk)
}
tcp_sync_left_out(tp);
 
+   /* Earlier loss recovery underway (see RFC4138; Appendix B).
+* The last condition is necessary at least in tp->frto_counter case.
+*/
+   if (IsSackFrto() && (tp->frto_counter ||
+   ((1 << icsk->icsk_ca_state) & (TCPF_CA_Recovery|TCPF_CA_Loss))) &&
+   after(tp->high_seq, tp->snd_una)) {
+   tp->frto_highmark = tp->high_seq;
+   } else {
+   tp->frto_highmark = tp->snd_nxt;
+   }
tcp_set_ca_state(sk, TCP_CA_Disorder);
   

[TCP] FRTO: Sysctl documentation for SACK enhanced version

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=127af0c44fc916908abd145914d65b9fe598bcd7
Commit: 127af0c44fc916908abd145914d65b9fe598bcd7
Parent: 4dc2665e3634d720a62bd27128fc8781fcdad2dc
Author: Ilpo Järvinen <[EMAIL PROTECTED]>
AuthorDate: Wed Feb 21 23:16:38 2007 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Apr 25 22:23:17 2007 -0700

[TCP] FRTO: Sysctl documentation for SACK enhanced version

The description is overly verbose to avoid ambiguity between
"SACK enabled" and "SACK enhanced FRTO"

Signed-off-by: Ilpo Järvinen <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 Documentation/networking/ip-sysctl.txt |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/Documentation/networking/ip-sysctl.txt 
b/Documentation/networking/ip-sysctl.txt
index 702d1d8..719b429 100644
--- a/Documentation/networking/ip-sysctl.txt
+++ b/Documentation/networking/ip-sysctl.txt
@@ -183,7 +183,10 @@ tcp_frto - BOOLEAN
Enables F-RTO, an enhanced recovery algorithm for TCP retransmission
timeouts.  It is particularly beneficial in wireless environments
where packet loss is typically due to random radio interference
-   rather than intermediate router congestion.
+   rather than intermediate router congestion. If set to 1, basic
+   version is enabled. 2 enables SACK enhanced FRTO, which is
+   EXPERIMENTAL. The basic version can be used also when SACK is
+   enabled for a flow through tcp_sack sysctl.
 
 tcp_keepalive_time - INTEGER
How often TCP sends out keepalive messages when keepalive is enabled.
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[TCP]: FRTO undo response falls back to ratehalving one if ECEd

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e317f6f69cb95527799d308a9421b7dc1252989a
Commit: e317f6f69cb95527799d308a9421b7dc1252989a
Parent: e01f9d7793be82e6c252efbd52c399d3eb65abe4
Author: Ilpo Järvinen <[EMAIL PROTECTED]>
AuthorDate: Fri Mar 2 13:34:19 2007 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Apr 25 22:23:26 2007 -0700

[TCP]: FRTO undo response falls back to ratehalving one if ECEd

Undoing ssthresh is disabled in fastretrans_alert whenever
FLAG_ECE is set by clearing prior_ssthresh. The clearing does
not protect FRTO because FRTO operates before fastretrans_alert.
Moving the clearing of prior_ssthresh earlier seems to be a
suboptimal solution to the FRTO case because then FLAG_ECE will
cause a second ssthresh reduction in try_to_open (the first
occurred when FRTO was entered). So instead, FRTO falls back
immediately to the rate halving response, which switches TCP to
CA_CWR state preventing the latter reduction of ssthresh.

If the first ECE arrived before the ACK after which FRTO is able
to decide RTO as spurious, prior_ssthresh is already cleared.
Thus no undoing for ssthresh occurs. Besides, FLAG_ECE should be
set also in the following ACKs resulting in rate halving response
that sees TCP is already in CA_CWR, which again prevents an extra
ssthresh reduction on that round-trip.

If the first ECE arrived before RTO, ssthresh has already been
adapted and prior_ssthresh remains cleared on entry because TCP
is in CA_CWR (the same applies also to a case where FRTO is
entered more than once and ECE comes in the middle).

High_seq must not be touched after tcp_enter_cwr because CWR
round-trip calculation depends on it.

I believe that after this patch, FRTO should be ECN-safe and
even able to take advantage of synergy benefits.

Signed-off-by: Ilpo Järvinen <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/ipv4/tcp_input.c |   11 ++-
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index cb715ea..d894bbc 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2587,14 +2587,15 @@ static void tcp_conservative_spur_to_response(struct 
tcp_sock *tp)
  */
 static void tcp_ratehalving_spur_to_response(struct sock *sk)
 {
-   struct tcp_sock *tp = tcp_sk(sk);
tcp_enter_cwr(sk, 0);
-   tp->high_seq = tp->frto_highmark;   /* Smoother w/o this? - ij */
 }
 
-static void tcp_undo_spur_to_response(struct sock *sk)
+static void tcp_undo_spur_to_response(struct sock *sk, int flag)
 {
-   tcp_undo_cwr(sk, 1);
+   if (flag&FLAG_ECE)
+   tcp_ratehalving_spur_to_response(sk);
+   else
+   tcp_undo_cwr(sk, 1);
 }
 
 /* F-RTO spurious RTO detection algorithm (RFC4138)
@@ -2681,7 +2682,7 @@ static int tcp_process_frto(struct sock *sk, u32 
prior_snd_una, int flag)
} else /* frto_counter == 2 */ {
switch (sysctl_tcp_frto_response) {
case 2:
-   tcp_undo_spur_to_response(sk);
+   tcp_undo_spur_to_response(sk, flag);
break;
case 1:
tcp_conservative_spur_to_response(tp);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[TCP] Sysctl documentation: tcp_frto_response

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=89808060b7a71376cc2ba8092d43b2010da465b6
Commit: 89808060b7a71376cc2ba8092d43b2010da465b6
Parent: 3cfe3baaf07c9e40a75f9a70662de56df1c246a8
Author: Ilpo Järvinen <[EMAIL PROTECTED]>
AuthorDate: Tue Feb 27 10:10:55 2007 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Apr 25 22:23:24 2007 -0700

[TCP] Sysctl documentation: tcp_frto_response

In addition, fixed minor things in tcp_frto sysctl.

Signed-off-by: Ilpo Järvinen <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 Documentation/networking/ip-sysctl.txt |   21 +++--
 1 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/Documentation/networking/ip-sysctl.txt 
b/Documentation/networking/ip-sysctl.txt
index 719b429..054c515 100644
--- a/Documentation/networking/ip-sysctl.txt
+++ b/Documentation/networking/ip-sysctl.txt
@@ -179,15 +179,32 @@ tcp_fin_timeout - INTEGER
because they eat maximum 1.5K of memory, but they tend
to live longer. Cf. tcp_max_orphans.
 
-tcp_frto - BOOLEAN
+tcp_frto - INTEGER
Enables F-RTO, an enhanced recovery algorithm for TCP retransmission
timeouts.  It is particularly beneficial in wireless environments
where packet loss is typically due to random radio interference
rather than intermediate router congestion. If set to 1, basic
-   version is enabled. 2 enables SACK enhanced FRTO, which is
+   version is enabled. 2 enables SACK enhanced F-RTO, which is
EXPERIMENTAL. The basic version can be used also when SACK is
enabled for a flow through tcp_sack sysctl.
 
+tcp_frto_response - INTEGER
+   When F-RTO has detected that a TCP retransmission timeout was
+   spurious (i.e, the timeout would have been avoided had TCP set a
+   longer retransmission timeout), TCP has several options what to do
+   next. Possible values are:
+   0 Rate halving based; a smooth and conservative response,
+ results in halved cwnd and ssthresh after one RTT
+   1 Very conservative response; not recommended because even
+ though being valid, it interacts poorly with the rest of
+ Linux TCP, halves cwnd and ssthresh immediately
+   2 Aggressive response; undoes congestion control measures
+ that are now known to be unnecessary (ignoring the
+ possibility of a lost retransmission that would require
+ TCP to be more cautious), cwnd and ssthresh are restored
+ to the values prior timeout
+   Default: 0 (rate halving based)
+
 tcp_keepalive_time - INTEGER
How often TCP sends out keepalive messages when keepalive is enabled.
Default: 2hours.
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[TCP]: Add two new spurious RTO responses to FRTO

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3cfe3baaf07c9e40a75f9a70662de56df1c246a8
Commit: 3cfe3baaf07c9e40a75f9a70662de56df1c246a8
Parent: c5e7af0df5d7234afd8596560d9f570cfc6c18bf
Author: Ilpo Järvinen <[EMAIL PROTECTED]>
AuthorDate: Tue Feb 27 10:09:49 2007 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Apr 25 22:23:23 2007 -0700

[TCP]: Add two new spurious RTO responses to FRTO

New sysctl tcp_frto_response is added to select amongst these
responses:
- Rate halving based; reuses CA_CWR state (default)
- Very conservative; used to be the only one available (=1)
- Undo cwr; undoes ssthresh and cwnd reductions (=2)

The response with rate halving requires a new parameter to
tcp_enter_cwr because FRTO has already reduced ssthresh and
doing a second reduction there has to be prevented. In addition,
to keep things nice on 80 cols screen, a local variable was
added.

Signed-off-by: Ilpo Järvinen <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 include/linux/sysctl.h |1 +
 include/net/tcp.h  |3 ++-
 net/ipv4/sysctl_net_ipv4.c |8 
 net/ipv4/tcp_input.c   |   36 
 net/ipv4/tcp_output.c  |2 +-
 5 files changed, 44 insertions(+), 6 deletions(-)

diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index 98e0fd2..c9ccb55 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -439,6 +439,7 @@ enum
NET_TCP_AVAIL_CONG_CONTROL=122,
NET_TCP_ALLOWED_CONG_CONTROL=123,
NET_TCP_MAX_SSTHRESH=124,
+   NET_TCP_FRTO_RESPONSE=125,
 };
 
 enum {
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 6d09f50..f0c9e34 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -220,6 +220,7 @@ extern int sysctl_tcp_app_win;
 extern int sysctl_tcp_adv_win_scale;
 extern int sysctl_tcp_tw_reuse;
 extern int sysctl_tcp_frto;
+extern int sysctl_tcp_frto_response;
 extern int sysctl_tcp_low_latency;
 extern int sysctl_tcp_dma_copybreak;
 extern int sysctl_tcp_nometrics_save;
@@ -738,7 +739,7 @@ static inline void tcp_sync_left_out(struct tcp_sock *tp)
tp->left_out = tp->sacked_out + tp->lost_out;
 }
 
-extern void tcp_enter_cwr(struct sock *sk);
+extern void tcp_enter_cwr(struct sock *sk, const int set_ssthresh);
 extern __u32 tcp_init_cwnd(struct tcp_sock *tp, struct dst_entry *dst);
 
 /* Slow start with delack produces 3 packets of burst, so that
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
index d68effe..6817d64 100644
--- a/net/ipv4/sysctl_net_ipv4.c
+++ b/net/ipv4/sysctl_net_ipv4.c
@@ -647,6 +647,14 @@ ctl_table ipv4_table[] = {
.proc_handler   = &proc_dointvec
},
{
+   .ctl_name   = NET_TCP_FRTO_RESPONSE,
+   .procname   = "tcp_frto_response",
+   .data   = &sysctl_tcp_frto_response,
+   .maxlen = sizeof(int),
+   .mode   = 0644,
+   .proc_handler   = &proc_dointvec
+   },
+   {
.ctl_name   = NET_TCP_LOW_LATENCY,
.procname   = "tcp_low_latency",
.data   = &sysctl_tcp_low_latency,
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index f6ba07f..322e43c 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -86,6 +86,7 @@ int sysctl_tcp_stdurg __read_mostly;
 int sysctl_tcp_rfc1337 __read_mostly;
 int sysctl_tcp_max_orphans __read_mostly = NR_FILE;
 int sysctl_tcp_frto __read_mostly;
+int sysctl_tcp_frto_response __read_mostly;
 int sysctl_tcp_nometrics_save __read_mostly;
 
 int sysctl_tcp_moderate_rcvbuf __read_mostly = 1;
@@ -762,15 +763,17 @@ __u32 tcp_init_cwnd(struct tcp_sock *tp, struct dst_entry 
*dst)
 }
 
 /* Set slow start threshold and cwnd not falling to slow start */
-void tcp_enter_cwr(struct sock *sk)
+void tcp_enter_cwr(struct sock *sk, const int set_ssthresh)
 {
struct tcp_sock *tp = tcp_sk(sk);
+   const struct inet_connection_sock *icsk = inet_csk(sk);
 
tp->prior_ssthresh = 0;
tp->bytes_acked = 0;
if (inet_csk(sk)->icsk_ca_state < TCP_CA_CWR) {
tp->undo_marker = 0;
-   tp->snd_ssthresh = inet_csk(sk)->icsk_ca_ops->ssthresh(sk);
+   if (set_ssthresh)
+   tp->snd_ssthresh = icsk->icsk_ca_ops->ssthresh(sk);
tp->snd_cwnd = min(tp->snd_cwnd,
   tcp_packets_in_flight(tp) + 1U);
tp->snd_cwnd_cnt = 0;
@@ -2003,7 +2006,7 @@ static void tcp_try_to_open(struct sock *sk, struct 
tcp_sock *tp, int flag)
tp->retrans_stamp = 0;
 
if (flag&FLAG_ECE)
-   tcp_enter_cwr(sk);
+   tcp_enter_cwr(sk, 1);
 
if (inet_csk(sk)->icsk_ca_state != TCP_CA_CWR) {

[TCP] FRTO: Reverse RETRANS bit clearing logic

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d1a54c6a0a3f9c2c4ef71982d89b8571bd9eaa51
Commit: d1a54c6a0a3f9c2c4ef71982d89b8571bd9eaa51
Parent: 46d0de4ed92650b95f27acae09914996bbe624e7
Author: Ilpo Järvinen <[EMAIL PROTECTED]>
AuthorDate: Wed Feb 21 23:11:57 2007 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Apr 25 22:23:13 2007 -0700

[TCP] FRTO: Reverse RETRANS bit clearing logic

Previously RETRANS bits were cleared on the entry to FRTO. We
postpone that into tcp_enter_frto_loss, which is really the
place were the clearing should be done anyway. This allows
simplification of the logic from a clearing loop to the head skb
clearing only.

Besides, the other changes made in the previous patches to
tcp_use_frto made it impossible for the non-SACKed FRTO to be
entered if other than the head has been rexmitted.

With SACK-enhanced FRTO (and Appendix B), however, there can be
a number retransmissions in flight when RTO expires (same thing
could happen before this patchset also with non-SACK FRTO). To
not introduce any jumpiness into the packet counting during FRTO,
instead of clearing RETRANS bits from skbs during entry, do it
later on.

Signed-off-by: Ilpo Järvinen <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/ipv4/tcp_input.c |   35 +++
 1 files changed, 23 insertions(+), 12 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index a283fc1..3ef7e9e 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1268,7 +1268,11 @@ int tcp_use_frto(struct sock *sk)
 
 /* RTO occurred, but do not yet enter Loss state. Instead, defer RTO
  * recovery a bit and use heuristics in tcp_process_frto() to detect if
- * the RTO was spurious.
+ * the RTO was spurious. Only clear SACKED_RETRANS of the head here to
+ * keep retrans_out counting accurate (with SACK F-RTO, other than head
+ * may still have that bit set); TCPCB_LOST and remaining SACKED_RETRANS
+ * bits are handled if the Loss state is really to be entered (in
+ * tcp_enter_frto_loss).
  *
  * Do like tcp_enter_loss() would; when RTO expires the second time it
  * does:
@@ -1289,17 +1293,13 @@ void tcp_enter_frto(struct sock *sk)
tcp_ca_event(sk, CA_EVENT_FRTO);
}
 
-   /* Have to clear retransmission markers here to keep the bookkeeping
-* in shape, even though we are not yet in Loss state.
-* If something was really lost, it is eventually caught up
-* in tcp_enter_frto_loss.
-*/
-   tp->retrans_out = 0;
tp->undo_marker = tp->snd_una;
tp->undo_retrans = 0;
 
-   sk_stream_for_retrans_queue(skb, sk) {
+   skb = skb_peek(&sk->sk_write_queue);
+   if (TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_RETRANS) {
TCP_SKB_CB(skb)->sacked &= ~TCPCB_SACKED_RETRANS;
+   tp->retrans_out -= tcp_skb_pcount(skb);
}
tcp_sync_left_out(tp);
 
@@ -1313,7 +1313,7 @@ void tcp_enter_frto(struct sock *sk)
  * which indicates that we should follow the traditional RTO recovery,
  * i.e. mark everything lost and do go-back-N retransmission.
  */
-static void tcp_enter_frto_loss(struct sock *sk, int allowed_segments)
+static void tcp_enter_frto_loss(struct sock *sk, int allowed_segments, int 
flag)
 {
struct tcp_sock *tp = tcp_sk(sk);
struct sk_buff *skb;
@@ -1322,10 +1322,21 @@ static void tcp_enter_frto_loss(struct sock *sk, int 
allowed_segments)
tp->sacked_out = 0;
tp->lost_out = 0;
tp->fackets_out = 0;
+   tp->retrans_out = 0;
 
sk_stream_for_retrans_queue(skb, sk) {
cnt += tcp_skb_pcount(skb);
-   TCP_SKB_CB(skb)->sacked &= ~TCPCB_LOST;
+   /*
+* Count the retransmission made on RTO correctly (only when
+* waiting for the first ACK and did not get it)...
+*/
+   if ((tp->frto_counter == 1) && !(flag&FLAG_DATA_ACKED)) {
+   tp->retrans_out += tcp_skb_pcount(skb);
+   /* ...enter this if branch just for the first segment */
+   flag |= FLAG_DATA_ACKED;
+   } else {
+   TCP_SKB_CB(skb)->sacked &= 
~(TCPCB_LOST|TCPCB_SACKED_RETRANS);
+   }
if (!(TCP_SKB_CB(skb)->sacked&TCPCB_SACKED_ACKED)) {
 
/* Do not mark those segments lost that were
@@ -2550,7 +2561,7 @@ static int tcp_process_frto(struct sock *sk, u32 
prior_snd_una, int flag)
inet_csk(sk)->icsk_retransmits = 0;
 
if (!before(tp->snd_una, tp->frto_highmark)) {
-   tcp_enter_frto_loss(sk, tp->frto_counter + 1);
+   tcp_enter_frto_loss(sk, tp->frto_counter + 1, flag);
return 1;
}
 
@@ -2562,7 

[NET]: Keep sk_backlog near sk_lock

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=fa438ccfdfd3f6db02c13b61b21454eb81cd6a13
Commit: fa438ccfdfd3f6db02c13b61b21454eb81cd6a13
Parent: e317f6f69cb95527799d308a9421b7dc1252989a
Author: Eric Dumazet <[EMAIL PROTECTED]>
AuthorDate: Sun Mar 4 16:05:44 2007 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Apr 25 22:23:27 2007 -0700

[NET]: Keep sk_backlog near sk_lock

sk_backlog is a critical field of struct sock. (known famous words)

It is (ab)used in hot paths, in particular in release_sock(), tcp_recvmsg(),
tcp_v4_rcv(), sk_receive_skb().

It really makes sense to place it next to sk_lock, because sk_backlog is 
only
used after sk_lock locked (and thus memory cache line in L1 cache). This
should reduce cache misses and sk_lock acquisition time.

(In theory, we could only move the head pointer near sk_lock, and leaving 
tail
far away, because 'tail' is normally not so hot, but keep it simple :) )

Signed-off-by: Eric Dumazet <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 include/net/sock.h |   18 +-
 net/core/sock.c|2 +-
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/include/net/sock.h b/include/net/sock.h
index 2c7d60c..a3366c3 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -202,6 +202,15 @@ struct sock {
unsigned short  sk_type;
int sk_rcvbuf;
socket_lock_t   sk_lock;
+   /*
+* The backlog queue is special, it is always used with
+* the per-socket spinlock held and requires low latency
+* access. Therefore we special case it's implementation.
+*/
+   struct {
+   struct sk_buff *head;
+   struct sk_buff *tail;
+   } sk_backlog;
wait_queue_head_t   *sk_sleep;
struct dst_entry*sk_dst_cache;
struct xfrm_policy  *sk_policy[2];
@@ -221,15 +230,6 @@ struct sock {
int sk_rcvlowat;
unsigned long   sk_flags;
unsigned long   sk_lingertime;
-   /*
-* The backlog queue is special, it is always used with
-* the per-socket spinlock held and requires low latency
-* access. Therefore we special case it's implementation.
-*/
-   struct {
-   struct sk_buff *head;
-   struct sk_buff *tail;
-   } sk_backlog;
struct sk_buff_head sk_error_queue;
struct proto*sk_prot_creator;
rwlock_tsk_callback_lock;
diff --git a/net/core/sock.c b/net/core/sock.c
index 27c4f62..6d35d57 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -904,6 +904,7 @@ struct sock *sk_clone(const struct sock *sk, const gfp_t 
priority)
sk_node_init(&newsk->sk_node);
sock_lock_init(newsk);
bh_lock_sock(newsk);
+   newsk->sk_backlog.head  = newsk->sk_backlog.tail = NULL;
 
atomic_set(&newsk->sk_rmem_alloc, 0);
atomic_set(&newsk->sk_wmem_alloc, 0);
@@ -923,7 +924,6 @@ struct sock *sk_clone(const struct sock *sk, const gfp_t 
priority)
newsk->sk_wmem_queued   = 0;
newsk->sk_forward_alloc = 0;
newsk->sk_send_head = NULL;
-   newsk->sk_backlog.head  = newsk->sk_backlog.tail = NULL;
newsk->sk_userlocks = sk->sk_userlocks & 
~SOCK_BINDPORT_LOCK;
 
sock_reset_flag(newsk, SOCK_DONE);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[TCP]: Correct reordering detection change (no FRTO case)

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c5e7af0df5d7234afd8596560d9f570cfc6c18bf
Commit: c5e7af0df5d7234afd8596560d9f570cfc6c18bf
Parent: e0ef57cc56c3c96493f9b0d6c77bb9608eeaa173
Author: Ilpo Järvinen <[EMAIL PROTECTED]>
AuthorDate: Fri Feb 23 16:22:06 2007 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Apr 25 22:23:22 2007 -0700

[TCP]: Correct reordering detection change (no FRTO case)

The reordering detection must work also when FRTO has not been
used at all which was the original intention of mine, just the
expression of the idea was flawed.

Signed-off-by: Ilpo Järvinen <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/ipv4/tcp_input.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index bb3f234..f6ba07f 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1240,7 +1240,7 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff 
*ack_skb, u32 prior_snd_
tp->left_out = tp->sacked_out + tp->lost_out;
 
if ((reord < tp->fackets_out) && icsk->icsk_ca_state != TCP_CA_Loss &&
-   (tp->frto_highmark && after(tp->snd_una, tp->frto_highmark)))
+   (!tp->frto_highmark || after(tp->snd_una, tp->frto_highmark)))
tcp_update_reordering(sk, ((tp->fackets_out + 1) - reord), 0);
 
 #if FASTRETRANS_DEBUG > 0
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[TCP]: Make snd_cwnd_clamp a u32.

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e0ef57cc56c3c96493f9b0d6c77bb9608eeaa173
Commit: e0ef57cc56c3c96493f9b0d6c77bb9608eeaa173
Parent: 54287cc178cf85dbae0decec8b4dc190bff757ad
Author: David S. Miller <[EMAIL PROTECTED]>
AuthorDate: Thu Feb 22 22:52:59 2007 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Apr 25 22:23:21 2007 -0700

[TCP]: Make snd_cwnd_clamp a u32.

Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 include/linux/tcp.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 415193e..18a468d 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -302,7 +302,7 @@ struct tcp_sock {
u32 snd_ssthresh;   /* Slow start size threshold*/
u32 snd_cwnd;   /* Sending congestion window*/
u16 snd_cwnd_cnt;   /* Linear increase counter  */
-   u16 snd_cwnd_clamp; /* Do not allow snd_cwnd to grow above this */
+   u32 snd_cwnd_clamp; /* Do not allow snd_cwnd to grow above this */
u32 snd_cwnd_used;
u32 snd_cwnd_stamp;
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PKTGEN]: use pr_debug

2007-04-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=25c4e53a4c9bfe45be52821f54ec5ce957519db2
Commit: 25c4e53a4c9bfe45be52821f54ec5ce957519db2
Parent: fa438ccfdfd3f6db02c13b61b21454eb81cd6a13
Author: Stephen Hemminger <[EMAIL PROTECTED]>
AuthorDate: Sun Mar 4 16:06:47 2007 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Apr 25 22:23:28 2007 -0700

[PKTGEN]: use pr_debug

Remove private debug macro and replace with standard version

Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>
Signed-off-by: Robert Olsson <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/core/pktgen.c |   34 +++---
 1 files changed, 15 insertions(+), 19 deletions(-)

diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 4b01496..a6bdcb0 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -164,9 +164,6 @@
 
 #define VERSION  "pktgen v2.68: Packet Generator for packet performance 
testing.\n"
 
-/* #define PG_DEBUG(a) a */
-#define PG_DEBUG(a)
-
 /* The buckets are exponential in 'width' */
 #define LAT_BUCKETS_MAX 32
 #define IP_NAME_SZ 32
@@ -1857,8 +1854,7 @@ static int pktgen_mark_device(const char *ifname)
int ret = 0;
 
mutex_lock(&pktgen_thread_lock);
-   PG_DEBUG(printk("pktgen: pktgen_mark_device marking %s for removal\n",
-   ifname));
+   pr_debug("pktgen: pktgen_mark_device marking %s for removal\n", ifname);
 
while (1) {
 
@@ -1867,8 +1863,8 @@ static int pktgen_mark_device(const char *ifname)
break;  /* success */
 
mutex_unlock(&pktgen_thread_lock);
-   PG_DEBUG(printk("pktgen: pktgen_mark_device waiting for %s "
-   "to disappear\n", ifname));
+   pr_debug("pktgen: pktgen_mark_device waiting for %s "
+   "to disappear\n", ifname);
schedule_timeout_interruptible(msecs_to_jiffies(msec_per_try));
mutex_lock(&pktgen_thread_lock);
 
@@ -2848,7 +2844,7 @@ static void pktgen_run(struct pktgen_thread *t)
struct pktgen_dev *pkt_dev;
int started = 0;
 
-   PG_DEBUG(printk("pktgen: entering pktgen_run. %p\n", t));
+   pr_debug("pktgen: entering pktgen_run. %p\n", t);
 
if_lock(t);
list_for_each_entry(pkt_dev, &t->if_list, list) {
@@ -2880,7 +2876,7 @@ static void pktgen_stop_all_threads_ifs(void)
 {
struct pktgen_thread *t;
 
-   PG_DEBUG(printk("pktgen: entering pktgen_stop_all_threads_ifs.\n"));
+   pr_debug("pktgen: entering pktgen_stop_all_threads_ifs.\n");
 
mutex_lock(&pktgen_thread_lock);
 
@@ -2948,7 +2944,7 @@ static void pktgen_run_all_threads(void)
 {
struct pktgen_thread *t;
 
-   PG_DEBUG(printk("pktgen: entering pktgen_run_all_threads.\n"));
+   pr_debug("pktgen: entering pktgen_run_all_threads.\n");
 
mutex_lock(&pktgen_thread_lock);
 
@@ -3040,7 +3036,7 @@ static void pktgen_stop(struct pktgen_thread *t)
 {
struct pktgen_dev *pkt_dev;
 
-   PG_DEBUG(printk("pktgen: entering pktgen_stop\n"));
+   pr_debug("pktgen: entering pktgen_stop\n");
 
if_lock(t);
 
@@ -3064,7 +3060,7 @@ static void pktgen_rem_one_if(struct pktgen_thread *t)
struct list_head *q, *n;
struct pktgen_dev *cur;
 
-   PG_DEBUG(printk("pktgen: entering pktgen_rem_one_if\n"));
+   pr_debug("pktgen: entering pktgen_rem_one_if\n");
 
if_lock(t);
 
@@ -3093,7 +3089,7 @@ static void pktgen_rem_all_ifs(struct pktgen_thread *t)
 
/* Remove all devices, free mem */
 
-   PG_DEBUG(printk("pktgen: entering pktgen_rem_all_ifs\n"));
+   pr_debug("pktgen: entering pktgen_rem_all_ifs\n");
if_lock(t);
 
list_for_each_safe(q, n, &t->if_list) {
@@ -3276,7 +3272,7 @@ static int pktgen_thread_worker(void *arg)
 
t->pid = current->pid;
 
-   PG_DEBUG(printk("pktgen: starting pktgen/%d:  pid=%d\n", cpu, 
current->pid));
+   pr_debug("pktgen: starting pktgen/%d:  pid=%d\n", cpu, current->pid);
 
max_before_softirq = t->max_before_softirq;
 
@@ -3339,13 +3335,13 @@ static int pktgen_thread_worker(void *arg)
set_current_state(TASK_INTERRUPTIBLE);
}
 
-   PG_DEBUG(printk("pktgen: %s stopping all device\n", t->tsk->comm));
+   pr_debug("pktgen: %s stopping all device\n", t->tsk->comm);
pktgen_stop(t);
 
-   PG_DEBUG(printk("pktgen: %s removing all device\n", t->tsk->comm));
+   pr_debug("pktgen: %s removing all device\n", t->tsk->comm);
pktgen_rem_all_ifs(t);
 
-   PG_DEBUG(printk("pktgen: %s removing thread.\n", t->tsk->comm));
+   pr_debug("pktgen: %s removing thread.\n", t->tsk->comm);
pktgen_rem_thread(t);
 
return 0;
@@ -3364,7 +3360,7 @@ static struct pktgen_dev *pktgen_find_dev(struct 
pktgen_thread *t,
   

  1   2   3   4   5   6   7   8   9   10   >