[MIPS] Malta: Delete dead code.

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=fa33a54646fa305a7cf5a2872da062f20ac94b6f
Commit: fa33a54646fa305a7cf5a2872da062f20ac94b6f
Parent: 1097c6ac33defae6cf501b7919c23faf240601f0
Author: Ralf Baechle <[EMAIL PROTECTED]>
AuthorDate: Mon Oct 22 15:13:22 2007 +0100
Committer:  Ralf Baechle <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 22:09:00 2007 +0100

[MIPS] Malta: Delete dead code.

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

diff --git a/arch/mips/mips-boards/generic/time.c 
b/arch/mips/mips-boards/generic/time.c
index 1d00b77..9d6243a 100644
--- a/arch/mips/mips-boards/generic/time.c
+++ b/arch/mips/mips-boards/generic/time.c
@@ -147,21 +147,8 @@ void __init plat_time_init(void)
 #endif
 }
 
-//static irqreturn_t mips_perf_interrupt(int irq, void *dev_id)
-//{
-// return perf_irq();
-//}
-
-//static struct irqaction perf_irqaction = {
-// .handler = mips_perf_interrupt,
-// .flags = IRQF_DISABLED | IRQF_PERCPU,
-// .name = "performance",
-//};
-
 void __init plat_perf_setup(void)
 {
-// struct irqaction *irq = &perf_irqaction;
-
cp0_perfcount_irq = -1;
 
 #ifdef MSC01E_INT_BASE
-
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] Fix include wrapper symbol to something sane.

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9490094b141003d692320113a662224a9fa2ef42
Commit: 9490094b141003d692320113a662224a9fa2ef42
Parent: fa33a54646fa305a7cf5a2872da062f20ac94b6f
Author: Ralf Baechle <[EMAIL PROTECTED]>
AuthorDate: Mon Oct 22 15:17:39 2007 +0100
Committer:  Ralf Baechle <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 22:09:01 2007 +0100

[MIPS] Fix include wrapper symbol to something sane.

And why are there i8253.h and 8253pit.h ...

Signed-off-by: Ralf Baechle <[EMAIL PROTECTED]>
---
 include/asm-mips/i8253.h |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/asm-mips/i8253.h b/include/asm-mips/i8253.h
index 8f689d7..affb32c 100644
--- a/include/asm-mips/i8253.h
+++ b/include/asm-mips/i8253.h
@@ -2,8 +2,8 @@
  *  Machine specific IO port address definition for generic.
  *  Written by Osamu Tomita <[EMAIL PROTECTED]>
  */
-#ifndef _MACH_IO_PORTS_H
-#define _MACH_IO_PORTS_H
+#ifndef __ASM_I8253_H
+#define __ASM_I8253_H
 
 /* i8253A PIT registers */
 #define PIT_MODE   0x43
@@ -27,4 +27,4 @@
 
 extern void setup_pit_timer(void);
 
-#endif /* !_MACH_IO_PORTS_H */
+#endif /* __ASM_I8253_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] Kbuild: Use the new cc-cross-prefix feature.

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=17f690be454de447d8ddc586fa418ebfdb200966
Commit: 17f690be454de447d8ddc586fa418ebfdb200966
Parent: 9490094b141003d692320113a662224a9fa2ef42
Author: Ralf Baechle <[EMAIL PROTECTED]>
AuthorDate: Mon Oct 22 19:10:57 2007 +0100
Committer:  Ralf Baechle <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 22:09:01 2007 +0100

[MIPS] Kbuild: Use the new cc-cross-prefix feature.

Signed-off-by: Ralf Baechle <[EMAIL PROTECTED]>
---
 arch/mips/Kconfig.debug |   12 
 arch/mips/Makefile  |   18 ++
 2 files changed, 10 insertions(+), 20 deletions(-)

diff --git a/arch/mips/Kconfig.debug b/arch/mips/Kconfig.debug
index 3efe117..fd7124c 100644
--- a/arch/mips/Kconfig.debug
+++ b/arch/mips/Kconfig.debug
@@ -6,18 +6,6 @@ config TRACE_IRQFLAGS_SUPPORT
 
 source "lib/Kconfig.debug"
 
-config CROSSCOMPILE
-   bool "Are you using a crosscompiler"
-   help
- Say Y here if you are compiling the kernel on a different
- architecture than the one it is intended to run on.  This is just a
- convenience option which will select the appropriate value for
- the CROSS_COMPILE make variable which otherwise has to be passed on
- the command line from mips-linux-, mipsel-linux-, mips64-linux- and
- mips64el-linux- as appropriate for a particular kernel configuration.
- You will have to pass the value for CROSS_COMPILE manually if the
- name prefix for your tools is different.
-
 config CMDLINE
string "Default kernel command string"
default ""
diff --git a/arch/mips/Makefile b/arch/mips/Makefile
index 14164c2..23c1775 100644
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -18,15 +18,15 @@ cflags-y :=
 # Select the object file format to substitute into the linker script.
 #
 ifdef CONFIG_CPU_LITTLE_ENDIAN
-32bit-tool-prefix  = mipsel-linux-
-64bit-tool-prefix  = mips64el-linux-
+32bit-tool-archpref= mipsel
+64bit-tool-archpref= mips64el
 32bit-bfd  = elf32-tradlittlemips
 64bit-bfd  = elf64-tradlittlemips
 32bit-emul = elf32ltsmip
 64bit-emul = elf64ltsmip
 else
-32bit-tool-prefix  = mips-linux-
-64bit-tool-prefix  = mips64-linux-
+32bit-tool-archpref= mips
+64bit-tool-archpref= mips64
 32bit-bfd  = elf32-tradbigmips
 64bit-bfd  = elf64-tradbigmips
 32bit-emul = elf32btsmip
@@ -34,16 +34,18 @@ else
 endif
 
 ifdef CONFIG_32BIT
-tool-prefix= $(32bit-tool-prefix)
+tool-archpref  = $(32bit-tool-archpref)
 UTS_MACHINE:= mips
 endif
 ifdef CONFIG_64BIT
-tool-prefix= $(64bit-tool-prefix)
+tool-archpref  = $(64bit-tool-archpref)
 UTS_MACHINE:= mips64
 endif
 
-ifdef CONFIG_CROSSCOMPILE
-CROSS_COMPILE  := $(tool-prefix)
+ifneq ($(SUBARCH),$(ARCH))
+  ifeq ($(CROSS_COMPILE),)
+CROSS_COMPILE := $(call cc-cross-prefix, $(tool-archpref)-linux-  
$(tool-archpref)-gnu-linux-  $(tool-archpref)-unknown-gnu-linux-)
+  endif
 endif
 
 ifdef CONFIG_32BIT
-
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] time: Make c0_compare_int_usable more bullet proof

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=dab969c00b8bee17a47057bbb91cd0a348cf6f76
Commit: dab969c00b8bee17a47057bbb91cd0a348cf6f76
Parent: 17f690be454de447d8ddc586fa418ebfdb200966
Author: Atsushi Nemoto <[EMAIL PROTECTED]>
AuthorDate: Tue Oct 23 01:14:06 2007 +0900
Committer:  Ralf Baechle <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 22:09:01 2007 +0100

[MIPS] time: Make c0_compare_int_usable more bullet proof

Use write_c0_compare(read_c0_count()) to clear interrupt.

Signed-off-by: Atsushi Nemoto <[EMAIL PROTECTED]>
Signed-off-by: Ralf Baechle <[EMAIL PROTECTED]>
---
 arch/mips/kernel/cevt-r4k.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/mips/kernel/cevt-r4k.c b/arch/mips/kernel/cevt-r4k.c
index a915e56..ae2984f 100644
--- a/arch/mips/kernel/cevt-r4k.c
+++ b/arch/mips/kernel/cevt-r4k.c
@@ -186,7 +186,7 @@ static int c0_compare_int_usable(void)
 * IP7 already pending?  Try to clear it by acking the timer.
 */
if (c0_compare_int_pending()) {
-   write_c0_compare(read_c0_compare());
+   write_c0_compare(read_c0_count());
irq_disable_hazard();
if (c0_compare_int_pending())
return 0;
@@ -202,7 +202,7 @@ static int c0_compare_int_usable(void)
if (!c0_compare_int_pending())
return 0;
 
-   write_c0_compare(read_c0_compare());
+   write_c0_compare(read_c0_count());
irq_disable_hazard();
if (c0_compare_int_pending())
return 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


[POWERPC] bestcomm: Restrict bus prefetch bugfix to original mpc5200 silicon.

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c052a22e808fc1f9b78b9a2fe7065f2026815128
Commit: c052a22e808fc1f9b78b9a2fe7065f2026815128
Parent: 2fb59d623ad85dfdb8ce03a660051743f7361896
Author: Grant Likely <[EMAIL PROTECTED]>
AuthorDate: Sun Oct 21 10:52:02 2007 -0600
Committer:  Grant Likely <[EMAIL PROTECTED]>
CommitDate: Sun Oct 21 10:52:02 2007 -0600

[POWERPC] bestcomm: Restrict bus prefetch bugfix to original mpc5200 
silicon.

Only the MPC5200 needs this bug fix.  MPC5200B is okay.

Signed-off-by: Grant Likely <[EMAIL PROTECTED]>
---
 arch/powerpc/sysdev/bestcomm/bestcomm.c |9 ++---
 include/asm-powerpc/mpc52xx.h   |5 +
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/sysdev/bestcomm/bestcomm.c 
b/arch/powerpc/sysdev/bestcomm/bestcomm.c
index 48492a8..740ad73 100644
--- a/arch/powerpc/sysdev/bestcomm/bestcomm.c
+++ b/arch/powerpc/sysdev/bestcomm/bestcomm.c
@@ -269,6 +269,7 @@ bcom_engine_init(void)
int task;
phys_addr_t tdt_pa, ctx_pa, var_pa, fdt_pa;
unsigned int tdt_size, ctx_size, var_size, fdt_size;
+   u16 regval;
 
/* Allocate & clear SRAM zones for FDT, TDTs, contexts and vars/incs */
tdt_size = BCOM_MAX_TASKS * sizeof(struct bcom_tdt);
@@ -319,9 +320,11 @@ bcom_engine_init(void)
/* Init 'always' initiator */
out_8(&bcom_eng->regs->ipr[BCOM_INITIATOR_ALWAYS], BCOM_IPR_ALWAYS);
 
-   /* Disable COMM Bus Prefetch, apparently it's not reliable yet */
-   /* FIXME: This should be done on 5200 and not 5200B ... */
-   out_be16(&bcom_eng->regs->PtdCntrl, in_be16(&bcom_eng->regs->PtdCntrl) 
| 1);
+   /* Disable COMM Bus Prefetch on the original 5200; it's broken */
+   if ((mfspr(SPRN_SVR) & MPC5200_SVR_MASK) == MPC5200_SVR) {
+   regval = in_be16(&bcom_eng->regs->PtdCntrl);
+   out_be16(&bcom_eng->regs->PtdCntrl,  regval | 1);
+   }
 
/* Init lock */
spin_lock_init(&bcom_eng->lock);
diff --git a/include/asm-powerpc/mpc52xx.h b/include/asm-powerpc/mpc52xx.h
index 568135f..764d997 100644
--- a/include/asm-powerpc/mpc52xx.h
+++ b/include/asm-powerpc/mpc52xx.h
@@ -20,6 +20,11 @@
 
 #include 
 
+/* Variants of the 5200(B) */
+#define MPC5200_SVR0x80110010
+#define MPC5200_SVR_MASK   0xfff0
+#define MPC5200B_SVR   0x80110020
+#define MPC5200B_SVR_MASK  0xfff0
 
 /*  */
 /* Structures mapping of some unit register set */
-
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


[POWERPC] Add mpc52xx_find_and_map_path(), refactor utility functions

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c5c01c9700e59a5b20d7bdd15808d33ab9d9e877
Commit: c5c01c9700e59a5b20d7bdd15808d33ab9d9e877
Parent: c052a22e808fc1f9b78b9a2fe7065f2026815128
Author: Marian Balakowicz <[EMAIL PROTECTED]>
AuthorDate: Fri Oct 19 04:44:14 2007 +1000
Committer:  Grant Likely <[EMAIL PROTECTED]>
CommitDate: Sun Oct 21 12:42:47 2007 -0600

[POWERPC] Add mpc52xx_find_and_map_path(), refactor utility functions

Add helper routine mpc52xx_find_and_map_path(). Extract common code to
mpc52xx_map_node() and refactor mpc52xx_find_and_map().

Signed-off-by: Jan Wrobel <[EMAIL PROTECTED]>
Signed-off-by: Grant Likely <[EMAIL PROTECTED]>
---
 arch/powerpc/platforms/52xx/mpc52xx_common.c |   21 +
 include/asm-powerpc/mpc52xx.h|1 +
 2 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/platforms/52xx/mpc52xx_common.c 
b/arch/powerpc/platforms/52xx/mpc52xx_common.c
index 3bc201e..74b4b41 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_common.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_common.c
@@ -19,14 +19,12 @@
 #include 
 
 
-void __iomem *
-mpc52xx_find_and_map(const char *compatible)
+static void __iomem *
+mpc52xx_map_node(struct device_node *ofn)
 {
-   struct device_node *ofn;
const u32 *regaddr_p;
u64 regaddr64, size64;
 
-   ofn = of_find_compatible_node(NULL, NULL, compatible);
if (!ofn)
return NULL;
 
@@ -42,8 +40,23 @@ mpc52xx_find_and_map(const char *compatible)
 
return ioremap((u32)regaddr64, (u32)size64);
 }
+
+void __iomem *
+mpc52xx_find_and_map(const char *compatible)
+{
+   return mpc52xx_map_node(
+   of_find_compatible_node(NULL, NULL, compatible));
+}
+
 EXPORT_SYMBOL(mpc52xx_find_and_map);
 
+void __iomem *
+mpc52xx_find_and_map_path(const char *path)
+{
+   return mpc52xx_map_node(of_find_node_by_path(path));
+}
+
+EXPORT_SYMBOL(mpc52xx_find_and_map_path);
 
 /**
  * mpc52xx_find_ipb_freq - Find the IPB bus frequency for a device
diff --git a/include/asm-powerpc/mpc52xx.h b/include/asm-powerpc/mpc52xx.h
index 764d997..8e42846 100644
--- a/include/asm-powerpc/mpc52xx.h
+++ b/include/asm-powerpc/mpc52xx.h
@@ -249,6 +249,7 @@ struct mpc52xx_cdm {
 #ifndef __ASSEMBLY__
 
 extern void __iomem * mpc52xx_find_and_map(const char *);
+extern void __iomem * mpc52xx_find_and_map_path(const char *path);
 extern unsigned int mpc52xx_find_ipb_freq(struct device_node *node);
 extern void mpc5200_setup_xlb_arbiter(void);
 extern void mpc52xx_declare_of_platform_devices(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


[POWERPC] Update device tree binding for mpc5200 gpt

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d24bc314c964e900ddf30efa1ef44565cf0cf44c
Commit: d24bc314c964e900ddf30efa1ef44565cf0cf44c
Parent: c5c01c9700e59a5b20d7bdd15808d33ab9d9e877
Author: Marian Balakowicz <[EMAIL PROTECTED]>
AuthorDate: Fri Oct 19 04:44:24 2007 +1000
Committer:  Grant Likely <[EMAIL PROTECTED]>
CommitDate: Sun Oct 21 12:42:55 2007 -0600

[POWERPC] Update device tree binding for mpc5200 gpt

Add 'fsl,' prefix to 'compatible' property for gpt nodes.
Add 'fsl,' prefix to empty, GPT0 specific 'has-wdt' property.
The fsl, prefix is being added to better match the convention of prefixing
manufacturer specific properties and values with the vendors name.

Signed-off-by: Marian Balakowicz <[EMAIL PROTECTED]>
Signed-off-by: Grant Likely <[EMAIL PROTECTED]>
---
 .../powerpc/mpc52xx-device-tree-bindings.txt   |4 +-
 arch/powerpc/boot/dts/lite5200.dts |   26 +++-
 arch/powerpc/boot/dts/lite5200b.dts|   26 +++-
 drivers/watchdog/mpc5200_wdt.c |3 ++
 4 files changed, 23 insertions(+), 36 deletions(-)

diff --git a/Documentation/powerpc/mpc52xx-device-tree-bindings.txt 
b/Documentation/powerpc/mpc52xx-device-tree-bindings.txt
index 5f7d536..5e03610 100644
--- a/Documentation/powerpc/mpc52xx-device-tree-bindings.txt
+++ b/Documentation/powerpc/mpc52xx-device-tree-bindings.txt
@@ -185,7 +185,7 @@ bestcomm@ dma-controller  
mpc5200-bestcomm 5200 pic also requires
 Recommended soc5200 child nodes; populate as needed for your board
 name   device_type compatibleDescription
    --- -----
-gpt@ gpt mpc5200-gpt   General purpose timers
+gpt@ gpt fsl,mpc5200-gpt   General purpose timers
 rtc@ rtc mpc5200-rtc   Real time clock
 mscan@   mscan   mpc5200-mscan CAN bus controller
 pci@ pci mpc5200-pci   PCI bridge
@@ -213,7 +213,7 @@ cell-index  int When multiple devices are 
present, is the
 5) General Purpose Timer nodes (child of soc5200 node)
 On the mpc5200 and 5200b, GPT0 has a watchdog timer function.  If the board
 design supports the internal wdt, then the device node for GPT0 should
-include the empty property 'has-wdt'.
+include the empty property 'fsl,has-wdt'.
 
 6) PSC nodes (child of soc5200 node)
 PSC nodes can define the optional 'port-number' property to force assignment
diff --git a/arch/powerpc/boot/dts/lite5200.dts 
b/arch/powerpc/boot/dts/lite5200.dts
index bc45f5f..6731763 100644
--- a/arch/powerpc/boot/dts/lite5200.dts
+++ b/arch/powerpc/boot/dts/lite5200.dts
@@ -70,18 +70,16 @@
};
 
[EMAIL PROTECTED] { // General Purpose Timer
-   compatible = "mpc5200-gpt";
-   device_type = "gpt";
+   compatible = "fsl,mpc5200-gpt";
cell-index = <0>;
reg = <600 10>;
interrupts = <1 9 0>;
interrupt-parent = <&mpc5200_pic>;
-   has-wdt;
+   fsl,has-wdt;
};
 
[EMAIL PROTECTED] { // General Purpose Timer
-   compatible = "mpc5200-gpt";
-   device_type = "gpt";
+   compatible = "fsl,mpc5200-gpt";
cell-index = <1>;
reg = <610 10>;
interrupts = <1 a 0>;
@@ -89,8 +87,7 @@
};
 
[EMAIL PROTECTED] { // General Purpose Timer
-   compatible = "mpc5200-gpt";
-   device_type = "gpt";
+   compatible = "fsl,mpc5200-gpt";
cell-index = <2>;
reg = <620 10>;
interrupts = <1 b 0>;
@@ -98,8 +95,7 @@
};
 
[EMAIL PROTECTED] { // General Purpose Timer
-   compatible = "mpc5200-gpt";
-   device_type = "gpt";
+   compatible = "fsl,mpc5200-gpt";
cell-index = <3>;
reg = <630 10>;
interrupts = <1 c 0>;
@@ -107,8 +103,7 @@
};
 
[EMAIL PROTECTED] { // General Purpose Timer
-   compatible = "mpc5200-gpt";
-   device_type = "gpt";
+   compatible = "fsl,mpc5200-gpt";
cell-index = <4>;
reg = <640 10>;
interrupts = <1 d 0>;
@@ -116,8 +111,7 @@
};
 
[EMAIL PROTECTED] { // General Purpose Timer
-   compatible = "mpc5200-gpt";
-

[POWERPC] Add restart support for mpc52xx based platforms

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=86b92cdda9e997dd305851cb16292c67076d58cb
Commit: 86b92cdda9e997dd305851cb16292c67076d58cb
Parent: d24bc314c964e900ddf30efa1ef44565cf0cf44c
Author: Marian Balakowicz <[EMAIL PROTECTED]>
AuthorDate: Fri Oct 19 04:44:33 2007 +1000
Committer:  Grant Likely <[EMAIL PROTECTED]>
CommitDate: Sun Oct 21 12:43:04 2007 -0600

[POWERPC] Add restart support for mpc52xx based platforms

Add common helper routines: mpc52xx_map_wdt() and mpc52xx_restart().

Signed-off-by: Marian Balakowicz <[EMAIL PROTECTED]>
Signed-off-by: Sascha Hauer <[EMAIL PROTECTED]>
Signed-off-by: Grant Likely <[EMAIL PROTECTED]>
---
 arch/powerpc/platforms/52xx/mpc52xx_common.c |   50 ++
 include/asm-powerpc/mpc52xx.h|3 ++
 2 files changed, 53 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/platforms/52xx/mpc52xx_common.c 
b/arch/powerpc/platforms/52xx/mpc52xx_common.c
index 74b4b41..9850685 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_common.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_common.c
@@ -18,6 +18,13 @@
 #include 
 #include 
 
+/*
+ * This variable is mapped in mpc52xx_map_wdt() and used in mpc52xx_restart().
+ * Permanent mapping is required because mpc52xx_restart() can be called
+ * from interrupt context while node mapping (which calls ioremap())
+ * cannot be used at such point.
+ */
+static volatile struct mpc52xx_gpt *mpc52xx_wdt = NULL;
 
 static void __iomem *
 mpc52xx_map_node(struct device_node *ofn)
@@ -126,3 +133,46 @@ mpc52xx_declare_of_platform_devices(void)
"Error while probing of_platform bus\n");
 }
 
+void __init
+mpc52xx_map_wdt(void)
+{
+   const void *has_wdt;
+   struct device_node *np;
+
+   /* mpc52xx_wdt is mapped here and used in mpc52xx_restart,
+* possibly from a interrupt context. wdt is only implement
+* on a gpt0, so check has-wdt property before mapping.
+*/
+   for_each_compatible_node(np, NULL, "fsl,mpc5200-gpt") {
+   has_wdt = of_get_property(np, "fsl,has-wdt", NULL);
+   if (has_wdt) {
+   mpc52xx_wdt = mpc52xx_map_node(np);
+   return;
+   }
+   }
+   for_each_compatible_node(np, NULL, "mpc5200-gpt") {
+   has_wdt = of_get_property(np, "has-wdt", NULL);
+   if (has_wdt) {
+   mpc52xx_wdt = mpc52xx_map_node(np);
+   return;
+   }
+   }
+}
+
+void
+mpc52xx_restart(char *cmd)
+{
+   local_irq_disable();
+
+   /* Turn on the watchdog and wait for it to expire.
+* It effectively does a reset. */
+   if (mpc52xx_wdt) {
+   out_be32(&mpc52xx_wdt->mode, 0x);
+   out_be32(&mpc52xx_wdt->count, 0x00ff);
+   out_be32(&mpc52xx_wdt->mode, 0x9004);
+   } else
+   printk("mpc52xx_restart: Can't access wdt. "
+   "Restart impossible, system halted.\n");
+
+   while (1);
+}
diff --git a/include/asm-powerpc/mpc52xx.h b/include/asm-powerpc/mpc52xx.h
index 8e42846..fcb2ebb 100644
--- a/include/asm-powerpc/mpc52xx.h
+++ b/include/asm-powerpc/mpc52xx.h
@@ -259,6 +259,9 @@ extern unsigned int mpc52xx_get_irq(void);
 
 extern int __init mpc52xx_add_bridge(struct device_node *node);
 
+extern void __init mpc52xx_map_wdt(void);
+extern void mpc52xx_restart(char *cmd);
+
 #endif /* __ASSEMBLY__ */
 
 #ifdef CONFIG_PM
-
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


[POWERPC] Enable restart support for lite5200 board

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9dda78b711ca4d507251a7e896b2f41ec019fc58
Commit: 9dda78b711ca4d507251a7e896b2f41ec019fc58
Parent: 86b92cdda9e997dd305851cb16292c67076d58cb
Author: Marian Balakowicz <[EMAIL PROTECTED]>
AuthorDate: Fri Oct 19 04:44:39 2007 +1000
Committer:  Grant Likely <[EMAIL PROTECTED]>
CommitDate: Sun Oct 21 12:43:14 2007 -0600

[POWERPC] Enable restart support for lite5200 board

Use the watchdog timer to implement board restart support.

Signed-off-by: Marian Balakowicz <[EMAIL PROTECTED]>
Signed-off-by: Grant Likely <[EMAIL PROTECTED]>
---
 arch/powerpc/platforms/52xx/lite5200.c |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/platforms/52xx/lite5200.c 
b/arch/powerpc/platforms/52xx/lite5200.c
index 65b7ae4..25d2bfa 100644
--- a/arch/powerpc/platforms/52xx/lite5200.c
+++ b/arch/powerpc/platforms/52xx/lite5200.c
@@ -145,6 +145,9 @@ static void __init lite5200_setup_arch(void)
/* Some mpc5200 & mpc5200b related configuration */
mpc5200_setup_xlb_arbiter();
 
+   /* Map wdt for mpc52xx_restart() */
+   mpc52xx_map_wdt();
+
 #ifdef CONFIG_PM
mpc52xx_suspend.board_suspend_prepare = lite5200_suspend_prepare;
mpc52xx_suspend.board_resume_finish = lite5200_resume_finish;
@@ -183,5 +186,6 @@ define_machine(lite5200) {
.init   = mpc52xx_declare_of_platform_devices,
.init_IRQ   = mpc52xx_init_irq,
.get_irq= mpc52xx_get_irq,
+   .restart= mpc52xx_restart,
.calibrate_decr = generic_calibrate_decr,
 };
-
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


[Bluetooth] Finish L2CAP configuration only with acceptable settings

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=876d9484edf77d228adb42aecd4debd58d7739d6
Commit: 876d9484edf77d228adb42aecd4debd58d7739d6
Parent: a9de9248064bfc8eb0a183a6a951a4e7b5ca10a4
Author: Marcel Holtmann <[EMAIL PROTECTED]>
AuthorDate: Sat Oct 20 13:35:42 2007 +0200
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 02:59:40 2007 -0700

[Bluetooth] Finish L2CAP configuration only with acceptable settings

The parameters of the L2CAP output configuration might not be accepted
after the first configuration round. So only indicate a finished output
configuration when acceptable settings are provided.

Signed-off-by: Marcel Holtmann <[EMAIL PROTECTED]>
---
 net/bluetooth/l2cap.c |   16 ++--
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index 36ef27b..6ce693d 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -1370,8 +1370,10 @@ static int l2cap_parse_conf_req(struct sock *sk, void 
*data)
 
if (pi->conf_mtu < pi->omtu)
result = L2CAP_CONF_UNACCEPT;
-   else
+   else {
pi->omtu = pi->conf_mtu;
+   pi->conf_state |= L2CAP_CONF_OUTPUT_DONE;
+   }
 
l2cap_add_conf_opt(&ptr, L2CAP_CONF_MTU, 2, pi->omtu);
}
@@ -1577,16 +1579,19 @@ static inline int l2cap_config_req(struct l2cap_conn 
*conn, struct l2cap_cmd_hdr
 
l2cap_send_cmd(conn, cmd->ident, L2CAP_CONF_RSP, len, rsp);
 
-   /* Output config done. */
-   l2cap_pi(sk)->conf_state |= L2CAP_CONF_OUTPUT_DONE;
-
/* Reset config buffer. */
l2cap_pi(sk)->conf_len = 0;
 
+   if (!(l2cap_pi(sk)->conf_state & L2CAP_CONF_OUTPUT_DONE))
+   goto unlock;
+
if (l2cap_pi(sk)->conf_state & L2CAP_CONF_INPUT_DONE) {
sk->sk_state = BT_CONNECTED;
l2cap_chan_ready(sk);
-   } else if (!(l2cap_pi(sk)->conf_state & L2CAP_CONF_REQ_SENT)) {
+   goto unlock;
+   }
+
+   if (!(l2cap_pi(sk)->conf_state & L2CAP_CONF_REQ_SENT)) {
u8 req[64];
l2cap_send_cmd(conn, l2cap_get_ident(conn), L2CAP_CONF_REQ,
l2cap_build_conf_req(sk, req), req);
@@ -1646,7 +1651,6 @@ static inline int l2cap_config_rsp(struct l2cap_conn 
*conn, struct l2cap_cmd_hdr
if (flags & 0x01)
goto done;
 
-   /* Input config done */
l2cap_pi(sk)->conf_state |= L2CAP_CONF_INPUT_DONE;
 
if (l2cap_pi(sk)->conf_state & L2CAP_CONF_OUTPUT_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


[Bluetooth] Remove global conf_mtu variable from L2CAP

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=861d6882b3dfe1710b35dbddf1b395b962061413
Commit: 861d6882b3dfe1710b35dbddf1b395b962061413
Parent: 876d9484edf77d228adb42aecd4debd58d7739d6
Author: Marcel Holtmann <[EMAIL PROTECTED]>
AuthorDate: Sat Oct 20 13:37:06 2007 +0200
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 02:59:41 2007 -0700

[Bluetooth] Remove global conf_mtu variable from L2CAP

After the change to the L2CAP configuration parameter handling the
global conf_mtu variable is no longer needed and so remove it.

Signed-off-by: Marcel Holtmann <[EMAIL PROTECTED]>
---
 include/net/bluetooth/l2cap.h |   10 +-
 net/bluetooth/l2cap.c |   12 ++--
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index 70e70f5..f7bcd1f 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -221,7 +221,6 @@ struct l2cap_pinfo {
__u8conf_len;
__u8conf_state;
__u8conf_retry;
-   __u16   conf_mtu;
 
__u8ident;
 
@@ -232,10 +231,11 @@ struct l2cap_pinfo {
struct sock *prev_c;
 };
 
-#define L2CAP_CONF_REQ_SENT0x01
-#define L2CAP_CONF_INPUT_DONE  0x02
-#define L2CAP_CONF_OUTPUT_DONE 0x04
-#define L2CAP_CONF_MAX_RETRIES 2
+#define L2CAP_CONF_REQ_SENT0x01
+#define L2CAP_CONF_INPUT_DONE  0x02
+#define L2CAP_CONF_OUTPUT_DONE 0x04
+
+#define L2CAP_CONF_MAX_RETRIES 2
 
 void l2cap_load(void);
 
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index 6ce693d..fde1606 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -508,7 +508,6 @@ static void l2cap_sock_init(struct sock *sk, struct sock 
*parent)
 
/* Default config options */
pi->conf_len = 0;
-   pi->conf_mtu = L2CAP_DEFAULT_MTU;
pi->flush_to = L2CAP_DEFAULT_FLUSH_TO;
 }
 
@@ -1256,11 +1255,11 @@ static inline int l2cap_get_conf_opt(void **ptr, int 
*type, int *olen, unsigned
break;
 
case 2:
-   *val = __le16_to_cpu(*((__le16 *)opt->val));
+   *val = __le16_to_cpu(*((__le16 *) opt->val));
break;
 
case 4:
-   *val = __le32_to_cpu(*((__le32 *)opt->val));
+   *val = __le32_to_cpu(*((__le32 *) opt->val));
break;
 
default:
@@ -1332,6 +1331,7 @@ static int l2cap_parse_conf_req(struct sock *sk, void 
*data)
int len = pi->conf_len;
int type, hint, olen;
unsigned long val;
+   u16 mtu = L2CAP_DEFAULT_MTU;
u16 result = L2CAP_CONF_SUCCESS;
 
BT_DBG("sk %p", sk);
@@ -1344,7 +1344,7 @@ static int l2cap_parse_conf_req(struct sock *sk, void 
*data)
 
switch (type) {
case L2CAP_CONF_MTU:
-   pi->conf_mtu = val;
+   mtu = val;
break;
 
case L2CAP_CONF_FLUSH_TO:
@@ -1368,10 +1368,10 @@ static int l2cap_parse_conf_req(struct sock *sk, void 
*data)
/* Configure output options and let the other side know
 * which ones we don't like. */
 
-   if (pi->conf_mtu < pi->omtu)
+   if (mtu < pi->omtu)
result = L2CAP_CONF_UNACCEPT;
else {
-   pi->omtu = pi->conf_mtu;
+   pi->omtu = mtu;
pi->conf_state |= L2CAP_CONF_OUTPUT_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


[Bluetooth] Retrieve L2CAP features mask on connection setup

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4e8402a3f884427f9233ba436459c158d1f2e114
Commit: 4e8402a3f884427f9233ba436459c158d1f2e114
Parent: 861d6882b3dfe1710b35dbddf1b395b962061413
Author: Marcel Holtmann <[EMAIL PROTECTED]>
AuthorDate: Sat Oct 20 13:37:56 2007 +0200
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 02:59:41 2007 -0700

[Bluetooth] Retrieve L2CAP features mask on connection setup

The Bluetooth 1.2 specification introduced a specific features mask
value to interoperate with newer versions of the specification. So far
this piece of information was never needed, but future extensions will
rely on it. This patch adds a generic way to retrieve this information
only once per connection setup.

Signed-off-by: Marcel Holtmann <[EMAIL PROTECTED]>
---
 include/net/bluetooth/l2cap.h |   14 ++-
 net/bluetooth/l2cap.c |  233 ++--
 2 files changed, 163 insertions(+), 84 deletions(-)

diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index f7bcd1f..e1ea640 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -29,7 +29,8 @@
 #define L2CAP_DEFAULT_MTU  672
 #define L2CAP_DEFAULT_FLUSH_TO 0x
 
-#define L2CAP_CONN_TIMEOUT (HZ * 40)
+#define L2CAP_CONN_TIMEOUT (4) /* 40 seconds */
+#define L2CAP_INFO_TIMEOUT (4000)  /*  4 seconds */
 
 /* L2CAP socket address */
 struct sockaddr_l2 {
@@ -160,7 +161,6 @@ struct l2cap_disconn_rsp {
 
 struct l2cap_info_req {
__le16  type;
-   __u8data[0];
 } __attribute__ ((packed));
 
 struct l2cap_info_rsp {
@@ -192,6 +192,13 @@ struct l2cap_conn {
 
unsigned intmtu;
 
+   __u32   feat_mask;
+
+   __u8info_state;
+   __u8info_ident;
+
+   struct timer_list info_timer;
+
spinlock_t  lock;
 
struct sk_buff *rx_skb;
@@ -202,6 +209,9 @@ struct l2cap_conn {
struct l2cap_chan_list chan_list;
 };
 
+#define L2CAP_INFO_CL_MTU_REQ_SENT 0x01
+#define L2CAP_INFO_FEAT_MASK_REQ_SENT  0x02
+
 /* - L2CAP channel and socket info - */
 #define l2cap_pi(sk) ((struct l2cap_pinfo *) sk)
 
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index fde1606..896ae5a 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -258,7 +258,119 @@ static void l2cap_chan_del(struct sock *sk, int err)
sk->sk_state_change(sk);
 }
 
+static inline u8 l2cap_get_ident(struct l2cap_conn *conn)
+{
+   u8 id;
+
+   /* Get next available identificator.
+*1 - 128 are used by kernel.
+*  129 - 199 are reserved.
+*  200 - 254 are used by utilities like l2ping, etc.
+*/
+
+   spin_lock_bh(&conn->lock);
+
+   if (++conn->tx_ident > 128)
+   conn->tx_ident = 1;
+
+   id = conn->tx_ident;
+
+   spin_unlock_bh(&conn->lock);
+
+   return id;
+}
+
+static inline int l2cap_send_cmd(struct l2cap_conn *conn, u8 ident, u8 code, 
u16 len, void *data)
+{
+   struct sk_buff *skb = l2cap_build_cmd(conn, code, ident, len, data);
+
+   BT_DBG("code 0x%2.2x", code);
+
+   if (!skb)
+   return -ENOMEM;
+
+   return hci_send_acl(conn->hcon, skb, 0);
+}
+
 /*  L2CAP connections  */
+static void l2cap_conn_start(struct l2cap_conn *conn)
+{
+   struct l2cap_chan_list *l = &conn->chan_list;
+   struct sock *sk;
+
+   BT_DBG("conn %p", conn);
+
+   read_lock(&l->lock);
+
+   for (sk = l->head; sk; sk = l2cap_pi(sk)->next_c) {
+   bh_lock_sock(sk);
+
+   if (sk->sk_type != SOCK_SEQPACKET) {
+   l2cap_sock_clear_timer(sk);
+   sk->sk_state = BT_CONNECTED;
+   sk->sk_state_change(sk);
+   } else if (sk->sk_state == BT_CONNECT) {
+   struct l2cap_conn_req req;
+   l2cap_pi(sk)->ident = l2cap_get_ident(conn);
+   req.scid = cpu_to_le16(l2cap_pi(sk)->scid);
+   req.psm  = l2cap_pi(sk)->psm;
+   l2cap_send_cmd(conn, l2cap_pi(sk)->ident,
+   L2CAP_CONN_REQ, sizeof(req), &req);
+   }
+
+   bh_unlock_sock(sk);
+   }
+
+   read_unlock(&l->lock);
+}
+
+static void l2cap_conn_ready(struct l2cap_conn *conn)
+{
+   BT_DBG("conn %p", conn);
+
+   if (conn->chan_list.head || !hlist_empty(&l2cap_sk_list.head)) {
+   struct l2cap_info_req req;
+
+   req.type = cpu_to_le16(L2CAP_IT_FEAT_MASK);
+
+   conn->info_state |= L2CAP_INFO_FEAT_MASK_REQ_SENT;
+   conn->info_ident = l2cap_get_ident(conn);
+
+   mod_timer(&conn->info_timer,
+   jiffies + msecs_to_jiffies(L2CAP_INFO_TIMEOUT));
+
+ 

[Bluetooth] Advertise L2CAP features mask support

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f0709e03ac3552b1b048ee171cb96ecaacc6813c
Commit: f0709e03ac3552b1b048ee171cb96ecaacc6813c
Parent: 4e8402a3f884427f9233ba436459c158d1f2e114
Author: Marcel Holtmann <[EMAIL PROTECTED]>
AuthorDate: Sat Oct 20 13:38:51 2007 +0200
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 02:59:42 2007 -0700

[Bluetooth] Advertise L2CAP features mask support

Indicate the support for the L2CAP features mask value when the remote
entity tries to negotiate Bluetooth 1.2 specific features.

Signed-off-by: Marcel Holtmann <[EMAIL PROTECTED]>
---
 net/bluetooth/l2cap.c |   23 ++-
 1 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index 896ae5a..733c95d 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -55,7 +55,9 @@
 #define BT_DBG(D...)
 #endif
 
-#define VERSION "2.8"
+#define VERSION "2.9"
+
+static u32 l2cap_feat_mask = 0x;
 
 static const struct proto_ops l2cap_sock_ops;
 
@@ -1775,16 +1777,27 @@ static inline int l2cap_disconnect_rsp(struct 
l2cap_conn *conn, struct l2cap_cmd
 static inline int l2cap_information_req(struct l2cap_conn *conn, struct 
l2cap_cmd_hdr *cmd, u8 *data)
 {
struct l2cap_info_req *req = (struct l2cap_info_req *) data;
-   struct l2cap_info_rsp rsp;
u16 type;
 
type = __le16_to_cpu(req->type);
 
BT_DBG("type 0x%4.4x", type);
 
-   rsp.type   = cpu_to_le16(type);
-   rsp.result = cpu_to_le16(L2CAP_IR_NOTSUPP);
-   l2cap_send_cmd(conn, cmd->ident, L2CAP_INFO_RSP, sizeof(rsp), &rsp);
+   if (type == L2CAP_IT_FEAT_MASK) {
+   u8 buf[8];
+   struct l2cap_info_rsp *rsp = (struct l2cap_info_rsp *) buf;
+   rsp->type   = cpu_to_le16(L2CAP_IT_FEAT_MASK);
+   rsp->result = cpu_to_le16(L2CAP_IR_SUCCESS);
+   put_unaligned(cpu_to_le32(l2cap_feat_mask), (__le32 *) 
rsp->data);
+   l2cap_send_cmd(conn, cmd->ident,
+   L2CAP_INFO_RSP, sizeof(buf), buf);
+   } else {
+   struct l2cap_info_rsp rsp;
+   rsp.type   = cpu_to_le16(type);
+   rsp.result = cpu_to_le16(L2CAP_IR_NOTSUPP);
+   l2cap_send_cmd(conn, cmd->ident,
+   L2CAP_INFO_RSP, sizeof(rsp), &rsp);
+   }
 
return 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


[Bluetooth] Fall back to L2CAP in basic mode

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6464f35f3771f69cd8d107fff166dc29ab392f97
Commit: 6464f35f3771f69cd8d107fff166dc29ab392f97
Parent: f0709e03ac3552b1b048ee171cb96ecaacc6813c
Author: Marcel Holtmann <[EMAIL PROTECTED]>
AuthorDate: Sat Oct 20 13:39:51 2007 +0200
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 02:59:43 2007 -0700

[Bluetooth] Fall back to L2CAP in basic mode

In case the remote entity tries to negogiate retransmission or flow
control mode, reject it and fall back to basic mode.

Signed-off-by: Marcel Holtmann <[EMAIL PROTECTED]>
---
 include/net/bluetooth/l2cap.h |   13 +
 net/bluetooth/l2cap.c |   32 
 2 files changed, 37 insertions(+), 8 deletions(-)

diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index e1ea640..73e115b 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -149,6 +149,19 @@ struct l2cap_conf_opt {
 
 #define L2CAP_CONF_MAX_SIZE22
 
+struct l2cap_conf_rfc {
+   __u8   mode;
+   __u8   txwin_size;
+   __u8   max_transmit;
+   __le16 retrans_timeout;
+   __le16 monitor_timeout;
+   __le16 max_pdu_size;
+} __attribute__ ((packed));
+
+#define L2CAP_MODE_BASIC   0x00
+#define L2CAP_MODE_RETRANS 0x01
+#define L2CAP_MODE_FLOWCTL 0x02
+
 struct l2cap_disconn_req {
__le16 dcid;
__le16 scid;
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index 733c95d..6fbbae7 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -1048,7 +1048,7 @@ static int l2cap_sock_setsockopt(struct socket *sock, int 
level, int optname, ch
opts.imtu = l2cap_pi(sk)->imtu;
opts.omtu = l2cap_pi(sk)->omtu;
opts.flush_to = l2cap_pi(sk)->flush_to;
-   opts.mode = 0x00;
+   opts.mode = L2CAP_MODE_BASIC;
 
len = min_t(unsigned int, sizeof(opts), optlen);
if (copy_from_user((char *) &opts, optval, len)) {
@@ -1097,7 +1097,7 @@ static int l2cap_sock_getsockopt(struct socket *sock, int 
level, int optname, ch
opts.imtu = l2cap_pi(sk)->imtu;
opts.omtu = l2cap_pi(sk)->omtu;
opts.flush_to = l2cap_pi(sk)->flush_to;
-   opts.mode = 0x00;
+   opts.mode = L2CAP_MODE_BASIC;
 
len = min_t(unsigned int, len, sizeof(opts));
if (copy_to_user(optval, (char *) &opts, len))
@@ -1376,6 +1376,7 @@ static int l2cap_parse_conf_req(struct sock *sk, void 
*data)
int len = pi->conf_len;
int type, hint, olen;
unsigned long val;
+   struct l2cap_conf_rfc rfc = { .mode = L2CAP_MODE_BASIC };
u16 mtu = L2CAP_DEFAULT_MTU;
u16 result = L2CAP_CONF_SUCCESS;
 
@@ -1399,6 +1400,11 @@ static int l2cap_parse_conf_req(struct sock *sk, void 
*data)
case L2CAP_CONF_QOS:
break;
 
+   case L2CAP_CONF_RFC:
+   if (olen == sizeof(rfc))
+   memcpy(&rfc, (void *) val, olen);
+   break;
+
default:
if (hint)
break;
@@ -1413,14 +1419,24 @@ static int l2cap_parse_conf_req(struct sock *sk, void 
*data)
/* Configure output options and let the other side know
 * which ones we don't like. */
 
-   if (mtu < pi->omtu)
+   if (rfc.mode == L2CAP_MODE_BASIC) {
+   if (mtu < pi->omtu)
+   result = L2CAP_CONF_UNACCEPT;
+   else {
+   pi->omtu = mtu;
+   pi->conf_state |= L2CAP_CONF_OUTPUT_DONE;
+   }
+
+   l2cap_add_conf_opt(&ptr, L2CAP_CONF_MTU, 2, pi->omtu);
+   } else {
result = L2CAP_CONF_UNACCEPT;
-   else {
-   pi->omtu = mtu;
-   pi->conf_state |= L2CAP_CONF_OUTPUT_DONE;
-   }
 
-   l2cap_add_conf_opt(&ptr, L2CAP_CONF_MTU, 2, pi->omtu);
+   memset(&rfc, 0, sizeof(rfc));
+   rfc.mode = L2CAP_MODE_BASIC;
+
+   l2cap_add_conf_opt(&ptr, L2CAP_CONF_RFC,
+   sizeof(rfc), (unsigned long) 
&rfc);
+   }
}
 
rsp->scid   = cpu_to_le16(pi->dcid);
-
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


[Bluetooth] Change BPA 100/105 driver to use USB anchors

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e24b21ec85afda6f51b6bc403e971ff2aa7eacee
Commit: e24b21ec85afda6f51b6bc403e971ff2aa7eacee
Parent: 6464f35f3771f69cd8d107fff166dc29ab392f97
Author: Marcel Holtmann <[EMAIL PROTECTED]>
AuthorDate: Sat Oct 20 13:41:33 2007 +0200
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 02:59:43 2007 -0700

[Bluetooth] Change BPA 100/105 driver to use USB anchors

With the new support for USB anchors the driver can become more
simpler and also cleaner. This patch switches to the usage of USB
anchors for all URBs.

Signed-off-by: Marcel Holtmann <[EMAIL PROTECTED]>
---
 drivers/bluetooth/bpa10x.c | 1208 
 1 files changed, 554 insertions(+), 654 deletions(-)

diff --git a/drivers/bluetooth/bpa10x.c b/drivers/bluetooth/bpa10x.c
dissimilarity index 67%
index e8ebd5d..1375b53 100644
--- a/drivers/bluetooth/bpa10x.c
+++ b/drivers/bluetooth/bpa10x.c
@@ -1,654 +1,554 @@
-/*
- *
- *  Digianswer Bluetooth USB driver
- *
- *  Copyright (C) 2004-2005  Marcel Holtmann <[EMAIL PROTECTED]>
- *
- *
- *  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
- *
- */
-
-#include 
-
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include 
-
-#include 
-#include 
-
-#ifndef CONFIG_BT_HCIBPA10X_DEBUG
-#undef  BT_DBG
-#define BT_DBG(D...)
-#endif
-
-#define VERSION "0.8"
-
-static int ignore = 0;
-
-static struct usb_device_id bpa10x_table[] = {
-   /* Tektronix BPA 100/105 (Digianswer) */
-   { USB_DEVICE(0x08fd, 0x0002) },
-
-   { } /* Terminating entry */
-};
-
-MODULE_DEVICE_TABLE(usb, bpa10x_table);
-
-#define BPA10X_CMD_EP  0x00
-#define BPA10X_EVT_EP  0x81
-#define BPA10X_TX_EP   0x02
-#define BPA10X_RX_EP   0x82
-
-#define BPA10X_CMD_BUF_SIZE252
-#define BPA10X_EVT_BUF_SIZE16
-#define BPA10X_TX_BUF_SIZE 384
-#define BPA10X_RX_BUF_SIZE 384
-
-struct bpa10x_data {
-   struct hci_dev  *hdev;
-   struct usb_device   *udev;
-
-   rwlock_tlock;
-
-   struct sk_buff_head cmd_queue;
-   struct urb  *cmd_urb;
-   struct urb  *evt_urb;
-   struct sk_buff  *evt_skb;
-   unsigned intevt_len;
-
-   struct sk_buff_head tx_queue;
-   struct urb  *tx_urb;
-   struct urb  *rx_urb;
-};
-
-#define HCI_VENDOR_HDR_SIZE5
-
-struct hci_vendor_hdr {
-   __u8type;
-   __le16  snum;
-   __le16  dlen;
-} __attribute__ ((packed));
-
-static void bpa10x_recv_bulk(struct bpa10x_data *data, unsigned char *buf, int 
count)
-{
-   struct hci_acl_hdr *ah;
-   struct hci_sco_hdr *sh;
-   struct hci_vendor_hdr *vh;
-   struct sk_buff *skb;
-   int len;
-
-   while (count) {
-   switch (*buf++) {
-   case HCI_ACLDATA_PKT:
-   ah = (struct hci_acl_hdr *) buf;
-   len = HCI_ACL_HDR_SIZE + __le16_to_cpu(ah->dlen);
-   skb = bt_skb_alloc(len, GFP_ATOMIC);
-   if (skb) {
-   memcpy(skb_put(skb, len), buf, len);
-   skb->dev = (void *) data->hdev;
-   bt_cb(skb)->pkt_type = HCI_ACLDATA_PKT;
-   hci_recv_frame(skb);
-   }
-   break;
-
-   case HCI_SCODATA_PKT:
-   sh = (struct hci_sco_hdr *) buf;
-   len = HCI_SCO_HDR_SIZE + sh->dlen;
-   skb = bt_skb_alloc(len, GFP_ATOMIC);
-   if (skb) {
-   memcpy(skb_put(skb, len), buf, len);
-   skb->dev = (void *) data->hdev;
-   bt_cb(skb)->pkt_type = HCI_SCODATA_PKT;
-   hci_recv_frame(skb);
-   }
-   break;
-
-   case HCI_VENDOR_PKT:
-   vh = (struct hci_vendor_hdr *) buf;
-   len = HCI_VENDOR_HDR_SIZE + __le16_to_cpu(vh->dlen);
-   skb = bt_skb_alloc

[Bluetooth] Add UART driver for Texas Instruments' BRF63xx chips

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=166d2f6a4332aad53cb0750a296f76c06102552d
Commit: 166d2f6a4332aad53cb0750a296f76c06102552d
Parent: e24b21ec85afda6f51b6bc403e971ff2aa7eacee
Author: Ohad Ben-Cohen <[EMAIL PROTECTED]>
AuthorDate: Sat Oct 20 13:42:36 2007 +0200
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 02:59:44 2007 -0700

[Bluetooth] Add UART driver for Texas Instruments' BRF63xx chips

Add support for Texas Instruments' HCI Low Level (HCILL) Bluetooth
protocol, which is a power management extension to H4. The HCILL is
widely used by TI's BRF63xx Bluetooth chips.

Signed-off-by: Ohad Ben-Cohen <[EMAIL PROTECTED]>
Signed-off-by: Marcel Holtmann <[EMAIL PROTECTED]>
---
 drivers/bluetooth/Kconfig |   11 +
 drivers/bluetooth/Makefile|1 +
 drivers/bluetooth/hci_ldisc.c |8 +-
 drivers/bluetooth/hci_ll.c|  531 +
 drivers/bluetooth/hci_uart.h  |8 +-
 5 files changed, 557 insertions(+), 2 deletions(-)

diff --git a/drivers/bluetooth/Kconfig b/drivers/bluetooth/Kconfig
index b9fbe6e..62b89b9 100644
--- a/drivers/bluetooth/Kconfig
+++ b/drivers/bluetooth/Kconfig
@@ -55,6 +55,17 @@ config BT_HCIUART_BCSP
 
  Say Y here to compile support for HCI BCSP protocol.
 
+config BT_HCIUART_LL
+   bool "HCILL protocol support"
+   depends on BT_HCIUART
+   help
+ HCILL (HCI Low Level) is a serial protocol for communication
+ between Bluetooth device and host. This protocol is required for
+ serial Bluetooth devices that are based on Texas Instruments'
+ BRF chips.
+
+ Say Y here to compile support for HCILL protocol.
+
 config BT_HCIBCM203X
tristate "HCI BCM203x USB driver"
depends on USB
diff --git a/drivers/bluetooth/Makefile b/drivers/bluetooth/Makefile
index 08c10e1..a543dfc 100644
--- a/drivers/bluetooth/Makefile
+++ b/drivers/bluetooth/Makefile
@@ -16,4 +16,5 @@ obj-$(CONFIG_BT_HCIBTUART)+= btuart_cs.o
 hci_uart-y := hci_ldisc.o
 hci_uart-$(CONFIG_BT_HCIUART_H4)   += hci_h4.o
 hci_uart-$(CONFIG_BT_HCIUART_BCSP) += hci_bcsp.o
+hci_uart-$(CONFIG_BT_HCIUART_LL)   += hci_ll.o
 hci_uart-objs  := $(hci_uart-y)
diff --git a/drivers/bluetooth/hci_ldisc.c b/drivers/bluetooth/hci_ldisc.c
index 6055b9c..e68821d 100644
--- a/drivers/bluetooth/hci_ldisc.c
+++ b/drivers/bluetooth/hci_ldisc.c
@@ -549,7 +549,10 @@ static int __init hci_uart_init(void)
 #ifdef CONFIG_BT_HCIUART_BCSP
bcsp_init();
 #endif
-   
+#ifdef CONFIG_BT_HCIUART_LL
+   ll_init();
+#endif
+
return 0;
 }
 
@@ -563,6 +566,9 @@ static void __exit hci_uart_exit(void)
 #ifdef CONFIG_BT_HCIUART_BCSP
bcsp_deinit();
 #endif
+#ifdef CONFIG_BT_HCIUART_LL
+   ll_deinit();
+#endif
 
/* Release tty registration of line discipline */
if ((err = tty_unregister_ldisc(N_HCI)))
diff --git a/drivers/bluetooth/hci_ll.c b/drivers/bluetooth/hci_ll.c
new file mode 100644
index 000..8c3e62a
--- /dev/null
+++ b/drivers/bluetooth/hci_ll.c
@@ -0,0 +1,531 @@
+/*
+ *  Texas Instruments' Bluetooth HCILL UART protocol
+ *
+ *  HCILL (HCI Low Level) is a Texas Instruments' power management
+ *  protocol extension to H4.
+ *
+ *  Copyright (C) 2007 Texas Instruments, Inc.
+ *
+ *  Written by Ohad Ben-Cohen <[EMAIL PROTECTED]>
+ *
+ *  Acknowledgements:
+ *  This file is based on hci_h4.c, which was written
+ *  by Maxim Krasnyansky and Marcel Holtmann.
+ *
+ *  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
+ *
+ *  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
+ *
+ */
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include "hci_uart.h"
+
+/* HCILL commands */
+#define HCILL_GO_TO_SLEEP_IND  0x30
+#define HCILL_GO_TO_SLEEP_ACK  0x31
+#define HCILL_WAKE_UP_IND  0x32
+#define HCILL_WAKE_UP_ACK  0x33
+
+/* HCILL receiver States */
+#define HCILL_W4_PACKET_TYPE   0
+#define HCILL_W4_EVENT_HDR 1
+#define HCILL_W4_ACL_HDR   2
+#define HCILL_W4_SCO_HDR   3
+#define HCILL_W4_DATA  4
+
+/* HCILL states */
+enum hcill_states_e {
+   HCILL_ASLEEP,
+   HCILL_ASLEEP_TO_AWAKE,
+   

[Bluetooth] Eliminate checks for impossible conditions in IRQ handler

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ac019360fe311dd6aa11b358a02eb3a61675882e
Commit: ac019360fe311dd6aa11b358a02eb3a61675882e
Parent: 166d2f6a4332aad53cb0750a296f76c06102552d
Author: Jeff Garzik <[EMAIL PROTECTED]>
AuthorDate: Sat Oct 20 13:45:57 2007 +0200
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 02:59:44 2007 -0700

[Bluetooth] Eliminate checks for impossible conditions in IRQ handler

Our info structure and info->hdev is always passed to the IRQ handler,
so we don't have to worry about these checks in every interrupt.

Leave a BUG_ON() just to help unwary programmers, but these could
probably be removed as well.

Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
Signed-off-by: Marcel Holtmann <[EMAIL PROTECTED]>
---
 drivers/bluetooth/bluecard_cs.c |5 +
 drivers/bluetooth/bt3c_cs.c |5 +
 drivers/bluetooth/btuart_cs.c   |5 +
 drivers/bluetooth/dtl1_cs.c |5 +
 4 files changed, 4 insertions(+), 16 deletions(-)

diff --git a/drivers/bluetooth/bluecard_cs.c b/drivers/bluetooth/bluecard_cs.c
index 851de4d..bcf5792 100644
--- a/drivers/bluetooth/bluecard_cs.c
+++ b/drivers/bluetooth/bluecard_cs.c
@@ -503,10 +503,7 @@ static irqreturn_t bluecard_interrupt(int irq, void 
*dev_inst)
unsigned int iobase;
unsigned char reg;
 
-   if (!info || !info->hdev) {
-   BT_ERR("Call of irq %d for unknown device", irq);
-   return IRQ_NONE;
-   }
+   BUG_ON(!info->hdev);
 
if (!test_bit(CARD_READY, &(info->hw_state)))
return IRQ_HANDLED;
diff --git a/drivers/bluetooth/bt3c_cs.c b/drivers/bluetooth/bt3c_cs.c
index 3951607..a18f9b8 100644
--- a/drivers/bluetooth/bt3c_cs.c
+++ b/drivers/bluetooth/bt3c_cs.c
@@ -344,10 +344,7 @@ static irqreturn_t bt3c_interrupt(int irq, void *dev_inst)
unsigned int iobase;
int iir;
 
-   if (!info || !info->hdev) {
-   BT_ERR("Call of irq %d for unknown device", irq);
-   return IRQ_NONE;
-   }
+   BUG_ON(!info->hdev);
 
iobase = info->p_dev->io.BasePort1;
 
diff --git a/drivers/bluetooth/btuart_cs.c b/drivers/bluetooth/btuart_cs.c
index d7d2ea0..08f48d5 100644
--- a/drivers/bluetooth/btuart_cs.c
+++ b/drivers/bluetooth/btuart_cs.c
@@ -294,10 +294,7 @@ static irqreturn_t btuart_interrupt(int irq, void 
*dev_inst)
int boguscount = 0;
int iir, lsr;
 
-   if (!info || !info->hdev) {
-   BT_ERR("Call of irq %d for unknown device", irq);
-   return IRQ_NONE;
-   }
+   BUG_ON(!info->hdev);
 
iobase = info->p_dev->io.BasePort1;
 
diff --git a/drivers/bluetooth/dtl1_cs.c b/drivers/bluetooth/dtl1_cs.c
index 7f9c54b..dae45cd 100644
--- a/drivers/bluetooth/dtl1_cs.c
+++ b/drivers/bluetooth/dtl1_cs.c
@@ -298,10 +298,7 @@ static irqreturn_t dtl1_interrupt(int irq, void *dev_inst)
int boguscount = 0;
int iir, lsr;
 
-   if (!info || !info->hdev) {
-   BT_ERR("Call of irq %d for unknown device", irq);
-   return IRQ_NONE;
-   }
+   BUG_ON(!info->hdev);
 
iobase = info->p_dev->io.BasePort1;
 
-
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


[Bluetooth] Add generic driver for Bluetooth SDIO devices

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ddbaf13e3609442b64abb931ac21527772d87980
Commit: ddbaf13e3609442b64abb931ac21527772d87980
Parent: ac019360fe311dd6aa11b358a02eb3a61675882e
Author: Marcel Holtmann <[EMAIL PROTECTED]>
AuthorDate: Sat Oct 20 14:02:04 2007 +0200
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 02:59:45 2007 -0700

[Bluetooth] Add generic driver for Bluetooth SDIO devices

This patch adds a generic driver for Bluetooth SDIO devices. It
supports Type-A and Type-B devices.

Signed-off-by: David Vrabel <[EMAIL PROTECTED]>
Signed-off-by: Marcel Holtmann <[EMAIL PROTECTED]>
---
 drivers/bluetooth/Kconfig  |   11 ++
 drivers/bluetooth/Makefile |2 +
 drivers/bluetooth/btsdio.c |  406 
 3 files changed, 419 insertions(+), 0 deletions(-)

diff --git a/drivers/bluetooth/Kconfig b/drivers/bluetooth/Kconfig
index 62b89b9..77bded4 100644
--- a/drivers/bluetooth/Kconfig
+++ b/drivers/bluetooth/Kconfig
@@ -22,6 +22,17 @@ config BT_HCIUSB_SCO
 
  Say Y here to compile support for SCO over HCI USB.
 
+config BT_HCIBTSDIO
+   tristate "HCI SDIO driver"
+   depends on MMC
+   help
+ Bluetooth HCI SDIO driver.
+ This driver is required if you want to use Bluetooth device with
+ SDIO interface.
+
+ Say Y here to compile support for Bluetooth SDIO devices into the
+ kernel or say M to compile it as module (btsdio).
+
 config BT_HCIUART
tristate "HCI UART driver"
help
diff --git a/drivers/bluetooth/Makefile b/drivers/bluetooth/Makefile
index a543dfc..aee1279 100644
--- a/drivers/bluetooth/Makefile
+++ b/drivers/bluetooth/Makefile
@@ -13,6 +13,8 @@ obj-$(CONFIG_BT_HCIBT3C)  += bt3c_cs.o
 obj-$(CONFIG_BT_HCIBLUECARD)   += bluecard_cs.o
 obj-$(CONFIG_BT_HCIBTUART) += btuart_cs.o
 
+obj-$(CONFIG_BT_HCIBTSDIO) += btsdio.o
+
 hci_uart-y := hci_ldisc.o
 hci_uart-$(CONFIG_BT_HCIUART_H4)   += hci_h4.o
 hci_uart-$(CONFIG_BT_HCIUART_BCSP) += hci_bcsp.o
diff --git a/drivers/bluetooth/btsdio.c b/drivers/bluetooth/btsdio.c
new file mode 100644
index 000..b786f61
--- /dev/null
+++ b/drivers/bluetooth/btsdio.c
@@ -0,0 +1,406 @@
+/*
+ *
+ *  Generic Bluetooth SDIO driver
+ *
+ *  Copyright (C) 2007  Cambridge Silicon Radio Ltd.
+ *  Copyright (C) 2007  Marcel Holtmann <[EMAIL PROTECTED]>
+ *
+ *
+ *  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
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+
+#ifndef CONFIG_BT_HCIBTSDIO_DEBUG
+#undef  BT_DBG
+#define BT_DBG(D...)
+#endif
+
+#define VERSION "0.1"
+
+static const struct sdio_device_id btsdio_table[] = {
+   /* Generic Bluetooth Type-A SDIO device */
+   { SDIO_DEVICE_CLASS(SDIO_CLASS_BT_A) },
+
+   /* Generic Bluetooth Type-B SDIO device */
+   { SDIO_DEVICE_CLASS(SDIO_CLASS_BT_B) },
+
+   { } /* Terminating entry */
+};
+
+MODULE_DEVICE_TABLE(sdio, btsdio_table);
+
+struct btsdio_data {
+   struct hci_dev   *hdev;
+   struct sdio_func *func;
+
+   struct work_struct work;
+
+   struct sk_buff_head txq;
+};
+
+#define REG_RDAT 0x00  /* Receiver Data */
+#define REG_TDAT 0x00  /* Transmitter Data */
+#define REG_PC_RRT   0x10  /* Read Packet Control */
+#define REG_PC_WRT   0x11  /* Write Packet Control */
+#define REG_RTC_STAT 0x12  /* Retry Control Status */
+#define REG_RTC_SET  0x12  /* Retry Control Set */
+#define REG_INTRD0x13  /* Interrupt Indication */
+#define REG_CL_INTRD 0x13  /* Interrupt Clear */
+#define REG_EN_INTRD 0x14  /* Interrupt Enable */
+#define REG_MD_STAT  0x20  /* Bluetooth Mode Status */
+
+static int btsdio_tx_packet(struct btsdio_data *data, struct sk_buff *skb)
+{
+   int err;
+
+   BT_DBG("%s", data->hdev->name);
+
+   /* Prepend Type-A header */
+   skb_push(skb, 4);
+   skb->data[0] = (skb->len & 0xff);
+   skb->data[1] = (skb->len & 0x00ff00) >> 8;
+   skb->data[2] = (skb->len & 0xff) >> 16;
+   skb->data[3] = bt_cb(skb)->pkt_type;
+
+   err = sdio_write

[Bluetooth] Add generic driver for Bluetooth USB devices

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5e23b923da03de7e41f00f5664ae22c4f7dcd2a3
Commit: 5e23b923da03de7e41f00f5664ae22c4f7dcd2a3
Parent: ddbaf13e3609442b64abb931ac21527772d87980
Author: Marcel Holtmann <[EMAIL PROTECTED]>
AuthorDate: Sat Oct 20 14:12:34 2007 +0200
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 02:59:46 2007 -0700

[Bluetooth] Add generic driver for Bluetooth USB devices

This patch adds a new generic driver for Bluetooth USB devices. This
driver is still experimental at this point, but it is cleaner and
easier to maintain than the current Bluetooth USB driver. It is a
much better starting point for power management improvements.

Signed-off-by: Marcel Holtmann <[EMAIL PROTECTED]>
---
 drivers/bluetooth/Kconfig  |   13 +
 drivers/bluetooth/Makefile |1 +
 drivers/bluetooth/btusb.c  |  564 
 3 files changed, 578 insertions(+), 0 deletions(-)

diff --git a/drivers/bluetooth/Kconfig b/drivers/bluetooth/Kconfig
index 77bded4..075598e 100644
--- a/drivers/bluetooth/Kconfig
+++ b/drivers/bluetooth/Kconfig
@@ -22,6 +22,19 @@ config BT_HCIUSB_SCO
 
  Say Y here to compile support for SCO over HCI USB.
 
+config BT_HCIBTUSB
+   tristate "HCI USB driver (alternate version)"
+   depends on USB && EXPERIMENTAL && BT_HCIUSB=n
+   help
+ Bluetooth HCI USB driver.
+ This driver is required if you want to use Bluetooth devices with
+ USB interface.
+
+  This driver is still experimental and has no SCO support.
+
+ Say Y here to compile support for Bluetooth USB devices into the
+ kernel or say M to compile it as module (btusb).
+
 config BT_HCIBTSDIO
tristate "HCI SDIO driver"
depends on MMC
diff --git a/drivers/bluetooth/Makefile b/drivers/bluetooth/Makefile
index aee1279..77444af 100644
--- a/drivers/bluetooth/Makefile
+++ b/drivers/bluetooth/Makefile
@@ -13,6 +13,7 @@ obj-$(CONFIG_BT_HCIBT3C)  += bt3c_cs.o
 obj-$(CONFIG_BT_HCIBLUECARD)   += bluecard_cs.o
 obj-$(CONFIG_BT_HCIBTUART) += btuart_cs.o
 
+obj-$(CONFIG_BT_HCIBTUSB)  += btusb.o
 obj-$(CONFIG_BT_HCIBTSDIO) += btsdio.o
 
 hci_uart-y := hci_ldisc.o
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
new file mode 100644
index 000..12e1089
--- /dev/null
+++ b/drivers/bluetooth/btusb.c
@@ -0,0 +1,564 @@
+/*
+ *
+ *  Generic Bluetooth USB driver
+ *
+ *  Copyright (C) 2005-2007  Marcel Holtmann <[EMAIL PROTECTED]>
+ *
+ *
+ *  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
+ *
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+
+//#define CONFIG_BT_HCIBTUSB_DEBUG
+#ifndef CONFIG_BT_HCIBTUSB_DEBUG
+#undef  BT_DBG
+#define BT_DBG(D...)
+#endif
+
+#define VERSION "0.1"
+
+static struct usb_device_id btusb_table[] = {
+   /* Generic Bluetooth USB device */
+   { USB_DEVICE_INFO(0xe0, 0x01, 0x01) },
+
+   { } /* Terminating entry */
+};
+
+MODULE_DEVICE_TABLE(usb, btusb_table);
+
+static struct usb_device_id blacklist_table[] = {
+   { } /* Terminating entry */
+};
+
+#define BTUSB_INTR_RUNNING 0
+#define BTUSB_BULK_RUNNING 1
+
+struct btusb_data {
+   struct hci_dev   *hdev;
+   struct usb_device*udev;
+
+   spinlock_t lock;
+
+   unsigned long flags;
+
+   struct work_struct work;
+
+   struct usb_anchor tx_anchor;
+   struct usb_anchor intr_anchor;
+   struct usb_anchor bulk_anchor;
+
+   struct usb_endpoint_descriptor *intr_ep;
+   struct usb_endpoint_descriptor *bulk_tx_ep;
+   struct usb_endpoint_descriptor *bulk_rx_ep;
+};
+
+static void btusb_intr_complete(struct urb *urb)
+{
+   struct hci_dev *hdev = urb->context;
+   struct btusb_data *data = hdev->driver_data;
+   int err;
+
+   BT_DBG("%s urb %p status %d count %d", hdev->name,
+   urb, urb->status, urb->actual_length);
+
+   if (!test_bit(HCI_RUNNING, &hdev->flags))
+   return;
+
+   if (urb->status == 0) {
+   if (hci_recv_fragment(hdev, HCI_EVENT_PKT,
+  

[Bluetooth] Fix wrong argument in debug code of HIDP

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6792b5ec8d9e723e4689fd5b16cfa52603985f43
Commit: 6792b5ec8d9e723e4689fd5b16cfa52603985f43
Parent: 5e23b923da03de7e41f00f5664ae22c4f7dcd2a3
Author: Dave Young <[EMAIL PROTECTED]>
AuthorDate: Sat Oct 20 14:15:39 2007 +0200
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 02:59:46 2007 -0700

[Bluetooth] Fix wrong argument in debug code of HIDP

In the debug code of the hidp_queue_report function, the device
variable does not exist, replace it with session->hid.

Signed-off-by: Dave Young <[EMAIL PROTECTED]>
Signed-off-by: Marcel Holtmann <[EMAIL PROTECTED]>
---
 net/bluetooth/hidp/core.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
index 66c7369..4bbacdd 100644
--- a/net/bluetooth/hidp/core.c
+++ b/net/bluetooth/hidp/core.c
@@ -247,7 +247,7 @@ static inline int hidp_queue_report(struct hidp_session 
*session, unsigned char
 {
struct sk_buff *skb;
 
-   BT_DBG("session %p hid %p data %p size %d", session, device, data, 
size);
+   BT_DBG("session %p hid %p data %p size %d", session, session->hid, 
data, size);
 
if (!(skb = alloc_skb(size + 1, GFP_ATOMIC))) {
BT_ERR("Can't allocate memory for new frame");
-
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


[Bluetooth] Add address and channel attribute to RFCOMM TTY device

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=dae6a0f6636d05bcb28ece1f3630b23ed2d66e18
Commit: dae6a0f6636d05bcb28ece1f3630b23ed2d66e18
Parent: 6792b5ec8d9e723e4689fd5b16cfa52603985f43
Author: Marcel Holtmann <[EMAIL PROTECTED]>
AuthorDate: Sat Oct 20 14:52:38 2007 +0200
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 02:59:47 2007 -0700

[Bluetooth] Add address and channel attribute to RFCOMM TTY device

Export the remote device address and channel of RFCOMM TTY device
via sysfs attributes. This allows udev to create better naming rules
for configured RFCOMM devices.

Signed-off-by: Marcel Holtmann <[EMAIL PROTECTED]>
---
 net/bluetooth/rfcomm/tty.c |   25 +
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c
index 22a8320..e447651 100644
--- a/net/bluetooth/rfcomm/tty.c
+++ b/net/bluetooth/rfcomm/tty.c
@@ -189,6 +189,23 @@ static struct device *rfcomm_get_device(struct rfcomm_dev 
*dev)
return conn ? &conn->dev : NULL;
 }
 
+static ssize_t show_address(struct device *tty_dev, struct device_attribute 
*attr, char *buf)
+{
+   struct rfcomm_dev *dev = dev_get_drvdata(tty_dev);
+   bdaddr_t bdaddr;
+   baswap(&bdaddr, &dev->dst);
+   return sprintf(buf, "%s\n", batostr(&bdaddr));
+}
+
+static ssize_t show_channel(struct device *tty_dev, struct device_attribute 
*attr, char *buf)
+{
+   struct rfcomm_dev *dev = dev_get_drvdata(tty_dev);
+   return sprintf(buf, "%d\n", dev->channel);
+}
+
+static DEVICE_ATTR(address, S_IRUGO, show_address, NULL);
+static DEVICE_ATTR(channel, S_IRUGO, show_channel, NULL);
+
 static int rfcomm_dev_add(struct rfcomm_dev_req *req, struct rfcomm_dlc *dlc)
 {
struct rfcomm_dev *dev;
@@ -281,6 +298,14 @@ out:
return err;
}
 
+   dev_set_drvdata(dev->tty_dev, dev);
+
+   if (device_create_file(dev->tty_dev, &dev_attr_address) < 0)
+   BT_ERR("Failed to create address attribute");
+
+   if (device_create_file(dev->tty_dev, &dev_attr_channel) < 0)
+   BT_ERR("Failed to create channel attribute");
+
return dev->id;
 }
 
-
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


[Bluetooth] Add support for handling simple eSCO links

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b6a0dc822497e1c0b9e8c4add270cc27fce48454
Commit: b6a0dc822497e1c0b9e8c4add270cc27fce48454
Parent: dae6a0f6636d05bcb28ece1f3630b23ed2d66e18
Author: Marcel Holtmann <[EMAIL PROTECTED]>
AuthorDate: Sat Oct 20 14:55:10 2007 +0200
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 02:59:47 2007 -0700

[Bluetooth] Add support for handling simple eSCO links

With the Bluetooth 1.2 specification the Extended SCO feature for
better audio connections was introduced. So far the Bluetooth core
wasn't able to handle any eSCO connections correctly. This patch
adds simple eSCO support while keeping backward compatibility with
older devices.

Signed-off-by: Marcel Holtmann <[EMAIL PROTECTED]>
---
 include/net/bluetooth/hci_core.h |1 +
 net/bluetooth/hci_conn.c |   39 +--
 net/bluetooth/hci_core.c |   22 
 net/bluetooth/hci_event.c|   99 +-
 net/bluetooth/sco.c  |   12 +++--
 5 files changed, 151 insertions(+), 22 deletions(-)

diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 0db89ed..ea13baa 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -313,6 +313,7 @@ static inline struct hci_conn 
*hci_conn_hash_lookup_state(struct hci_dev *hdev,
 void hci_acl_connect(struct hci_conn *conn);
 void hci_acl_disconn(struct hci_conn *conn, __u8 reason);
 void hci_add_sco(struct hci_conn *conn, __u16 handle);
+void hci_setup_sync(struct hci_conn *conn, __u16 handle);
 
 struct hci_conn *hci_conn_add(struct hci_dev *hdev, int type, bdaddr_t *dst);
 int hci_conn_del(struct hci_conn *conn);
diff --git a/net/bluetooth/hci_conn.c b/net/bluetooth/hci_conn.c
index 797a30b..9483320 100644
--- a/net/bluetooth/hci_conn.c
+++ b/net/bluetooth/hci_conn.c
@@ -78,9 +78,9 @@ void hci_acl_connect(struct hci_conn *conn)
 
cp.pkt_type = cpu_to_le16(hdev->pkt_type & ACL_PTYPE_MASK);
if (lmp_rswitch_capable(hdev) && !(hdev->link_mode & HCI_LM_MASTER))
-   cp.role_switch  = 0x01;
+   cp.role_switch = 0x01;
else
-   cp.role_switch  = 0x00;
+   cp.role_switch = 0x00;
 
hci_send_cmd(hdev, HCI_OP_CREATE_CONN, sizeof(cp), &cp);
 }
@@ -127,6 +127,28 @@ void hci_add_sco(struct hci_conn *conn, __u16 handle)
hci_send_cmd(hdev, HCI_OP_ADD_SCO, sizeof(cp), &cp);
 }
 
+void hci_setup_sync(struct hci_conn *conn, __u16 handle)
+{
+   struct hci_dev *hdev = conn->hdev;
+   struct hci_cp_setup_sync_conn cp;
+
+   BT_DBG("%p", conn);
+
+   conn->state = BT_CONNECT;
+   conn->out = 1;
+
+   cp.handle   = cpu_to_le16(handle);
+   cp.pkt_type = cpu_to_le16(hdev->esco_type);
+
+   cp.tx_bandwidth   = cpu_to_le32(0x1f40);
+   cp.rx_bandwidth   = cpu_to_le32(0x1f40);
+   cp.max_latency= cpu_to_le16(0x);
+   cp.voice_setting  = cpu_to_le16(hdev->voice_setting);
+   cp.retrans_effort = 0xff;
+
+   hci_send_cmd(hdev, HCI_OP_SETUP_SYNC_CONN, sizeof(cp), &cp);
+}
+
 static void hci_conn_timeout(unsigned long arg)
 {
struct hci_conn *conn = (void *) arg;
@@ -141,7 +163,10 @@ static void hci_conn_timeout(unsigned long arg)
 
switch (conn->state) {
case BT_CONNECT:
-   hci_acl_connect_cancel(conn);
+   if (conn->type == ACL_LINK)
+   hci_acl_connect_cancel(conn);
+   else
+   hci_acl_disconn(conn, 0x13);
break;
case BT_CONNECTED:
hci_acl_disconn(conn, 0x13);
@@ -328,8 +353,12 @@ struct hci_conn *hci_connect(struct hci_dev *hdev, int 
type, bdaddr_t *dst)
hci_conn_hold(sco);
 
if (acl->state == BT_CONNECTED &&
-   (sco->state == BT_OPEN || sco->state == BT_CLOSED))
-   hci_add_sco(sco, acl->handle);
+   (sco->state == BT_OPEN || sco->state == BT_CLOSED)) {
+   if (lmp_esco_capable(hdev))
+   hci_setup_sync(sco, acl->handle);
+   else
+   hci_add_sco(sco, acl->handle);
+   }
 
return sco;
 }
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 2894382..372b0d3 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1361,6 +1361,26 @@ static inline void hci_sched_sco(struct hci_dev *hdev)
}
 }
 
+static inline void hci_sched_esco(struct hci_dev *hdev)
+{
+   struct hci_conn *conn;
+   struct sk_buff *skb;
+   int quote;
+
+   BT_DBG("%s", hdev->name);
+
+   while (hdev->sco_cnt && (conn = hci_low_sent(hdev, ESCO_LINK, "e))) 
{
+   while (quote-- && (skb = skb_dequeue(&conn->data_q))) {
+   BT_DBG("skb %p len %d", skb, skb->len);
+  

[Bluetooth] Add constant for Bluetooth socket options level

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2cb3377a295aade1f2e192d4bea948b2196fb162
Commit: 2cb3377a295aade1f2e192d4bea948b2196fb162
Parent: b6a0dc822497e1c0b9e8c4add270cc27fce48454
Author: Marcel Holtmann <[EMAIL PROTECTED]>
AuthorDate: Sat Oct 20 15:28:08 2007 +0200
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 02:59:48 2007 -0700

[Bluetooth] Add constant for Bluetooth socket options level

Assign the next free socket options level to be used by the Bluetooth
protocol and address family.

Signed-off-by: Marcel Holtmann <[EMAIL PROTECTED]>
---
 include/linux/socket.h |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/include/linux/socket.h b/include/linux/socket.h
index f852e1a..c22ef1c 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -291,6 +291,7 @@ struct ucred {
 #define SOL_TIPC   271
 #define SOL_RXRPC  272
 #define SOL_PPPOL2TP   273
+#define SOL_BLUETOOTH  274
 
 /* IPX options */
 #define IPX_TYPE   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


[Bluetooth] Convert RFCOMM to use kthread API

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a524eccc7307b1d6e79f03fed79f9f34c016ce56
Commit: a524eccc7307b1d6e79f03fed79f9f34c016ce56
Parent: 2cb3377a295aade1f2e192d4bea948b2196fb162
Author: Marcel Holtmann <[EMAIL PROTECTED]>
AuthorDate: Sat Oct 20 21:37:20 2007 +0200
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 02:59:49 2007 -0700

[Bluetooth] Convert RFCOMM to use kthread API

This patch does the full kthread conversion for the RFCOMM protocol. It
makes the code slightly simpler and more maintainable.

Based on a patch from Christoph Hellwig <[EMAIL PROTECTED]>

Signed-off-by: Marcel Holtmann <[EMAIL PROTECTED]>
---
 net/bluetooth/rfcomm/core.c |   60 +++
 1 files changed, 21 insertions(+), 39 deletions(-)

diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c
index bb72207..e7ac6ba 100644
--- a/net/bluetooth/rfcomm/core.c
+++ b/net/bluetooth/rfcomm/core.c
@@ -33,11 +33,11 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -68,7 +68,6 @@ static DEFINE_MUTEX(rfcomm_mutex);
 static unsigned long rfcomm_event;
 
 static LIST_HEAD(session_list);
-static atomic_t terminate, running;
 
 static int rfcomm_send_frame(struct rfcomm_session *s, u8 *data, int len);
 static int rfcomm_send_sabm(struct rfcomm_session *s, u8 dlci);
@@ -1850,26 +1849,6 @@ static inline void rfcomm_process_sessions(void)
rfcomm_unlock();
 }
 
-static void rfcomm_worker(void)
-{
-   BT_DBG("");
-
-   while (!atomic_read(&terminate)) {
-   set_current_state(TASK_INTERRUPTIBLE);
-   if (!test_bit(RFCOMM_SCHED_WAKEUP, &rfcomm_event)) {
-   /* No pending events. Let's sleep.
-* Incoming connections and data will wake us up. */
-   schedule();
-   }
-   set_current_state(TASK_RUNNING);
-
-   /* Process stuff */
-   clear_bit(RFCOMM_SCHED_WAKEUP, &rfcomm_event);
-   rfcomm_process_sessions();
-   }
-   return;
-}
-
 static int rfcomm_add_listener(bdaddr_t *ba)
 {
struct sockaddr_l2 addr;
@@ -1935,22 +1914,28 @@ static void rfcomm_kill_listener(void)
 
 static int rfcomm_run(void *unused)
 {
-   rfcomm_thread = current;
-
-   atomic_inc(&running);
+   BT_DBG("");
 
-   daemonize("krfcommd");
set_user_nice(current, -10);
 
-   BT_DBG("");
-
rfcomm_add_listener(BDADDR_ANY);
 
-   rfcomm_worker();
+   while (!kthread_should_stop()) {
+   set_current_state(TASK_INTERRUPTIBLE);
+   if (!test_bit(RFCOMM_SCHED_WAKEUP, &rfcomm_event)) {
+   /* No pending events. Let's sleep.
+* Incoming connections and data will wake us up. */
+   schedule();
+   }
+   set_current_state(TASK_RUNNING);
+
+   /* Process stuff */
+   clear_bit(RFCOMM_SCHED_WAKEUP, &rfcomm_event);
+   rfcomm_process_sessions();
+   }
 
rfcomm_kill_listener();
 
-   atomic_dec(&running);
return 0;
 }
 
@@ -2059,7 +2044,11 @@ static int __init rfcomm_init(void)
 
hci_register_cb(&rfcomm_cb);
 
-   kernel_thread(rfcomm_run, NULL, CLONE_KERNEL);
+   rfcomm_thread = kthread_run(rfcomm_run, NULL, "krfcommd");
+   if (IS_ERR(rfcomm_thread)) {
+   hci_unregister_cb(&rfcomm_cb);
+   return PTR_ERR(rfcomm_thread);
+   }
 
if (class_create_file(bt_class, &class_attr_rfcomm_dlc) < 0)
BT_ERR("Failed to create RFCOMM info file");
@@ -2081,14 +2070,7 @@ static void __exit rfcomm_exit(void)
 
hci_unregister_cb(&rfcomm_cb);
 
-   /* Terminate working thread.
-* ie. Set terminate flag and wake it up */
-   atomic_inc(&terminate);
-   rfcomm_schedule(RFCOMM_SCHED_STATE);
-
-   /* Wait until thread is running */
-   while (atomic_read(&running))
-   schedule();
+   kthread_stop(rfcomm_thread);
 
 #ifdef CONFIG_BT_RFCOMM_TTY
rfcomm_cleanup_ttys();
-
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


[TG3]: Add 5723 support

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6c7af27c8a2e8b85cb235a2409d3b2093b18f77d
Commit: 6c7af27c8a2e8b85cb235a2409d3b2093b18f77d
Parent: a524eccc7307b1d6e79f03fed79f9f34c016ce56
Author: Matt Carlson <[EMAIL PROTECTED]>
AuthorDate: Sun Oct 21 16:12:02 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 02:59:49 2007 -0700

[TG3]: Add 5723 support

This patch adds support for upcoming 5723 devices.

Signed-off-by: Matt Carlson <[EMAIL PROTECTED]>
Signed-off-by: Michael Chan <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 drivers/net/tg3.c   |1 +
 include/linux/pci_ids.h |1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 014dc2c..253d761 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -200,6 +200,7 @@ static struct pci_device_id tg3_pci_tbl[] = {
{PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5906M)},
{PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5784)},
{PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5764)},
+   {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5723)},
{PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5761)},
{PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5761E)},
{PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_9DXX)},
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index df948b4..4e10a07 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -1943,6 +1943,7 @@
 #define PCI_DEVICE_ID_TIGON3_5720  0x1658
 #define PCI_DEVICE_ID_TIGON3_5721  0x1659
 #define PCI_DEVICE_ID_TIGON3_5722  0x165a
+#define PCI_DEVICE_ID_TIGON3_5723  0x165b
 #define PCI_DEVICE_ID_TIGON3_5705M 0x165d
 #define PCI_DEVICE_ID_TIGON3_5705M_2   0x165e
 #define PCI_DEVICE_ID_TIGON3_5714  0x1668
-
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


[TG3]: Add management FW version to ethtool report

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9c8a620e7f85fff050a54697da44bbd1a66e8e0b
Commit: 9c8a620e7f85fff050a54697da44bbd1a66e8e0b
Parent: 6c7af27c8a2e8b85cb235a2409d3b2093b18f77d
Author: Matt Carlson <[EMAIL PROTECTED]>
AuthorDate: Sun Oct 21 16:16:08 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 02:59:50 2007 -0700

[TG3]: Add management FW version to ethtool report

This patch appends the management firmware version to the bootcode
firmware string reported through ethtool.

Signed-off-by: Matt Carlson <[EMAIL PROTECTED]>
Signed-off-by: Michael Chan <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 drivers/net/tg3.c |   83 
 drivers/net/tg3.h |9 +-
 2 files changed, 78 insertions(+), 14 deletions(-)

diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 253d761..98f4658 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -10821,9 +10821,24 @@ out_not_found:
strcpy(tp->board_part_number, "none");
 }
 
+static int __devinit tg3_fw_img_is_valid(struct tg3 *tp, u32 offset)
+{
+   u32 val;
+
+   if (tg3_nvram_read_swab(tp, offset, &val) ||
+   (val & 0xfc00) != 0x0c00 ||
+   tg3_nvram_read_swab(tp, offset + 4, &val) ||
+   val != 0)
+   return 0;
+
+   return 1;
+}
+
 static void __devinit tg3_read_fw_ver(struct tg3 *tp)
 {
u32 val, offset, start;
+   u32 ver_offset;
+   int i, bcnt;
 
if (tg3_nvram_read_swab(tp, 0, &val))
return;
@@ -10836,29 +10851,71 @@ static void __devinit tg3_read_fw_ver(struct tg3 *tp)
return;
 
offset = tg3_nvram_logical_addr(tp, offset);
-   if (tg3_nvram_read_swab(tp, offset, &val))
+
+   if (!tg3_fw_img_is_valid(tp, offset) ||
+   tg3_nvram_read_swab(tp, offset + 8, &ver_offset))
return;
 
-   if ((val & 0xfc00) == 0x0c00) {
-   u32 ver_offset, addr;
-   int i;
+   offset = offset + ver_offset - start;
+   for (i = 0; i < 16; i += 4) {
+   if (tg3_nvram_read(tp, offset + i, &val))
+   return;
+
+   val = le32_to_cpu(val);
+   memcpy(tp->fw_ver + i, &val, 4);
+   }
 
-   if (tg3_nvram_read_swab(tp, offset + 4, &val) ||
-   tg3_nvram_read_swab(tp, offset + 8, &ver_offset))
+   if (!(tp->tg3_flags & TG3_FLAG_ENABLE_ASF) ||
+(tp->tg3_flags & TG3_FLG3_ENABLE_APE))
+   return;
+
+   for (offset = TG3_NVM_DIR_START;
+offset < TG3_NVM_DIR_END;
+offset += TG3_NVM_DIRENT_SIZE) {
+   if (tg3_nvram_read_swab(tp, offset, &val))
return;
 
-   if (val != 0)
+   if ((val >> TG3_NVM_DIRTYPE_SHIFT) == TG3_NVM_DIRTYPE_ASFINI)
+   break;
+   }
+
+   if (offset == TG3_NVM_DIR_END)
+   return;
+
+   if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS))
+   start = 0x0800;
+   else if (tg3_nvram_read_swab(tp, offset - 4, &start))
+   return;
+
+   if (tg3_nvram_read_swab(tp, offset + 4, &offset) ||
+   !tg3_fw_img_is_valid(tp, offset) ||
+   tg3_nvram_read_swab(tp, offset + 8, &val))
+   return;
+
+   offset += val - start;
+
+   bcnt = strlen(tp->fw_ver);
+
+   tp->fw_ver[bcnt++] = ',';
+   tp->fw_ver[bcnt++] = ' ';
+
+   for (i = 0; i < 4; i++) {
+   if (tg3_nvram_read(tp, offset, &val))
return;
 
-   addr = offset + ver_offset - start;
-   for (i = 0; i < 16; i += 4) {
-   if (tg3_nvram_read(tp, addr + i, &val))
-   return;
+   val = le32_to_cpu(val);
+   offset += sizeof(val);
 
-   val = cpu_to_le32(val);
-   memcpy(tp->fw_ver + i, &val, 4);
+   if (bcnt > TG3_VER_SIZE - sizeof(val)) {
+   memcpy(&tp->fw_ver[bcnt], &val, TG3_VER_SIZE - bcnt);
+   break;
}
+
+   memcpy(&tp->fw_ver[bcnt], &val, sizeof(val));
+   bcnt += sizeof(val);
}
+
+   tp->fw_ver[TG3_VER_SIZE - 1] = 0;
 }
 
 static struct pci_dev * __devinit tg3_find_peer(struct tg3 *);
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index 6dbdad2..495a1df 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -1540,6 +1540,12 @@
 #define TG3_EEPROM_MAGIC_HW0xabcd
 #define TG3_EEPROM_MAGIC_HW_MSK0x
 
+#define TG3_NVM_DIR_START  0x18
+#define TG3_NVM_DIR_END0x78
+#define TG3_NVM_DIRENT_SIZE0xc
+#define TG3_NVM_DIRTYPE_SHIFT  24
+#define T

[TG3]: PCI command adjustment

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8a6eac90e21633e054e17d21454a2c26824aeb18
Commit: 8a6eac90e21633e054e17d21454a2c26824aeb18
Parent: 9c8a620e7f85fff050a54697da44bbd1a66e8e0b
Author: Matt Carlson <[EMAIL PROTECTED]>
AuthorDate: Sun Oct 21 16:17:55 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 02:59:51 2007 -0700

[TG3]: PCI command adjustment

This patch changes the way the driver works with the PCI command
register.  It adjusts the access size from dwords to words.  This patch
is done both as a PCI configuration space cleanup and as preparatory
work for PCI error recovery.

Signed-off-by: Matt Carlson <[EMAIL PROTECTED]>
Signed-off-by: Michael Chan <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 drivers/net/tg3.c |7 ++-
 drivers/net/tg3.h |2 +-
 2 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 98f4658..328eb4a 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -5029,10 +5029,7 @@ static int tg3_poll_fw(struct tg3 *tp)
 /* Save PCI command register before chip reset */
 static void tg3_save_pci_state(struct tg3 *tp)
 {
-   u32 val;
-
-   pci_read_config_dword(tp->pdev, TG3PCI_COMMAND, &val);
-   tp->pci_cmd = val;
+   pci_read_config_word(tp->pdev, PCI_COMMAND, &tp->pci_cmd);
 }
 
 /* Restore PCI state after chip reset */
@@ -5055,7 +5052,7 @@ static void tg3_restore_pci_state(struct tg3 *tp)
   PCISTATE_ALLOW_APE_SHMEM_WR;
pci_write_config_dword(tp->pdev, TG3PCI_PCISTATE, val);
 
-   pci_write_config_dword(tp->pdev, TG3PCI_COMMAND, tp->pci_cmd);
+   pci_write_config_word(tp->pdev, PCI_COMMAND, tp->pci_cmd);
 
if (!(tp->tg3_flags2 & TG3_FLG2_PCI_EXPRESS)) {
pci_write_config_byte(tp->pdev, PCI_CACHE_LINE_SIZE,
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index 495a1df..1d5b2a3 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -2421,7 +2421,7 @@ struct tg3 {
 #define PHY_REV_BCM5411_X0 0x1 /* Found on Netgear GA302T */
 
u32 led_ctrl;
-   u32 pci_cmd;
+   u16 pci_cmd;
 
charboard_part_number[24];
 #define TG3_VER_SIZE 32
-
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


[TG3]: Update version to 3.85

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=33b0c4fe6d0dd19fc7c9b801855f55c5260f2858
Commit: 33b0c4fe6d0dd19fc7c9b801855f55c5260f2858
Parent: 8a6eac90e21633e054e17d21454a2c26824aeb18
Author: Matt Carlson <[EMAIL PROTECTED]>
AuthorDate: Sun Oct 21 16:22:38 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 02:59:51 2007 -0700

[TG3]: Update version to 3.85

This patch updates the version number to 3.85.

Signed-off-by: Matt Carlson <[EMAIL PROTECTED]>
Signed-off-by: Michael Chan <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 drivers/net/tg3.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 328eb4a..09440d7 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -64,8 +64,8 @@
 
 #define DRV_MODULE_NAME"tg3"
 #define PFX DRV_MODULE_NAME": "
-#define DRV_MODULE_VERSION "3.84"
-#define DRV_MODULE_RELDATE "October 12, 2007"
+#define DRV_MODULE_VERSION "3.85"
+#define DRV_MODULE_RELDATE "October 18, 2007"
 
 #define TG3_DEF_MAC_MODE   0
 #define TG3_DEF_RX_MODE0
-
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


[ATM]: Fix clip module reload crash.

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bfb85c9f753a7172bd962e8717118191dfd612cc
Commit: bfb85c9f753a7172bd962e8717118191dfd612cc
Parent: 33b0c4fe6d0dd19fc7c9b801855f55c5260f2858
Author: Randy Dunlap <[EMAIL PROTECTED]>
AuthorDate: Sun Oct 21 16:24:27 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 02:59:52 2007 -0700

[ATM]: Fix clip module reload crash.

net/atm/clip.c crashes the kernel if it (module) is loaded, removed,
and then loaded again.  Its exit call to neigh_table_clear()
should destroy the cache after freeing it.

Signed-off-by: Randy Dunlap <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/core/neighbour.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 67ba991..05979e3 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -1438,6 +1438,9 @@ int neigh_table_clear(struct neigh_table *tbl)
free_percpu(tbl->stats);
tbl->stats = NULL;
 
+   kmem_cache_destroy(tbl->kmem_cachep);
+   tbl->kmem_cachep = NULL;
+
return 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


[NET]: Fix SKB_WITH_OVERHEAD calculation

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=deea84b0ae3d26b41502ae0a39fe7fe134e703d0
Commit: deea84b0ae3d26b41502ae0a39fe7fe134e703d0
Parent: bfb85c9f753a7172bd962e8717118191dfd612cc
Author: Herbert Xu <[EMAIL PROTECTED]>
AuthorDate: Sun Oct 21 16:27:46 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 02:59:53 2007 -0700

[NET]: Fix SKB_WITH_OVERHEAD calculation

The calculation in SKB_WITH_OVERHEAD is incorrect in that it can cause
an overflow across a page boundary which is what it's meant to prevent.
In particular, the header length (X) should not be lumped together with
skb_shared_info.  The latter needs to be aligned properly while the header
has no choice but to sit in front of wherever the payload is.

Therefore the correct calculation is to take away the aligned size of
skb_shared_info, and then subtract the header length.  The resulting
quantity L satisfies the following inequality:

SKB_DATA_ALIGN(L + X) + sizeof(struct skb_shared_info) <= PAGE_SIZE

This is the quantity used by alloc_skb to do the actual allocation.

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

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index f93f22b..369f60a 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -41,8 +41,7 @@
 #define SKB_DATA_ALIGN(X)  (((X) + (SMP_CACHE_BYTES - 1)) & \
 ~(SMP_CACHE_BYTES - 1))
 #define SKB_WITH_OVERHEAD(X)   \
-   (((X) - sizeof(struct skb_shared_info)) & \
-~(SMP_CACHE_BYTES - 1))
+   ((X) - SKB_DATA_ALIGN(sizeof(struct skb_shared_info)))
 #define SKB_MAX_ORDER(X, ORDER) \
SKB_WITH_OVERHEAD((PAGE_SIZE << (ORDER)) - (X))
 #define SKB_MAX_HEAD(X)(SKB_MAX_ORDER((X), 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


[NIU]: Cleanup PAGE_SIZE checks a bit

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=81429973cfff7745792c877dd083eec29724ec97
Commit: 81429973cfff7745792c877dd083eec29724ec97
Parent: deea84b0ae3d26b41502ae0a39fe7fe134e703d0
Author: Olof Johansson <[EMAIL PROTECTED]>
AuthorDate: Sun Oct 21 16:32:58 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 02:59:53 2007 -0700

[NIU]: Cleanup PAGE_SIZE checks a bit

I get the following warning from a powerpc allyesconfig of current
mainline:

drivers/net/niu.c: In function 'niu_size_rbr':
drivers/net/niu.c:3113: warning: large integer implicitly truncated to 
unsigned type

PAGE_SIZE in this case is 64KB, so I don't quite get why gcc can't
tell that the line in question will never be reached.

I suggest the following instead, but I can unfortunately not do
anything but build test it.

Also, the driver does some other checks to make sure that PAGE_SIZE is
a power of two (BUILD_BUG_ON() in niu_init()), doesn't seem like that
could ever be untrue? Or are there really archs with non-power-of-two
PAGE_SIZE?

Signed-off-by: Olof Johansson <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 drivers/net/niu.c |   34 +-
 1 files changed, 5 insertions(+), 29 deletions(-)

diff --git a/drivers/net/niu.c b/drivers/net/niu.c
index ed1f9bb..112ab07 100644
--- a/drivers/net/niu.c
+++ b/drivers/net/niu.c
@@ -3103,31 +3103,12 @@ static int niu_alloc_tx_ring_info(struct niu *np,
 
 static void niu_size_rbr(struct niu *np, struct rx_ring_info *rp)
 {
-   u16 bs;
+   u16 bss;
 
-   switch (PAGE_SIZE) {
-   case 4 * 1024:
-   case 8 * 1024:
-   case 16 * 1024:
-   case 32 * 1024:
-   rp->rbr_block_size = PAGE_SIZE;
-   rp->rbr_blocks_per_page = 1;
-   break;
+   bss = min(PAGE_SHIFT, 15);
 
-   default:
-   if (PAGE_SIZE % (32 * 1024) == 0)
-   bs = 32 * 1024;
-   else if (PAGE_SIZE % (16 * 1024) == 0)
-   bs = 16 * 1024;
-   else if (PAGE_SIZE % (8 * 1024) == 0)
-   bs = 8 * 1024;
-   else if (PAGE_SIZE % (4 * 1024) == 0)
-   bs = 4 * 1024;
-   else
-   BUG();
-   rp->rbr_block_size = bs;
-   rp->rbr_blocks_per_page = PAGE_SIZE / bs;
-   }
+   rp->rbr_block_size = 1 << bss;
+   rp->rbr_blocks_per_page = 1 << (PAGE_SHIFT-bss);
 
rp->rbr_sizes[0] = 256;
rp->rbr_sizes[1] = 1024;
@@ -7902,12 +7883,7 @@ static int __init niu_init(void)
 {
int err = 0;
 
-   BUILD_BUG_ON((PAGE_SIZE < 4 * 1024) ||
-((PAGE_SIZE > 32 * 1024) &&
- ((PAGE_SIZE % (32 * 1024)) != 0 &&
-  (PAGE_SIZE % (16 * 1024)) != 0 &&
-  (PAGE_SIZE % (8 * 1024)) != 0 &&
-  (PAGE_SIZE % (4 * 1024)) != 0)));
+   BUILD_BUG_ON(PAGE_SIZE < 4 * 1024);
 
niu_debug = netif_msg_init(debug, NIU_MSG_DEFAULT);
 
-
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


[INET]: Let inet_diag and friends autoload

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=305e1e96911417d8cda2699f6a20a6f434616a8c
Commit: 305e1e96911417d8cda2699f6a20a6f434616a8c
Parent: 81429973cfff7745792c877dd083eec29724ec97
Author: Jean Delvare <[EMAIL PROTECTED]>
AuthorDate: Sun Oct 21 16:44:04 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 02:59:54 2007 -0700

[INET]: Let inet_diag and friends autoload

By adding module aliases to inet_diag, tcp_diag and dccp_diag, we let
them load automatically as needed. This makes tools like "ss" run
faster.

Signed-off-by: Jean Delvare <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 include/linux/net.h  |4 
 net/dccp/diag.c  |1 +
 net/ipv4/inet_diag.c |7 +++
 net/ipv4/tcp_diag.c  |1 +
 4 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/include/linux/net.h b/include/linux/net.h
index c136abc..dd79cdb 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -313,6 +313,10 @@ static const struct proto_ops name##_ops = {   
\
 #define MODULE_ALIAS_NET_PF_PROTO(pf, proto) \
MODULE_ALIAS("net-pf-" __stringify(pf) "-proto-" __stringify(proto))
 
+#define MODULE_ALIAS_NET_PF_PROTO_TYPE(pf, proto, type) \
+   MODULE_ALIAS("net-pf-" __stringify(pf) "-proto-" __stringify(proto) \
+"-type-" __stringify(type))
+
 #ifdef CONFIG_SYSCTL
 #include 
 extern ctl_table net_table[];
diff --git a/net/dccp/diag.c b/net/dccp/diag.c
index 0f37455..d8a3509 100644
--- a/net/dccp/diag.c
+++ b/net/dccp/diag.c
@@ -68,3 +68,4 @@ module_exit(dccp_diag_fini);
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Arnaldo Carvalho de Melo <[EMAIL PROTECTED]>");
 MODULE_DESCRIPTION("DCCP inet_diag handler");
+MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_NETLINK, NETLINK_INET_DIAG, 
DCCPDIAG_GETSOCK);
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c
index 7eb83eb..dc429b6 100644
--- a/net/ipv4/inet_diag.c
+++ b/net/ipv4/inet_diag.c
@@ -815,6 +815,12 @@ static int inet_diag_rcv_msg(struct sk_buff *skb, struct 
nlmsghdr *nlh)
nlmsg_len(nlh) < hdrlen)
return -EINVAL;
 
+#ifdef CONFIG_KMOD
+   if (inet_diag_table[nlh->nlmsg_type] == NULL)
+   request_module("net-pf-%d-proto-%d-type-%d", PF_NETLINK,
+  NETLINK_INET_DIAG, nlh->nlmsg_type);
+#endif
+
if (inet_diag_table[nlh->nlmsg_type] == NULL)
return -ENOENT;
 
@@ -914,3 +920,4 @@ static void __exit inet_diag_exit(void)
 module_init(inet_diag_init);
 module_exit(inet_diag_exit);
 MODULE_LICENSE("GPL");
+MODULE_ALIAS_NET_PF_PROTO(PF_NETLINK, NETLINK_INET_DIAG);
diff --git a/net/ipv4/tcp_diag.c b/net/ipv4/tcp_diag.c
index 3904d21..2fbcc7d 100644
--- a/net/ipv4/tcp_diag.c
+++ b/net/ipv4/tcp_diag.c
@@ -56,3 +56,4 @@ static void __exit tcp_diag_exit(void)
 module_init(tcp_diag_init);
 module_exit(tcp_diag_exit);
 MODULE_LICENSE("GPL");
+MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_NETLINK, NETLINK_INET_DIAG, TCPDIAG_GETSOCK);
-
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


[INET]: Use MODULE_ALIAS_NET_PF_PROTO_TYPE where possible.

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7131c6c73656b92aea806c6e688e97aa49ff911e
Commit: 7131c6c73656b92aea806c6e688e97aa49ff911e
Parent: 305e1e96911417d8cda2699f6a20a6f434616a8c
Author: Jean Delvare <[EMAIL PROTECTED]>
AuthorDate: Sun Oct 21 16:45:03 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 02:59:54 2007 -0700

[INET]: Use MODULE_ALIAS_NET_PF_PROTO_TYPE where possible.

Now that we have this new macro, use it where possible.

Signed-off-by: Jean Delvare <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/dccp/ipv4.c |4 ++--
 net/dccp/ipv6.c |4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c
index 44f6e17..222549a 100644
--- a/net/dccp/ipv4.c
+++ b/net/dccp/ipv4.c
@@ -1037,8 +1037,8 @@ module_exit(dccp_v4_exit);
  * values directly, Also cover the case where the protocol is not specified,
  * i.e. net-pf-PF_INET-proto-0-type-SOCK_DCCP
  */
-MODULE_ALIAS("net-pf-" __stringify(PF_INET) "-proto-33-type-6");
-MODULE_ALIAS("net-pf-" __stringify(PF_INET) "-proto-0-type-6");
+MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET, 33, 6);
+MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET, 0, 6);
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Arnaldo Carvalho de Melo <[EMAIL PROTECTED]>");
 MODULE_DESCRIPTION("DCCP - Datagram Congestion Controlled Protocol");
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c
index cac5354..bbadd66 100644
--- a/net/dccp/ipv6.c
+++ b/net/dccp/ipv6.c
@@ -1219,8 +1219,8 @@ module_exit(dccp_v6_exit);
  * values directly, Also cover the case where the protocol is not specified,
  * i.e. net-pf-PF_INET6-proto-0-type-SOCK_DCCP
  */
-MODULE_ALIAS("net-pf-" __stringify(PF_INET6) "-proto-33-type-6");
-MODULE_ALIAS("net-pf-" __stringify(PF_INET6) "-proto-0-type-6");
+MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET6, 33, 6);
+MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET6, 0, 6);
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Arnaldo Carvalho de Melo <[EMAIL PROTECTED]>");
 MODULE_DESCRIPTION("DCCPv6 - Datagram Congestion Controlled Protocol");
-
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


[NET]: Use the skb_set_queue_mapping where appropriate

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=dfa4091129019959f4608756f76dc687495287ad
Commit: dfa4091129019959f4608756f76dc687495287ad
Parent: 7131c6c73656b92aea806c6e688e97aa49ff911e
Author: Pavel Emelyanov <[EMAIL PROTECTED]>
AuthorDate: Sun Oct 21 16:57:55 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 02:59:55 2007 -0700

[NET]: Use the skb_set_queue_mapping where appropriate

There's already such a helper to initialize this field.  Use it.

Signed-off-by: Pavel Emelyanov <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/core/dev.c|2 +-
 net/core/pktgen.c |6 ++
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 38b03da..1672cc1 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1661,7 +1661,7 @@ gso:
q = dev->qdisc;
if (q->enqueue) {
/* reset queue_mapping to zero */
-   skb->queue_mapping = 0;
+   skb_set_queue_mapping(skb, 0);
rc = q->enqueue(skb, q);
qdisc_run(dev);
spin_unlock(&dev->queue_lock);
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index c4719ed..b78235e 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -2603,8 +2603,7 @@ static struct sk_buff *fill_packet_ipv4(struct net_device 
*odev,
skb->network_header = skb->tail;
skb->transport_header = skb->network_header + sizeof(struct iphdr);
skb_put(skb, sizeof(struct iphdr) + sizeof(struct udphdr));
-   skb->queue_mapping = pkt_dev->cur_queue_map;
-
+   skb_set_queue_mapping(skb, pkt_dev->cur_queue_map);
iph = ip_hdr(skb);
udph = udp_hdr(skb);
 
@@ -2941,8 +2940,7 @@ static struct sk_buff *fill_packet_ipv6(struct net_device 
*odev,
skb->network_header = skb->tail;
skb->transport_header = skb->network_header + sizeof(struct ipv6hdr);
skb_put(skb, sizeof(struct ipv6hdr) + sizeof(struct udphdr));
-   skb->queue_mapping = pkt_dev->cur_queue_map;
-
+   skb_set_queue_mapping(skb, pkt_dev->cur_queue_map);
iph = ipv6_hdr(skb);
udph = udp_hdr(skb);
 
-
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


[NET]: Make and use skb_get_queue_mapping

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4e3ab47a547616e583c7a5458beced6aa34c8ef3
Commit: 4e3ab47a547616e583c7a5458beced6aa34c8ef3
Parent: dfa4091129019959f4608756f76dc687495287ad
Author: Pavel Emelyanov <[EMAIL PROTECTED]>
AuthorDate: Sun Oct 21 17:01:29 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 02:59:56 2007 -0700

[NET]: Make and use skb_get_queue_mapping

Make the helper for getting the field, symmetrical to
the "set" one. Return 0 if CONFIG_NETDEVICES_MULTIQUEUE=n

Signed-off-by: Pavel Emelyanov <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 drivers/net/cpmac.c|2 +-
 include/linux/skbuff.h |9 +
 net/sched/sch_teql.c   |2 +-
 3 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/net/cpmac.c b/drivers/net/cpmac.c
index ed53aaa..ae41973 100644
--- a/drivers/net/cpmac.c
+++ b/drivers/net/cpmac.c
@@ -471,7 +471,7 @@ static int cpmac_start_xmit(struct sk_buff *skb, struct 
net_device *dev)
}
 
len = max(skb->len, ETH_ZLEN);
-   queue = skb->queue_mapping;
+   queue = skb_get_queue_mapping(skb);
 #ifdef CONFIG_NETDEVICES_MULTIQUEUE
netif_stop_subqueue(dev, queue);
 #else
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 369f60a..ecb0ede 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1769,6 +1769,15 @@ static inline void skb_set_queue_mapping(struct sk_buff 
*skb, u16 queue_mapping)
 #endif
 }
 
+static inline u16 skb_get_queue_mapping(struct sk_buff *skb)
+{
+#ifdef CONFIG_NETDEVICES_MULTIQUEUE
+   return skb->queue_mapping;
+#else
+   return 0;
+#endif
+}
+
 static inline void skb_copy_queue_mapping(struct sk_buff *to, const struct 
sk_buff *from)
 {
 #ifdef CONFIG_NETDEVICES_MULTIQUEUE
diff --git a/net/sched/sch_teql.c b/net/sched/sch_teql.c
index be57cf3..a9fad71 100644
--- a/net/sched/sch_teql.c
+++ b/net/sched/sch_teql.c
@@ -266,7 +266,7 @@ static int teql_master_xmit(struct sk_buff *skb, struct 
net_device *dev)
int busy;
int nores;
int len = skb->len;
-   int subq = skb->queue_mapping;
+   int subq = skb_get_queue_mapping(skb);
struct sk_buff *skb_res = NULL;
 
start = master->slaves;
-
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


[NET]: Hide the queue_mapping field inside netif_subqueue_stopped

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=668f895a85b0c3a62a690425145f13dabebebd7a
Commit: 668f895a85b0c3a62a690425145f13dabebebd7a
Parent: 4e3ab47a547616e583c7a5458beced6aa34c8ef3
Author: Pavel Emelyanov <[EMAIL PROTECTED]>
AuthorDate: Sun Oct 21 17:01:56 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 02:59:56 2007 -0700

[NET]: Hide the queue_mapping field inside netif_subqueue_stopped

Many places get the queue_mapping field from skb to pass it to the
netif_subqueue_stopped() which will be 0 in any case.

Make the helper that works with sk_buff

Signed-off-by: Pavel Emelyanov <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 include/linux/netdevice.h |7 ++-
 net/core/dev.c|4 ++--
 net/core/netpoll.c|4 ++--
 net/core/pktgen.c |6 +++---
 net/sched/sch_teql.c  |4 ++--
 5 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 6f85db3..4a3f54e 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -996,7 +996,7 @@ static inline void netif_stop_subqueue(struct net_device 
*dev, u16 queue_index)
  *
  * Check individual transmit queue of a device with multiple transmit queues.
  */
-static inline int netif_subqueue_stopped(const struct net_device *dev,
+static inline int __netif_subqueue_stopped(const struct net_device *dev,
 u16 queue_index)
 {
 #ifdef CONFIG_NETDEVICES_MULTIQUEUE
@@ -1007,6 +1007,11 @@ static inline int netif_subqueue_stopped(const struct 
net_device *dev,
 #endif
 }
 
+static inline int netif_subqueue_stopped(const struct net_device *dev,
+struct sk_buff *skb)
+{
+   return __netif_subqueue_stopped(dev, skb_get_queue_mapping(skb));
+}
 
 /**
  * netif_wake_subqueue - allow sending packets on subqueue
diff --git a/net/core/dev.c b/net/core/dev.c
index 1672cc1..8726589 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1553,7 +1553,7 @@ gso:
return rc;
}
if (unlikely((netif_queue_stopped(dev) ||
-netif_subqueue_stopped(dev, skb->queue_mapping)) &&
+netif_subqueue_stopped(dev, skb)) &&
 skb->next))
return NETDEV_TX_BUSY;
} while (skb->next);
@@ -1692,7 +1692,7 @@ gso:
HARD_TX_LOCK(dev, cpu);
 
if (!netif_queue_stopped(dev) &&
-   !netif_subqueue_stopped(dev, skb->queue_mapping)) {
+   !netif_subqueue_stopped(dev, skb)) {
rc = 0;
if (!dev_hard_start_xmit(skb, dev)) {
HARD_TX_UNLOCK(dev);
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index 95daba6..bf8d18f 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -67,7 +67,7 @@ static void queue_process(struct work_struct *work)
local_irq_save(flags);
netif_tx_lock(dev);
if ((netif_queue_stopped(dev) ||
-netif_subqueue_stopped(dev, skb->queue_mapping)) ||
+netif_subqueue_stopped(dev, skb)) ||
 dev->hard_start_xmit(skb, dev) != NETDEV_TX_OK) {
skb_queue_head(&npinfo->txq, skb);
netif_tx_unlock(dev);
@@ -269,7 +269,7 @@ static void netpoll_send_skb(struct netpoll *np, struct 
sk_buff *skb)
 tries > 0; --tries) {
if (netif_tx_trylock(dev)) {
if (!netif_queue_stopped(dev) &&
-   !netif_subqueue_stopped(dev, 
skb->queue_mapping))
+   !netif_subqueue_stopped(dev, skb))
status = dev->hard_start_xmit(skb, dev);
netif_tx_unlock(dev);
 
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index b78235e..de33f36 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -3383,7 +3383,7 @@ static __inline__ void pktgen_xmit(struct pktgen_dev 
*pkt_dev)
 
if ((netif_queue_stopped(odev) ||
 (pkt_dev->skb &&
- netif_subqueue_stopped(odev, pkt_dev->skb->queue_mapping))) ||
+ netif_subqueue_stopped(odev, pkt_dev->skb))) ||
need_resched()) {
idle_start = getCurUs();
 
@@ -3400,7 +3400,7 @@ static __inline__ void pktgen_xmit(struct pktgen_dev 
*pkt_dev)
pkt_dev->idle_acc += getCurUs() - idle_start;
 
if (netif_queue_stopped(odev) ||
-   netif_subqueue_stopped(odev, pkt_dev->skb->queue_mapping)) {
+   netif_subqueu

[NET]: Cut off the queue_mapping field from sk_buff

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e3fa259bcbbca25c8e8275c8dcedcf484854465b
Commit: e3fa259bcbbca25c8e8275c8dcedcf484854465b
Parent: 668f895a85b0c3a62a690425145f13dabebebd7a
Author: Pavel Emelyanov <[EMAIL PROTECTED]>
AuthorDate: Sun Oct 21 17:02:30 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 02:59:57 2007 -0700

[NET]: Cut off the queue_mapping field from sk_buff

Just hide it behind the #ifdef, because nobody wants
it now.

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

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index ecb0ede..fd4e12f 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -300,8 +300,9 @@ struct sk_buff {
 #endif
 
int iif;
+#ifdef CONFIG_NETDEVICES_MULTIQUEUE
__u16   queue_mapping;
-
+#endif
 #ifdef CONFIG_NET_SCHED
__u16   tc_index;   /* traffic control index */
 #ifdef CONFIG_NET_CLS_ACT
-
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


[IPSEC] IPV6: Fix to add tunnel mode SA correctly.

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ea2c47b42f12dadbad9d879fb6df102b9003ab82
Commit: ea2c47b42f12dadbad9d879fb6df102b9003ab82
Parent: e3fa259bcbbca25c8e8275c8dcedcf484854465b
Author: Masahide NAKAMURA <[EMAIL PROTECTED]>
AuthorDate: Mon Oct 22 02:30:15 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 02:59:58 2007 -0700

[IPSEC] IPV6: Fix to add tunnel mode SA correctly.

Signed-off-by: Masahide NAKAMURA <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/ipv6/ah6.c  |1 +
 net/ipv6/esp6.c |1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/net/ipv6/ah6.c b/net/ipv6/ah6.c
index 67cd066..66a9139 100644
--- a/net/ipv6/ah6.c
+++ b/net/ipv6/ah6.c
@@ -483,6 +483,7 @@ static int ah6_init_state(struct xfrm_state *x)
break;
case XFRM_MODE_TUNNEL:
x->props.header_len += sizeof(struct ipv6hdr);
+   break;
default:
goto error;
}
diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c
index b071543..72a6598 100644
--- a/net/ipv6/esp6.c
+++ b/net/ipv6/esp6.c
@@ -360,6 +360,7 @@ static int esp6_init_state(struct xfrm_state *x)
break;
case XFRM_MODE_TUNNEL:
x->props.header_len += sizeof(struct ipv6hdr);
+   break;
default:
goto error;
}
-
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


[SPARC64]: Update defconfig.

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3d0a721f04fe9321ca360fbab144ea10682d458a
Commit: 3d0a721f04fe9321ca360fbab144ea10682d458a
Parent: 55b70a0300b873c0ec7ea6e33752af56f41250ce
Author: David S. Miller <[EMAIL PROTECTED]>
AuthorDate: Sun Oct 21 19:58:24 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Sun Oct 21 19:58:24 2007 -0700

[SPARC64]: Update defconfig.

Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 arch/sparc64/defconfig |   91 +---
 1 files changed, 32 insertions(+), 59 deletions(-)

diff --git a/arch/sparc64/defconfig b/arch/sparc64/defconfig
index 1aa2c40..e023d4b 100644
--- a/arch/sparc64/defconfig
+++ b/arch/sparc64/defconfig
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
 # Linux kernel version: 2.6.23
-# Sat Oct 13 21:53:54 2007
+# Sun Oct 21 19:57:44 2007
 #
 CONFIG_SPARC=y
 CONFIG_SPARC64=y
@@ -49,6 +49,10 @@ CONFIG_POSIX_MQUEUE=y
 # CONFIG_AUDIT is not set
 # CONFIG_IKCONFIG is not set
 CONFIG_LOG_BUF_SHIFT=18
+# CONFIG_CGROUPS is not set
+CONFIG_FAIR_GROUP_SCHED=y
+CONFIG_FAIR_USER_SCHED=y
+# CONFIG_FAIR_CGROUP_SCHED is not set
 CONFIG_SYSFS_DEPRECATED=y
 CONFIG_RELAY=y
 # CONFIG_BLK_DEV_INITRD is not set
@@ -145,7 +149,10 @@ CONFIG_SELECT_MEMORY_MODEL=y
 CONFIG_SPARSEMEM_MANUAL=y
 CONFIG_SPARSEMEM=y
 CONFIG_HAVE_MEMORY_PRESENT=y
-CONFIG_SPARSEMEM_STATIC=y
+# CONFIG_SPARSEMEM_STATIC is not set
+CONFIG_SPARSEMEM_EXTREME=y
+CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y
+CONFIG_SPARSEMEM_VMEMMAP=y
 CONFIG_SPLIT_PTLOCK_CPUS=4
 CONFIG_RESOURCES_64BIT=y
 CONFIG_ZONE_DMA_FLAG=0
@@ -275,10 +282,6 @@ CONFIG_VLAN_8021Q=m
 # CONFIG_LAPB is not set
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
-
-#
-# QoS and/or fair queueing
-#
 # CONFIG_NET_SCHED is not set
 
 #
@@ -372,8 +375,6 @@ CONFIG_IDEPCI_PCIBUS_ORDER=y
 # CONFIG_BLK_DEV_GENERIC is not set
 # CONFIG_BLK_DEV_OPTI621 is not set
 CONFIG_BLK_DEV_IDEDMA_PCI=y
-# CONFIG_BLK_DEV_IDEDMA_FORCED is not set
-CONFIG_IDEDMA_ONLYDISK=y
 # CONFIG_BLK_DEV_AEC62XX is not set
 CONFIG_BLK_DEV_ALI15X3=y
 # CONFIG_WDC_ALI15X3 is not set
@@ -401,6 +402,7 @@ CONFIG_BLK_DEV_ALI15X3=y
 # CONFIG_BLK_DEV_TC86C001 is not set
 # CONFIG_IDE_ARM is not set
 CONFIG_BLK_DEV_IDEDMA=y
+CONFIG_IDE_ARCH_OBSOLETE_INIT=y
 # CONFIG_BLK_DEV_HD is not set
 
 #
@@ -441,6 +443,7 @@ CONFIG_SCSI_FC_ATTRS=y
 CONFIG_SCSI_ISCSI_ATTRS=m
 # CONFIG_SCSI_SAS_ATTRS is not set
 # CONFIG_SCSI_SAS_LIBSAS is not set
+# CONFIG_SCSI_SRP_ATTRS is not set
 CONFIG_SCSI_LOWLEVEL=y
 CONFIG_ISCSI_TCP=m
 # CONFIG_BLK_DEV_3W__RAID is not set
@@ -492,14 +495,8 @@ CONFIG_DM_MIRROR=m
 CONFIG_DM_ZERO=m
 # CONFIG_DM_MULTIPATH is not set
 # CONFIG_DM_DELAY is not set
-
-#
-# Fusion MPT device support
-#
+# CONFIG_DM_UEVENT is not set
 # CONFIG_FUSION is not set
-# CONFIG_FUSION_SPI is not set
-# CONFIG_FUSION_FC is not set
-# CONFIG_FUSION_SAS is not set
 
 #
 # IEEE 1394 (FireWire) support
@@ -638,7 +635,6 @@ CONFIG_INPUT_MOUSEDEV_PSAUX=y
 CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
 # CONFIG_INPUT_JOYDEV is not set
-# CONFIG_INPUT_TSDEV is not set
 CONFIG_INPUT_EVDEV=y
 # CONFIG_INPUT_EVBUG is not set
 
@@ -714,11 +710,9 @@ CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
 # CONFIG_LEGACY_PTYS is not set
 # CONFIG_IPMI_HANDLER is not set
-# CONFIG_WATCHDOG is not set
 # CONFIG_HW_RANDOM is not set
 # CONFIG_R3964 is not set
 # CONFIG_APPLICOM is not set
-# CONFIG_DRM is not set
 # CONFIG_RAW_DRIVER is not set
 # CONFIG_TCG_TPM is not set
 CONFIG_DEVPORT=y
@@ -786,8 +780,6 @@ CONFIG_I2C_ALGOBIT=y
 # CONFIG_POWER_SUPPLY is not set
 CONFIG_HWMON=y
 # CONFIG_HWMON_VID is not set
-# CONFIG_SENSORS_ABITUGURU is not set
-# CONFIG_SENSORS_ABITUGURU3 is not set
 # CONFIG_SENSORS_AD7418 is not set
 # CONFIG_SENSORS_ADM1021 is not set
 # CONFIG_SENSORS_ADM1025 is not set
@@ -795,12 +787,12 @@ CONFIG_HWMON=y
 # CONFIG_SENSORS_ADM1029 is not set
 # CONFIG_SENSORS_ADM1031 is not set
 # CONFIG_SENSORS_ADM9240 is not set
-# CONFIG_SENSORS_ASB100 is not set
+# CONFIG_SENSORS_ADT7470 is not set
 # CONFIG_SENSORS_ATXP1 is not set
 # CONFIG_SENSORS_DS1621 is not set
 # CONFIG_SENSORS_F71805F is not set
-# CONFIG_SENSORS_FSCHER is not set
-# CONFIG_SENSORS_FSCPOS is not set
+# CONFIG_SENSORS_F71882FG is not set
+# CONFIG_SENSORS_F75375S is not set
 # CONFIG_SENSORS_GL518SM is not set
 # CONFIG_SENSORS_GL520SM is not set
 # CONFIG_SENSORS_IT87 is not set
@@ -836,6 +828,7 @@ CONFIG_HWMON=y
 # CONFIG_SENSORS_W83627HF is not set
 # CONFIG_SENSORS_W83627EHF is not set
 # CONFIG_HWMON_DEBUG_CHIP is not set
+# CONFIG_WATCHDOG is not set
 
 #
 # Sonics Silicon Backplane
@@ -858,12 +851,7 @@ CONFIG_SSB_POSSIBLE=y
 #
 # Graphics support
 #
-# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
-
-#
-# Display device support
-#
-# CONFIG_DISPLAY_SUPPORT is not set
+# CONFIG_DRM is not set
 # CONFIG_VGASTATE is not set
 # CONFIG_VIDEO_OUTPUT_CON

[SPARC64]: Stop using __do_IRQ().

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8d57d3ad0c4641bc6b720160215c907a3d1004a0
Commit: 8d57d3ad0c4641bc6b720160215c907a3d1004a0
Parent: 3d0a721f04fe9321ca360fbab144ea10682d458a
Author: David S. Miller <[EMAIL PROTECTED]>
AuthorDate: Mon Oct 22 02:16:45 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 02:16:45 2007 -0700

[SPARC64]: Stop using __do_IRQ().

Invoke the desc->handle_irq directly in the top-level dispatch,
just like other sophisticated ports.

This will allow us to decrease the cost of the MSI queue dispatch.

Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 arch/sparc64/Kconfig  |4 ++
 arch/sparc64/kernel/irq.c |   85 ++--
 arch/sparc64/kernel/pci_msi.c |   14 +-
 3 files changed, 53 insertions(+), 50 deletions(-)

diff --git a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig
index c7a74e3..03c4e5c 100644
--- a/arch/sparc64/Kconfig
+++ b/arch/sparc64/Kconfig
@@ -72,6 +72,10 @@ config ARCH_NO_VIRT_TO_BUS
 config OF
def_bool y
 
+config GENERIC_HARDIRQS_NO__DO_IRQ
+   bool
+   def_bool y
+
 choice
prompt "Kernel page size"
default SPARC64_PAGE_SIZE_8KB
diff --git a/arch/sparc64/kernel/irq.c b/arch/sparc64/kernel/irq.c
index 2c3bea2..30431bd 100644
--- a/arch/sparc64/kernel/irq.c
+++ b/arch/sparc64/kernel/irq.c
@@ -257,8 +257,8 @@ struct irq_handler_data {
unsigned long   imap;
 
void(*pre_handler)(unsigned int, void *, void *);
-   void*pre_handler_arg1;
-   void*pre_handler_arg2;
+   void*arg1;
+   void*arg2;
 };
 
 #ifdef CONFIG_SMP
@@ -346,7 +346,7 @@ static void sun4u_irq_disable(unsigned int virt_irq)
}
 }
 
-static void sun4u_irq_end(unsigned int virt_irq)
+static void sun4u_irq_eoi(unsigned int virt_irq)
 {
struct irq_handler_data *data = get_irq_chip_data(virt_irq);
struct irq_desc *desc = irq_desc + virt_irq;
@@ -401,7 +401,7 @@ static void sun4v_irq_disable(unsigned int virt_irq)
   "err(%d)\n", ino, err);
 }
 
-static void sun4v_irq_end(unsigned int virt_irq)
+static void sun4v_irq_eoi(unsigned int virt_irq)
 {
unsigned int ino = virt_irq_table[virt_irq].dev_ino;
struct irq_desc *desc = irq_desc + virt_irq;
@@ -478,7 +478,7 @@ static void sun4v_virq_disable(unsigned int virt_irq)
   dev_handle, dev_ino, err);
 }
 
-static void sun4v_virq_end(unsigned int virt_irq)
+static void sun4v_virq_eoi(unsigned int virt_irq)
 {
struct irq_desc *desc = irq_desc + virt_irq;
unsigned long dev_handle, dev_ino;
@@ -498,33 +498,11 @@ static void sun4v_virq_end(unsigned int virt_irq)
   dev_handle, dev_ino, err);
 }
 
-static void run_pre_handler(unsigned int virt_irq)
-{
-   struct irq_handler_data *data = get_irq_chip_data(virt_irq);
-   unsigned int ino;
-
-   ino = virt_irq_table[virt_irq].dev_ino;
-   if (likely(data->pre_handler)) {
-   data->pre_handler(ino,
- data->pre_handler_arg1,
- data->pre_handler_arg2);
-   }
-}
-
 static struct irq_chip sun4u_irq = {
.typename   = "sun4u",
.enable = sun4u_irq_enable,
.disable= sun4u_irq_disable,
-   .end= sun4u_irq_end,
-   .set_affinity   = sun4u_set_affinity,
-};
-
-static struct irq_chip sun4u_irq_ack = {
-   .typename   = "sun4u+ack",
-   .enable = sun4u_irq_enable,
-   .disable= sun4u_irq_disable,
-   .ack= run_pre_handler,
-   .end= sun4u_irq_end,
+   .eoi= sun4u_irq_eoi,
.set_affinity   = sun4u_set_affinity,
 };
 
@@ -532,7 +510,7 @@ static struct irq_chip sun4v_irq = {
.typename   = "sun4v",
.enable = sun4v_irq_enable,
.disable= sun4v_irq_disable,
-   .end= sun4v_irq_end,
+   .eoi= sun4v_irq_eoi,
.set_affinity   = sun4v_set_affinity,
 };
 
@@ -540,31 +518,33 @@ static struct irq_chip sun4v_virq = {
.typename   = "vsun4v",
.enable = sun4v_virq_enable,
.disable= sun4v_virq_disable,
-   .end= sun4v_virq_end,
+   .eoi= sun4v_virq_eoi,
.set_affinity   = sun4v_virt_set_affinity,
 };
 
+static void fastcall pre_flow_handler(unsigned int virt_irq,
+ struct irq_desc *desc)
+{
+   struct irq_handler_data *data = get_irq_chip_data(virt_irq);
+   unsigned int ino = virt_irq_table[virt_irq].dev_ino;
+
+   data->pre_handler(ino, data->arg1, data->arg2);
+
+   handle_fasteoi_irq(virt_irq, desc);
+}
+
 void irq_install_pre_handler(int virt_irq,
 void (*f

[SPARC64]: small Makefile cleanups

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1d3e07f7d0f97321121849fc064fb293b83db9ef
Commit: 1d3e07f7d0f97321121849fc064fb293b83db9ef
Parent: 8d57d3ad0c4641bc6b720160215c907a3d1004a0
Author: Sam Ravnborg <[EMAIL PROTECTED]>
AuthorDate: Mon Oct 22 02:32:10 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 02:32:10 2007 -0700

[SPARC64]: small Makefile cleanups

A few trivial Makefile cleanups
- dependencipes in head.o was all wrong - deleted
- CMODEL_CFLAG was not used anywhere
- NEW_GCC was then not used outside sparc64/Makefe - do not export it
- FIXME seems not appropriate - all other put oprofile in drivers-y too
- No reason to do -I. (and it still builds)

Signed-off-by: Sam Ravnborg <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 arch/sparc64/Makefile  |4 
 arch/sparc64/kernel/Makefile   |9 -
 arch/sparc64/math-emu/Makefile |2 +-
 3 files changed, 1 insertions(+), 14 deletions(-)

diff --git a/arch/sparc64/Makefile b/arch/sparc64/Makefile
index 6c92a42..01159cb 100644
--- a/arch/sparc64/Makefile
+++ b/arch/sparc64/Makefile
@@ -18,8 +18,6 @@ NEW_GCC := $(call cc-option-yn, -m64 -mcmodel=medlow)
 NEW_GAS := $(shell if $(LD) -V 2>&1 | grep 'elf64_sparc' > /dev/null; then 
echo y; else echo n; fi)
 UNDECLARED_REGS := $(shell if $(CC) -c -x assembler /dev/null -Wa,--help | 
grep undeclared-regs > /dev/null; then echo y; else echo n; fi; )
 
-export NEW_GCC
-
 ifneq ($(NEW_GAS),y)
 AS = sparc64-linux-as
 LD = sparc64-linux-ld
@@ -58,8 +56,6 @@ core-y+= arch/sparc64/kernel/ 
arch/sparc64/mm/
 core-$(CONFIG_SOLARIS_EMUL)+= arch/sparc64/solaris/
 core-y += arch/sparc64/math-emu/
 libs-y += arch/sparc64/prom/ arch/sparc64/lib/
-
-# FIXME: is drivers- right?
 drivers-$(CONFIG_OPROFILE) += arch/sparc64/oprofile/
 
 boot := arch/sparc64/boot
diff --git a/arch/sparc64/kernel/Makefile b/arch/sparc64/kernel/Makefile
index 112c46e..ef50d21 100644
--- a/arch/sparc64/kernel/Makefile
+++ b/arch/sparc64/kernel/Makefile
@@ -39,12 +39,3 @@ else
 obj-y += sys_sunos32.o sunos_ioctl32.o
   endif
 endif
-
-ifneq ($(NEW_GCC),y)
-  CMODEL_CFLAG := -mmedlow
-else
-  CMODEL_CFLAG := -m64 -mcmodel=medlow
-endif
-
-head.o: head.S ttable.S itlb_miss.S dtlb_miss.S ktlb.S tsb.S \
-   etrap.S rtrap.S winfixup.S entry.S
diff --git a/arch/sparc64/math-emu/Makefile b/arch/sparc64/math-emu/Makefile
index a0b06fd..cc5cb9b 100644
--- a/arch/sparc64/math-emu/Makefile
+++ b/arch/sparc64/math-emu/Makefile
@@ -4,4 +4,4 @@
 
 obj-y:= math.o
 
-EXTRA_CFLAGS = -I. -Iinclude/math-emu -w
+EXTRA_CFLAGS = -Iinclude/math-emu -w
-
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


[SPARC64]: ARRAY_SIZE() cleanup

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=29f139ce27c7e64a3e8575afa8deb46cde09db0a
Commit: 29f139ce27c7e64a3e8575afa8deb46cde09db0a
Parent: 1d3e07f7d0f97321121849fc064fb293b83db9ef
Author: Alejandro Martinez Ruiz <[EMAIL PROTECTED]>
AuthorDate: Mon Oct 22 17:24:19 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 17:24:19 2007 -0700

[SPARC64]: ARRAY_SIZE() cleanup

Signed-off-by: Alejandro Martinez Ruiz <[EMAIL PROTECTED]>
Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 arch/sparc64/kernel/pci.c |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/arch/sparc64/kernel/pci.c b/arch/sparc64/kernel/pci.c
index 9b80864..63b3ebc 100644
--- a/arch/sparc64/kernel/pci.c
+++ b/arch/sparc64/kernel/pci.c
@@ -207,8 +207,7 @@ static struct {
{ "SUNW,sun4v-pci", sun4v_pci_init },
{ "pciex108e,80f0", fire_pci_init },
 };
-#define PCI_NUM_CONTROLLER_TYPES (sizeof(pci_controller_table) / \
- sizeof(pci_controller_table[0]))
+#define PCI_NUM_CONTROLLER_TYPES   ARRAY_SIZE(pci_controller_table)
 
 static int __init pci_controller_init(const char *model_name, int namelen, 
struct device_node *dp)
 {
-
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] Update default configuration.

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=32346f47dd46bed291464e194a6c47da6fdd1bc3
Commit: 32346f47dd46bed291464e194a6c47da6fdd1bc3
Parent: 55b70a0300b873c0ec7ea6e33752af56f41250ce
Author: Martin Schwidefsky <[EMAIL PROTECTED]>
AuthorDate: Mon Oct 22 12:52:38 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 12:52:46 2007 +0200

[S390] Update default configuration.

Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
---
 arch/s390/defconfig |  131 +--
 1 files changed, 85 insertions(+), 46 deletions(-)

diff --git a/arch/s390/defconfig b/arch/s390/defconfig
index 2aae23d..ece7b99 100644
--- a/arch/s390/defconfig
+++ b/arch/s390/defconfig
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.22
-# Tue Jul 17 12:50:23 2007
+# Linux kernel version: 2.6.23
+# Mon Oct 22 12:10:44 2007
 #
 CONFIG_MMU=y
 CONFIG_ZONE_DMA=y
@@ -19,15 +19,11 @@ CONFIG_S390=y
 CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
 
 #
-# Code maturity level options
+# General setup
 #
 CONFIG_EXPERIMENTAL=y
 CONFIG_LOCK_KERNEL=y
 CONFIG_INIT_ENV_ARG_LIMIT=32
-
-#
-# General setup
-#
 CONFIG_LOCALVERSION=""
 CONFIG_LOCALVERSION_AUTO=y
 CONFIG_SWAP=y
@@ -42,7 +38,14 @@ CONFIG_AUDIT=y
 CONFIG_IKCONFIG=y
 CONFIG_IKCONFIG_PROC=y
 CONFIG_LOG_BUF_SHIFT=17
+CONFIG_CGROUPS=y
+# CONFIG_CGROUP_DEBUG is not set
+CONFIG_CGROUP_NS=y
+CONFIG_CGROUP_CPUACCT=y
 # CONFIG_CPUSETS is not set
+CONFIG_FAIR_GROUP_SCHED=y
+CONFIG_FAIR_USER_SCHED=y
+# CONFIG_FAIR_CGROUP_SCHED is not set
 CONFIG_SYSFS_DEPRECATED=y
 # CONFIG_RELAY is not set
 CONFIG_BLK_DEV_INITRD=y
@@ -63,7 +66,6 @@ CONFIG_FUTEX=y
 CONFIG_ANON_INODES=y
 CONFIG_EPOLL=y
 CONFIG_SIGNALFD=y
-CONFIG_TIMERFD=y
 CONFIG_EVENTFD=y
 CONFIG_SHMEM=y
 CONFIG_VM_EVENT_COUNTERS=y
@@ -83,6 +85,7 @@ CONFIG_STOP_MACHINE=y
 CONFIG_BLOCK=y
 # CONFIG_BLK_DEV_IO_TRACE is not set
 CONFIG_BLK_DEV_BSG=y
+CONFIG_BLOCK_COMPAT=y
 
 #
 # IO Schedulers
@@ -108,7 +111,6 @@ CONFIG_64BIT=y
 CONFIG_SMP=y
 CONFIG_NR_CPUS=32
 CONFIG_HOTPLUG_CPU=y
-CONFIG_DEFAULT_MIGRATION_COST=100
 CONFIG_COMPAT=y
 CONFIG_SYSVIPC_COMPAT=y
 CONFIG_AUDIT_ARCH=y
@@ -143,9 +145,11 @@ CONFIG_FLATMEM_MANUAL=y
 CONFIG_FLATMEM=y
 CONFIG_FLAT_NODE_MEM_MAP=y
 # CONFIG_SPARSEMEM_STATIC is not set
+# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
 CONFIG_SPLIT_PTLOCK_CPUS=4
 CONFIG_RESOURCES_64BIT=y
 CONFIG_ZONE_DMA_FLAG=1
+CONFIG_BOUNCE=y
 CONFIG_VIRT_TO_BUS=y
 CONFIG_HOLES_IN_ZONE=y
 
@@ -219,12 +223,14 @@ CONFIG_INET_TUNNEL=y
 CONFIG_INET_XFRM_MODE_TRANSPORT=y
 CONFIG_INET_XFRM_MODE_TUNNEL=y
 CONFIG_INET_XFRM_MODE_BEET=y
+CONFIG_INET_LRO=y
 CONFIG_INET_DIAG=y
 CONFIG_INET_TCP_DIAG=y
 # CONFIG_TCP_CONG_ADVANCED is not set
 CONFIG_TCP_CONG_CUBIC=y
 CONFIG_DEFAULT_TCP_CONG="cubic"
 # CONFIG_TCP_MD5SIG is not set
+# CONFIG_IP_VS is not set
 CONFIG_IPV6=y
 # CONFIG_IPV6_PRIVACY is not set
 # CONFIG_IPV6_ROUTER_PREF is not set
@@ -243,7 +249,48 @@ CONFIG_IPV6_SIT=y
 # CONFIG_IPV6_TUNNEL is not set
 # CONFIG_IPV6_MULTIPLE_TABLES is not set
 # CONFIG_NETWORK_SECMARK is not set
-# CONFIG_NETFILTER is not set
+CONFIG_NETFILTER=y
+# CONFIG_NETFILTER_DEBUG is not set
+
+#
+# Core Netfilter Configuration
+#
+CONFIG_NETFILTER_NETLINK=m
+CONFIG_NETFILTER_NETLINK_QUEUE=m
+CONFIG_NETFILTER_NETLINK_LOG=m
+CONFIG_NF_CONNTRACK_ENABLED=m
+CONFIG_NF_CONNTRACK=m
+# CONFIG_NF_CT_ACCT is not set
+# CONFIG_NF_CONNTRACK_MARK is not set
+# CONFIG_NF_CONNTRACK_EVENTS is not set
+# CONFIG_NF_CT_PROTO_SCTP is not set
+# CONFIG_NF_CT_PROTO_UDPLITE is not set
+# CONFIG_NF_CONNTRACK_AMANDA is not set
+# CONFIG_NF_CONNTRACK_FTP is not set
+# CONFIG_NF_CONNTRACK_H323 is not set
+# CONFIG_NF_CONNTRACK_IRC is not set
+# CONFIG_NF_CONNTRACK_NETBIOS_NS is not set
+# CONFIG_NF_CONNTRACK_PPTP is not set
+# CONFIG_NF_CONNTRACK_SANE is not set
+# CONFIG_NF_CONNTRACK_SIP is not set
+# CONFIG_NF_CONNTRACK_TFTP is not set
+# CONFIG_NF_CT_NETLINK is not set
+# CONFIG_NETFILTER_XTABLES is not set
+
+#
+# IP: Netfilter Configuration
+#
+# CONFIG_NF_CONNTRACK_IPV4 is not set
+# CONFIG_IP_NF_QUEUE is not set
+# CONFIG_IP_NF_IPTABLES is not set
+# CONFIG_IP_NF_ARPTABLES is not set
+
+#
+# IPv6: Netfilter Configuration (EXPERIMENTAL)
+#
+# CONFIG_NF_CONNTRACK_IPV6 is not set
+# CONFIG_IP6_NF_QUEUE is not set
+# CONFIG_IP6_NF_IPTABLES is not set
 # CONFIG_IP_DCCP is not set
 CONFIG_IP_SCTP=m
 # CONFIG_SCTP_DBG_MSG is not set
@@ -263,12 +310,7 @@ CONFIG_SCTP_HMAC_MD5=y
 # CONFIG_LAPB is not set
 # CONFIG_ECONET is not set
 # CONFIG_WAN_ROUTER is not set
-
-#
-# QoS and/or fair queueing
-#
 CONFIG_NET_SCHED=y
-CONFIG_NET_SCH_FIFO=y
 
 #
 # Queueing/Scheduling
@@ -306,10 +348,12 @@ CONFIG_NET_CLS_ACT=y
 CONFIG_NET_ACT_POLICE=y
 # CONFIG_NET_ACT_GACT is not set
 # CONFIG_NET_ACT_MIRRED is not set
+CONFIG_NET_ACT_NAT=m
 # CONFIG_NET_ACT_PEDIT is not set
 # CONFIG_NET_ACT_SIMP is not set
 CONFIG_NET_CLS_P

[S390] Add per-cpu idle time / idle count sysfs attributes.

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=fae8b22d3e3e3a3d317a7746493997af02a3f35c
Commit: fae8b22d3e3e3a3d317a7746493997af02a3f35c
Parent: 32346f47dd46bed291464e194a6c47da6fdd1bc3
Author: Heiko Carstens <[EMAIL PROTECTED]>
AuthorDate: Mon Oct 22 12:52:39 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 12:52:47 2007 +0200

[S390] Add per-cpu idle time / idle count sysfs attributes.

Add two new sysfs entries per cpu: idle_count and idle_time.
idle_count contains the number of times a cpu went into idle state.
idle_time contains the time a cpu spent in idle state in microseconds.
This can be used e.g. by powertop to tell how often idle state is
entered and left.

# cat /sys/devices/system/cpu/cpu0/idle_count
504
# cat /sys/devices/system/cpu/cpu0/idle_time
469734037 us

Cc: Arjan van de Ven <[EMAIL PROTECTED]>
Signed-off-by: Heiko Carstens <[EMAIL PROTECTED]>
Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
---
 arch/s390/kernel/process.c |   16 +++
 arch/s390/kernel/smp.c |   63 +--
 include/asm-s390/cpu.h |   25 +
 3 files changed, 101 insertions(+), 3 deletions(-)

diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c
index 70c5737..cc7c4ba 100644
--- a/arch/s390/kernel/process.c
+++ b/arch/s390/kernel/process.c
@@ -44,6 +44,7 @@
 #include 
 #include 
 #include 
+#include 
 
 asmlinkage void ret_from_fork(void) asm ("ret_from_fork");
 
@@ -91,6 +92,14 @@ EXPORT_SYMBOL(unregister_idle_notifier);
 
 void do_monitor_call(struct pt_regs *regs, long interruption_code)
 {
+   struct s390_idle_data *idle;
+
+   idle = &__get_cpu_var(s390_idle);
+   spin_lock(&idle->lock);
+   idle->idle_time += get_clock() - idle->idle_enter;
+   idle->in_idle = 0;
+   spin_unlock(&idle->lock);
+
/* disable monitor call class 0 */
__ctl_clear_bit(8, 15);
 
@@ -105,6 +114,7 @@ extern void s390_handle_mcck(void);
 static void default_idle(void)
 {
int cpu, rc;
+   struct s390_idle_data *idle;
 
/* CPU is going idle. */
cpu = smp_processor_id();
@@ -142,6 +152,12 @@ static void default_idle(void)
return;
}
 
+   idle = &__get_cpu_var(s390_idle);
+   spin_lock(&idle->lock);
+   idle->idle_count++;
+   idle->in_idle = 1;
+   idle->idle_enter = get_clock();
+   spin_unlock(&idle->lock);
trace_hardirqs_on();
/* Wait for external, I/O or machine check interrupt. */
__load_psw_mask(psw_kernel_bits | PSW_MASK_WAIT |
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index 35edbef..ba3fff0 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -42,6 +42,7 @@
 #include 
 #include 
 #include 
+#include 
 
 /*
  * An array with a pointer the lowcore of every CPU.
@@ -494,6 +495,8 @@ int __cpuinit start_secondary(void *cpuvoid)
return 0;
 }
 
+DEFINE_PER_CPU(struct s390_idle_data, s390_idle);
+
 static void __init smp_create_idle(unsigned int cpu)
 {
struct task_struct *p;
@@ -506,6 +509,7 @@ static void __init smp_create_idle(unsigned int cpu)
if (IS_ERR(p))
panic("failed fork for CPU %u: %li", cpu, PTR_ERR(p));
current_set[cpu] = p;
+   spin_lock_init(&(&per_cpu(s390_idle, cpu))->lock);
 }
 
 static int cpu_stopped(int cpu)
@@ -724,6 +728,7 @@ void __init smp_prepare_boot_cpu(void)
cpu_set(0, cpu_online_map);
S390_lowcore.percpu_offset = __per_cpu_offset[0];
current_set[0] = current;
+   spin_lock_init(&(&__get_cpu_var(s390_idle))->lock);
 }
 
 void __init smp_cpus_done(unsigned int max_cpus)
@@ -756,22 +761,71 @@ static ssize_t show_capability(struct sys_device *dev, 
char *buf)
 }
 static SYSDEV_ATTR(capability, 0444, show_capability, NULL);
 
+static ssize_t show_idle_count(struct sys_device *dev, char *buf)
+{
+   struct s390_idle_data *idle;
+   unsigned long long idle_count;
+
+   idle = &per_cpu(s390_idle, dev->id);
+   spin_lock_irq(&idle->lock);
+   idle_count = idle->idle_count;
+   spin_unlock_irq(&idle->lock);
+   return sprintf(buf, "%llu\n", idle_count);
+}
+static SYSDEV_ATTR(idle_count, 0444, show_idle_count, NULL);
+
+static ssize_t show_idle_time(struct sys_device *dev, char *buf)
+{
+   struct s390_idle_data *idle;
+   unsigned long long new_time;
+
+   idle = &per_cpu(s390_idle, dev->id);
+   spin_lock_irq(&idle->lock);
+   if (idle->in_idle) {
+   new_time = get_clock();
+   idle->idle_time += new_time - idle->idle_enter;
+   idle->idle_enter = new_time;
+   }
+   new_time = idle->idle_time;
+   spin_unlock_irq(&idle->lock);
+   return sprintf(buf, "%llu us\n", new_time >> 12);
+}
+static SYSDEV_ATTR(idle_time, 0444, show_idle_time,

[S390] cio: Use to_channelpath() for device to channel path conversion.

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=054696077a6c4f9e306321d45b5762d6ea7940e1
Commit: 054696077a6c4f9e306321d45b5762d6ea7940e1
Parent: fae8b22d3e3e3a3d317a7746493997af02a3f35c
Author: Cornelia Huck <[EMAIL PROTECTED]>
AuthorDate: Mon Oct 22 12:52:40 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 12:52:47 2007 +0200

[S390] cio: Use to_channelpath() for device to channel path conversion.

We already have a macro for that, so let's use it consistently...

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

diff --git a/drivers/s390/cio/chp.c b/drivers/s390/cio/chp.c
index 42c1f46..297cdce 100644
--- a/drivers/s390/cio/chp.c
+++ b/drivers/s390/cio/chp.c
@@ -246,7 +246,7 @@ int chp_add_cmg_attr(struct channel_path *chp)
 static ssize_t chp_status_show(struct device *dev,
   struct device_attribute *attr, char *buf)
 {
-   struct channel_path *chp = container_of(dev, struct channel_path, dev);
+   struct channel_path *chp = to_channelpath(dev);
 
if (!chp)
return 0;
@@ -258,7 +258,7 @@ static ssize_t chp_status_write(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
 {
-   struct channel_path *cp = container_of(dev, struct channel_path, dev);
+   struct channel_path *cp = to_channelpath(dev);
char cmd[10];
int num_args;
int error;
@@ -286,7 +286,7 @@ static ssize_t chp_configure_show(struct device *dev,
struct channel_path *cp;
int status;
 
-   cp = container_of(dev, struct channel_path, dev);
+   cp = to_channelpath(dev);
status = chp_info_get_status(cp->chpid);
if (status < 0)
return status;
@@ -308,7 +308,7 @@ static ssize_t chp_configure_write(struct device *dev,
return -EINVAL;
if (val != 0 && val != 1)
return -EINVAL;
-   cp = container_of(dev, struct channel_path, dev);
+   cp = to_channelpath(dev);
chp_cfg_schedule(cp->chpid, val);
cfg_wait_idle();
 
@@ -320,7 +320,7 @@ static DEVICE_ATTR(configure, 0644, chp_configure_show, 
chp_configure_write);
 static ssize_t chp_type_show(struct device *dev, struct device_attribute *attr,
 char *buf)
 {
-   struct channel_path *chp = container_of(dev, struct channel_path, dev);
+   struct channel_path *chp = to_channelpath(dev);
 
if (!chp)
return 0;
@@ -374,7 +374,7 @@ static void chp_release(struct device *dev)
 {
struct channel_path *cp;
 
-   cp = container_of(dev, struct channel_path, dev);
+   cp = to_channelpath(dev);
kfree(cp);
 }
 
-
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 incomplete commit for uevent suppression.

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5bf04b2062c5b441d7154216694fea7dc2a6a7f3
Commit: 5bf04b2062c5b441d7154216694fea7dc2a6a7f3
Parent: 054696077a6c4f9e306321d45b5762d6ea7940e1
Author: Cornelia Huck <[EMAIL PROTECTED]>
AuthorDate: Mon Oct 22 12:52:41 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 12:52:47 2007 +0200

[S390] cio: Fix incomplete commit for uevent suppression.

Commit fa1a8c23eb7d3ded8a3c6d0e653339a2bc7fca9e intended to
introduce uevent suppression for subchannels, but half of it was
lost somewhere. Now, we end up with two uevents for every registered
subchannel :( So we should better add the missing part from
http://marc.info/?l=linux-kernel&m=117515953113974&w=2.

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

diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c
index 5d83dd4..838f7ac 100644
--- a/drivers/s390/cio/css.c
+++ b/drivers/s390/cio/css.c
@@ -182,6 +182,15 @@ static int css_register_subchannel(struct subchannel *sch)
sch->dev.bus = &css_bus_type;
sch->dev.release = &css_subchannel_release;
sch->dev.groups = subch_attr_groups;
+   /*
+* We don't want to generate uevents for I/O subchannels that don't
+* have a working ccw device behind them since they will be
+* unregistered before they can be used anyway, so we delay the add
+* uevent until after device recognition was successful.
+*/
+   if (!cio_is_console(sch->schid))
+   /* Console is special, no need to suppress. */
+   sch->dev.uevent_suppress = 1;
css_update_ssd_info(sch);
/* make it known to the system */
ret = css_sch_device_register(sch);
-
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] struct class_device -> struct device conversion.

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7f021ce1957504cacc78896de857b90293badabc
Commit: 7f021ce1957504cacc78896de857b90293badabc
Parent: 5bf04b2062c5b441d7154216694fea7dc2a6a7f3
Author: Cornelia Huck <[EMAIL PROTECTED]>
AuthorDate: Mon Oct 22 12:52:42 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 12:52:48 2007 +0200

[S390] struct class_device -> struct device conversion.

Convert struct class_device users under drivers/s390/char to use
struct device.

Signed-off-by: Cornelia Huck <[EMAIL PROTECTED]>
Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
---
 drivers/s390/char/raw3270.c|   26 +++---
 drivers/s390/char/tape_class.c |   19 +++
 drivers/s390/char/tape_class.h |4 ++--
 drivers/s390/char/vmlogrdr.c   |   15 ++-
 4 files changed, 26 insertions(+), 38 deletions(-)

diff --git a/drivers/s390/char/raw3270.c b/drivers/s390/char/raw3270.c
index 2edd5fb..8d1c64a 100644
--- a/drivers/s390/char/raw3270.c
+++ b/drivers/s390/char/raw3270.c
@@ -48,8 +48,8 @@ struct raw3270 {
struct timer_list timer;/* Device timer. */
 
unsigned char *ascebc;  /* ascii -> ebcdic table */
-   struct class_device *clttydev;  /* 3270-class tty device ptr */
-   struct class_device *cltubdev;  /* 3270-class tub device ptr */
+   struct device *clttydev;/* 3270-class tty device ptr */
+   struct device *cltubdev;/* 3270-class tub device ptr */
 
struct raw3270_request init_request;
unsigned char init_data[256];
@@ -1107,11 +1107,9 @@ raw3270_delete_device(struct raw3270 *rp)
/* Remove from device chain. */
mutex_lock(&raw3270_mutex);
if (rp->clttydev && !IS_ERR(rp->clttydev))
-   class_device_destroy(class3270,
-MKDEV(IBM_TTY3270_MAJOR, rp->minor));
+   device_destroy(class3270, MKDEV(IBM_TTY3270_MAJOR, rp->minor));
if (rp->cltubdev && !IS_ERR(rp->cltubdev))
-   class_device_destroy(class3270,
-MKDEV(IBM_FS3270_MAJOR, rp->minor));
+   device_destroy(class3270, MKDEV(IBM_FS3270_MAJOR, rp->minor));
list_del_init(&rp->list);
mutex_unlock(&raw3270_mutex);
 
@@ -1181,24 +1179,22 @@ static int raw3270_create_attributes(struct raw3270 *rp)
if (rc)
goto out;
 
-   rp->clttydev = class_device_create(class3270, NULL,
-  MKDEV(IBM_TTY3270_MAJOR, rp->minor),
-  &rp->cdev->dev, "tty%s",
-  rp->cdev->dev.bus_id);
+   rp->clttydev = device_create(class3270, &rp->cdev->dev,
+MKDEV(IBM_TTY3270_MAJOR, rp->minor),
+"tty%s", rp->cdev->dev.bus_id);
if (IS_ERR(rp->clttydev)) {
rc = PTR_ERR(rp->clttydev);
goto out_ttydev;
}
 
-   rp->cltubdev = class_device_create(class3270, NULL,
-  MKDEV(IBM_FS3270_MAJOR, rp->minor),
-  &rp->cdev->dev, "tub%s",
-  rp->cdev->dev.bus_id);
+   rp->cltubdev = device_create(class3270, &rp->cdev->dev,
+MKDEV(IBM_FS3270_MAJOR, rp->minor),
+"tub%s", rp->cdev->dev.bus_id);
if (!IS_ERR(rp->cltubdev))
goto out;
 
rc = PTR_ERR(rp->cltubdev);
-   class_device_destroy(class3270, MKDEV(IBM_TTY3270_MAJOR, rp->minor));
+   device_destroy(class3270, MKDEV(IBM_TTY3270_MAJOR, rp->minor));
 
 out_ttydev:
sysfs_remove_group(&rp->cdev->dev.kobj, &raw3270_attr_group);
diff --git a/drivers/s390/char/tape_class.c b/drivers/s390/char/tape_class.c
index 2e0d297..aa7f166 100644
--- a/drivers/s390/char/tape_class.c
+++ b/drivers/s390/char/tape_class.c
@@ -69,12 +69,9 @@ struct tape_class_device *register_tape_dev(
if (rc)
goto fail_with_cdev;
 
-   tcd->class_device = class_device_create(
-   tape_class,
-   NULL,
-   tcd->char_device->dev,
-   device,
-   "%s", tcd->device_name
+   tcd->class_device = device_create(tape_class, device,
+ tcd->char_device->dev,
+ "%s", tcd->device_name
);
rc = IS_ERR(tcd->class_device) ? PTR_ERR(tcd->class_device) : 0;
if (rc)
@@ -90,7 +87,7 @@ struct tape_class_device *register_tape_dev(
return tcd;
 
 fail_with_class_device:
-   class_device_destroy(tape_class, tcd->char_dev

[S390] kernel: Fix dump on panic for DASDs under LPAR.

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e3d3683d1402c1737687cb698451d545f57c32a7
Commit: e3d3683d1402c1737687cb698451d545f57c32a7
Parent: 7f021ce1957504cacc78896de857b90293badabc
Author: Michael Holzheu <[EMAIL PROTECTED]>
AuthorDate: Mon Oct 22 12:52:43 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 12:52:48 2007 +0200

[S390] kernel: Fix dump on panic for DASDs under LPAR.

Currently the ccw method is used to ipl the DASD dump record under LPAR.
This mechanism is not reliable, which can cause dump failures. This fix
now uses the diag 308 ipl method for all machines, which have diag308
subcode 5 and 4 support.

Signed-off-by: Michael Holzheu <[EMAIL PROTECTED]>
Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
---
 arch/s390/kernel/ipl.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c
index 66b5190..ce0856d 100644
--- a/arch/s390/kernel/ipl.c
+++ b/arch/s390/kernel/ipl.c
@@ -648,6 +648,8 @@ static int dump_set_type(enum dump_type type)
case DUMP_TYPE_CCW:
if (MACHINE_IS_VM)
dump_method = DUMP_METHOD_CCW_VM;
+   else if (diag308_set_works)
+   dump_method = DUMP_METHOD_CCW_DIAG;
else
dump_method = DUMP_METHOD_CCW_CIO;
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] tlb flush fix.

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ba8a9229ab9e80278c28ad68b15053f65b2b0a7c
Commit: ba8a9229ab9e80278c28ad68b15053f65b2b0a7c
Parent: e3d3683d1402c1737687cb698451d545f57c32a7
Author: Martin Schwidefsky <[EMAIL PROTECTED]>
AuthorDate: Mon Oct 22 12:52:44 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 12:52:48 2007 +0200

[S390] tlb flush fix.

The current tlb flushing code for page table entries violates the
s390 architecture in a small detail. The relevant section from the
principles of operation (SA22-7832-02 page 3-47):

   "A valid table entry must not be changed while it is attached
   to any CPU and may be used for translation by that CPU except to
   (1) invalidate the entry by using INVALIDATE PAGE TABLE ENTRY or
   INVALIDATE DAT TABLE ENTRY, (2) alter bits 56-63 of a page-table
   entry, or (3) make a change by means of a COMPARE AND SWAP AND
   PURGE instruction that purges the TLB."

That means if one thread of a multithreaded applciation uses a vma
while another thread does an unmap on it, the page table entries of
that vma needs to get removed with IPTE, IDTE or CSP. In some strange
and rare situations a cpu could check-stop (die) because a entry has
been pushed out of the TLB that is still needed to complete a
(milli-coded) instruction. I've never seen it happen with the current
code on any of the supported machines, so right now this is a
theoretical problem. But I want to fix it nevertheless, to avoid
headaches in the futures.

To get this implemented correctly without changing common code the
primitives ptep_get_and_clear, ptep_get_and_clear_full and
ptep_set_wrprotect need to use the IPTE instruction to invalidate the
pte before the new pte value gets stored. If IPTE is always used for
the three primitives three important operations will have a performace
hit: fork, mprotect and exit_mmap. Time for some workarounds:

* 1: ptep_get_and_clear_full is used in unmap_vmas to remove page
tables entries in a batched tlb gather operation. If the mmu_gather
context passed to unmap_vmas has been started with full_mm_flush==1
or if only one cpu is online or if the only user of a mm_struct is the
current process then the fullmm indication in the mmu_gather context is
set to one. All TLBs for mm_struct are flushed by the tlb_gather_mmu
call. No new TLBs can be created while the unmap is in progress. In
this case ptep_get_and_clear_full clears the ptes with a simple store.

* 2: ptep_get_and_clear is used in change_protection to clear the
ptes from the page tables before they are reentered with the new
access flags. At the end of the update flush_tlb_range clears the
remaining TLBs. In general the ptep_get_and_clear has to issue IPTE
for each pte and flush_tlb_range is a nop. But if there is only one
user of the mm_struct then ptep_get_and_clear uses simple stores
to do the update and flush_tlb_range will flush the TLBs.

* 3: Similar to 2, ptep_set_wrprotect is used in copy_page_range
for a fork to make all ptes of a cow mapping read-only. At the end of
of copy_page_range dup_mmap will flush the TLBs with a call to
flush_tlb_mm.  Check for mm->mm_users and if there is only one user
avoid using IPTE in ptep_set_wrprotect and let flush_tlb_mm clear the
TLBs.

Overall for single threaded programs the tlb flush code now performs
better, for multi threaded programs it is slightly worse. In particular
exit_mmap() now does a single IDTE for the mm and then just frees every
page cache reference and every page table page directly without a delay
over the mmu_gather structure.

Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
---
 arch/s390/kernel/smp.c  |2 +-
 include/asm-s390/pgalloc.h  |   17 -
 include/asm-s390/pgtable.h  |   99 
 include/asm-s390/tlb.h  |  149 +--
 include/asm-s390/tlbflush.h |  150 ---
 5 files changed, 256 insertions(+), 161 deletions(-)

diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index ba3fff0..1d97fe1 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -326,7 +326,7 @@ static void smp_ext_bitcall(int cpu, ec_bit_sig sig)
  */
 void smp_ptlb_callback(void *info)
 {
-   local_flush_tlb();
+   __tlb_flush_local();
 }
 
 void smp_ptlb_all(void)
diff --git a/include/asm-s390/pgalloc.h b/include/asm-s390/pgalloc.h
index e45d3c9..6cbbfe4 100644
--- a/include/asm-s390/pgalloc.h
+++ b/include/asm-s390/pgalloc.h
@@ -82,7 +82,6 @@ static inline void pgd_free(pgd_t *pgd)
  */
 #define pmd_alloc_one(mm,address)   ({ BUG(); ((pmd_t *)2); })
 #define pmd_free(x) do

[S390] Remove unused user_seg from thread structure.

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6f3fa3f0eb8fe4675f8543dd4be3365577e1d487
Commit: 6f3fa3f0eb8fe4675f8543dd4be3365577e1d487
Parent: ba8a9229ab9e80278c28ad68b15053f65b2b0a7c
Author: Martin Schwidefsky <[EMAIL PROTECTED]>
AuthorDate: Mon Oct 22 12:52:45 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 12:52:48 2007 +0200

[S390] Remove unused user_seg from thread structure.

Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
---
 arch/s390/kernel/process.c   |2 --
 include/asm-s390/processor.h |   14 +++---
 2 files changed, 3 insertions(+), 13 deletions(-)

diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c
index cc7c4ba..96492cf 100644
--- a/arch/s390/kernel/process.c
+++ b/arch/s390/kernel/process.c
@@ -270,14 +270,12 @@ int copy_thread(int nr, unsigned long clone_flags, 
unsigned long new_stackp,
save_fp_regs(¤t->thread.fp_regs);
memcpy(&p->thread.fp_regs, ¤t->thread.fp_regs,
   sizeof(s390_fp_regs));
-p->thread.user_seg = __pa((unsigned long) p->mm->pgd) | _SEGMENT_TABLE;
/* Set a new TLS ?  */
if (clone_flags & CLONE_SETTLS)
p->thread.acrs[0] = regs->gprs[6];
 #else /* CONFIG_64BIT */
/* Save the fpu registers to new thread structure. */
save_fp_regs(&p->thread.fp_regs);
-p->thread.user_seg = __pa((unsigned long) p->mm->pgd) | _REGION_TABLE;
/* Set a new TLS ?  */
if (clone_flags & CLONE_SETTLS) {
if (test_thread_flag(TIF_31BIT)) {
diff --git a/include/asm-s390/processor.h b/include/asm-s390/processor.h
index 3b972d4..81efccc 100644
--- a/include/asm-s390/processor.h
+++ b/include/asm-s390/processor.h
@@ -93,7 +93,6 @@ struct thread_struct {
s390_fp_regs fp_regs;
unsigned int  acrs[NUM_ACRS];
 unsigned long ksp;  /* kernel stack pointer */
-unsigned long user_seg; /* HSTD */
mm_segment_t mm_segment;
 unsigned long prot_addr;/* address of protection-excep. */
 unsigned int error_code;/* error-code of last prog-excep.   */
@@ -134,16 +133,9 @@ struct stack_frame {
 # define __SWAPPER_PG_DIR __pa(&swapper_pg_dir[0]) + _REGION_TABLE
 #endif /* __s390x__ */
 
-#define INIT_THREAD {{0,{{0},{0},{0},{0},{0},{0},{0},{0},{0},{0}, \
-   {0},{0},{0},{0},{0},{0}}}, \
-{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, \
-sizeof(init_stack) + (unsigned long) &init_stack, \
-__SWAPPER_PG_DIR, \
-{0},  \
-0,0,0,\
-(per_struct) 0,}}},0,0,0,0,{{0,}}},   \
-0, 0  \
-} 
+#define INIT_THREAD {  \
+   .ksp = sizeof(init_stack) + (unsigned long) &init_stack,\
+}
 
 /*
  * Do necessary setup to start up a new thread.
-
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] Introduce follow_table in uaccess_pt.c

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e4aa402e7a3b6b87d8df6243a37171cdcd2f01c2
Commit: e4aa402e7a3b6b87d8df6243a37171cdcd2f01c2
Parent: 6f3fa3f0eb8fe4675f8543dd4be3365577e1d487
Author: Martin Schwidefsky <[EMAIL PROTECTED]>
AuthorDate: Mon Oct 22 12:52:46 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 12:52:49 2007 +0200

[S390] Introduce follow_table in uaccess_pt.c

Define and use follow_table inline in uaccess_pt.c to simplify
the code.

Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
---
 arch/s390/lib/uaccess_pt.c |   85 +++
 1 files changed, 22 insertions(+), 63 deletions(-)

diff --git a/arch/s390/lib/uaccess_pt.c b/arch/s390/lib/uaccess_pt.c
index b159a9d..dc37ea8 100644
--- a/arch/s390/lib/uaccess_pt.c
+++ b/arch/s390/lib/uaccess_pt.c
@@ -15,6 +15,22 @@
 #include 
 #include "uaccess.h"
 
+static inline pte_t *follow_table(struct mm_struct *mm, unsigned long addr)
+{
+   pgd_t *pgd;
+   pmd_t *pmd;
+
+   pgd = pgd_offset(mm, addr);
+   if (pgd_none(*pgd) || unlikely(pgd_bad(*pgd)))
+   return NULL;
+
+   pmd = pmd_offset(pgd, addr);
+   if (pmd_none(*pmd) || unlikely(pmd_bad(*pmd)))
+   return NULL;
+
+   return pte_offset_map(pmd, addr);
+}
+
 static int __handle_fault(struct mm_struct *mm, unsigned long address,
  int write_access)
 {
@@ -85,8 +101,6 @@ static size_t __user_copy_pt(unsigned long uaddr, void *kptr,
 {
struct mm_struct *mm = current->mm;
unsigned long offset, pfn, done, size;
-   pgd_t *pgd;
-   pmd_t *pmd;
pte_t *pte;
void *from, *to;
 
@@ -94,15 +108,7 @@ static size_t __user_copy_pt(unsigned long uaddr, void 
*kptr,
 retry:
spin_lock(&mm->page_table_lock);
do {
-   pgd = pgd_offset(mm, uaddr);
-   if (pgd_none(*pgd) || unlikely(pgd_bad(*pgd)))
-   goto fault;
-
-   pmd = pmd_offset(pgd, uaddr);
-   if (pmd_none(*pmd) || unlikely(pmd_bad(*pmd)))
-   goto fault;
-
-   pte = pte_offset_map(pmd, uaddr);
+   pte = follow_table(mm, uaddr);
if (!pte || !pte_present(*pte) ||
(write_user && !pte_write(*pte)))
goto fault;
@@ -142,22 +148,12 @@ static unsigned long __dat_user_addr(unsigned long uaddr)
 {
struct mm_struct *mm = current->mm;
unsigned long pfn, ret;
-   pgd_t *pgd;
-   pmd_t *pmd;
pte_t *pte;
int rc;
 
ret = 0;
 retry:
-   pgd = pgd_offset(mm, uaddr);
-   if (pgd_none(*pgd) || unlikely(pgd_bad(*pgd)))
-   goto fault;
-
-   pmd = pmd_offset(pgd, uaddr);
-   if (pmd_none(*pmd) || unlikely(pmd_bad(*pmd)))
-   goto fault;
-
-   pte = pte_offset_map(pmd, uaddr);
+   pte = follow_table(mm, uaddr);
if (!pte || !pte_present(*pte))
goto fault;
 
@@ -229,8 +225,6 @@ static size_t strnlen_user_pt(size_t count, const char 
__user *src)
unsigned long uaddr = (unsigned long) src;
struct mm_struct *mm = current->mm;
unsigned long offset, pfn, done, len;
-   pgd_t *pgd;
-   pmd_t *pmd;
pte_t *pte;
size_t len_str;
 
@@ -240,15 +234,7 @@ static size_t strnlen_user_pt(size_t count, const char 
__user *src)
 retry:
spin_lock(&mm->page_table_lock);
do {
-   pgd = pgd_offset(mm, uaddr);
-   if (pgd_none(*pgd) || unlikely(pgd_bad(*pgd)))
-   goto fault;
-
-   pmd = pmd_offset(pgd, uaddr);
-   if (pmd_none(*pmd) || unlikely(pmd_bad(*pmd)))
-   goto fault;
-
-   pte = pte_offset_map(pmd, uaddr);
+   pte = follow_table(mm, uaddr);
if (!pte || !pte_present(*pte))
goto fault;
 
@@ -308,8 +294,6 @@ static size_t copy_in_user_pt(size_t n, void __user *to,
  uaddr, done, size;
unsigned long uaddr_from = (unsigned long) from;
unsigned long uaddr_to = (unsigned long) to;
-   pgd_t *pgd_from, *pgd_to;
-   pmd_t *pmd_from, *pmd_to;
pte_t *pte_from, *pte_to;
int write_user;
 
@@ -317,39 +301,14 @@ static size_t copy_in_user_pt(size_t n, void __user *to,
 retry:
spin_lock(&mm->page_table_lock);
do {
-   pgd_from = pgd_offset(mm, uaddr_from);
-   if (pgd_none(*pgd_from) || unlikely(pgd_bad(*pgd_from))) {
-   uaddr = uaddr_from;
-   write_user = 0;
-   goto fault;
-   }
-   pgd_to = pgd_offset(mm, uaddr_to);
-   if (pgd_none(*pgd_to) || unlikely(pgd_bad(*pgd_to))) {
-   uaddr = uaddr_to;
-  

[S390] Cleanup page table definitions.

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3610cce87af0693603db171d5b6f6735f5e3dc5b
Commit: 3610cce87af0693603db171d5b6f6735f5e3dc5b
Parent: e4aa402e7a3b6b87d8df6243a37171cdcd2f01c2
Author: Martin Schwidefsky <[EMAIL PROTECTED]>
AuthorDate: Mon Oct 22 12:52:47 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 12:52:49 2007 +0200

[S390] Cleanup page table definitions.

- De-confuse the defines for the address-space-control-elements
  and the segment/region table entries.
- Create out of line functions for page table allocation / freeing.
- Simplify get_shadow_xxx functions.

Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
---
 arch/s390/mm/Makefile  |2 +-
 arch/s390/mm/init.c|   28 ++---
 arch/s390/mm/pgtable.c |   94 +
 arch/s390/mm/vmem.c|   19 ++--
 include/asm-s390/mmu_context.h |   50 +-
 include/asm-s390/pgalloc.h |  213 +--
 include/asm-s390/pgtable.h |  219 +--
 include/asm-s390/processor.h   |6 -
 include/asm-s390/tlbflush.h|2 +-
 9 files changed, 305 insertions(+), 328 deletions(-)

diff --git a/arch/s390/mm/Makefile b/arch/s390/mm/Makefile
index f95449b..6640193 100644
--- a/arch/s390/mm/Makefile
+++ b/arch/s390/mm/Makefile
@@ -2,6 +2,6 @@
 # Makefile for the linux s390-specific parts of the memory manager.
 #
 
-obj-y   := init.o fault.o extmem.o mmap.o vmem.o
+obj-y   := init.o fault.o extmem.o mmap.o vmem.o pgtable.o
 obj-$(CONFIG_CMM) += cmm.o
 
diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c
index 3a25bbf..90ec058 100644
--- a/arch/s390/mm/init.c
+++ b/arch/s390/mm/init.c
@@ -103,32 +103,28 @@ static void __init setup_ro_region(void)
  */
 void __init paging_init(void)
 {
-   pgd_t *pg_dir;
-   int i;
-   unsigned long pgdir_k;
static const int ssm_mask = 0x0400L;
unsigned long max_zone_pfns[MAX_NR_ZONES];
+   unsigned long pgd_type;
 
-   pg_dir = swapper_pg_dir;
-   
+   init_mm.pgd = swapper_pg_dir;
+   S390_lowcore.kernel_asce = __pa(init_mm.pgd) & PAGE_MASK;
 #ifdef CONFIG_64BIT
-   pgdir_k = (__pa(swapper_pg_dir) & PAGE_MASK) | _KERN_REGION_TABLE;
-   for (i = 0; i < PTRS_PER_PGD; i++)
-   pgd_clear_kernel(pg_dir + i);
+   S390_lowcore.kernel_asce |= _ASCE_TYPE_REGION3 | _ASCE_TABLE_LENGTH;
+   pgd_type = _REGION3_ENTRY_EMPTY;
 #else
-   pgdir_k = (__pa(swapper_pg_dir) & PAGE_MASK) | _KERNSEG_TABLE;
-   for (i = 0; i < PTRS_PER_PGD; i++)
-   pmd_clear_kernel((pmd_t *)(pg_dir + i));
+   S390_lowcore.kernel_asce |= _ASCE_TABLE_LENGTH;
+   pgd_type = _SEGMENT_ENTRY_EMPTY;
 #endif
+   clear_table((unsigned long *) init_mm.pgd, pgd_type,
+   sizeof(unsigned long)*2048);
vmem_map_init();
setup_ro_region();
 
-   S390_lowcore.kernel_asce = pgdir_k;
-
 /* enable virtual mapping in kernel mode */
-   __ctl_load(pgdir_k, 1, 1);
-   __ctl_load(pgdir_k, 7, 7);
-   __ctl_load(pgdir_k, 13, 13);
+   __ctl_load(S390_lowcore.kernel_asce, 1, 1);
+   __ctl_load(S390_lowcore.kernel_asce, 7, 7);
+   __ctl_load(S390_lowcore.kernel_asce, 13, 13);
__raw_local_irq_ssm(ssm_mask);
 
memset(max_zone_pfns, 0, sizeof(max_zone_pfns));
diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c
new file mode 100644
index 000..e60e0ae
--- /dev/null
+++ b/arch/s390/mm/pgtable.c
@@ -0,0 +1,94 @@
+/*
+ *  arch/s390/mm/pgtable.c
+ *
+ *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 
+
+#ifndef CONFIG_64BIT
+#define ALLOC_ORDER1
+#else
+#define ALLOC_ORDER2
+#endif
+
+unsigned long *crst_table_alloc(struct mm_struct *mm, int noexec)
+{
+   struct page *page = alloc_pages(GFP_KERNEL, ALLOC_ORDER);
+
+   if (!page)
+   return NULL;
+   page->index = 0;
+   if (noexec) {
+   struct page *shadow = alloc_pages(GFP_KERNEL, ALLOC_ORDER);
+   if (!shadow) {
+   __free_pages(page, ALLOC_ORDER);
+   return NULL;
+   }
+   page->index = page_to_phys(shadow);
+   }
+   return (unsigned long *) page_to_phys(page);
+}
+
+void crst_table_free(unsigned long *table)
+{
+   unsigned long *shadow = get_shadow_table(table);
+
+   if (shadow)
+   free_pages((unsigned long) shadow, ALLOC_ORDER);
+   free_pages((unsigned long) table, ALLOC_ORDER);
+}
+
+/*
+ * page table entry allocation/free routines.
+ */
+unsigned long *page_table_alloc(int noexec)
+{
+   struct

[S390] 4level-fixup cleanup

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=190a1d722a59725706daf832bc8a511ed62f249d
Commit: 190a1d722a59725706daf832bc8a511ed62f249d
Parent: 3610cce87af0693603db171d5b6f6735f5e3dc5b
Author: Martin Schwidefsky <[EMAIL PROTECTED]>
AuthorDate: Mon Oct 22 12:52:48 2007 +0200
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 12:52:49 2007 +0200

[S390] 4level-fixup cleanup

Get independent from asm-generic/4level-fixup.h

Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
---
 arch/s390/lib/uaccess_pt.c |7 ++-
 arch/s390/mm/init.c|4 +-
 arch/s390/mm/vmem.c|   34 ++--
 include/asm-s390/page.h|4 ++
 include/asm-s390/pgalloc.h |   32 
 include/asm-s390/pgtable.h |  123 ++--
 include/asm-s390/tlb.h |2 +
 7 files changed, 127 insertions(+), 79 deletions(-)

diff --git a/arch/s390/lib/uaccess_pt.c b/arch/s390/lib/uaccess_pt.c
index dc37ea8..7e8efaa 100644
--- a/arch/s390/lib/uaccess_pt.c
+++ b/arch/s390/lib/uaccess_pt.c
@@ -18,13 +18,18 @@
 static inline pte_t *follow_table(struct mm_struct *mm, unsigned long addr)
 {
pgd_t *pgd;
+   pud_t *pud;
pmd_t *pmd;
 
pgd = pgd_offset(mm, addr);
if (pgd_none(*pgd) || unlikely(pgd_bad(*pgd)))
return NULL;
 
-   pmd = pmd_offset(pgd, addr);
+   pud = pud_offset(pgd, addr);
+   if (pud_none(*pud) || unlikely(pud_bad(*pud)))
+   return NULL;
+
+   pmd = pmd_offset(pud, addr);
if (pmd_none(*pmd) || unlikely(pmd_bad(*pmd)))
return NULL;
 
diff --git a/arch/s390/mm/init.c b/arch/s390/mm/init.c
index 90ec058..b234bb4 100644
--- a/arch/s390/mm/init.c
+++ b/arch/s390/mm/init.c
@@ -81,6 +81,7 @@ void show_mem(void)
 static void __init setup_ro_region(void)
 {
pgd_t *pgd;
+   pud_t *pud;
pmd_t *pmd;
pte_t *pte;
pte_t new_pte;
@@ -91,7 +92,8 @@ static void __init setup_ro_region(void)
 
for (; address < end; address += PAGE_SIZE) {
pgd = pgd_offset_k(address);
-   pmd = pmd_offset(pgd, address);
+   pud = pud_offset(pgd, address);
+   pmd = pmd_offset(pud, address);
pte = pte_offset_kernel(pmd, address);
new_pte = mk_pte_phys(address, __pgprot(_PAGE_RO));
*pte = new_pte;
diff --git a/arch/s390/mm/vmem.c b/arch/s390/mm/vmem.c
index 1bd51d8..fb9c5a8 100644
--- a/arch/s390/mm/vmem.c
+++ b/arch/s390/mm/vmem.c
@@ -73,6 +73,8 @@ static void __init_refok *vmem_alloc_pages(unsigned int order)
return alloc_bootmem_pages((1 << order) * PAGE_SIZE);
 }
 
+#define vmem_pud_alloc()   ({ BUG(); ((pud_t *) NULL); })
+
 static inline pmd_t *vmem_pmd_alloc(void)
 {
pmd_t *pmd = NULL;
@@ -103,6 +105,7 @@ static int vmem_add_range(unsigned long start, unsigned 
long size)
 {
unsigned long address;
pgd_t *pg_dir;
+   pud_t *pu_dir;
pmd_t *pm_dir;
pte_t *pt_dir;
pte_t  pte;
@@ -111,13 +114,21 @@ static int vmem_add_range(unsigned long start, unsigned 
long size)
for (address = start; address < start + size; address += PAGE_SIZE) {
pg_dir = pgd_offset_k(address);
if (pgd_none(*pg_dir)) {
+   pu_dir = vmem_pud_alloc();
+   if (!pu_dir)
+   goto out;
+   pgd_populate_kernel(&init_mm, pg_dir, pu_dir);
+   }
+
+   pu_dir = pud_offset(pg_dir, address);
+   if (pud_none(*pu_dir)) {
pm_dir = vmem_pmd_alloc();
if (!pm_dir)
goto out;
-   pgd_populate_kernel(&init_mm, pg_dir, pm_dir);
+   pud_populate_kernel(&init_mm, pu_dir, pm_dir);
}
 
-   pm_dir = pmd_offset(pg_dir, address);
+   pm_dir = pmd_offset(pu_dir, address);
if (pmd_none(*pm_dir)) {
pt_dir = vmem_pte_alloc();
if (!pt_dir)
@@ -143,6 +154,7 @@ static void vmem_remove_range(unsigned long start, unsigned 
long size)
 {
unsigned long address;
pgd_t *pg_dir;
+   pud_t *pu_dir;
pmd_t *pm_dir;
pte_t *pt_dir;
pte_t  pte;
@@ -150,9 +162,10 @@ static void vmem_remove_range(unsigned long start, 
unsigned long size)
pte_val(pte) = _PAGE_TYPE_EMPTY;
for (address = start; address < start + size; address += PAGE_SIZE) {
pg_dir = pgd_offset_k(address);
-   if (pgd_none(*pg_dir))
+   pu_dir = pud_offset(pg_dir, address);
+   if (pud_none(*pu_dir))
continue;
-   pm_dir = pmd_offset(pg_dir, address);
+   pm_dir = pmd_offset(pu_di

KVM: x86 emulator: fix merge screwup due to emulator split

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1a52e051368a0e29b26e8790bacd8d1d759e3287
Commit: 1a52e051368a0e29b26e8790bacd8d1d759e3287
Parent: 55b70a0300b873c0ec7ea6e33752af56f41250ce
Author: Nitin A Kamble <[EMAIL PROTECTED]>
AuthorDate: Tue Sep 18 16:34:25 2007 -0700
Committer:  Avi Kivity <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 12:03:28 2007 +0200

KVM: x86 emulator: fix merge screwup due to emulator split

This code has gone to wrong place in the file. Moving it back to
right location.

Signed-off-by: Nitin A Kamble <[EMAIL PROTECTED]>
Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>
---
 drivers/kvm/x86_emulate.c |   51 +++--
 1 files changed, 26 insertions(+), 25 deletions(-)

diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c
index 9737c3b..b1026d2 100644
--- a/drivers/kvm/x86_emulate.c
+++ b/drivers/kvm/x86_emulate.c
@@ -1083,31 +1083,6 @@ push:
case 0xd2 ... 0xd3: /* Grp2 */
src.val = _regs[VCPU_REGS_RCX];
goto grp2;
-   case 0xe8: /* call (near) */ {
-   long int rel;
-   switch (op_bytes) {
-   case 2:
-   rel = insn_fetch(s16, 2, _eip);
-   break;
-   case 4:
-   rel = insn_fetch(s32, 4, _eip);
-   break;
-   case 8:
-   rel = insn_fetch(s64, 8, _eip);
-   break;
-   default:
-   DPRINTF("Call: Invalid op_bytes\n");
-   goto cannot_emulate;
-   }
-   src.val = (unsigned long) _eip;
-   JMP_REL(rel);
-   goto push;
-   }
-   case 0xe9: /* jmp rel */
-   case 0xeb: /* jmp rel short */
-   JMP_REL(src.val);
-   no_wb = 1; /* Disable writeback. */
-   break;
case 0xf6 ... 0xf7: /* Grp3 */
switch (modrm_reg) {
case 0 ... 1:   /* test */
@@ -1350,6 +1325,32 @@ special_insn:
case 0xae ... 0xaf: /* scas */
DPRINTF("Urk! I don't handle SCAS.\n");
goto cannot_emulate;
+   case 0xe8: /* call (near) */ {
+   long int rel;
+   switch (op_bytes) {
+   case 2:
+   rel = insn_fetch(s16, 2, _eip);
+   break;
+   case 4:
+   rel = insn_fetch(s32, 4, _eip);
+   break;
+   case 8:
+   rel = insn_fetch(s64, 8, _eip);
+   break;
+   default:
+   DPRINTF("Call: Invalid op_bytes\n");
+   goto cannot_emulate;
+   }
+   src.val = (unsigned long) _eip;
+   JMP_REL(rel);
+   goto push;
+   }
+   case 0xe9: /* jmp rel */
+   case 0xeb: /* jmp rel short */
+   JMP_REL(src.val);
+   no_wb = 1; /* Disable writeback. */
+   break;
+
 
}
goto writeback;
-
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


KVM: x86 emulator: fix repne/repnz decoding

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ae6200baea4175cac684ea76f78082b31afbdefa
Commit: ae6200baea4175cac684ea76f78082b31afbdefa
Parent: 1a52e051368a0e29b26e8790bacd8d1d759e3287
Author: Laurent Vivier <[EMAIL PROTECTED]>
AuthorDate: Thu Sep 20 11:17:24 2007 +0200
Committer:  Avi Kivity <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 12:03:28 2007 +0200

KVM: x86 emulator: fix repne/repnz decoding

The repnz/repne instructions must set rep_prefix to 1 like rep/repe/repz.

This patch correct the disk probe problem met with OpenBSD.

This issue appears with commit e70669abd4e60dfea3ac1639848e20e2b8dd1255
because before it, the decoding was done internally to kvm and after it
is done by x86_emulate.c (which doesn't do it correctly).

Signed-off-by: Laurent Vivier <[EMAIL PROTECTED]>
Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>
---
 drivers/kvm/x86_emulate.c |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c
index b1026d2..80b1758 100644
--- a/drivers/kvm/x86_emulate.c
+++ b/drivers/kvm/x86_emulate.c
@@ -596,11 +596,10 @@ x86_emulate_memop(struct x86_emulate_ctxt *ctxt, struct 
x86_emulate_ops *ops)
case 0xf0:  /* LOCK */
lock_prefix = 1;
break;
+   case 0xf2:  /* REPNE/REPNZ */
case 0xf3:  /* REP/REPE/REPZ */
rep_prefix = 1;
break;
-   case 0xf2:  /* REPNE/REPNZ */
-   break;
default:
goto done_prefixes;
}
-
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


KVM: MMU: Set shadow pte atomically in mmu_pte_write_zap_pte()

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7f2145ad6f3e7060147a2a4c4db35c641ff61b5c
Commit: 7f2145ad6f3e7060147a2a4c4db35c641ff61b5c
Parent: ae6200baea4175cac684ea76f78082b31afbdefa
Author: Izik Eidus <[EMAIL PROTECTED]>
AuthorDate: Sun Sep 23 12:30:19 2007 +0200
Committer:  Avi Kivity <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 12:03:28 2007 +0200

KVM: MMU: Set shadow pte atomically in mmu_pte_write_zap_pte()

Setting shadow page table entry should be set atomicly using 
set_shadow_pte().

Signed-off-by: Izik Eidus <[EMAIL PROTECTED]>
Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>
---
 drivers/kvm/mmu.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/kvm/mmu.c b/drivers/kvm/mmu.c
index 6d84d30..7171618 100644
--- a/drivers/kvm/mmu.c
+++ b/drivers/kvm/mmu.c
@@ -1088,7 +1088,7 @@ static void mmu_pte_write_zap_pte(struct kvm_vcpu *vcpu,
mmu_page_remove_parent_pte(child, spte);
}
}
-   *spte = 0;
+   set_shadow_pte(spte, 0);
kvm_flush_remote_tlbs(vcpu->kvm);
 }
 
-
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


KVM: VMX: Handle NMIs before enabling interrupts and preemption

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1b6269db3f83396c2fd2c8d0f3e0f37ac0e6ba05
Commit: 1b6269db3f83396c2fd2c8d0f3e0f37ac0e6ba05
Parent: 7f2145ad6f3e7060147a2a4c4db35c641ff61b5c
Author: Avi Kivity <[EMAIL PROTECTED]>
AuthorDate: Tue Oct 9 12:12:19 2007 +0200
Committer:  Avi Kivity <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 12:03:28 2007 +0200

KVM: VMX: Handle NMIs before enabling interrupts and preemption

This makes sure we handle NMI on the current cpu, and that we don't service
maskable interrupts before non-maskable ones.

Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>
---
 drivers/kvm/vmx.c |   13 +
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index 4f115a8..bcc1e39 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -1760,10 +1760,8 @@ static int handle_exception(struct kvm_vcpu *vcpu, 
struct kvm_run *kvm_run)
set_bit(irq / BITS_PER_LONG, &vcpu->irq_summary);
}
 
-   if ((intr_info & INTR_INFO_INTR_TYPE_MASK) == 0x200) { /* nmi */
-   asm ("int $2");
-   return 1;
-   }
+   if ((intr_info & INTR_INFO_INTR_TYPE_MASK) == 0x200) /* nmi */
+   return 1;  /* already handled by vmx_vcpu_run() */
 
if (is_no_device(intr_info)) {
vmx_fpu_activate(vcpu);
@@ -2196,6 +2194,7 @@ static void vmx_intr_assist(struct kvm_vcpu *vcpu)
 static void vmx_vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
 {
struct vcpu_vmx *vmx = to_vmx(vcpu);
+   u32 intr_info;
 
/*
 * Loading guest fpu may have cleared host cr0.ts
@@ -2322,6 +2321,12 @@ static void vmx_vcpu_run(struct kvm_vcpu *vcpu, struct 
kvm_run *kvm_run)
 
asm ("mov %0, %%ds; mov %0, %%es" : : "r"(__USER_DS));
vmx->launched = 1;
+
+   intr_info = vmcs_read32(VM_EXIT_INTR_INFO);
+
+   /* We need to handle NMIs before interrupts are enabled */
+   if ((intr_info & INTR_INFO_INTR_TYPE_MASK) == 0x200) /* nmi */
+   asm("int $2");
 }
 
 static void vmx_inject_page_fault(struct kvm_vcpu *vcpu,
-
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


KVM: VMX: Reset mmu context when entering real mode

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8668a3c468ed55d19514117a5a959d91d3d03823
Commit: 8668a3c468ed55d19514117a5a959d91d3d03823
Parent: 1b6269db3f83396c2fd2c8d0f3e0f37ac0e6ba05
Author: Eddie Dong <[EMAIL PROTECTED]>
AuthorDate: Wed Oct 10 14:26:45 2007 +0800
Committer:  Avi Kivity <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 12:03:28 2007 +0200

KVM: VMX: Reset mmu context when entering real mode

Resetting an SMP guest will force AP enter real mode (RESET) with
paging enabled in protected mode. While current enter_rmode() can
only handle mode switch from nonpaging mode to real mode which leads
to SMP reboot failure.

Fix by reloading the mmu context on entering real mode.

Signed-off-by: Yaozu (Eddie) Dong <[EMAIL PROTECTED]>
Signed-off-by: Qing He <[EMAIL PROTECTED]>
Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>
---
 drivers/kvm/mmu.c |1 +
 drivers/kvm/vmx.c |1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/kvm/mmu.c b/drivers/kvm/mmu.c
index 7171618..feb5ac9 100644
--- a/drivers/kvm/mmu.c
+++ b/drivers/kvm/mmu.c
@@ -1049,6 +1049,7 @@ int kvm_mmu_reset_context(struct kvm_vcpu *vcpu)
destroy_kvm_mmu(vcpu);
return init_kvm_mmu(vcpu);
 }
+EXPORT_SYMBOL_GPL(kvm_mmu_reset_context);
 
 int kvm_mmu_load(struct kvm_vcpu *vcpu)
 {
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index bcc1e39..f130c01 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -1128,6 +1128,7 @@ static void enter_rmode(struct kvm_vcpu *vcpu)
fix_rmode_seg(VCPU_SREG_GS, &vcpu->rmode.gs);
fix_rmode_seg(VCPU_SREG_FS, &vcpu->rmode.fs);
 
+   kvm_mmu_reset_context(vcpu);
init_rmode_tss(vcpu->kvm);
 }
 
-
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


KVM: x86 emulator: implement 'movnti mem, reg'

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a012e65aee48379a7a87eadafa74f878b61522b9
Commit: a012e65aee48379a7a87eadafa74f878b61522b9
Parent: 8668a3c468ed55d19514117a5a959d91d3d03823
Author: Sheng Yang <[EMAIL PROTECTED]>
AuthorDate: Mon Oct 15 14:24:20 2007 +0800
Committer:  Avi Kivity <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 12:03:29 2007 +0200

KVM: x86 emulator: implement 'movnti mem, reg'

Implement emulation of instruction:
movnti m32/m64, r32/r64
opcode: 0x0f 0xc3

Signed-off-by: Sheng Yang <[EMAIL PROTECTED]>
Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>
---
 drivers/kvm/x86_emulate.c |7 ++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c
index 80b1758..0a8696d 100644
--- a/drivers/kvm/x86_emulate.c
+++ b/drivers/kvm/x86_emulate.c
@@ -212,7 +212,8 @@ static u16 twobyte_table[256] = {
0, 0, ByteOp | DstReg | SrcMem | ModRM | Mov,
DstReg | SrcMem16 | ModRM | Mov,
/* 0xC0 - 0xCF */
-   0, 0, 0, 0, 0, 0, 0, ImplicitOps | ModRM, 0, 0, 0, 0, 0, 0, 0, 0,
+   0, 0, 0, DstMem | SrcReg | ModRM | Mov, 0, 0, 0, ImplicitOps | ModRM,
+   0, 0, 0, 0, 0, 0, 0, 0,
/* 0xD0 - 0xDF */
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/* 0xE0 - 0xEF */
@@ -1501,6 +1502,10 @@ twobyte_insn:
dst.bytes = op_bytes;
dst.val = (d & ByteOp) ? (s8) src.val : (s16) src.val;
break;
+   case 0xc3:  /* movnti */
+   dst.bytes = op_bytes;
+   dst.val = (op_bytes == 4) ? (u32) src.val : (u64) src.val;
+   break;
}
goto writeback;
 
-
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


KVM: VMX: Force vm86 mode if setting flags during real mode

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=78f7826868da8e27d097802139a3fec39f47f3b8
Commit: 78f7826868da8e27d097802139a3fec39f47f3b8
Parent: a012e65aee48379a7a87eadafa74f878b61522b9
Author: Avi Kivity <[EMAIL PROTECTED]>
AuthorDate: Tue Oct 16 19:06:15 2007 +0200
Committer:  Avi Kivity <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 12:03:29 2007 +0200

KVM: VMX: Force vm86 mode if setting flags during real mode

When resetting from userspace, we need to handle the flags being cleared
even after we are in real mode.

Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>
---
 drivers/kvm/vmx.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index f130c01..bb56ae3 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -523,6 +523,8 @@ static unsigned long vmx_get_rflags(struct kvm_vcpu *vcpu)
 
 static void vmx_set_rflags(struct kvm_vcpu *vcpu, unsigned long rflags)
 {
+   if (vcpu->rmode.active)
+   rflags |= IOPL_MASK | X86_EFLAGS_VM;
vmcs_writel(GUEST_RFLAGS, rflags);
 }
 
-
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


KVM: x86 emulator: fix access registers for instructions with ModR/M byte and Mod = 3

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4e62417bf317504c0b85e0d7abd236f334f54eaf
Commit: 4e62417bf317504c0b85e0d7abd236f334f54eaf
Parent: 78f7826868da8e27d097802139a3fec39f47f3b8
Author: Aurelien Jarno <[EMAIL PROTECTED]>
AuthorDate: Wed Oct 17 19:30:41 2007 +0200
Committer:  Avi Kivity <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 12:03:29 2007 +0200

KVM: x86 emulator: fix access registers for instructions with ModR/M byte 
and Mod = 3

The patch belows changes the access type to register from memory for
instructions that are declared as SrcMem or DstMem, but have a
ModR/M byte with Mod = 3.

It fixes (at least) the lmsw and smsw instructions on an AMD64 CPU,
which are needed for FreeBSD.

Signed-off-by: Aurelien Jarno <[EMAIL PROTECTED]>
Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>
---
 drivers/kvm/x86_emulate.c |   16 
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c
index 0a8696d..a6ace30 100644
--- a/drivers/kvm/x86_emulate.c
+++ b/drivers/kvm/x86_emulate.c
@@ -825,6 +825,14 @@ done_prefixes:
if (twobyte && b == 0x01 && modrm_reg == 7)
break;
  srcmem_common:
+   /*
+* For instructions with a ModR/M byte, switch to register
+* access if Mod = 3.
+*/
+   if ((d & ModRM) && modrm_mod == 3) {
+   src.type = OP_REG;
+   break;
+   }
src.type = OP_MEM;
src.ptr = (unsigned long *)cr2;
src.val = 0;
@@ -893,6 +901,14 @@ done_prefixes:
dst.ptr = (unsigned long *)cr2;
dst.bytes = (d & ByteOp) ? 1 : op_bytes;
dst.val = 0;
+   /*
+* For instructions with a ModR/M byte, switch to register
+* access if Mod = 3.
+*/
+   if ((d & ModRM) && modrm_mod == 3) {
+   dst.type = OP_REG;
+   break;
+   }
if (d & BitOp) {
unsigned long mask = ~(dst.bytes * 8 - 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


KVM: Move kvm_guest_exit() after local_irq_enable()

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0552f73b9a81d39d50b71a5c06cf36efff80b6fd
Commit: 0552f73b9a81d39d50b71a5c06cf36efff80b6fd
Parent: 4e62417bf317504c0b85e0d7abd236f334f54eaf
Author: Laurent Vivier <[EMAIL PROTECTED]>
AuthorDate: Thu Oct 18 15:19:01 2007 +0200
Committer:  Avi Kivity <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 12:03:29 2007 +0200

KVM: Move kvm_guest_exit() after local_irq_enable()

We need to make sure that the timer interrupt happens before we clear
PF_VCPU, so the accounting code actually sees guest mode.

http://lkml.org/lkml/2007/10/15/114

Signed-off-by: Laurent Vivier <[EMAIL PROTECTED]>
Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>
---
 drivers/kvm/kvm_main.c |   11 ++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index af2d288..8c458f2 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -2054,12 +2054,21 @@ again:
 
kvm_x86_ops->run(vcpu, kvm_run);
 
-   kvm_guest_exit();
vcpu->guest_mode = 0;
local_irq_enable();
 
++vcpu->stat.exits;
 
+   /*
+* We must have an instruction between local_irq_enable() and
+* kvm_guest_exit(), so the timer interrupt isn't delayed by
+* the interrupt shadow.  The stat.exits increment will do nicely.
+* But we need to prevent reordering, hence this barrier():
+*/
+   barrier();
+
+   kvm_guest_exit();
+
preempt_enable();
 
/*
-
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


KVM: Fix local apic timer divide by zero

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b33ac88b4c23330043acad930517282eb486db1d
Commit: b33ac88b4c23330043acad930517282eb486db1d
Parent: 0552f73b9a81d39d50b71a5c06cf36efff80b6fd
Author: Kevin Pedretti <[EMAIL PROTECTED]>
AuthorDate: Sun Oct 21 08:54:53 2007 +0200
Committer:  Avi Kivity <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 12:03:29 2007 +0200

KVM: Fix local apic timer divide by zero

kvm_lapic_reset() was initializing apic->timer.divide_count to 0,
which could potentially lead to a divide by zero error in
apic_get_tmcct().  Any guest that reads the APIC's CCR (current count)
register before setting DCR (divide configuration) would trigger a divide
by zero exception in the host kernel, leading to a host-OS crash.

This patch results in apic->timer.divide_count being initialized to
2 at reset, eliminating the bug (DCR=0 at reset, meaning divide by 2).

Signed-off-by: Kevin Pedretti <[EMAIL PROTECTED]>
Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>
---
 drivers/kvm/lapic.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/kvm/lapic.c b/drivers/kvm/lapic.c
index a190587..443730e 100644
--- a/drivers/kvm/lapic.c
+++ b/drivers/kvm/lapic.c
@@ -853,7 +853,7 @@ void kvm_lapic_reset(struct kvm_vcpu *vcpu)
apic_set_reg(apic, APIC_ISR + 0x10 * i, 0);
apic_set_reg(apic, APIC_TMR + 0x10 * i, 0);
}
-   apic->timer.divide_count = 0;
+   update_divide_count(apic);
atomic_set(&apic->timer.pending, 0);
if (vcpu->vcpu_id == 0)
vcpu->apic_base |= MSR_IA32_APICBASE_BSP;
-
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


KVM: Improve local apic timer wraparound handling

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9da8f4e83a824dabf3fb7ad0890549257ae614a0
Commit: 9da8f4e83a824dabf3fb7ad0890549257ae614a0
Parent: b33ac88b4c23330043acad930517282eb486db1d
Author: Kevin Pedretti <[EMAIL PROTECTED]>
AuthorDate: Sun Oct 21 08:55:50 2007 +0200
Committer:  Avi Kivity <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 12:03:29 2007 +0200

KVM: Improve local apic timer wraparound handling

Better handle wrap-around cases when reading the APIC CCR
(current count register).  Also, if ICR is 0, CCR should also
be 0... previously reading CCR before setting ICR would result
in a large kinda-random number.

Signed-off-by: Kevin Pedretti <[EMAIL PROTECTED]>
Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>
---
 drivers/kvm/lapic.c |   36 ++--
 1 files changed, 26 insertions(+), 10 deletions(-)

diff --git a/drivers/kvm/lapic.c b/drivers/kvm/lapic.c
index 443730e..238fcad 100644
--- a/drivers/kvm/lapic.c
+++ b/drivers/kvm/lapic.c
@@ -494,12 +494,19 @@ static void apic_send_ipi(struct kvm_lapic *apic)
 
 static u32 apic_get_tmcct(struct kvm_lapic *apic)
 {
-   u32 counter_passed;
-   ktime_t passed, now = apic->timer.dev.base->get_time();
-   u32 tmcct = apic_get_reg(apic, APIC_TMICT);
+   u64 counter_passed;
+   ktime_t passed, now;
+   u32 tmcct;
 
ASSERT(apic != NULL);
 
+   now = apic->timer.dev.base->get_time();
+   tmcct = apic_get_reg(apic, APIC_TMICT);
+
+   /* if initial count is 0, current count should also be 0 */
+   if (tmcct == 0)
+   return 0;
+
if (unlikely(ktime_to_ns(now) <=
ktime_to_ns(apic->timer.last_update))) {
/* Wrap around */
@@ -514,15 +521,24 @@ static u32 apic_get_tmcct(struct kvm_lapic *apic)
 
counter_passed = div64_64(ktime_to_ns(passed),
  (APIC_BUS_CYCLE_NS * 
apic->timer.divide_count));
-   tmcct -= counter_passed;
 
-   if (tmcct <= 0) {
-   if (unlikely(!apic_lvtt_period(apic)))
+   if (counter_passed > tmcct) {
+   if (unlikely(!apic_lvtt_period(apic))) {
+   /* one-shot timers stick at 0 until reset */
tmcct = 0;
-   else
-   do {
-   tmcct += apic_get_reg(apic, APIC_TMICT);
-   } while (tmcct <= 0);
+   } else {
+   /*
+* periodic timers reset to APIC_TMICT when they
+* hit 0. The while loop simulates this happening N
+* times. (counter_passed %= tmcct) would also work,
+* but might be slower or not work on 32-bit??
+*/
+   while (counter_passed > tmcct)
+   counter_passed -= tmcct;
+   tmcct -= counter_passed;
+   }
+   } else {
+   tmcct -= counter_passed;
}
 
return tmcct;
-
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


sched: don't clear PF_VCPU in scheduler

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=83d87d167367ae2cc2c6810399aefac33a2ced41
Commit: 83d87d167367ae2cc2c6810399aefac33a2ced41
Parent: 9da8f4e83a824dabf3fb7ad0890549257ae614a0
Author: Laurent Vivier <[EMAIL PROTECTED]>
AuthorDate: Thu Oct 18 15:19:01 2007 +0200
Committer:  Avi Kivity <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 12:03:29 2007 +0200

sched: don't clear PF_VCPU in scheduler

KVM clears it by itself now, and for s390 this is plain wrong.

Signed-off-by: Laurent Vivier <[EMAIL PROTECTED]>
Acked-by: Ingo Molnar <[EMAIL PROTECTED]>
Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>
---
 kernel/sched.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/kernel/sched.c b/kernel/sched.c
index 7581e33..2810e56 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -3375,7 +3375,6 @@ void account_system_time(struct task_struct *p, int 
hardirq_offset,
 
if (p->flags & PF_VCPU) {
account_guest_time(p, cputime);
-   p->flags &= ~PF_VCPU;
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


KVM: Use new smp_call_function_mask() in kvm_flush_remote_tlbs()

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=49d3bd7e2b990e717aa66e229410b8f5096c4956
Commit: 49d3bd7e2b990e717aa66e229410b8f5096c4956
Parent: 83d87d167367ae2cc2c6810399aefac33a2ced41
Author: Laurent Vivier <[EMAIL PROTECTED]>
AuthorDate: Mon Oct 22 16:33:07 2007 +0200
Committer:  Avi Kivity <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 17:21:54 2007 +0200

KVM: Use new smp_call_function_mask() in kvm_flush_remote_tlbs()

In kvm_flush_remote_tlbs(), replace a loop using smp_call_function_single()
by a single call to smp_call_function_mask() (which is new for x86_64).

Signed-off-by: Laurent Vivier <[EMAIL PROTECTED]>
Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>
---
 drivers/kvm/kvm_main.c |   26 +++---
 1 files changed, 3 insertions(+), 23 deletions(-)

diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index 8c458f2..07ae280 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -198,21 +198,15 @@ static void vcpu_put(struct kvm_vcpu *vcpu)
 
 static void ack_flush(void *_completed)
 {
-   atomic_t *completed = _completed;
-
-   atomic_inc(completed);
 }
 
 void kvm_flush_remote_tlbs(struct kvm *kvm)
 {
-   int i, cpu, needed;
+   int i, cpu;
cpumask_t cpus;
struct kvm_vcpu *vcpu;
-   atomic_t completed;
 
-   atomic_set(&completed, 0);
cpus_clear(cpus);
-   needed = 0;
for (i = 0; i < KVM_MAX_VCPUS; ++i) {
vcpu = kvm->vcpus[i];
if (!vcpu)
@@ -221,23 +215,9 @@ void kvm_flush_remote_tlbs(struct kvm *kvm)
continue;
cpu = vcpu->cpu;
if (cpu != -1 && cpu != raw_smp_processor_id())
-   if (!cpu_isset(cpu, cpus)) {
-   cpu_set(cpu, cpus);
-   ++needed;
-   }
-   }
-
-   /*
-* We really want smp_call_function_mask() here.  But that's not
-* available, so ipi all cpus in parallel and wait for them
-* to complete.
-*/
-   for (cpu = first_cpu(cpus); cpu != NR_CPUS; cpu = next_cpu(cpu, cpus))
-   smp_call_function_single(cpu, ack_flush, &completed, 1, 0);
-   while (atomic_read(&completed) != needed) {
-   cpu_relax();
-   barrier();
+   cpu_set(cpu, cpus);
}
+   smp_call_function_mask(cpus, ack_flush, NULL, 1);
 }
 
 int kvm_vcpu_init(struct kvm_vcpu *vcpu, struct kvm *kvm, unsigned id)
-
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


Blackfin arch: Javier Herrer writes: fix building when icache and dcache is disabled

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=da27abb79970e80904818e3866703ed02953a174
Commit: da27abb79970e80904818e3866703ed02953a174
Parent: 55b70a0300b873c0ec7ea6e33752af56f41250ce
Author: Mike Frysinger <[EMAIL PROTECTED]>
AuthorDate: Mon Oct 22 10:55:35 2007 +0800
Committer:  Bryan Wu <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 10:55:35 2007 +0800

Blackfin arch: Javier Herrer writes: fix building when icache and dcache is 
disabled

Signed-off-by: Mike Frysinger <[EMAIL PROTECTED]>
Signed-off-by: Bryan Wu <[EMAIL PROTECTED]>
---
 arch/blackfin/kernel/setup.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/blackfin/kernel/setup.c b/arch/blackfin/kernel/setup.c
index 0e74644..f1b059e 100644
--- a/arch/blackfin/kernel/setup.c
+++ b/arch/blackfin/kernel/setup.c
@@ -501,7 +501,7 @@ EXPORT_SYMBOL(sclk_to_usecs);
 
 unsigned long usecs_to_sclk(unsigned long usecs)
 {
-   return get_sclk() / (USEC_PER_SEC * (u64)usecs);
+   return (get_sclk() * (u64)usecs) / USEC_PER_SEC;
 }
 EXPORT_SYMBOL(usecs_to_sclk);
 
@@ -589,7 +589,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
 #elif defined CONFIG_BFIN_WT
"wt"
 #endif
-   , 0);
+   "", 0);
 
seq_printf(m, "%s\n", cache);
 
-
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


Blackfin arch: use KBUILD_CFLAGS and KBUILD_AFLAGS in Makefile

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=38f668e8f78c6699c705f7a1f4866ed03a93e4cf
Commit: 38f668e8f78c6699c705f7a1f4866ed03a93e4cf
Parent: da27abb79970e80904818e3866703ed02953a174
Author: Bryan Wu <[EMAIL PROTECTED]>
AuthorDate: Mon Oct 22 10:46:21 2007 +0800
Committer:  Bryan Wu <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 10:46:21 2007 +0800

Blackfin arch: use KBUILD_CFLAGS and KBUILD_AFLAGS in Makefile

Signed-off-by: Bryan Wu <[EMAIL PROTECTED]>
---
 arch/blackfin/Makefile |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/blackfin/Makefile b/arch/blackfin/Makefile
index 3c87291..f7cac7c 100644
--- a/arch/blackfin/Makefile
+++ b/arch/blackfin/Makefile
@@ -12,8 +12,8 @@ LDFLAGS_vmlinux  := -X
 OBJCOPYFLAGS := -O binary -R .note -R .comment -S
 GZFLAGS  := -9
 
-CFLAGS   += $(call cc-option,-mno-fdpic)
-AFLAGS   += $(call cc-option,-mno-fdpic)
+KBUILD_CFLAGS   += $(call cc-option,-mno-fdpic)
+KBUILD_AFLAGS   += $(call cc-option,-mno-fdpic)
 CFLAGS_MODULE+= -mlong-calls
 KALLSYMS += --symbol-prefix=_
 
-
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


Input: i8042 - export i8042_command()

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=553a05b8821f5a6bc633e97187933e2157b2d291
Commit: 553a05b8821f5a6bc633e97187933e2157b2d291
Parent: 82ba56c273911f7eda79849cfa0fc2d2e5a3b75b
Author: Márton Németh <[EMAIL PROTECTED]>
AuthorDate: Mon Oct 22 00:56:52 2007 -0400
Committer:  Dmitry Torokhov <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 00:56:52 2007 -0400

Input: i8042 - export i8042_command()

Export the i8042_command() function which manages the mutual
exclusion with the help of the i8042_lock spinlock. This allows
to access i8042 safely from other parts of the kernel.

Signed-off-by: Márton Németh <[EMAIL PROTECTED]>
Signed-off-by: Dmitry Torokhov <[EMAIL PROTECTED]>
---
 drivers/input/serio/i8042.c |4 +++-
 drivers/input/serio/i8042.h |   22 --
 include/linux/i8042.h   |   35 +++
 3 files changed, 38 insertions(+), 23 deletions(-)

diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c
index 11dafc0..1a0cea3 100644
--- a/drivers/input/serio/i8042.c
+++ b/drivers/input/serio/i8042.c
@@ -20,6 +20,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -208,7 +209,7 @@ static int __i8042_command(unsigned char *param, int 
command)
return 0;
 }
 
-static int i8042_command(unsigned char *param, int command)
+int i8042_command(unsigned char *param, int command)
 {
unsigned long flags;
int retval;
@@ -219,6 +220,7 @@ static int i8042_command(unsigned char *param, int command)
 
return retval;
 }
+EXPORT_SYMBOL(i8042_command);
 
 /*
  * i8042_kbd_write() sends a byte out through the keyboard interface.
diff --git a/drivers/input/serio/i8042.h b/drivers/input/serio/i8042.h
index b3eb7a7..dd22d91 100644
--- a/drivers/input/serio/i8042.h
+++ b/drivers/input/serio/i8042.h
@@ -61,28 +61,6 @@
 #define I8042_CTR_XLATE0x40
 
 /*
- * Commands.
- */
-
-#define I8042_CMD_CTL_RCTR 0x0120
-#define I8042_CMD_CTL_WCTR 0x1060
-#define I8042_CMD_CTL_TEST 0x01aa
-
-#define I8042_CMD_KBD_DISABLE  0x00ad
-#define I8042_CMD_KBD_ENABLE   0x00ae
-#define I8042_CMD_KBD_TEST 0x01ab
-#define I8042_CMD_KBD_LOOP 0x11d2
-
-#define I8042_CMD_AUX_DISABLE  0x00a7
-#define I8042_CMD_AUX_ENABLE   0x00a8
-#define I8042_CMD_AUX_TEST 0x01a9
-#define I8042_CMD_AUX_SEND 0x10d4
-#define I8042_CMD_AUX_LOOP 0x11d3
-
-#define I8042_CMD_MUX_PFX  0x0090
-#define I8042_CMD_MUX_SEND 0x1090
-
-/*
  * Return codes.
  */
 
diff --git a/include/linux/i8042.h b/include/linux/i8042.h
new file mode 100644
index 000..7907a72
--- /dev/null
+++ b/include/linux/i8042.h
@@ -0,0 +1,35 @@
+#ifndef _LINUX_I8042_H
+#define _LINUX_I8042_H
+
+/*
+ * 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.
+ */
+
+
+/*
+ * Standard commands.
+ */
+
+#define I8042_CMD_CTL_RCTR 0x0120
+#define I8042_CMD_CTL_WCTR 0x1060
+#define I8042_CMD_CTL_TEST 0x01aa
+
+#define I8042_CMD_KBD_DISABLE  0x00ad
+#define I8042_CMD_KBD_ENABLE   0x00ae
+#define I8042_CMD_KBD_TEST 0x01ab
+#define I8042_CMD_KBD_LOOP 0x11d2
+
+#define I8042_CMD_AUX_DISABLE  0x00a7
+#define I8042_CMD_AUX_ENABLE   0x00a8
+#define I8042_CMD_AUX_TEST 0x01a9
+#define I8042_CMD_AUX_SEND 0x10d4
+#define I8042_CMD_AUX_LOOP 0x11d3
+
+#define I8042_CMD_MUX_PFX  0x0090
+#define I8042_CMD_MUX_SEND 0x1090
+
+int i8042_command(unsigned char *param, int command);
+
+#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


Input: bf54x-keys - return real error when request_irq() fails

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=858711c55f757872b11574599bfa836df8ab34c9
Commit: 858711c55f757872b11574599bfa836df8ab34c9
Parent: 553a05b8821f5a6bc633e97187933e2157b2d291
Author: Michael Hennerich <[EMAIL PROTECTED]>
AuthorDate: Mon Oct 22 00:59:38 2007 -0400
Committer:  Dmitry Torokhov <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 00:59:38 2007 -0400

Input: bf54x-keys - return real error when request_irq() fails

Signed-off-by: Michael Hennerich <[EMAIL PROTECTED]>
Signed-off-by: Bryan Wu <[EMAIL PROTECTED]>
Signed-off-by: Dmitry Torokhov <[EMAIL PROTECTED]>
---
 drivers/input/keyboard/bf54x-keys.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/input/keyboard/bf54x-keys.c 
b/drivers/input/keyboard/bf54x-keys.c
index a67b29b..e5f4da9 100644
--- a/drivers/input/keyboard/bf54x-keys.c
+++ b/drivers/input/keyboard/bf54x-keys.c
@@ -256,7 +256,6 @@ static int __devinit bfin_kpad_probe(struct platform_device 
*pdev)
printk(KERN_ERR DRV_NAME
": unable to claim irq %d; error %d\n",
bf54x_kpad->irq, error);
-   error = -EBUSY;
goto out2;
}
 
-
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


Input: usbtouchscreen - add support for GoTop tablet devices

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=14e4020630b364cc564172a476cd6a6ac4bc7393
Commit: 14e4020630b364cc564172a476cd6a6ac4bc7393
Parent: 858711c55f757872b11574599bfa836df8ab34c9
Author: Jerrold Jones <[EMAIL PROTECTED]>
AuthorDate: Mon Oct 22 00:59:47 2007 -0400
Committer:  Dmitry Torokhov <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 00:59:47 2007 -0400

Input: usbtouchscreen - add support for GoTop tablet devices

Add support for GoTop Super_Q2/GogoPen/PenPower tablets to usbtouchscreen.
Protocol discovery was done by Yick Yan Lam.

Signed-off-by: Daniel Ritz <[EMAIL PROTECTED]>
Signed-off-by: Dmitry Torokhov <[EMAIL PROTECTED]>
---
 drivers/input/touchscreen/Kconfig  |6 
 drivers/input/touchscreen/usbtouchscreen.c |   36 ++-
 2 files changed, 40 insertions(+), 2 deletions(-)

diff --git a/drivers/input/touchscreen/Kconfig 
b/drivers/input/touchscreen/Kconfig
index e3e0baa..fa8442b 100644
--- a/drivers/input/touchscreen/Kconfig
+++ b/drivers/input/touchscreen/Kconfig
@@ -202,6 +202,7 @@ config TOUCHSCREEN_USB_COMPOSITE
  - DMC TSC-10/25
  - IRTOUCHSYSTEMS/UNITOP
  - IdealTEK URTC1000
+ - GoTop Super_Q2/GogoPen/PenPower tablets
 
  Have a look at  for
  a usage description and the required user-space stuff.
@@ -259,4 +260,9 @@ config TOUCHSCREEN_USB_GENERAL_TOUCH
bool "GeneralTouch Touchscreen device support" if EMBEDDED
depends on TOUCHSCREEN_USB_COMPOSITE
 
+config TOUCHSCREEN_USB_GOTOP
+   default y
+   bool "GoTop Super_Q2/GogoPen/PenPower tablet device support" if EMBEDDED
+   depends on TOUCHSCREEN_USB_COMPOSITE
+
 endif
diff --git a/drivers/input/touchscreen/usbtouchscreen.c 
b/drivers/input/touchscreen/usbtouchscreen.c
index 9fb3d5c..f7d4a3b 100644
--- a/drivers/input/touchscreen/usbtouchscreen.c
+++ b/drivers/input/touchscreen/usbtouchscreen.c
@@ -11,8 +11,9 @@
  *  - DMC TSC-10/25
  *  - IRTOUCHSYSTEMS/UNITOP
  *  - IdealTEK URTC1000
+ *  - GoTop Super_Q2/GogoPen/PenPower tablets
  *
- * Copyright (C) 2004-2006 by Daniel Ritz <[EMAIL PROTECTED]>
+ * Copyright (C) 2004-2007 by Daniel Ritz <[EMAIL PROTECTED]>
  * Copyright (C) by Todd E. Johnson (mtouchusb.c)
  *
  * This program is free software; you can redistribute it and/or
@@ -115,6 +116,7 @@ enum {
DEVTYPE_IRTOUCH,
DEVTYPE_IDEALTEK,
DEVTYPE_GENERAL_TOUCH,
+   DEVTYPE_GOTOP,
 };
 
 static struct usb_device_id usbtouch_devices[] = {
@@ -168,6 +170,12 @@ static struct usb_device_id usbtouch_devices[] = {
{USB_DEVICE(0x0dfc, 0x0001), .driver_info = DEVTYPE_GENERAL_TOUCH},
 #endif
 
+#ifdef CONFIG_TOUCHSCREEN_USB_GOTOP
+   {USB_DEVICE(0x08f2, 0x007f), .driver_info = DEVTYPE_GOTOP},
+   {USB_DEVICE(0x08f2, 0x00ce), .driver_info = DEVTYPE_GOTOP},
+   {USB_DEVICE(0x08f2, 0x00f4), .driver_info = DEVTYPE_GOTOP},
+#endif
+
{}
 };
 
@@ -501,6 +509,20 @@ static int general_touch_read_data(struct usbtouch_usb 
*dev, unsigned char *pkt)
 #endif
 
 /*
+ * GoTop Part
+ */
+#ifdef CONFIG_TOUCHSCREEN_USB_GOTOP
+static int gotop_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
+{
+   dev->x = ((pkt[1] & 0x38) << 4) | pkt[2];
+   dev->y = ((pkt[1] & 0x07) << 7) | pkt[3];
+   dev->touch = pkt[0] & 0x01;
+   return 1;
+}
+#endif
+
+
+/*
  * the different device descriptors
  */
 static struct usbtouch_device_info usbtouch_dev_info[] = {
@@ -623,9 +645,19 @@ static struct usbtouch_device_info usbtouch_dev_info[] = {
.max_yc = 0x0500,
.rept_size  = 7,
.read_data  = general_touch_read_data,
-   }
+   },
 #endif
 
+#ifdef CONFIG_TOUCHSCREEN_USB_GOTOP
+   [DEVTYPE_GOTOP] = {
+   .min_xc = 0x0,
+   .max_xc = 0x03ff,
+   .min_yc = 0x0,
+   .max_yc = 0x03ff,
+   .rept_size  = 4,
+   .read_data  = gotop_read_data,
+   },
+#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


Input: appletouch - apply idle reset logic to all touchpads

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=46249ea60fbb61a72ee6929b831b1f3e6865f024
Commit: 46249ea60fbb61a72ee6929b831b1f3e6865f024
Parent: 14e4020630b364cc564172a476cd6a6ac4bc7393
Author: Anton Ekblad <[EMAIL PROTECTED]>
AuthorDate: Mon Oct 22 00:59:59 2007 -0400
Committer:  Dmitry Torokhov <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 00:59:59 2007 -0400

Input: appletouch - apply idle reset logic to all touchpads

Not only Geyser 3 but also Geyser 1 need to be reset after they become
idle to stop them from needlessly waking up the kernel. Do idle reset
on all touchpads, regardless of their version - if we see 10 empty
packets the touchpad needs to be reset; good touchpads should not send
empty packets anyway.

Signed-off-by: Dmitry Torokhov <[EMAIL PROTECTED]>
---
 drivers/input/mouse/appletouch.c |   25 +++--
 1 files changed, 11 insertions(+), 14 deletions(-)

diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c
index 0117817..f132702 100644
--- a/drivers/input/mouse/appletouch.c
+++ b/drivers/input/mouse/appletouch.c
@@ -504,25 +504,22 @@ static void atp_complete(struct urb* urb)
memset(dev->xy_acc, 0, sizeof(dev->xy_acc));
}
 
-   /* Geyser 3 will continue to send packets continually after
+   input_report_key(dev->input, BTN_LEFT, key);
+   input_sync(dev->input);
+
+   /* Many Geysers will continue to send packets continually after
   the first touch unless reinitialised. Do so if it's been
   idle for a while in order to avoid waking the kernel up
   several hundred times a second */
 
-   if (atp_is_geyser_3(dev)) {
-   if (!x && !y && !key) {
-   dev->idlecount++;
-   if (dev->idlecount == 10) {
-   dev->valid = 0;
-   schedule_work(&dev->work);
-   }
+   if (!x && !y && !key) {
+   dev->idlecount++;
+   if (dev->idlecount == 10) {
+   dev->valid = 0;
+   schedule_work(&dev->work);
}
-   else
-   dev->idlecount = 0;
-   }
-
-   input_report_key(dev->input, BTN_LEFT, key);
-   input_sync(dev->input);
+   } else
+   dev->idlecount = 0;
 
 exit:
retval = usb_submit_urb(dev->urb, GFP_ATOMIC);
-
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


Expand hwif->host_flags so that it fits new flags.

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e95d9c6b046f665da551a51b4071902336a6118c
Commit: e95d9c6b046f665da551a51b4071902336a6118c
Parent: 81f8320f624a785d77443ace83391d0fdee695f6
Author: David Miller <[EMAIL PROTECTED]>
AuthorDate: Mon Oct 22 02:09:00 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 19:35:14 2007 -0700

Expand hwif->host_flags so that it fits new flags.

Commit 238e4f142c33bb34440cc64029dde7b9fbc4e65f ("ide: add
IDE_HFLAG_NO_LBA48 and IDE_HFLAG_NO_LBA48_DMA host flags") caused a
regression because the host_flags in struct hwif_s wasn't expanded to
cope with the fact that the host flags no longer fit in 16 bits.

Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
[ I hate having to add good commit descriptions.  - Linus ]
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 include/linux/ide.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/linux/ide.h b/include/linux/ide.h
index 2e4b8dd..4ed4777 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -667,7 +667,7 @@ typedef struct hwif_s {
u8 straight8;   /* Alan's straight 8 check */
u8 bus_state;   /* power state of the IDE bus */
 
-   u16 host_flags;
+   u32 host_flags;
 
u8 pio_mask;
 
-
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


auditsc: fix kernel-doc param warnings

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=481968f44e81aac3b1b4863baf2c497ec46388f6
Commit: 481968f44e81aac3b1b4863baf2c497ec46388f6
Parent: e95d9c6b046f665da551a51b4071902336a6118c
Author: Randy Dunlap <[EMAIL PROTECTED]>
AuthorDate: Sun Oct 21 20:59:53 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 19:40:02 2007 -0700

auditsc: fix kernel-doc param warnings

Fix kernel-doc for auditsc parameter changes.

Warning(linux-2.6.23-git17//kernel/auditsc.c:1623): No description found 
for parameter 'dentry'
Warning(linux-2.6.23-git17//kernel/auditsc.c:1666): No description found 
for parameter 'dentry'

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

diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index 80ecab0..bce9ecd 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -1615,7 +1615,7 @@ static void audit_copy_inode(struct audit_names *name, 
const struct inode *inode
 /**
  * audit_inode - store the inode and device from a lookup
  * @name: name being audited
- * @inode: inode being audited
+ * @dentry: dentry being audited
  *
  * Called from fs/namei.c:path_lookup().
  */
@@ -1650,7 +1650,7 @@ void __audit_inode(const char *name, const struct dentry 
*dentry)
 /**
  * audit_inode_child - collect inode info for created/removed objects
  * @dname: inode's dentry name
- * @inode: inode being audited
+ * @dentry: dentry being audited
  * @parent: inode of dentry parent
  *
  * For syscalls that create or remove filesystem objects, audit_inode
-
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


procfs: fix kernel-doc param warnings

2007-10-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0895e91d60ef9bdef426d1ce14bb94bd5875870d
Commit: 0895e91d60ef9bdef426d1ce14bb94bd5875870d
Parent: 481968f44e81aac3b1b4863baf2c497ec46388f6
Author: Randy Dunlap <[EMAIL PROTECTED]>
AuthorDate: Sun Oct 21 21:00:10 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 19:40:02 2007 -0700

procfs: fix kernel-doc param warnings

Fix mnt_flush_task() misplaced kernel-doc.
Fix typos in some of the doc text.

Warning(linux-2.6.23-git17//fs/proc/base.c:2280): No description found for 
parameter 'mnt'
Warning(linux-2.6.23-git17//fs/proc/base.c:2280): No description found for 
parameter 'pid'
Warning(linux-2.6.23-git17//fs/proc/base.c:2280): No description found for 
parameter 'tgid'

Signed-off-by: Randy Dunlap <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 fs/proc/base.c |   46 ++
 1 files changed, 22 insertions(+), 24 deletions(-)

diff --git a/fs/proc/base.c b/fs/proc/base.c
index 39a3d7c..aeaf0d0 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -2255,27 +2255,6 @@ static const struct inode_operations 
proc_tgid_base_inode_operations = {
.setattr= proc_setattr,
 };
 
-/**
- * proc_flush_task -  Remove dcache entries for @task from the /proc dcache.
- *
- * @task: task that should be flushed.
- *
- * Looks in the dcache for
- * /proc/@pid
- * /proc/@tgid/task/@pid
- * if either directory is present flushes it and all of it'ts children
- * from the dcache.
- *
- * It is safe and reasonable to cache /proc entries for a task until
- * that task exits.  After that they just clog up the dcache with
- * useless entries, possibly causing useful dcache entries to be
- * flushed instead.  This routine is proved to flush those useless
- * dcache entries at process exit time.
- *
- * NOTE: This routine is just an optimization so it does not guarantee
- *   that no dcache entries will exist at process exit time it
- *   just makes it very unlikely that any will persist.
- */
 static void proc_flush_task_mnt(struct vfsmount *mnt, pid_t pid, pid_t tgid)
 {
struct dentry *dentry, *leader, *dir;
@@ -2322,10 +2301,29 @@ out:
return;
 }
 
-/*
- * when flushing dentries from proc one need to flush them from global
+/**
+ * proc_flush_task -  Remove dcache entries for @task from the /proc dcache.
+ * @task: task that should be flushed.
+ *
+ * When flushing dentries from proc, one needs to flush them from global
  * proc (proc_mnt) and from all the namespaces' procs this task was seen
- * in. this call is supposed to make all this job.
+ * in. This call is supposed to do all of this job.
+ *
+ * Looks in the dcache for
+ * /proc/@pid
+ * /proc/@tgid/task/@pid
+ * if either directory is present flushes it and all of it'ts children
+ * from the dcache.
+ *
+ * It is safe and reasonable to cache /proc entries for a task until
+ * that task exits.  After that they just clog up the dcache with
+ * useless entries, possibly causing useful dcache entries to be
+ * flushed instead.  This routine is proved to flush those useless
+ * dcache entries at process exit time.
+ *
+ * NOTE: This routine is just an optimization so it does not guarantee
+ *   that no dcache entries will exist at process exit time it
+ *   just makes it very unlikely that any will persist.
  */
 
 void proc_flush_task(struct task_struct *task)
-
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


<    1   2