diff --git a/[refs] b/[refs]
index dfa18a69068f..15287d5492db 100644
--- a/[refs]
+++ b/[refs]
@@ -1,2 +1,2 @@
---
-refs/heads/master: 9156ad48338e0306e508ead5c0d9986050744475
+refs/heads/master: f98eeb4eb1c52de89dcefeb538029bcecc6dd42d
diff --git a/trunk/Documentation/kernel-parameters.txt b/trunk/Documentation/kernel-parameters.txt
index db122df5e77d..2fc1fb896afc 100644
--- a/trunk/Documentation/kernel-parameters.txt
+++ b/trunk/Documentation/kernel-parameters.txt
@@ -527,30 +527,29 @@ and is between 256 and 4096 characters. It is defined in the file
Format: [,]
See also Documentation/networking/decnet.txt.
- vt.default_blu= [VT]
+ default_blu= [VT]
Format: ,,,...,
Change the default blue palette of the console.
This is a 16-member array composed of values
ranging from 0-255.
- vt.default_grn= [VT]
+ default_grn= [VT]
Format: ,,,...,
Change the default green palette of the console.
This is a 16-member array composed of values
ranging from 0-255.
- vt.default_red= [VT]
+ default_red= [VT]
Format: ,,,...,
Change the default red palette of the console.
This is a 16-member array composed of values
ranging from 0-255.
- vt.default_utf8=
- [VT]
+ default_utf8= [VT]
Format=<0|1>
Set system-wide default UTF-8 mode for all tty's.
- Default is 1, i.e. UTF-8 mode is enabled for all
- newly opened terminals.
+ Default is 0 and by setting to 1, it enables UTF-8
+ mode for all newly opened or allocated terminals.
dhash_entries= [KNL]
Set number of hash buckets for dentry cache.
@@ -884,14 +883,6 @@ and is between 256 and 4096 characters. It is defined in the file
lapic_timer_c2_ok [X86-32,x86-64,APIC] trust the local apic timer in
C2 power state.
- libata.dma= [LIBATA] DMA control
- libata.dma=0 Disable all PATA and SATA DMA
- libata.dma=1 PATA and SATA Disk DMA only
- libata.dma=2 ATAPI (CDROM) DMA only
- libata.dma=4 Compact Flash DMA only
- Combinations also work, so libata.dma=3 enables DMA
- for disks and CDROMs, but not CFs.
-
libata.noacpi [LIBATA] Disables use of ACPI in libata suspend/resume
when set.
Format:
diff --git a/trunk/Documentation/local_ops.txt b/trunk/Documentation/local_ops.txt
index 4269a1105b37..1a45f11e645e 100644
--- a/trunk/Documentation/local_ops.txt
+++ b/trunk/Documentation/local_ops.txt
@@ -45,6 +45,29 @@ long fails. The definition looks like :
typedef struct { atomic_long_t a; } local_t;
+* Rules to follow when using local atomic operations
+
+- Variables touched by local ops must be per cpu variables.
+- _Only_ the CPU owner of these variables must write to them.
+- This CPU can use local ops from any context (process, irq, softirq, nmi, ...)
+ to update its local_t variables.
+- Preemption (or interrupts) must be disabled when using local ops in
+ process context to make sure the process won't be migrated to a
+ different CPU between getting the per-cpu variable and doing the
+ actual local op.
+- When using local ops in interrupt context, no special care must be
+ taken on a mainline kernel, since they will run on the local CPU with
+ preemption already disabled. I suggest, however, to explicitly
+ disable preemption anyway to make sure it will still work correctly on
+ -rt kernels.
+- Reading the local cpu variable will provide the current copy of the
+ variable.
+- Reads of these variables can be done from any CPU, because updates to
+ "long", aligned, variables are always atomic. Since no memory
+ synchronization is done by the writer CPU, an outdated copy of the
+ variable can be read when reading some _other_ cpu's variables.
+
+
* Rules to follow when using local atomic operations
- Variables touched by local ops must be per cpu variables.
diff --git a/trunk/Documentation/networking/driver.txt b/trunk/Documentation/networking/driver.txt
index ea72d2e66ca8..4f7da5a2bf4f 100644
--- a/trunk/Documentation/networking/driver.txt
+++ b/trunk/Documentation/networking/driver.txt
@@ -61,10 +61,7 @@ Transmit path guidelines:
2) Do not forget to update netdev->trans_start to jiffies after
each new tx packet is given to the hardware.
-3) A hard_start_xmit method must not modify the shared parts of a
- cloned SKB.
-
-4) Do not forget that once you return 0 from your hard_start_xmit
+3) Do not forget that once you return 0 from your hard_start_xmit
method, it is your driver's responsibility to free up the SKB
and in some finite amount of time.
diff --git a/trunk/Documentation/networking/wavelan.txt b/trunk/Documentation/networking/wavelan.txt
index afa6e521c685..c1acf5eb3712 100644
--- a/trunk/Documentation/networking/wavelan.txt
+++ b/trunk/Documentation/networking/wavelan.txt
@@ -12,8 +12,8 @@ and many Linux driver to support it.
"wavelan" driver (old ISA Wavelan)
----------------
o Config : Network device -> Wireless LAN -> AT&T WaveLAN
- o Location : .../drivers/net/wireless/wavelan*
- o in-line doc : .../drivers/net/wireless/wavelan.p.h
+ o Location : .../drivers/net/wavelan*
+ o in-line doc : .../drivers/net/wavelan.p.h
o on-line doc :
http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Wavelan.html
diff --git a/trunk/Documentation/nfsroot.txt b/trunk/Documentation/nfsroot.txt
index 31b329172343..9b956a969362 100644
--- a/trunk/Documentation/nfsroot.txt
+++ b/trunk/Documentation/nfsroot.txt
@@ -97,6 +97,10 @@ ip=::::::
autoconfiguration will take place. The most common way to use this
is "ip=dhcp".
+ Note that "ip=off" is not the same thing as "ip=::::::off", because in
+ the latter autoconfiguration will take place if any of DHCP, BOOTP or RARP
+ are compiled in the kernel.
+
IP address of the client.
Default: Determined using autoconfiguration.
@@ -145,9 +149,7 @@ ip=::::::
this option.
off or none: don't use autoconfiguration
- (do static IP assignment instead)
on or any: use any protocol available in the kernel
- (default)
dhcp: use DHCP
bootp: use BOOTP
rarp: use RARP
diff --git a/trunk/Documentation/watchdog/watchdog-api.txt b/trunk/Documentation/watchdog/watchdog-api.txt
index 4cc4ba9d7150..bb7cb1d31ec7 100644
--- a/trunk/Documentation/watchdog/watchdog-api.txt
+++ b/trunk/Documentation/watchdog/watchdog-api.txt
@@ -42,27 +42,23 @@ like this source file: see Documentation/watchdog/src/watchdog-simple.c
A more advanced driver could for example check that a HTTP server is
still responding before doing the write call to ping the watchdog.
-When the device is closed, the watchdog is disabled, unless the "Magic
-Close" feature is supported (see below). This is not always such a
-good idea, since if there is a bug in the watchdog daemon and it
-crashes the system will not reboot. Because of this, some of the
-drivers support the configuration option "Disable watchdog shutdown on
-close", CONFIG_WATCHDOG_NOWAYOUT. If it is set to Y when compiling
-the kernel, there is no way of disabling the watchdog once it has been
-started. So, if the watchdog daemon crashes, the system will reboot
-after the timeout has passed. Watchdog devices also usually support
-the nowayout module parameter so that this option can be controlled at
-runtime.
-
-Magic Close feature:
-
-If a driver supports "Magic Close", the driver will not disable the
-watchdog unless a specific magic character 'V' has been sent to
-/dev/watchdog just before closing the file. If the userspace daemon
-closes the file without sending this special character, the driver
-will assume that the daemon (and userspace in general) died, and will
-stop pinging the watchdog without disabling it first. This will then
-cause a reboot if the watchdog is not re-opened in sufficient time.
+When the device is closed, the watchdog is disabled. This is not
+always such a good idea, since if there is a bug in the watchdog
+daemon and it crashes the system will not reboot. Because of this,
+some of the drivers support the configuration option "Disable watchdog
+shutdown on close", CONFIG_WATCHDOG_NOWAYOUT. If it is set to Y when
+compiling the kernel, there is no way of disabling the watchdog once
+it has been started. So, if the watchdog daemon crashes, the system
+will reboot after the timeout has passed. Watchdog devices also usually
+support the nowayout module parameter so that this option can be controlled
+at runtime.
+
+Drivers will not disable the watchdog, unless a specific magic character 'V'
+has been sent /dev/watchdog just before closing the file. If the userspace
+daemon closes the file without sending this special character, the driver
+will assume that the daemon (and userspace in general) died, and will stop
+pinging the watchdog without disabling it first. This will then cause a
+reboot if the watchdog is not re-opened in sufficient time.
The ioctl API:
diff --git a/trunk/MAINTAINERS b/trunk/MAINTAINERS
index 2340cfb1e25d..3c7db6222f86 100644
--- a/trunk/MAINTAINERS
+++ b/trunk/MAINTAINERS
@@ -665,18 +665,12 @@ S: Maintained
ATMEL AT91 MCI DRIVER
P: Nicolas Ferre
-M: nicolas.ferre@atmel.com
+M: nicolas.ferre@rfo.atmel.com
L: linux-arm-kernel@lists.arm.linux.org.uk (subscribers-only)
W: http://www.atmel.com/products/AT91/
W: http://www.at91.com/
S: Maintained
-ATMEL LCDFB DRIVER
-P: Nicolas Ferre
-M: nicolas.ferre@atmel.com
-L: linux-fbdev-devel@lists.sourceforge.net (subscribers-only)
-S: Maintained
-
ATMEL MACB ETHERNET DRIVER
P: Haavard Skinnemoen
M: hskinnemoen@atmel.com
@@ -1876,10 +1870,8 @@ T: quilt kernel.org/pub/linux/kernel/people/bart/pata-2.6/
S: Maintained
IDE/ATAPI CDROM DRIVER
-P: Borislav Petkov
-M: bbpetkov@yahoo.de
L: linux-ide@vger.kernel.org
-S: Maintained
+S: Unmaintained
IDE/ATAPI FLOPPY DRIVERS
P: Paul Bristow
@@ -1925,7 +1917,7 @@ INFINIBAND SUBSYSTEM
P: Roland Dreier
M: rolandd@cisco.com
P: Sean Hefty
-M: sean.hefty@intel.com
+M: mshefty@ichips.intel.com
P: Hal Rosenstock
M: hal.rosenstock@gmail.com
L: general@lists.openfabrics.org
@@ -1990,27 +1982,29 @@ L: netdev@vger.kernel.org
S: Maintained
INTEL PRO/100 ETHERNET SUPPORT
-P: Auke Kok
-M: auke-jan.h.kok@intel.com
+P: John Ronciak
+M: john.ronciak@intel.com
P: Jesse Brandeburg
M: jesse.brandeburg@intel.com
P: Jeff Kirsher
M: jeffrey.t.kirsher@intel.com
-P: John Ronciak
-M: john.ronciak@intel.com
+P: Auke Kok
+M: auke-jan.h.kok@intel.com
L: e1000-devel@lists.sourceforge.net
W: http://sourceforge.net/projects/e1000/
S: Supported
INTEL PRO/1000 GIGABIT ETHERNET SUPPORT
-P: Auke Kok
-M: auke-jan.h.kok@intel.com
+P: Jeb Cramer
+M: cramerj@intel.com
+P: John Ronciak
+M: john.ronciak@intel.com
P: Jesse Brandeburg
M: jesse.brandeburg@intel.com
P: Jeff Kirsher
M: jeffrey.t.kirsher@intel.com
-P: John Ronciak
-M: john.ronciak@intel.com
+P: Auke Kok
+M: auke-jan.h.kok@intel.com
L: e1000-devel@lists.sourceforge.net
W: http://sourceforge.net/projects/e1000/
S: Supported
@@ -2035,7 +2029,7 @@ P: James Ketrenos
M: jketreno@linux.intel.com
L: linux-wireless@vger.kernel.org
L: ipw2100-devel@lists.sourceforge.net
-W: http://lists.sourceforge.net/mailman/listinfo/ipw2100-devel
+L: http://lists.sourceforge.net/mailman/listinfo/ipw2100-devel
W: http://ipw2100.sourceforge.net
S: Supported
@@ -2046,7 +2040,7 @@ P: James Ketrenos
M: jketreno@linux.intel.com
L: linux-wireless@vger.kernel.org
L: ipw2100-devel@lists.sourceforge.net
-W: http://lists.sourceforge.net/mailman/listinfo/ipw2100-devel
+L: http://lists.sourceforge.net/mailman/listinfo/ipw2100-devel
W: http://ipw2200.sourceforge.net
S: Supported
@@ -2603,7 +2597,7 @@ S: Maintained
MSI LAPTOP SUPPORT
P: Lennart Poettering
M: mzxreary@0pointer.de
-W: https://tango.0pointer.de/mailman/listinfo/s270-linux
+L: https://tango.0pointer.de/mailman/listinfo/s270-linux
W: http://0pointer.de/lennart/tchibo.html
S: Maintained
@@ -2745,8 +2739,8 @@ T: git kernel.org:/pub/scm/linux/kernel/git/linville/wireless-2.6.git
S: Maintained
NETXEN (1/10) GbE SUPPORT
-P: Dhananjay Phadke
-M: dhananjay@netxen.com
+P: Amit S. Kale
+M: amitkale@netxen.com
L: netdev@vger.kernel.org
W: http://www.netxen.com
S: Supported
@@ -3617,10 +3611,8 @@ L: linux-kernel@vger.kernel.org ?
S: Supported
SPIDERNET NETWORK DRIVER for CELL
-P: Ishizaki Kou
-M: kou.ishizaki@toshiba.co.jp
-P: Jens Osterkamp
-M: jens@de.ibm.com
+P: Linas Vepstas
+M: linas@austin.ibm.com
L: netdev@vger.kernel.org
S: Supported
@@ -4062,14 +4054,6 @@ L: user-mode-linux-user@lists.sourceforge.net
W: http://user-mode-linux.sourceforge.net
S: Maintained
-USERSPACE I/O (UIO)
-P: Hans J. Koch
-M: hjk@linutronix.de
-P: Greg Kroah-Hartman
-M: gregkh@suse.de
-L: linux-kernel@vger.kernel.org
-S: Maintained
-
FAT/VFAT/MSDOS FILESYSTEM:
P: OGAWA Hirofumi
M: hirofumi@mail.parknet.co.jp
diff --git a/trunk/Makefile b/trunk/Makefile
index ce641ebee25a..fbb8dfc063d3 100644
--- a/trunk/Makefile
+++ b/trunk/Makefile
@@ -1,7 +1,7 @@
VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 24
-EXTRAVERSION = -rc8
+EXTRAVERSION = -rc6
NAME = Arr Matey! A Hairy Bilge Rat!
# *DOCUMENTATION*
@@ -12,7 +12,7 @@ NAME = Arr Matey! A Hairy Bilge Rat!
# Do not:
# o use make's built-in rules and variables
-# (this increases performance and avoids hard-to-debug behaviour);
+# (this increases performance and avoid hard-to-debug behavour);
# o print "Entering directory ...";
MAKEFLAGS += -rR --no-print-directory
@@ -1329,7 +1329,7 @@ else
ALLINCLUDE_ARCHS := $(SRCARCH)
endif
else
-#Allow user to specify only ALLSOURCE_PATHS on the command line, keeping existing behaviour.
+#Allow user to specify only ALLSOURCE_PATHS on the command line, keeping existing behavour.
ALLINCLUDE_ARCHS := $(ALLSOURCE_ARCHS)
endif
diff --git a/trunk/arch/.gitignore b/trunk/arch/.gitignore
deleted file mode 100644
index 741468920320..000000000000
--- a/trunk/arch/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-i386
-x86_64
diff --git a/trunk/arch/alpha/math-emu/math.c b/trunk/arch/alpha/math-emu/math.c
index 58c2669a1dd4..ae79dd970b02 100644
--- a/trunk/arch/alpha/math-emu/math.c
+++ b/trunk/arch/alpha/math-emu/math.c
@@ -225,7 +225,7 @@ alpha_fp_emul (unsigned long pc)
FP_UNPACK_SP(SB, &vb);
DR_c = DB_c;
DR_s = DB_s;
- DR_e = DB_e + (1024 - 128);
+ DR_e = DB_e;
DR_f = SB_f << (52 - 23);
goto pack_d;
}
diff --git a/trunk/arch/arm/Kconfig b/trunk/arch/arm/Kconfig
index a04f507e7f2c..c4de2d4664d7 100644
--- a/trunk/arch/arm/Kconfig
+++ b/trunk/arch/arm/Kconfig
@@ -1072,13 +1072,11 @@ source "drivers/rtc/Kconfig"
source "drivers/dma/Kconfig"
-source "drivers/dca/Kconfig"
-
endmenu
source "fs/Kconfig"
-source "arch/arm/Kconfig.instrumentation"
+source "kernel/Kconfig.instrumentation"
source "arch/arm/Kconfig.debug"
diff --git a/trunk/arch/arm/Kconfig.instrumentation b/trunk/arch/arm/Kconfig.instrumentation
deleted file mode 100644
index 63b8c6d5606a..000000000000
--- a/trunk/arch/arm/Kconfig.instrumentation
+++ /dev/null
@@ -1,52 +0,0 @@
-menuconfig INSTRUMENTATION
- bool "Instrumentation Support"
- default y
- ---help---
- Say Y here to get to see options related to performance measurement,
- system-wide debugging, and testing. This option alone does not add any
- kernel code.
-
- If you say N, all options in this submenu will be skipped and
- disabled. If you're trying to debug the kernel itself, go see the
- Kernel Hacking menu.
-
-if INSTRUMENTATION
-
-config PROFILING
- bool "Profiling support (EXPERIMENTAL)"
- help
- Say Y here to enable the extended profiling support mechanisms used
- by profilers such as OProfile.
-
-config OPROFILE
- tristate "OProfile system profiling (EXPERIMENTAL)"
- depends on PROFILING && !UML
- help
- OProfile is a profiling system capable of profiling the
- whole system, include the kernel, kernel modules, libraries,
- and applications.
-
- If unsure, say N.
-
-config OPROFILE_ARMV6
- bool
- depends on OPROFILE && CPU_V6 && !SMP
- default y
- select OPROFILE_ARM11_CORE
-
-config OPROFILE_MPCORE
- bool
- depends on OPROFILE && CPU_V6 && SMP
- default y
- select OPROFILE_ARM11_CORE
-
-config OPROFILE_ARM11_CORE
- bool
-
-config MARKERS
- bool "Activate markers"
- help
- Place an empty function call at each marker site. Can be
- dynamically changed for a probe function.
-
-endif # INSTRUMENTATION
diff --git a/trunk/arch/arm/mach-at91/board-ek.c b/trunk/arch/arm/mach-at91/board-ek.c
index 53a5ef9e72ee..d05b1b2be9fb 100644
--- a/trunk/arch/arm/mach-at91/board-ek.c
+++ b/trunk/arch/arm/mach-at91/board-ek.c
@@ -109,15 +109,6 @@ static struct spi_board_info ek_spi_devices[] = {
#endif
};
-static struct i2c_board_info __initdata ek_i2c_devices[] = {
- {
- I2C_BOARD_INFO("ics1523", 0x26),
- },
- {
- I2C_BOARD_INFO("dac3550", 0x4d),
- }
-};
-
#define EK_FLASH_BASE AT91_CHIPSELECT_0
#define EK_FLASH_SIZE 0x200000
diff --git a/trunk/arch/arm/mach-omap1/board-fsample.c b/trunk/arch/arm/mach-omap1/board-fsample.c
index d5f6ea14fc7b..f65baa95986e 100644
--- a/trunk/arch/arm/mach-omap1/board-fsample.c
+++ b/trunk/arch/arm/mach-omap1/board-fsample.c
@@ -40,29 +40,31 @@ static int fsample_keymap[] = {
KEY(0,1,KEY_RIGHT),
KEY(0,2,KEY_LEFT),
KEY(0,3,KEY_DOWN),
- KEY(0,4,KEY_ENTER),
- KEY(1,0,KEY_F10),
+ KEY(0,4,KEY_CENTER),
+ KEY(0,5,KEY_0_5),
+ KEY(1,0,KEY_SOFT2),
KEY(1,1,KEY_SEND),
KEY(1,2,KEY_END),
KEY(1,3,KEY_VOLUMEDOWN),
KEY(1,4,KEY_VOLUMEUP),
KEY(1,5,KEY_RECORD),
- KEY(2,0,KEY_F9),
+ KEY(2,0,KEY_SOFT1),
KEY(2,1,KEY_3),
KEY(2,2,KEY_6),
KEY(2,3,KEY_9),
- KEY(2,4,KEY_KPDOT),
+ KEY(2,4,KEY_SHARP),
+ KEY(2,5,KEY_2_5),
KEY(3,0,KEY_BACK),
KEY(3,1,KEY_2),
KEY(3,2,KEY_5),
KEY(3,3,KEY_8),
KEY(3,4,KEY_0),
- KEY(3,5,KEY_KPSLASH),
+ KEY(3,5,KEY_HEADSETHOOK),
KEY(4,0,KEY_HOME),
KEY(4,1,KEY_1),
KEY(4,2,KEY_4),
KEY(4,3,KEY_7),
- KEY(4,4,KEY_KPASTERISK),
+ KEY(4,4,KEY_STAR),
KEY(4,5,KEY_POWER),
0
};
diff --git a/trunk/arch/arm/mach-omap1/board-nokia770.c b/trunk/arch/arm/mach-omap1/board-nokia770.c
index 182a98a9df4c..22db19a53647 100644
--- a/trunk/arch/arm/mach-omap1/board-nokia770.c
+++ b/trunk/arch/arm/mach-omap1/board-nokia770.c
@@ -36,6 +36,8 @@
#include
#include
+#include "../plat-omap/dsp/dsp_common.h"
+
#define ADS7846_PENDOWN_GPIO 15
static void __init omap_nokia770_init_irq(void)
@@ -316,8 +318,6 @@ static __init int omap_dsp_init(void)
out:
return ret;
}
-#else
-#define omap_dsp_init() do {} while (0)
#endif /* CONFIG_OMAP_DSP */
static void __init omap_nokia770_init(void)
diff --git a/trunk/arch/arm/mach-omap1/board-perseus2.c b/trunk/arch/arm/mach-omap1/board-perseus2.c
index e44437e10eef..1d5c8d509722 100644
--- a/trunk/arch/arm/mach-omap1/board-perseus2.c
+++ b/trunk/arch/arm/mach-omap1/board-perseus2.c
@@ -39,29 +39,31 @@ static int p2_keymap[] = {
KEY(0,1,KEY_RIGHT),
KEY(0,2,KEY_LEFT),
KEY(0,3,KEY_DOWN),
- KEY(0,4,KEY_ENTER),
- KEY(1,0,KEY_F10),
+ KEY(0,4,KEY_CENTER),
+ KEY(0,5,KEY_0_5),
+ KEY(1,0,KEY_SOFT2),
KEY(1,1,KEY_SEND),
KEY(1,2,KEY_END),
KEY(1,3,KEY_VOLUMEDOWN),
KEY(1,4,KEY_VOLUMEUP),
KEY(1,5,KEY_RECORD),
- KEY(2,0,KEY_F9),
+ KEY(2,0,KEY_SOFT1),
KEY(2,1,KEY_3),
KEY(2,2,KEY_6),
KEY(2,3,KEY_9),
- KEY(2,4,KEY_KPDOT),
+ KEY(2,4,KEY_SHARP),
+ KEY(2,5,KEY_2_5),
KEY(3,0,KEY_BACK),
KEY(3,1,KEY_2),
KEY(3,2,KEY_5),
KEY(3,3,KEY_8),
KEY(3,4,KEY_0),
- KEY(3,5,KEY_KPSLASH),
+ KEY(3,5,KEY_HEADSETHOOK),
KEY(4,0,KEY_HOME),
KEY(4,1,KEY_1),
KEY(4,2,KEY_4),
KEY(4,3,KEY_7),
- KEY(4,4,KEY_KPASTERISK),
+ KEY(4,4,KEY_STAR),
KEY(4,5,KEY_POWER),
0
};
diff --git a/trunk/arch/arm/mach-pxa/pxa25x.c b/trunk/arch/arm/mach-pxa/pxa25x.c
index 9732d5d9466b..dcd81f8d0833 100644
--- a/trunk/arch/arm/mach-pxa/pxa25x.c
+++ b/trunk/arch/arm/mach-pxa/pxa25x.c
@@ -178,19 +178,13 @@ static void pxa25x_cpu_pm_save(unsigned long *sleep_save)
SAVE(GAFR1_L); SAVE(GAFR1_U);
SAVE(GAFR2_L); SAVE(GAFR2_U);
- SAVE(ICMR); ICMR = 0;
+ SAVE(ICMR);
SAVE(CKEN);
SAVE(PSTR);
-
- /* Clear GPIO transition detect bits */
- GEDR0 = GEDR0; GEDR1 = GEDR1; GEDR2 = GEDR2;
}
static void pxa25x_cpu_pm_restore(unsigned long *sleep_save)
{
- /* ensure not to come back here if it wasn't intended */
- PSPR = 0;
-
/* restore registers */
RESTORE_GPLEVEL(0); RESTORE_GPLEVEL(1); RESTORE_GPLEVEL(2);
RESTORE(GPDR0); RESTORE(GPDR1); RESTORE(GPDR2);
@@ -201,12 +195,7 @@ static void pxa25x_cpu_pm_restore(unsigned long *sleep_save)
RESTORE(GFER0); RESTORE(GFER1); RESTORE(GFER2);
RESTORE(PGSR0); RESTORE(PGSR1); RESTORE(PGSR2);
- PSSR = PSSR_RDH | PSSR_PH;
-
RESTORE(CKEN);
-
- ICLR = 0;
- ICCR = 1;
RESTORE(ICMR);
RESTORE(PSTR);
}
diff --git a/trunk/arch/arm/mach-pxa/sleep.S b/trunk/arch/arm/mach-pxa/sleep.S
index d0447723b73a..aff71fec618a 100644
--- a/trunk/arch/arm/mach-pxa/sleep.S
+++ b/trunk/arch/arm/mach-pxa/sleep.S
@@ -43,11 +43,11 @@ pxa_cpu_save_cp:
pxa_cpu_save_sp:
@ preserve phys address of stack
mov r0, sp
- str lr, [sp, #-4]!
+ mov r2, lr
bl sleep_phys_sp
ldr r1, =sleep_save_sp
str r0, [r1]
- ldr pc, [sp], #4
+ mov pc, r2
/*
* pxa27x_cpu_suspend()
@@ -270,3 +270,5 @@ resume_after_mmu:
mar acc0, r2, r3
#endif
ldmfd sp!, {r4 - r12, pc} @ return to caller
+
+
diff --git a/trunk/arch/arm/vfp/vfp.h b/trunk/arch/arm/vfp/vfp.h
index 791d0238c68f..54a2ad6d9ca2 100644
--- a/trunk/arch/arm/vfp/vfp.h
+++ b/trunk/arch/arm/vfp/vfp.h
@@ -361,12 +361,10 @@ u32 vfp_estimate_sqrt_significand(u32 exponent, u32 significand);
* OP_SCALAR - this operation always operates in scalar mode
* OP_SD - the instruction exceptionally writes to a single precision result.
* OP_DD - the instruction exceptionally writes to a double precision result.
- * OP_SM - the instruction exceptionally reads from a single precision operand.
*/
#define OP_SCALAR (1 << 0)
#define OP_SD (1 << 1)
#define OP_DD (1 << 1)
-#define OP_SM (1 << 2)
struct op {
u32 (* const fn)(int dd, int dn, int dm, u32 fpscr);
diff --git a/trunk/arch/arm/vfp/vfpdouble.c b/trunk/arch/arm/vfp/vfpdouble.c
index 6cac43bd1d86..190a09ad18eb 100644
--- a/trunk/arch/arm/vfp/vfpdouble.c
+++ b/trunk/arch/arm/vfp/vfpdouble.c
@@ -668,8 +668,8 @@ static struct op fops_ext[32] = {
[FEXT_TO_IDX(FEXT_FCMPZ)] = { vfp_double_fcmpz, OP_SCALAR },
[FEXT_TO_IDX(FEXT_FCMPEZ)] = { vfp_double_fcmpez, OP_SCALAR },
[FEXT_TO_IDX(FEXT_FCVT)] = { vfp_double_fcvts, OP_SCALAR|OP_SD },
- [FEXT_TO_IDX(FEXT_FUITO)] = { vfp_double_fuito, OP_SCALAR|OP_SM },
- [FEXT_TO_IDX(FEXT_FSITO)] = { vfp_double_fsito, OP_SCALAR|OP_SM },
+ [FEXT_TO_IDX(FEXT_FUITO)] = { vfp_double_fuito, OP_SCALAR },
+ [FEXT_TO_IDX(FEXT_FSITO)] = { vfp_double_fsito, OP_SCALAR },
[FEXT_TO_IDX(FEXT_FTOUI)] = { vfp_double_ftoui, OP_SCALAR|OP_SD },
[FEXT_TO_IDX(FEXT_FTOUIZ)] = { vfp_double_ftouiz, OP_SCALAR|OP_SD },
[FEXT_TO_IDX(FEXT_FTOSI)] = { vfp_double_ftosi, OP_SCALAR|OP_SD },
@@ -1128,7 +1128,7 @@ u32 vfp_double_cpdo(u32 inst, u32 fpscr)
u32 exceptions = 0;
unsigned int dest;
unsigned int dn = vfp_get_dn(inst);
- unsigned int dm;
+ unsigned int dm = vfp_get_dm(inst);
unsigned int vecitr, veclen, vecstride;
struct op *fop;
@@ -1145,14 +1145,6 @@ u32 vfp_double_cpdo(u32 inst, u32 fpscr)
else
dest = vfp_get_dd(inst);
- /*
- * f[us]ito takes a sN operand, not a dN operand.
- */
- if (fop->flags & OP_SM)
- dm = vfp_get_sm(inst);
- else
- dm = vfp_get_dm(inst);
-
/*
* If destination bank is zero, vector length is always '1'.
* ARM DDI0100F C5.1.3, C5.3.2.
diff --git a/trunk/arch/blackfin/Kconfig b/trunk/arch/blackfin/Kconfig
index 25232ba08119..2a3a7ea5958c 100644
--- a/trunk/arch/blackfin/Kconfig
+++ b/trunk/arch/blackfin/Kconfig
@@ -65,10 +65,6 @@ config GENERIC_CALIBRATE_DELAY
bool
default y
-config HARDWARE_PM
- def_bool y
- depends on OPROFILE
-
source "init/Kconfig"
source "kernel/Kconfig.preempt"
diff --git a/trunk/arch/cris/arch-v10/drivers/ds1302.c b/trunk/arch/cris/arch-v10/drivers/ds1302.c
index 1d1936a18133..88eff7f54ea6 100644
--- a/trunk/arch/cris/arch-v10/drivers/ds1302.c
+++ b/trunk/arch/cris/arch-v10/drivers/ds1302.c
@@ -6,9 +6,136 @@
*!
*! Functions exported: ds1302_readreg, ds1302_writereg, ds1302_init
*!
+*! $Log: ds1302.c,v $
+*! Revision 1.18 2005/01/24 09:11:26 mikaelam
+*! Minor changes to get DS1302 RTC chip driver to work
+*!
+*! Revision 1.17 2005/01/05 06:11:22 starvik
+*! No need to do local_irq_disable after local_irq_save.
+*!
+*! Revision 1.16 2004/12/13 12:21:52 starvik
+*! Added I/O and DMA allocators from Linux 2.4
+*!
+*! Revision 1.14 2004/08/24 06:48:43 starvik
+*! Whitespace cleanup
+*!
+*! Revision 1.13 2004/05/28 09:26:59 starvik
+*! Modified I2C initialization to work in 2.6.
+*!
+*! Revision 1.12 2004/05/14 07:58:03 starvik
+*! Merge of changes from 2.4
+*!
+*! Revision 1.10 2004/02/04 09:25:12 starvik
+*! Merge of Linux 2.6.2
+*!
+*! Revision 1.9 2003/07/04 08:27:37 starvik
+*! Merge of Linux 2.5.74
+*!
+*! Revision 1.8 2003/04/09 05:20:47 starvik
+*! Merge of Linux 2.5.67
+*!
+*! Revision 1.6 2003/01/09 14:42:51 starvik
+*! Merge of Linux 2.5.55
+*!
+*! Revision 1.4 2002/12/11 13:13:57 starvik
+*! Added arch/ to v10 specific includes
+*! Added fix from Linux 2.4 in serial.c (flush_to_flip_buffer)
+*!
+*! Revision 1.3 2002/11/20 11:56:10 starvik
+*! Merge of Linux 2.5.48
+*!
+*! Revision 1.2 2002/11/18 13:16:06 starvik
+*! Linux 2.5 port of latest 2.4 drivers
+*!
+*! Revision 1.15 2002/10/11 16:14:33 johana
+*! Added CONFIG_ETRAX_DS1302_TRICKLE_CHARGE and initial setting of the
+*! trcklecharge register.
+*!
+*! Revision 1.14 2002/10/10 12:15:38 magnusmn
+*! Added support for having the RST signal on bit g0
+*!
+*! Revision 1.13 2002/05/29 15:16:08 johana
+*! Removed unused variables.
+*!
+*! Revision 1.12 2002/04/10 15:35:25 johana
+*! Moved probe function closer to init function and marked it __init.
+*!
+*! Revision 1.11 2001/06/14 12:35:52 jonashg
+*! The ATA hack is back. It is unfortunately the only way to set g27 to output.
+*!
+*! Revision 1.9 2001/06/14 10:00:14 jonashg
+*! No need for tempudelay to be inline anymore (had to adjust the usec to
+*! loops conversion because of this to make it slow enough to be a udelay).
+*!
+*! Revision 1.8 2001/06/14 08:06:32 jonashg
+*! Made tempudelay delay usecs (well, just a tad more).
+*!
+*! Revision 1.7 2001/06/13 14:18:11 jonashg
+*! Only allow processes with SYS_TIME capability to set time and charge.
+*!
+*! Revision 1.6 2001/06/12 15:22:07 jonashg
+*! * Made init function __init.
+*! * Parameter to out_byte() is unsigned char.
+*! * The magic number 42 has got a name.
+*! * Removed comment about /proc (nothing is exported there).
+*!
+*! Revision 1.5 2001/06/12 14:35:13 jonashg
+*! Gave the module a name and added it to printk's.
+*!
+*! Revision 1.4 2001/05/31 14:53:40 jonashg
+*! Made tempudelay() inline so that the watchdog doesn't reset (see
+*! function comment).
+*!
+*! Revision 1.3 2001/03/26 16:03:06 bjornw
+*! Needs linux/config.h
+*!
+*! Revision 1.2 2001/03/20 19:42:00 bjornw
+*! Use the ETRAX prefix on the DS1302 options
+*!
+*! Revision 1.1 2001/03/20 09:13:50 magnusmn
+*! Linux 2.4 port
+*!
+*! Revision 1.10 2000/07/05 15:38:23 bjornw
+*! Dont update kernel time when a RTC_SET_TIME is done
+*!
+*! Revision 1.9 2000/03/02 15:42:59 macce
+*! * Hack to make RTC work on all 2100/2400
+*!
+*! Revision 1.8 2000/02/23 16:59:18 torbjore
+*! added setup of R_GEN_CONFIG when RTC is connected to the generic port.
+*!
+*! Revision 1.7 2000/01/17 15:51:43 johana
+*! Added RTC_SET_CHARGE ioctl to enable trickle charger.
+*!
+*! Revision 1.6 1999/10/27 13:19:47 bjornw
+*! Added update_xtime_from_cmos which reads back the updated RTC into the kernel.
+*! /dev/rtc calls it now.
+*!
+*! Revision 1.5 1999/10/27 12:39:37 bjornw
+*! Disabled superuser check. Anyone can now set the time.
+*!
+*! Revision 1.4 1999/09/02 13:27:46 pkj
+*! Added shadow for R_PORT_PB_CONFIG.
+*! Renamed port_g_shadow to port_g_data_shadow.
+*!
+*! Revision 1.3 1999/09/02 08:28:06 pkj
+*! Made it possible to select either port PB or the generic port for the RST
+*! signal line to the DS1302 RTC.
+*! Also make sure the RST bit is configured as output on Port PB (if used).
+*!
+*! Revision 1.2 1999/09/01 14:47:20 bjornw
+*! Added support for /dev/rtc operations with ioctl RD_TIME and SET_TIME to read
+*! and set the date. Register as major 121.
+*!
+*! Revision 1.1 1999/09/01 09:45:29 bjornw
+*! Implemented a DS1302 RTC driver.
+*!
+*!
*! ---------------------------------------------------------------------------
*!
-*! (C) Copyright 1999-2007 Axis Communications AB, LUND, SWEDEN
+*! (C) Copyright 1999, 2000, 2001, 2002, 2003, 2004 Axis Communications AB, LUND, SWEDEN
+*!
+*! $Id: ds1302.c,v 1.18 2005/01/24 09:11:26 mikaelam Exp $
*!
*!***************************************************************************/
@@ -29,8 +156,6 @@
#include
#include
-#include "i2c.h"
-
#define RTC_MAJOR_NR 121 /* local major, change later */
static const char ds1302_name[] = "ds1302";
diff --git a/trunk/arch/cris/arch-v10/kernel/io_interface_mux.c b/trunk/arch/cris/arch-v10/kernel/io_interface_mux.c
index f3b327d4ed9c..3a9114e89edf 100644
--- a/trunk/arch/cris/arch-v10/kernel/io_interface_mux.c
+++ b/trunk/arch/cris/arch-v10/kernel/io_interface_mux.c
@@ -392,7 +392,6 @@ int cris_request_io_interface(enum cris_io_interface ioif, const char *device_id
if (((interfaces[ioif].gpio_g_in & gpio_in_pins) != interfaces[ioif].gpio_g_in) ||
((interfaces[ioif].gpio_g_out & gpio_out_pins) != interfaces[ioif].gpio_g_out) ||
((interfaces[ioif].gpio_b & gpio_pb_pins) != interfaces[ioif].gpio_b)) {
- local_irq_restore(flags);
printk(KERN_CRIT "cris_request_io_interface: Could not get required pins for interface %u\n",
ioif);
return -EBUSY;
diff --git a/trunk/arch/cris/arch-v10/kernel/signal.c b/trunk/arch/cris/arch-v10/kernel/signal.c
index b6be705c2a3e..41d4a5f93284 100644
--- a/trunk/arch/cris/arch-v10/kernel/signal.c
+++ b/trunk/arch/cris/arch-v10/kernel/signal.c
@@ -7,7 +7,7 @@
*
* Ideas also taken from arch/arm.
*
- * Copyright (C) 2000-2007 Axis Communications AB
+ * Copyright (C) 2000, 2001 Axis Communications AB
*
* Authors: Bjorn Wesen (bjornw@axis.com)
*
@@ -40,30 +40,84 @@
*/
#define RESTART_CRIS_SYS(regs) regs->r10 = regs->orig_r10; regs->irp -= 2;
-void do_signal(int canrestart, struct pt_regs *regs);
+int do_signal(int canrestart, sigset_t *oldset, struct pt_regs *regs);
/*
- * Atomically swap in the new signal mask, and wait for a signal. Define
+ * Atomically swap in the new signal mask, and wait for a signal. Define
* dummy arguments to be able to reach the regs argument. (Note that this
* arrangement relies on old_sigset_t occupying one register.)
*/
-int sys_sigsuspend(old_sigset_t mask, long r11, long r12, long r13, long mof,
- long srp, struct pt_regs *regs)
+int
+sys_sigsuspend(old_sigset_t mask, long r11, long r12, long r13, long mof,
+ long srp, struct pt_regs *regs)
{
+ sigset_t saveset;
+
mask &= _BLOCKABLE;
spin_lock_irq(¤t->sighand->siglock);
- current->saved_sigmask = current->blocked;
+ saveset = current->blocked;
siginitset(¤t->blocked, mask);
recalc_sigpending();
spin_unlock_irq(¤t->sighand->siglock);
- current->state = TASK_INTERRUPTIBLE;
- schedule();
- set_thread_flag(TIF_RESTORE_SIGMASK);
- return -ERESTARTNOHAND;
+
+ regs->r10 = -EINTR;
+ while (1) {
+ current->state = TASK_INTERRUPTIBLE;
+ schedule();
+ if (do_signal(0, &saveset, regs))
+ /* We will get here twice: once to call the signal
+ handler, then again to return from the
+ sigsuspend system call. When calling the
+ signal handler, R10 holds the signal number as
+ set through do_signal. The sigsuspend call
+ will return with the restored value set above;
+ always -EINTR. */
+ return regs->r10;
+ }
}
-int sys_sigaction(int sig, const struct old_sigaction __user *act,
- struct old_sigaction *oact)
+/* Define dummy arguments to be able to reach the regs argument. (Note that
+ * this arrangement relies on size_t occupying one register.)
+ */
+int
+sys_rt_sigsuspend(sigset_t *unewset, size_t sigsetsize, long r12, long r13,
+ long mof, long srp, struct pt_regs *regs)
+{
+ sigset_t saveset, newset;
+
+ /* XXX: Don't preclude handling different sized sigset_t's. */
+ if (sigsetsize != sizeof(sigset_t))
+ return -EINVAL;
+
+ if (copy_from_user(&newset, unewset, sizeof(newset)))
+ return -EFAULT;
+ sigdelsetmask(&newset, ~_BLOCKABLE);
+
+ spin_lock_irq(¤t->sighand->siglock);
+ saveset = current->blocked;
+ current->blocked = newset;
+ recalc_sigpending();
+ spin_unlock_irq(¤t->sighand->siglock);
+
+ regs->r10 = -EINTR;
+ while (1) {
+ current->state = TASK_INTERRUPTIBLE;
+ schedule();
+ if (do_signal(0, &saveset, regs))
+ /* We will get here twice: once to call the signal
+ handler, then again to return from the
+ sigsuspend system call. When calling the
+ signal handler, R10 holds the signal number as
+ set through do_signal. The sigsuspend call
+ will return with the restored value set above;
+ always -EINTR. */
+ return regs->r10;
+ }
+}
+
+int
+sys_sigaction(int sig, const struct old_sigaction __user *act,
+ struct old_sigaction *oact)
{
struct k_sigaction new_ka, old_ka;
int ret;
@@ -93,7 +147,8 @@ int sys_sigaction(int sig, const struct old_sigaction __user *act,
return ret;
}
-int sys_sigaltstack(const stack_t *uss, stack_t __user *uoss)
+int
+sys_sigaltstack(const stack_t *uss, stack_t __user *uoss)
{
return do_sigaltstack(uss, uoss, rdusp());
}
@@ -150,7 +205,7 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc)
/* TODO: the other ports use regs->orig_XX to disable syscall checks
* after this completes, but we don't use that mechanism. maybe we can
- * use it now ?
+ * use it now ?
*/
return err;
@@ -161,7 +216,7 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc)
/* Define dummy arguments to be able to reach the regs argument. */
-asmlinkage int sys_sigreturn(long r10, long r11, long r12, long r13, long mof,
+asmlinkage int sys_sigreturn(long r10, long r11, long r12, long r13, long mof,
long srp, struct pt_regs *regs)
{
struct sigframe __user *frame = (struct sigframe *)rdusp();
@@ -188,7 +243,7 @@ asmlinkage int sys_sigreturn(long r10, long r11, long r12, long r13, long mof,
current->blocked = set;
recalc_sigpending();
spin_unlock_irq(¤t->sighand->siglock);
-
+
if (restore_sigcontext(regs, &frame->sc))
goto badframe;
@@ -199,11 +254,11 @@ asmlinkage int sys_sigreturn(long r10, long r11, long r12, long r13, long mof,
badframe:
force_sig(SIGSEGV, current);
return 0;
-}
+}
/* Define dummy arguments to be able to reach the regs argument. */
-asmlinkage int sys_rt_sigreturn(long r10, long r11, long r12, long r13,
+asmlinkage int sys_rt_sigreturn(long r10, long r11, long r12, long r13,
long mof, long srp, struct pt_regs *regs)
{
struct rt_sigframe __user *frame = (struct rt_sigframe *)rdusp();
@@ -227,7 +282,7 @@ asmlinkage int sys_rt_sigreturn(long r10, long r11, long r12, long r13,
current->blocked = set;
recalc_sigpending();
spin_unlock_irq(¤t->sighand->siglock);
-
+
if (restore_sigcontext(regs, &frame->uc.uc_mcontext))
goto badframe;
@@ -239,14 +294,14 @@ asmlinkage int sys_rt_sigreturn(long r10, long r11, long r12, long r13,
badframe:
force_sig(SIGSEGV, current);
return 0;
-}
+}
/*
* Set up a signal frame.
*/
-static int setup_sigcontext(struct sigcontext __user *sc,
- struct pt_regs *regs, unsigned long mask)
+static int
+setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs, unsigned long mask)
{
int err = 0;
unsigned long usp = rdusp();
@@ -269,11 +324,10 @@ static int setup_sigcontext(struct sigcontext __user *sc,
return err;
}
-/* Figure out where we want to put the new signal frame
- * - usually on the stack. */
+/* figure out where we want to put the new signal frame - usually on the stack */
static inline void __user *
-get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size)
+get_sigframe(struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size)
{
unsigned long sp = rdusp();
@@ -291,15 +345,15 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size)
}
/* grab and setup a signal frame.
- *
+ *
* basically we stack a lot of state info, and arrange for the
* user-mode program to return to the kernel using either a
* trampoline which performs the syscall sigreturn, or a provided
* user-mode trampoline.
*/
-static int setup_frame(int sig, struct k_sigaction *ka,
- sigset_t *set, struct pt_regs *regs)
+static void setup_frame(int sig, struct k_sigaction *ka,
+ sigset_t *set, struct pt_regs * regs)
{
struct sigframe __user *frame;
unsigned long return_ip;
@@ -347,15 +401,14 @@ static int setup_frame(int sig, struct k_sigaction *ka,
wrusp((unsigned long)frame);
- return 0;
+ return;
give_sigsegv:
force_sigsegv(sig, current);
- return -EFAULT;
}
-static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
- sigset_t *set, struct pt_regs *regs)
+static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
+ sigset_t *set, struct pt_regs * regs)
{
struct rt_sigframe __user *frame;
unsigned long return_ip;
@@ -390,10 +443,9 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
/* trampoline - the desired return ip is the retcode itself */
return_ip = (unsigned long)&frame->retcode;
/* This is movu.w __NR_rt_sigreturn, r9; break 13; */
- err |= __put_user(0x9c5f, (short __user *)(frame->retcode+0));
- err |= __put_user(__NR_rt_sigreturn,
- (short __user *)(frame->retcode+2));
- err |= __put_user(0xe93d, (short __user *)(frame->retcode+4));
+ err |= __put_user(0x9c5f, (short __user*)(frame->retcode+0));
+ err |= __put_user(__NR_rt_sigreturn, (short __user*)(frame->retcode+2));
+ err |= __put_user(0xe93d, (short __user*)(frame->retcode+4));
}
if (err)
@@ -403,81 +455,73 @@ static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
/* Set up registers for signal handler */
- /* What we enter NOW */
- regs->irp = (unsigned long) ka->sa.sa_handler;
- /* What we enter LATER */
- regs->srp = return_ip;
- /* First argument is signo */
- regs->r10 = sig;
- /* Second argument is (siginfo_t *) */
- regs->r11 = (unsigned long)&frame->info;
- /* Third argument is unused */
- regs->r12 = 0;
-
- /* Actually move the usp to reflect the stacked frame */
+ regs->irp = (unsigned long) ka->sa.sa_handler; /* what we enter NOW */
+ regs->srp = return_ip; /* what we enter LATER */
+ regs->r10 = sig; /* first argument is signo */
+ regs->r11 = (unsigned long) &frame->info; /* second argument is (siginfo_t *) */
+ regs->r12 = 0; /* third argument is unused */
+
+ /* actually move the usp to reflect the stacked frame */
+
wrusp((unsigned long)frame);
- return 0;
+ return;
give_sigsegv:
force_sigsegv(sig, current);
- return -EFAULT;
}
/*
* OK, we're invoking a handler
- */
+ */
-static inline int handle_signal(int canrestart, unsigned long sig,
- siginfo_t *info, struct k_sigaction *ka,
- sigset_t *oldset, struct pt_regs *regs)
+static inline void
+handle_signal(int canrestart, unsigned long sig,
+ siginfo_t *info, struct k_sigaction *ka,
+ sigset_t *oldset, struct pt_regs * regs)
{
- int ret;
-
/* Are we from a system call? */
if (canrestart) {
/* If so, check system call restarting.. */
switch (regs->r10) {
- case -ERESTART_RESTARTBLOCK:
- case -ERESTARTNOHAND:
- /* ERESTARTNOHAND means that the syscall should
- * only be restarted if there was no handler for
- * the signal, and since we only get here if there
- * is a handler, we don't restart */
- regs->r10 = -EINTR;
- break;
- case -ERESTARTSYS:
- /* ERESTARTSYS means to restart the syscall if
- * there is no handler or the handler was
- * registered with SA_RESTART */
- if (!(ka->sa.sa_flags & SA_RESTART)) {
+ case -ERESTART_RESTARTBLOCK:
+ case -ERESTARTNOHAND:
+ /* ERESTARTNOHAND means that the syscall should only be
+ restarted if there was no handler for the signal, and since
+ we only get here if there is a handler, we don't restart */
regs->r10 = -EINTR;
break;
- }
- /* fallthrough */
- case -ERESTARTNOINTR:
- /* ERESTARTNOINTR means that the syscall should
- * be called again after the signal handler returns. */
- RESTART_CRIS_SYS(regs);
+
+ case -ERESTARTSYS:
+ /* ERESTARTSYS means to restart the syscall if there is no
+ handler or the handler was registered with SA_RESTART */
+ if (!(ka->sa.sa_flags & SA_RESTART)) {
+ regs->r10 = -EINTR;
+ break;
+ }
+ /* fallthrough */
+ case -ERESTARTNOINTR:
+ /* ERESTARTNOINTR means that the syscall should be called again
+ after the signal handler returns. */
+ RESTART_CRIS_SYS(regs);
}
}
/* Set up the stack frame */
if (ka->sa.sa_flags & SA_SIGINFO)
- ret = setup_rt_frame(sig, ka, info, oldset, regs);
+ setup_rt_frame(sig, ka, info, oldset, regs);
else
- ret = setup_frame(sig, ka, oldset, regs);
-
- if (ret == 0) {
- spin_lock_irq(¤t->sighand->siglock);
- sigorsets(¤t->blocked, ¤t->blocked,
- &ka->sa.sa_mask);
- if (!(ka->sa.sa_flags & SA_NODEFER))
- sigaddset(¤t->blocked, sig);
- recalc_sigpending();
- spin_unlock_irq(¤t->sighand->siglock);
- }
- return ret;
+ setup_frame(sig, ka, oldset, regs);
+
+ if (ka->sa.sa_flags & SA_ONESHOT)
+ ka->sa.sa_handler = SIG_DFL;
+
+ spin_lock_irq(¤t->sighand->siglock);
+ sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask);
+ if (!(ka->sa.sa_flags & SA_NODEFER))
+ sigaddset(¤t->blocked,sig);
+ recalc_sigpending();
+ spin_unlock_irq(¤t->sighand->siglock);
}
/*
@@ -492,12 +536,11 @@ static inline int handle_signal(int canrestart, unsigned long sig,
* mode below.
*/
-void do_signal(int canrestart, struct pt_regs *regs)
+int do_signal(int canrestart, sigset_t *oldset, struct pt_regs *regs)
{
siginfo_t info;
int signr;
struct k_sigaction ka;
- sigset_t *oldset;
/*
* We want the common case to go fast, which
@@ -506,26 +549,16 @@ void do_signal(int canrestart, struct pt_regs *regs)
* if so.
*/
if (!user_mode(regs))
- return;
+ return 1;
- if (test_thread_flag(TIF_RESTORE_SIGMASK))
- oldset = ¤t->saved_sigmask;
- else
+ if (!oldset)
oldset = ¤t->blocked;
signr = get_signal_to_deliver(&info, &ka, regs, NULL);
if (signr > 0) {
/* Whee! Actually deliver the signal. */
- if (handle_signal(canrestart, signr, &info, &ka,
- oldset, regs)) {
- /* a signal was successfully delivered; the saved
- * sigmask will have been stored in the signal frame,
- * and will be restored by sigreturn, so we can simply
- * clear the TIF_RESTORE_SIGMASK flag */
- if (test_thread_flag(TIF_RESTORE_SIGMASK))
- clear_thread_flag(TIF_RESTORE_SIGMASK);
- }
- return;
+ handle_signal(canrestart, signr, &info, &ka, oldset, regs);
+ return 1;
}
/* Did we come from a system call? */
@@ -536,16 +569,10 @@ void do_signal(int canrestart, struct pt_regs *regs)
regs->r10 == -ERESTARTNOINTR) {
RESTART_CRIS_SYS(regs);
}
- if (regs->r10 == -ERESTART_RESTARTBLOCK) {
+ if (regs->r10 == -ERESTART_RESTARTBLOCK){
regs->r10 = __NR_restart_syscall;
regs->irp -= 2;
}
}
-
- /* if there's no signal to deliver, we just put the saved sigmask
- * back */
- if (test_thread_flag(TIF_RESTORE_SIGMASK)) {
- clear_thread_flag(TIF_RESTORE_SIGMASK);
- sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL);
- }
+ return 0;
}
diff --git a/trunk/arch/cris/arch-v10/kernel/time.c b/trunk/arch/cris/arch-v10/kernel/time.c
index 9310a7b476e9..5976f6199c47 100644
--- a/trunk/arch/cris/arch-v10/kernel/time.c
+++ b/trunk/arch/cris/arch-v10/kernel/time.c
@@ -13,7 +13,6 @@
#include
#include
#include
-#include
#include
#include
#include
diff --git a/trunk/arch/cris/arch-v10/vmlinux.lds.S b/trunk/arch/cris/arch-v10/vmlinux.lds.S
index 97a7876ed681..9859d49d088b 100644
--- a/trunk/arch/cris/arch-v10/vmlinux.lds.S
+++ b/trunk/arch/cris/arch-v10/vmlinux.lds.S
@@ -9,8 +9,7 @@
*/
#include
-#include
-
+
jiffies = jiffies_64;
SECTIONS
{
@@ -24,7 +23,7 @@ SECTIONS
_stext = .;
__stext = .;
.text : {
- TEXT_TEXT
+ *(.text)
SCHED_TEXT
LOCK_TEXT
*(.fixup)
@@ -50,10 +49,10 @@ SECTIONS
__edata = . ; /* End of data section */
_edata = . ;
- . = ALIGN(PAGE_SIZE); /* init_task and stack, must be aligned */
+ . = ALIGN(8192); /* init_task and stack, must be aligned */
.data.init_task : { *(.data.init_task) }
- . = ALIGN(PAGE_SIZE); /* Init code and data */
+ . = ALIGN(8192); /* Init code and data */
__init_begin = .;
.init.text : {
_sinittext = .;
@@ -67,7 +66,13 @@ SECTIONS
__setup_end = .;
.initcall.init : {
__initcall_start = .;
- INITCALLS
+ *(.initcall1.init);
+ *(.initcall2.init);
+ *(.initcall3.init);
+ *(.initcall4.init);
+ *(.initcall5.init);
+ *(.initcall6.init);
+ *(.initcall7.init);
__initcall_end = .;
}
@@ -83,18 +88,16 @@ SECTIONS
__initramfs_start = .;
*(.init.ramfs)
__initramfs_end = .;
+ /* We fill to the next page, so we can discard all init
+ pages without needing to consider what payload might be
+ appended to the kernel image. */
+ FILL (0);
+ . = ALIGN (8192);
}
#endif
+
__vmlinux_end = .; /* last address of the physical file */
-
- /*
- * We fill to the next page, so we can discard all init
- * pages without needing to consider what payload might be
- * appended to the kernel image.
- */
- . = ALIGN(PAGE_SIZE);
-
- __init_end = .;
+ __init_end = .;
__data_end = . ; /* Move to _edata ? */
__bss_start = .; /* BSS */
diff --git a/trunk/arch/ia64/kernel/unaligned.c b/trunk/arch/ia64/kernel/unaligned.c
index f6a1aeb742b3..2173de9fe917 100644
--- a/trunk/arch/ia64/kernel/unaligned.c
+++ b/trunk/arch/ia64/kernel/unaligned.c
@@ -1488,17 +1488,14 @@ ia64_handle_unaligned (unsigned long ifa, struct pt_regs *regs)
case LDFA_OP:
case LDFCCLR_OP:
case LDFCNC_OP:
- if (u.insn.x)
- ret = emulate_load_floatpair(ifa, u.insn, regs);
- else
- ret = emulate_load_float(ifa, u.insn, regs);
- break;
-
case LDF_IMM_OP:
case LDFA_IMM_OP:
case LDFCCLR_IMM_OP:
case LDFCNC_IMM_OP:
- ret = emulate_load_float(ifa, u.insn, regs);
+ if (u.insn.x)
+ ret = emulate_load_floatpair(ifa, u.insn, regs);
+ else
+ ret = emulate_load_float(ifa, u.insn, regs);
break;
case STF_OP:
diff --git a/trunk/arch/ia64/sn/kernel/xp_nofault.S b/trunk/arch/ia64/sn/kernel/xp_nofault.S
index 98e7c7dbfdd8..54e8973b6e99 100644
--- a/trunk/arch/ia64/sn/kernel/xp_nofault.S
+++ b/trunk/arch/ia64/sn/kernel/xp_nofault.S
@@ -3,7 +3,7 @@
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
- * Copyright (c) 2004-2007 Silicon Graphics, Inc. All Rights Reserved.
+ * Copyright (c) 2004-2005 Silicon Graphics, Inc. All Rights Reserved.
*/
@@ -14,11 +14,6 @@
* PIO read fails, the MCA handler will force the error to look
* corrected and vector to the xp_error_PIOR which will return an error.
*
- * The definition of "consumption" and the time it takes for an MCA
- * to surface is processor implementation specific. This code
- * is sufficient on Itanium through the Montvale processor family.
- * It may need to be adjusted for future processor implementations.
- *
* extern int xp_nofault_PIOR(void *remote_register);
*/
@@ -27,10 +22,11 @@ xp_nofault_PIOR:
mov r8=r0 // Stage a success return value
ld8.acq r9=[r32];; // PIO Read the specified register
adds r9=1,r9;; // Add to force consumption
- srlz.i;; // Allow time for MCA to surface
+ or r9=r9,r9;; // Or to force consumption
br.ret.sptk.many b0;; // Return success
.global xp_error_PIOR
xp_error_PIOR:
mov r8=1 // Return value of 1
br.ret.sptk.many b0;; // Return failure
+
diff --git a/trunk/arch/mips/Kconfig b/trunk/arch/mips/Kconfig
index b22c043b6ef8..c6fc405a6c8e 100644
--- a/trunk/arch/mips/Kconfig
+++ b/trunk/arch/mips/Kconfig
@@ -59,8 +59,6 @@ config BCM47XX
select SYS_SUPPORTS_LITTLE_ENDIAN
select SSB
select SSB_DRIVER_MIPS
- select SSB_DRIVER_EXTIF
- select SSB_PCICORE_HOSTMODE if PCI
select GENERIC_GPIO
select SYS_HAS_EARLY_PRINTK
select CFE
@@ -994,6 +992,8 @@ config BOOT_ELF64
menu "CPU selection"
+source "kernel/time/Kconfig"
+
choice
prompt "CPU type"
default CPU_R4X00
@@ -1768,8 +1768,6 @@ config NR_CPUS
performance should round up your number of processors to the next
power of two.
-source "kernel/time/Kconfig"
-
#
# Timer Interrupt Frequency Configuration
#
diff --git a/trunk/arch/mips/au1000/common/pci.c b/trunk/arch/mips/au1000/common/pci.c
index ce771487567d..6fa70a36a250 100644
--- a/trunk/arch/mips/au1000/common/pci.c
+++ b/trunk/arch/mips/au1000/common/pci.c
@@ -1,8 +1,8 @@
/*
* BRIEF MODULE DESCRIPTION
- * Alchemy/AMD Au1x00 PCI support.
+ * Alchemy/AMD Au1x00 pci support.
*
- * Copyright 2001-2003, 2007 MontaVista Software Inc.
+ * Copyright 2001,2002,2003 MontaVista Software Inc.
* Author: MontaVista Software, Inc.
* ppopov@mvista.com or source@mvista.com
*
@@ -66,8 +66,6 @@ static unsigned long virt_io_addr;
static int __init au1x_pci_setup(void)
{
- extern void au1x_pci_cfg_init(void);
-
#if defined(CONFIG_SOC_AU1500) || defined(CONFIG_SOC_AU1550)
virt_io_addr = (unsigned long)ioremap(Au1500_PCI_IO_START,
Au1500_PCI_IO_END - Au1500_PCI_IO_START + 1);
@@ -96,8 +94,6 @@ static int __init au1x_pci_setup(void)
set_io_port_base(virt_io_addr);
#endif
- au1x_pci_cfg_init();
-
register_pci_controller(&au1x_controller);
return 0;
}
diff --git a/trunk/arch/mips/cobalt/console.c b/trunk/arch/mips/cobalt/console.c
index d1ba701c9dd1..db330e811025 100644
--- a/trunk/arch/mips/cobalt/console.c
+++ b/trunk/arch/mips/cobalt/console.c
@@ -4,15 +4,10 @@
#include
#include
-#include
-
#define UART_BASE ((void __iomem *)CKSEG1ADDR(0x1c800000))
void prom_putchar(char c)
{
- if (cobalt_board_id <= COBALT_BRD_ID_QUBE1)
- return;
-
while (!(readb(UART_BASE + UART_LSR) & UART_LSR_THRE))
;
diff --git a/trunk/arch/mips/kernel/head.S b/trunk/arch/mips/kernel/head.S
index 50be56c9e9ef..236768731063 100644
--- a/trunk/arch/mips/kernel/head.S
+++ b/trunk/arch/mips/kernel/head.S
@@ -136,8 +136,7 @@ EXPORT(_stext)
* kernel load address. This is needed because this platform does
* not have a ELF loader yet.
*/
-FEXPORT(__kernel_entry)
- j kernel_entry
+ __INIT
#endif
__INIT_REFOK
diff --git a/trunk/arch/mips/kernel/setup.c b/trunk/arch/mips/kernel/setup.c
index f8a535afce39..7f6ddcb5d485 100644
--- a/trunk/arch/mips/kernel/setup.c
+++ b/trunk/arch/mips/kernel/setup.c
@@ -269,7 +269,7 @@ static void __init bootmem_init(void)
static void __init bootmem_init(void)
{
- unsigned long reserved_end;
+ unsigned long init_begin, reserved_end;
unsigned long mapstart = ~0UL;
unsigned long bootmap_size;
int i;
@@ -344,6 +344,7 @@ static void __init bootmem_init(void)
min_low_pfn, max_low_pfn);
+ init_begin = PFN_UP(__pa_symbol(&__init_begin));
for (i = 0; i < boot_mem_map.nr_map; i++) {
unsigned long start, end;
@@ -351,8 +352,8 @@ static void __init bootmem_init(void)
end = PFN_DOWN(boot_mem_map.map[i].addr
+ boot_mem_map.map[i].size);
- if (start <= min_low_pfn)
- start = min_low_pfn;
+ if (start <= init_begin)
+ start = init_begin;
if (start >= end)
continue;
diff --git a/trunk/arch/mips/kernel/time.c b/trunk/arch/mips/kernel/time.c
index 2995be1ab3ca..1ecfbb7eba6c 100644
--- a/trunk/arch/mips/kernel/time.c
+++ b/trunk/arch/mips/kernel/time.c
@@ -147,9 +147,9 @@ static __init int cpu_has_mfc0_count_bug(void)
return 1;
/*
- * we assume newer revisions are ok
+ * I don't have erratas for newer R4400 so be paranoid.
*/
- return 0;
+ return 1;
}
return 0;
diff --git a/trunk/arch/mips/lasat/image/Makefile b/trunk/arch/mips/lasat/image/Makefile
index 460626b6d62f..5332449ec040 100644
--- a/trunk/arch/mips/lasat/image/Makefile
+++ b/trunk/arch/mips/lasat/image/Makefile
@@ -12,11 +12,11 @@ endif
MKLASATIMG = mklasatimg
MKLASATIMG_ARCH = mq2,mqpro,sp100,sp200
-KERNEL_IMAGE = vmlinux
+KERNEL_IMAGE = $(TOPDIR)/vmlinux
KERNEL_START = $(shell $(NM) $(KERNEL_IMAGE) | grep " _text" | cut -f1 -d\ )
KERNEL_ENTRY = $(shell $(NM) $(KERNEL_IMAGE) | grep kernel_entry | cut -f1 -d\ )
-LDSCRIPT= -L$(srctree)/$(src) -Tromscript.normal
+LDSCRIPT= -L$(obj) -Tromscript.normal
HEAD_DEFINES := -D_kernel_start=0x$(KERNEL_START) \
-D_kernel_entry=0x$(KERNEL_ENTRY) \
@@ -24,7 +24,7 @@ HEAD_DEFINES := -D_kernel_start=0x$(KERNEL_START) \
-D TIMESTAMP=$(shell date +%s)
$(obj)/head.o: $(obj)/head.S $(KERNEL_IMAGE)
- $(CC) -fno-pic $(HEAD_DEFINES) $(LINUXINCLUDE) -c -o $@ $<
+ $(CC) -fno-pic $(HEAD_DEFINES) -I$(TOPDIR)/include -c -o $@ $<
OBJECTS = head.o kImage.o
diff --git a/trunk/arch/mips/mips-boards/generic/memory.c b/trunk/arch/mips/mips-boards/generic/memory.c
index dc272c188233..2c5c27c8e86d 100644
--- a/trunk/arch/mips/mips-boards/generic/memory.c
+++ b/trunk/arch/mips/mips-boards/generic/memory.c
@@ -169,6 +169,7 @@ void __init prom_meminit(void)
void __init prom_free_prom_memory(void)
{
+#if 0 /* for now ... */
unsigned long addr;
int i;
@@ -180,4 +181,5 @@ void __init prom_free_prom_memory(void)
free_init_pages("prom memory",
addr, addr + boot_mem_map.map[i].size);
}
+#endif
}
diff --git a/trunk/arch/mips/mips-boards/generic/reset.c b/trunk/arch/mips/mips-boards/generic/reset.c
index 583d468d98a9..7a1bb51f81ee 100644
--- a/trunk/arch/mips/mips-boards/generic/reset.c
+++ b/trunk/arch/mips/mips-boards/generic/reset.c
@@ -39,18 +39,16 @@ static void atlas_machine_power_off(void);
static void mips_machine_restart(char *command)
{
- unsigned int __iomem *softres_reg =
- ioremap(SOFTRES_REG, sizeof(unsigned int));
+ unsigned int __iomem *softres_reg = ioremap(SOFTRES_REG, sizeof(unsigned int));
- __raw_writel(GORESET, softres_reg);
+ writew(GORESET, softres_reg);
}
static void mips_machine_halt(void)
{
- unsigned int __iomem *softres_reg =
- ioremap(SOFTRES_REG, sizeof(unsigned int));
+ unsigned int __iomem *softres_reg = ioremap(SOFTRES_REG, sizeof(unsigned int));
- __raw_writel(GORESET, softres_reg);
+ writew(GORESET, softres_reg);
}
#if defined(CONFIG_MIPS_ATLAS)
diff --git a/trunk/arch/mips/mips-boards/malta/malta_setup.c b/trunk/arch/mips/mips-boards/malta/malta_setup.c
index bc43a5c2224d..9a2636e56243 100644
--- a/trunk/arch/mips/mips-boards/malta/malta_setup.c
+++ b/trunk/arch/mips/mips-boards/malta/malta_setup.c
@@ -149,7 +149,7 @@ void __init plat_mem_setup(void)
/* Check PCI clock */
{
unsigned int __iomem *jmpr_p = (unsigned int *) ioremap(MALTA_JMPRS_REG, sizeof(unsigned int));
- int jmpr = (__raw_readl(jmpr_p) >> 2) & 0x07;
+ int jmpr = (readw(jmpr_p) >> 2) & 0x07;
static const int pciclocks[] __initdata = {
33, 20, 25, 30, 12, 16, 37, 10
};
diff --git a/trunk/arch/mips/mm/dma-default.c b/trunk/arch/mips/mm/dma-default.c
index 810535dd091b..ae76795685cc 100644
--- a/trunk/arch/mips/mm/dma-default.c
+++ b/trunk/arch/mips/mm/dma-default.c
@@ -45,7 +45,7 @@ static gfp_t massage_gfp_flags(const struct device *dev, gfp_t gfp)
/* ignore region specifiers */
gfp &= ~(__GFP_DMA | __GFP_DMA32 | __GFP_HIGHMEM);
-#ifdef CONFIG_ZONE_DMA
+#ifdef CONFIG_ZONE_DMA32
if (dev == NULL)
gfp |= __GFP_DMA;
else if (dev->coherent_dma_mask < DMA_BIT_MASK(24))
diff --git a/trunk/arch/mips/pci/fixup-cobalt.c b/trunk/arch/mips/pci/fixup-cobalt.c
index 9553b14002dd..f7df1142912b 100644
--- a/trunk/arch/mips/pci/fixup-cobalt.c
+++ b/trunk/arch/mips/pci/fixup-cobalt.c
@@ -177,7 +177,7 @@ static char irq_tab_raq2[] __initdata = {
int __init pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
{
- if (cobalt_board_id <= COBALT_BRD_ID_QUBE1)
+ if (cobalt_board_id < COBALT_BRD_ID_QUBE2)
return irq_tab_qube1[slot];
if (cobalt_board_id == COBALT_BRD_ID_RAQ2)
diff --git a/trunk/arch/mips/pci/ops-au1000.c b/trunk/arch/mips/pci/ops-au1000.c
index 1314bd58f036..6b29904acf45 100644
--- a/trunk/arch/mips/pci/ops-au1000.c
+++ b/trunk/arch/mips/pci/ops-au1000.c
@@ -1,8 +1,8 @@
/*
* BRIEF MODULE DESCRIPTION
- * Alchemy/AMD Au1x00 PCI support.
+ * Alchemy/AMD Au1x00 pci support.
*
- * Copyright 2001-2003, 2007 MontaVista Software Inc.
+ * Copyright 2001,2002,2003 MontaVista Software Inc.
* Author: MontaVista Software, Inc.
* ppopov@mvista.com or source@mvista.com
*
@@ -69,27 +69,10 @@ void mod_wired_entry(int entry, unsigned long entrylo0,
write_c0_pagemask(old_pagemask);
}
-static struct vm_struct *pci_cfg_vm;
+struct vm_struct *pci_cfg_vm;
static int pci_cfg_wired_entry;
-static unsigned long last_entryLo0, last_entryLo1;
-
-/*
- * We can't ioremap the entire pci config space because it's too large.
- * Nor can we call ioremap dynamically because some device drivers use
- * the PCI config routines from within interrupt handlers and that
- * becomes a problem in get_vm_area(). We use one wired TLB to handle
- * all config accesses for all busses.
- */
-void __init au1x_pci_cfg_init(void)
-{
- /* Reserve a wired entry for PCI config accesses */
- pci_cfg_vm = get_vm_area(0x2000, VM_IOREMAP);
- if (!pci_cfg_vm)
- panic(KERN_ERR "PCI unable to get vm area\n");
- pci_cfg_wired_entry = read_c0_wired();
- add_wired_entry(0, 0, (unsigned long)pci_cfg_vm->addr, PM_4K);
- last_entryLo0 = last_entryLo1 = 0xffffffff;
-}
+static int first_cfg = 1;
+unsigned long last_entryLo0, last_entryLo1;
static int config_access(unsigned char access_type, struct pci_bus *bus,
unsigned int dev_fn, unsigned char where,
@@ -114,6 +97,27 @@ static int config_access(unsigned char access_type, struct pci_bus *bus,
Au1500_PCI_STATCMD);
au_sync_udelay(1);
+ /*
+ * We can't ioremap the entire pci config space because it's
+ * too large. Nor can we call ioremap dynamically because some
+ * device drivers use the pci config routines from within
+ * interrupt handlers and that becomes a problem in get_vm_area().
+ * We use one wired tlb to handle all config accesses for all
+ * busses. To improve performance, if the current device
+ * is the same as the last device accessed, we don't touch the
+ * tlb.
+ */
+ if (first_cfg) {
+ /* reserve a wired entry for pci config accesses */
+ first_cfg = 0;
+ pci_cfg_vm = get_vm_area(0x2000, VM_IOREMAP);
+ if (!pci_cfg_vm)
+ panic(KERN_ERR "PCI unable to get vm area\n");
+ pci_cfg_wired_entry = read_c0_wired();
+ add_wired_entry(0, 0, (unsigned long)pci_cfg_vm->addr, PM_4K);
+ last_entryLo0 = last_entryLo1 = 0xffffffff;
+ }
+
/* Allow board vendors to implement their own off-chip idsel.
* If it doesn't succeed, may as well bail out at this point.
*/
@@ -140,12 +144,9 @@ static int config_access(unsigned char access_type, struct pci_bus *bus,
/* page boundary */
cfg_base = cfg_base & PAGE_MASK;
- /*
- * To improve performance, if the current device is the same as
- * the last device accessed, we don't touch the TLB.
- */
entryLo0 = (6 << 26) | (cfg_base >> 6) | (2 << 3) | 7;
entryLo1 = (6 << 26) | (cfg_base >> 6) | (0x1000 >> 6) | (2 << 3) | 7;
+
if ((entryLo0 != last_entryLo0) || (entryLo1 != last_entryLo1)) {
mod_wired_entry(pci_cfg_wired_entry, entryLo0, entryLo1,
(unsigned long)pci_cfg_vm->addr, PM_4K);
diff --git a/trunk/arch/mips/pci/ops-mace.c b/trunk/arch/mips/pci/ops-mace.c
index e95881897ec9..fe5451449304 100644
--- a/trunk/arch/mips/pci/ops-mace.c
+++ b/trunk/arch/mips/pci/ops-mace.c
@@ -42,10 +42,6 @@ static int
mace_pci_read_config(struct pci_bus *bus, unsigned int devfn,
int reg, int size, u32 *val)
{
- u32 control = mace->pci.control;
-
- /* disable master aborts interrupts during config read */
- mace->pci.control = control & ~MACEPCI_CONTROL_MAR_INT;
mace->pci.config_addr = mkaddr(bus, devfn, reg);
switch (size) {
case 1:
@@ -58,9 +54,6 @@ mace_pci_read_config(struct pci_bus *bus, unsigned int devfn,
*val = mace->pci.config_data.l;
break;
}
- /* ack possible master abort */
- mace->pci.error &= ~MACEPCI_ERROR_MASTER_ABORT;
- mace->pci.control = control;
DPRINTK("read%d: reg=%08x,val=%02x\n", size * 8, reg, *val);
diff --git a/trunk/arch/mips/pci/pci-ip32.c b/trunk/arch/mips/pci/pci-ip32.c
index 532b561b4442..618ea7dbc474 100644
--- a/trunk/arch/mips/pci/pci-ip32.c
+++ b/trunk/arch/mips/pci/pci-ip32.c
@@ -119,7 +119,6 @@ static struct pci_controller mace_pci_controller = {
.iommu = 0,
.mem_offset = MACE_PCI_MEM_OFFSET,
.io_offset = 0,
- .io_map_base = CKSEG1ADDR(MACEPCI_LOW_IO),
};
static int __init mace_init(void)
@@ -136,8 +135,7 @@ static int __init mace_init(void)
BUG_ON(request_irq(MACE_PCI_BRIDGE_IRQ, macepci_error, 0,
"MACE PCI error", NULL));
- /* extend memory resources */
- iomem_resource.end = mace_pci_mem_resource.end;
+ iomem_resource = mace_pci_mem_resource;
ioport_resource = mace_pci_io_resource;
register_pci_controller(&mace_pci_controller);
diff --git a/trunk/arch/mips/philips/pnx8550/common/time.c b/trunk/arch/mips/philips/pnx8550/common/time.c
index 6d494e0de3d9..e818fd0f1584 100644
--- a/trunk/arch/mips/philips/pnx8550/common/time.c
+++ b/trunk/arch/mips/philips/pnx8550/common/time.c
@@ -22,6 +22,7 @@
#include
#include
#include
+#include
#include
#include
@@ -40,60 +41,11 @@ static cycle_t hpt_read(void)
return read_c0_count2();
}
-static struct clocksource pnx_clocksource = {
- .name = "pnx8xxx",
- .rating = 200,
- .read = hpt_read,
- .flags = CLOCK_SOURCE_IS_CONTINUOUS,
-};
-
static void timer_ack(void)
{
write_c0_compare(cpj);
}
-static irqreturn_t pnx8xxx_timer_interrupt(int irq, void *dev_id)
-{
- struct clock_event_device *c = dev_id;
-
- /* clear MATCH, signal the event */
- c->event_handler(c);
-
- return IRQ_HANDLED;
-}
-
-static struct irqaction pnx8xxx_timer_irq = {
- .handler = pnx8xxx_timer_interrupt,
- .flags = IRQF_DISABLED | IRQF_PERCPU,
- .name = "pnx8xxx_timer",
-};
-
-static irqreturn_t monotonic_interrupt(int irq, void *dev_id)
-{
- /* Timer 2 clear interrupt */
- write_c0_compare2(-1);
- return IRQ_HANDLED;
-}
-
-static struct irqaction monotonic_irqaction = {
- .handler = monotonic_interrupt,
- .flags = IRQF_DISABLED,
- .name = "Monotonic timer",
-};
-
-static int pnx8xxx_set_next_event(unsigned long delta,
- struct clock_event_device *evt)
-{
- write_c0_compare(delta);
- return 0;
-}
-
-static struct clock_event_device pnx8xxx_clockevent = {
- .name = "pnx8xxx_clockevent",
- .features = CLOCK_EVT_FEAT_ONESHOT,
- .set_next_event = pnx8xxx_set_next_event,
-};
-
/*
* plat_time_init() - it does the following things:
*
@@ -106,34 +58,11 @@ static struct clock_event_device pnx8xxx_clockevent = {
__init void plat_time_init(void)
{
- unsigned int configPR;
unsigned int n;
unsigned int m;
unsigned int p;
unsigned int pow2p;
- clockevents_register_device(&pnx8xxx_clockevent);
- clocksource_register(&pnx_clocksource);
-
- setup_irq(PNX8550_INT_TIMER1, &pnx8xxx_timer_irq);
- setup_irq(PNX8550_INT_TIMER2, &monotonic_irqaction);
-
- /* Timer 1 start */
- configPR = read_c0_config7();
- configPR &= ~0x00000008;
- write_c0_config7(configPR);
-
- /* Timer 2 start */
- configPR = read_c0_config7();
- configPR &= ~0x00000010;
- write_c0_config7(configPR);
-
- /* Timer 3 stop */
- configPR = read_c0_config7();
- configPR |= 0x00000020;
- write_c0_config7(configPR);
-
-
/* PLL0 sets MIPS clock (PLL1 <=> TM1, PLL6 <=> TM2, PLL5 <=> mem) */
/* (but only if CLK_MIPS_CTL select value [bits 3:1] is 1: FIXME) */
@@ -158,6 +87,42 @@ __init void plat_time_init(void)
write_c0_count2(0);
write_c0_compare2(0xffffffff);
+ clocksource_mips.read = hpt_read;
+ mips_timer_ack = timer_ack;
+}
+
+static irqreturn_t monotonic_interrupt(int irq, void *dev_id)
+{
+ /* Timer 2 clear interrupt */
+ write_c0_compare2(-1);
+ return IRQ_HANDLED;
}
+static struct irqaction monotonic_irqaction = {
+ .handler = monotonic_interrupt,
+ .flags = IRQF_DISABLED,
+ .name = "Monotonic timer",
+};
+void __init plat_timer_setup(struct irqaction *irq)
+{
+ int configPR;
+
+ setup_irq(PNX8550_INT_TIMER1, irq);
+ setup_irq(PNX8550_INT_TIMER2, &monotonic_irqaction);
+
+ /* Timer 1 start */
+ configPR = read_c0_config7();
+ configPR &= ~0x00000008;
+ write_c0_config7(configPR);
+
+ /* Timer 2 start */
+ configPR = read_c0_config7();
+ configPR &= ~0x00000010;
+ write_c0_config7(configPR);
+
+ /* Timer 3 stop */
+ configPR = read_c0_config7();
+ configPR |= 0x00000020;
+ write_c0_config7(configPR);
+}
diff --git a/trunk/arch/mips/sgi-ip32/ip32-irq.c b/trunk/arch/mips/sgi-ip32/ip32-irq.c
index b0ea0e43ba48..cab7cc22ab67 100644
--- a/trunk/arch/mips/sgi-ip32/ip32-irq.c
+++ b/trunk/arch/mips/sgi-ip32/ip32-irq.c
@@ -426,6 +426,7 @@ static void ip32_irq0(void)
crime_int = crime->istat & crime_mask;
irq = MACE_VID_IN1_IRQ + __ffs(crime_int);
+ crime_int = 1 << irq;
if (crime_int & CRIME_MACEISA_INT_MASK) {
unsigned long mace_int = mace->perif.ctrl.istat;
diff --git a/trunk/arch/mips/sgi-ip32/ip32-platform.c b/trunk/arch/mips/sgi-ip32/ip32-platform.c
index 89a71f49b692..77febd68fcd4 100644
--- a/trunk/arch/mips/sgi-ip32/ip32-platform.c
+++ b/trunk/arch/mips/sgi-ip32/ip32-platform.c
@@ -13,22 +13,21 @@
#include
#include
-#define MACEISA_SERIAL1_OFFS offsetof(struct sgi_mace, isa.serial1)
-#define MACEISA_SERIAL2_OFFS offsetof(struct sgi_mace, isa.serial2)
-
-#define MACE_PORT(offset,_irq) \
+/*
+ * .iobase isn't a constant (in the sense of C) so we fill it in at runtime.
+ */
+#define MACE_PORT(int) \
{ \
- .mapbase = MACE_BASE + offset, \
- .irq = _irq, \
+ .irq = int, \
.uartclk = 1843200, \
.iotype = UPIO_MEM, \
- .flags = UPF_SKIP_TEST|UPF_IOREMAP, \
+ .flags = UPF_SKIP_TEST, \
.regshift = 8, \
}
static struct plat_serial8250_port uart8250_data[] = {
- MACE_PORT(MACEISA_SERIAL1_OFFS, MACEISA_SERIAL1_IRQ),
- MACE_PORT(MACEISA_SERIAL2_OFFS, MACEISA_SERIAL2_IRQ),
+ MACE_PORT(MACEISA_SERIAL1_IRQ),
+ MACE_PORT(MACEISA_SERIAL2_IRQ),
{ },
};
@@ -42,6 +41,9 @@ static struct platform_device uart8250_device = {
static int __init uart8250_init(void)
{
+ uart8250_data[0].membase = (void __iomem *) &mace->isa.serial1;
+ uart8250_data[1].membase = (void __iomem *) &mace->isa.serial2;
+
return platform_device_register(&uart8250_device);
}
diff --git a/trunk/arch/mips/tx4938/toshiba_rbtx4938/setup.c b/trunk/arch/mips/tx4938/toshiba_rbtx4938/setup.c
index 632e5d201353..4a8152375efe 100644
--- a/trunk/arch/mips/tx4938/toshiba_rbtx4938/setup.c
+++ b/trunk/arch/mips/tx4938/toshiba_rbtx4938/setup.c
@@ -598,8 +598,8 @@ static int __init rbtx4938_ethaddr_init(void)
printk(KERN_WARNING "seeprom: bad checksum.\n");
}
for (i = 0; i < 2; i++) {
- unsigned int id =
- TXX9_IRQ_BASE + (i ? TX4938_IR_ETH1 : TX4938_IR_ETH0);
+ unsigned int slot = TX4938_PCIC_IDSEL_AD_TO_SLOT(31 - i);
+ unsigned int id = (1 << 8) | PCI_DEVFN(slot, 0); /* bus 1 */
struct platform_device *pdev;
if (!(tx4938_ccfgptr->pcfg &
(i ? TX4938_PCFG_ETH1_SEL : TX4938_PCFG_ETH0_SEL)))
diff --git a/trunk/arch/powerpc/Kconfig b/trunk/arch/powerpc/Kconfig
index 53d0955abf11..66a3d8cee5cf 100644
--- a/trunk/arch/powerpc/Kconfig
+++ b/trunk/arch/powerpc/Kconfig
@@ -342,14 +342,6 @@ config PPC_64K_PAGES
while on hardware with such support, it will be used to map
normal application pages.
-config PPC_SUBPAGE_PROT
- bool "Support setting protections for 4k subpages"
- depends on PPC_64K_PAGES
- help
- This option adds support for a system call to allow user programs
- to set access permissions (read/write, readonly, or no access)
- on the 4k subpages of each 64k page.
-
config SCHED_SMT
bool "SMT (Hyperthreading) scheduler support"
depends on PPC64 && SMP
diff --git a/trunk/arch/powerpc/boot/dts/cm5200.dts b/trunk/arch/powerpc/boot/dts/cm5200.dts
deleted file mode 100644
index 9295083d1ce9..000000000000
--- a/trunk/arch/powerpc/boot/dts/cm5200.dts
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- * CM5200 board Device Tree Source
- *
- * Copyright (C) 2007 Semihalf
- * Marian Balakowicz
- *
- * 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.
- */
-
-/*
- * WARNING: Do not depend on this tree layout remaining static just yet.
- * The MPC5200 device tree conventions are still in flux
- * Keep an eye on the linuxppc-dev mailing list for more details
- */
-
-/ {
- model = "schindler,cm5200";
- compatible = "schindler,cm5200";
- #address-cells = <1>;
- #size-cells = <1>;
-
- cpus {
- #address-cells = <1>;
- #size-cells = <0>;
-
- PowerPC,5200@0 {
- device_type = "cpu";
- reg = <0>;
- d-cache-line-size = <20>;
- i-cache-line-size = <20>;
- d-cache-size = <4000>; // L1, 16K
- i-cache-size = <4000>; // L1, 16K
- timebase-frequency = <0>; // from bootloader
- bus-frequency = <0>; // from bootloader
- clock-frequency = <0>; // from bootloader
- };
- };
-
- memory {
- device_type = "memory";
- reg = <00000000 04000000>; // 64MB
- };
-
- soc5200@f0000000 {
- model = "fsl,mpc5200b";
- compatible = "fsl,mpc5200b";
- revision = ""; // from bootloader
- device_type = "soc";
- ranges = <0 f0000000 0000c000>;
- reg = ;
- bus-frequency = <0>; // from bootloader
- system-frequency = <0>; // from bootloader
-
- cdm@200 {
- compatible = "mpc5200b-cdm","mpc5200-cdm";
- reg = <200 38>;
- };
-
- mpc5200_pic: pic@500 {
- // 5200 interrupts are encoded into two levels;
- interrupt-controller;
- #interrupt-cells = <3>;
- compatible = "mpc5200b-pic","mpc5200-pic";
- reg = <500 80>;
- };
-
- gpt@600 { // General Purpose Timer
- compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
- reg = <600 10>;
- interrupts = <1 9 0>;
- interrupt-parent = <&mpc5200_pic>;
- fsl,has-wdt;
- };
-
- gpt@610 { // General Purpose Timer
- compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
- reg = <610 10>;
- interrupts = <1 a 0>;
- interrupt-parent = <&mpc5200_pic>;
- };
-
- gpt@620 { // General Purpose Timer
- compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
- reg = <620 10>;
- interrupts = <1 b 0>;
- interrupt-parent = <&mpc5200_pic>;
- };
-
- gpt@630 { // General Purpose Timer
- compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
- reg = <630 10>;
- interrupts = <1 c 0>;
- interrupt-parent = <&mpc5200_pic>;
- };
-
- gpt@640 { // General Purpose Timer
- compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
- reg = <640 10>;
- interrupts = <1 d 0>;
- interrupt-parent = <&mpc5200_pic>;
- };
-
- gpt@650 { // General Purpose Timer
- compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
- reg = <650 10>;
- interrupts = <1 e 0>;
- interrupt-parent = <&mpc5200_pic>;
- };
-
- gpt@660 { // General Purpose Timer
- compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
- reg = <660 10>;
- interrupts = <1 f 0>;
- interrupt-parent = <&mpc5200_pic>;
- };
-
- gpt@670 { // General Purpose Timer
- compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
- reg = <670 10>;
- interrupts = <1 10 0>;
- interrupt-parent = <&mpc5200_pic>;
- };
-
- rtc@800 { // Real time clock
- compatible = "mpc5200b-rtc","mpc5200-rtc";
- reg = <800 100>;
- interrupts = <1 5 0 1 6 0>;
- interrupt-parent = <&mpc5200_pic>;
- };
-
- gpio@b00 {
- compatible = "mpc5200b-gpio","mpc5200-gpio";
- reg = ;
- interrupts = <1 7 0>;
- interrupt-parent = <&mpc5200_pic>;
- };
-
- gpio-wkup@c00 {
- compatible = "mpc5200b-gpio-wkup","mpc5200-gpio-wkup";
- reg = ;
- interrupts = <1 8 0 0 3 0>;
- interrupt-parent = <&mpc5200_pic>;
- };
-
- spi@f00 {
- compatible = "mpc5200b-spi","mpc5200-spi";
- reg = ;
- interrupts = <2 d 0 2 e 0>;
- interrupt-parent = <&mpc5200_pic>;
- };
-
- usb@1000 {
- device_type = "usb-ohci-be";
- compatible = "mpc5200b-ohci","mpc5200-ohci","ohci-be";
- reg = <1000 ff>;
- interrupts = <2 6 0>;
- interrupt-parent = <&mpc5200_pic>;
- };
-
- dma-controller@1200 {
- compatible = "mpc5200b-bestcomm","mpc5200-bestcomm";
- reg = <1200 80>;
- interrupts = <3 0 0 3 1 0 3 2 0 3 3 0
- 3 4 0 3 5 0 3 6 0 3 7 0
- 3 8 0 3 9 0 3 a 0 3 b 0
- 3 c 0 3 d 0 3 e 0 3 f 0>;
- interrupt-parent = <&mpc5200_pic>;
- };
-
- xlb@1f00 {
- compatible = "mpc5200b-xlb","mpc5200-xlb";
- reg = <1f00 100>;
- };
-
- serial@2000 { // PSC1
- device_type = "serial";
- compatible = "mpc5200b-psc-uart","mpc5200-psc-uart";
- port-number = <0>; // Logical port assignment
- reg = <2000 100>;
- interrupts = <2 1 0>;
- interrupt-parent = <&mpc5200_pic>;
- };
-
- serial@2200 { // PSC2
- device_type = "serial";
- compatible = "mpc5200-psc-uart";
- port-number = <1>; // Logical port assignment
- reg = <2200 100>;
- interrupts = <2 2 0>;
- interrupt-parent = <&mpc5200_pic>;
- };
-
- serial@2400 { // PSC3
- device_type = "serial";
- compatible = "mpc5200-psc-uart";
- port-number = <2>; // Logical port assignment
- reg = <2400 100>;
- interrupts = <2 3 0>;
- interrupt-parent = <&mpc5200_pic>;
- };
-
- serial@2c00 { // PSC6
- device_type = "serial";
- compatible = "mpc5200b-psc-uart","mpc5200-psc-uart";
- port-number = <5>; // Logical port assignment
- reg = <2c00 100>;
- interrupts = <2 4 0>;
- interrupt-parent = <&mpc5200_pic>;
- };
-
- ethernet@3000 {
- device_type = "network";
- compatible = "mpc5200b-fec","mpc5200-fec";
- reg = <3000 800>;
- local-mac-address = [ 00 00 00 00 00 00 ]; /* Filled in by U-Boot */
- interrupts = <2 5 0>;
- interrupt-parent = <&mpc5200_pic>;
- };
-
- i2c@3d40 {
- compatible = "mpc5200b-i2c","mpc5200-i2c","fsl-i2c";
- reg = <3d40 40>;
- interrupts = <2 10 0>;
- interrupt-parent = <&mpc5200_pic>;
- fsl5200-clocking;
- };
-
- sram@8000 {
- compatible = "mpc5200b-sram","mpc5200-sram";
- reg = <8000 4000>;
- };
- };
-};
diff --git a/trunk/arch/powerpc/boot/dts/lite5200.dts b/trunk/arch/powerpc/boot/dts/lite5200.dts
index e1d6f441532f..23eeeb1fc61e 100644
--- a/trunk/arch/powerpc/boot/dts/lite5200.dts
+++ b/trunk/arch/powerpc/boot/dts/lite5200.dts
@@ -19,7 +19,7 @@
/ {
model = "fsl,lite5200";
// revision = "1.0";
- compatible = "fsl,lite5200";
+ compatible = "fsl,lite5200","generic-mpc5200";
#address-cells = <1>;
#size-cells = <1>;
diff --git a/trunk/arch/powerpc/boot/dts/lite5200b.dts b/trunk/arch/powerpc/boot/dts/lite5200b.dts
index 3e06f58a0a71..f94e073de9a7 100644
--- a/trunk/arch/powerpc/boot/dts/lite5200b.dts
+++ b/trunk/arch/powerpc/boot/dts/lite5200b.dts
@@ -19,7 +19,7 @@
/ {
model = "fsl,lite5200b";
// revision = "1.0";
- compatible = "fsl,lite5200b";
+ compatible = "fsl,lite5200b","generic-mpc5200";
#address-cells = <1>;
#size-cells = <1>;
diff --git a/trunk/arch/powerpc/boot/dts/motionpro.dts b/trunk/arch/powerpc/boot/dts/motionpro.dts
deleted file mode 100644
index d8c316ae0a47..000000000000
--- a/trunk/arch/powerpc/boot/dts/motionpro.dts
+++ /dev/null
@@ -1,309 +0,0 @@
-/*
- * Motion-PRO board Device Tree Source
- *
- * Copyright (C) 2007 Semihalf
- * Marian Balakowicz
- *
- * 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.
- */
-
-/*
- * WARNING: Do not depend on this tree layout remaining static just yet.
- * The MPC5200 device tree conventions are still in flux
- * Keep an eye on the linuxppc-dev mailing list for more details
- */
-
-/ {
- model = "promess,motionpro";
- compatible = "promess,motionpro";
- #address-cells = <1>;
- #size-cells = <1>;
-
- cpus {
- #address-cells = <1>;
- #size-cells = <0>;
-
- PowerPC,5200@0 {
- device_type = "cpu";
- reg = <0>;
- d-cache-line-size = <20>;
- i-cache-line-size = <20>;
- d-cache-size = <4000>; // L1, 16K
- i-cache-size = <4000>; // L1, 16K
- timebase-frequency = <0>; // from bootloader
- bus-frequency = <0>; // from bootloader
- clock-frequency = <0>; // from bootloader
- };
- };
-
- memory {
- device_type = "memory";
- reg = <00000000 04000000>; // 64MB
- };
-
- soc5200@f0000000 {
- model = "fsl,mpc5200b";
- compatible = "fsl,mpc5200b";
- revision = ""; // from bootloader
- device_type = "soc";
- ranges = <0 f0000000 0000c000>;
- reg = ;
- bus-frequency = <0>; // from bootloader
- system-frequency = <0>; // from bootloader
-
- cdm@200 {
- compatible = "mpc5200b-cdm","mpc5200-cdm";
- reg = <200 38>;
- };
-
- mpc5200_pic: pic@500 {
- // 5200 interrupts are encoded into two levels;
- interrupt-controller;
- #interrupt-cells = <3>;
- compatible = "mpc5200b-pic","mpc5200-pic";
- reg = <500 80>;
- };
-
- gpt@600 { // General Purpose Timer
- compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
- reg = <600 10>;
- interrupts = <1 9 0>;
- interrupt-parent = <&mpc5200_pic>;
- fsl,has-wdt;
- };
-
- gpt@610 { // General Purpose Timer
- compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
- reg = <610 10>;
- interrupts = <1 a 0>;
- interrupt-parent = <&mpc5200_pic>;
- };
-
- gpt@620 { // General Purpose Timer
- compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
- reg = <620 10>;
- interrupts = <1 b 0>;
- interrupt-parent = <&mpc5200_pic>;
- };
-
- gpt@630 { // General Purpose Timer
- compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
- reg = <630 10>;
- interrupts = <1 c 0>;
- interrupt-parent = <&mpc5200_pic>;
- };
-
- gpt@640 { // General Purpose Timer
- compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
- reg = <640 10>;
- interrupts = <1 d 0>;
- interrupt-parent = <&mpc5200_pic>;
- };
-
- gpt@650 { // General Purpose Timer
- compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
- reg = <650 10>;
- interrupts = <1 e 0>;
- interrupt-parent = <&mpc5200_pic>;
- };
-
- motionpro-led@660 { // Motion-PRO status LED
- compatible = "promess,motionpro-led";
- label = "motionpro-statusled";
- reg = <660 10>;
- interrupts = <1 f 0>;
- interrupt-parent = <&mpc5200_pic>;
- blink-delay = <64>; // 100 msec
- };
-
- motionpro-led@670 { // Motion-PRO ready LED
- compatible = "promess,motionpro-led";
- label = "motionpro-readyled";
- reg = <670 10>;
- interrupts = <1 10 0>;
- interrupt-parent = <&mpc5200_pic>;
- };
-
- rtc@800 { // Real time clock
- compatible = "mpc5200b-rtc","mpc5200-rtc";
- reg = <800 100>;
- interrupts = <1 5 0 1 6 0>;
- interrupt-parent = <&mpc5200_pic>;
- };
-
- mscan@980 {
- compatible = "mpc5200b-mscan","mpc5200-mscan";
- interrupts = <2 12 0>;
- interrupt-parent = <&mpc5200_pic>;
- reg = <980 80>;
- };
-
- gpio@b00 {
- compatible = "mpc5200b-gpio","mpc5200-gpio";
- reg = ;
- interrupts = <1 7 0>;
- interrupt-parent = <&mpc5200_pic>;
- };
-
- gpio-wkup@c00 {
- compatible = "mpc5200b-gpio-wkup","mpc5200-gpio-wkup";
- reg = ;
- interrupts = <1 8 0 0 3 0>;
- interrupt-parent = <&mpc5200_pic>;
- };
-
-
- spi@f00 {
- compatible = "mpc5200b-spi","mpc5200-spi";
- reg = ;
- interrupts = <2 d 0 2 e 0>;
- interrupt-parent = <&mpc5200_pic>;
- };
-
- usb@1000 {
- compatible = "mpc5200b-ohci","mpc5200-ohci","ohci-be";
- reg = <1000 ff>;
- interrupts = <2 6 0>;
- interrupt-parent = <&mpc5200_pic>;
- };
-
- dma-controller@1200 {
- compatible = "mpc5200b-bestcomm","mpc5200-bestcomm";
- reg = <1200 80>;
- interrupts = <3 0 0 3 1 0 3 2 0 3 3 0
- 3 4 0 3 5 0 3 6 0 3 7 0
- 3 8 0 3 9 0 3 a 0 3 b 0
- 3 c 0 3 d 0 3 e 0 3 f 0>;
- interrupt-parent = <&mpc5200_pic>;
- };
-
- xlb@1f00 {
- compatible = "mpc5200b-xlb","mpc5200-xlb";
- reg = <1f00 100>;
- };
-
- serial@2000 { // PSC1
- device_type = "serial";
- compatible = "mpc5200b-psc-uart","mpc5200-psc-uart";
- port-number = <0>; // Logical port assignment
- reg = <2000 100>;
- interrupts = <2 1 0>;
- interrupt-parent = <&mpc5200_pic>;
- };
-
- // PSC2 in spi master mode
- spi@2200 { // PSC2
- compatible = "mpc5200b-psc-spi","mpc5200-psc-spi";
- cell-index = <1>;
- reg = <2200 100>;
- interrupts = <2 2 0>;
- interrupt-parent = <&mpc5200_pic>;
- };
-
- // PSC5 in uart mode
- serial@2800 { // PSC5
- device_type = "serial";
- compatible = "mpc5200b-psc-uart","mpc5200-psc-uart";
- port-number = <4>; // Logical port assignment
- reg = <2800 100>;
- interrupts = <2 c 0>;
- interrupt-parent = <&mpc5200_pic>;
- };
-
- ethernet@3000 {
- device_type = "network";
- compatible = "mpc5200b-fec","mpc5200-fec";
- reg = <3000 800>;
- local-mac-address = [ 00 00 00 00 00 00 ]; /* Filled in by U-Boot */
- interrupts = <2 5 0>;
- interrupt-parent = <&mpc5200_pic>;
- };
-
- ata@3a00 {
- compatible = "mpc5200b-ata","mpc5200-ata";
- reg = <3a00 100>;
- interrupts = <2 7 0>;
- interrupt-parent = <&mpc5200_pic>;
- };
-
- i2c@3d40 {
- compatible = "mpc5200b-i2c","mpc5200-i2c","fsl-i2c";
- reg = <3d40 40>;
- interrupts = <2 10 0>;
- interrupt-parent = <&mpc5200_pic>;
- fsl5200-clocking;
- };
-
- sram@8000 {
- compatible = "mpc5200b-sram","mpc5200-sram";
- reg = <8000 4000>;
- };
- };
-
- lpb {
- model = "fsl,lpb";
- compatible = "fsl,lpb";
- #address-cells = <2>;
- #size-cells = <1>;
- ranges = <1 0 50000000 00010000
- 2 0 50010000 00010000
- 3 0 50020000 00010000>;
-
- // 8-bit DualPort SRAM on LocalPlus Bus CS1
- kollmorgen@1,0 {
- compatible = "promess,motionpro-kollmorgen";
- reg = <1 0 10000>;
- interrupts = <1 1 0>;
- interrupt-parent = <&mpc5200_pic>;
- };
-
- // 8-bit board CPLD on LocalPlus Bus CS2
- cpld@2,0 {
- compatible = "promess,motionpro-cpld";
- reg = <2 0 10000>;
- };
-
- // 8-bit custom Anybus Module on LocalPlus Bus CS3
- anybus@3,0 {
- compatible = "promess,motionpro-anybus";
- reg = <3 0 10000>;
- };
- pro_module_general@3,0 {
- compatible = "promess,pro_module_general";
- reg = <3 0 3>;
- };
- pro_module_dio@3,800 {
- compatible = "promess,pro_module_dio";
- reg = <3 800 2>;
- };
- };
-
- pci@f0000d00 {
- #interrupt-cells = <1>;
- #size-cells = <2>;
- #address-cells = <3>;
- device_type = "pci";
- compatible = "mpc5200b-pci","mpc5200-pci";
- reg = ;
- interrupt-map-mask = ;
- interrupt-map = ;
- clock-frequency = <0>; // From boot loader
- interrupts = <2 8 0 2 9 0 2 a 0>;
- interrupt-parent = <&mpc5200_pic>;
- bus-range = <0 0>;
- ranges = <42000000 0 80000000 80000000 0 20000000
- 02000000 0 a0000000 a0000000 0 10000000
- 01000000 0 00000000 b0000000 0 01000000>;
- };
-};
diff --git a/trunk/arch/powerpc/boot/dts/tqm5200.dts b/trunk/arch/powerpc/boot/dts/tqm5200.dts
deleted file mode 100644
index 5017cec3d386..000000000000
--- a/trunk/arch/powerpc/boot/dts/tqm5200.dts
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * TQM5200 board Device Tree Source
- *
- * Copyright (C) 2007 Semihalf
- * Marian Balakowicz
- *
- * 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.
- */
-
-/*
- * WARNING: Do not depend on this tree layout remaining static just yet.
- * The MPC5200 device tree conventions are still in flux
- * Keep an eye on the linuxppc-dev mailing list for more details
- */
-
-/ {
- model = "tqc,tqm5200";
- compatible = "tqc,tqm5200";
- #address-cells = <1>;
- #size-cells = <1>;
-
- cpus {
- #address-cells = <1>;
- #size-cells = <0>;
-
- PowerPC,5200@0 {
- device_type = "cpu";
- reg = <0>;
- d-cache-line-size = <20>;
- i-cache-line-size = <20>;
- d-cache-size = <4000>; // L1, 16K
- i-cache-size = <4000>; // L1, 16K
- timebase-frequency = <0>; // from bootloader
- bus-frequency = <0>; // from bootloader
- clock-frequency = <0>; // from bootloader
- };
- };
-
- memory {
- device_type = "memory";
- reg = <00000000 04000000>; // 64MB
- };
-
- soc5200@f0000000 {
- model = "fsl,mpc5200";
- compatible = "fsl,mpc5200";
- revision = ""; // from bootloader
- device_type = "soc";
- ranges = <0 f0000000 0000c000>;
- reg = ;
- bus-frequency = <0>; // from bootloader
- system-frequency = <0>; // from bootloader
-
- cdm@200 {
- compatible = "mpc5200-cdm";
- reg = <200 38>;
- };
-
- mpc5200_pic: pic@500 {
- // 5200 interrupts are encoded into two levels;
- interrupt-controller;
- #interrupt-cells = <3>;
- compatible = "mpc5200-pic";
- reg = <500 80>;
- };
-
- gpt@600 { // General Purpose Timer
- compatible = "fsl,mpc5200-gpt";
- reg = <600 10>;
- interrupts = <1 9 0>;
- interrupt-parent = <&mpc5200_pic>;
- fsl,has-wdt;
- };
-
- gpio@b00 {
- compatible = "mpc5200-gpio";
- reg = ;
- interrupts = <1 7 0>;
- interrupt-parent = <&mpc5200_pic>;
- };
-
- usb@1000 {
- compatible = "mpc5200-ohci","ohci-be";
- reg = <1000 ff>;
- interrupts = <2 6 0>;
- interrupt-parent = <&mpc5200_pic>;
- };
-
- dma-controller@1200 {
- compatible = "mpc5200-bestcomm";
- reg = <1200 80>;
- interrupts = <3 0 0 3 1 0 3 2 0 3 3 0
- 3 4 0 3 5 0 3 6 0 3 7 0
- 3 8 0 3 9 0 3 a 0 3 b 0
- 3 c 0 3 d 0 3 e 0 3 f 0>;
- interrupt-parent = <&mpc5200_pic>;
- };
-
- xlb@1f00 {
- compatible = "mpc5200-xlb";
- reg = <1f00 100>;
- };
-
- serial@2000 { // PSC1
- device_type = "serial";
- compatible = "mpc5200-psc-uart";
- port-number = <0>; // Logical port assignment
- reg = <2000 100>;
- interrupts = <2 1 0>;
- interrupt-parent = <&mpc5200_pic>;
- };
-
- serial@2200 { // PSC2
- device_type = "serial";
- compatible = "mpc5200-psc-uart";
- port-number = <1>; // Logical port assignment
- reg = <2200 100>;
- interrupts = <2 2 0>;
- interrupt-parent = <&mpc5200_pic>;
- };
-
- serial@2400 { // PSC3
- device_type = "serial";
- compatible = "mpc5200-psc-uart";
- port-number = <2>; // Logical port assignment
- reg = <2400 100>;
- interrupts = <2 3 0>;
- interrupt-parent = <&mpc5200_pic>;
- };
-
- ethernet@3000 {
- device_type = "network";
- compatible = "mpc5200-fec";
- reg = <3000 800>;
- local-mac-address = [ 00 00 00 00 00 00 ]; /* Filled in by U-Boot */
- interrupts = <2 5 0>;
- interrupt-parent = <&mpc5200_pic>;
- };
-
- ata@3a00 {
- compatible = "mpc5200-ata";
- reg = <3a00 100>;
- interrupts = <2 7 0>;
- interrupt-parent = <&mpc5200_pic>;
- };
-
- i2c@3d40 {
- compatible = "mpc5200-i2c","fsl-i2c";
- reg = <3d40 40>;
- interrupts = <2 10 0>;
- interrupt-parent = <&mpc5200_pic>;
- fsl5200-clocking;
- };
-
- sram@8000 {
- compatible = "mpc5200-sram";
- reg = <8000 4000>;
- };
- };
-
- pci@f0000d00 {
- #interrupt-cells = <1>;
- #size-cells = <2>;
- #address-cells = <3>;
- device_type = "pci";
- compatible = "fsl,mpc5200-pci";
- reg = ;
- interrupt-map-mask = ;
- interrupt-map = ;
- clock-frequency = <0>; // From boot loader
- interrupts = <2 8 0 2 9 0 2 a 0>;
- interrupt-parent = <&mpc5200_pic>;
- bus-range = <0 0>;
- ranges = <42000000 0 80000000 80000000 0 10000000
- 02000000 0 90000000 90000000 0 10000000
- 01000000 0 00000000 a0000000 0 01000000>;
- };
-};
diff --git a/trunk/arch/powerpc/boot/flatdevtree_env.h b/trunk/arch/powerpc/boot/flatdevtree_env.h
index 66e0ebb1a364..ad0420da8921 100644
--- a/trunk/arch/powerpc/boot/flatdevtree_env.h
+++ b/trunk/arch/powerpc/boot/flatdevtree_env.h
@@ -2,7 +2,7 @@
* This file adds the header file glue so that the shared files
* flatdevicetree.[ch] can compile and work in the powerpc bootwrapper.
*
- * strncmp & strchr copied from
+ * strncmp & strchr copied from
* Copyright (C) 1991, 1992 Linus Torvalds
*
* Maintained by: Mark A. Greer
diff --git a/trunk/arch/powerpc/configs/mpc5200_defconfig b/trunk/arch/powerpc/configs/lite5200_defconfig
similarity index 58%
rename from trunk/arch/powerpc/configs/mpc5200_defconfig
rename to trunk/arch/powerpc/configs/lite5200_defconfig
index 740c9f2b7de6..02bb7e5d8ed5 100644
--- a/trunk/arch/powerpc/configs/mpc5200_defconfig
+++ b/trunk/arch/powerpc/configs/lite5200_defconfig
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
-# Linux kernel version: 2.6.24-rc6
-# Fri Jan 18 14:19:54 2008
+# Linux kernel version: 2.6.24-rc4
+# Thu Dec 6 16:48:24 2007
#
# CONFIG_PPC64 is not set
@@ -72,9 +72,7 @@ CONFIG_SYSVIPC_SYSCTL=y
# CONFIG_IKCONFIG is not set
CONFIG_LOG_BUF_SHIFT=14
# CONFIG_CGROUPS is not set
-CONFIG_FAIR_GROUP_SCHED=y
-CONFIG_FAIR_USER_SCHED=y
-# CONFIG_FAIR_CGROUP_SCHED is not set
+# CONFIG_FAIR_GROUP_SCHED is not set
CONFIG_SYSFS_DEPRECATED=y
# CONFIG_RELAY is not set
CONFIG_BLK_DEV_INITRD=y
@@ -140,22 +138,17 @@ CONFIG_CLASSIC32=y
CONFIG_PPC_MPC52xx=y
CONFIG_PPC_MPC5200=y
CONFIG_PPC_MPC5200_BUGFIX=y
-CONFIG_PPC_MPC5200_SIMPLE=y
-CONFIG_PPC_EFIKA=y
+# CONFIG_PPC_EFIKA is not set
CONFIG_PPC_LITE5200=y
# CONFIG_PPC_PMAC is not set
# CONFIG_PPC_CELL is not set
# CONFIG_PPC_CELL_NATIVE is not set
# CONFIG_PQ2ADS is not set
# CONFIG_EMBEDDED6xx is not set
-CONFIG_PPC_NATIVE=y
-# CONFIG_UDBG_RTAS_CONSOLE is not set
# CONFIG_MPIC is not set
# CONFIG_MPIC_WEIRD is not set
# CONFIG_PPC_I8259 is not set
-CONFIG_PPC_RTAS=y
-# CONFIG_RTAS_ERROR_LOGGING is not set
-CONFIG_RTAS_PROC=y
+# CONFIG_PPC_RTAS is not set
# CONFIG_MMIO_NVRAM is not set
# CONFIG_PPC_MPC106 is not set
# CONFIG_PPC_970_NAP is not set
@@ -351,82 +344,7 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y
# CONFIG_DEBUG_DEVRES is not set
# CONFIG_SYS_HYPERVISOR is not set
# CONFIG_CONNECTOR is not set
-CONFIG_MTD=y
-# CONFIG_MTD_DEBUG is not set
-CONFIG_MTD_CONCAT=y
-CONFIG_MTD_PARTITIONS=y
-# CONFIG_MTD_REDBOOT_PARTS is not set
-CONFIG_MTD_CMDLINE_PARTS=y
-
-#
-# User Modules And Translation Layers
-#
-CONFIG_MTD_CHAR=y
-CONFIG_MTD_BLKDEVS=y
-CONFIG_MTD_BLOCK=y
-# CONFIG_FTL is not set
-# CONFIG_NFTL is not set
-# CONFIG_INFTL is not set
-# CONFIG_RFD_FTL is not set
-# CONFIG_SSFDC is not set
-# CONFIG_MTD_OOPS is not set
-
-#
-# RAM/ROM/Flash chip drivers
-#
-CONFIG_MTD_CFI=y
-# CONFIG_MTD_JEDECPROBE is not set
-CONFIG_MTD_GEN_PROBE=y
-# CONFIG_MTD_CFI_ADV_OPTIONS is not set
-CONFIG_MTD_MAP_BANK_WIDTH_1=y
-CONFIG_MTD_MAP_BANK_WIDTH_2=y
-CONFIG_MTD_MAP_BANK_WIDTH_4=y
-# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
-# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
-# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
-CONFIG_MTD_CFI_I1=y
-CONFIG_MTD_CFI_I2=y
-# CONFIG_MTD_CFI_I4 is not set
-# CONFIG_MTD_CFI_I8 is not set
-# CONFIG_MTD_CFI_INTELEXT is not set
-CONFIG_MTD_CFI_AMDSTD=y
-# CONFIG_MTD_CFI_STAA is not set
-CONFIG_MTD_CFI_UTIL=y
-CONFIG_MTD_RAM=y
-CONFIG_MTD_ROM=y
-# CONFIG_MTD_ABSENT is not set
-
-#
-# Mapping drivers for chip access
-#
-# CONFIG_MTD_COMPLEX_MAPPINGS is not set
-# CONFIG_MTD_PHYSMAP is not set
-CONFIG_MTD_PHYSMAP_OF=y
-# CONFIG_MTD_INTEL_VR_NOR is not set
-# CONFIG_MTD_PLATRAM is not set
-
-#
-# Self-contained MTD device drivers
-#
-# CONFIG_MTD_PMC551 is not set
-# CONFIG_MTD_SLRAM is not set
-# CONFIG_MTD_PHRAM is not set
-# CONFIG_MTD_MTDRAM is not set
-# CONFIG_MTD_BLOCK2MTD is not set
-
-#
-# Disk-On-Chip Device Drivers
-#
-# CONFIG_MTD_DOC2000 is not set
-# CONFIG_MTD_DOC2001 is not set
-# CONFIG_MTD_DOC2001PLUS is not set
-# CONFIG_MTD_NAND is not set
-# CONFIG_MTD_ONENAND is not set
-
-#
-# UBI - Unsorted block images
-#
-# CONFIG_MTD_UBI is not set
+# CONFIG_MTD is not set
CONFIG_OF_DEVICE=y
# CONFIG_PARPORT is not set
CONFIG_BLK_DEV=y
@@ -440,7 +358,6 @@ CONFIG_BLK_DEV_LOOP=y
# CONFIG_BLK_DEV_CRYPTOLOOP is not set
# CONFIG_BLK_DEV_NBD is not set
# CONFIG_BLK_DEV_SX8 is not set
-# CONFIG_BLK_DEV_UB is not set
CONFIG_BLK_DEV_RAM=y
CONFIG_BLK_DEV_RAM_COUNT=16
CONFIG_BLK_DEV_RAM_SIZE=32768
@@ -460,18 +377,18 @@ CONFIG_MISC_DEVICES=y
# CONFIG_RAID_ATTRS is not set
CONFIG_SCSI=y
CONFIG_SCSI_DMA=y
-CONFIG_SCSI_TGT=y
+# CONFIG_SCSI_TGT is not set
# CONFIG_SCSI_NETLINK is not set
-CONFIG_SCSI_PROC_FS=y
+# CONFIG_SCSI_PROC_FS is not set
#
# SCSI support type (disk, tape, CD-ROM)
#
-CONFIG_BLK_DEV_SD=y
+# CONFIG_BLK_DEV_SD is not set
# CONFIG_CHR_DEV_ST is not set
# CONFIG_CHR_DEV_OSST is not set
# CONFIG_BLK_DEV_SR is not set
-CONFIG_CHR_DEV_SG=y
+# CONFIG_CHR_DEV_SG is not set
# CONFIG_CHR_DEV_SCH is not set
#
@@ -584,8 +501,7 @@ CONFIG_PATA_MPC52xx=y
# CONFIG_PATA_SIS is not set
# CONFIG_PATA_VIA is not set
# CONFIG_PATA_WINBOND is not set
-CONFIG_PATA_PLATFORM=y
-# CONFIG_PATA_OF_PLATFORM is not set
+# CONFIG_PATA_PLATFORM is not set
# CONFIG_MD is not set
# CONFIG_FUSION is not set
@@ -606,40 +522,37 @@ CONFIG_NETDEVICES=y
# CONFIG_VETH is not set
# CONFIG_IP1000 is not set
# CONFIG_ARCNET is not set
-CONFIG_PHYLIB=y
-
-#
-# MII PHY device drivers
-#
-# CONFIG_MARVELL_PHY is not set
-# CONFIG_DAVICOM_PHY is not set
-# CONFIG_QSEMI_PHY is not set
-# CONFIG_LXT_PHY is not set
-# CONFIG_CICADA_PHY is not set
-# CONFIG_VITESSE_PHY is not set
-# CONFIG_SMSC_PHY is not set
-# CONFIG_BROADCOM_PHY is not set
-# CONFIG_ICPLUS_PHY is not set
-# CONFIG_FIXED_PHY is not set
-# CONFIG_MDIO_BITBANG is not set
-CONFIG_NET_ETHERNET=y
-# CONFIG_MII is not set
-# CONFIG_HAPPYMEAL is not set
-# CONFIG_SUNGEM is not set
-# CONFIG_CASSINI is not set
-# CONFIG_NET_VENDOR_3COM is not set
-# CONFIG_NET_TULIP is not set
-# CONFIG_HP100 is not set
-# CONFIG_IBM_NEW_EMAC_ZMII is not set
-# CONFIG_IBM_NEW_EMAC_RGMII is not set
-# CONFIG_IBM_NEW_EMAC_TAH is not set
-# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
-# CONFIG_NET_PCI is not set
-# CONFIG_B44 is not set
-CONFIG_FEC_MPC52xx=y
-CONFIG_FEC_MPC52xx_MDIO=y
-# CONFIG_NETDEV_1000 is not set
-# CONFIG_NETDEV_10000 is not set
+# CONFIG_NET_ETHERNET is not set
+CONFIG_NETDEV_1000=y
+# CONFIG_ACENIC is not set
+# CONFIG_DL2K is not set
+# CONFIG_E1000 is not set
+# CONFIG_E1000E is not set
+# CONFIG_NS83820 is not set
+# CONFIG_HAMACHI is not set
+# CONFIG_YELLOWFIN is not set
+# CONFIG_R8169 is not set
+# CONFIG_SIS190 is not set
+# CONFIG_SKGE is not set
+# CONFIG_SKY2 is not set
+# CONFIG_SK98LIN is not set
+# CONFIG_VIA_VELOCITY is not set
+# CONFIG_TIGON3 is not set
+# CONFIG_BNX2 is not set
+# CONFIG_MV643XX_ETH is not set
+# CONFIG_QLA3XXX is not set
+# CONFIG_ATL1 is not set
+CONFIG_NETDEV_10000=y
+# CONFIG_CHELSIO_T1 is not set
+# CONFIG_CHELSIO_T3 is not set
+# CONFIG_IXGBE is not set
+# CONFIG_IXGB is not set
+# CONFIG_S2IO is not set
+# CONFIG_MYRI10GE is not set
+# CONFIG_NETXEN_NIC is not set
+# CONFIG_NIU is not set
+# CONFIG_MLX4_CORE is not set
+# CONFIG_TEHUTI is not set
# CONFIG_TR is not set
#
@@ -647,15 +560,6 @@ CONFIG_FEC_MPC52xx_MDIO=y
#
# CONFIG_WLAN_PRE80211 is not set
# CONFIG_WLAN_80211 is not set
-
-#
-# USB Network Adapters
-#
-# CONFIG_USB_CATC is not set
-# CONFIG_USB_KAWETH is not set
-# CONFIG_USB_PEGASUS is not set
-# CONFIG_USB_RTL8150 is not set
-# CONFIG_USB_USBNET is not set
# CONFIG_WAN is not set
# CONFIG_FDDI is not set
# CONFIG_HIPPI is not set
@@ -699,78 +603,21 @@ CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y
CONFIG_SERIAL_MPC52xx=y
CONFIG_SERIAL_MPC52xx_CONSOLE=y
-CONFIG_SERIAL_MPC52xx_CONSOLE_BAUD=115200
+CONFIG_SERIAL_MPC52xx_CONSOLE_BAUD=9600
# CONFIG_SERIAL_JSM is not set
CONFIG_UNIX98_PTYS=y
CONFIG_LEGACY_PTYS=y
CONFIG_LEGACY_PTY_COUNT=256
-# CONFIG_HVC_RTAS is not set
# CONFIG_IPMI_HANDLER is not set
# CONFIG_HW_RANDOM is not set
# CONFIG_NVRAM is not set
-CONFIG_GEN_RTC=y
-# CONFIG_GEN_RTC_X is not set
+# CONFIG_GEN_RTC is not set
# CONFIG_R3964 is not set
# CONFIG_APPLICOM is not set
# CONFIG_RAW_DRIVER is not set
# CONFIG_TCG_TPM is not set
CONFIG_DEVPORT=y
-CONFIG_I2C=y
-CONFIG_I2C_BOARDINFO=y
-CONFIG_I2C_CHARDEV=y
-
-#
-# I2C Algorithms
-#
-# CONFIG_I2C_ALGOBIT is not set
-# CONFIG_I2C_ALGOPCF is not set
-# CONFIG_I2C_ALGOPCA is not set
-
-#
-# I2C Hardware Bus support
-#
-# CONFIG_I2C_ALI1535 is not set
-# CONFIG_I2C_ALI1563 is not set
-# CONFIG_I2C_ALI15X3 is not set
-# CONFIG_I2C_AMD756 is not set
-# CONFIG_I2C_AMD8111 is not set
-# CONFIG_I2C_I801 is not set
-# CONFIG_I2C_I810 is not set
-# CONFIG_I2C_PIIX4 is not set
-CONFIG_I2C_MPC=y
-# CONFIG_I2C_NFORCE2 is not set
-# CONFIG_I2C_OCORES is not set
-# CONFIG_I2C_PARPORT_LIGHT is not set
-# CONFIG_I2C_PROSAVAGE is not set
-# CONFIG_I2C_SAVAGE4 is not set
-# CONFIG_I2C_SIMTEC is not set
-# CONFIG_I2C_SIS5595 is not set
-# CONFIG_I2C_SIS630 is not set
-# CONFIG_I2C_SIS96X is not set
-# CONFIG_I2C_TAOS_EVM is not set
-# CONFIG_I2C_STUB is not set
-# CONFIG_I2C_TINY_USB is not set
-# CONFIG_I2C_VIA is not set
-# CONFIG_I2C_VIAPRO is not set
-# CONFIG_I2C_VOODOO3 is not set
-
-#
-# Miscellaneous I2C Chip support
-#
-# CONFIG_SENSORS_DS1337 is not set
-# CONFIG_SENSORS_DS1374 is not set
-# CONFIG_DS1682 is not set
-# CONFIG_SENSORS_EEPROM is not set
-# CONFIG_SENSORS_PCF8574 is not set
-# CONFIG_SENSORS_PCA9539 is not set
-# CONFIG_SENSORS_PCF8591 is not set
-# CONFIG_SENSORS_M41T00 is not set
-# CONFIG_SENSORS_MAX6875 is not set
-# CONFIG_SENSORS_TSL2550 is not set
-# CONFIG_I2C_DEBUG_CORE is not set
-# CONFIG_I2C_DEBUG_ALGO is not set
-# CONFIG_I2C_DEBUG_BUS is not set
-# CONFIG_I2C_DEBUG_CHIP is not set
+# CONFIG_I2C is not set
#
# SPI support
@@ -779,77 +626,8 @@ CONFIG_I2C_MPC=y
# CONFIG_SPI_MASTER is not set
# CONFIG_W1 is not set
# CONFIG_POWER_SUPPLY is not set
-CONFIG_HWMON=y
-# CONFIG_HWMON_VID is not set
-# CONFIG_SENSORS_AD7418 is not set
-# CONFIG_SENSORS_ADM1021 is not set
-# CONFIG_SENSORS_ADM1025 is not set
-# CONFIG_SENSORS_ADM1026 is not set
-# CONFIG_SENSORS_ADM1029 is not set
-# CONFIG_SENSORS_ADM1031 is not set
-# CONFIG_SENSORS_ADM9240 is not set
-# CONFIG_SENSORS_ADT7470 is not set
-# CONFIG_SENSORS_ATXP1 is not set
-# CONFIG_SENSORS_DS1621 is not set
-# CONFIG_SENSORS_I5K_AMB is not set
-# CONFIG_SENSORS_F71805F 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
-# CONFIG_SENSORS_LM63 is not set
-# CONFIG_SENSORS_LM75 is not set
-# CONFIG_SENSORS_LM77 is not set
-# CONFIG_SENSORS_LM78 is not set
-# CONFIG_SENSORS_LM80 is not set
-# CONFIG_SENSORS_LM83 is not set
-# CONFIG_SENSORS_LM85 is not set
-# CONFIG_SENSORS_LM87 is not set
-# CONFIG_SENSORS_LM90 is not set
-# CONFIG_SENSORS_LM92 is not set
-# CONFIG_SENSORS_LM93 is not set
-# CONFIG_SENSORS_MAX1619 is not set
-# CONFIG_SENSORS_MAX6650 is not set
-# CONFIG_SENSORS_PC87360 is not set
-# CONFIG_SENSORS_PC87427 is not set
-# CONFIG_SENSORS_SIS5595 is not set
-# CONFIG_SENSORS_DME1737 is not set
-# CONFIG_SENSORS_SMSC47M1 is not set
-# CONFIG_SENSORS_SMSC47M192 is not set
-# CONFIG_SENSORS_SMSC47B397 is not set
-# CONFIG_SENSORS_THMC50 is not set
-# CONFIG_SENSORS_VIA686A is not set
-# CONFIG_SENSORS_VT1211 is not set
-# CONFIG_SENSORS_VT8231 is not set
-# CONFIG_SENSORS_W83781D is not set
-# CONFIG_SENSORS_W83791D is not set
-# CONFIG_SENSORS_W83792D is not set
-# CONFIG_SENSORS_W83793 is not set
-# CONFIG_SENSORS_W83L785TS is not set
-# CONFIG_SENSORS_W83627HF is not set
-# CONFIG_SENSORS_W83627EHF is not set
-# CONFIG_HWMON_DEBUG_CHIP is not set
-CONFIG_WATCHDOG=y
-# CONFIG_WATCHDOG_NOWAYOUT is not set
-
-#
-# Watchdog Device Drivers
-#
-# CONFIG_SOFT_WATCHDOG is not set
-# CONFIG_MPC5200_WDT is not set
-# CONFIG_WATCHDOG_RTAS is not set
-
-#
-# PCI-based Watchdog Cards
-#
-# CONFIG_PCIPCWATCHDOG is not set
-# CONFIG_WDTPCI is not set
-
-#
-# USB-based Watchdog Cards
-#
-# CONFIG_USBPCWATCHDOG is not set
+# CONFIG_HWMON is not set
+# CONFIG_WATCHDOG is not set
#
# Sonics Silicon Backplane
@@ -867,8 +645,7 @@ CONFIG_SSB_POSSIBLE=y
#
# CONFIG_VIDEO_DEV is not set
# CONFIG_DVB_CORE is not set
-CONFIG_DAB=y
-# CONFIG_USB_DABUSB is not set
+# CONFIG_DAB is not set
#
# Graphics support
@@ -893,125 +670,18 @@ CONFIG_USB_SUPPORT=y
CONFIG_USB_ARCH_HAS_HCD=y
CONFIG_USB_ARCH_HAS_OHCI=y
CONFIG_USB_ARCH_HAS_EHCI=y
-CONFIG_USB=y
-# CONFIG_USB_DEBUG is not set
-
-#
-# Miscellaneous USB options
-#
-CONFIG_USB_DEVICEFS=y
-# CONFIG_USB_DEVICE_CLASS is not set
-# CONFIG_USB_DYNAMIC_MINORS is not set
-# CONFIG_USB_SUSPEND is not set
-# CONFIG_USB_PERSIST is not set
-# CONFIG_USB_OTG is not set
-
-#
-# USB Host Controller Drivers
-#
-# CONFIG_USB_EHCI_HCD is not set
-# CONFIG_USB_ISP116X_HCD is not set
-CONFIG_USB_OHCI_HCD=y
-CONFIG_USB_OHCI_HCD_PPC_SOC=y
-CONFIG_USB_OHCI_HCD_PPC_OF=y
-CONFIG_USB_OHCI_HCD_PPC_OF_BE=y
-# CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set
-CONFIG_USB_OHCI_HCD_PCI=y
-CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y
-CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y
-CONFIG_USB_OHCI_LITTLE_ENDIAN=y
-# CONFIG_USB_UHCI_HCD is not set
-# CONFIG_USB_SL811_HCD is not set
-# CONFIG_USB_R8A66597_HCD is not set
-
-#
-# USB Device Class drivers
-#
-# CONFIG_USB_ACM is not set
-# CONFIG_USB_PRINTER is not set
+# CONFIG_USB is not set
#
# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
#
-#
-# may also be needed; see USB_STORAGE Help for more information
-#
-CONFIG_USB_STORAGE=y
-# CONFIG_USB_STORAGE_DEBUG is not set
-# CONFIG_USB_STORAGE_DATAFAB is not set
-# CONFIG_USB_STORAGE_FREECOM is not set
-# CONFIG_USB_STORAGE_ISD200 is not set
-# CONFIG_USB_STORAGE_DPCM is not set
-# CONFIG_USB_STORAGE_USBAT is not set
-# CONFIG_USB_STORAGE_SDDR09 is not set
-# CONFIG_USB_STORAGE_SDDR55 is not set
-# CONFIG_USB_STORAGE_JUMPSHOT is not set
-# CONFIG_USB_STORAGE_ALAUDA is not set
-# CONFIG_USB_STORAGE_KARMA is not set
-# CONFIG_USB_LIBUSUAL is not set
-
-#
-# USB Imaging devices
-#
-# CONFIG_USB_MDC800 is not set
-# CONFIG_USB_MICROTEK is not set
-CONFIG_USB_MON=y
-
-#
-# USB port drivers
-#
-
-#
-# USB Serial Converter support
-#
-# CONFIG_USB_SERIAL is not set
-
-#
-# USB Miscellaneous drivers
-#
-# CONFIG_USB_EMI62 is not set
-# CONFIG_USB_EMI26 is not set
-# CONFIG_USB_ADUTUX is not set
-# CONFIG_USB_AUERSWALD is not set
-# CONFIG_USB_RIO500 is not set
-# CONFIG_USB_LEGOTOWER is not set
-# CONFIG_USB_LCD is not set
-# CONFIG_USB_BERRY_CHARGE is not set
-# CONFIG_USB_LED is not set
-# CONFIG_USB_CYPRESS_CY7C63 is not set
-# CONFIG_USB_CYTHERM is not set
-# CONFIG_USB_PHIDGET is not set
-# CONFIG_USB_IDMOUSE is not set
-# CONFIG_USB_FTDI_ELAN is not set
-# CONFIG_USB_APPLEDISPLAY is not set
-# CONFIG_USB_LD is not set
-# CONFIG_USB_TRANCEVIBRATOR is not set
-# CONFIG_USB_IOWARRIOR is not set
-# CONFIG_USB_TEST is not set
-
-#
-# USB DSL modem support
-#
-
#
# USB Gadget Support
#
# CONFIG_USB_GADGET is not set
# CONFIG_MMC is not set
-CONFIG_NEW_LEDS=y
-CONFIG_LEDS_CLASS=y
-
-#
-# LED drivers
-#
-
-#
-# LED Triggers
-#
-CONFIG_LEDS_TRIGGERS=y
-CONFIG_LEDS_TRIGGER_TIMER=y
-# CONFIG_LEDS_TRIGGER_HEARTBEAT is not set
+# CONFIG_NEW_LEDS is not set
# CONFIG_INFINIBAND is not set
# CONFIG_EDAC is not set
# CONFIG_RTC_CLASS is not set
@@ -1059,11 +729,8 @@ CONFIG_DNOTIFY=y
#
# DOS/FAT/NT Filesystems
#
-CONFIG_FAT_FS=y
-CONFIG_MSDOS_FS=y
-CONFIG_VFAT_FS=y
-CONFIG_FAT_DEFAULT_CODEPAGE=437
-CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
+# CONFIG_MSDOS_FS is not set
+# CONFIG_VFAT_FS is not set
# CONFIG_NTFS_FS is not set
#
@@ -1088,39 +755,15 @@ CONFIG_TMPFS=y
# CONFIG_BEFS_FS is not set
# CONFIG_BFS_FS is not set
# CONFIG_EFS_FS is not set
-CONFIG_JFFS2_FS=y
-CONFIG_JFFS2_FS_DEBUG=0
-CONFIG_JFFS2_FS_WRITEBUFFER=y
-# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
-# CONFIG_JFFS2_SUMMARY is not set
-# CONFIG_JFFS2_FS_XATTR is not set
-# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
-CONFIG_JFFS2_ZLIB=y
-# CONFIG_JFFS2_LZO is not set
-CONFIG_JFFS2_RTIME=y
-# CONFIG_JFFS2_RUBIN is not set
-CONFIG_CRAMFS=y
+# CONFIG_CRAMFS is not set
# CONFIG_VXFS_FS is not set
# CONFIG_HPFS_FS is not set
# CONFIG_QNX4FS_FS is not set
# CONFIG_SYSV_FS is not set
# CONFIG_UFS_FS is not set
CONFIG_NETWORK_FILESYSTEMS=y
-CONFIG_NFS_FS=y
-CONFIG_NFS_V3=y
-# CONFIG_NFS_V3_ACL is not set
-CONFIG_NFS_V4=y
-# CONFIG_NFS_DIRECTIO is not set
+# CONFIG_NFS_FS is not set
# CONFIG_NFSD is not set
-CONFIG_ROOT_NFS=y
-CONFIG_LOCKD=y
-CONFIG_LOCKD_V4=y
-CONFIG_NFS_COMMON=y
-CONFIG_SUNRPC=y
-CONFIG_SUNRPC_GSS=y
-# CONFIG_SUNRPC_BIND34 is not set
-CONFIG_RPCSEC_GSS_KRB5=y
-# CONFIG_RPCSEC_GSS_SPKM3 is not set
# CONFIG_SMB_FS is not set
# CONFIG_CIFS is not set
# CONFIG_NCP_FS is not set
@@ -1132,61 +775,19 @@ CONFIG_RPCSEC_GSS_KRB5=y
#
# CONFIG_PARTITION_ADVANCED is not set
CONFIG_MSDOS_PARTITION=y
-CONFIG_NLS=y
-CONFIG_NLS_DEFAULT="iso8859-1"
-CONFIG_NLS_CODEPAGE_437=y
-# CONFIG_NLS_CODEPAGE_737 is not set
-# CONFIG_NLS_CODEPAGE_775 is not set
-# CONFIG_NLS_CODEPAGE_850 is not set
-# CONFIG_NLS_CODEPAGE_852 is not set
-# CONFIG_NLS_CODEPAGE_855 is not set
-# CONFIG_NLS_CODEPAGE_857 is not set
-# CONFIG_NLS_CODEPAGE_860 is not set
-# CONFIG_NLS_CODEPAGE_861 is not set
-# CONFIG_NLS_CODEPAGE_862 is not set
-# CONFIG_NLS_CODEPAGE_863 is not set
-# CONFIG_NLS_CODEPAGE_864 is not set
-# CONFIG_NLS_CODEPAGE_865 is not set
-# CONFIG_NLS_CODEPAGE_866 is not set
-# CONFIG_NLS_CODEPAGE_869 is not set
-# CONFIG_NLS_CODEPAGE_936 is not set
-# CONFIG_NLS_CODEPAGE_950 is not set
-# CONFIG_NLS_CODEPAGE_932 is not set
-# CONFIG_NLS_CODEPAGE_949 is not set
-# CONFIG_NLS_CODEPAGE_874 is not set
-# CONFIG_NLS_ISO8859_8 is not set
-# CONFIG_NLS_CODEPAGE_1250 is not set
-# CONFIG_NLS_CODEPAGE_1251 is not set
-# CONFIG_NLS_ASCII is not set
-CONFIG_NLS_ISO8859_1=y
-# CONFIG_NLS_ISO8859_2 is not set
-# CONFIG_NLS_ISO8859_3 is not set
-# CONFIG_NLS_ISO8859_4 is not set
-# CONFIG_NLS_ISO8859_5 is not set
-# CONFIG_NLS_ISO8859_6 is not set
-# CONFIG_NLS_ISO8859_7 is not set
-# CONFIG_NLS_ISO8859_9 is not set
-# CONFIG_NLS_ISO8859_13 is not set
-# CONFIG_NLS_ISO8859_14 is not set
-# CONFIG_NLS_ISO8859_15 is not set
-# CONFIG_NLS_KOI8_R is not set
-# CONFIG_NLS_KOI8_U is not set
-# CONFIG_NLS_UTF8 is not set
+# CONFIG_NLS is not set
# CONFIG_DLM is not set
# CONFIG_UCC_SLOW is not set
#
# Library routines
#
-CONFIG_BITREVERSE=y
# CONFIG_CRC_CCITT is not set
# CONFIG_CRC16 is not set
# CONFIG_CRC_ITU_T is not set
-CONFIG_CRC32=y
+# CONFIG_CRC32 is not set
# CONFIG_CRC7 is not set
# CONFIG_LIBCRC32C is not set
-CONFIG_ZLIB_INFLATE=y
-CONFIG_ZLIB_DEFLATE=y
CONFIG_PLIST=y
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT=y
@@ -1241,46 +842,6 @@ CONFIG_FORCED_INLINING=y
# CONFIG_KEYS is not set
# CONFIG_SECURITY is not set
# CONFIG_SECURITY_FILE_CAPABILITIES is not set
-CONFIG_CRYPTO=y
-CONFIG_CRYPTO_ALGAPI=y
-CONFIG_CRYPTO_BLKCIPHER=y
-CONFIG_CRYPTO_MANAGER=y
-# CONFIG_CRYPTO_HMAC is not set
-# CONFIG_CRYPTO_XCBC is not set
-# CONFIG_CRYPTO_NULL is not set
-# CONFIG_CRYPTO_MD4 is not set
-CONFIG_CRYPTO_MD5=y
-# CONFIG_CRYPTO_SHA1 is not set
-# CONFIG_CRYPTO_SHA256 is not set
-# CONFIG_CRYPTO_SHA512 is not set
-# CONFIG_CRYPTO_WP512 is not set
-# CONFIG_CRYPTO_TGR192 is not set
-# CONFIG_CRYPTO_GF128MUL is not set
-# CONFIG_CRYPTO_ECB is not set
-CONFIG_CRYPTO_CBC=y
-# CONFIG_CRYPTO_PCBC is not set
-# CONFIG_CRYPTO_LRW is not set
-# CONFIG_CRYPTO_XTS is not set
-# CONFIG_CRYPTO_CRYPTD is not set
-CONFIG_CRYPTO_DES=y
-# CONFIG_CRYPTO_FCRYPT is not set
-# CONFIG_CRYPTO_BLOWFISH is not set
-# CONFIG_CRYPTO_TWOFISH is not set
-# CONFIG_CRYPTO_SERPENT is not set
-# CONFIG_CRYPTO_AES is not set
-# CONFIG_CRYPTO_CAST5 is not set
-# CONFIG_CRYPTO_CAST6 is not set
-# CONFIG_CRYPTO_TEA is not set
-# CONFIG_CRYPTO_ARC4 is not set
-# CONFIG_CRYPTO_KHAZAD is not set
-# CONFIG_CRYPTO_ANUBIS is not set
-# CONFIG_CRYPTO_SEED is not set
-# CONFIG_CRYPTO_DEFLATE is not set
-# CONFIG_CRYPTO_MICHAEL_MIC is not set
-# CONFIG_CRYPTO_CRC32C is not set
-# CONFIG_CRYPTO_CAMELLIA is not set
-# CONFIG_CRYPTO_TEST is not set
-# CONFIG_CRYPTO_AUTHENC is not set
-CONFIG_CRYPTO_HW=y
+# CONFIG_CRYPTO is not set
CONFIG_PPC_CLOCK=y
CONFIG_PPC_LIB_RHEAP=y
diff --git a/trunk/arch/powerpc/kernel/head_64.S b/trunk/arch/powerpc/kernel/head_64.S
index 11b4f6d9ffce..c34986835a4e 100644
--- a/trunk/arch/powerpc/kernel/head_64.S
+++ b/trunk/arch/powerpc/kernel/head_64.S
@@ -903,7 +903,6 @@ handle_page_fault:
* the PTE insertion
*/
12: bl .save_nvgprs
- mr r5,r3
addi r3,r1,STACK_FRAME_OVERHEAD
ld r4,_DAR(r1)
bl .low_hash_fault
diff --git a/trunk/arch/powerpc/kernel/iommu.c b/trunk/arch/powerpc/kernel/iommu.c
index a3c406aca664..47c3fe55242f 100644
--- a/trunk/arch/powerpc/kernel/iommu.c
+++ b/trunk/arch/powerpc/kernel/iommu.c
@@ -278,7 +278,6 @@ int iommu_map_sg(struct iommu_table *tbl, struct scatterlist *sglist,
unsigned long flags;
struct scatterlist *s, *outs, *segstart;
int outcount, incount, i;
- unsigned int align;
unsigned long handle;
BUG_ON(direction == DMA_NONE);
@@ -310,12 +309,7 @@ int iommu_map_sg(struct iommu_table *tbl, struct scatterlist *sglist,
/* Allocate iommu entries for that segment */
vaddr = (unsigned long) sg_virt(s);
npages = iommu_num_pages(vaddr, slen);
- align = 0;
- if (IOMMU_PAGE_SHIFT < PAGE_SHIFT && slen >= PAGE_SIZE &&
- (vaddr & ~PAGE_MASK) == 0)
- align = PAGE_SHIFT - IOMMU_PAGE_SHIFT;
- entry = iommu_range_alloc(tbl, npages, &handle,
- mask >> IOMMU_PAGE_SHIFT, align);
+ entry = iommu_range_alloc(tbl, npages, &handle, mask >> IOMMU_PAGE_SHIFT, 0);
DBG(" - vaddr: %lx, size: %lx\n", vaddr, slen);
@@ -576,7 +570,7 @@ dma_addr_t iommu_map_single(struct iommu_table *tbl, void *vaddr,
{
dma_addr_t dma_handle = DMA_ERROR_CODE;
unsigned long uaddr;
- unsigned int npages, align;
+ unsigned int npages;
BUG_ON(direction == DMA_NONE);
@@ -584,13 +578,8 @@ dma_addr_t iommu_map_single(struct iommu_table *tbl, void *vaddr,
npages = iommu_num_pages(uaddr, size);
if (tbl) {
- align = 0;
- if (IOMMU_PAGE_SHIFT < PAGE_SHIFT && size >= PAGE_SIZE &&
- ((unsigned long)vaddr & ~PAGE_MASK) == 0)
- align = PAGE_SHIFT - IOMMU_PAGE_SHIFT;
-
dma_handle = iommu_alloc(tbl, vaddr, npages, direction,
- mask >> IOMMU_PAGE_SHIFT, align);
+ mask >> IOMMU_PAGE_SHIFT, 0);
if (dma_handle == DMA_ERROR_CODE) {
if (printk_ratelimit()) {
printk(KERN_INFO "iommu_alloc failed, "
diff --git a/trunk/arch/powerpc/kernel/prom_init.c b/trunk/arch/powerpc/kernel/prom_init.c
index 5d89a21dd0d6..1add6efdb315 100644
--- a/trunk/arch/powerpc/kernel/prom_init.c
+++ b/trunk/arch/powerpc/kernel/prom_init.c
@@ -2216,45 +2216,6 @@ static void __init fixup_device_tree_efika(void)
prom_printf("fixup_device_tree_efika: ",
"skipped entry %x - setprop error\n", i);
}
-
- /* Make sure ethernet mdio bus node exists */
- node = call_prom("finddevice", 1, 1, ADDR("/builtin/mdio"));
- if (!PHANDLE_VALID(node)) {
- prom_printf("Adding Ethernet MDIO node\n");
- call_prom("interpret", 1, 1,
- " s\" /builtin\" find-device"
- " new-device"
- " 1 encode-int s\" #address-cells\" property"
- " 0 encode-int s\" #size-cells\" property"
- " s\" mdio\" 2dup device-name device-type"
- " s\" mpc5200b-fec-phy\" encode-string"
- " s\" compatible\" property"
- " 0xf0003000 0x400 reg"
- " 0x2 encode-int"
- " 0x5 encode-int encode+"
- " 0x3 encode-int encode+"
- " s\" interrupts\" property"
- " finish-device");
- };
-
- /* Make sure ethernet phy device node exist */
- node = call_prom("finddevice", 1, 1, ADDR("/builtin/mdio/ethernet-phy"));
- if (!PHANDLE_VALID(node)) {
- prom_printf("Adding Ethernet PHY node\n");
- call_prom("interpret", 1, 1,
- " s\" /builtin/mdio\" find-device"
- " new-device"
- " s\" ethernet-phy\" device-name"
- " 0x10 encode-int s\" reg\" property"
- " my-self"
- " ihandle>phandle"
- " finish-device"
- " s\" /builtin/ethernet\" find-device"
- " encode-int"
- " s\" phy-handle\" property"
- " device-end");
- }
-
}
#else
#define fixup_device_tree_efika()
diff --git a/trunk/arch/powerpc/mm/Makefile b/trunk/arch/powerpc/mm/Makefile
index 41649a5d3602..20629ae95c50 100644
--- a/trunk/arch/powerpc/mm/Makefile
+++ b/trunk/arch/powerpc/mm/Makefile
@@ -22,4 +22,3 @@ obj-$(CONFIG_FSL_BOOKE) += fsl_booke_mmu.o
obj-$(CONFIG_NEED_MULTIPLE_NODES) += numa.o
obj-$(CONFIG_PPC_MM_SLICES) += slice.o
obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
-obj-$(CONFIG_PPC_SUBPAGE_PROT) += subpage-prot.o
diff --git a/trunk/arch/powerpc/mm/hash_low_64.S b/trunk/arch/powerpc/mm/hash_low_64.S
index 21d248486479..e935edd6b72b 100644
--- a/trunk/arch/powerpc/mm/hash_low_64.S
+++ b/trunk/arch/powerpc/mm/hash_low_64.S
@@ -331,8 +331,7 @@ htab_pte_insert_failure:
*****************************************************************************/
/* _hash_page_4K(unsigned long ea, unsigned long access, unsigned long vsid,
- * pte_t *ptep, unsigned long trap, int local, int ssize,
- * int subpg_prot)
+ * pte_t *ptep, unsigned long trap, int local, int ssize)
*/
/*
@@ -430,19 +429,12 @@ END_FTR_SECTION_IFSET(CPU_FTR_1T_SEGMENT)
xor r28,r28,r0 /* hash */
/* Convert linux PTE bits into HW equivalents */
-4:
-#ifdef CONFIG_PPC_SUBPAGE_PROT
- andc r10,r30,r10
- andi. r3,r10,0x1fe /* Get basic set of flags */
- rlwinm r0,r10,32-9+1,30,30 /* _PAGE_RW -> _PAGE_USER (r0) */
-#else
- andi. r3,r30,0x1fe /* Get basic set of flags */
- rlwinm r0,r30,32-9+1,30,30 /* _PAGE_RW -> _PAGE_USER (r0) */
-#endif
+4: andi. r3,r30,0x1fe /* Get basic set of flags */
xori r3,r3,HPTE_R_N /* _PAGE_EXEC -> NOEXEC */
+ rlwinm r0,r30,32-9+1,30,30 /* _PAGE_RW -> _PAGE_USER (r0) */
rlwinm r4,r30,32-7+1,30,30 /* _PAGE_DIRTY -> _PAGE_USER (r4) */
and r0,r0,r4 /* _PAGE_RW & _PAGE_DIRTY ->r0 bit 30*/
- andc r0,r3,r0 /* r0 = pte & ~r0 */
+ andc r0,r30,r0 /* r0 = pte & ~r0 */
rlwimi r3,r0,32-1,31,31 /* Insert result into PP lsb */
ori r3,r3,HPTE_R_C /* Always add "C" bit for perf. */
diff --git a/trunk/arch/powerpc/mm/hash_utils_64.c b/trunk/arch/powerpc/mm/hash_utils_64.c
index 7b4cacb0d4ba..9326a6962b42 100644
--- a/trunk/arch/powerpc/mm/hash_utils_64.c
+++ b/trunk/arch/powerpc/mm/hash_utils_64.c
@@ -637,7 +637,7 @@ unsigned int hash_page_do_lazy_icache(unsigned int pp, pte_t pte, int trap)
* For now this makes the whole process use 4k pages.
*/
#ifdef CONFIG_PPC_64K_PAGES
-void demote_segment_4k(struct mm_struct *mm, unsigned long addr)
+static void demote_segment_4k(struct mm_struct *mm, unsigned long addr)
{
if (mm->context.user_psize == MMU_PAGE_4K)
return;
@@ -645,62 +645,13 @@ void demote_segment_4k(struct mm_struct *mm, unsigned long addr)
#ifdef CONFIG_SPU_BASE
spu_flush_all_slbs(mm);
#endif
- if (get_paca()->context.user_psize != MMU_PAGE_4K) {
- get_paca()->context = mm->context;
- slb_flush_and_rebolt();
- }
}
#endif /* CONFIG_PPC_64K_PAGES */
-#ifdef CONFIG_PPC_SUBPAGE_PROT
-/*
- * This looks up a 2-bit protection code for a 4k subpage of a 64k page.
- * Userspace sets the subpage permissions using the subpage_prot system call.
- *
- * Result is 0: full permissions, _PAGE_RW: read-only,
- * _PAGE_USER or _PAGE_USER|_PAGE_RW: no access.
- */
-static int subpage_protection(pgd_t *pgdir, unsigned long ea)
-{
- struct subpage_prot_table *spt = pgd_subpage_prot(pgdir);
- u32 spp = 0;
- u32 **sbpm, *sbpp;
-
- if (ea >= spt->maxaddr)
- return 0;
- if (ea < 0x100000000) {
- /* addresses below 4GB use spt->low_prot */
- sbpm = spt->low_prot;
- } else {
- sbpm = spt->protptrs[ea >> SBP_L3_SHIFT];
- if (!sbpm)
- return 0;
- }
- sbpp = sbpm[(ea >> SBP_L2_SHIFT) & (SBP_L2_COUNT - 1)];
- if (!sbpp)
- return 0;
- spp = sbpp[(ea >> PAGE_SHIFT) & (SBP_L1_COUNT - 1)];
-
- /* extract 2-bit bitfield for this 4k subpage */
- spp >>= 30 - 2 * ((ea >> 12) & 0xf);
-
- /* turn 0,1,2,3 into combination of _PAGE_USER and _PAGE_RW */
- spp = ((spp & 2) ? _PAGE_USER : 0) | ((spp & 1) ? _PAGE_RW : 0);
- return spp;
-}
-
-#else /* CONFIG_PPC_SUBPAGE_PROT */
-static inline int subpage_protection(pgd_t *pgdir, unsigned long ea)
-{
- return 0;
-}
-#endif
-
/* Result code is:
* 0 - handled
* 1 - normal page fault
* -1 - critical hash insertion error
- * -2 - access not permitted by subpage protection mechanism
*/
int hash_page(unsigned long ea, unsigned long access, unsigned long trap)
{
@@ -851,14 +802,7 @@ int hash_page(unsigned long ea, unsigned long access, unsigned long trap)
rc = __hash_page_64K(ea, access, vsid, ptep, trap, local, ssize);
else
#endif /* CONFIG_PPC_HAS_HASH_64K */
- {
- int spp = subpage_protection(pgdir, ea);
- if (access & spp)
- rc = -2;
- else
- rc = __hash_page_4K(ea, access, vsid, ptep, trap,
- local, ssize, spp);
- }
+ rc = __hash_page_4K(ea, access, vsid, ptep, trap, local, ssize);
#ifndef CONFIG_PPC_64K_PAGES
DBG_LOW(" o-pte: %016lx\n", pte_val(*ptep));
@@ -930,8 +874,7 @@ void hash_preload(struct mm_struct *mm, unsigned long ea,
__hash_page_64K(ea, access, vsid, ptep, trap, local, ssize);
else
#endif /* CONFIG_PPC_HAS_HASH_64K */
- __hash_page_4K(ea, access, vsid, ptep, trap, local, ssize,
- subpage_protection(pgdir, ea));
+ __hash_page_4K(ea, access, vsid, ptep, trap, local, ssize);
local_irq_restore(flags);
}
@@ -976,17 +919,19 @@ void flush_hash_range(unsigned long number, int local)
* low_hash_fault is called when we the low level hash code failed
* to instert a PTE due to an hypervisor error
*/
-void low_hash_fault(struct pt_regs *regs, unsigned long address, int rc)
+void low_hash_fault(struct pt_regs *regs, unsigned long address)
{
if (user_mode(regs)) {
-#ifdef CONFIG_PPC_SUBPAGE_PROT
- if (rc == -2)
- _exception(SIGSEGV, regs, SEGV_ACCERR, address);
- else
-#endif
- _exception(SIGBUS, regs, BUS_ADRERR, address);
- } else
- bad_page_fault(regs, address, SIGBUS);
+ siginfo_t info;
+
+ info.si_signo = SIGBUS;
+ info.si_errno = 0;
+ info.si_code = BUS_ADRERR;
+ info.si_addr = (void __user *)address;
+ force_sig_info(SIGBUS, &info, current);
+ return;
+ }
+ bad_page_fault(regs, address, SIGBUS);
}
#ifdef CONFIG_DEBUG_PAGEALLOC
diff --git a/trunk/arch/powerpc/mm/lmb.c b/trunk/arch/powerpc/mm/lmb.c
index 8f4d2dc4cafb..4ce23bcf8a57 100644
--- a/trunk/arch/powerpc/mm/lmb.c
+++ b/trunk/arch/powerpc/mm/lmb.c
@@ -342,3 +342,16 @@ void __init lmb_enforce_memory_limit(unsigned long memory_limit)
}
}
}
+
+int __init lmb_is_reserved(unsigned long addr)
+{
+ int i;
+
+ for (i = 0; i < lmb.reserved.cnt; i++) {
+ unsigned long upper = lmb.reserved.region[i].base +
+ lmb.reserved.region[i].size - 1;
+ if ((addr >= lmb.reserved.region[i].base) && (addr <= upper))
+ return 1;
+ }
+ return 0;
+}
diff --git a/trunk/arch/powerpc/mm/mem.c b/trunk/arch/powerpc/mm/mem.c
index 5402fb6b3aae..e8122447f019 100644
--- a/trunk/arch/powerpc/mm/mem.c
+++ b/trunk/arch/powerpc/mm/mem.c
@@ -213,15 +213,30 @@ void __init do_init_bootmem(void)
*/
#ifdef CONFIG_HIGHMEM
free_bootmem_with_active_regions(0, total_lowmem >> PAGE_SHIFT);
+
+ /* reserve the sections we're already using */
+ for (i = 0; i < lmb.reserved.cnt; i++) {
+ unsigned long addr = lmb.reserved.region[i].base +
+ lmb_size_bytes(&lmb.reserved, i) - 1;
+ if (addr < total_lowmem)
+ reserve_bootmem(lmb.reserved.region[i].base,
+ lmb_size_bytes(&lmb.reserved, i));
+ else if (lmb.reserved.region[i].base < total_lowmem) {
+ unsigned long adjusted_size = total_lowmem -
+ lmb.reserved.region[i].base;
+ reserve_bootmem(lmb.reserved.region[i].base,
+ adjusted_size);
+ }
+ }
#else
free_bootmem_with_active_regions(0, max_pfn);
-#endif
/* reserve the sections we're already using */
for (i = 0; i < lmb.reserved.cnt; i++)
reserve_bootmem(lmb.reserved.region[i].base,
lmb_size_bytes(&lmb.reserved, i));
+#endif
/* XXX need to clip this if using highmem? */
sparse_memory_present_with_active_regions(0);
@@ -334,11 +349,13 @@ void __init mem_init(void)
highmem_mapnr = total_lowmem >> PAGE_SHIFT;
for (pfn = highmem_mapnr; pfn < max_mapnr; ++pfn) {
struct page *page = pfn_to_page(pfn);
-
+ if (lmb_is_reserved(pfn << PAGE_SHIFT))
+ continue;
ClearPageReserved(page);
init_page_count(page);
__free_page(page);
totalhigh_pages++;
+ reservedpages--;
}
totalram_pages += totalhigh_pages;
printk(KERN_DEBUG "High memory: %luk\n",
diff --git a/trunk/arch/powerpc/mm/slb.c b/trunk/arch/powerpc/mm/slb.c
index 47b06bad24ad..3cf0802cd2b6 100644
--- a/trunk/arch/powerpc/mm/slb.c
+++ b/trunk/arch/powerpc/mm/slb.c
@@ -295,8 +295,6 @@ void slb_initialize(void)
create_shadowed_slbe(VMALLOC_START, mmu_kernel_ssize, vflags, 1);
- slb_shadow_clear(2);
-
/* We don't bolt the stack for the time being - we're in boot,
* so the stack is in the bolted segment. By the time it goes
* elsewhere, we'll call _switch() which will bolt in the new
diff --git a/trunk/arch/powerpc/mm/subpage-prot.c b/trunk/arch/powerpc/mm/subpage-prot.c
deleted file mode 100644
index 4cafc0c33d0a..000000000000
--- a/trunk/arch/powerpc/mm/subpage-prot.c
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * Copyright 2007-2008 Paul Mackerras, IBM Corp.
- *
- * 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.
- */
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-#include
-#include
-
-/*
- * Free all pages allocated for subpage protection maps and pointers.
- * Also makes sure that the subpage_prot_table structure is
- * reinitialized for the next user.
- */
-void subpage_prot_free(pgd_t *pgd)
-{
- struct subpage_prot_table *spt = pgd_subpage_prot(pgd);
- unsigned long i, j, addr;
- u32 **p;
-
- for (i = 0; i < 4; ++i) {
- if (spt->low_prot[i]) {
- free_page((unsigned long)spt->low_prot[i]);
- spt->low_prot[i] = NULL;
- }
- }
- addr = 0;
- for (i = 0; i < 2; ++i) {
- p = spt->protptrs[i];
- if (!p)
- continue;
- spt->protptrs[i] = NULL;
- for (j = 0; j < SBP_L2_COUNT && addr < spt->maxaddr;
- ++j, addr += PAGE_SIZE)
- if (p[j])
- free_page((unsigned long)p[j]);
- free_page((unsigned long)p);
- }
- spt->maxaddr = 0;
-}
-
-static void hpte_flush_range(struct mm_struct *mm, unsigned long addr,
- int npages)
-{
- pgd_t *pgd;
- pud_t *pud;
- pmd_t *pmd;
- pte_t *pte;
- spinlock_t *ptl;
-
- pgd = pgd_offset(mm, addr);
- if (pgd_none(*pgd))
- return;
- pud = pud_offset(pgd, addr);
- if (pud_none(*pud))
- return;
- pmd = pmd_offset(pud, addr);
- if (pmd_none(*pmd))
- return;
- pte = pte_offset_map_lock(mm, pmd, addr, &ptl);
- arch_enter_lazy_mmu_mode();
- for (; npages > 0; --npages) {
- pte_update(mm, addr, pte, 0, 0);
- addr += PAGE_SIZE;
- ++pte;
- }
- arch_leave_lazy_mmu_mode();
- pte_unmap_unlock(pte - 1, ptl);
-}
-
-/*
- * Clear the subpage protection map for an address range, allowing
- * all accesses that are allowed by the pte permissions.
- */
-static void subpage_prot_clear(unsigned long addr, unsigned long len)
-{
- struct mm_struct *mm = current->mm;
- struct subpage_prot_table *spt = pgd_subpage_prot(mm->pgd);
- u32 **spm, *spp;
- int i, nw;
- unsigned long next, limit;
-
- down_write(&mm->mmap_sem);
- limit = addr + len;
- if (limit > spt->maxaddr)
- limit = spt->maxaddr;
- for (; addr < limit; addr = next) {
- next = pmd_addr_end(addr, limit);
- if (addr < 0x100000000) {
- spm = spt->low_prot;
- } else {
- spm = spt->protptrs[addr >> SBP_L3_SHIFT];
- if (!spm)
- continue;
- }
- spp = spm[(addr >> SBP_L2_SHIFT) & (SBP_L2_COUNT - 1)];
- if (!spp)
- continue;
- spp += (addr >> PAGE_SHIFT) & (SBP_L1_COUNT - 1);
-
- i = (addr >> PAGE_SHIFT) & (PTRS_PER_PTE - 1);
- nw = PTRS_PER_PTE - i;
- if (addr + (nw << PAGE_SHIFT) > next)
- nw = (next - addr) >> PAGE_SHIFT;
-
- memset(spp, 0, nw * sizeof(u32));
-
- /* now flush any existing HPTEs for the range */
- hpte_flush_range(mm, addr, nw);
- }
- up_write(&mm->mmap_sem);
-}
-
-/*
- * Copy in a subpage protection map for an address range.
- * The map has 2 bits per 4k subpage, so 32 bits per 64k page.
- * Each 2-bit field is 0 to allow any access, 1 to prevent writes,
- * 2 or 3 to prevent all accesses.
- * Note that the normal page protections also apply; the subpage
- * protection mechanism is an additional constraint, so putting 0
- * in a 2-bit field won't allow writes to a page that is otherwise
- * write-protected.
- */
-long sys_subpage_prot(unsigned long addr, unsigned long len, u32 __user *map)
-{
- struct mm_struct *mm = current->mm;
- struct subpage_prot_table *spt = pgd_subpage_prot(mm->pgd);
- u32 **spm, *spp;
- int i, nw;
- unsigned long next, limit;
- int err;
-
- /* Check parameters */
- if ((addr & ~PAGE_MASK) || (len & ~PAGE_MASK) ||
- addr >= TASK_SIZE || len >= TASK_SIZE || addr + len > TASK_SIZE)
- return -EINVAL;
-
- if (is_hugepage_only_range(mm, addr, len))
- return -EINVAL;
-
- if (!map) {
- /* Clear out the protection map for the address range */
- subpage_prot_clear(addr, len);
- return 0;
- }
-
- if (!access_ok(VERIFY_READ, map, (len >> PAGE_SHIFT) * sizeof(u32)))
- return -EFAULT;
-
- down_write(&mm->mmap_sem);
- for (limit = addr + len; addr < limit; addr = next) {
- next = pmd_addr_end(addr, limit);
- err = -ENOMEM;
- if (addr < 0x100000000) {
- spm = spt->low_prot;
- } else {
- spm = spt->protptrs[addr >> SBP_L3_SHIFT];
- if (!spm) {
- spm = (u32 **)get_zeroed_page(GFP_KERNEL);
- if (!spm)
- goto out;
- spt->protptrs[addr >> SBP_L3_SHIFT] = spm;
- }
- }
- spm += (addr >> SBP_L2_SHIFT) & (SBP_L2_COUNT - 1);
- spp = *spm;
- if (!spp) {
- spp = (u32 *)get_zeroed_page(GFP_KERNEL);
- if (!spp)
- goto out;
- *spm = spp;
- }
- spp += (addr >> PAGE_SHIFT) & (SBP_L1_COUNT - 1);
-
- local_irq_disable();
- demote_segment_4k(mm, addr);
- local_irq_enable();
-
- i = (addr >> PAGE_SHIFT) & (PTRS_PER_PTE - 1);
- nw = PTRS_PER_PTE - i;
- if (addr + (nw << PAGE_SHIFT) > next)
- nw = (next - addr) >> PAGE_SHIFT;
-
- up_write(&mm->mmap_sem);
- err = -EFAULT;
- if (__copy_from_user(spp, map, nw * sizeof(u32)))
- goto out2;
- map += nw;
- down_write(&mm->mmap_sem);
-
- /* now flush any existing HPTEs for the range */
- hpte_flush_range(mm, addr, nw);
- }
- if (limit > spt->maxaddr)
- spt->maxaddr = limit;
- err = 0;
- out:
- up_write(&mm->mmap_sem);
- out2:
- return err;
-}
diff --git a/trunk/arch/powerpc/platforms/52xx/Kconfig b/trunk/arch/powerpc/platforms/52xx/Kconfig
index 733a8063d400..2938d4927b83 100644
--- a/trunk/arch/powerpc/platforms/52xx/Kconfig
+++ b/trunk/arch/powerpc/platforms/52xx/Kconfig
@@ -19,28 +19,6 @@ config PPC_MPC5200_BUGFIX
It is safe to say 'Y' here
-config PPC_MPC5200_SIMPLE
- bool "Generic support for simple MPC5200 based boards"
- depends on PPC_MULTIPLATFORM && PPC32
- select PPC_MPC5200
- select DEFAULT_UIMAGE
- select WANT_DEVICE_TREE
- default n
- help
- This option enables support for a simple MPC52xx based boards which
- do not need a custom platform specific setup. Such boards are
- supported assuming the following:
-
- - GPIO pins are configured by the firmware,
- - CDM configuration (clocking) is setup correctly by firmware,
- - if the 'fsl,has-wdt' property is present in one of the
- gpt nodes, then it is safe to use such gpt to reset the board,
- - PCI is supported if enabled in the kernel configuration
- and if there is a PCI bus node defined in the device tree.
-
- Boards that are compatible with this generic platform support
- are: 'tqc,tqm5200', 'promess,motionpro', 'schindler,cm5200'.
-
config PPC_EFIKA
bool "bPlan Efika 5k2. MPC5200B based computer"
depends on PPC_MULTIPLATFORM && PPC32
@@ -53,7 +31,8 @@ config PPC_EFIKA
config PPC_LITE5200
bool "Freescale Lite5200 Eval Board"
depends on PPC_MULTIPLATFORM && PPC32
- select PPC_MPC5200
- select DEFAULT_UIMAGE
select WANT_DEVICE_TREE
+ select PPC_MPC5200
default n
+
+
diff --git a/trunk/arch/powerpc/platforms/52xx/Makefile b/trunk/arch/powerpc/platforms/52xx/Makefile
index fe1b81bb5224..307dbc178091 100644
--- a/trunk/arch/powerpc/platforms/52xx/Makefile
+++ b/trunk/arch/powerpc/platforms/52xx/Makefile
@@ -6,7 +6,6 @@ obj-y += mpc52xx_pic.o mpc52xx_common.o
obj-$(CONFIG_PCI) += mpc52xx_pci.o
endif
-obj-$(CONFIG_PPC_MPC5200_SIMPLE) += mpc5200_simple.o
obj-$(CONFIG_PPC_EFIKA) += efika.o
obj-$(CONFIG_PPC_LITE5200) += lite5200.o
diff --git a/trunk/arch/powerpc/platforms/52xx/lite5200.c b/trunk/arch/powerpc/platforms/52xx/lite5200.c
index 5a8d190f53e4..25d2bfa3d9dc 100644
--- a/trunk/arch/powerpc/platforms/52xx/lite5200.c
+++ b/trunk/arch/powerpc/platforms/52xx/lite5200.c
@@ -42,13 +42,10 @@
static void __init
lite5200_fix_clock_config(void)
{
- struct device_node *np;
struct mpc52xx_cdm __iomem *cdm;
/* Map zones */
- np = of_find_compatible_node(NULL, NULL, "mpc5200-cdm");
- cdm = of_iomap(np, 0);
- of_node_put(np);
+ cdm = mpc52xx_find_and_map("mpc5200-cdm");
if (!cdm) {
printk(KERN_ERR "%s() failed; expect abnormal behaviour\n",
__FUNCTION__);
@@ -77,13 +74,10 @@ lite5200_fix_clock_config(void)
static void __init
lite5200_fix_port_config(void)
{
- struct device_node *np;
struct mpc52xx_gpio __iomem *gpio;
u32 port_config;
- np = of_find_compatible_node(NULL, NULL, "mpc5200-gpio");
- gpio = of_iomap(np, 0);
- of_node_put(np);
+ gpio = mpc52xx_find_and_map("mpc5200-gpio");
if (!gpio) {
printk(KERN_ERR "%s() failed. expect abnormal behavior\n",
__FUNCTION__);
@@ -137,6 +131,10 @@ static void lite5200_resume_finish(void __iomem *mbar)
static void __init lite5200_setup_arch(void)
{
+#ifdef CONFIG_PCI
+ struct device_node *np;
+#endif
+
if (ppc_md.progress)
ppc_md.progress("lite5200_setup_arch()", 0);
@@ -156,7 +154,13 @@ static void __init lite5200_setup_arch(void)
lite5200_pm_init();
#endif
- mpc52xx_setup_pci();
+#ifdef CONFIG_PCI
+ np = of_find_node_by_type(NULL, "pci");
+ if (np) {
+ mpc52xx_add_bridge(np);
+ of_node_put(np);
+ }
+#endif
}
/*
diff --git a/trunk/arch/powerpc/platforms/52xx/lite5200_pm.c b/trunk/arch/powerpc/platforms/52xx/lite5200_pm.c
index c3ada1e340d2..ffa14aff5248 100644
--- a/trunk/arch/powerpc/platforms/52xx/lite5200_pm.c
+++ b/trunk/arch/powerpc/platforms/52xx/lite5200_pm.c
@@ -42,8 +42,6 @@ static int lite5200_pm_set_target(suspend_state_t state)
static int lite5200_pm_prepare(void)
{
- struct device_node *np;
-
/* deep sleep? let mpc52xx code handle that */
if (lite5200_pm_target_state == PM_SUSPEND_STANDBY)
return mpc52xx_pm_prepare();
@@ -52,9 +50,7 @@ static int lite5200_pm_prepare(void)
return -EINVAL;
/* map registers */
- np = of_find_compatible_node(NULL, NULL, "mpc5200");
- mbar = of_iomap(np, 0);
- of_node_put(np);
+ mbar = mpc52xx_find_and_map("mpc5200");
if (!mbar) {
printk(KERN_ERR "%s:%i Error mapping registers\n", __func__, __LINE__);
return -ENOSYS;
diff --git a/trunk/arch/powerpc/platforms/52xx/mpc5200_simple.c b/trunk/arch/powerpc/platforms/52xx/mpc5200_simple.c
deleted file mode 100644
index 754aa932f595..000000000000
--- a/trunk/arch/powerpc/platforms/52xx/mpc5200_simple.c
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Support for 'mpc5200-simple-platform' compatible boards.
- *
- * Written by Marian Balakowicz
- * Copyright (C) 2007 Semihalf
- *
- * 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.
- *
- * Description:
- * This code implements support for a simple MPC52xx based boards which
- * do not need a custom platform specific setup. Such boards are
- * supported assuming the following:
- *
- * - GPIO pins are configured by the firmware,
- * - CDM configuration (clocking) is setup correctly by firmware,
- * - if the 'fsl,has-wdt' property is present in one of the
- * gpt nodes, then it is safe to use such gpt to reset the board,
- * - PCI is supported if enabled in the kernel configuration
- * and if there is a PCI bus node defined in the device tree.
- *
- * Boards that are compatible with this generic platform support
- * are listed in a 'board' table.
- */
-
-#undef DEBUG
-#include
-#include
-#include
-#include
-
-/*
- * Setup the architecture
- */
-static void __init mpc5200_simple_setup_arch(void)
-{
- if (ppc_md.progress)
- ppc_md.progress("mpc5200_simple_setup_arch()", 0);
-
- /* Some mpc5200 & mpc5200b related configuration */
- mpc5200_setup_xlb_arbiter();
-
- /* Map wdt for mpc52xx_restart() */
- mpc52xx_map_wdt();
-
- mpc52xx_setup_pci();
-}
-
-/* list of the supported boards */
-static char *board[] __initdata = {
- "promess,motionpro",
- "schindler,cm5200",
- "tqc,tqm5200",
- NULL
-};
-
-/*
- * Called very early, MMU is off, device-tree isn't unflattened
- */
-static int __init mpc5200_simple_probe(void)
-{
- unsigned long node = of_get_flat_dt_root();
- int i = 0;
-
- while (board[i]) {
- if (of_flat_dt_is_compatible(node, board[i]))
- break;
- i++;
- }
-
- return (board[i] != NULL);
-}
-
-define_machine(mpc5200_simple_platform) {
- .name = "mpc5200-simple-platform",
- .probe = mpc5200_simple_probe,
- .setup_arch = mpc5200_simple_setup_arch,
- .init = mpc52xx_declare_of_platform_devices,
- .init_IRQ = mpc52xx_init_irq,
- .get_irq = mpc52xx_get_irq,
- .restart = mpc52xx_restart,
- .calibrate_decr = generic_calibrate_decr,
-};
diff --git a/trunk/arch/powerpc/platforms/52xx/mpc52xx_common.c b/trunk/arch/powerpc/platforms/52xx/mpc52xx_common.c
index 66955937be2a..9850685c5429 100644
--- a/trunk/arch/powerpc/platforms/52xx/mpc52xx_common.c
+++ b/trunk/arch/powerpc/platforms/52xx/mpc52xx_common.c
@@ -26,6 +26,45 @@
*/
static volatile struct mpc52xx_gpt *mpc52xx_wdt = NULL;
+static void __iomem *
+mpc52xx_map_node(struct device_node *ofn)
+{
+ const u32 *regaddr_p;
+ u64 regaddr64, size64;
+
+ if (!ofn)
+ return NULL;
+
+ regaddr_p = of_get_address(ofn, 0, &size64, NULL);
+ if (!regaddr_p) {
+ of_node_put(ofn);
+ return NULL;
+ }
+
+ regaddr64 = of_translate_address(ofn, regaddr_p);
+
+ of_node_put(ofn);
+
+ 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
* @node: device node
@@ -62,12 +101,9 @@ EXPORT_SYMBOL(mpc52xx_find_ipb_freq);
void __init
mpc5200_setup_xlb_arbiter(void)
{
- struct device_node *np;
struct mpc52xx_xlb __iomem *xlb;
- np = of_find_compatible_node(NULL, NULL, "mpc5200-xlb");
- xlb = of_iomap(np, 0);
- of_node_put(np);
+ xlb = mpc52xx_find_and_map("mpc5200-xlb");
if (!xlb) {
printk(KERN_ERR __FILE__ ": "
"Error mapping XLB in mpc52xx_setup_cpu(). "
@@ -88,21 +124,11 @@ mpc5200_setup_xlb_arbiter(void)
iounmap(xlb);
}
-static struct of_device_id mpc52xx_bus_ids[] __initdata= {
- { .compatible = "fsl,mpc5200-immr", },
- { .compatible = "fsl,lpb", },
-
- /* depreciated matches; shouldn't be used in new device trees */
- { .type = "builtin", .compatible = "mpc5200", }, /* efika */
- { .type = "soc", .compatible = "mpc5200", }, /* lite5200 */
- {},
-};
-
void __init
mpc52xx_declare_of_platform_devices(void)
{
/* Find every child of the SOC node and add it to of_platform */
- if (of_platform_bus_probe(NULL, mpc52xx_bus_ids, NULL))
+ if (of_platform_bus_probe(NULL, NULL, NULL))
printk(KERN_ERR __FILE__ ": "
"Error while probing of_platform bus\n");
}
@@ -120,19 +146,16 @@ mpc52xx_map_wdt(void)
for_each_compatible_node(np, NULL, "fsl,mpc5200-gpt") {
has_wdt = of_get_property(np, "fsl,has-wdt", NULL);
if (has_wdt) {
- mpc52xx_wdt = of_iomap(np, 0);
- of_node_put(np);
+ 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 = of_iomap(np, 0);
- of_node_put(np);
+ mpc52xx_wdt = mpc52xx_map_node(np);
return;
}
-
}
}
diff --git a/trunk/arch/powerpc/platforms/52xx/mpc52xx_pci.c b/trunk/arch/powerpc/platforms/52xx/mpc52xx_pci.c
index 4b79398b2e40..262eda8659d0 100644
--- a/trunk/arch/powerpc/platforms/52xx/mpc52xx_pci.c
+++ b/trunk/arch/powerpc/platforms/52xx/mpc52xx_pci.c
@@ -406,17 +406,3 @@ mpc52xx_add_bridge(struct device_node *node)
return 0;
}
-
-void __init mpc52xx_setup_pci(void)
-{
- struct device_node *pci;
-
- pci = of_find_compatible_node(NULL, NULL, "fsl,mpc5200-pci");
- if (!pci)
- pci = of_find_compatible_node(NULL, NULL, "mpc5200-pci");
- if (!pci)
- return;
-
- mpc52xx_add_bridge(pci);
- of_node_put(pci);
-}
diff --git a/trunk/arch/powerpc/platforms/52xx/mpc52xx_pic.c b/trunk/arch/powerpc/platforms/52xx/mpc52xx_pic.c
index 07e89876d582..61100f270c68 100644
--- a/trunk/arch/powerpc/platforms/52xx/mpc52xx_pic.c
+++ b/trunk/arch/powerpc/platforms/52xx/mpc52xx_pic.c
@@ -364,18 +364,16 @@ void __init mpc52xx_init_irq(void)
{
u32 intr_ctrl;
struct device_node *picnode;
- struct device_node *np;
/* Remap the necessary zones */
picnode = of_find_compatible_node(NULL, NULL, "mpc5200-pic");
- intr = of_iomap(picnode, 0);
+
+ intr = mpc52xx_find_and_map("mpc5200-pic");
if (!intr)
panic(__FILE__ ": find_and_map failed on 'mpc5200-pic'. "
"Check node !");
- np = of_find_compatible_node(NULL, NULL, "mpc5200-bestcomm");
- sdma = of_iomap(np, 0);
- of_node_put(np);
+ sdma = mpc52xx_find_and_map("mpc5200-bestcomm");
if (!sdma)
panic(__FILE__ ": find_and_map failed on 'mpc5200-bestcomm'. "
"Check node !");
diff --git a/trunk/arch/powerpc/platforms/52xx/mpc52xx_pm.c b/trunk/arch/powerpc/platforms/52xx/mpc52xx_pm.c
index 52f027789c8f..7ffa7babf254 100644
--- a/trunk/arch/powerpc/platforms/52xx/mpc52xx_pm.c
+++ b/trunk/arch/powerpc/platforms/52xx/mpc52xx_pm.c
@@ -59,14 +59,10 @@ int mpc52xx_set_wakeup_gpio(u8 pin, u8 level)
int mpc52xx_pm_prepare(void)
{
- struct device_node *np;
-
/* map the whole register space */
- np = of_find_compatible_node(NULL, NULL, "mpc5200");
- mbar = of_iomap(np, 0);
- of_node_put(np);
+ mbar = mpc52xx_find_and_map("mpc5200");
if (!mbar) {
- pr_err("mpc52xx_pm_prepare(): could not map registers\n");
+ printk(KERN_ERR "%s:%i Error mapping registers\n", __func__, __LINE__);
return -ENOSYS;
}
/* these offsets are from mpc5200 users manual */
diff --git a/trunk/arch/powerpc/platforms/cell/Kconfig b/trunk/arch/powerpc/platforms/cell/Kconfig
index 3a963b4a9be0..e1e2f6a43019 100644
--- a/trunk/arch/powerpc/platforms/cell/Kconfig
+++ b/trunk/arch/powerpc/platforms/cell/Kconfig
@@ -88,8 +88,3 @@ config CBE_CPUFREQ_PMI
but also at lower core voltage.
endmenu
-
-config OPROFILE_CELL
- def_bool y
- depends on PPC_CELL_NATIVE && (OPROFILE = m || OPROFILE = y)
-
diff --git a/trunk/arch/powerpc/platforms/cell/Makefile b/trunk/arch/powerpc/platforms/cell/Makefile
index c89964c6fb1f..3cd565a04d0a 100644
--- a/trunk/arch/powerpc/platforms/cell/Makefile
+++ b/trunk/arch/powerpc/platforms/cell/Makefile
@@ -19,7 +19,6 @@ spu-manage-$(CONFIG_PPC_CELLEB) += spu_manage.o
spu-manage-$(CONFIG_PPC_CELL_NATIVE) += spu_manage.o
obj-$(CONFIG_SPU_BASE) += spu_callbacks.o spu_base.o \
- spu_notify.o \
spu_syscalls.o spu_fault.o \
$(spu-priv1-y) \
$(spu-manage-y) \
diff --git a/trunk/arch/powerpc/platforms/cell/spu_notify.c b/trunk/arch/powerpc/platforms/cell/spu_notify.c
deleted file mode 100644
index 34d156959f39..000000000000
--- a/trunk/arch/powerpc/platforms/cell/spu_notify.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Move OProfile dependencies from spufs module to the kernel so it
- * can run on non-cell PPC.
- *
- * Copyright (C) IBM 2005
- *
- * 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, 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., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#undef DEBUG
-
-#include
-#include
-#include "spufs/spufs.h"
-
-static BLOCKING_NOTIFIER_HEAD(spu_switch_notifier);
-
-void spu_switch_notify(struct spu *spu, struct spu_context *ctx)
-{
- blocking_notifier_call_chain(&spu_switch_notifier,
- ctx ? ctx->object_id : 0, spu);
-}
-EXPORT_SYMBOL_GPL(spu_switch_notify);
-
-int spu_switch_event_register(struct notifier_block *n)
-{
- int ret;
- ret = blocking_notifier_chain_register(&spu_switch_notifier, n);
- if (!ret)
- notify_spus_active();
- return ret;
-}
-EXPORT_SYMBOL_GPL(spu_switch_event_register);
-
-int spu_switch_event_unregister(struct notifier_block *n)
-{
- return blocking_notifier_chain_unregister(&spu_switch_notifier, n);
-}
-EXPORT_SYMBOL_GPL(spu_switch_event_unregister);
-
-void spu_set_profile_private_kref(struct spu_context *ctx,
- struct kref *prof_info_kref,
- void (* prof_info_release) (struct kref *kref))
-{
- ctx->prof_priv_kref = prof_info_kref;
- ctx->prof_priv_release = prof_info_release;
-}
-EXPORT_SYMBOL_GPL(spu_set_profile_private_kref);
-
-void *spu_get_profile_private_kref(struct spu_context *ctx)
-{
- return ctx->prof_priv_kref;
-}
-EXPORT_SYMBOL_GPL(spu_get_profile_private_kref);
-
diff --git a/trunk/arch/powerpc/platforms/cell/spu_syscalls.c b/trunk/arch/powerpc/platforms/cell/spu_syscalls.c
index 75530d99eda6..a9438b719fe8 100644
--- a/trunk/arch/powerpc/platforms/cell/spu_syscalls.c
+++ b/trunk/arch/powerpc/platforms/cell/spu_syscalls.c
@@ -145,20 +145,6 @@ int elf_coredump_extra_notes_write(struct file *file, loff_t *foffset)
return ret;
}
-void notify_spus_active(void)
-{
- struct spufs_calls *calls;
-
- calls = spufs_calls_get();
- if (!calls)
- return;
-
- calls->notify_spus_active();
- spufs_calls_put(calls);
-
- return;
-}
-
int register_spu_syscalls(struct spufs_calls *calls)
{
if (spufs_calls)
diff --git a/trunk/arch/powerpc/platforms/cell/spufs/context.c b/trunk/arch/powerpc/platforms/cell/spufs/context.c
index 133995ed5cc7..237e152d31dc 100644
--- a/trunk/arch/powerpc/platforms/cell/spufs/context.c
+++ b/trunk/arch/powerpc/platforms/cell/spufs/context.c
@@ -177,3 +177,19 @@ void spu_release_saved(struct spu_context *ctx)
spu_release(ctx);
}
+void spu_set_profile_private_kref(struct spu_context *ctx,
+ struct kref *prof_info_kref,
+ void ( * prof_info_release) (struct kref *kref))
+{
+ ctx->prof_priv_kref = prof_info_kref;
+ ctx->prof_priv_release = prof_info_release;
+}
+EXPORT_SYMBOL_GPL(spu_set_profile_private_kref);
+
+void *spu_get_profile_private_kref(struct spu_context *ctx)
+{
+ return ctx->prof_priv_kref;
+}
+EXPORT_SYMBOL_GPL(spu_get_profile_private_kref);
+
+
diff --git a/trunk/arch/powerpc/platforms/cell/spufs/sched.c b/trunk/arch/powerpc/platforms/cell/spufs/sched.c
index 00d914232af1..8c8af11b35b4 100644
--- a/trunk/arch/powerpc/platforms/cell/spufs/sched.c
+++ b/trunk/arch/powerpc/platforms/cell/spufs/sched.c
@@ -182,7 +182,15 @@ static int node_allowed(struct spu_context *ctx, int node)
return rval;
}
-void do_notify_spus_active(void)
+static BLOCKING_NOTIFIER_HEAD(spu_switch_notifier);
+
+void spu_switch_notify(struct spu *spu, struct spu_context *ctx)
+{
+ blocking_notifier_call_chain(&spu_switch_notifier,
+ ctx ? ctx->object_id : 0, spu);
+}
+
+static void notify_spus_active(void)
{
int node;
@@ -209,6 +217,22 @@ void do_notify_spus_active(void)
}
}
+int spu_switch_event_register(struct notifier_block * n)
+{
+ int ret;
+ ret = blocking_notifier_chain_register(&spu_switch_notifier, n);
+ if (!ret)
+ notify_spus_active();
+ return ret;
+}
+EXPORT_SYMBOL_GPL(spu_switch_event_register);
+
+int spu_switch_event_unregister(struct notifier_block * n)
+{
+ return blocking_notifier_chain_unregister(&spu_switch_notifier, n);
+}
+EXPORT_SYMBOL_GPL(spu_switch_event_unregister);
+
/**
* spu_bind_context - bind spu context to physical spu
* @spu: physical spu to bind to
diff --git a/trunk/arch/powerpc/platforms/cell/spufs/syscalls.c b/trunk/arch/powerpc/platforms/cell/spufs/syscalls.c
index 430404413178..2c34f7170190 100644
--- a/trunk/arch/powerpc/platforms/cell/spufs/syscalls.c
+++ b/trunk/arch/powerpc/platforms/cell/spufs/syscalls.c
@@ -86,6 +86,5 @@ struct spufs_calls spufs_calls = {
.spu_run = do_spu_run,
.coredump_extra_notes_size = spufs_coredump_extra_notes_size,
.coredump_extra_notes_write = spufs_coredump_extra_notes_write,
- .notify_spus_active = do_notify_spus_active,
.owner = THIS_MODULE,
};
diff --git a/trunk/arch/powerpc/platforms/ps3/os-area.c b/trunk/arch/powerpc/platforms/ps3/os-area.c
index b9ea09d9d2fb..766685ab26f8 100644
--- a/trunk/arch/powerpc/platforms/ps3/os-area.c
+++ b/trunk/arch/powerpc/platforms/ps3/os-area.c
@@ -23,7 +23,6 @@
#include
#include
#include
-#include
#include
@@ -38,8 +37,6 @@ enum os_area_ldr_format {
HEADER_LDR_FORMAT_GZIP = 1,
};
-#define OS_AREA_HEADER_MAGIC_NUM "cell_ext_os_area"
-
/**
* struct os_area_header - os area header segment.
* @magic_num: Always 'cell_ext_os_area'.
@@ -117,11 +114,13 @@ struct os_area_params {
u8 _reserved_5[8];
};
-#define OS_AREA_DB_MAGIC_NUM "-db-"
+enum {
+ OS_AREA_DB_MAGIC_NUM = 0x2d64622dU,
+};
/**
* struct os_area_db - Shared flash memory database.
- * @magic_num: Always '-db-'.
+ * @magic_num: Always '-db-' = 0x2d64622d.
* @version: os_area_db format version number.
* @index_64: byte offset of the database id index for 64 bit variables.
* @count_64: number of usable 64 bit index entries
@@ -136,7 +135,7 @@ struct os_area_params {
*/
struct os_area_db {
- u8 magic_num[4];
+ u32 magic_num;
u16 version;
u16 _reserved_1;
u16 index_64;
@@ -266,26 +265,12 @@ static void __init os_area_get_property(struct device_node *node,
prop->name);
}
-static void dump_field(char *s, const u8 *field, int size_of_field)
-{
-#if defined(DEBUG)
- int i;
-
- for (i = 0; i < size_of_field; i++)
- s[i] = isprint(field[i]) ? field[i] : '.';
- s[i] = 0;
-#endif
-}
-
#define dump_header(_a) _dump_header(_a, __func__, __LINE__)
static void _dump_header(const struct os_area_header *h, const char *func,
int line)
{
- char str[sizeof(h->magic_num) + 1];
-
- dump_field(str, h->magic_num, sizeof(h->magic_num));
pr_debug("%s:%d: h.magic_num: '%s'\n", func, line,
- str);
+ h->magic_num);
pr_debug("%s:%d: h.hdr_version: %u\n", func, line,
h->hdr_version);
pr_debug("%s:%d: h.db_area_offset: %u\n", func, line,
@@ -326,8 +311,7 @@ static void _dump_params(const struct os_area_params *p, const char *func,
static int verify_header(const struct os_area_header *header)
{
- if (memcmp(header->magic_num, OS_AREA_HEADER_MAGIC_NUM,
- sizeof(header->magic_num))) {
+ if (memcmp(header->magic_num, "cell_ext_os_area", 16)) {
pr_debug("%s:%d magic_num failed\n", __func__, __LINE__);
return -1;
}
@@ -347,8 +331,7 @@ static int verify_header(const struct os_area_header *header)
static int db_verify(const struct os_area_db *db)
{
- if (memcmp(db->magic_num, OS_AREA_DB_MAGIC_NUM,
- sizeof(db->magic_num))) {
+ if (db->magic_num != OS_AREA_DB_MAGIC_NUM) {
pr_debug("%s:%d magic_num failed\n", __func__, __LINE__);
return -1;
}
@@ -501,11 +484,8 @@ static int db_get_rtc_diff(const struct os_area_db *db, int64_t *rtc_diff)
static void _dump_db(const struct os_area_db *db, const char *func,
int line)
{
- char str[sizeof(db->magic_num) + 1];
-
- dump_field(str, db->magic_num, sizeof(db->magic_num));
pr_debug("%s:%d: db.magic_num: '%s'\n", func, line,
- str);
+ (const char*)&db->magic_num);
pr_debug("%s:%d: db.version: %u\n", func, line,
db->version);
pr_debug("%s:%d: db.index_64: %u\n", func, line,
@@ -536,7 +516,7 @@ static void os_area_db_init(struct os_area_db *db)
memset(db, 0, sizeof(struct os_area_db));
- memcpy(db->magic_num, OS_AREA_DB_MAGIC_NUM, sizeof(db->magic_num));
+ db->magic_num = OS_AREA_DB_MAGIC_NUM;
db->version = 1;
db->index_64 = HEADER_SIZE;
db->count_64 = VALUES_64_COUNT;
diff --git a/trunk/arch/powerpc/platforms/pseries/hotplug-cpu.c b/trunk/arch/powerpc/platforms/pseries/hotplug-cpu.c
index 412e6b42986f..fc48b96c81bf 100644
--- a/trunk/arch/powerpc/platforms/pseries/hotplug-cpu.c
+++ b/trunk/arch/powerpc/platforms/pseries/hotplug-cpu.c
@@ -29,7 +29,6 @@
#include
#include
#include "xics.h"
-#include "plpar_wrappers.h"
/* This version can't take the spinlock, because it never returns */
static struct rtas_args rtas_stop_self_args = {
@@ -59,7 +58,6 @@ static void pseries_mach_cpu_die(void)
local_irq_disable();
idle_task_exit();
xics_teardown_cpu(0);
- unregister_slb_shadow(hard_smp_processor_id(), __pa(get_slb_shadow()));
rtas_stop_self();
/* Should never get here... */
BUG();
diff --git a/trunk/arch/sparc/kernel/ptrace.c b/trunk/arch/sparc/kernel/ptrace.c
index 7452269bba2a..fe562db475e9 100644
--- a/trunk/arch/sparc/kernel/ptrace.c
+++ b/trunk/arch/sparc/kernel/ptrace.c
@@ -5,7 +5,7 @@
* Based upon code written by Ross Biro, Linus Torvalds, Bob Manson,
* and David Mosberger.
*
- * Added Linux support -miguel (weird, eh?, the original code was meant
+ * Added Linux support -miguel (weird, eh?, the orignal code was meant
* to emulate SunOS).
*/
diff --git a/trunk/arch/sparc/kernel/time.c b/trunk/arch/sparc/kernel/time.c
index 00b393c3a4a0..45cb7c5286d7 100644
--- a/trunk/arch/sparc/kernel/time.c
+++ b/trunk/arch/sparc/kernel/time.c
@@ -436,14 +436,7 @@ void __init time_init(void)
static inline unsigned long do_gettimeoffset(void)
{
- unsigned long val = *master_l10_counter;
- unsigned long usec = (val >> 10) & 0x1fffff;
-
- /* Limit hit? */
- if (val & 0x80000000)
- usec += 1000000 / HZ;
-
- return usec;
+ return (*master_l10_counter >> 10) & 0x1fffff;
}
/* Ok, my cute asm atomicity trick doesn't work anymore.
diff --git a/trunk/arch/sparc64/kernel/ktlb.S b/trunk/arch/sparc64/kernel/ktlb.S
index cef8defcd7a9..964527d2ffa0 100644
--- a/trunk/arch/sparc64/kernel/ktlb.S
+++ b/trunk/arch/sparc64/kernel/ktlb.S
@@ -1,6 +1,6 @@
/* arch/sparc64/kernel/ktlb.S: Kernel mapping TLB miss handling.
*
- * Copyright (C) 1995, 1997, 2005, 2008 David S. Miller
+ * Copyright (C) 1995, 1997, 2005 David S. Miller
* Copyright (C) 1996 Eddie C. Dost (ecd@brainaid.de)
* Copyright (C) 1996 Miguel de Icaza (miguel@nuclecu.unam.mx)
* Copyright (C) 1996,98,99 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
@@ -226,7 +226,6 @@ kvmap_dtlb_load:
ba,pt %xcc, sun4v_dtlb_load
mov %g5, %g3
-#ifdef CONFIG_SPARSEMEM_VMEMMAP
kvmap_vmemmap:
sub %g4, %g5, %g5
srlx %g5, 22, %g5
@@ -235,7 +234,6 @@ kvmap_vmemmap:
or %g1, %lo(vmemmap_table), %g1
ba,pt %xcc, kvmap_dtlb_load
ldx [%g1 + %g5], %g5
-#endif
kvmap_dtlb_nonlinear:
/* Catch kernel NULL pointer derefs. */
@@ -244,14 +242,12 @@ kvmap_dtlb_nonlinear:
bleu,pn %xcc, kvmap_dtlb_longpath
nop
-#ifdef CONFIG_SPARSEMEM_VMEMMAP
/* Do not use the TSB for vmemmap. */
mov (VMEMMAP_BASE >> 24), %g5
sllx %g5, 24, %g5
cmp %g4,%g5
bgeu,pn %xcc, kvmap_vmemmap
nop
-#endif
KERN_TSB_LOOKUP_TL1(%g4, %g6, %g5, %g1, %g2, %g3, kvmap_dtlb_load)
diff --git a/trunk/arch/sparc64/kernel/pci.c b/trunk/arch/sparc64/kernel/pci.c
index a61c38fe75ea..63b3ebc0c3c2 100644
--- a/trunk/arch/sparc64/kernel/pci.c
+++ b/trunk/arch/sparc64/kernel/pci.c
@@ -1275,20 +1275,4 @@ int pci_dma_supported(struct pci_dev *pdev, u64 device_mask)
return (device_mask & dma_addr_mask) == dma_addr_mask;
}
-void pci_resource_to_user(const struct pci_dev *pdev, int bar,
- const struct resource *rp, resource_size_t *start,
- resource_size_t *end)
-{
- struct pci_pbm_info *pbm = pdev->dev.archdata.host_controller;
- unsigned long offset;
-
- if (rp->flags & IORESOURCE_IO)
- offset = pbm->io_space.start;
- else
- offset = pbm->mem_space.start;
-
- *start = rp->start - offset;
- *end = rp->end - offset;
-}
-
#endif /* !(CONFIG_PCI) */
diff --git a/trunk/arch/sparc64/kernel/pci_schizo.c b/trunk/arch/sparc64/kernel/pci_schizo.c
index e752e75cce83..9546ba9f5dee 100644
--- a/trunk/arch/sparc64/kernel/pci_schizo.c
+++ b/trunk/arch/sparc64/kernel/pci_schizo.c
@@ -850,7 +850,7 @@ static int pbm_routes_this_ino(struct pci_pbm_info *pbm, u32 ino)
/* How the Tomatillo IRQs are routed around is pure guesswork here.
*
* All the Tomatillo devices I see in prtconf dumps seem to have only
- * a single PCI bus unit attached to it. It would seem they are separate
+ * a single PCI bus unit attached to it. It would seem they are seperate
* devices because their PortID (ie. JBUS ID) values are all different
* and thus the registers are mapped to totally different locations.
*
diff --git a/trunk/arch/sparc64/kernel/sun4v_tlb_miss.S b/trunk/arch/sparc64/kernel/sun4v_tlb_miss.S
index fd9430562e0b..9871dbb1ab42 100644
--- a/trunk/arch/sparc64/kernel/sun4v_tlb_miss.S
+++ b/trunk/arch/sparc64/kernel/sun4v_tlb_miss.S
@@ -215,7 +215,6 @@ sun4v_itlb_error:
1: ba,pt %xcc, etrap
2: or %g7, %lo(2b), %g7
- mov %l4, %o1
call sun4v_itlb_error_report
add %sp, PTREGS_OFF, %o0
@@ -242,7 +241,6 @@ sun4v_dtlb_error:
1: ba,pt %xcc, etrap
2: or %g7, %lo(2b), %g7
- mov %l4, %o1
call sun4v_dtlb_error_report
add %sp, PTREGS_OFF, %o0
diff --git a/trunk/arch/sparc64/kernel/traps.c b/trunk/arch/sparc64/kernel/traps.c
index 2b6abf633343..04998388259f 100644
--- a/trunk/arch/sparc64/kernel/traps.c
+++ b/trunk/arch/sparc64/kernel/traps.c
@@ -1950,8 +1950,6 @@ void sun4v_itlb_error_report(struct pt_regs *regs, int tl)
printk(KERN_EMERG "SUN4V-ITLB: Error at TPC[%lx], tl %d\n",
regs->tpc, tl);
print_symbol(KERN_EMERG "SUN4V-ITLB: TPC<%s>\n", regs->tpc);
- printk(KERN_EMERG "SUN4V-ITLB: O7[%lx]\n", regs->u_regs[UREG_I7]);
- print_symbol(KERN_EMERG "SUN4V-ITLB: O7<%s>\n", regs->u_regs[UREG_I7]);
printk(KERN_EMERG "SUN4V-ITLB: vaddr[%lx] ctx[%lx] "
"pte[%lx] error[%lx]\n",
sun4v_err_itlb_vaddr, sun4v_err_itlb_ctx,
@@ -1973,8 +1971,6 @@ void sun4v_dtlb_error_report(struct pt_regs *regs, int tl)
printk(KERN_EMERG "SUN4V-DTLB: Error at TPC[%lx], tl %d\n",
regs->tpc, tl);
print_symbol(KERN_EMERG "SUN4V-DTLB: TPC<%s>\n", regs->tpc);
- printk(KERN_EMERG "SUN4V-DTLB: O7[%lx]\n", regs->u_regs[UREG_I7]);
- print_symbol(KERN_EMERG "SUN4V-DTLB: O7<%s>\n", regs->u_regs[UREG_I7]);
printk(KERN_EMERG "SUN4V-DTLB: vaddr[%lx] ctx[%lx] "
"pte[%lx] error[%lx]\n",
sun4v_err_dtlb_vaddr, sun4v_err_dtlb_ctx,
diff --git a/trunk/arch/um/drivers/harddog_user.c b/trunk/arch/um/drivers/harddog_user.c
index 448ba59207a1..b56f8e0196a9 100644
--- a/trunk/arch/um/drivers/harddog_user.c
+++ b/trunk/arch/um/drivers/harddog_user.c
@@ -79,14 +79,14 @@ int start_watchdog(int *in_fd_ret, int *out_fd_ret, char *sock)
n = read(in_fds[0], &c, sizeof(c));
if (n == 0) {
printk("harddog_open - EOF on watchdog pipe\n");
- helper_wait(pid, 1, NULL);
+ helper_wait(pid);
err = -EIO;
goto out_close_out;
}
else if (n < 0) {
printk("harddog_open - read of watchdog pipe failed, "
"err = %d\n", errno);
- helper_wait(pid, 1, NULL);
+ helper_wait(pid);
err = n;
goto out_close_out;
}
diff --git a/trunk/arch/x86/kernel/apm_32.c b/trunk/arch/x86/kernel/apm_32.c
index af045ca0f653..17089a041028 100644
--- a/trunk/arch/x86/kernel/apm_32.c
+++ b/trunk/arch/x86/kernel/apm_32.c
@@ -2256,12 +2256,14 @@ static int __init apm_init(void)
apm_info.disabled = 1;
return -ENODEV;
}
- if (pm_flags & PM_ACPI) {
+ if (PM_IS_ACTIVE()) {
printk(KERN_NOTICE "apm: overridden by ACPI.\n");
apm_info.disabled = 1;
return -ENODEV;
}
- pm_flags |= PM_APM;
+#ifdef CONFIG_PM_LEGACY
+ pm_active = 1;
+#endif
/*
* Set up a segment that references the real mode segment 0x40
@@ -2364,7 +2366,9 @@ static void __exit apm_exit(void)
kthread_stop(kapmd_task);
kapmd_task = NULL;
}
- pm_flags &= ~PM_APM;
+#ifdef CONFIG_PM_LEGACY
+ pm_active = 0;
+#endif
}
module_init(apm_init);
diff --git a/trunk/arch/x86/kernel/head_32.S b/trunk/arch/x86/kernel/head_32.S
index fbad51fce672..ac0637a6d71c 100644
--- a/trunk/arch/x86/kernel/head_32.S
+++ b/trunk/arch/x86/kernel/head_32.S
@@ -196,7 +196,7 @@ default_entry:
/* Do an early initialization of the fixmap area */
movl $(swapper_pg_dir - __PAGE_OFFSET), %edx
movl $(swapper_pg_pmd - __PAGE_OFFSET), %eax
- addl $0x67, %eax /* 0x67 == _PAGE_TABLE */
+ addl $0x007, %eax /* 0x007 = PRESENT+RW+USER */
movl %eax, 4092(%edx)
xorl %ebx,%ebx /* This is the boot CPU (BSP) */
diff --git a/trunk/arch/x86/kernel/hpet.c b/trunk/arch/x86/kernel/hpet.c
index 2f99ee206b95..4a86ffd67ec5 100644
--- a/trunk/arch/x86/kernel/hpet.c
+++ b/trunk/arch/x86/kernel/hpet.c
@@ -657,7 +657,7 @@ irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id)
hpet_pie_count = 0;
}
- if (hpet_rtc_flags & RTC_AIE &&
+ if (hpet_rtc_flags & RTC_PIE &&
(curr_time.tm_sec == hpet_alarm_time.tm_sec) &&
(curr_time.tm_min == hpet_alarm_time.tm_min) &&
(curr_time.tm_hour == hpet_alarm_time.tm_hour))
diff --git a/trunk/arch/x86/kernel/io_apic_32.c b/trunk/arch/x86/kernel/io_apic_32.c
index a6b1490e00c4..c3a565bba106 100644
--- a/trunk/arch/x86/kernel/io_apic_32.c
+++ b/trunk/arch/x86/kernel/io_apic_32.c
@@ -2169,10 +2169,14 @@ static inline void __init check_timer(void)
{
int apic1, pin1, apic2, pin2;
int vector;
+ unsigned int ver;
unsigned long flags;
local_irq_save(flags);
+ ver = apic_read(APIC_LVR);
+ ver = GET_APIC_VERSION(ver);
+
/*
* get/set the timer IRQ vector:
*/
@@ -2185,11 +2189,15 @@ static inline void __init check_timer(void)
* mode for the 8259A whenever interrupts are routed
* through I/O APICs. Also IRQ0 has to be enabled in
* the 8259A which implies the virtual wire has to be
- * disabled in the local APIC.
+ * disabled in the local APIC. Finally timer interrupts
+ * need to be acknowledged manually in the 8259A for
+ * timer_interrupt() and for the i82489DX when using
+ * the NMI watchdog.
*/
apic_write_around(APIC_LVT0, APIC_LVT_MASKED | APIC_DM_EXTINT);
init_8259A(1);
- timer_ack = 1;
+ timer_ack = !cpu_has_tsc;
+ timer_ack |= (nmi_watchdog == NMI_IO_APIC && !APIC_INTEGRATED(ver));
if (timer_over_8254 > 0)
enable_8259A_irq(0);
diff --git a/trunk/arch/x86/kernel/mfgpt_32.c b/trunk/arch/x86/kernel/mfgpt_32.c
index 3960ab7e1497..0ab680f2d9db 100644
--- a/trunk/arch/x86/kernel/mfgpt_32.c
+++ b/trunk/arch/x86/kernel/mfgpt_32.c
@@ -278,12 +278,12 @@ static int mfgpt_next_event(unsigned long delta, struct clock_event_device *evt)
static irqreturn_t mfgpt_tick(int irq, void *dev_id)
{
- /* Turn off the clock (and clear the event) */
- mfgpt_disable_timer(mfgpt_event_clock);
-
if (mfgpt_tick_mode == CLOCK_EVT_MODE_SHUTDOWN)
return IRQ_HANDLED;
+ /* Turn off the clock */
+ mfgpt_disable_timer(mfgpt_event_clock);
+
/* Clear the counter */
geode_mfgpt_write(mfgpt_event_clock, MFGPT_REG_COUNTER, 0);
@@ -319,6 +319,10 @@ static int __init mfgpt_timer_setup(void)
}
mfgpt_event_clock = timer;
+ /* Set the clock scale and enable the event mode for CMP2 */
+ val = MFGPT_SCALE | (3 << 8);
+
+ geode_mfgpt_write(mfgpt_event_clock, MFGPT_REG_SETUP, val);
/* Set up the IRQ on the MFGPT side */
if (geode_mfgpt_setup_irq(mfgpt_event_clock, MFGPT_CMP2, irq)) {
@@ -335,11 +339,6 @@ static int __init mfgpt_timer_setup(void)
goto err;
}
- /* Set the clock scale and enable the event mode for CMP2 */
- val = MFGPT_SCALE | (3 << 8);
-
- geode_mfgpt_write(mfgpt_event_clock, MFGPT_REG_SETUP, val);
-
/* Set up the clock event */
mfgpt_clockevent.mult = div_sc(MFGPT_HZ, NSEC_PER_SEC, 32);
mfgpt_clockevent.min_delta_ns = clockevent_delta2ns(0xF,
diff --git a/trunk/arch/x86/kernel/nmi_32.c b/trunk/arch/x86/kernel/nmi_32.c
index 852db2906921..80ca72e5ac29 100644
--- a/trunk/arch/x86/kernel/nmi_32.c
+++ b/trunk/arch/x86/kernel/nmi_32.c
@@ -25,6 +25,7 @@
#include
#include
+#include
#include "mach_traps.h"
@@ -83,7 +84,7 @@ static int __init check_nmi_watchdog(void)
prev_nmi_count = kmalloc(NR_CPUS * sizeof(int), GFP_KERNEL);
if (!prev_nmi_count)
- return -1;
+ goto error;
printk(KERN_INFO "Testing NMI watchdog ... ");
@@ -118,7 +119,7 @@ static int __init check_nmi_watchdog(void)
if (!atomic_read(&nmi_active)) {
kfree(prev_nmi_count);
atomic_set(&nmi_active, -1);
- return -1;
+ goto error;
}
printk("OK.\n");
@@ -129,6 +130,10 @@ static int __init check_nmi_watchdog(void)
kfree(prev_nmi_count);
return 0;
+error:
+ timer_ack = !cpu_has_tsc;
+
+ return -1;
}
/* This needs to happen later in boot so counters are working */
late_initcall(check_nmi_watchdog);
diff --git a/trunk/arch/x86/kernel/process_32.c b/trunk/arch/x86/kernel/process_32.c
index 46d391d49de8..9663c2a74830 100644
--- a/trunk/arch/x86/kernel/process_32.c
+++ b/trunk/arch/x86/kernel/process_32.c
@@ -204,10 +204,6 @@ void cpu_idle(void)
}
}
-static void do_nothing(void *unused)
-{
-}
-
void cpu_idle_wait(void)
{
unsigned int cpu, this_cpu = get_cpu();
@@ -232,13 +228,6 @@ void cpu_idle_wait(void)
cpu_clear(cpu, map);
}
cpus_and(map, map, cpu_online_map);
- /*
- * We waited 1 sec, if a CPU still did not call idle
- * it may be because it is in idle and not waking up
- * because it has nothing to do.
- * Give all the remaining CPUS a kick.
- */
- smp_call_function_mask(map, do_nothing, 0, 0);
} while (!cpus_empty(map));
set_cpus_allowed(current, tmp);
diff --git a/trunk/arch/x86/kernel/process_64.c b/trunk/arch/x86/kernel/process_64.c
index ab79e1dfa023..6309b275cb9c 100644
--- a/trunk/arch/x86/kernel/process_64.c
+++ b/trunk/arch/x86/kernel/process_64.c
@@ -135,10 +135,6 @@ static void poll_idle (void)
cpu_relax();
}
-static void do_nothing(void *unused)
-{
-}
-
void cpu_idle_wait(void)
{
unsigned int cpu, this_cpu = get_cpu();
@@ -164,13 +160,6 @@ void cpu_idle_wait(void)
cpu_clear(cpu, map);
}
cpus_and(map, map, cpu_online_map);
- /*
- * We waited 1 sec, if a CPU still did not call idle
- * it may be because it is in idle and not waking up
- * because it has nothing to do.
- * Give all the remaining CPUS a kick.
- */
- smp_call_function_mask(map, do_nothing, 0, 0);
} while (!cpus_empty(map));
set_cpus_allowed(current, tmp);
diff --git a/trunk/arch/x86/kernel/smpboot_64.c b/trunk/arch/x86/kernel/smpboot_64.c
index aaf4e1291217..594889521da1 100644
--- a/trunk/arch/x86/kernel/smpboot_64.c
+++ b/trunk/arch/x86/kernel/smpboot_64.c
@@ -141,8 +141,8 @@ static void __cpuinit smp_store_cpu_info(int id)
struct cpuinfo_x86 *c = &cpu_data(id);
*c = boot_cpu_data;
- c->cpu_index = id;
identify_cpu(c);
+ c->cpu_index = id;
print_cpu_info(c);
}
@@ -526,7 +526,7 @@ struct create_idle {
int cpu;
};
-static void __cpuinit do_fork_idle(struct work_struct *work)
+void do_fork_idle(struct work_struct *work)
{
struct create_idle *c_idle =
container_of(work, struct create_idle, work);
diff --git a/trunk/arch/x86/kernel/traps_32.c b/trunk/arch/x86/kernel/traps_32.c
index 02d1e1e58e81..c88bbffcaa03 100644
--- a/trunk/arch/x86/kernel/traps_32.c
+++ b/trunk/arch/x86/kernel/traps_32.c
@@ -541,7 +541,6 @@ fastcall void do_##name(struct pt_regs * regs, long error_code) \
info.si_errno = 0; \
info.si_code = sicode; \
info.si_addr = (void __user *)siaddr; \
- trace_hardirqs_fixup(); \
if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \
== NOTIFY_STOP) \
return; \
diff --git a/trunk/arch/x86/kernel/traps_64.c b/trunk/arch/x86/kernel/traps_64.c
index cc68b92316cd..d11525ad81b4 100644
--- a/trunk/arch/x86/kernel/traps_64.c
+++ b/trunk/arch/x86/kernel/traps_64.c
@@ -635,7 +635,6 @@ asmlinkage void do_##name(struct pt_regs * regs, long error_code) \
info.si_errno = 0; \
info.si_code = sicode; \
info.si_addr = (void __user *)siaddr; \
- trace_hardirqs_fixup(); \
if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \
== NOTIFY_STOP) \
return; \
diff --git a/trunk/arch/x86/mm/init_32.c b/trunk/arch/x86/mm/init_32.c
index 3c76d194fd2c..c7d19471261d 100644
--- a/trunk/arch/x86/mm/init_32.c
+++ b/trunk/arch/x86/mm/init_32.c
@@ -321,13 +321,8 @@ extern void set_highmem_pages_init(int);
static void __init set_highmem_pages_init(int bad_ppro)
{
int pfn;
- for (pfn = highstart_pfn; pfn < highend_pfn; pfn++) {
- /*
- * Holes under sparsemem might not have no mem_map[]:
- */
- if (pfn_valid(pfn))
- add_one_highpage_init(pfn_to_page(pfn), pfn, bad_ppro);
- }
+ for (pfn = highstart_pfn; pfn < highend_pfn; pfn++)
+ add_one_highpage_init(pfn_to_page(pfn), pfn, bad_ppro);
totalram_pages += totalhigh_pages;
}
#endif /* CONFIG_FLATMEM */
diff --git a/trunk/arch/x86/oprofile/nmi_int.c b/trunk/arch/x86/oprofile/nmi_int.c
index 944bbcdd2b8d..2d0eeac7251f 100644
--- a/trunk/arch/x86/oprofile/nmi_int.c
+++ b/trunk/arch/x86/oprofile/nmi_int.c
@@ -380,7 +380,7 @@ static int __init ppro_init(char ** cpu_type)
if (cpu_model == 14)
*cpu_type = "i386/core";
- else if (cpu_model == 15 || cpu_model == 23)
+ else if (cpu_model == 15)
*cpu_type = "i386/core_2";
else if (cpu_model > 0xd)
return 0;
diff --git a/trunk/block/blktrace.c b/trunk/block/blktrace.c
index 9b4da4ae3c7d..498a0a54a6aa 100644
--- a/trunk/block/blktrace.c
+++ b/trunk/block/blktrace.c
@@ -25,6 +25,7 @@
#include
#include
+static DEFINE_PER_CPU(unsigned long long, blk_trace_cpu_offset) = { 0, };
static unsigned int blktrace_seq __read_mostly = 1;
/*
@@ -40,7 +41,7 @@ static void trace_note(struct blk_trace *bt, pid_t pid, int action,
const int cpu = smp_processor_id();
t->magic = BLK_IO_TRACE_MAGIC | BLK_IO_TRACE_VERSION;
- t->time = ktime_to_ns(ktime_get());
+ t->time = cpu_clock(cpu) - per_cpu(blk_trace_cpu_offset, cpu);
t->device = bt->dev;
t->action = action;
t->pid = pid;
@@ -158,7 +159,7 @@ void __blk_add_trace(struct blk_trace *bt, sector_t sector, int bytes,
t->magic = BLK_IO_TRACE_MAGIC | BLK_IO_TRACE_VERSION;
t->sequence = ++(*sequence);
- t->time = ktime_to_ns(ktime_get());
+ t->time = cpu_clock(cpu) - per_cpu(blk_trace_cpu_offset, cpu);
t->sector = sector;
t->bytes = bytes;
t->action = what;
@@ -178,7 +179,7 @@ void __blk_add_trace(struct blk_trace *bt, sector_t sector, int bytes,
EXPORT_SYMBOL_GPL(__blk_add_trace);
static struct dentry *blk_tree_root;
-static DEFINE_MUTEX(blk_tree_mutex);
+static struct mutex blk_tree_mutex;
static unsigned int root_users;
static inline void blk_remove_root(void)
@@ -504,3 +505,77 @@ void blk_trace_shutdown(struct request_queue *q)
blk_trace_remove(q);
}
}
+
+/*
+ * Average offset over two calls to cpu_clock() with a gettimeofday()
+ * in the middle
+ */
+static void blk_check_time(unsigned long long *t, int this_cpu)
+{
+ unsigned long long a, b;
+ struct timeval tv;
+
+ a = cpu_clock(this_cpu);
+ do_gettimeofday(&tv);
+ b = cpu_clock(this_cpu);
+
+ *t = tv.tv_sec * 1000000000 + tv.tv_usec * 1000;
+ *t -= (a + b) / 2;
+}
+
+/*
+ * calibrate our inter-CPU timings
+ */
+static void blk_trace_check_cpu_time(void *data)
+{
+ unsigned long long *t;
+ int this_cpu = get_cpu();
+
+ t = &per_cpu(blk_trace_cpu_offset, this_cpu);
+
+ /*
+ * Just call it twice, hopefully the second call will be cache hot
+ * and a little more precise
+ */
+ blk_check_time(t, this_cpu);
+ blk_check_time(t, this_cpu);
+
+ put_cpu();
+}
+
+static void blk_trace_set_ht_offsets(void)
+{
+#if defined(CONFIG_SCHED_SMT)
+ int cpu, i;
+
+ /*
+ * now make sure HT siblings have the same time offset
+ */
+ preempt_disable();
+ for_each_online_cpu(cpu) {
+ unsigned long long *cpu_off, *sibling_off;
+
+ for_each_cpu_mask(i, per_cpu(cpu_sibling_map, cpu)) {
+ if (i == cpu)
+ continue;
+
+ cpu_off = &per_cpu(blk_trace_cpu_offset, cpu);
+ sibling_off = &per_cpu(blk_trace_cpu_offset, i);
+ *sibling_off = *cpu_off;
+ }
+ }
+ preempt_enable();
+#endif
+}
+
+static __init int blk_trace_init(void)
+{
+ mutex_init(&blk_tree_mutex);
+ on_each_cpu(blk_trace_check_cpu_time, NULL, 1, 1);
+ blk_trace_set_ht_offsets();
+
+ return 0;
+}
+
+module_init(blk_trace_init);
+
diff --git a/trunk/drivers/acpi/Kconfig b/trunk/drivers/acpi/Kconfig
index ccf6ea95f68c..b9f923ef173d 100644
--- a/trunk/drivers/acpi/Kconfig
+++ b/trunk/drivers/acpi/Kconfig
@@ -82,12 +82,6 @@ config ACPI_PROCFS_POWER
and functions, which do not yet exist in /sys
Say N to delete power /proc/acpi/ folders that have moved to /sys/
-config ACPI_SYSFS_POWER
- bool "Future power /sys interface"
- select POWER_SUPPLY
- default y
- ---help---
- Say N to disable power /sys interface
config ACPI_PROC_EVENT
bool "Deprecated /proc/acpi/event support"
depends on PROC_FS
@@ -109,6 +103,7 @@ config ACPI_PROC_EVENT
config ACPI_AC
tristate "AC Adapter"
depends on X86
+ select POWER_SUPPLY
default y
help
This driver adds support for the AC Adapter object, which indicates
@@ -118,6 +113,7 @@ config ACPI_AC
config ACPI_BATTERY
tristate "Battery"
depends on X86
+ select POWER_SUPPLY
default y
help
This driver adds support for battery information through
@@ -372,6 +368,7 @@ config ACPI_HOTPLUG_MEMORY
config ACPI_SBS
tristate "Smart Battery System"
depends on X86
+ select POWER_SUPPLY
help
This driver adds support for the Smart Battery System, another
type of access to battery information, found on some laptops.
diff --git a/trunk/drivers/acpi/ac.c b/trunk/drivers/acpi/ac.c
index 76b9bea98b6d..76ed4f52bebd 100644
--- a/trunk/drivers/acpi/ac.c
+++ b/trunk/drivers/acpi/ac.c
@@ -31,9 +31,7 @@
#include
#include
#endif
-#ifdef CONFIG_ACPI_SYSFS_POWER
#include
-#endif
#include
#include
@@ -81,9 +79,7 @@ static struct acpi_driver acpi_ac_driver = {
};
struct acpi_ac {
-#ifdef CONFIG_ACPI_SYSFS_POWER
struct power_supply charger;
-#endif
struct acpi_device * device;
unsigned long state;
};
@@ -98,7 +94,7 @@ static const struct file_operations acpi_ac_fops = {
.release = single_release,
};
#endif
-#ifdef CONFIG_ACPI_SYSFS_POWER
+
static int get_ac_property(struct power_supply *psy,
enum power_supply_property psp,
union power_supply_propval *val)
@@ -117,7 +113,7 @@ static int get_ac_property(struct power_supply *psy,
static enum power_supply_property ac_props[] = {
POWER_SUPPLY_PROP_ONLINE,
};
-#endif
+
/* --------------------------------------------------------------------------
AC Adapter Management
-------------------------------------------------------------------------- */
@@ -245,9 +241,7 @@ static void acpi_ac_notify(acpi_handle handle, u32 event, void *data)
acpi_bus_generate_netlink_event(device->pnp.device_class,
device->dev.bus_id, event,
(u32) ac->state);
-#ifdef CONFIG_ACPI_SYSFS_POWER
kobject_uevent(&ac->charger.dev->kobj, KOBJ_CHANGE);
-#endif
break;
default:
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
@@ -286,14 +280,12 @@ static int acpi_ac_add(struct acpi_device *device)
#endif
if (result)
goto end;
-#ifdef CONFIG_ACPI_SYSFS_POWER
ac->charger.name = acpi_device_bid(device);
ac->charger.type = POWER_SUPPLY_TYPE_MAINS;
ac->charger.properties = ac_props;
ac->charger.num_properties = ARRAY_SIZE(ac_props);
ac->charger.get_property = get_ac_property;
power_supply_register(&ac->device->dev, &ac->charger);
-#endif
status = acpi_install_notify_handler(device->handle,
ACPI_ALL_NOTIFY, acpi_ac_notify,
ac);
@@ -327,10 +319,8 @@ static int acpi_ac_resume(struct acpi_device *device)
old_state = ac->state;
if (acpi_ac_get_state(ac))
return 0;
-#ifdef CONFIG_ACPI_SYSFS_POWER
if (old_state != ac->state)
kobject_uevent(&ac->charger.dev->kobj, KOBJ_CHANGE);
-#endif
return 0;
}
@@ -347,10 +337,8 @@ static int acpi_ac_remove(struct acpi_device *device, int type)
status = acpi_remove_notify_handler(device->handle,
ACPI_ALL_NOTIFY, acpi_ac_notify);
-#ifdef CONFIG_ACPI_SYSFS_POWER
if (ac->charger.dev)
power_supply_unregister(&ac->charger);
-#endif
#ifdef CONFIG_ACPI_PROCFS_POWER
acpi_ac_remove_fs(device);
#endif
diff --git a/trunk/drivers/acpi/battery.c b/trunk/drivers/acpi/battery.c
index c4a769d1ba85..8f7505d304b5 100644
--- a/trunk/drivers/acpi/battery.c
+++ b/trunk/drivers/acpi/battery.c
@@ -40,9 +40,7 @@
#include
#include
-#ifdef CONFIG_ACPI_SYSFS_POWER
#include
-#endif
#define ACPI_BATTERY_VALUE_UNKNOWN 0xFFFFFFFF
@@ -88,9 +86,7 @@ MODULE_DEVICE_TABLE(acpi, battery_device_ids);
struct acpi_battery {
struct mutex lock;
-#ifdef CONFIG_ACPI_SYSFS_POWER
struct power_supply bat;
-#endif
struct acpi_device *device;
unsigned long update_time;
int current_now;
@@ -121,7 +117,6 @@ inline int acpi_battery_present(struct acpi_battery *battery)
return battery->device->status.battery_present;
}
-#ifdef CONFIG_ACPI_SYSFS_POWER
static int acpi_battery_technology(struct acpi_battery *battery)
{
if (!strcasecmp("NiCd", battery->type))
@@ -227,7 +222,6 @@ static enum power_supply_property energy_battery_props[] = {
POWER_SUPPLY_PROP_MODEL_NAME,
POWER_SUPPLY_PROP_MANUFACTURER,
};
-#endif
#ifdef CONFIG_ACPI_PROCFS_POWER
inline char *acpi_battery_units(struct acpi_battery *battery)
@@ -404,7 +398,6 @@ static int acpi_battery_init_alarm(struct acpi_battery *battery)
return acpi_battery_set_alarm(battery);
}
-#ifdef CONFIG_ACPI_SYSFS_POWER
static ssize_t acpi_battery_alarm_show(struct device *dev,
struct device_attribute *attr,
char *buf)
@@ -436,6 +429,11 @@ static int sysfs_add_battery(struct acpi_battery *battery)
{
int result;
+ battery->update_time = 0;
+ result = acpi_battery_get_info(battery);
+ acpi_battery_init_alarm(battery);
+ if (result)
+ return result;
if (battery->power_unit) {
battery->bat.properties = charge_battery_props;
battery->bat.num_properties =
@@ -464,31 +462,18 @@ static void sysfs_remove_battery(struct acpi_battery *battery)
power_supply_unregister(&battery->bat);
battery->bat.dev = NULL;
}
-#endif
static int acpi_battery_update(struct acpi_battery *battery)
{
- int result;
- result = acpi_battery_get_status(battery);
+ int result = acpi_battery_get_status(battery);
if (result)
return result;
-#ifdef CONFIG_ACPI_SYSFS_POWER
if (!acpi_battery_present(battery)) {
sysfs_remove_battery(battery);
- battery->update_time = 0;
return 0;
}
-#endif
- if (!battery->update_time) {
- result = acpi_battery_get_info(battery);
- if (result)
- return result;
- acpi_battery_init_alarm(battery);
- }
-#ifdef CONFIG_ACPI_SYSFS_POWER
if (!battery->bat.dev)
sysfs_add_battery(battery);
-#endif
return acpi_battery_get_state(battery);
}
@@ -782,11 +767,9 @@ static void acpi_battery_notify(acpi_handle handle, u32 event, void *data)
acpi_bus_generate_netlink_event(device->pnp.device_class,
device->dev.bus_id, event,
acpi_battery_present(battery));
-#ifdef CONFIG_ACPI_SYSFS_POWER
/* acpi_batter_update could remove power_supply object */
if (battery->bat.dev)
kobject_uevent(&battery->bat.dev->kobj, KOBJ_CHANGE);
-#endif
}
static int acpi_battery_add(struct acpi_device *device)
@@ -845,9 +828,7 @@ static int acpi_battery_remove(struct acpi_device *device, int type)
#ifdef CONFIG_ACPI_PROCFS_POWER
acpi_battery_remove_fs(device);
#endif
-#ifdef CONFIG_ACPI_SYSFS_POWER
sysfs_remove_battery(battery);
-#endif
mutex_destroy(&battery->lock);
kfree(battery);
return 0;
diff --git a/trunk/drivers/acpi/bus.c b/trunk/drivers/acpi/bus.c
index d7a115c362d1..49d432d0a12c 100644
--- a/trunk/drivers/acpi/bus.c
+++ b/trunk/drivers/acpi/bus.c
@@ -29,6 +29,7 @@
#include
#include
#include
+#include
#include
#include
#ifdef CONFIG_X86
@@ -763,14 +764,16 @@ static int __init acpi_init(void)
result = acpi_bus_init();
if (!result) {
- if (!(pm_flags & PM_APM))
- pm_flags |= PM_ACPI;
+#ifdef CONFIG_PM_LEGACY
+ if (!PM_IS_ACTIVE())
+ pm_active = 1;
else {
printk(KERN_INFO PREFIX
"APM is already active, exiting\n");
disable_acpi();
result = -ENODEV;
}
+#endif
} else
disable_acpi();
diff --git a/trunk/drivers/acpi/ec.c b/trunk/drivers/acpi/ec.c
index 97dc16155a55..d411017f8c06 100644
--- a/trunk/drivers/acpi/ec.c
+++ b/trunk/drivers/acpi/ec.c
@@ -892,17 +892,6 @@ static int acpi_ec_stop(struct acpi_device *device, int type)
return 0;
}
-int __init acpi_boot_ec_enable(void)
-{
- if (!boot_ec || boot_ec->handlers_installed)
- return 0;
- if (!ec_install_handlers(boot_ec)) {
- first_ec = boot_ec;
- return 0;
- }
- return -EFAULT;
-}
-
int __init acpi_ec_ecdt_probe(void)
{
int ret;
@@ -935,10 +924,9 @@ int __init acpi_ec_ecdt_probe(void)
goto error;
/* We really need to limit this workaround, the only ASUS,
* which needs it, has fake EC._INI method, so use it as flag.
- * Keep boot_ec struct as it will be needed soon.
*/
if (ACPI_FAILURE(acpi_get_handle(boot_ec->handle, "_INI", &x)))
- return -ENODEV;
+ goto error;
}
ret = ec_install_handlers(boot_ec);
diff --git a/trunk/drivers/acpi/events/evregion.c b/trunk/drivers/acpi/events/evregion.c
index 58ad09725dd2..e99f0c435a47 100644
--- a/trunk/drivers/acpi/events/evregion.c
+++ b/trunk/drivers/acpi/events/evregion.c
@@ -344,7 +344,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
* setup will potentially execute control methods
* (e.g., _REG method for this region)
*/
- acpi_ex_exit_interpreter();
+ acpi_ex_relinquish_interpreter();
status = region_setup(region_obj, ACPI_REGION_ACTIVATE,
handler_desc->address_space.context,
@@ -352,7 +352,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
/* Re-enter the interpreter */
- acpi_ex_enter_interpreter();
+ acpi_ex_reacquire_interpreter();
/* Check for failure of the Region Setup */
@@ -405,7 +405,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
* exit the interpreter because the handler *might* block -- we don't
* know what it will do, so we can't hold the lock on the intepreter.
*/
- acpi_ex_exit_interpreter();
+ acpi_ex_relinquish_interpreter();
}
/* Call the handler */
@@ -426,7 +426,7 @@ acpi_ev_address_space_dispatch(union acpi_operand_object *region_obj,
* We just returned from a non-default handler, we must re-enter the
* interpreter
*/
- acpi_ex_enter_interpreter();
+ acpi_ex_reacquire_interpreter();
}
return_ACPI_STATUS(status);
diff --git a/trunk/drivers/acpi/pci_irq.c b/trunk/drivers/acpi/pci_irq.c
index 62010c2481b3..dd3186abe07a 100644
--- a/trunk/drivers/acpi/pci_irq.c
+++ b/trunk/drivers/acpi/pci_irq.c
@@ -429,15 +429,6 @@ int acpi_pci_irq_enable(struct pci_dev *dev)
&polarity, &link,
acpi_pci_allocate_irq);
- if (irq < 0) {
- /*
- * IDE legacy mode controller IRQs are magic. Why do compat
- * extensions always make such a nasty mess.
- */
- if (dev->class >> 8 == PCI_CLASS_STORAGE_IDE &&
- (dev->class & 0x05) == 0)
- return 0;
- }
/*
* No IRQ known to the ACPI subsystem - maybe the BIOS /
* driver reported one, then use it. Exit in any case.
diff --git a/trunk/drivers/acpi/processor_idle.c b/trunk/drivers/acpi/processor_idle.c
index 2235f4e02d26..2fe34cc73c13 100644
--- a/trunk/drivers/acpi/processor_idle.c
+++ b/trunk/drivers/acpi/processor_idle.c
@@ -76,11 +76,7 @@ static void (*pm_idle_save) (void) __read_mostly;
#define PM_TIMER_TICKS_TO_US(p) (((p) * 1000)/(PM_TIMER_FREQUENCY/1000))
static unsigned int max_cstate __read_mostly = ACPI_PROCESSOR_MAX_POWER;
-#ifdef CONFIG_CPU_IDLE
module_param(max_cstate, uint, 0000);
-#else
-module_param(max_cstate, uint, 0644);
-#endif
static unsigned int nocst __read_mostly;
module_param(nocst, uint, 0000);
diff --git a/trunk/drivers/acpi/sbs.c b/trunk/drivers/acpi/sbs.c
index f136c7d3b3c2..22cb95b349e4 100644
--- a/trunk/drivers/acpi/sbs.c
+++ b/trunk/drivers/acpi/sbs.c
@@ -40,9 +40,7 @@
#include
#include
-#ifdef CONFIG_ACPI_SYSFS_POWER
#include
-#endif
#include "sbshc.h"
@@ -82,9 +80,7 @@ static const struct acpi_device_id sbs_device_ids[] = {
MODULE_DEVICE_TABLE(acpi, sbs_device_ids);
struct acpi_battery {
-#ifdef CONFIG_ACPI_SYSFS_POWER
struct power_supply bat;
-#endif
struct acpi_sbs *sbs;
#ifdef CONFIG_ACPI_PROCFS_POWER
struct proc_dir_entry *proc_entry;
@@ -117,9 +113,7 @@ struct acpi_battery {
#define to_acpi_battery(x) container_of(x, struct acpi_battery, bat);
struct acpi_sbs {
-#ifdef CONFIG_ACPI_SYSFS_POWER
struct power_supply charger;
-#endif
struct acpi_device *device;
struct acpi_smb_hc *hc;
struct mutex lock;
@@ -163,7 +157,6 @@ static inline int acpi_battery_scale(struct acpi_battery *battery)
acpi_battery_ipscale(battery);
}
-#ifdef CONFIG_ACPI_SYSFS_POWER
static int sbs_get_ac_property(struct power_supply *psy,
enum power_supply_property psp,
union power_supply_propval *val)
@@ -301,7 +294,6 @@ static enum power_supply_property sbs_energy_battery_props[] = {
POWER_SUPPLY_PROP_MODEL_NAME,
POWER_SUPPLY_PROP_MANUFACTURER,
};
-#endif
/* --------------------------------------------------------------------------
Smart Battery System Management
@@ -437,7 +429,6 @@ static int acpi_ac_get_present(struct acpi_sbs *sbs)
return result;
}
-#ifdef CONFIG_ACPI_SYSFS_POWER
static ssize_t acpi_battery_alarm_show(struct device *dev,
struct device_attribute *attr,
char *buf)
@@ -467,7 +458,6 @@ static struct device_attribute alarm_attr = {
.show = acpi_battery_alarm_show,
.store = acpi_battery_alarm_store,
};
-#endif
/* --------------------------------------------------------------------------
FS Interface (/proc/acpi)
@@ -803,7 +793,6 @@ static int acpi_battery_add(struct acpi_sbs *sbs, int id)
&acpi_battery_state_fops, &acpi_battery_alarm_fops,
battery);
#endif
-#ifdef CONFIG_ACPI_SYSFS_POWER
battery->bat.name = battery->name;
battery->bat.type = POWER_SUPPLY_TYPE_BATTERY;
if (!acpi_battery_mode(battery)) {
@@ -824,7 +813,6 @@ static int acpi_battery_add(struct acpi_sbs *sbs, int id)
goto end;
battery->have_sysfs_alarm = 1;
end:
-#endif
printk(KERN_INFO PREFIX "%s [%s]: Battery Slot [%s] (battery %s)\n",
ACPI_SBS_DEVICE_NAME, acpi_device_bid(sbs->device),
battery->name, sbs->battery->present ? "present" : "absent");
@@ -834,13 +822,12 @@ static int acpi_battery_add(struct acpi_sbs *sbs, int id)
static void acpi_battery_remove(struct acpi_sbs *sbs, int id)
{
struct acpi_battery *battery = &sbs->battery[id];
-#ifdef CONFIG_ACPI_SYSFS_POWER
+
if (battery->bat.dev) {
if (battery->have_sysfs_alarm)
device_remove_file(battery->bat.dev, &alarm_attr);
power_supply_unregister(&battery->bat);
}
-#endif
#ifdef CONFIG_ACPI_PROCFS_POWER
if (battery->proc_entry)
acpi_sbs_remove_fs(&battery->proc_entry, acpi_battery_dir);
@@ -861,14 +848,12 @@ static int acpi_charger_add(struct acpi_sbs *sbs)
if (result)
goto end;
#endif
-#ifdef CONFIG_ACPI_SYSFS_POWER
sbs->charger.name = "sbs-charger";
sbs->charger.type = POWER_SUPPLY_TYPE_MAINS;
sbs->charger.properties = sbs_ac_props;
sbs->charger.num_properties = ARRAY_SIZE(sbs_ac_props);
sbs->charger.get_property = sbs_get_ac_property;
power_supply_register(&sbs->device->dev, &sbs->charger);
-#endif
printk(KERN_INFO PREFIX "%s [%s]: AC Adapter [%s] (%s)\n",
ACPI_SBS_DEVICE_NAME, acpi_device_bid(sbs->device),
ACPI_AC_DIR_NAME, sbs->charger_present ? "on-line" : "off-line");
@@ -878,10 +863,8 @@ static int acpi_charger_add(struct acpi_sbs *sbs)
static void acpi_charger_remove(struct acpi_sbs *sbs)
{
-#ifdef CONFIG_ACPI_SYSFS_POWER
if (sbs->charger.dev)
power_supply_unregister(&sbs->charger);
-#endif
#ifdef CONFIG_ACPI_PROCFS_POWER
if (sbs->charger_entry)
acpi_sbs_remove_fs(&sbs->charger_entry, acpi_ac_dir);
@@ -902,9 +885,7 @@ void acpi_sbs_callback(void *context)
ACPI_SBS_NOTIFY_STATUS,
sbs->charger_present);
#endif
-#ifdef CONFIG_ACPI_SYSFS_POWER
kobject_uevent(&sbs->charger.dev->kobj, KOBJ_CHANGE);
-#endif
}
if (sbs->manager_present) {
for (id = 0; id < MAX_SBS_BAT; ++id) {
@@ -921,9 +902,7 @@ void acpi_sbs_callback(void *context)
ACPI_SBS_NOTIFY_STATUS,
bat->present);
#endif
-#ifdef CONFIG_ACPI_SYSFS_POWER
kobject_uevent(&bat->bat.dev->kobj, KOBJ_CHANGE);
-#endif
}
}
}
diff --git a/trunk/drivers/acpi/scan.c b/trunk/drivers/acpi/scan.c
index cbfe9ae7a9e5..5b4d462117cf 100644
--- a/trunk/drivers/acpi/scan.c
+++ b/trunk/drivers/acpi/scan.c
@@ -1449,8 +1449,6 @@ static int acpi_bus_scan_fixed(struct acpi_device *root)
return result;
}
-int __init acpi_boot_ec_enable(void);
-
static int __init acpi_scan_init(void)
{
int result;
@@ -1482,10 +1480,6 @@ static int __init acpi_scan_init(void)
* Enumerate devices in the ACPI namespace.
*/
result = acpi_bus_scan_fixed(acpi_root);
-
- /* EC region might be needed at bus_scan, so enable it now */
- acpi_boot_ec_enable();
-
if (!result)
result = acpi_bus_scan(acpi_root, &ops);
diff --git a/trunk/drivers/ata/ata_piix.c b/trunk/drivers/ata/ata_piix.c
index b406b39b878e..bb62a588f489 100644
--- a/trunk/drivers/ata/ata_piix.c
+++ b/trunk/drivers/ata/ata_piix.c
@@ -132,7 +132,6 @@ enum {
ich8_2port_sata,
ich8m_apple_sata_ahci, /* locks up on second port enable */
tolapai_sata_ahci,
- piix_pata_vmw, /* PIIX4 for VMware, spurious DMA_ERR */
/* constants for mapping table */
P0 = 0, /* port 0 */
@@ -166,7 +165,6 @@ static void piix_set_piomode(struct ata_port *ap, struct ata_device *adev);
static void piix_set_dmamode(struct ata_port *ap, struct ata_device *adev);
static void ich_set_dmamode(struct ata_port *ap, struct ata_device *adev);
static int ich_pata_cable_detect(struct ata_port *ap);
-static u8 piix_vmw_bmdma_status(struct ata_port *ap);
#ifdef CONFIG_PM
static int piix_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg);
static int piix_pci_device_resume(struct pci_dev *pdev);
@@ -177,8 +175,6 @@ static unsigned int in_module_init = 1;
static const struct pci_device_id piix_pci_tbl[] = {
/* Intel PIIX3 for the 430HX etc */
{ 0x8086, 0x7010, PCI_ANY_ID, PCI_ANY_ID, 0, 0, piix_pata_mwdma },
- /* VMware ICH4 */
- { 0x8086, 0x7111, 0x15ad, 0x1976, 0, 0, piix_pata_vmw },
/* Intel PIIX4 for the 430TX/440BX/MX chipset: UDMA 33 */
/* Also PIIX4E (fn3 rev 2) and PIIX4M (fn3 rev 3) */
{ 0x8086, 0x7111, PCI_ANY_ID, PCI_ANY_ID, 0, 0, piix_pata_33 },
@@ -387,38 +383,6 @@ static const struct ata_port_operations piix_sata_ops = {
.port_start = ata_port_start,
};
-static const struct ata_port_operations piix_vmw_ops = {
- .set_piomode = piix_set_piomode,
- .set_dmamode = piix_set_dmamode,
- .mode_filter = ata_pci_default_filter,
-
- .tf_load = ata_tf_load,
- .tf_read = ata_tf_read,
- .check_status = ata_check_status,
- .exec_command = ata_exec_command,
- .dev_select = ata_std_dev_select,
-
- .bmdma_setup = ata_bmdma_setup,
- .bmdma_start = ata_bmdma_start,
- .bmdma_stop = ata_bmdma_stop,
- .bmdma_status = piix_vmw_bmdma_status,
- .qc_prep = ata_qc_prep,
- .qc_issue = ata_qc_issue_prot,
- .data_xfer = ata_data_xfer,
-
- .freeze = ata_bmdma_freeze,
- .thaw = ata_bmdma_thaw,
- .error_handler = piix_pata_error_handler,
- .post_internal_cmd = ata_bmdma_post_internal_cmd,
- .cable_detect = ata_cable_40wire,
-
- .irq_handler = ata_interrupt,
- .irq_clear = ata_bmdma_irq_clear,
- .irq_on = ata_irq_on,
-
- .port_start = ata_port_start,
-};
-
static const struct piix_map_db ich5_map_db = {
.mask = 0x7,
.port_enable = 0x3,
@@ -659,16 +623,6 @@ static struct ata_port_info piix_port_info[] = {
.port_ops = &piix_sata_ops,
},
- [piix_pata_vmw] =
- {
- .sht = &piix_sht,
- .flags = PIIX_PATA_FLAGS,
- .pio_mask = 0x1f, /* pio0-4 */
- .mwdma_mask = 0x06, /* mwdma1-2 ?? CHECK 0 should be ok but slow */
- .udma_mask = ATA_UDMA_MASK_40C,
- .port_ops = &piix_vmw_ops,
- },
-
};
static struct pci_bits piix_enable_bits[] = {
@@ -1181,11 +1135,6 @@ static int piix_pci_device_resume(struct pci_dev *pdev)
}
#endif
-static u8 piix_vmw_bmdma_status(struct ata_port *ap)
-{
- return ata_bmdma_status(ap) & ~ATA_DMA_ERR;
-}
-
#define AHCI_PCI_BAR 5
#define AHCI_GLOBAL_CTL 0x04
#define AHCI_ENABLE (1 << 31)
diff --git a/trunk/drivers/ata/libata-core.c b/trunk/drivers/ata/libata-core.c
index 6380726f7538..4753a1831dbc 100644
--- a/trunk/drivers/ata/libata-core.c
+++ b/trunk/drivers/ata/libata-core.c
@@ -6998,9 +6998,7 @@ int ata_host_start(struct ata_host *host)
rc = ap->ops->port_start(ap);
if (rc) {
if (rc != -ENODEV)
- dev_printk(KERN_ERR, host->dev,
- "failed to start port %d "
- "(errno=%d)\n", i, rc);
+ dev_printk(KERN_ERR, host->dev, "failed to start port %d (errno=%d)\n", i, rc);
goto err_out;
}
}
diff --git a/trunk/drivers/ata/libata-eh.c b/trunk/drivers/ata/libata-eh.c
index 21a81cd148e4..f0124a8d3134 100644
--- a/trunk/drivers/ata/libata-eh.c
+++ b/trunk/drivers/ata/libata-eh.c
@@ -1733,15 +1733,11 @@ static void ata_eh_link_autopsy(struct ata_link *link)
ehc->i.action &= ~ATA_EH_PERDEV_MASK;
}
- /* propagate timeout to host link */
- if ((all_err_mask & AC_ERR_TIMEOUT) && !ata_is_host_link(link))
- ap->link.eh_context.i.err_mask |= AC_ERR_TIMEOUT;
-
- /* record error and consider speeding down */
+ /* consider speeding down */
dev = ehc->i.dev;
- if (!dev && ((ata_link_max_devices(link) == 1 &&
- ata_dev_enabled(link->device))))
- dev = link->device;
+ if (!dev && ata_link_max_devices(link) == 1 &&
+ ata_dev_enabled(link->device))
+ dev = link->device;
if (dev)
ehc->i.action |= ata_eh_speed_down(dev, is_io, all_err_mask);
@@ -1763,14 +1759,8 @@ void ata_eh_autopsy(struct ata_port *ap)
{
struct ata_link *link;
- ata_port_for_each_link(link, ap)
+ __ata_port_for_each_link(link, ap)
ata_eh_link_autopsy(link);
-
- /* Autopsy of fanout ports can affect host link autopsy.
- * Perform host link autopsy last.
- */
- if (ap->nr_pmp_links)
- ata_eh_link_autopsy(&ap->link);
}
/**
@@ -2167,11 +2157,13 @@ int ata_eh_reset(struct ata_link *link, int classify,
if (ata_link_offline(link))
continue;
- /* apply class override */
+ /* apply class override and convert UNKNOWN to NONE */
if (lflags & ATA_LFLAG_ASSUME_ATA)
classes[dev->devno] = ATA_DEV_ATA;
else if (lflags & ATA_LFLAG_ASSUME_SEMB)
classes[dev->devno] = ATA_DEV_SEMB_UNSUP; /* not yet */
+ else if (classes[dev->devno] == ATA_DEV_UNKNOWN)
+ classes[dev->devno] = ATA_DEV_NONE;
}
/* record current link speed */
diff --git a/trunk/drivers/ata/libata-pmp.c b/trunk/drivers/ata/libata-pmp.c
index caef2bbd4a8a..c0c4dbcde091 100644
--- a/trunk/drivers/ata/libata-pmp.c
+++ b/trunk/drivers/ata/libata-pmp.c
@@ -495,12 +495,14 @@ static void sata_pmp_quirks(struct ata_port *ap)
/* SError.N need a kick in the ass to get working */
link->flags |= ATA_LFLAG_HRST_TO_RESUME;
- /* Class code report is unreliable and SRST
- * times out under certain configurations.
- * Config device can be at port 0 or 5 and
- * locks up on SRST.
+ /* class code report is unreliable */
+ if (link->pmp < 5)
+ link->flags |= ATA_LFLAG_ASSUME_ATA;
+
+ /* The config device, which can be either at
+ * port 0 or 5, locks up on SRST.
*/
- if (link->pmp <= 5)
+ if (link->pmp == 0 || link->pmp == 5)
link->flags |= ATA_LFLAG_NO_SRST |
ATA_LFLAG_ASSUME_ATA;
diff --git a/trunk/drivers/ata/libata-scsi.c b/trunk/drivers/ata/libata-scsi.c
index 14daf4848f09..a883bb03d4c7 100644
--- a/trunk/drivers/ata/libata-scsi.c
+++ b/trunk/drivers/ata/libata-scsi.c
@@ -841,9 +841,6 @@ static void ata_scsi_dev_config(struct scsi_device *sdev,
blk_queue_max_hw_segments(q, q->max_hw_segments - 1);
}
- if (dev->class == ATA_DEV_ATA)
- sdev->manage_start_stop = 1;
-
if (dev->flags & ATA_DFLAG_AN)
set_bit(SDEV_EVT_MEDIA_CHANGE, sdev->supported_events);
@@ -875,6 +872,8 @@ int ata_scsi_slave_config(struct scsi_device *sdev)
ata_scsi_sdev_config(sdev);
+ sdev->manage_start_stop = 1;
+
if (dev)
ata_scsi_dev_config(sdev, dev);
diff --git a/trunk/drivers/ata/libata-sff.c b/trunk/drivers/ata/libata-sff.c
index b7ac80b4b1fb..48acc09dab96 100644
--- a/trunk/drivers/ata/libata-sff.c
+++ b/trunk/drivers/ata/libata-sff.c
@@ -806,10 +806,7 @@ int ata_pci_init_one(struct pci_dev *pdev,
if (rc)
goto err_out;
- if (!legacy_mode && pdev->irq) {
- /* We may have no IRQ assigned in which case we can poll. This
- shouldn't happen on a sane system but robustness is cheap
- in this case */
+ if (!legacy_mode) {
rc = devm_request_irq(dev, pdev->irq, pi->port_ops->irq_handler,
IRQF_SHARED, DRV_NAME, host);
if (rc)
@@ -817,7 +814,7 @@ int ata_pci_init_one(struct pci_dev *pdev,
ata_port_desc(host->ports[0], "irq %d", pdev->irq);
ata_port_desc(host->ports[1], "irq %d", pdev->irq);
- } else if (legacy_mode) {
+ } else {
if (!ata_port_is_dummy(host->ports[0])) {
rc = devm_request_irq(dev, ATA_PRIMARY_IRQ(pdev),
pi->port_ops->irq_handler,
diff --git a/trunk/drivers/ata/pata_bf54x.c b/trunk/drivers/ata/pata_bf54x.c
index 7842cc487359..088a41f4e656 100644
--- a/trunk/drivers/ata/pata_bf54x.c
+++ b/trunk/drivers/ata/pata_bf54x.c
@@ -1509,8 +1509,7 @@ static int __devinit bfin_atapi_probe(struct platform_device *pdev)
if (res == NULL)
return -EINVAL;
- while (bfin_port_info[board_idx].udma_mask > 0 &&
- udma_fsclk[udma_mode] > fsclk) {
+ while (bfin_port_info[board_idx].udma_mask>0 && udma_fsclk[udma_mode] > fsclk) {
udma_mode--;
bfin_port_info[board_idx].udma_mask >>= 1;
}
diff --git a/trunk/drivers/ata/pata_ixp4xx_cf.c b/trunk/drivers/ata/pata_ixp4xx_cf.c
index 120b5bfa7ce6..fcd532afbf2e 100644
--- a/trunk/drivers/ata/pata_ixp4xx_cf.c
+++ b/trunk/drivers/ata/pata_ixp4xx_cf.c
@@ -130,11 +130,10 @@ static struct ata_port_operations ixp4xx_port_ops = {
.port_start = ata_port_start,
};
-static void ixp4xx_setup_port(struct ata_port *ap,
+static void ixp4xx_setup_port(struct ata_ioports *ioaddr,
struct ixp4xx_pata_data *data,
unsigned long raw_cs0, unsigned long raw_cs1)
{
- struct ata_ioports *ioaddr = &ap->ioaddr;
unsigned long raw_cmd = raw_cs0;
unsigned long raw_ctl = raw_cs1 + 0x06;
diff --git a/trunk/drivers/ata/pata_legacy.c b/trunk/drivers/ata/pata_legacy.c
index 17159b5e1e43..7bed8d806381 100644
--- a/trunk/drivers/ata/pata_legacy.c
+++ b/trunk/drivers/ata/pata_legacy.c
@@ -271,12 +271,14 @@ static void pdc_data_xfer_vlb(struct ata_device *adev, unsigned char *buf, unsig
ioread32_rep(ap->ioaddr.data_addr, buf, buflen >> 2);
if (unlikely(slop)) {
- __le32 pad = 0;
+ u32 pad;
if (write_data) {
memcpy(&pad, buf + buflen - slop, slop);
- iowrite32(le32_to_cpu(pad), ap->ioaddr.data_addr);
+ pad = le32_to_cpu(pad);
+ iowrite32(pad, ap->ioaddr.data_addr);
} else {
- pad = cpu_to_le32(ioread32(ap->ioaddr.data_addr));
+ pad = ioread32(ap->ioaddr.data_addr);
+ pad = cpu_to_le16(pad);
memcpy(buf + buflen - slop, &pad, slop);
}
}
diff --git a/trunk/drivers/ata/pata_pdc202xx_old.c b/trunk/drivers/ata/pata_pdc202xx_old.c
index 6c9689b59b06..bc7c2d5d8d5e 100644
--- a/trunk/drivers/ata/pata_pdc202xx_old.c
+++ b/trunk/drivers/ata/pata_pdc202xx_old.c
@@ -215,8 +215,8 @@ static void pdc2026x_bmdma_stop(struct ata_queued_cmd *qc)
/* Flip back to 33Mhz for PIO */
if (adev->dma_mode >= XFER_UDMA_2)
iowrite8(ioread8(clock) & ~sel66, clock);
+
ata_bmdma_stop(qc);
- pdc202xx_set_piomode(ap, adev);
}
/**
@@ -233,35 +233,6 @@ static void pdc2026x_dev_config(struct ata_device *adev)
adev->max_sectors = 256;
}
-static int pdc2026x_port_start(struct ata_port *ap)
-{
- void __iomem *bmdma = ap->ioaddr.bmdma_addr;
- if (bmdma) {
- /* Enable burst mode */
- u8 burst = ioread8(bmdma + 0x1f);
- iowrite8(burst | 0x01, bmdma + 0x1f);
- }
- return ata_sff_port_start(ap);
-}
-
-/**
- * pdc2026x_check_atapi_dma - Check whether ATAPI DMA can be supported for this command
- * @qc: Metadata associated with taskfile to check
- *
- * Just say no - not supported on older Promise.
- *
- * LOCKING:
- * None (inherited from caller).
- *
- * RETURNS: 0 when ATAPI DMA can be used
- * 1 otherwise
- */
-
-static int pdc2026x_check_atapi_dma(struct ata_queued_cmd *qc)
-{
- return 1;
-}
-
static struct scsi_host_template pdc202xx_sht = {
.module = THIS_MODULE,
.name = DRV_NAME,
@@ -329,7 +300,6 @@ static struct ata_port_operations pdc2026x_port_ops = {
.post_internal_cmd = ata_bmdma_post_internal_cmd,
.cable_detect = pdc2026x_cable_detect,
- .check_atapi_dma= pdc2026x_check_atapi_dma,
.bmdma_setup = ata_bmdma_setup,
.bmdma_start = pdc2026x_bmdma_start,
.bmdma_stop = pdc2026x_bmdma_stop,
@@ -343,7 +313,7 @@ static struct ata_port_operations pdc2026x_port_ops = {
.irq_clear = ata_bmdma_irq_clear,
.irq_on = ata_irq_on,
- .port_start = pdc2026x_port_start,
+ .port_start = ata_sff_port_start,
};
static int pdc202xx_init_one(struct pci_dev *dev, const struct pci_device_id *id)
diff --git a/trunk/drivers/ata/pata_qdi.c b/trunk/drivers/ata/pata_qdi.c
index a4c0e502cb42..7d4c696c4cb6 100644
--- a/trunk/drivers/ata/pata_qdi.c
+++ b/trunk/drivers/ata/pata_qdi.c
@@ -136,12 +136,14 @@ static void qdi_data_xfer(struct ata_device *adev, unsigned char *buf, unsigned
ioread32_rep(ap->ioaddr.data_addr, buf, buflen >> 2);
if (unlikely(slop)) {
- __le32 pad = 0;
+ u32 pad;
if (write_data) {
memcpy(&pad, buf + buflen - slop, slop);
- iowrite32(le32_to_cpu(pad), ap->ioaddr.data_addr);
+ pad = le32_to_cpu(pad);
+ iowrite32(pad, ap->ioaddr.data_addr);
} else {
- pad = cpu_to_le32(ioread32(ap->ioaddr.data_addr));
+ pad = ioread32(ap->ioaddr.data_addr);
+ pad = cpu_to_le32(pad);
memcpy(buf + buflen - slop, &pad, slop);
}
}
diff --git a/trunk/drivers/ata/pata_winbond.c b/trunk/drivers/ata/pata_winbond.c
index 7116a9e7a8b2..311cdb3a5566 100644
--- a/trunk/drivers/ata/pata_winbond.c
+++ b/trunk/drivers/ata/pata_winbond.c
@@ -104,12 +104,14 @@ static void winbond_data_xfer(struct ata_device *adev, unsigned char *buf, unsig
ioread32_rep(ap->ioaddr.data_addr, buf, buflen >> 2);
if (unlikely(slop)) {
- __le32 pad = 0;
+ u32 pad;
if (write_data) {
memcpy(&pad, buf + buflen - slop, slop);
- iowrite32(le32_to_cpu(pad), ap->ioaddr.data_addr);
+ pad = le32_to_cpu(pad);
+ iowrite32(pad, ap->ioaddr.data_addr);
} else {
- pad = cpu_to_le32(ioread32(ap->ioaddr.data_addr));
+ pad = ioread32(ap->ioaddr.data_addr);
+ pad = cpu_to_le16(pad);
memcpy(buf + buflen - slop, &pad, slop);
}
}
diff --git a/trunk/drivers/ata/sata_qstor.c b/trunk/drivers/ata/sata_qstor.c
index c68b241805fd..2f1de6ec044c 100644
--- a/trunk/drivers/ata/sata_qstor.c
+++ b/trunk/drivers/ata/sata_qstor.c
@@ -270,7 +270,7 @@ static int qs_scr_read(struct ata_port *ap, unsigned int sc_reg, u32 *val)
static void qs_error_handler(struct ata_port *ap)
{
qs_enter_reg_mode(ap);
- ata_do_eh(ap, qs_prereset, NULL, sata_std_hardreset,
+ ata_do_eh(ap, qs_prereset, ata_std_softreset, NULL,
ata_std_postreset);
}
diff --git a/trunk/drivers/ata/sata_sil24.c b/trunk/drivers/ata/sata_sil24.c
index 864c1c1b8511..96fd5260446d 100644
--- a/trunk/drivers/ata/sata_sil24.c
+++ b/trunk/drivers/ata/sata_sil24.c
@@ -301,7 +301,7 @@ static struct sil24_cerr_info {
[PORT_CERR_PKT_PROT] = { AC_ERR_HSM, ATA_EH_SOFTRESET,
"invalid data directon for ATAPI CDB" },
[PORT_CERR_SGT_BOUNDARY] = { AC_ERR_SYSTEM, ATA_EH_SOFTRESET,
- "SGT not on qword boundary" },
+ "SGT no on qword boundary" },
[PORT_CERR_SGT_TGTABRT] = { AC_ERR_HOST_BUS, ATA_EH_SOFTRESET,
"PCI target abort while fetching SGT" },
[PORT_CERR_SGT_MSTABRT] = { AC_ERR_HOST_BUS, ATA_EH_SOFTRESET,
@@ -832,31 +832,16 @@ static int sil24_qc_defer(struct ata_queued_cmd *qc)
struct ata_link *link = qc->dev->link;
struct ata_port *ap = link->ap;
u8 prot = qc->tf.protocol;
-
- /*
- * There is a bug in the chip:
- * Port LRAM Causes the PRB/SGT Data to be Corrupted
- * If the host issues a read request for LRAM and SActive registers
- * while active commands are available in the port, PRB/SGT data in
- * the LRAM can become corrupted. This issue applies only when
- * reading from, but not writing to, the LRAM.
- *
- * Therefore, reading LRAM when there is no particular error [and
- * other commands may be outstanding] is prohibited.
- *
- * To avoid this bug there are two situations where a command must run
- * exclusive of any other commands on the port:
- *
- * - ATAPI commands which check the sense data
- * - Passthrough ATA commands which always have ATA_QCFLAG_RESULT_TF
- * set.
- *
- */
- int is_excl = (prot == ATA_PROT_ATAPI ||
- prot == ATA_PROT_ATAPI_NODATA ||
- prot == ATA_PROT_ATAPI_DMA ||
- (qc->flags & ATA_QCFLAG_RESULT_TF));
-
+ int is_atapi = (prot == ATA_PROT_ATAPI ||
+ prot == ATA_PROT_ATAPI_NODATA ||
+ prot == ATA_PROT_ATAPI_DMA);
+
+ /* ATAPI commands completing with CHECK_SENSE cause various
+ * weird problems if other commands are active. PMP DMA CS
+ * errata doesn't cover all and HSM violation occurs even with
+ * only one other device active. Always run an ATAPI command
+ * by itself.
+ */
if (unlikely(ap->excl_link)) {
if (link == ap->excl_link) {
if (ap->nr_active_links)
@@ -864,7 +849,7 @@ static int sil24_qc_defer(struct ata_queued_cmd *qc)
qc->flags |= ATA_QCFLAG_CLEAR_EXCL;
} else
return ATA_DEFER_PORT;
- } else if (unlikely(is_excl)) {
+ } else if (unlikely(is_atapi)) {
ap->excl_link = link;
if (ap->nr_active_links)
return ATA_DEFER_PORT;
@@ -1094,13 +1079,10 @@ static void sil24_error_intr(struct ata_port *ap)
if (ci && ci->desc) {
err_mask |= ci->err_mask;
action |= ci->action;
- if (action & ATA_EH_RESET_MASK)
- freeze = 1;
ata_ehi_push_desc(ehi, "%s", ci->desc);
} else {
err_mask |= AC_ERR_OTHER;
action |= ATA_EH_SOFTRESET;
- freeze = 1;
ata_ehi_push_desc(ehi, "unknown command error %d",
cerr);
}
diff --git a/trunk/drivers/atm/firestream.c b/trunk/drivers/atm/firestream.c
index c662d686154a..f8f7139c07c1 100644
--- a/trunk/drivers/atm/firestream.c
+++ b/trunk/drivers/atm/firestream.c
@@ -171,8 +171,8 @@ static char *res_strings[] = {
"packet purged",
"packet ageing timeout",
"channel ageing timeout",
- "calculated length error",
- "programmed length limit error",
+ "calculated lenght error",
+ "programmed lenght limit error",
"aal5 crc32 error",
"oam transp or transpc crc10 error",
"reserved 25",
diff --git a/trunk/drivers/atm/idt77105.c b/trunk/drivers/atm/idt77105.c
index 84672dc57f7a..0bd657f5dd2a 100644
--- a/trunk/drivers/atm/idt77105.c
+++ b/trunk/drivers/atm/idt77105.c
@@ -357,7 +357,7 @@ static const struct atmphy_ops idt77105_ops = {
};
-int idt77105_init(struct atm_dev *dev)
+int __devinit idt77105_init(struct atm_dev *dev)
{
dev->phy = &idt77105_ops;
return 0;
diff --git a/trunk/drivers/atm/nicstar.c b/trunk/drivers/atm/nicstar.c
index 0c205b000e8b..14ced85b3f54 100644
--- a/trunk/drivers/atm/nicstar.c
+++ b/trunk/drivers/atm/nicstar.c
@@ -625,6 +625,14 @@ static int __devinit ns_init_card(int i, struct pci_dev *pcidev)
if (mac[i] == NULL)
nicstar_init_eprom(card->membase);
+ if (request_irq(pcidev->irq, &ns_irq_handler, IRQF_DISABLED | IRQF_SHARED, "nicstar", card) != 0)
+ {
+ printk("nicstar%d: can't allocate IRQ %d.\n", i, pcidev->irq);
+ error = 9;
+ ns_init_card_error(card, error);
+ return error;
+ }
+
/* Set the VPI/VCI MSb mask to zero so we can receive OAM cells */
writel(0x00000000, card->membase + VPM);
@@ -850,6 +858,8 @@ static int __devinit ns_init_card(int i, struct pci_dev *pcidev)
card->iovpool.count++;
}
+ card->intcnt = 0;
+
/* Configure NICStAR */
if (card->rct_size == 4096)
ns_cfg_rctsize = NS_CFG_RCTSIZE_4096_ENTRIES;
@@ -858,15 +868,6 @@ static int __devinit ns_init_card(int i, struct pci_dev *pcidev)
card->efbie = 1;
- card->intcnt = 0;
- if (request_irq(pcidev->irq, &ns_irq_handler, IRQF_DISABLED | IRQF_SHARED, "nicstar", card) != 0)
- {
- printk("nicstar%d: can't allocate IRQ %d.\n", i, pcidev->irq);
- error = 9;
- ns_init_card_error(card, error);
- return error;
- }
-
/* Register device */
card->atmdev = atm_dev_register("nicstar", &atm_ops, -1, NULL);
if (card->atmdev == NULL)
diff --git a/trunk/drivers/atm/suni.c b/trunk/drivers/atm/suni.c
index b1d063cc4fbe..f04f39c00833 100644
--- a/trunk/drivers/atm/suni.c
+++ b/trunk/drivers/atm/suni.c
@@ -289,7 +289,7 @@ static const struct atmphy_ops suni_ops = {
};
-int suni_init(struct atm_dev *dev)
+int __devinit suni_init(struct atm_dev *dev)
{
unsigned char mri;
diff --git a/trunk/drivers/block/cciss.c b/trunk/drivers/block/cciss.c
index 509b6490413b..7d704968765f 100644
--- a/trunk/drivers/block/cciss.c
+++ b/trunk/drivers/block/cciss.c
@@ -2927,7 +2927,7 @@ static void __devinit cciss_interrupt_mode(ctlr_info_t *c,
return;
}
-static int __devinit cciss_pci_init(ctlr_info_t *c, struct pci_dev *pdev)
+static int cciss_pci_init(ctlr_info_t *c, struct pci_dev *pdev)
{
ushort subsystem_vendor_id, subsystem_device_id, command;
__u32 board_id, scratchpad = 0;
diff --git a/trunk/drivers/block/loop.c b/trunk/drivers/block/loop.c
index b8af22e610df..56e23042728a 100644
--- a/trunk/drivers/block/loop.c
+++ b/trunk/drivers/block/loop.c
@@ -610,7 +610,7 @@ static int loop_thread(void *data)
static int loop_switch(struct loop_device *lo, struct file *file)
{
struct switch_request w;
- struct bio *bio = bio_alloc(GFP_KERNEL, 0);
+ struct bio *bio = bio_alloc(GFP_KERNEL, 1);
if (!bio)
return -ENOMEM;
init_completion(&w.wait);
diff --git a/trunk/drivers/bluetooth/hci_ll.c b/trunk/drivers/bluetooth/hci_ll.c
index b91d45a41b2f..8c3e62a17b4a 100644
--- a/trunk/drivers/bluetooth/hci_ll.c
+++ b/trunk/drivers/bluetooth/hci_ll.c
@@ -204,19 +204,6 @@ static void ll_device_want_to_wakeup(struct hci_uart *hu)
spin_lock_irqsave(&ll->hcill_lock, flags);
switch (ll->hcill_state) {
- case HCILL_ASLEEP_TO_AWAKE:
- /*
- * This state means that both the host and the BRF chip
- * have simultaneously sent a wake-up-indication packet.
- * Traditionaly, in this case, receiving a wake-up-indication
- * was enough and an additional wake-up-ack wasn't needed.
- * This has changed with the BRF6350, which does require an
- * explicit wake-up-ack. Other BRF versions, which do not
- * require an explicit ack here, do accept it, thus it is
- * perfectly safe to always send one.
- */
- BT_DBG("dual wake-up-indication");
- /* deliberate fall-through - do not add break */
case HCILL_ASLEEP:
/* acknowledge device wake up */
if (send_hcill_cmd(HCILL_WAKE_UP_ACK, hu) < 0) {
@@ -224,8 +211,16 @@ static void ll_device_want_to_wakeup(struct hci_uart *hu)
goto out;
}
break;
+ case HCILL_ASLEEP_TO_AWAKE:
+ /*
+ * this state means that a wake-up-indication
+ * is already on its way to the device,
+ * and will serve as the required wake-up-ack
+ */
+ BT_DBG("dual wake-up-indication");
+ break;
default:
- /* any other state is illegal */
+ /* any other state are illegal */
BT_ERR("received HCILL_WAKE_UP_IND in state %ld", ll->hcill_state);
break;
}
diff --git a/trunk/drivers/char/Kconfig b/trunk/drivers/char/Kconfig
index 2e3a0d4bc4c2..ef1ed5d70125 100644
--- a/trunk/drivers/char/Kconfig
+++ b/trunk/drivers/char/Kconfig
@@ -137,7 +137,7 @@ config CYCLADES
your Linux box, for instance in order to become a dial-in server.
For information about the Cyclades-Z card, read
- .
+ .
To compile this driver as a module, choose M here: the
module will be called cyclades.
diff --git a/trunk/drivers/char/tpm/tpm.c b/trunk/drivers/char/tpm/tpm.c
index c88424a0c89b..39564b76d4a3 100644
--- a/trunk/drivers/char/tpm/tpm.c
+++ b/trunk/drivers/char/tpm/tpm.c
@@ -1046,6 +1046,12 @@ void tpm_remove_hardware(struct device *dev)
}
EXPORT_SYMBOL_GPL(tpm_remove_hardware);
+static u8 savestate[] = {
+ 0, 193, /* TPM_TAG_RQU_COMMAND */
+ 0, 0, 0, 10, /* blob length (in bytes) */
+ 0, 0, 0, 152 /* TPM_ORD_SaveState */
+};
+
/*
* We are about to suspend. Save the TPM state
* so that it can be restored.
@@ -1053,12 +1059,6 @@ EXPORT_SYMBOL_GPL(tpm_remove_hardware);
int tpm_pm_suspend(struct device *dev, pm_message_t pm_state)
{
struct tpm_chip *chip = dev_get_drvdata(dev);
- u8 savestate[] = {
- 0, 193, /* TPM_TAG_RQU_COMMAND */
- 0, 0, 0, 10, /* blob length (in bytes) */
- 0, 0, 0, 152 /* TPM_ORD_SaveState */
- };
-
if (chip == NULL)
return -ENODEV;
diff --git a/trunk/drivers/char/tty_ioctl.c b/trunk/drivers/char/tty_ioctl.c
index d4b6d64e858b..1bdd2bf4f37d 100644
--- a/trunk/drivers/char/tty_ioctl.c
+++ b/trunk/drivers/char/tty_ioctl.c
@@ -62,7 +62,7 @@ void tty_wait_until_sent(struct tty_struct * tty, long timeout)
if (!timeout)
timeout = MAX_SCHEDULE_TIMEOUT;
if (wait_event_interruptible_timeout(tty->write_wait,
- !tty->driver->chars_in_buffer(tty), timeout) < 0)
+ !tty->driver->chars_in_buffer(tty), timeout))
return;
if (tty->driver->wait_until_sent)
tty->driver->wait_until_sent(tty, timeout);
@@ -364,25 +364,6 @@ void tty_termios_copy_hw(struct ktermios *new, struct ktermios *old)
EXPORT_SYMBOL(tty_termios_copy_hw);
-/**
- * tty_termios_hw_change - check for setting change
- * @a: termios
- * @b: termios to compare
- *
- * Check if any of the bits that affect a dumb device have changed
- * between the two termios structures, or a speed change is needed.
- */
-
-int tty_termios_hw_change(struct ktermios *a, struct ktermios *b)
-{
- if (a->c_ispeed != b->c_ispeed || a->c_ospeed != b->c_ospeed)
- return 1;
- if ((a->c_cflag ^ b->c_cflag) & ~(HUPCL | CREAD | CLOCAL))
- return 1;
- return 0;
-}
-EXPORT_SYMBOL(tty_termios_hw_change);
-
/**
* change_termios - update termios values
* @tty: tty to update
diff --git a/trunk/drivers/connector/cn_queue.c b/trunk/drivers/connector/cn_queue.c
index 12ceed54ab18..296f51002b55 100644
--- a/trunk/drivers/connector/cn_queue.c
+++ b/trunk/drivers/connector/cn_queue.c
@@ -99,8 +99,8 @@ int cn_queue_add_callback(struct cn_queue_dev *dev, char *name, struct cb_id *id
spin_unlock_bh(&dev->queue_lock);
if (found) {
- cn_queue_free_callback(cbq);
atomic_dec(&dev->refcnt);
+ cn_queue_free_callback(cbq);
return -EINVAL;
}
diff --git a/trunk/drivers/connector/connector.c b/trunk/drivers/connector/connector.c
index bf9716b75513..6883fcb79ad3 100644
--- a/trunk/drivers/connector/connector.c
+++ b/trunk/drivers/connector/connector.c
@@ -145,8 +145,6 @@ static int cn_call_callback(struct cn_msg *msg, void (*destruct_data)(void *), v
if (queue_work(dev->cbdev->cn_queue,
&__cbq->work))
err = 0;
- else
- err = -EINVAL;
} else {
struct cn_callback_data *d;
diff --git a/trunk/drivers/cpufreq/cpufreq_conservative.c b/trunk/drivers/cpufreq/cpufreq_conservative.c
index 5d3a04ba6ad2..1bba99747f5b 100644
--- a/trunk/drivers/cpufreq/cpufreq_conservative.c
+++ b/trunk/drivers/cpufreq/cpufreq_conservative.c
@@ -603,9 +603,5 @@ MODULE_DESCRIPTION ("'cpufreq_conservative' - A dynamic cpufreq governor for "
"optimised for use in a battery environment");
MODULE_LICENSE ("GPL");
-#ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE
-fs_initcall(cpufreq_gov_dbs_init);
-#else
module_init(cpufreq_gov_dbs_init);
-#endif
module_exit(cpufreq_gov_dbs_exit);
diff --git a/trunk/drivers/cpufreq/cpufreq_ondemand.c b/trunk/drivers/cpufreq/cpufreq_ondemand.c
index d2af20dda382..369f44595150 100644
--- a/trunk/drivers/cpufreq/cpufreq_ondemand.c
+++ b/trunk/drivers/cpufreq/cpufreq_ondemand.c
@@ -610,9 +610,6 @@ MODULE_DESCRIPTION("'cpufreq_ondemand' - A dynamic cpufreq governor for "
"Low Latency Frequency Transition capable processors");
MODULE_LICENSE("GPL");
-#ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND
-fs_initcall(cpufreq_gov_dbs_init);
-#else
module_init(cpufreq_gov_dbs_init);
-#endif
module_exit(cpufreq_gov_dbs_exit);
+
diff --git a/trunk/drivers/cpufreq/cpufreq_userspace.c b/trunk/drivers/cpufreq/cpufreq_userspace.c
index f8cdde4bf6cd..51bedab6c808 100644
--- a/trunk/drivers/cpufreq/cpufreq_userspace.c
+++ b/trunk/drivers/cpufreq/cpufreq_userspace.c
@@ -231,9 +231,5 @@ MODULE_AUTHOR ("Dominik Brodowski , Russell King E, &ctx->cword.encrypt);
+ padlock_xcrypt_ecb(in, out, ctx->E, &ctx->cword.encrypt, 1);
}
static void aes_decrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in)
{
struct aes_ctx *ctx = aes_ctx(tfm);
- aes_crypt(in, out, ctx->D, &ctx->cword.decrypt);
+ padlock_xcrypt_ecb(in, out, ctx->D, &ctx->cword.decrypt, 1);
}
static struct crypto_alg aes_alg = {
diff --git a/trunk/drivers/firmware/dmi-id.c b/trunk/drivers/firmware/dmi-id.c
index bc132d8f79cb..b6e1eb77d148 100644
--- a/trunk/drivers/firmware/dmi-id.c
+++ b/trunk/drivers/firmware/dmi-id.c
@@ -175,11 +175,12 @@ static struct device *dmi_dev;
extern int dmi_available;
-/* In a separate function to keep gcc 3.2 happy - do NOT merge this in
- dmi_id_init! */
-static void __init dmi_id_init_attr_table(void)
+static int __init dmi_id_init(void)
{
- int i;
+ int ret, i;
+
+ if (!dmi_available)
+ return -ENODEV;
/* Not necessarily all DMI fields are available on all
* systems, hence let's built an attribute table of just
@@ -204,16 +205,6 @@ static void __init dmi_id_init_attr_table(void)
ADD_DMI_ATTR(chassis_serial, DMI_CHASSIS_SERIAL);
ADD_DMI_ATTR(chassis_asset_tag, DMI_CHASSIS_ASSET_TAG);
sys_dmi_attributes[i++] = &sys_dmi_modalias_attr.attr;
-}
-
-static int __init dmi_id_init(void)
-{
- int ret;
-
- if (!dmi_available)
- return -ENODEV;
-
- dmi_id_init_attr_table();
ret = class_register(&dmi_class);
if (ret)
diff --git a/trunk/drivers/hwmon/it87.c b/trunk/drivers/hwmon/it87.c
index ad6c8a319903..6a182e14cf58 100644
--- a/trunk/drivers/hwmon/it87.c
+++ b/trunk/drivers/hwmon/it87.c
@@ -2,14 +2,6 @@
it87.c - Part of lm_sensors, Linux kernel modules for hardware
monitoring.
- The IT8705F is an LPC-based Super I/O part that contains UARTs, a
- parallel port, an IR port, a MIDI port, a floppy controller, etc., in
- addition to an Environment Controller (Enhanced Hardware Monitor and
- Fan Controller)
-
- This driver supports only the Environment Controller in the IT8705F and
- similar parts. The other devices are supported by different drivers.
-
Supports: IT8705F Super I/O chip w/LPC interface
IT8712F Super I/O chip w/LPC interface
IT8716F Super I/O chip w/LPC interface
@@ -126,15 +118,9 @@ static int fix_pwm_polarity;
/* Length of ISA address segment */
#define IT87_EXTENT 8
-/* Length of ISA address segment for Environmental Controller */
-#define IT87_EC_EXTENT 2
-
-/* Offset of EC registers from ISA base address */
-#define IT87_EC_OFFSET 5
-
-/* Where are the ISA address/data registers relative to the EC base address */
-#define IT87_ADDR_REG_OFFSET 0
-#define IT87_DATA_REG_OFFSET 1
+/* Where are the ISA address/data registers relative to the base address */
+#define IT87_ADDR_REG_OFFSET 5
+#define IT87_DATA_REG_OFFSET 6
/*----- The IT87 registers -----*/
@@ -982,10 +968,10 @@ static int __devinit it87_probe(struct platform_device *pdev)
};
res = platform_get_resource(pdev, IORESOURCE_IO, 0);
- if (!request_region(res->start, IT87_EC_EXTENT, DRVNAME)) {
+ if (!request_region(res->start, IT87_EXTENT, DRVNAME)) {
dev_err(dev, "Failed to request region 0x%lx-0x%lx\n",
(unsigned long)res->start,
- (unsigned long)(res->start + IT87_EC_EXTENT - 1));
+ (unsigned long)(res->start + IT87_EXTENT - 1));
err = -EBUSY;
goto ERROR0;
}
@@ -1138,7 +1124,7 @@ static int __devinit it87_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, NULL);
kfree(data);
ERROR1:
- release_region(res->start, IT87_EC_EXTENT);
+ release_region(res->start, IT87_EXTENT);
ERROR0:
return err;
}
@@ -1151,7 +1137,7 @@ static int __devexit it87_remove(struct platform_device *pdev)
sysfs_remove_group(&pdev->dev.kobj, &it87_group);
sysfs_remove_group(&pdev->dev.kobj, &it87_group_opt);
- release_region(data->addr, IT87_EC_EXTENT);
+ release_region(data->addr, IT87_EXTENT);
platform_set_drvdata(pdev, NULL);
kfree(data);
@@ -1416,8 +1402,8 @@ static int __init it87_device_add(unsigned short address,
const struct it87_sio_data *sio_data)
{
struct resource res = {
- .start = address + IT87_EC_OFFSET,
- .end = address + IT87_EC_OFFSET + IT87_EC_EXTENT - 1,
+ .start = address ,
+ .end = address + IT87_EXTENT - 1,
.name = DRVNAME,
.flags = IORESOURCE_IO,
};
diff --git a/trunk/drivers/hwmon/w83627ehf.c b/trunk/drivers/hwmon/w83627ehf.c
index d5aa25ce5dbd..b15c6a998b72 100644
--- a/trunk/drivers/hwmon/w83627ehf.c
+++ b/trunk/drivers/hwmon/w83627ehf.c
@@ -1276,31 +1276,23 @@ static int __devinit w83627ehf_probe(struct platform_device *pdev)
data->vrm = vid_which_vrm();
superio_enter(sio_data->sioreg);
+ /* Set VID input sensibility if needed. In theory the BIOS should
+ have set it, but in practice it's not always the case. */
+ en_vrm10 = superio_inb(sio_data->sioreg, SIO_REG_EN_VRM10);
+ if ((en_vrm10 & 0x08) && data->vrm != 100) {
+ dev_warn(dev, "Setting VID input voltage to TTL\n");
+ superio_outb(sio_data->sioreg, SIO_REG_EN_VRM10,
+ en_vrm10 & ~0x08);
+ } else if (!(en_vrm10 & 0x08) && data->vrm == 100) {
+ dev_warn(dev, "Setting VID input voltage to VRM10\n");
+ superio_outb(sio_data->sioreg, SIO_REG_EN_VRM10,
+ en_vrm10 | 0x08);
+ }
/* Read VID value */
superio_select(sio_data->sioreg, W83627EHF_LD_HWM);
- if (superio_inb(sio_data->sioreg, SIO_REG_VID_CTRL) & 0x80) {
- /* Set VID input sensibility if needed. In theory the BIOS
- should have set it, but in practice it's not always the
- case. We only do it for the W83627EHF/EHG because the
- W83627DHG is more complex in this respect. */
- if (sio_data->kind == w83627ehf) {
- en_vrm10 = superio_inb(sio_data->sioreg,
- SIO_REG_EN_VRM10);
- if ((en_vrm10 & 0x08) && data->vrm == 90) {
- dev_warn(dev, "Setting VID input voltage to "
- "TTL\n");
- superio_outb(sio_data->sioreg, SIO_REG_EN_VRM10,
- en_vrm10 & ~0x08);
- } else if (!(en_vrm10 & 0x08) && data->vrm == 100) {
- dev_warn(dev, "Setting VID input voltage to "
- "VRM10\n");
- superio_outb(sio_data->sioreg, SIO_REG_EN_VRM10,
- en_vrm10 | 0x08);
- }
- }
-
+ if (superio_inb(sio_data->sioreg, SIO_REG_VID_CTRL) & 0x80)
data->vid = superio_inb(sio_data->sioreg, SIO_REG_VID_DATA) & 0x3f;
- } else {
+ else {
dev_info(dev, "VID pins in output mode, CPU VID not "
"available\n");
data->vid = 0x3f;
diff --git a/trunk/drivers/i2c/busses/i2c-at91.c b/trunk/drivers/i2c/busses/i2c-at91.c
index c09b036913bd..9c8b6d5eaec9 100644
--- a/trunk/drivers/i2c/busses/i2c-at91.c
+++ b/trunk/drivers/i2c/busses/i2c-at91.c
@@ -135,7 +135,7 @@ static int xfer_write(struct i2c_adapter *adap, unsigned char *buf, int length)
* Generic i2c master transfer entrypoint.
*
* Note: We do not use Atmel's feature of storing the "internal device address".
- * Instead the "internal device address" has to be written using a separate
+ * Instead the "internal device address" has to be written using a seperate
* i2c message.
* http://lists.arm.linux.org.uk/pipermail/linux-arm-kernel/2004-September/024411.html
*/
diff --git a/trunk/drivers/i2c/busses/i2c-omap.c b/trunk/drivers/i2c/busses/i2c-omap.c
index f2552b19ea60..cb55cf2ba1e9 100644
--- a/trunk/drivers/i2c/busses/i2c-omap.c
+++ b/trunk/drivers/i2c/busses/i2c-omap.c
@@ -619,13 +619,13 @@ omap_i2c_probe(struct platform_device *pdev)
err_free_irq:
free_irq(dev->irq, dev);
err_unuse_clocks:
- omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, 0);
omap_i2c_disable_clocks(dev);
omap_i2c_put_clocks(dev);
err_free_mem:
platform_set_drvdata(pdev, NULL);
kfree(dev);
err_release_region:
+ omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, 0);
release_mem_region(mem->start, (mem->end - mem->start) + 1);
return r;
diff --git a/trunk/drivers/i2c/busses/i2c-powermac.c b/trunk/drivers/i2c/busses/i2c-powermac.c
index 7813127649a1..0ab4f2627c26 100644
--- a/trunk/drivers/i2c/busses/i2c-powermac.c
+++ b/trunk/drivers/i2c/busses/i2c-powermac.c
@@ -94,7 +94,7 @@ static s32 i2c_powermac_smbus_xfer( struct i2c_adapter* adap,
break;
/* Note that these are broken vs. the expected smbus API where
- * on reads, the length is actually returned from the function,
+ * on reads, the lenght is actually returned from the function,
* but I think the current API makes no sense and I don't want
* any driver that I haven't verified for correctness to go
* anywhere near a pmac i2c bus anyway ...
diff --git a/trunk/drivers/i2c/busses/i2c-sibyte.c b/trunk/drivers/i2c/busses/i2c-sibyte.c
index 503a134ec803..0ca599d3b402 100644
--- a/trunk/drivers/i2c/busses/i2c-sibyte.c
+++ b/trunk/drivers/i2c/busses/i2c-sibyte.c
@@ -200,14 +200,11 @@ static struct i2c_adapter sibyte_board_adapter[2] = {
static int __init i2c_sibyte_init(void)
{
- pr_info("i2c-sibyte: i2c SMBus adapter module for SiByte board\n");
+ printk("i2c-swarm.o: i2c SMBus adapter module for SiByte board\n");
if (i2c_sibyte_add_bus(&sibyte_board_adapter[0], K_SMB_FREQ_100KHZ) < 0)
return -ENODEV;
- if (i2c_sibyte_add_bus(&sibyte_board_adapter[1],
- K_SMB_FREQ_400KHZ) < 0) {
- i2c_del_adapter(&sibyte_board_adapter[0]);
+ if (i2c_sibyte_add_bus(&sibyte_board_adapter[1], K_SMB_FREQ_400KHZ) < 0)
return -ENODEV;
- }
return 0;
}
diff --git a/trunk/drivers/i2c/i2c-dev.c b/trunk/drivers/i2c/i2c-dev.c
index df540d5dfaf4..c21ae20ae362 100644
--- a/trunk/drivers/i2c/i2c-dev.c
+++ b/trunk/drivers/i2c/i2c-dev.c
@@ -184,7 +184,7 @@ static ssize_t i2cdev_write (struct file *file, const char __user *buf, size_t c
/* This address checking function differs from the one in i2c-core
in that it considers an address with a registered device, but no
- bound driver, as NOT busy. */
+ bounded driver, as NOT busy. */
static int i2cdev_check_addr(struct i2c_adapter *adapter, unsigned int addr)
{
struct list_head *item;
diff --git a/trunk/drivers/ide/ide-acpi.c b/trunk/drivers/ide/ide-acpi.c
index 899d56536e80..89df48fdc69d 100644
--- a/trunk/drivers/ide/ide-acpi.c
+++ b/trunk/drivers/ide/ide-acpi.c
@@ -16,7 +16,6 @@
#include
#include
#include
-#include
#include
#include
@@ -66,39 +65,6 @@ extern int ide_noacpi;
extern int ide_noacpitfs;
extern int ide_noacpionboot;
-static bool ide_noacpi_psx;
-static int no_acpi_psx(const struct dmi_system_id *id)
-{
- ide_noacpi_psx = true;
- printk(KERN_NOTICE"%s detected - disable ACPI _PSx.\n", id->ident);
- return 0;
-}
-
-static const struct dmi_system_id ide_acpi_dmi_table[] = {
- /* Bug 9673. */
- /* We should check if this is because ACPI NVS isn't save/restored. */
- {
- .callback = no_acpi_psx,
- .ident = "HP nx9005",
- .matches = {
- DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies Ltd."),
- DMI_MATCH(DMI_BIOS_VERSION, "KAM1.60")
- },
- },
-
- { } /* terminate list */
-};
-
-static int ide_acpi_blacklist(void)
-{
- static int done;
- if (done)
- return 0;
- done = 1;
- dmi_check_system(ide_acpi_dmi_table);
- return 0;
-}
-
/**
* ide_get_dev_handle - finds acpi_handle and PCI device.function
* @dev: device to locate
@@ -657,7 +623,7 @@ void ide_acpi_set_state(ide_hwif_t *hwif, int on)
{
int unit;
- if (ide_noacpi || ide_noacpi_psx)
+ if (ide_noacpi)
return;
DEBPRINT("ENTER:\n");
@@ -702,8 +668,6 @@ void ide_acpi_init(ide_hwif_t *hwif)
struct ide_acpi_drive_link *master;
struct ide_acpi_drive_link *slave;
- ide_acpi_blacklist();
-
hwif->acpidata = kzalloc(sizeof(struct ide_acpi_hwif_link), GFP_KERNEL);
if (!hwif->acpidata)
return;
diff --git a/trunk/drivers/ide/ide-cd.c b/trunk/drivers/ide/ide-cd.c
index c7d77f0ad892..92ac658dac33 100644
--- a/trunk/drivers/ide/ide-cd.c
+++ b/trunk/drivers/ide/ide-cd.c
@@ -1068,8 +1068,8 @@ int cdrom_read_check_ireason (ide_drive_t *drive, int len, int ireason)
return 0;
else if (ireason == 0) {
/* Whoops... The drive is expecting to receive data from us! */
- printk(KERN_ERR "%s: %s: wrong transfer direction!\n",
- drive->name, __FUNCTION__);
+ printk(KERN_ERR "%s: read_intr: Drive wants to transfer data the "
+ "wrong way!\n", drive->name);
/* Throw some data at the drive so it doesn't hang
and quit this request. */
@@ -1086,8 +1086,8 @@ int cdrom_read_check_ireason (ide_drive_t *drive, int len, int ireason)
return 0;
} else {
/* Drive wants a command packet, or invalid ireason... */
- printk(KERN_ERR "%s: %s: bad interrupt reason 0x%02x\n",
- drive->name, __FUNCTION__, ireason);
+ printk(KERN_ERR "%s: read_intr: bad interrupt reason %x\n", drive->name,
+ ireason);
}
cdrom_end_request(drive, 0);
@@ -1112,11 +1112,8 @@ static ide_startstop_t cdrom_read_intr (ide_drive_t *drive)
*/
if (dma) {
info->dma = 0;
- dma_error = HWIF(drive)->ide_dma_end(drive);
- if (dma_error) {
- printk(KERN_ERR "%s: DMA read error\n", drive->name);
+ if ((dma_error = HWIF(drive)->ide_dma_end(drive)))
ide_dma_off(drive);
- }
}
if (cdrom_decode_status(drive, 0, &stat))
@@ -1446,7 +1443,7 @@ static ide_startstop_t cdrom_pc_intr (ide_drive_t *drive)
return ide_stopped;
/* Read the interrupt reason and the transfer length. */
- ireason = HWIF(drive)->INB(IDE_IREASON_REG) & 0x3;
+ ireason = HWIF(drive)->INB(IDE_IREASON_REG);
lowcyl = HWIF(drive)->INB(IDE_BCOUNTL_REG);
highcyl = HWIF(drive)->INB(IDE_BCOUNTH_REG);
@@ -1487,7 +1484,7 @@ static ide_startstop_t cdrom_pc_intr (ide_drive_t *drive)
if (thislen > len) thislen = len;
/* The drive wants to be written to. */
- if (ireason == 0) {
+ if ((ireason & 3) == 0) {
if (!rq->data) {
blk_dump_rq_flags(rq, "cdrom_pc_intr, write");
goto confused;
@@ -1509,9 +1506,9 @@ static ide_startstop_t cdrom_pc_intr (ide_drive_t *drive)
}
/* Same drill for reading. */
- else if (ireason == 2) {
+ else if ((ireason & 3) == 2) {
if (!rq->data) {
- blk_dump_rq_flags(rq, "cdrom_pc_intr, read");
+ blk_dump_rq_flags(rq, "cdrom_pc_intr, write");
goto confused;
}
/* Transfer the data. */
@@ -1635,8 +1632,8 @@ static int cdrom_write_check_ireason(ide_drive_t *drive, int len, int ireason)
return 0;
else if (ireason == 2) {
/* Whoops... The drive wants to send data. */
- printk(KERN_ERR "%s: %s: wrong transfer direction!\n",
- drive->name, __FUNCTION__);
+ printk(KERN_ERR "%s: write_intr: wrong transfer direction!\n",
+ drive->name);
while (len > 0) {
int dum = 0;
@@ -1645,8 +1642,8 @@ static int cdrom_write_check_ireason(ide_drive_t *drive, int len, int ireason)
}
} else {
/* Drive wants a command packet, or invalid ireason... */
- printk(KERN_ERR "%s: %s: bad interrupt reason 0x%02x\n",
- drive->name, __FUNCTION__, ireason);
+ printk(KERN_ERR "%s: write_intr: bad interrupt reason %x\n",
+ drive->name, ireason);
}
cdrom_end_request(drive, 0);
@@ -1808,9 +1805,8 @@ static ide_startstop_t cdrom_write_intr(ide_drive_t *drive)
/* Check for errors. */
if (dma) {
info->dma = 0;
- dma_error = HWIF(drive)->ide_dma_end(drive);
- if (dma_error) {
- printk(KERN_ERR "%s: DMA write error\n", drive->name);
+ if ((dma_error = HWIF(drive)->ide_dma_end(drive))) {
+ printk(KERN_ERR "ide-cd: write dma error\n");
ide_dma_off(drive);
}
}
@@ -1830,7 +1826,7 @@ static ide_startstop_t cdrom_write_intr(ide_drive_t *drive)
}
/* Read the interrupt reason and the transfer length. */
- ireason = HWIF(drive)->INB(IDE_IREASON_REG) & 0x3;
+ ireason = HWIF(drive)->INB(IDE_IREASON_REG);
lowcyl = HWIF(drive)->INB(IDE_BCOUNTL_REG);
highcyl = HWIF(drive)->INB(IDE_BCOUNTH_REG);
@@ -1843,9 +1839,8 @@ static ide_startstop_t cdrom_write_intr(ide_drive_t *drive)
*/
uptodate = 1;
if (rq->current_nr_sectors > 0) {
- printk(KERN_ERR "%s: %s: data underrun (%d blocks)\n",
- drive->name, __FUNCTION__,
- rq->current_nr_sectors);
+ printk(KERN_ERR "%s: write_intr: data underrun (%d blocks)\n",
+ drive->name, rq->current_nr_sectors);
uptodate = 0;
}
cdrom_end_request(drive, uptodate);
@@ -1865,8 +1860,7 @@ static ide_startstop_t cdrom_write_intr(ide_drive_t *drive)
int this_transfer;
if (!rq->current_nr_sectors) {
- printk(KERN_ERR "%s: %s: confused, missing data\n",
- drive->name, __FUNCTION__);
+ printk(KERN_ERR "ide-cd: write_intr: oops\n");
break;
}
@@ -2694,14 +2688,14 @@ void ide_cdrom_update_speed (ide_drive_t *drive, struct atapi_capabilities_page
if (!drive->id->model[0] &&
!strncmp(drive->id->fw_rev, "241N", 4)) {
CDROM_STATE_FLAGS(drive)->current_speed =
- (le16_to_cpu(cap->curspeed) + (176/2)) / 176;
+ (((unsigned int)cap->curspeed) + (176/2)) / 176;
CDROM_CONFIG_FLAGS(drive)->max_speed =
- (le16_to_cpu(cap->maxspeed) + (176/2)) / 176;
+ (((unsigned int)cap->maxspeed) + (176/2)) / 176;
} else {
CDROM_STATE_FLAGS(drive)->current_speed =
- (be16_to_cpu(cap->curspeed) + (176/2)) / 176;
+ (ntohs(cap->curspeed) + (176/2)) / 176;
CDROM_CONFIG_FLAGS(drive)->max_speed =
- (be16_to_cpu(cap->maxspeed) + (176/2)) / 176;
+ (ntohs(cap->maxspeed) + (176/2)) / 176;
}
}
@@ -2915,9 +2909,6 @@ static int ide_cdrom_register (ide_drive_t *drive, int nslots)
if (!CDROM_CONFIG_FLAGS(drive)->ram)
devinfo->mask |= CDC_RAM;
- if (CDROM_CONFIG_FLAGS(drive)->no_speed_select)
- devinfo->mask |= CDC_SELECT_SPEED;
-
devinfo->disk = info->disk;
return register_cdrom(devinfo);
}
@@ -3170,7 +3161,7 @@ int ide_cdrom_setup (ide_drive_t *drive)
CDROM_CONFIG_FLAGS(drive)->limit_nframes = 1;
/* the 3231 model does not support the SET_CD_SPEED command */
else if (!strcmp(drive->id->model, "SAMSUNG CD-ROM SCR-3231"))
- CDROM_CONFIG_FLAGS(drive)->no_speed_select = 1;
+ cdi->mask |= CDC_SELECT_SPEED;
#if ! STANDARD_ATAPI
/* by default Sanyo 3 CD changer support is turned off and
@@ -3513,8 +3504,15 @@ static int ide_cd_probe(ide_drive_t *drive)
g->driverfs_dev = &drive->gendev;
g->flags = GENHD_FL_CD | GENHD_FL_REMOVABLE;
if (ide_cdrom_setup(drive)) {
+ struct cdrom_device_info *devinfo = &info->devinfo;
ide_proc_unregister_driver(drive, &ide_cdrom_driver);
- ide_cd_release(&info->kref);
+ kfree(info->buffer);
+ kfree(info->toc);
+ kfree(info->changer_info);
+ if (devinfo->handle == drive && unregister_cdrom(devinfo))
+ printk (KERN_ERR "%s: ide_cdrom_cleanup failed to unregister device from the cdrom driver.\n", drive->name);
+ kfree(info);
+ drive->driver_data = NULL;
goto failed;
}
diff --git a/trunk/drivers/ide/ide-cd.h b/trunk/drivers/ide/ide-cd.h
index 1b302fe2724d..228b29c5d2e4 100644
--- a/trunk/drivers/ide/ide-cd.h
+++ b/trunk/drivers/ide/ide-cd.h
@@ -91,8 +91,7 @@ struct ide_cd_config_flags {
__u8 close_tray : 1; /* can close the tray */
__u8 writing : 1; /* pseudo write in progress */
__u8 mo_drive : 1; /* drive is an MO device */
- __u8 no_speed_select : 1; /* SET_CD_SPEED command is unsupported. */
- __u8 reserved : 1;
+ __u8 reserved : 2;
byte max_speed; /* Max speed of the drive */
};
#define CDROM_CONFIG_FLAGS(drive) (&(((struct cdrom_info *)(drive->driver_data))->config_flags))
diff --git a/trunk/drivers/ide/ide-iops.c b/trunk/drivers/ide/ide-iops.c
index bb9693dabe41..cef405ddaf0e 100644
--- a/trunk/drivers/ide/ide-iops.c
+++ b/trunk/drivers/ide/ide-iops.c
@@ -612,12 +612,12 @@ u8 eighty_ninty_three (ide_drive_t *drive)
printk(KERN_DEBUG "%s: skipping word 93 validity check\n",
drive->name);
- if (ide_dev_is_sata(id) && !ivb)
- return 1;
-
if (hwif->cbl != ATA_CBL_PATA80 && !ivb)
goto no_80w;
+ if (ide_dev_is_sata(id))
+ return 1;
+
/*
* FIXME:
* - force bit13 (80c cable present) check also for !ivb devices
diff --git a/trunk/drivers/ide/pci/cmd64x.c b/trunk/drivers/ide/pci/cmd64x.c
index bc553337b1be..51fca441c294 100644
--- a/trunk/drivers/ide/pci/cmd64x.c
+++ b/trunk/drivers/ide/pci/cmd64x.c
@@ -1,5 +1,5 @@
/*
- * linux/drivers/ide/pci/cmd64x.c Version 1.52 Dec 24, 2007
+ * linux/drivers/ide/pci/cmd64x.c Version 1.51 Nov 8, 2007
*
* cmd64x.c: Enable interrupts at initialization time on Ultra/PCI machines.
* Due to massive hardware bugs, UltraDMA is only supported
@@ -564,7 +564,6 @@ static const struct ide_port_info cmd64x_chipsets[] __devinitdata = {
.init_chipset = init_chipset_cmd64x,
.init_hwif = init_hwif_cmd64x,
.enablebits = {{0x51,0x04,0x04}, {0x51,0x08,0x08}},
- .chipset = ide_cmd646,
.host_flags = IDE_HFLAG_ABUSE_PREFETCH | IDE_HFLAG_BOOTABLE,
.pio_mask = ATA_PIO5,
.mwdma_mask = ATA_MWDMA2,
@@ -574,6 +573,7 @@ static const struct ide_port_info cmd64x_chipsets[] __devinitdata = {
.init_chipset = init_chipset_cmd64x,
.init_hwif = init_hwif_cmd64x,
.enablebits = {{0x51,0x04,0x04}, {0x51,0x08,0x08}},
+ .chipset = ide_cmd646,
.host_flags = IDE_HFLAG_ABUSE_PREFETCH | IDE_HFLAG_BOOTABLE,
.pio_mask = ATA_PIO5,
.mwdma_mask = ATA_MWDMA2,
diff --git a/trunk/drivers/ide/pci/cs5535.c b/trunk/drivers/ide/pci/cs5535.c
index ddcbeba671e1..9094916e3780 100644
--- a/trunk/drivers/ide/pci/cs5535.c
+++ b/trunk/drivers/ide/pci/cs5535.c
@@ -49,7 +49,7 @@
#define ATAC_BM0_PRD 0x04
#define CS5535_CABLE_DETECT 0x48
-/* Format I PIO settings. We separate out cmd and data for safer timings */
+/* Format I PIO settings. We seperate out cmd and data for safer timings */
static unsigned int cs5535_pio_cmd_timings[5] =
{ 0xF7F4, 0x53F3, 0x13F1, 0x5131, 0x1131 };
diff --git a/trunk/drivers/ide/pci/trm290.c b/trunk/drivers/ide/pci/trm290.c
index 0151d7fdfb8a..0895e753a35d 100644
--- a/trunk/drivers/ide/pci/trm290.c
+++ b/trunk/drivers/ide/pci/trm290.c
@@ -1,8 +1,7 @@
/*
- * linux/drivers/ide/pci/trm290.c Version 1.05 Dec. 26, 2007
+ * linux/drivers/ide/pci/trm290.c Version 1.02 Mar. 18, 2000
*
* Copyright (c) 1997-1998 Mark Lord
- * Copyright (c) 2007 MontaVista Software, Inc.
* May be copied or modified under the terms of the GNU General Public License
*
* June 22, 2004 - get rid of check_region
@@ -178,7 +177,7 @@ static void trm290_selectproc (ide_drive_t *drive)
trm290_prepare_drive(drive, drive->using_dma);
}
-static void trm290_dma_exec_cmd(ide_drive_t *drive, u8 command)
+static void trm290_ide_dma_exec_cmd(ide_drive_t *drive, u8 command)
{
BUG_ON(HWGROUP(drive)->handler != NULL); /* paranoia check */
ide_set_handler(drive, &ide_dma_intr, WAIT_CMD, NULL);
@@ -186,7 +185,7 @@ static void trm290_dma_exec_cmd(ide_drive_t *drive, u8 command)
outb(command, IDE_COMMAND_REG);
}
-static int trm290_dma_setup(ide_drive_t *drive)
+static int trm290_ide_dma_setup(ide_drive_t *drive)
{
ide_hwif_t *hwif = drive->hwif;
struct request *rq = hwif->hwgroup->rq;
@@ -216,7 +215,7 @@ static int trm290_dma_setup(ide_drive_t *drive)
return 0;
}
-static void trm290_dma_start(ide_drive_t *drive)
+static void trm290_ide_dma_start(ide_drive_t *drive)
{
}
@@ -241,14 +240,6 @@ static int trm290_ide_dma_test_irq (ide_drive_t *drive)
return (status == 0x00ff);
}
-static void trm290_dma_host_on(ide_drive_t *drive)
-{
-}
-
-static void trm290_dma_host_off(ide_drive_t *drive)
-{
-}
-
static void __devinit init_hwif_trm290(ide_hwif_t *hwif)
{
unsigned int cfgbase = 0;
@@ -289,13 +280,11 @@ static void __devinit init_hwif_trm290(ide_hwif_t *hwif)
ide_setup_dma(hwif, (hwif->config_data + 4) ^ (hwif->channel ? 0x0080 : 0x0000), 3);
- hwif->dma_host_off = &trm290_dma_host_off;
- hwif->dma_host_on = &trm290_dma_host_on;
- hwif->dma_setup = &trm290_dma_setup;
- hwif->dma_exec_cmd = &trm290_dma_exec_cmd;
- hwif->dma_start = &trm290_dma_start;
- hwif->ide_dma_end = &trm290_ide_dma_end;
- hwif->ide_dma_test_irq = &trm290_ide_dma_test_irq;
+ hwif->dma_setup = &trm290_ide_dma_setup;
+ hwif->dma_exec_cmd = &trm290_ide_dma_exec_cmd;
+ hwif->dma_start = &trm290_ide_dma_start;
+ hwif->ide_dma_end = &trm290_ide_dma_end;
+ hwif->ide_dma_test_irq = &trm290_ide_dma_test_irq;
hwif->selectproc = &trm290_selectproc;
#if 1
diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_ud.c b/trunk/drivers/infiniband/hw/ipath/ipath_ud.c
index b3df6f3c705e..16a2a938b520 100644
--- a/trunk/drivers/infiniband/hw/ipath/ipath_ud.c
+++ b/trunk/drivers/infiniband/hw/ipath/ipath_ud.c
@@ -455,28 +455,6 @@ void ipath_ud_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr,
}
}
- /*
- * The opcode is in the low byte when its in network order
- * (top byte when in host order).
- */
- opcode = be32_to_cpu(ohdr->bth[0]) >> 24;
- if (qp->ibqp.qp_num > 1 &&
- opcode == IB_OPCODE_UD_SEND_ONLY_WITH_IMMEDIATE) {
- if (header_in_data) {
- wc.imm_data = *(__be32 *) data;
- data += sizeof(__be32);
- } else
- wc.imm_data = ohdr->u.ud.imm_data;
- wc.wc_flags = IB_WC_WITH_IMM;
- hdrsize += sizeof(u32);
- } else if (opcode == IB_OPCODE_UD_SEND_ONLY) {
- wc.imm_data = 0;
- wc.wc_flags = 0;
- } else {
- dev->n_pkt_drops++;
- goto bail;
- }
-
/* Get the number of bytes the message was padded by. */
pad = (be32_to_cpu(ohdr->bth[0]) >> 20) & 3;
if (unlikely(tlen < (hdrsize + pad + 4))) {
@@ -503,6 +481,28 @@ void ipath_ud_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr,
*/
wc.byte_len = tlen + sizeof(struct ib_grh);
+ /*
+ * The opcode is in the low byte when its in network order
+ * (top byte when in host order).
+ */
+ opcode = be32_to_cpu(ohdr->bth[0]) >> 24;
+ if (qp->ibqp.qp_num > 1 &&
+ opcode == IB_OPCODE_UD_SEND_ONLY_WITH_IMMEDIATE) {
+ if (header_in_data) {
+ wc.imm_data = *(__be32 *) data;
+ data += sizeof(__be32);
+ } else
+ wc.imm_data = ohdr->u.ud.imm_data;
+ wc.wc_flags = IB_WC_WITH_IMM;
+ hdrsize += sizeof(u32);
+ } else if (opcode == IB_OPCODE_UD_SEND_ONLY) {
+ wc.imm_data = 0;
+ wc.wc_flags = 0;
+ } else {
+ dev->n_pkt_drops++;
+ goto bail;
+ }
+
/*
* Get the next work request entry to find where to put the data.
*/
diff --git a/trunk/drivers/infiniband/hw/mlx4/cq.c b/trunk/drivers/infiniband/hw/mlx4/cq.c
index 9d32c49cc651..8bf44daf45ec 100644
--- a/trunk/drivers/infiniband/hw/mlx4/cq.c
+++ b/trunk/drivers/infiniband/hw/mlx4/cq.c
@@ -430,7 +430,7 @@ static int mlx4_ib_poll_one(struct mlx4_ib_cq *cq,
wc->dlid_path_bits = (be32_to_cpu(cqe->g_mlpath_rqpn) >> 24) & 0x7f;
wc->wc_flags |= be32_to_cpu(cqe->g_mlpath_rqpn) & 0x80000000 ?
IB_WC_GRH : 0;
- wc->pkey_index = be32_to_cpu(cqe->immed_rss_invalid) & 0x7f;
+ wc->pkey_index = be32_to_cpu(cqe->immed_rss_invalid) >> 16;
}
return 0;
diff --git a/trunk/drivers/infiniband/ulp/srp/ib_srp.c b/trunk/drivers/infiniband/ulp/srp/ib_srp.c
index bdb6f8517401..950228fb009f 100644
--- a/trunk/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/trunk/drivers/infiniband/ulp/srp/ib_srp.c
@@ -2053,7 +2053,6 @@ static void srp_remove_one(struct ib_device *device)
list_for_each_entry_safe(target, tmp_target,
&host->target_list, list) {
- srp_remove_host(target->scsi_host);
scsi_remove_host(target->scsi_host);
srp_disconnect_target(target);
ib_destroy_cm_id(target->cm_id);
diff --git a/trunk/drivers/input/gameport/gameport.c b/trunk/drivers/input/gameport/gameport.c
index 1dc2ac9f3d1c..bfc6061f1554 100644
--- a/trunk/drivers/input/gameport/gameport.c
+++ b/trunk/drivers/input/gameport/gameport.c
@@ -38,6 +38,8 @@ EXPORT_SYMBOL(gameport_unregister_driver);
EXPORT_SYMBOL(gameport_open);
EXPORT_SYMBOL(gameport_close);
EXPORT_SYMBOL(gameport_rescan);
+EXPORT_SYMBOL(gameport_cooked_read);
+EXPORT_SYMBOL(gameport_set_name);
EXPORT_SYMBOL(gameport_set_phys);
EXPORT_SYMBOL(gameport_start_polling);
EXPORT_SYMBOL(gameport_stop_polling);
diff --git a/trunk/drivers/input/input.c b/trunk/drivers/input/input.c
index a0be978501ff..307c7b5c2b33 100644
--- a/trunk/drivers/input/input.c
+++ b/trunk/drivers/input/input.c
@@ -235,10 +235,6 @@ static void input_handle_event(struct input_dev *dev,
if (value >= 0)
disposition = INPUT_PASS_TO_ALL;
break;
-
- case EV_PWR:
- disposition = INPUT_PASS_TO_ALL;
- break;
}
if (type != EV_SYN)
@@ -1270,10 +1266,6 @@ void input_set_capability(struct input_dev *dev, unsigned int type, unsigned int
__set_bit(code, dev->ffbit);
break;
- case EV_PWR:
- /* do nothing */
- break;
-
default:
printk(KERN_ERR
"input_set_capability: unknown type %u (code %u)\n",
diff --git a/trunk/drivers/input/keyboard/Kconfig b/trunk/drivers/input/keyboard/Kconfig
index 086d58c0ccbe..dfa6592c10f6 100644
--- a/trunk/drivers/input/keyboard/Kconfig
+++ b/trunk/drivers/input/keyboard/Kconfig
@@ -209,22 +209,22 @@ config KEYBOARD_HIL
to your machine, so normally you should say Y here.
config KEYBOARD_HP6XX
- tristate "HP Jornada 6xx keyboard"
+ tristate "HP Jornada 6XX Keyboard support"
depends on SH_HP6XX
select INPUT_POLLDEV
help
- Say Y here if you have a HP Jornada 620/660/680/690 and want to
- support the built-in keyboard.
+ This adds support for the onboard keyboard found on
+ HP Jornada 620/660/680/690.
To compile this driver as a module, choose M here: the
module will be called jornada680_kbd.
config KEYBOARD_HP7XX
- tristate "HP Jornada 7xx keyboard"
+ tristate "HP Jornada 7XX Keyboard Driver"
depends on SA1100_JORNADA720_SSP && SA1100_SSP
help
- Say Y here if you have a HP Jornada 710/720/728 and want to
- support the built-in keyboard.
+ Say Y here to add support for the HP Jornada 7xx (710/720/728)
+ onboard keyboard.
To compile this driver as a module, choose M here: the
module will be called jornada720_kbd.
diff --git a/trunk/drivers/input/keyboard/jornada680_kbd.c b/trunk/drivers/input/keyboard/jornada680_kbd.c
index a23633a2e1b4..bec1cf483723 100644
--- a/trunk/drivers/input/keyboard/jornada680_kbd.c
+++ b/trunk/drivers/input/keyboard/jornada680_kbd.c
@@ -16,14 +16,14 @@
* published by the Free Software Foundation.
*/
-#include
#include
-#include
-#include
-#include
#include
#include
+#include
+#include
+#include
#include
+#include
#include
#include
@@ -43,22 +43,22 @@
#define PLDR 0xa4000134
static const unsigned short jornada_scancodes[] = {
-/* PTD1 */ KEY_CAPSLOCK, KEY_MACRO, KEY_LEFTCTRL, 0, KEY_ESC, KEY_KP5, 0, 0, /* 1 -> 8 */
- KEY_F1, KEY_F2, KEY_F3, KEY_F8, KEY_F7, KEY_F6, KEY_F4, KEY_F5, /* 9 -> 16 */
-/* PTD5 */ KEY_SLASH, KEY_APOSTROPHE, KEY_ENTER, 0, KEY_Z, 0, 0, 0, /* 17 -> 24 */
- KEY_X, KEY_C, KEY_V, KEY_DOT, KEY_COMMA, KEY_M, KEY_B, KEY_N, /* 25 -> 32 */
-/* PTD7 */ KEY_KP2, KEY_KP6, KEY_KP3, 0, 0, 0, 0, 0, /* 33 -> 40 */
- KEY_F10, KEY_RO, KEY_F9, KEY_KP4, KEY_NUMLOCK, KEY_SCROLLLOCK, KEY_LEFTALT, KEY_HANJA, /* 41 -> 48 */
-/* PTE0 */ KEY_KATAKANA, KEY_KP0, KEY_GRAVE, 0, KEY_FINANCE, 0, 0, 0, /* 49 -> 56 */
- KEY_KPMINUS, KEY_HIRAGANA, KEY_SPACE, KEY_KPDOT, KEY_VOLUMEUP, 249, 0, 0, /* 57 -> 64 */
-/* PTE1 */ KEY_SEMICOLON, KEY_RIGHTBRACE, KEY_BACKSLASH, 0, KEY_A, 0, 0, 0, /* 65 -> 72 */
- KEY_S, KEY_D, KEY_F, KEY_L, KEY_K, KEY_J, KEY_G, KEY_H, /* 73 -> 80 */
-/* PTE3 */ KEY_KP8, KEY_LEFTMETA, KEY_RIGHTSHIFT, 0, KEY_TAB, 0, 0, 0, /* 81 -> 88 */
- 0, KEY_LEFTSHIFT, KEY_KP7, KEY_KP9, KEY_KP1, KEY_F11, KEY_KPPLUS, KEY_KPASTERISK, /* 89 -> 96 */
-/* PTE6 */ KEY_P, KEY_LEFTBRACE, KEY_BACKSPACE, 0, KEY_Q, 0, 0, 0, /* 97 -> 104 */
- KEY_W, KEY_E, KEY_R, KEY_O, KEY_I, KEY_U, KEY_T, KEY_Y, /* 105 -> 112 */
-/* PTE7 */ KEY_0, KEY_MINUS, KEY_EQUAL, 0, KEY_1, 0, 0, 0, /* 113 -> 120 */
- KEY_2, KEY_3, KEY_4, KEY_9, KEY_8, KEY_7, KEY_5, KEY_6, /* 121 -> 128 */
+/* PTD1 */ KEY_CAPSLOCK, KEY_MACRO, KEY_LEFTCTRL, 0, KEY_ESC, 0, 0, 0, /* 1 -> 8 */
+ KEY_F1, KEY_F2, KEY_F3, KEY_F8, KEY_F7, KEY_F2, KEY_F4, KEY_F5, /* 9 -> 16 */
+/* PTD5 */ KEY_SLASH, KEY_APOSTROPHE, KEY_ENTER, 0, KEY_Z, 0, 0, 0, /* 17 -> 24 */
+ KEY_X, KEY_C, KEY_V, KEY_DOT, KEY_COMMA, KEY_M, KEY_B, KEY_N, /* 25 -> 32 */
+/* PTD7 */ KEY_KP2, KEY_KP6, 0, 0, 0, 0, 0, 0, /* 33 -> 40 */
+ 0, 0, 0, KEY_KP4, 0, 0, KEY_LEFTALT, KEY_HANJA, /* 41 -> 48 */
+/* PTE0 */ 0, 0, 0, 0, KEY_FINANCE, 0, 0, 0, /* 49 -> 56 */
+ KEY_LEFTCTRL, 0, KEY_SPACE, KEY_KPDOT, KEY_VOLUMEUP, 249, 0, 0, /* 57 -> 64 */
+/* PTE1 */ KEY_SEMICOLON, KEY_RIGHTBRACE, KEY_BACKSLASH, 0, KEY_A, 0, 0, 0,/* 65 -> 72 */
+ KEY_S, KEY_D, KEY_F, KEY_L, KEY_K, KEY_J, KEY_G, KEY_H, /* 73 -> 80 */
+/* PTE3 */ KEY_KP8, KEY_LEFTMETA, KEY_RIGHTSHIFT, 0, KEY_TAB, 0, 0,0, /* 81 -> 88 */
+ 0, KEY_LEFTSHIFT, 0, 0, 0, 0, 0, 0, /* 89 -> 96 */
+/* PTE6 */ KEY_P, KEY_LEFTBRACE, KEY_BACKSPACE, 0, KEY_Q, 0, 0, 0, /* 97 -> 104 */
+ KEY_W, KEY_E, KEY_R, KEY_O, KEY_I, KEY_U, KEY_T, KEY_R, /* 105 -> 112 */
+/* PTE7 */ KEY_0, KEY_MINUS, KEY_EQUAL, 0, KEY_1, 0, 0, 0, /* 113 -> 120 */
+ KEY_2, KEY_3, KEY_4, KEY_9, KEY_8, KEY_7, KEY_5, KEY_6, /* 121 -> 128 */
/* **** */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0
};
diff --git a/trunk/drivers/input/keyboard/spitzkbd.c b/trunk/drivers/input/keyboard/spitzkbd.c
index 1d59a2dc3c17..410d78a774d0 100644
--- a/trunk/drivers/input/keyboard/spitzkbd.c
+++ b/trunk/drivers/input/keyboard/spitzkbd.c
@@ -391,7 +391,6 @@ static int __init spitzkbd_probe(struct platform_device *dev)
for (i = 0; i < ARRAY_SIZE(spitzkbd_keycode); i++)
set_bit(spitzkbd->keycode[i], input_dev->keybit);
clear_bit(0, input_dev->keybit);
- set_bit(KEY_SUSPEND, input_dev->keybit);
set_bit(SW_LID, input_dev->swbit);
set_bit(SW_TABLET_MODE, input_dev->swbit);
set_bit(SW_HEADPHONE_INSERT, input_dev->swbit);
diff --git a/trunk/drivers/input/mouse/alps.c b/trunk/drivers/input/mouse/alps.c
index b346a3b418ea..2b5ed119c9a9 100644
--- a/trunk/drivers/input/mouse/alps.c
+++ b/trunk/drivers/input/mouse/alps.c
@@ -54,7 +54,7 @@ static const struct alps_model_info alps_model_data[] = {
{ { 0x20, 0x02, 0x0e }, 0xf8, 0xf8, ALPS_PASS | ALPS_DUALPOINT }, /* XXX */
{ { 0x22, 0x02, 0x0a }, 0xf8, 0xf8, ALPS_PASS | ALPS_DUALPOINT },
{ { 0x22, 0x02, 0x14 }, 0xff, 0xff, ALPS_PASS | ALPS_DUALPOINT }, /* Dell Latitude D600 */
- { { 0x73, 0x02, 0x50 }, 0xcf, 0xcf, ALPS_FW_BK_1 } /* Dell Vostro 1400 */
+ { { 0x73, 0x02, 0x50 }, 0xcf, 0xff, ALPS_FW_BK_1 } /* Dell Vostro 1400 */
};
/*
diff --git a/trunk/drivers/input/mouse/lifebook.c b/trunk/drivers/input/mouse/lifebook.c
index df81b0aaa9f8..9ec57d80186e 100644
--- a/trunk/drivers/input/mouse/lifebook.c
+++ b/trunk/drivers/input/mouse/lifebook.c
@@ -225,13 +225,8 @@ static void lifebook_set_resolution(struct psmouse *psmouse, unsigned int resolu
static void lifebook_disconnect(struct psmouse *psmouse)
{
- struct lifebook_data *priv = psmouse->private;
-
psmouse_reset(psmouse);
- if (priv) {
- input_unregister_device(priv->dev2);
- kfree(priv);
- }
+ kfree(psmouse->private);
psmouse->private = NULL;
}
diff --git a/trunk/drivers/input/mouse/psmouse-base.c b/trunk/drivers/input/mouse/psmouse-base.c
index b8628252e10c..21a9c0b69a1f 100644
--- a/trunk/drivers/input/mouse/psmouse-base.c
+++ b/trunk/drivers/input/mouse/psmouse-base.c
@@ -1247,8 +1247,6 @@ static int psmouse_connect(struct serio *serio, struct serio_driver *drv)
err_pt_deactivate:
if (parent && parent->pt_deactivate)
parent->pt_deactivate(parent);
- input_unregister_device(psmouse->dev);
- input_dev = NULL; /* so we don't try to free it below */
err_protocol_disconnect:
if (psmouse->disconnect)
psmouse->disconnect(psmouse);
diff --git a/trunk/drivers/input/mousedev.c b/trunk/drivers/input/mousedev.c
index be83516c776c..78c3ea75da2a 100644
--- a/trunk/drivers/input/mousedev.c
+++ b/trunk/drivers/input/mousedev.c
@@ -1029,15 +1029,6 @@ static const struct input_device_id mousedev_ids[] = {
BIT_MASK(ABS_PRESSURE) |
BIT_MASK(ABS_TOOL_WIDTH) },
}, /* A touchpad */
- {
- .flags = INPUT_DEVICE_ID_MATCH_EVBIT |
- INPUT_DEVICE_ID_MATCH_KEYBIT |
- INPUT_DEVICE_ID_MATCH_ABSBIT,
- .evbit = { BIT(EV_KEY) | BIT(EV_ABS) | BIT(EV_SYN) },
- .keybit = { [BIT_WORD(BTN_LEFT)] = BIT_MASK(BTN_LEFT) },
- .absbit = { BIT_MASK(ABS_X) | BIT_MASK(ABS_Y) },
- }, /* Mouse-like device with absolute X and Y but ordinary
- clicks, like hp ILO2 High Performance mouse */
{ }, /* Terminating entry */
};
diff --git a/trunk/drivers/input/touchscreen/Kconfig b/trunk/drivers/input/touchscreen/Kconfig
index 90e8e92dfe47..fa8442b6241c 100644
--- a/trunk/drivers/input/touchscreen/Kconfig
+++ b/trunk/drivers/input/touchscreen/Kconfig
@@ -115,17 +115,19 @@ config TOUCHSCREEN_MK712
module will be called mk712.
config TOUCHSCREEN_HP600
- tristate "HP Jornada 6xx touchscreen"
+ tristate "HP Jornada 680/690 touchscreen"
depends on SH_HP6XX && SH_ADC
help
- Say Y here if you have a HP Jornada 620/660/680/690 and want to
+ Say Y here if you have a HP Jornada 680 or 690 and want to
support the built-in touchscreen.
+ If unsure, say N.
+
To compile this driver as a module, choose M here: the
module will be called hp680_ts_input.
config TOUCHSCREEN_HP7XX
- tristate "HP Jornada 7xx touchscreen"
+ tristate "HP Jornada 710/720/728 touchscreen"
depends on SA1100_JORNADA720_SSP
help
Say Y here if you have a HP Jornada 710/720/728 and want
diff --git a/trunk/drivers/input/touchscreen/usbtouchscreen.c b/trunk/drivers/input/touchscreen/usbtouchscreen.c
index 63f9664a066f..19055e7381f8 100644
--- a/trunk/drivers/input/touchscreen/usbtouchscreen.c
+++ b/trunk/drivers/input/touchscreen/usbtouchscreen.c
@@ -11,7 +11,6 @@
* - DMC TSC-10/25
* - IRTOUCHSYSTEMS/UNITOP
* - IdealTEK URTC1000
- * - General Touch
* - GoTop Super_Q2/GogoPen/PenPower tablets
*
* Copyright (C) 2004-2007 by Daniel Ritz
@@ -51,7 +50,7 @@
#include
-#define DRIVER_VERSION "v0.6"
+#define DRIVER_VERSION "v0.5"
#define DRIVER_AUTHOR "Daniel Ritz "
#define DRIVER_DESC "USB Touchscreen Driver"
@@ -66,21 +65,17 @@ struct usbtouch_device_info {
int min_yc, max_yc;
int min_press, max_press;
int rept_size;
+ int flags;
void (*process_pkt) (struct usbtouch_usb *usbtouch, unsigned char *pkt, int len);
-
- /*
- * used to get the packet len. possible return values:
- * > 0: packet len
- * = 0: skip one byte
- * < 0: -return value more bytes needed
- */
int (*get_pkt_len) (unsigned char *pkt, int len);
-
int (*read_data) (struct usbtouch_usb *usbtouch, unsigned char *pkt);
int (*init) (struct usbtouch_usb *usbtouch);
};
+#define USBTOUCH_FLG_BUFFER 0x01
+
+
/* a usbtouch device */
struct usbtouch_usb {
unsigned char *data;
@@ -99,6 +94,15 @@ struct usbtouch_usb {
};
+#if defined(CONFIG_TOUCHSCREEN_USB_EGALAX) || defined(CONFIG_TOUCHSCREEN_USB_ETURBO) || defined(CONFIG_TOUCHSCREEN_USB_IDEALTEK)
+#define MULTI_PACKET
+#endif
+
+#ifdef MULTI_PACKET
+static void usbtouch_process_multi(struct usbtouch_usb *usbtouch,
+ unsigned char *pkt, int len);
+#endif
+
/* device types */
enum {
DEVTPYE_DUMMY = -1,
@@ -182,10 +186,6 @@ static struct usb_device_id usbtouch_devices[] = {
#ifdef CONFIG_TOUCHSCREEN_USB_EGALAX
-#ifndef MULTI_PACKET
-#define MULTI_PACKET
-#endif
-
#define EGALAX_PKT_TYPE_MASK 0xFE
#define EGALAX_PKT_TYPE_REPT 0x80
#define EGALAX_PKT_TYPE_DIAG 0x0A
@@ -323,9 +323,6 @@ static int itm_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
* eTurboTouch part
*/
#ifdef CONFIG_TOUCHSCREEN_USB_ETURBO
-#ifndef MULTI_PACKET
-#define MULTI_PACKET
-#endif
static int eturbo_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
{
unsigned int shift;
@@ -464,9 +461,6 @@ static int irtouch_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
* IdealTEK URTC1000 Part
*/
#ifdef CONFIG_TOUCHSCREEN_USB_IDEALTEK
-#ifndef MULTI_PACKET
-#define MULTI_PACKET
-#endif
static int idealtek_get_pkt_len(unsigned char *buf, int len)
{
if (buf[0] & 0x80)
@@ -531,11 +525,6 @@ static int gotop_read_data(struct usbtouch_usb *dev, unsigned char *pkt)
/*****************************************************************************
* the different device descriptors
*/
-#ifdef MULTI_PACKET
-static void usbtouch_process_multi(struct usbtouch_usb *usbtouch,
- unsigned char *pkt, int len);
-#endif
-
static struct usbtouch_device_info usbtouch_dev_info[] = {
#ifdef CONFIG_TOUCHSCREEN_USB_EGALAX
[DEVTYPE_EGALAX] = {
@@ -544,6 +533,7 @@ static struct usbtouch_device_info usbtouch_dev_info[] = {
.min_yc = 0x0,
.max_yc = 0x07ff,
.rept_size = 16,
+ .flags = USBTOUCH_FLG_BUFFER,
.process_pkt = usbtouch_process_multi,
.get_pkt_len = egalax_get_pkt_len,
.read_data = egalax_read_data,
@@ -592,6 +582,7 @@ static struct usbtouch_device_info usbtouch_dev_info[] = {
.min_yc = 0x0,
.max_yc = 0x07ff,
.rept_size = 8,
+ .flags = USBTOUCH_FLG_BUFFER,
.process_pkt = usbtouch_process_multi,
.get_pkt_len = eturbo_get_pkt_len,
.read_data = eturbo_read_data,
@@ -639,6 +630,7 @@ static struct usbtouch_device_info usbtouch_dev_info[] = {
.min_yc = 0x0,
.max_yc = 0x0fff,
.rept_size = 8,
+ .flags = USBTOUCH_FLG_BUFFER,
.process_pkt = usbtouch_process_multi,
.get_pkt_len = idealtek_get_pkt_len,
.read_data = idealtek_read_data,
@@ -746,14 +738,11 @@ static void usbtouch_process_multi(struct usbtouch_usb *usbtouch,
pos = 0;
while (pos < buf_len) {
/* get packet len */
- pkt_len = usbtouch->type->get_pkt_len(buffer + pos,
- buf_len - pos);
+ pkt_len = usbtouch->type->get_pkt_len(buffer + pos, len);
- /* unknown packet: skip one byte */
- if (unlikely(!pkt_len)) {
- pos++;
- continue;
- }
+ /* unknown packet: drop everything */
+ if (unlikely(!pkt_len))
+ goto out_flush_buf;
/* full packet: process */
if (likely((pkt_len > 0) && (pkt_len <= buf_len - pos))) {
@@ -868,7 +857,7 @@ static int usbtouch_probe(struct usb_interface *intf,
if (!usbtouch->data)
goto out_free;
- if (type->get_pkt_len) {
+ if (type->flags & USBTOUCH_FLG_BUFFER) {
usbtouch->buffer = kmalloc(type->rept_size, GFP_KERNEL);
if (!usbtouch->buffer)
goto out_free_buffers;
diff --git a/trunk/drivers/isdn/i4l/isdn_common.c b/trunk/drivers/isdn/i4l/isdn_common.c
index 9cef6fcf587b..d6952959d72a 100644
--- a/trunk/drivers/isdn/i4l/isdn_common.c
+++ b/trunk/drivers/isdn/i4l/isdn_common.c
@@ -914,9 +914,6 @@ isdn_readbchan_tty(int di, int channel, struct tty_struct *tty, int cisco_hack)
dflag = 0;
count_pull = count_put = 0;
while ((count_pull < skb->len) && (len > 0)) {
- /* push every character but the last to the tty buffer directly */
- if ( count_put )
- tty_insert_flip_char(tty, last, TTY_NORMAL);
len--;
if (dev->drv[di]->DLEflag & DLEmask) {
last = DLE;
diff --git a/trunk/drivers/isdn/i4l/isdn_tty.c b/trunk/drivers/isdn/i4l/isdn_tty.c
index 9cb6e5021adb..4e5f87c1e714 100644
--- a/trunk/drivers/isdn/i4l/isdn_tty.c
+++ b/trunk/drivers/isdn/i4l/isdn_tty.c
@@ -85,8 +85,6 @@ isdn_tty_try_read(modem_info * info, struct sk_buff *skb)
tty_insert_flip_char(tty, DLE, 0);
tty_insert_flip_char(tty, *dp++, 0);
}
- if (*dp == DLE)
- tty_insert_flip_char(tty, DLE, 0);
last = *dp;
} else {
#endif
@@ -2647,12 +2645,7 @@ isdn_tty_modem_result(int code, modem_info * info)
if ((info->flags & ISDN_ASYNC_CLOSING) || (!info->tty)) {
return;
}
-#ifdef CONFIG_ISDN_AUDIO
- if ( !info->vonline )
- tty_ldisc_flush(info->tty);
-#else
tty_ldisc_flush(info->tty);
-#endif
if ((info->flags & ISDN_ASYNC_CHECK_CD) &&
(!((info->flags & ISDN_ASYNC_CALLOUT_ACTIVE) &&
(info->flags & ISDN_ASYNC_CALLOUT_NOHUP)))) {
diff --git a/trunk/drivers/leds/led-class.c b/trunk/drivers/leds/led-class.c
index 64c66b3769c9..ba8b04b03b9f 100644
--- a/trunk/drivers/leds/led-class.c
+++ b/trunk/drivers/leds/led-class.c
@@ -106,9 +106,9 @@ int led_classdev_register(struct device *parent, struct led_classdev *led_cdev)
goto err_out;
/* add to the list of leds */
- down_write(&leds_list_lock);
+ write_lock(&leds_list_lock);
list_add_tail(&led_cdev->node, &leds_list);
- up_write(&leds_list_lock);
+ write_unlock(&leds_list_lock);
#ifdef CONFIG_LEDS_TRIGGERS
init_rwsem(&led_cdev->trigger_lock);
@@ -155,9 +155,9 @@ void led_classdev_unregister(struct led_classdev *led_cdev)
device_unregister(led_cdev->dev);
- down_write(&leds_list_lock);
+ write_lock(&leds_list_lock);
list_del(&led_cdev->node);
- up_write(&leds_list_lock);
+ write_unlock(&leds_list_lock);
}
EXPORT_SYMBOL_GPL(led_classdev_unregister);
diff --git a/trunk/drivers/leds/led-core.c b/trunk/drivers/leds/led-core.c
index 5d1ca10524b6..9b015f9af351 100644
--- a/trunk/drivers/leds/led-core.c
+++ b/trunk/drivers/leds/led-core.c
@@ -14,11 +14,11 @@
#include
#include
#include
-#include
+#include
#include
#include "leds.h"
-DECLARE_RWSEM(leds_list_lock);
+DEFINE_RWLOCK(leds_list_lock);
LIST_HEAD(leds_list);
EXPORT_SYMBOL_GPL(leds_list);
diff --git a/trunk/drivers/leds/led-triggers.c b/trunk/drivers/leds/led-triggers.c
index 13c9026d68af..0bdb786210b1 100644
--- a/trunk/drivers/leds/led-triggers.c
+++ b/trunk/drivers/leds/led-triggers.c
@@ -169,7 +169,7 @@ int led_trigger_register(struct led_trigger *trigger)
up_write(&triggers_list_lock);
/* Register with any LEDs that have this as a default trigger */
- down_read(&leds_list_lock);
+ read_lock(&leds_list_lock);
list_for_each_entry(led_cdev, &leds_list, node) {
down_write(&led_cdev->trigger_lock);
if (!led_cdev->trigger && led_cdev->default_trigger &&
@@ -177,7 +177,7 @@ int led_trigger_register(struct led_trigger *trigger)
led_trigger_set(led_cdev, trigger);
up_write(&led_cdev->trigger_lock);
}
- up_read(&leds_list_lock);
+ read_unlock(&leds_list_lock);
return 0;
}
@@ -212,14 +212,14 @@ void led_trigger_unregister(struct led_trigger *trigger)
up_write(&triggers_list_lock);
/* Remove anyone actively using this trigger */
- down_read(&leds_list_lock);
+ read_lock(&leds_list_lock);
list_for_each_entry(led_cdev, &leds_list, node) {
down_write(&led_cdev->trigger_lock);
if (led_cdev->trigger == trigger)
led_trigger_set(led_cdev, NULL);
up_write(&led_cdev->trigger_lock);
}
- up_read(&leds_list_lock);
+ read_unlock(&leds_list_lock);
}
void led_trigger_unregister_simple(struct led_trigger *trigger)
diff --git a/trunk/drivers/leds/leds-locomo.c b/trunk/drivers/leds/leds-locomo.c
index 2207335e9212..bfac499f3258 100644
--- a/trunk/drivers/leds/leds-locomo.c
+++ b/trunk/drivers/leds/leds-locomo.c
@@ -19,7 +19,7 @@
static void locomoled_brightness_set(struct led_classdev *led_cdev,
enum led_brightness value, int offset)
{
- struct locomo_dev *locomo_dev = LOCOMO_DEV(led_cdev->dev->parent);
+ struct locomo_dev *locomo_dev = LOCOMO_DEV(led_cdev->dev);
unsigned long flags;
local_irq_save(flags);
diff --git a/trunk/drivers/leds/leds.h b/trunk/drivers/leds/leds.h
index 12b6fe93b135..f2f3884fe063 100644
--- a/trunk/drivers/leds/leds.h
+++ b/trunk/drivers/leds/leds.h
@@ -14,7 +14,6 @@
#define __LEDS_H_INCLUDED
#include
-#include
#include
static inline void led_set_brightness(struct led_classdev *led_cdev,
@@ -27,7 +26,7 @@ static inline void led_set_brightness(struct led_classdev *led_cdev,
led_cdev->brightness_set(led_cdev, value);
}
-extern struct rw_semaphore leds_list_lock;
+extern rwlock_t leds_list_lock;
extern struct list_head leds_list;
#ifdef CONFIG_LEDS_TRIGGERS
diff --git a/trunk/drivers/lguest/Kconfig b/trunk/drivers/lguest/Kconfig
index 6b8dbb9ba73b..7eb9ecff8f4a 100644
--- a/trunk/drivers/lguest/Kconfig
+++ b/trunk/drivers/lguest/Kconfig
@@ -10,3 +10,10 @@ config LGUEST
not "rustyvisor". See Documentation/lguest/lguest.txt.
If unsure, say N. If curious, say M. If masochistic, say Y.
+
+config LGUEST_GUEST
+ bool
+ help
+ The guest needs code built-in, even if the host has lguest
+ support as a module. The drivers are tiny, so we build them
+ in too.
diff --git a/trunk/drivers/macintosh/adbhid.c b/trunk/drivers/macintosh/adbhid.c
index ef4c117ea35f..883da72b5368 100644
--- a/trunk/drivers/macintosh/adbhid.c
+++ b/trunk/drivers/macintosh/adbhid.c
@@ -322,9 +322,8 @@ adbhid_input_keycode(int id, int scancode, int repeat)
input_sync(ahid->input);
input_report_key(ahid->input, KEY_CAPSLOCK, 0);
input_sync(ahid->input);
- return;
}
- break;
+ return;
#ifdef CONFIG_PPC_PMAC
case ADB_KEY_POWER_OLD: /* Power key on PBook 3400 needs remapping */
switch(pmac_call_feature(PMAC_FTR_GET_MB_INFO,
diff --git a/trunk/drivers/md/raid5.c b/trunk/drivers/md/raid5.c
index e8c8157b02fc..a5aad8cad843 100644
--- a/trunk/drivers/md/raid5.c
+++ b/trunk/drivers/md/raid5.c
@@ -2865,8 +2865,7 @@ static void handle_stripe5(struct stripe_head *sh)
md_done_sync(conf->mddev, STRIPE_SECTORS, 1);
}
- if (s.expanding && s.locked == 0 &&
- !test_bit(STRIPE_OP_COMPUTE_BLK, &sh->ops.pending))
+ if (s.expanding && s.locked == 0)
handle_stripe_expansion(conf, sh, NULL);
if (sh->ops.count)
@@ -3068,8 +3067,7 @@ static void handle_stripe6(struct stripe_head *sh, struct page *tmp_page)
md_done_sync(conf->mddev, STRIPE_SECTORS, 1);
}
- if (s.expanding && s.locked == 0 &&
- !test_bit(STRIPE_OP_COMPUTE_BLK, &sh->ops.pending))
+ if (s.expanding && s.locked == 0)
handle_stripe_expansion(conf, sh, &r6s);
spin_unlock(&sh->lock);
diff --git a/trunk/drivers/media/dvb/ttpci/av7110.c b/trunk/drivers/media/dvb/ttpci/av7110.c
index 0d36c155695b..8b8144f77a73 100644
--- a/trunk/drivers/media/dvb/ttpci/av7110.c
+++ b/trunk/drivers/media/dvb/ttpci/av7110.c
@@ -2800,12 +2800,12 @@ static void av7110_irq(struct saa7146_dev* dev, u32 *isr)
}
-static struct saa7146_extension av7110_extension_driver;
+static struct saa7146_extension av7110_extension;
#define MAKE_AV7110_INFO(x_var,x_name) \
static struct saa7146_pci_extension_data x_var = { \
.ext_priv = x_name, \
- .ext = &av7110_extension_driver }
+ .ext = &av7110_extension }
MAKE_AV7110_INFO(tts_1_X_fsc,"Technotrend/Hauppauge WinTV DVB-S rev1.X or Fujitsu Siemens DVB-C");
MAKE_AV7110_INFO(ttt_1_X, "Technotrend/Hauppauge WinTV DVB-T rev1.X");
@@ -2843,7 +2843,7 @@ static struct pci_device_id pci_tbl[] = {
MODULE_DEVICE_TABLE(pci, pci_tbl);
-static struct saa7146_extension av7110_extension_driver = {
+static struct saa7146_extension av7110_extension = {
.name = "dvb",
.flags = SAA7146_USE_I2C_IRQ,
@@ -2860,14 +2860,14 @@ static struct saa7146_extension av7110_extension_driver = {
static int __init av7110_init(void)
{
int retval;
- retval = saa7146_register_extension(&av7110_extension_driver);
+ retval = saa7146_register_extension(&av7110_extension);
return retval;
}
static void __exit av7110_exit(void)
{
- saa7146_unregister_extension(&av7110_extension_driver);
+ saa7146_unregister_extension(&av7110_extension);
}
module_init(av7110_init);
diff --git a/trunk/drivers/media/video/bt8xx/bttv-driver.c b/trunk/drivers/media/video/bt8xx/bttv-driver.c
index 581a3c955739..c02d92deacd2 100644
--- a/trunk/drivers/media/video/bt8xx/bttv-driver.c
+++ b/trunk/drivers/media/video/bt8xx/bttv-driver.c
@@ -3063,10 +3063,11 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
struct video_mbuf *mbuf = arg;
unsigned int i;
+ mutex_lock(&fh->cap.lock);
retval = videobuf_mmap_setup(&fh->cap,gbuffers,gbufsize,
V4L2_MEMORY_MMAP);
if (retval < 0)
- return retval;
+ goto fh_unlock_and_return;
gbuffers = retval;
memset(mbuf,0,sizeof(*mbuf));
@@ -3074,6 +3075,7 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
mbuf->size = gbuffers * gbufsize;
for (i = 0; i < gbuffers; i++)
mbuf->offsets[i] = i * gbufsize;
+ mutex_unlock(&fh->cap.lock);
return 0;
}
case VIDIOCMCAPTURE:
diff --git a/trunk/drivers/media/video/cx23885/Kconfig b/trunk/drivers/media/video/cx23885/Kconfig
index 081ee6e1536f..d8b1ccb44913 100644
--- a/trunk/drivers/media/video/cx23885/Kconfig
+++ b/trunk/drivers/media/video/cx23885/Kconfig
@@ -10,7 +10,6 @@ config VIDEO_CX23885
select VIDEOBUF_DVB
select DVB_TUNER_MT2131 if !DVB_FE_CUSTOMISE
select DVB_S5H1409 if !DVB_FE_CUSTOMISE
- select DVB_LGDT330X if !DVB_FE_CUSTOMISE
select DVB_PLL if !DVB_FE_CUSTOMISE
---help---
This is a video4linux driver for Conexant 23885 based
diff --git a/trunk/drivers/media/video/ivtv/ivtv-i2c.c b/trunk/drivers/media/video/ivtv/ivtv-i2c.c
index 36e54f78aa2a..77b27dc750b1 100644
--- a/trunk/drivers/media/video/ivtv/ivtv-i2c.c
+++ b/trunk/drivers/media/video/ivtv/ivtv-i2c.c
@@ -541,7 +541,7 @@ static const struct i2c_algo_bit_data ivtv_i2c_algo_template = {
.setscl = ivtv_setscl_old,
.getsda = ivtv_getsda_old,
.getscl = ivtv_getscl_old,
- .udelay = 10,
+ .udelay = 5,
.timeout = 200,
};
diff --git a/trunk/drivers/media/video/saa7134/saa7134-core.c b/trunk/drivers/media/video/saa7134/saa7134-core.c
index 4f0a9157ecb1..4fd187ac9d70 100644
--- a/trunk/drivers/media/video/saa7134/saa7134-core.c
+++ b/trunk/drivers/media/video/saa7134/saa7134-core.c
@@ -1202,8 +1202,9 @@ static int saa7134_suspend(struct pci_dev *pci_dev , pm_message_t state)
static int saa7134_resume(struct pci_dev *pci_dev)
{
+
struct saa7134_dev *dev = pci_get_drvdata(pci_dev);
- unsigned long flags;
+ unsigned int flags;
pci_restore_state(pci_dev);
pci_set_power_state(pci_dev, PCI_D0);
diff --git a/trunk/drivers/mtd/chips/cfi_cmdset_0001.c b/trunk/drivers/mtd/chips/cfi_cmdset_0001.c
index 1707f98c322c..a9eb1c516247 100644
--- a/trunk/drivers/mtd/chips/cfi_cmdset_0001.c
+++ b/trunk/drivers/mtd/chips/cfi_cmdset_0001.c
@@ -1504,12 +1504,9 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,
int ret, wbufsize, word_gap, words;
const struct kvec *vec;
unsigned long vec_seek;
- unsigned long initial_adr;
- int initial_len = len;
wbufsize = cfi_interleave(cfi) << cfi->cfiq->MaxBufWriteSize;
adr += chip->start;
- initial_adr = adr;
cmd_adr = adr & ~(wbufsize-1);
/* Let's determine this according to the interleave only once */
@@ -1522,7 +1519,7 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,
return ret;
}
- XIP_INVAL_CACHED_RANGE(map, initial_adr, initial_len);
+ XIP_INVAL_CACHED_RANGE(map, adr, len);
ENABLE_VPP(map);
xip_disable(map, chip, cmd_adr);
@@ -1613,7 +1610,7 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,
chip->state = FL_WRITING;
ret = INVAL_CACHE_AND_WAIT(map, chip, cmd_adr,
- initial_adr, initial_len,
+ adr, len,
chip->buffer_write_time);
if (ret) {
map_write(map, CMD(0x70), cmd_adr);
diff --git a/trunk/drivers/net/3c509.c b/trunk/drivers/net/3c509.c
index 8fafac987e0b..edda6e10ebe5 100644
--- a/trunk/drivers/net/3c509.c
+++ b/trunk/drivers/net/3c509.c
@@ -385,7 +385,6 @@ static int __init el3_probe(int card_idx)
#if defined(__ISAPNP__)
static int pnp_cards;
struct pnp_dev *idev = NULL;
- int pnp_found = 0;
if (nopnp == 1)
goto no_pnp;
@@ -431,7 +430,6 @@ static int __init el3_probe(int card_idx)
pnp_cards++;
netdev_boot_setup_check(dev);
- pnp_found = 1;
goto found;
}
}
@@ -562,8 +560,6 @@ static int __init el3_probe(int card_idx)
lp = netdev_priv(dev);
#if defined(__ISAPNP__)
lp->dev = &idev->dev;
- if (pnp_found)
- lp->type = EL3_PNP;
#endif
err = el3_common_init(dev);
diff --git a/trunk/drivers/net/3c515.c b/trunk/drivers/net/3c515.c
index 684bab781015..275e7510ebaf 100644
--- a/trunk/drivers/net/3c515.c
+++ b/trunk/drivers/net/3c515.c
@@ -243,16 +243,14 @@ enum eeprom_offset {
enum Window3 { /* Window 3: MAC/config bits. */
Wn3_Config = 0, Wn3_MAC_Ctrl = 6, Wn3_Options = 8,
};
-enum wn3_config {
- Ram_size = 7,
- Ram_width = 8,
- Ram_speed = 0x30,
- Rom_size = 0xc0,
- Ram_split_shift = 16,
- Ram_split = 3 << Ram_split_shift,
- Xcvr_shift = 20,
- Xcvr = 7 << Xcvr_shift,
- Autoselect = 0x1000000,
+union wn3_config {
+ int i;
+ struct w3_config_fields {
+ unsigned int ram_size:3, ram_width:1, ram_speed:2, rom_size:2;
+ int pad8:8;
+ unsigned int ram_split:2, pad18:2, xcvr:3, pad21:1, autoselect:1;
+ int pad24:7;
+ } u;
};
enum Window4 {
@@ -616,7 +614,7 @@ static int corkscrew_setup(struct net_device *dev, int ioaddr,
/* Read the station address from the EEPROM. */
EL3WINDOW(0);
for (i = 0; i < 0x18; i++) {
- __be16 *phys_addr = (__be16 *) dev->dev_addr;
+ short *phys_addr = (short *) dev->dev_addr;
int timer;
outw(EEPROM_Read + i, ioaddr + Wn0EepromCmd);
/* Pause for at least 162 us. for the read to take place. */
@@ -648,22 +646,22 @@ static int corkscrew_setup(struct net_device *dev, int ioaddr,
{
char *ram_split[] = { "5:3", "3:1", "1:1", "3:5" };
- __u32 config;
+ union wn3_config config;
EL3WINDOW(3);
vp->available_media = inw(ioaddr + Wn3_Options);
- config = inl(ioaddr + Wn3_Config);
+ config.i = inl(ioaddr + Wn3_Config);
if (corkscrew_debug > 1)
printk(KERN_INFO " Internal config register is %4.4x, transceivers %#x.\n",
- config, inw(ioaddr + Wn3_Options));
+ config.i, inw(ioaddr + Wn3_Options));
printk(KERN_INFO " %dK %s-wide RAM %s Rx:Tx split, %s%s interface.\n",
- 8 << config & Ram_size,
- config & Ram_width ? "word" : "byte",
- ram_split[(config & Ram_split) >> Ram_split_shift],
- config & Autoselect ? "autoselect/" : "",
- media_tbl[(config & Xcvr) >> Xcvr_shift].name);
- vp->default_media = (config & Xcvr) >> Xcvr_shift;
- vp->autoselect = config & Autoselect ? 1 : 0;
- dev->if_port = vp->default_media;
+ 8 << config.u.ram_size,
+ config.u.ram_width ? "word" : "byte",
+ ram_split[config.u.ram_split],
+ config.u.autoselect ? "autoselect/" : "",
+ media_tbl[config.u.xcvr].name);
+ dev->if_port = config.u.xcvr;
+ vp->default_media = config.u.xcvr;
+ vp->autoselect = config.u.autoselect;
}
if (vp->media_override != 7) {
printk(KERN_INFO " Media override to transceiver type %d (%s).\n",
@@ -696,14 +694,14 @@ static int corkscrew_open(struct net_device *dev)
{
int ioaddr = dev->base_addr;
struct corkscrew_private *vp = netdev_priv(dev);
- __u32 config;
+ union wn3_config config;
int i;
/* Before initializing select the active media port. */
EL3WINDOW(3);
if (vp->full_duplex)
outb(0x20, ioaddr + Wn3_MAC_Ctrl); /* Set the full-duplex bit. */
- config = inl(ioaddr + Wn3_Config);
+ config.i = inl(ioaddr + Wn3_Config);
if (vp->media_override != 7) {
if (corkscrew_debug > 1)
@@ -729,12 +727,12 @@ static int corkscrew_open(struct net_device *dev)
} else
dev->if_port = vp->default_media;
- config = (config & ~Xcvr) | (dev->if_port << Xcvr_shift);
- outl(config, ioaddr + Wn3_Config);
+ config.u.xcvr = dev->if_port;
+ outl(config.i, ioaddr + Wn3_Config);
if (corkscrew_debug > 1) {
printk("%s: corkscrew_open() InternalConfig %8.8x.\n",
- dev->name, config);
+ dev->name, config.i);
}
outw(TxReset, ioaddr + EL3_CMD);
@@ -903,7 +901,7 @@ static void corkscrew_timer(unsigned long data)
ok = 1;
}
if (!ok) {
- __u32 config;
+ union wn3_config config;
do {
dev->if_port =
@@ -930,9 +928,9 @@ static void corkscrew_timer(unsigned long data)
ioaddr + Wn4_Media);
EL3WINDOW(3);
- config = inl(ioaddr + Wn3_Config);
- config = (config & ~Xcvr) | (dev->if_port << Xcvr_shift);
- outl(config, ioaddr + Wn3_Config);
+ config.i = inl(ioaddr + Wn3_Config);
+ config.u.xcvr = dev->if_port;
+ outl(config.i, ioaddr + Wn3_Config);
outw(dev->if_port == 3 ? StartCoax : StopCoax,
ioaddr + EL3_CMD);
diff --git a/trunk/drivers/net/Kconfig b/trunk/drivers/net/Kconfig
index 9af05a2f4af3..d9107e542dfa 100644
--- a/trunk/drivers/net/Kconfig
+++ b/trunk/drivers/net/Kconfig
@@ -166,6 +166,16 @@ config NET_SB1000
If you don't have this card, of course say N.
+config IP1000
+ tristate "IP1000 Gigabit Ethernet support"
+ depends on PCI && EXPERIMENTAL
+ select MII
+ ---help---
+ This driver supports IP1000 gigabit Ethernet cards.
+
+ To compile this driver as a module, choose M here: the module
+ will be called ipg. This is recommended.
+
source "drivers/net/arcnet/Kconfig"
source "drivers/net/phy/Kconfig"
@@ -1976,19 +1986,12 @@ config E1000E
+ More specific information on configuring the driver is in
+ .
+
To compile this driver as a module, choose M here. The module
will be called e1000e.
-config IP1000
- tristate "IP1000 Gigabit Ethernet support"
- depends on PCI && EXPERIMENTAL
- select MII
- ---help---
- This driver supports IP1000 gigabit Ethernet cards.
-
- To compile this driver as a module, choose M here: the module
- will be called ipg. This is recommended.
-
source "drivers/net/ixp2000/Kconfig"
config MYRI_SBUS
@@ -2465,6 +2468,9 @@ config IXGBE
+ More specific information on configuring the driver is in
+ .
+
To compile this driver as a module, choose M here. The module
will be called ixgbe.
diff --git a/trunk/drivers/net/atl1/atl1_main.c b/trunk/drivers/net/atl1/atl1_main.c
index 9200ee59d854..35b0a7dd4ef4 100644
--- a/trunk/drivers/net/atl1/atl1_main.c
+++ b/trunk/drivers/net/atl1/atl1_main.c
@@ -120,7 +120,7 @@ static int __devinit atl1_sw_init(struct atl1_adapter *adapter)
struct atl1_hw *hw = &adapter->hw;
struct net_device *netdev = adapter->netdev;
- hw->max_frame_size = netdev->mtu + ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN;
+ hw->max_frame_size = netdev->mtu + ETH_HLEN + ETH_FCS_LEN;
hw->min_frame_size = ETH_ZLEN + ETH_FCS_LEN;
adapter->wol = 0;
@@ -688,7 +688,7 @@ static int atl1_change_mtu(struct net_device *netdev, int new_mtu)
{
struct atl1_adapter *adapter = netdev_priv(netdev);
int old_mtu = netdev->mtu;
- int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN;
+ int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN;
if ((max_frame < ETH_ZLEN + ETH_FCS_LEN) ||
(max_frame > MAX_JUMBO_FRAME_SIZE)) {
@@ -853,8 +853,8 @@ static u32 atl1_configure(struct atl1_adapter *adapter)
/* set Interrupt Clear Timer */
iowrite16(adapter->ict, hw->hw_addr + REG_CMBDISDMA_TIMER);
- /* set max frame size hw will accept */
- iowrite32(hw->max_frame_size, hw->hw_addr + REG_MTU);
+ /* set MTU, 4 : VLAN */
+ iowrite32(hw->max_frame_size + 4, hw->hw_addr + REG_MTU);
/* jumbo size & rrd retirement timer */
value = (((u32) hw->rx_jumbo_th & RXQ_JMBOSZ_TH_MASK)
diff --git a/trunk/drivers/net/bonding/bond_alb.c b/trunk/drivers/net/bonding/bond_alb.c
index b57bc9467dbe..25b8dbf6cfd7 100644
--- a/trunk/drivers/net/bonding/bond_alb.c
+++ b/trunk/drivers/net/bonding/bond_alb.c
@@ -979,7 +979,7 @@ static void alb_swap_mac_addr(struct bonding *bond, struct slave *slave1, struct
/*
* Send learning packets after MAC address swap.
*
- * Called with RTNL and no other locks
+ * Called with RTNL and bond->lock held for read.
*/
static void alb_fasten_mac_swap(struct bonding *bond, struct slave *slave1,
struct slave *slave2)
@@ -987,8 +987,6 @@ static void alb_fasten_mac_swap(struct bonding *bond, struct slave *slave1,
int slaves_state_differ = (SLAVE_IS_OK(slave1) != SLAVE_IS_OK(slave2));
struct slave *disabled_slave = NULL;
- ASSERT_RTNL();
-
/* fasten the change in the switch */
if (SLAVE_IS_OK(slave1)) {
alb_send_learning_packets(slave1, slave1->dev->dev_addr);
@@ -1033,7 +1031,7 @@ static void alb_fasten_mac_swap(struct bonding *bond, struct slave *slave1,
* a slave that has @slave's permanet address as its current address.
* We'll make sure that that slave no longer uses @slave's permanent address.
*
- * Caller must hold RTNL and no other locks
+ * Caller must hold bond lock
*/
static void alb_change_hw_addr_on_detach(struct bonding *bond, struct slave *slave)
{
@@ -1544,12 +1542,7 @@ int bond_alb_init_slave(struct bonding *bond, struct slave *slave)
return 0;
}
-/*
- * Remove slave from tlb and rlb hash tables, and fix up MAC addresses
- * if necessary.
- *
- * Caller must hold RTNL and no other locks
- */
+/* Caller must hold bond lock for write */
void bond_alb_deinit_slave(struct bonding *bond, struct slave *slave)
{
if (bond->slave_cnt > 1) {
@@ -1608,6 +1601,9 @@ void bond_alb_handle_active_change(struct bonding *bond, struct slave *new_slave
struct slave *swap_slave;
int i;
+ if (new_slave)
+ ASSERT_RTNL();
+
if (bond->curr_active_slave == new_slave) {
return;
}
@@ -1653,8 +1649,6 @@ void bond_alb_handle_active_change(struct bonding *bond, struct slave *new_slave
write_unlock_bh(&bond->curr_slave_lock);
read_unlock(&bond->lock);
- ASSERT_RTNL();
-
/* curr_active_slave must be set before calling alb_swap_mac_addr */
if (swap_slave) {
/* swap mac address */
@@ -1665,11 +1659,12 @@ void bond_alb_handle_active_change(struct bonding *bond, struct slave *new_slave
bond->alb_info.rlb_enabled);
}
+ read_lock(&bond->lock);
+
if (swap_slave) {
alb_fasten_mac_swap(bond, swap_slave, new_slave);
- read_lock(&bond->lock);
} else {
- read_lock(&bond->lock);
+ /* fasten bond mac on new current slave */
alb_send_learning_packets(new_slave, bond->dev->dev_addr);
}
diff --git a/trunk/drivers/net/bonding/bond_main.c b/trunk/drivers/net/bonding/bond_main.c
index 49a198206e3d..b0b26036266b 100644
--- a/trunk/drivers/net/bonding/bond_main.c
+++ b/trunk/drivers/net/bonding/bond_main.c
@@ -1746,9 +1746,7 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
* has been cleared (if our_slave == old_current),
* but before a new active slave is selected.
*/
- write_unlock_bh(&bond->lock);
bond_alb_deinit_slave(bond, slave);
- write_lock_bh(&bond->lock);
}
if (oldcurrent == slave) {
@@ -1907,12 +1905,6 @@ static int bond_release_all(struct net_device *bond_dev)
slave_dev = slave->dev;
bond_detach_slave(bond, slave);
- /* now that the slave is detached, unlock and perform
- * all the undo steps that should not be called from
- * within a lock.
- */
- write_unlock_bh(&bond->lock);
-
if ((bond->params.mode == BOND_MODE_TLB) ||
(bond->params.mode == BOND_MODE_ALB)) {
/* must be called only after the slave
@@ -1923,6 +1915,12 @@ static int bond_release_all(struct net_device *bond_dev)
bond_compute_features(bond);
+ /* now that the slave is detached, unlock and perform
+ * all the undo steps that should not be called from
+ * within a lock.
+ */
+ write_unlock_bh(&bond->lock);
+
bond_destroy_slave_symlinks(bond_dev, slave_dev);
bond_del_vlans_from_slave(bond, slave_dev);
@@ -2386,9 +2384,7 @@ void bond_mii_monitor(struct work_struct *work)
rtnl_lock();
read_lock(&bond->lock);
__bond_mii_monitor(bond, 1);
- read_unlock(&bond->lock);
- rtnl_unlock(); /* might sleep, hold no other locks */
- read_lock(&bond->lock);
+ rtnl_unlock();
}
delay = ((bond->params.miimon * HZ) / 1000) ? : 1;
@@ -3403,7 +3399,9 @@ static int bond_master_netdev_event(unsigned long event, struct net_device *bond
case NETDEV_CHANGENAME:
return bond_event_changename(event_bond);
case NETDEV_UNREGISTER:
- bond_release_all(event_bond->dev);
+ /*
+ * TODO: remove a bond from the list?
+ */
break;
default:
break;
@@ -4542,27 +4540,18 @@ static void bond_free_all(void)
/*
* Convert string input module parms. Accept either the
- * number of the mode or its string name. A bit complicated because
- * some mode names are substrings of other names, and calls from sysfs
- * may have whitespace in the name (trailing newlines, for example).
+ * number of the mode or its string name.
*/
-int bond_parse_parm(const char *buf, struct bond_parm_tbl *tbl)
+int bond_parse_parm(char *mode_arg, struct bond_parm_tbl *tbl)
{
- int mode = -1, i, rv;
- char modestr[BOND_MAX_MODENAME_LEN + 1] = { 0, };
-
- rv = sscanf(buf, "%d", &mode);
- if (!rv) {
- rv = sscanf(buf, "%20s", modestr);
- if (!rv)
- return -1;
- }
+ int i;
for (i = 0; tbl[i].modename; i++) {
- if (mode == tbl[i].mode)
- return tbl[i].mode;
- if (strcmp(modestr, tbl[i].modename) == 0)
+ if ((isdigit(*mode_arg) &&
+ tbl[i].mode == simple_strtol(mode_arg, NULL, 0)) ||
+ (strcmp(mode_arg, tbl[i].modename) == 0)) {
return tbl[i].mode;
+ }
}
return -1;
@@ -4876,22 +4865,9 @@ static struct lock_class_key bonding_netdev_xmit_lock_key;
int bond_create(char *name, struct bond_params *params, struct bonding **newbond)
{
struct net_device *bond_dev;
- struct bonding *bond, *nxt;
int res;
rtnl_lock();
- down_write(&bonding_rwsem);
-
- /* Check to see if the bond already exists. */
- list_for_each_entry_safe(bond, nxt, &bond_dev_list, bond_list)
- if (strnicmp(bond->dev->name, name, IFNAMSIZ) == 0) {
- printk(KERN_ERR DRV_NAME
- ": cannot add bond %s; it already exists\n",
- name);
- res = -EPERM;
- goto out_rtnl;
- }
-
bond_dev = alloc_netdev(sizeof(struct bonding), name ? name : "",
ether_setup);
if (!bond_dev) {
@@ -4930,12 +4906,10 @@ int bond_create(char *name, struct bond_params *params, struct bonding **newbond
netif_carrier_off(bond_dev);
- up_write(&bonding_rwsem);
rtnl_unlock(); /* allows sysfs registration of net device */
res = bond_create_sysfs_entry(bond_dev->priv);
if (res < 0) {
rtnl_lock();
- down_write(&bonding_rwsem);
goto out_bond;
}
@@ -4946,7 +4920,6 @@ int bond_create(char *name, struct bond_params *params, struct bonding **newbond
out_netdev:
free_netdev(bond_dev);
out_rtnl:
- up_write(&bonding_rwsem);
rtnl_unlock();
return res;
}
@@ -4967,9 +4940,6 @@ static int __init bonding_init(void)
#ifdef CONFIG_PROC_FS
bond_create_proc_dir();
#endif
-
- init_rwsem(&bonding_rwsem);
-
for (i = 0; i < max_bonds; i++) {
res = bond_create(NULL, &bonding_defaults, NULL);
if (res)
diff --git a/trunk/drivers/net/bonding/bond_sysfs.c b/trunk/drivers/net/bonding/bond_sysfs.c
index 90a1f31e8e63..11b76b352415 100644
--- a/trunk/drivers/net/bonding/bond_sysfs.c
+++ b/trunk/drivers/net/bonding/bond_sysfs.c
@@ -109,10 +109,11 @@ static ssize_t bonding_store_bonds(struct class *cls, const char *buffer, size_t
{
char command[IFNAMSIZ + 1] = {0, };
char *ifname;
- int rv, res = count;
+ int res = count;
struct bonding *bond;
struct bonding *nxt;
+ down_write(&(bonding_rwsem));
sscanf(buffer, "%16s", command); /* IFNAMSIZ*/
ifname = command + 1;
if ((strlen(command) <= 1) ||
@@ -120,28 +121,39 @@ static ssize_t bonding_store_bonds(struct class *cls, const char *buffer, size_t
goto err_no_cmd;
if (command[0] == '+') {
+
+ /* Check to see if the bond already exists. */
+ list_for_each_entry_safe(bond, nxt, &bond_dev_list, bond_list)
+ if (strnicmp(bond->dev->name, ifname, IFNAMSIZ) == 0) {
+ printk(KERN_ERR DRV_NAME
+ ": cannot add bond %s; it already exists\n",
+ ifname);
+ res = -EPERM;
+ goto out;
+ }
+
printk(KERN_INFO DRV_NAME
": %s is being created...\n", ifname);
- rv = bond_create(ifname, &bonding_defaults, &bond);
- if (rv) {
- printk(KERN_INFO DRV_NAME ": Bond creation failed.\n");
- res = rv;
+ if (bond_create(ifname, &bonding_defaults, &bond)) {
+ printk(KERN_INFO DRV_NAME
+ ": %s interface already exists. Bond creation failed.\n",
+ ifname);
+ res = -EPERM;
}
goto out;
}
if (command[0] == '-') {
- rtnl_lock();
- down_write(&bonding_rwsem);
-
list_for_each_entry_safe(bond, nxt, &bond_dev_list, bond_list)
if (strnicmp(bond->dev->name, ifname, IFNAMSIZ) == 0) {
+ rtnl_lock();
/* check the ref count on the bond's kobject.
* If it's > expected, then there's a file open,
* and we have to fail.
*/
if (atomic_read(&bond->dev->dev.kobj.kref.refcount)
> expected_refcount){
+ rtnl_unlock();
printk(KERN_INFO DRV_NAME
": Unable remove bond %s due to open references.\n",
ifname);
@@ -152,7 +164,6 @@ static ssize_t bonding_store_bonds(struct class *cls, const char *buffer, size_t
": %s is being deleted...\n",
bond->dev->name);
bond_destroy(bond);
- up_write(&bonding_rwsem);
rtnl_unlock();
goto out;
}
@@ -160,8 +171,6 @@ static ssize_t bonding_store_bonds(struct class *cls, const char *buffer, size_t
printk(KERN_ERR DRV_NAME
": unable to delete non-existent bond %s\n", ifname);
res = -ENODEV;
- up_write(&bonding_rwsem);
- rtnl_unlock();
goto out;
}
@@ -174,6 +183,7 @@ static ssize_t bonding_store_bonds(struct class *cls, const char *buffer, size_t
* get called forever, which is bad.
*/
out:
+ up_write(&(bonding_rwsem));
return res;
}
/* class attribute for bond_masters file. This ends up in /sys/class/net */
@@ -261,9 +271,6 @@ static ssize_t bonding_store_slaves(struct device *d,
/* Note: We can't hold bond->lock here, as bond_create grabs it. */
- rtnl_lock();
- down_write(&(bonding_rwsem));
-
sscanf(buffer, "%16s", command); /* IFNAMSIZ*/
ifname = command + 1;
if ((strlen(command) <= 1) ||
@@ -329,10 +336,12 @@ static ssize_t bonding_store_slaves(struct device *d,
dev->mtu = bond->dev->mtu;
}
}
+ rtnl_lock();
res = bond_enslave(bond->dev, dev);
bond_for_each_slave(bond, slave, i)
if (strnicmp(slave->dev->name, ifname, IFNAMSIZ) == 0)
slave->original_mtu = original_mtu;
+ rtnl_unlock();
if (res) {
ret = res;
}
@@ -350,10 +359,12 @@ static ssize_t bonding_store_slaves(struct device *d,
if (dev) {
printk(KERN_INFO DRV_NAME ": %s: Removing slave %s\n",
bond->dev->name, dev->name);
+ rtnl_lock();
if (bond->setup_by_slave)
res = bond_release_and_destroy(bond->dev, dev);
else
res = bond_release(bond->dev, dev);
+ rtnl_unlock();
if (res) {
ret = res;
goto out;
@@ -378,8 +389,6 @@ static ssize_t bonding_store_slaves(struct device *d,
ret = -EPERM;
out:
- up_write(&(bonding_rwsem));
- rtnl_unlock();
return ret;
}
@@ -414,7 +423,7 @@ static ssize_t bonding_store_mode(struct device *d,
goto out;
}
- new_value = bond_parse_parm(buf, bond_mode_tbl);
+ new_value = bond_parse_parm((char *)buf, bond_mode_tbl);
if (new_value < 0) {
printk(KERN_ERR DRV_NAME
": %s: Ignoring invalid mode value %.*s.\n",
@@ -469,7 +478,7 @@ static ssize_t bonding_store_xmit_hash(struct device *d,
goto out;
}
- new_value = bond_parse_parm(buf, xmit_hashtype_tbl);
+ new_value = bond_parse_parm((char *)buf, xmit_hashtype_tbl);
if (new_value < 0) {
printk(KERN_ERR DRV_NAME
": %s: Ignoring invalid xmit hash policy value %.*s.\n",
@@ -509,7 +518,7 @@ static ssize_t bonding_store_arp_validate(struct device *d,
int new_value;
struct bonding *bond = to_bond(d);
- new_value = bond_parse_parm(buf, arp_validate_tbl);
+ new_value = bond_parse_parm((char *)buf, arp_validate_tbl);
if (new_value < 0) {
printk(KERN_ERR DRV_NAME
": %s: Ignoring invalid arp_validate value %s\n",
@@ -932,7 +941,7 @@ static ssize_t bonding_store_lacp(struct device *d,
goto out;
}
- new_value = bond_parse_parm(buf, bond_lacp_tbl);
+ new_value = bond_parse_parm((char *)buf, bond_lacp_tbl);
if ((new_value == 1) || (new_value == 0)) {
bond->params.lacp_fast = new_value;
@@ -1066,10 +1075,7 @@ static ssize_t bonding_store_primary(struct device *d,
struct slave *slave;
struct bonding *bond = to_bond(d);
- rtnl_lock();
- read_lock(&bond->lock);
- write_lock_bh(&bond->curr_slave_lock);
-
+ write_lock_bh(&bond->lock);
if (!USES_PRIMARY(bond->params.mode)) {
printk(KERN_INFO DRV_NAME
": %s: Unable to set primary slave; %s is in mode %d\n",
@@ -1103,8 +1109,8 @@ static ssize_t bonding_store_primary(struct device *d,
}
}
out:
- write_unlock_bh(&bond->curr_slave_lock);
- read_unlock(&bond->lock);
+ write_unlock_bh(&bond->lock);
+
rtnl_unlock();
return count;
@@ -1184,8 +1190,7 @@ static ssize_t bonding_store_active_slave(struct device *d,
struct bonding *bond = to_bond(d);
rtnl_lock();
- read_lock(&bond->lock);
- write_lock_bh(&bond->curr_slave_lock);
+ write_lock_bh(&bond->lock);
if (!USES_PRIMARY(bond->params.mode)) {
printk(KERN_INFO DRV_NAME
@@ -1242,8 +1247,7 @@ static ssize_t bonding_store_active_slave(struct device *d,
}
}
out:
- write_unlock_bh(&bond->curr_slave_lock);
- read_unlock(&bond->lock);
+ write_unlock_bh(&bond->lock);
rtnl_unlock();
return count;
@@ -1414,6 +1418,8 @@ int bond_create_sysfs(void)
int ret = 0;
struct bonding *firstbond;
+ init_rwsem(&bonding_rwsem);
+
/* get the netdev class pointer */
firstbond = container_of(bond_dev_list.next, struct bonding, bond_list);
if (!firstbond)
diff --git a/trunk/drivers/net/bonding/bonding.h b/trunk/drivers/net/bonding/bonding.h
index 6d83be49899a..e1e4734e23ce 100644
--- a/trunk/drivers/net/bonding/bonding.h
+++ b/trunk/drivers/net/bonding/bonding.h
@@ -141,8 +141,6 @@ struct bond_parm_tbl {
int mode;
};
-#define BOND_MAX_MODENAME_LEN 20
-
struct vlan_entry {
struct list_head vlan_list;
__be32 vlan_ip;
@@ -316,7 +314,7 @@ void bond_mii_monitor(struct work_struct *);
void bond_loadbalance_arp_mon(struct work_struct *);
void bond_activebackup_arp_mon(struct work_struct *);
void bond_set_mode_ops(struct bonding *bond, int mode);
-int bond_parse_parm(const char *mode_arg, struct bond_parm_tbl *tbl);
+int bond_parse_parm(char *mode_arg, struct bond_parm_tbl *tbl);
void bond_select_active_slave(struct bonding *bond);
void bond_change_active_slave(struct bonding *bond, struct slave *new_active);
void bond_register_arp(struct bonding *);
diff --git a/trunk/drivers/net/cassini.c b/trunk/drivers/net/cassini.c
index d66915d82b24..7df31b5561cc 100644
--- a/trunk/drivers/net/cassini.c
+++ b/trunk/drivers/net/cassini.c
@@ -142,8 +142,8 @@
#define DRV_MODULE_NAME "cassini"
#define PFX DRV_MODULE_NAME ": "
-#define DRV_MODULE_VERSION "1.5"
-#define DRV_MODULE_RELDATE "4 Jan 2008"
+#define DRV_MODULE_VERSION "1.4"
+#define DRV_MODULE_RELDATE "1 July 2004"
#define CAS_DEF_MSG_ENABLE \
(NETIF_MSG_DRV | \
@@ -336,6 +336,30 @@ static inline void cas_mask_intr(struct cas *cp)
cas_disable_irq(cp, i);
}
+static inline void cas_buffer_init(cas_page_t *cp)
+{
+ struct page *page = cp->buffer;
+ atomic_set((atomic_t *)&page->lru.next, 1);
+}
+
+static inline int cas_buffer_count(cas_page_t *cp)
+{
+ struct page *page = cp->buffer;
+ return atomic_read((atomic_t *)&page->lru.next);
+}
+
+static inline void cas_buffer_inc(cas_page_t *cp)
+{
+ struct page *page = cp->buffer;
+ atomic_inc((atomic_t *)&page->lru.next);
+}
+
+static inline void cas_buffer_dec(cas_page_t *cp)
+{
+ struct page *page = cp->buffer;
+ atomic_dec((atomic_t *)&page->lru.next);
+}
+
static void cas_enable_irq(struct cas *cp, const int ring)
{
if (ring == 0) { /* all but TX_DONE */
@@ -473,6 +497,7 @@ static int cas_page_free(struct cas *cp, cas_page_t *page)
{
pci_unmap_page(cp->pdev, page->dma_addr, cp->page_size,
PCI_DMA_FROMDEVICE);
+ cas_buffer_dec(page);
__free_pages(page->buffer, cp->page_order);
kfree(page);
return 0;
@@ -502,6 +527,7 @@ static cas_page_t *cas_page_alloc(struct cas *cp, const gfp_t flags)
page->buffer = alloc_pages(flags, cp->page_order);
if (!page->buffer)
goto page_err;
+ cas_buffer_init(page);
page->dma_addr = pci_map_page(cp->pdev, page->buffer, 0,
cp->page_size, PCI_DMA_FROMDEVICE);
return page;
@@ -580,7 +606,7 @@ static void cas_spare_recover(struct cas *cp, const gfp_t flags)
list_for_each_safe(elem, tmp, &list) {
cas_page_t *page = list_entry(elem, cas_page_t, list);
- if (page_count(page->buffer) > 1)
+ if (cas_buffer_count(page) > 1)
continue;
list_del(elem);
@@ -1348,7 +1374,7 @@ static inline cas_page_t *cas_page_spare(struct cas *cp, const int index)
cas_page_t *page = cp->rx_pages[1][index];
cas_page_t *new;
- if (page_count(page->buffer) == 1)
+ if (cas_buffer_count(page) == 1)
return page;
new = cas_page_dequeue(cp);
@@ -1368,7 +1394,7 @@ static cas_page_t *cas_page_swap(struct cas *cp, const int ring,
cas_page_t **page1 = cp->rx_pages[1];
/* swap if buffer is in use */
- if (page_count(page0[index]->buffer) > 1) {
+ if (cas_buffer_count(page0[index]) > 1) {
cas_page_t *new = cas_page_spare(cp, index);
if (new) {
page1[index] = page0[index];
@@ -1953,7 +1979,6 @@ static int cas_rx_process_pkt(struct cas *cp, struct cas_rx_comp *rxc,
struct cas_page *page;
struct sk_buff *skb;
void *addr, *crcaddr;
- __sum16 csum;
char *p;
hlen = CAS_VAL(RX_COMP2_HDR_SIZE, words[1]);
@@ -2037,10 +2062,10 @@ static int cas_rx_process_pkt(struct cas *cp, struct cas_rx_comp *rxc,
skb_shinfo(skb)->nr_frags++;
skb->data_len += hlen - swivel;
- skb->truesize += hlen - swivel;
skb->len += hlen - swivel;
get_page(page->buffer);
+ cas_buffer_inc(page);
frag->page = page->buffer;
frag->page_offset = off;
frag->size = hlen - swivel;
@@ -2065,6 +2090,7 @@ static int cas_rx_process_pkt(struct cas *cp, struct cas_rx_comp *rxc,
frag++;
get_page(page->buffer);
+ cas_buffer_inc(page);
frag->page = page->buffer;
frag->page_offset = 0;
frag->size = hlen;
@@ -2132,15 +2158,14 @@ static int cas_rx_process_pkt(struct cas *cp, struct cas_rx_comp *rxc,
skb_put(skb, alloclen);
}
- csum = (__force __sum16)htons(CAS_VAL(RX_COMP4_TCP_CSUM, words[3]));
+ i = CAS_VAL(RX_COMP4_TCP_CSUM, words[3]);
if (cp->crc_size) {
/* checksum includes FCS. strip it out. */
- csum = csum_fold(csum_partial(crcaddr, cp->crc_size,
- csum_unfold(csum)));
+ i = csum_fold(csum_partial(crcaddr, cp->crc_size, i));
if (addr)
cas_page_unmap(addr);
}
- skb->csum = csum_unfold(~csum);
+ skb->csum = ntohs(i ^ 0xffff);
skb->ip_summed = CHECKSUM_COMPLETE;
skb->protocol = eth_type_trans(skb, cp->dev);
return len;
@@ -2228,7 +2253,7 @@ static int cas_post_rxds_ringN(struct cas *cp, int ring, int num)
released = 0;
while (entry != last) {
/* make a new buffer if it's still in use */
- if (page_count(page[entry]->buffer) > 1) {
+ if (cas_buffer_count(page[entry]) > 1) {
cas_page_t *new = cas_page_dequeue(cp);
if (!new) {
/* let the timer know that we need to
@@ -2586,7 +2611,7 @@ static int cas_poll(struct napi_struct *napi, int budget)
{
struct cas *cp = container_of(napi, struct cas, napi);
struct net_device *dev = cp->dev;
- int i, enable_intr, credits;
+ int i, enable_intr, todo, credits;
u32 status = readl(cp->regs + REG_INTR_STATUS);
unsigned long flags;
@@ -4350,7 +4375,7 @@ static int cas_close(struct net_device *dev)
struct cas *cp = netdev_priv(dev);
#ifdef USE_NAPI
- napi_disable(&cp->napi);
+ napi_enable(&cp->napi);
#endif
/* Make sure we don't get distracted by suspend/resume */
mutex_lock(&cp->pm_mutex);
@@ -4847,90 +4872,6 @@ static int cas_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
return rc;
}
-/* When this chip sits underneath an Intel 31154 bridge, it is the
- * only subordinate device and we can tweak the bridge settings to
- * reflect that fact.
- */
-static void __devinit cas_program_bridge(struct pci_dev *cas_pdev)
-{
- struct pci_dev *pdev = cas_pdev->bus->self;
- u32 val;
-
- if (!pdev)
- return;
-
- if (pdev->vendor != 0x8086 || pdev->device != 0x537c)
- return;
-
- /* Clear bit 10 (Bus Parking Control) in the Secondary
- * Arbiter Control/Status Register which lives at offset
- * 0x41. Using a 32-bit word read/modify/write at 0x40
- * is much simpler so that's how we do this.
- */
- pci_read_config_dword(pdev, 0x40, &val);
- val &= ~0x00040000;
- pci_write_config_dword(pdev, 0x40, val);
-
- /* Max out the Multi-Transaction Timer settings since
- * Cassini is the only device present.
- *
- * The register is 16-bit and lives at 0x50. When the
- * settings are enabled, it extends the GRANT# signal
- * for a requestor after a transaction is complete. This
- * allows the next request to run without first needing
- * to negotiate the GRANT# signal back.
- *
- * Bits 12:10 define the grant duration:
- *
- * 1 -- 16 clocks
- * 2 -- 32 clocks
- * 3 -- 64 clocks
- * 4 -- 128 clocks
- * 5 -- 256 clocks
- *
- * All other values are illegal.
- *
- * Bits 09:00 define which REQ/GNT signal pairs get the
- * GRANT# signal treatment. We set them all.
- */
- pci_write_config_word(pdev, 0x50, (5 << 10) | 0x3ff);
-
- /* The Read Prefecth Policy register is 16-bit and sits at
- * offset 0x52. It enables a "smart" pre-fetch policy. We
- * enable it and max out all of the settings since only one
- * device is sitting underneath and thus bandwidth sharing is
- * not an issue.
- *
- * The register has several 3 bit fields, which indicates a
- * multiplier applied to the base amount of prefetching the
- * chip would do. These fields are at:
- *
- * 15:13 --- ReRead Primary Bus
- * 12:10 --- FirstRead Primary Bus
- * 09:07 --- ReRead Secondary Bus
- * 06:04 --- FirstRead Secondary Bus
- *
- * Bits 03:00 control which REQ/GNT pairs the prefetch settings
- * get enabled on. Bit 3 is a grouped enabler which controls
- * all of the REQ/GNT pairs from [8:3]. Bits 2 to 0 control
- * the individual REQ/GNT pairs [2:0].
- */
- pci_write_config_word(pdev, 0x52,
- (0x7 << 13) |
- (0x7 << 10) |
- (0x7 << 7) |
- (0x7 << 4) |
- (0xf << 0));
-
- /* Force cacheline size to 0x8 */
- pci_write_config_byte(pdev, PCI_CACHE_LINE_SIZE, 0x08);
-
- /* Force latency timer to maximum setting so Cassini can
- * sit on the bus as long as it likes.
- */
- pci_write_config_byte(pdev, PCI_LATENCY_TIMER, 0xff);
-}
-
static int __devinit cas_init_one(struct pci_dev *pdev,
const struct pci_device_id *ent)
{
@@ -4986,8 +4927,6 @@ static int __devinit cas_init_one(struct pci_dev *pdev,
printk(KERN_WARNING PFX "Could not enable MWI for %s\n",
pci_name(pdev));
- cas_program_bridge(pdev);
-
/*
* On some architectures, the default cache line size set
* by pci_try_set_mwi reduces perforamnce. We have to increase
diff --git a/trunk/drivers/net/cassini.h b/trunk/drivers/net/cassini.h
index 552af89ca1cf..2f93f83342d2 100644
--- a/trunk/drivers/net/cassini.h
+++ b/trunk/drivers/net/cassini.h
@@ -4122,8 +4122,8 @@ cas_saturn_patch_t cas_saturn_patch[] = {
inserted into
outgoing frame. */
struct cas_tx_desc {
- __le64 control;
- __le64 buffer;
+ u64 control;
+ u64 buffer;
};
/* descriptor ring for free buffers contains page-sized buffers. the index
@@ -4131,8 +4131,8 @@ struct cas_tx_desc {
* the completion ring.
*/
struct cas_rx_desc {
- __le64 index;
- __le64 buffer;
+ u64 index;
+ u64 buffer;
};
/* received packets are put on the completion ring. */
@@ -4210,10 +4210,10 @@ struct cas_rx_desc {
#define RX_INDEX_RELEASE 0x0000000000002000ULL
struct cas_rx_comp {
- __le64 word1;
- __le64 word2;
- __le64 word3;
- __le64 word4;
+ u64 word1;
+ u64 word2;
+ u64 word3;
+ u64 word4;
};
enum link_state {
@@ -4252,7 +4252,7 @@ struct cas_init_block {
struct cas_rx_comp rxcs[N_RX_COMP_RINGS][INIT_BLOCK_RX_COMP];
struct cas_rx_desc rxds[N_RX_DESC_RINGS][INIT_BLOCK_RX_DESC];
struct cas_tx_desc txds[N_TX_RINGS][INIT_BLOCK_TX];
- __le64 tx_compwb;
+ u64 tx_compwb;
};
/* tiny buffers to deal with target abort issue. we allocate a bit
diff --git a/trunk/drivers/net/cpmac.c b/trunk/drivers/net/cpmac.c
index 6e12d48351b8..6fd95a2c8cec 100644
--- a/trunk/drivers/net/cpmac.c
+++ b/trunk/drivers/net/cpmac.c
@@ -459,7 +459,7 @@ static int cpmac_start_xmit(struct sk_buff *skb, struct net_device *dev)
return NETDEV_TX_OK;
len = max(skb->len, ETH_ZLEN);
- queue = skb_get_queue_mapping(skb);
+ queue = skb->queue_mapping;
#ifdef CONFIG_NETDEVICES_MULTIQUEUE
netif_stop_subqueue(dev, queue);
#else
diff --git a/trunk/drivers/net/dl2k.c b/trunk/drivers/net/dl2k.c
index e233d04a2132..5066beb2e7bc 100644
--- a/trunk/drivers/net/dl2k.c
+++ b/trunk/drivers/net/dl2k.c
@@ -332,7 +332,7 @@ parse_eeprom (struct net_device *dev)
#endif
/* Read eeprom */
for (i = 0; i < 128; i++) {
- ((__le16 *) sromdata)[i] = cpu_to_le16(read_eeprom (ioaddr, i));
+ ((u16 *) sromdata)[i] = le16_to_cpu (read_eeprom (ioaddr, i));
}
#ifdef MEM_MAPPING
ioaddr = dev->base_addr;
@@ -516,7 +516,7 @@ rio_timer (unsigned long data)
PCI_DMA_FROMDEVICE));
}
np->rx_ring[entry].fraginfo |=
- cpu_to_le64((u64)np->rx_buf_sz << 48);
+ cpu_to_le64 (np->rx_buf_sz) << 48;
np->rx_ring[entry].status = 0;
} /* end for */
} /* end if */
@@ -584,11 +584,11 @@ alloc_list (struct net_device *dev)
cpu_to_le64 ( pci_map_single (
np->pdev, skb->data, np->rx_buf_sz,
PCI_DMA_FROMDEVICE));
- np->rx_ring[i].fraginfo |= cpu_to_le64((u64)np->rx_buf_sz << 48);
+ np->rx_ring[i].fraginfo |= cpu_to_le64 (np->rx_buf_sz) << 48;
}
/* Set RFDListPtr */
- writel (np->rx_ring_dma, dev->base_addr + RFDListPtr0);
+ writel (cpu_to_le32 (np->rx_ring_dma), dev->base_addr + RFDListPtr0);
writel (0, dev->base_addr + RFDListPtr1);
return;
@@ -620,14 +620,15 @@ start_xmit (struct sk_buff *skb, struct net_device *dev)
}
#endif
if (np->vlan) {
- tfc_vlan_tag = VLANTagInsert |
- ((u64)np->vlan << 32) |
- ((u64)skb->priority << 45);
+ tfc_vlan_tag =
+ cpu_to_le64 (VLANTagInsert) |
+ (cpu_to_le64 (np->vlan) << 32) |
+ (cpu_to_le64 (skb->priority) << 45);
}
txdesc->fraginfo = cpu_to_le64 (pci_map_single (np->pdev, skb->data,
skb->len,
PCI_DMA_TODEVICE));
- txdesc->fraginfo |= cpu_to_le64((u64)skb->len << 48);
+ txdesc->fraginfo |= cpu_to_le64 (skb->len) << 48;
/* DL2K bug: DMA fails to get next descriptor ptr in 10Mbps mode
* Work around: Always use 1 descriptor in 10Mbps mode */
@@ -707,11 +708,6 @@ rio_interrupt (int irq, void *dev_instance)
return IRQ_RETVAL(handled);
}
-static inline dma_addr_t desc_to_dma(struct netdev_desc *desc)
-{
- return le64_to_cpu(desc->fraginfo) & DMA_48BIT_MASK;
-}
-
static void
rio_free_tx (struct net_device *dev, int irq)
{
@@ -729,11 +725,11 @@ rio_free_tx (struct net_device *dev, int irq)
while (entry != np->cur_tx) {
struct sk_buff *skb;
- if (!(np->tx_ring[entry].status & cpu_to_le64(TFDDone)))
+ if (!(np->tx_ring[entry].status & TFDDone))
break;
skb = np->tx_skbuff[entry];
pci_unmap_single (np->pdev,
- desc_to_dma(&np->tx_ring[entry]),
+ np->tx_ring[entry].fraginfo & DMA_48BIT_MASK,
skb->len, PCI_DMA_TODEVICE);
if (irq)
dev_kfree_skb_irq (skb);
@@ -835,14 +831,13 @@ receive_packet (struct net_device *dev)
int pkt_len;
u64 frame_status;
- if (!(desc->status & cpu_to_le64(RFDDone)) ||
- !(desc->status & cpu_to_le64(FrameStart)) ||
- !(desc->status & cpu_to_le64(FrameEnd)))
+ if (!(desc->status & RFDDone) ||
+ !(desc->status & FrameStart) || !(desc->status & FrameEnd))
break;
/* Chip omits the CRC. */
- frame_status = le64_to_cpu(desc->status);
- pkt_len = frame_status & 0xffff;
+ pkt_len = le64_to_cpu (desc->status & 0xffff);
+ frame_status = le64_to_cpu (desc->status);
if (--cnt < 0)
break;
/* Update rx error statistics, drop packet. */
@@ -862,14 +857,15 @@ receive_packet (struct net_device *dev)
/* Small skbuffs for short packets */
if (pkt_len > copy_thresh) {
pci_unmap_single (np->pdev,
- desc_to_dma(desc),
+ desc->fraginfo & DMA_48BIT_MASK,
np->rx_buf_sz,
PCI_DMA_FROMDEVICE);
skb_put (skb = np->rx_skbuff[entry], pkt_len);
np->rx_skbuff[entry] = NULL;
} else if ((skb = dev_alloc_skb (pkt_len + 2)) != NULL) {
pci_dma_sync_single_for_cpu(np->pdev,
- desc_to_dma(desc),
+ desc->fraginfo &
+ DMA_48BIT_MASK,
np->rx_buf_sz,
PCI_DMA_FROMDEVICE);
/* 16 byte align the IP header */
@@ -879,7 +875,8 @@ receive_packet (struct net_device *dev)
pkt_len);
skb_put (skb, pkt_len);
pci_dma_sync_single_for_device(np->pdev,
- desc_to_dma(desc),
+ desc->fraginfo &
+ DMA_48BIT_MASK,
np->rx_buf_sz,
PCI_DMA_FROMDEVICE);
}
@@ -922,7 +919,7 @@ receive_packet (struct net_device *dev)
PCI_DMA_FROMDEVICE));
}
np->rx_ring[entry].fraginfo |=
- cpu_to_le64((u64)np->rx_buf_sz << 48);
+ cpu_to_le64 (np->rx_buf_sz) << 48;
np->rx_ring[entry].status = 0;
entry = (entry + 1) % RX_RING_SIZE;
}
@@ -1124,7 +1121,7 @@ set_multicast (struct net_device *dev)
hash_table[0] = hash_table[1] = 0;
/* RxFlowcontrol DA: 01-80-C2-00-00-01. Hash index=0x39 */
- hash_table[1] |= 0x02000000;
+ hash_table[1] |= cpu_to_le32(0x02000000);
if (dev->flags & IFF_PROMISC) {
/* Receive all frames promiscuously. */
rx_mode = ReceiveAllFrames;
@@ -1316,10 +1313,9 @@ rio_ioctl (struct net_device *dev, struct ifreq *rq, int cmd)
("%02x:cur:%08x next:%08x status:%08x frag1:%08x frag0:%08x",
i,
(u32) (np->tx_ring_dma + i * sizeof (*desc)),
- (u32)le64_to_cpu(desc->next_desc),
- (u32)le64_to_cpu(desc->status),
- (u32)(le64_to_cpu(desc->fraginfo) >> 32),
- (u32)le64_to_cpu(desc->fraginfo));
+ (u32) desc->next_desc,
+ (u32) desc->status, (u32) (desc->fraginfo >> 32),
+ (u32) desc->fraginfo);
printk ("\n");
}
printk ("\n");
@@ -1436,7 +1432,7 @@ mii_write (struct net_device *dev, int phy_addr, int reg_num, u16 data)
static int
mii_wait_link (struct net_device *dev, int wait)
{
- __u16 bmsr;
+ BMSR_t bmsr;
int phy_addr;
struct netdev_private *np;
@@ -1444,8 +1440,8 @@ mii_wait_link (struct net_device *dev, int wait)
phy_addr = np->phy_addr;
do {
- bmsr = mii_read (dev, phy_addr, MII_BMSR);
- if (bmsr & MII_BMSR_LINK_STATUS)
+ bmsr.image = mii_read (dev, phy_addr, MII_BMSR);
+ if (bmsr.bits.link_status)
return 0;
mdelay (1);
} while (--wait > 0);
@@ -1454,72 +1450,70 @@ mii_wait_link (struct net_device *dev, int wait)
static int
mii_get_media (struct net_device *dev)
{
- __u16 negotiate;
- __u16 bmsr;
- __u16 mscr;
- __u16 mssr;
+ ANAR_t negotiate;
+ BMSR_t bmsr;
+ BMCR_t bmcr;
+ MSCR_t mscr;
+ MSSR_t mssr;
int phy_addr;
struct netdev_private *np;
np = netdev_priv(dev);
phy_addr = np->phy_addr;
- bmsr = mii_read (dev, phy_addr, MII_BMSR);
+ bmsr.image = mii_read (dev, phy_addr, MII_BMSR);
if (np->an_enable) {
- if (!(bmsr & MII_BMSR_AN_COMPLETE)) {
+ if (!bmsr.bits.an_complete) {
/* Auto-Negotiation not completed */
return -1;
}
- negotiate = mii_read (dev, phy_addr, MII_ANAR) &
+ negotiate.image = mii_read (dev, phy_addr, MII_ANAR) &
mii_read (dev, phy_addr, MII_ANLPAR);
- mscr = mii_read (dev, phy_addr, MII_MSCR);
- mssr = mii_read (dev, phy_addr, MII_MSSR);
- if (mscr & MII_MSCR_1000BT_FD && mssr & MII_MSSR_LP_1000BT_FD) {
+ mscr.image = mii_read (dev, phy_addr, MII_MSCR);
+ mssr.image = mii_read (dev, phy_addr, MII_MSSR);
+ if (mscr.bits.media_1000BT_FD & mssr.bits.lp_1000BT_FD) {
np->speed = 1000;
np->full_duplex = 1;
printk (KERN_INFO "Auto 1000 Mbps, Full duplex\n");
- } else if (mscr & MII_MSCR_1000BT_HD && mssr & MII_MSSR_LP_1000BT_HD) {
+ } else if (mscr.bits.media_1000BT_HD & mssr.bits.lp_1000BT_HD) {
np->speed = 1000;
np->full_duplex = 0;
printk (KERN_INFO "Auto 1000 Mbps, Half duplex\n");
- } else if (negotiate & MII_ANAR_100BX_FD) {
+ } else if (negotiate.bits.media_100BX_FD) {
np->speed = 100;
np->full_duplex = 1;
printk (KERN_INFO "Auto 100 Mbps, Full duplex\n");
- } else if (negotiate & MII_ANAR_100BX_HD) {
+ } else if (negotiate.bits.media_100BX_HD) {
np->speed = 100;
np->full_duplex = 0;
printk (KERN_INFO "Auto 100 Mbps, Half duplex\n");
- } else if (negotiate & MII_ANAR_10BT_FD) {
+ } else if (negotiate.bits.media_10BT_FD) {
np->speed = 10;
np->full_duplex = 1;
printk (KERN_INFO "Auto 10 Mbps, Full duplex\n");
- } else if (negotiate & MII_ANAR_10BT_HD) {
+ } else if (negotiate.bits.media_10BT_HD) {
np->speed = 10;
np->full_duplex = 0;
printk (KERN_INFO "Auto 10 Mbps, Half duplex\n");
}
- if (negotiate & MII_ANAR_PAUSE) {
+ if (negotiate.bits.pause) {
np->tx_flow &= 1;
np->rx_flow &= 1;
- } else if (negotiate & MII_ANAR_ASYMMETRIC) {
+ } else if (negotiate.bits.asymmetric) {
np->tx_flow = 0;
np->rx_flow &= 1;
}
/* else tx_flow, rx_flow = user select */
} else {
- __u16 bmcr = mii_read (dev, phy_addr, MII_BMCR);
- switch (bmcr & (MII_BMCR_SPEED_100 | MII_BMCR_SPEED_1000)) {
- case MII_BMCR_SPEED_1000:
- printk (KERN_INFO "Operating at 1000 Mbps, ");
- break;
- case MII_BMCR_SPEED_100:
+ bmcr.image = mii_read (dev, phy_addr, MII_BMCR);
+ if (bmcr.bits.speed100 == 1 && bmcr.bits.speed1000 == 0) {
printk (KERN_INFO "Operating at 100 Mbps, ");
- break;
- case 0:
+ } else if (bmcr.bits.speed100 == 0 && bmcr.bits.speed1000 == 0) {
printk (KERN_INFO "Operating at 10 Mbps, ");
+ } else if (bmcr.bits.speed100 == 0 && bmcr.bits.speed1000 == 1) {
+ printk (KERN_INFO "Operating at 1000 Mbps, ");
}
- if (bmcr & MII_BMCR_DUPLEX_MODE) {
+ if (bmcr.bits.duplex_mode) {
printk ("Full duplex\n");
} else {
printk ("Half duplex\n");
@@ -1540,10 +1534,10 @@ mii_get_media (struct net_device *dev)
static int
mii_set_media (struct net_device *dev)
{
- __u16 pscr;
- __u16 bmcr;
- __u16 bmsr;
- __u16 anar;
+ PHY_SCR_t pscr;
+ BMCR_t bmcr;
+ BMSR_t bmsr;
+ ANAR_t anar;
int phy_addr;
struct netdev_private *np;
np = netdev_priv(dev);
@@ -1552,77 +1546,76 @@ mii_set_media (struct net_device *dev)
/* Does user set speed? */
if (np->an_enable) {
/* Advertise capabilities */
- bmsr = mii_read (dev, phy_addr, MII_BMSR);
- anar = mii_read (dev, phy_addr, MII_ANAR) &
- ~MII_ANAR_100BX_FD &
- ~MII_ANAR_100BX_HD &
- ~MII_ANAR_100BT4 &
- ~MII_ANAR_10BT_FD &
- ~MII_ANAR_10BT_HD;
- if (bmsr & MII_BMSR_100BX_FD)
- anar |= MII_ANAR_100BX_FD;
- if (bmsr & MII_BMSR_100BX_HD)
- anar |= MII_ANAR_100BX_HD;
- if (bmsr & MII_BMSR_100BT4)
- anar |= MII_ANAR_100BT4;
- if (bmsr & MII_BMSR_10BT_FD)
- anar |= MII_ANAR_10BT_FD;
- if (bmsr & MII_BMSR_10BT_HD)
- anar |= MII_ANAR_10BT_HD;
- anar |= MII_ANAR_PAUSE | MII_ANAR_ASYMMETRIC;
- mii_write (dev, phy_addr, MII_ANAR, anar);
+ bmsr.image = mii_read (dev, phy_addr, MII_BMSR);
+ anar.image = mii_read (dev, phy_addr, MII_ANAR);
+ anar.bits.media_100BX_FD = bmsr.bits.media_100BX_FD;
+ anar.bits.media_100BX_HD = bmsr.bits.media_100BX_HD;
+ anar.bits.media_100BT4 = bmsr.bits.media_100BT4;
+ anar.bits.media_10BT_FD = bmsr.bits.media_10BT_FD;
+ anar.bits.media_10BT_HD = bmsr.bits.media_10BT_HD;
+ anar.bits.pause = 1;
+ anar.bits.asymmetric = 1;
+ mii_write (dev, phy_addr, MII_ANAR, anar.image);
/* Enable Auto crossover */
- pscr = mii_read (dev, phy_addr, MII_PHY_SCR);
- pscr |= 3 << 5; /* 11'b */
- mii_write (dev, phy_addr, MII_PHY_SCR, pscr);
+ pscr.image = mii_read (dev, phy_addr, MII_PHY_SCR);
+ pscr.bits.mdi_crossover_mode = 3; /* 11'b */
+ mii_write (dev, phy_addr, MII_PHY_SCR, pscr.image);
/* Soft reset PHY */
mii_write (dev, phy_addr, MII_BMCR, MII_BMCR_RESET);
- bmcr = MII_BMCR_AN_ENABLE | MII_BMCR_RESTART_AN | MII_BMCR_RESET;
- mii_write (dev, phy_addr, MII_BMCR, bmcr);
+ bmcr.image = 0;
+ bmcr.bits.an_enable = 1;
+ bmcr.bits.restart_an = 1;
+ bmcr.bits.reset = 1;
+ mii_write (dev, phy_addr, MII_BMCR, bmcr.image);
mdelay(1);
} else {
/* Force speed setting */
/* 1) Disable Auto crossover */
- pscr = mii_read (dev, phy_addr, MII_PHY_SCR);
- pscr &= ~(3 << 5);
- mii_write (dev, phy_addr, MII_PHY_SCR, pscr);
+ pscr.image = mii_read (dev, phy_addr, MII_PHY_SCR);
+ pscr.bits.mdi_crossover_mode = 0;
+ mii_write (dev, phy_addr, MII_PHY_SCR, pscr.image);
/* 2) PHY Reset */
- bmcr = mii_read (dev, phy_addr, MII_BMCR);
- bmcr |= MII_BMCR_RESET;
- mii_write (dev, phy_addr, MII_BMCR, bmcr);
+ bmcr.image = mii_read (dev, phy_addr, MII_BMCR);
+ bmcr.bits.reset = 1;
+ mii_write (dev, phy_addr, MII_BMCR, bmcr.image);
/* 3) Power Down */
- bmcr = 0x1940; /* must be 0x1940 */
- mii_write (dev, phy_addr, MII_BMCR, bmcr);
+ bmcr.image = 0x1940; /* must be 0x1940 */
+ mii_write (dev, phy_addr, MII_BMCR, bmcr.image);
mdelay (100); /* wait a certain time */
/* 4) Advertise nothing */
mii_write (dev, phy_addr, MII_ANAR, 0);
/* 5) Set media and Power Up */
- bmcr = MII_BMCR_POWER_DOWN;
+ bmcr.image = 0;
+ bmcr.bits.power_down = 1;
if (np->speed == 100) {
- bmcr |= MII_BMCR_SPEED_100;
+ bmcr.bits.speed100 = 1;
+ bmcr.bits.speed1000 = 0;
printk (KERN_INFO "Manual 100 Mbps, ");
} else if (np->speed == 10) {
+ bmcr.bits.speed100 = 0;
+ bmcr.bits.speed1000 = 0;
printk (KERN_INFO "Manual 10 Mbps, ");
}
if (np->full_duplex) {
- bmcr |= MII_BMCR_DUPLEX_MODE;
+ bmcr.bits.duplex_mode = 1;
printk ("Full duplex\n");
} else {
+ bmcr.bits.duplex_mode = 0;
printk ("Half duplex\n");
}
#if 0
/* Set 1000BaseT Master/Slave setting */
- mscr = mii_read (dev, phy_addr, MII_MSCR);
- mscr |= MII_MSCR_CFG_ENABLE;
- mscr &= ~MII_MSCR_CFG_VALUE = 0;
+ mscr.image = mii_read (dev, phy_addr, MII_MSCR);
+ mscr.bits.cfg_enable = 1;
+ mscr.bits.cfg_value = 0;
#endif
- mii_write (dev, phy_addr, MII_BMCR, bmcr);
+ mii_write (dev, phy_addr, MII_BMCR, bmcr.image);
mdelay(10);
}
return 0;
@@ -1631,42 +1624,43 @@ mii_set_media (struct net_device *dev)
static int
mii_get_media_pcs (struct net_device *dev)
{
- __u16 negotiate;
- __u16 bmsr;
+ ANAR_PCS_t negotiate;
+ BMSR_t bmsr;
+ BMCR_t bmcr;
int phy_addr;
struct netdev_private *np;
np = netdev_priv(dev);
phy_addr = np->phy_addr;
- bmsr = mii_read (dev, phy_addr, PCS_BMSR);
+ bmsr.image = mii_read (dev, phy_addr, PCS_BMSR);
if (np->an_enable) {
- if (!(bmsr & MII_BMSR_AN_COMPLETE)) {
+ if (!bmsr.bits.an_complete) {
/* Auto-Negotiation not completed */
return -1;
}
- negotiate = mii_read (dev, phy_addr, PCS_ANAR) &
+ negotiate.image = mii_read (dev, phy_addr, PCS_ANAR) &
mii_read (dev, phy_addr, PCS_ANLPAR);
np->speed = 1000;
- if (negotiate & PCS_ANAR_FULL_DUPLEX) {
+ if (negotiate.bits.full_duplex) {
printk (KERN_INFO "Auto 1000 Mbps, Full duplex\n");
np->full_duplex = 1;
} else {
printk (KERN_INFO "Auto 1000 Mbps, half duplex\n");
np->full_duplex = 0;
}
- if (negotiate & PCS_ANAR_PAUSE) {
+ if (negotiate.bits.pause) {
np->tx_flow &= 1;
np->rx_flow &= 1;
- } else if (negotiate & PCS_ANAR_ASYMMETRIC) {
+ } else if (negotiate.bits.asymmetric) {
np->tx_flow = 0;
np->rx_flow &= 1;
}
/* else tx_flow, rx_flow = user select */
} else {
- __u16 bmcr = mii_read (dev, phy_addr, PCS_BMCR);
+ bmcr.image = mii_read (dev, phy_addr, PCS_BMCR);
printk (KERN_INFO "Operating at 1000 Mbps, ");
- if (bmcr & MII_BMCR_DUPLEX_MODE) {
+ if (bmcr.bits.duplex_mode) {
printk ("Full duplex\n");
} else {
printk ("Half duplex\n");
@@ -1687,9 +1681,9 @@ mii_get_media_pcs (struct net_device *dev)
static int
mii_set_media_pcs (struct net_device *dev)
{
- __u16 bmcr;
- __u16 esr;
- __u16 anar;
+ BMCR_t bmcr;
+ ESR_t esr;
+ ANAR_PCS_t anar;
int phy_addr;
struct netdev_private *np;
np = netdev_priv(dev);
@@ -1698,37 +1692,41 @@ mii_set_media_pcs (struct net_device *dev)
/* Auto-Negotiation? */
if (np->an_enable) {
/* Advertise capabilities */
- esr = mii_read (dev, phy_addr, PCS_ESR);
- anar = mii_read (dev, phy_addr, MII_ANAR) &
- ~PCS_ANAR_HALF_DUPLEX &
- ~PCS_ANAR_FULL_DUPLEX;
- if (esr & (MII_ESR_1000BT_HD | MII_ESR_1000BX_HD))
- anar |= PCS_ANAR_HALF_DUPLEX;
- if (esr & (MII_ESR_1000BT_FD | MII_ESR_1000BX_FD))
- anar |= PCS_ANAR_FULL_DUPLEX;
- anar |= PCS_ANAR_PAUSE | PCS_ANAR_ASYMMETRIC;
- mii_write (dev, phy_addr, MII_ANAR, anar);
+ esr.image = mii_read (dev, phy_addr, PCS_ESR);
+ anar.image = mii_read (dev, phy_addr, MII_ANAR);
+ anar.bits.half_duplex =
+ esr.bits.media_1000BT_HD | esr.bits.media_1000BX_HD;
+ anar.bits.full_duplex =
+ esr.bits.media_1000BT_FD | esr.bits.media_1000BX_FD;
+ anar.bits.pause = 1;
+ anar.bits.asymmetric = 1;
+ mii_write (dev, phy_addr, MII_ANAR, anar.image);
/* Soft reset PHY */
mii_write (dev, phy_addr, MII_BMCR, MII_BMCR_RESET);
- bmcr = MII_BMCR_AN_ENABLE | MII_BMCR_RESTART_AN |
- MII_BMCR_RESET;
- mii_write (dev, phy_addr, MII_BMCR, bmcr);
+ bmcr.image = 0;
+ bmcr.bits.an_enable = 1;
+ bmcr.bits.restart_an = 1;
+ bmcr.bits.reset = 1;
+ mii_write (dev, phy_addr, MII_BMCR, bmcr.image);
mdelay(1);
} else {
/* Force speed setting */
/* PHY Reset */
- bmcr = MII_BMCR_RESET;
- mii_write (dev, phy_addr, MII_BMCR, bmcr);
+ bmcr.image = 0;
+ bmcr.bits.reset = 1;
+ mii_write (dev, phy_addr, MII_BMCR, bmcr.image);
mdelay(10);
+ bmcr.image = 0;
+ bmcr.bits.an_enable = 0;
if (np->full_duplex) {
- bmcr = MII_BMCR_DUPLEX_MODE;
+ bmcr.bits.duplex_mode = 1;
printk (KERN_INFO "Manual full duplex\n");
} else {
- bmcr = 0;
+ bmcr.bits.duplex_mode = 0;
printk (KERN_INFO "Manual half duplex\n");
}
- mii_write (dev, phy_addr, MII_BMCR, bmcr);
+ mii_write (dev, phy_addr, MII_BMCR, bmcr.image);
mdelay(10);
/* Advertise nothing */
@@ -1764,7 +1762,7 @@ rio_close (struct net_device *dev)
skb = np->rx_skbuff[i];
if (skb) {
pci_unmap_single(np->pdev,
- desc_to_dma(&np->rx_ring[i]),
+ np->rx_ring[i].fraginfo & DMA_48BIT_MASK,
skb->len, PCI_DMA_FROMDEVICE);
dev_kfree_skb (skb);
np->rx_skbuff[i] = NULL;
@@ -1774,7 +1772,7 @@ rio_close (struct net_device *dev)
skb = np->tx_skbuff[i];
if (skb) {
pci_unmap_single(np->pdev,
- desc_to_dma(&np->tx_ring[i]),
+ np->tx_ring[i].fraginfo & DMA_48BIT_MASK,
skb->len, PCI_DMA_TODEVICE);
dev_kfree_skb (skb);
np->tx_skbuff[i] = NULL;
diff --git a/trunk/drivers/net/dl2k.h b/trunk/drivers/net/dl2k.h
index d66c605b4075..5b801775f42d 100644
--- a/trunk/drivers/net/dl2k.h
+++ b/trunk/drivers/net/dl2k.h
@@ -298,6 +298,23 @@ enum _pcs_reg {
};
/* Basic Mode Control Register */
+typedef union t_MII_BMCR {
+ u16 image;
+ struct {
+ u16 _bit_5_0:6; // bit 5:0
+ u16 speed1000:1; // bit 6
+ u16 col_test_enable:1; // bit 7
+ u16 duplex_mode:1; // bit 8
+ u16 restart_an:1; // bit 9
+ u16 isolate:1; // bit 10
+ u16 power_down:1; // bit 11
+ u16 an_enable:1; // bit 12
+ u16 speed100:1; // bit 13
+ u16 loopback:1; // bit 14
+ u16 reset:1; // bit 15
+ } bits;
+} BMCR_t, *PBMCR_t;
+
enum _mii_bmcr {
MII_BMCR_RESET = 0x8000,
MII_BMCR_LOOP_BACK = 0x4000,
@@ -316,6 +333,28 @@ enum _mii_bmcr {
};
/* Basic Mode Status Register */
+typedef union t_MII_BMSR {
+ u16 image;
+ struct {
+ u16 ext_capability:1; // bit 0
+ u16 japper_detect:1; // bit 1
+ u16 link_status:1; // bit 2
+ u16 an_ability:1; // bit 3
+ u16 remote_fault:1; // bit 4
+ u16 an_complete:1; // bit 5
+ u16 preamble_supp:1; // bit 6
+ u16 _bit_7:1; // bit 7
+ u16 ext_status:1; // bit 8
+ u16 media_100BT2_HD:1; // bit 9
+ u16 media_100BT2_FD:1; // bit 10
+ u16 media_10BT_HD:1; // bit 11
+ u16 media_10BT_FD:1; // bit 12
+ u16 media_100BX_HD:1; // bit 13
+ u16 media_100BX_FD:1; // bit 14
+ u16 media_100BT4:1; // bit 15
+ } bits;
+} BMSR_t, *PBMSR_t;
+
enum _mii_bmsr {
MII_BMSR_100BT4 = 0x8000,
MII_BMSR_100BX_FD = 0x4000,
@@ -335,6 +374,24 @@ enum _mii_bmsr {
};
/* ANAR */
+typedef union t_MII_ANAR {
+ u16 image;
+ struct {
+ u16 selector:5; // bit 4:0
+ u16 media_10BT_HD:1; // bit 5
+ u16 media_10BT_FD:1; // bit 6
+ u16 media_100BX_HD:1; // bit 7
+ u16 media_100BX_FD:1; // bit 8
+ u16 media_100BT4:1; // bit 9
+ u16 pause:1; // bit 10
+ u16 asymmetric:1; // bit 11
+ u16 _bit12:1; // bit 12
+ u16 remote_fault:1; // bit 13
+ u16 _bit14:1; // bit 14
+ u16 next_page:1; // bit 15
+ } bits;
+} ANAR_t, *PANAR_t;
+
enum _mii_anar {
MII_ANAR_NEXT_PAGE = 0x8000,
MII_ANAR_REMOTE_FAULT = 0x4000,
@@ -350,6 +407,24 @@ enum _mii_anar {
};
/* ANLPAR */
+typedef union t_MII_ANLPAR {
+ u16 image;
+ struct {
+ u16 selector:5; // bit 4:0
+ u16 media_10BT_HD:1; // bit 5
+ u16 media_10BT_FD:1; // bit 6
+ u16 media_100BX_HD:1; // bit 7
+ u16 media_100BX_FD:1; // bit 8
+ u16 media_100BT4:1; // bit 9
+ u16 pause:1; // bit 10
+ u16 asymmetric:1; // bit 11
+ u16 _bit12:1; // bit 12
+ u16 remote_fault:1; // bit 13
+ u16 _bit14:1; // bit 14
+ u16 next_page:1; // bit 15
+ } bits;
+} ANLPAR_t, *PANLPAR_t;
+
enum _mii_anlpar {
MII_ANLPAR_NEXT_PAGE = MII_ANAR_NEXT_PAGE,
MII_ANLPAR_REMOTE_FAULT = MII_ANAR_REMOTE_FAULT,
@@ -364,6 +439,18 @@ enum _mii_anlpar {
};
/* Auto-Negotiation Expansion Register */
+typedef union t_MII_ANER {
+ u16 image;
+ struct {
+ u16 lp_negotiable:1; // bit 0
+ u16 page_received:1; // bit 1
+ u16 nextpagable:1; // bit 2
+ u16 lp_nextpagable:1; // bit 3
+ u16 pdetect_fault:1; // bit 4
+ u16 _bit15_5:11; // bit 15:5
+ } bits;
+} ANER_t, *PANER_t;
+
enum _mii_aner {
MII_ANER_PAR_DETECT_FAULT = 0x0010,
MII_ANER_LP_NEXTPAGABLE = 0x0008,
@@ -373,6 +460,19 @@ enum _mii_aner {
};
/* MASTER-SLAVE Control Register */
+typedef union t_MII_MSCR {
+ u16 image;
+ struct {
+ u16 _bit_7_0:8; // bit 7:0
+ u16 media_1000BT_HD:1; // bit 8
+ u16 media_1000BT_FD:1; // bit 9
+ u16 port_type:1; // bit 10
+ u16 cfg_value:1; // bit 11
+ u16 cfg_enable:1; // bit 12
+ u16 test_mode:3; // bit 15:13
+ } bits;
+} MSCR_t, *PMSCR_t;
+
enum _mii_mscr {
MII_MSCR_TEST_MODE = 0xe000,
MII_MSCR_CFG_ENABLE = 0x1000,
@@ -383,6 +483,20 @@ enum _mii_mscr {
};
/* MASTER-SLAVE Status Register */
+typedef union t_MII_MSSR {
+ u16 image;
+ struct {
+ u16 idle_err_count:8; // bit 7:0
+ u16 _bit_9_8:2; // bit 9:8
+ u16 lp_1000BT_HD:1; // bit 10
+ u16 lp_1000BT_FD:1; // bit 11
+ u16 remote_rcv_status:1; // bit 12
+ u16 local_rcv_status:1; // bit 13
+ u16 cfg_resolution:1; // bit 14
+ u16 cfg_fault:1; // bit 15
+ } bits;
+} MSSR_t, *PMSSR_t;
+
enum _mii_mssr {
MII_MSSR_CFG_FAULT = 0x8000,
MII_MSSR_CFG_RES = 0x4000,
@@ -394,6 +508,17 @@ enum _mii_mssr {
};
/* IEEE Extened Status Register */
+typedef union t_MII_ESR {
+ u16 image;
+ struct {
+ u16 _bit_11_0:12; // bit 11:0
+ u16 media_1000BT_HD:2; // bit 12
+ u16 media_1000BT_FD:1; // bit 13
+ u16 media_1000BX_HD:1; // bit 14
+ u16 media_1000BX_FD:1; // bit 15
+ } bits;
+} ESR_t, *PESR_t;
+
enum _mii_esr {
MII_ESR_1000BX_FD = 0x8000,
MII_ESR_1000BX_HD = 0x4000,
@@ -401,7 +526,6 @@ enum _mii_esr {
MII_ESR_1000BT_HD = 0x1000,
};
/* PHY Specific Control Register */
-#if 0
typedef union t_MII_PHY_SCR {
u16 image;
struct {
@@ -419,7 +543,6 @@ typedef union t_MII_PHY_SCR {
u16 xmit_fifo_depth:2; // bit 15:14
} bits;
} PHY_SCR_t, *PPHY_SCR_t;
-#endif
typedef enum t_MII_ADMIN_STATUS {
adm_reset,
@@ -433,6 +556,21 @@ typedef enum t_MII_ADMIN_STATUS {
/* PCS control and status registers bitmap as the same as MII */
/* PCS Extended Status register bitmap as the same as MII */
/* PCS ANAR */
+typedef union t_PCS_ANAR {
+ u16 image;
+ struct {
+ u16 _bit_4_0:5; // bit 4:0
+ u16 full_duplex:1; // bit 5
+ u16 half_duplex:1; // bit 6
+ u16 asymmetric:1; // bit 7
+ u16 pause:1; // bit 8
+ u16 _bit_11_9:3; // bit 11:9
+ u16 remote_fault:2; // bit 13:12
+ u16 _bit_14:1; // bit 14
+ u16 next_page:1; // bit 15
+ } bits;
+} ANAR_PCS_t, *PANAR_PCS_t;
+
enum _pcs_anar {
PCS_ANAR_NEXT_PAGE = 0x8000,
PCS_ANAR_REMOTE_FAULT = 0x3000,
@@ -442,6 +580,21 @@ enum _pcs_anar {
PCS_ANAR_FULL_DUPLEX = 0x0020,
};
/* PCS ANLPAR */
+typedef union t_PCS_ANLPAR {
+ u16 image;
+ struct {
+ u16 _bit_4_0:5; // bit 4:0
+ u16 full_duplex:1; // bit 5
+ u16 half_duplex:1; // bit 6
+ u16 asymmetric:1; // bit 7
+ u16 pause:1; // bit 8
+ u16 _bit_11_9:3; // bit 11:9
+ u16 remote_fault:2; // bit 13:12
+ u16 _bit_14:1; // bit 14
+ u16 next_page:1; // bit 15
+ } bits;
+} ANLPAR_PCS_t, *PANLPAR_PCS_t;
+
enum _pcs_anlpar {
PCS_ANLPAR_NEXT_PAGE = PCS_ANAR_NEXT_PAGE,
PCS_ANLPAR_REMOTE_FAULT = PCS_ANAR_REMOTE_FAULT,
@@ -480,9 +633,9 @@ struct mii_data {
/* The Rx and Tx buffer descriptors. */
struct netdev_desc {
- __le64 next_desc;
- __le64 status;
- __le64 fraginfo;
+ u64 next_desc;
+ u64 status;
+ u64 fraginfo;
};
#define PRIV_ALIGN 15 /* Required alignment mask */
diff --git a/trunk/drivers/net/e100.c b/trunk/drivers/net/e100.c
index b87402bc8308..2b06e4b4dabc 100644
--- a/trunk/drivers/net/e100.c
+++ b/trunk/drivers/net/e100.c
@@ -1991,12 +1991,13 @@ static int e100_poll(struct napi_struct *napi, int budget)
struct nic *nic = container_of(napi, struct nic, napi);
struct net_device *netdev = nic->netdev;
unsigned int work_done = 0;
+ int tx_cleaned;
e100_rx_clean(nic, &work_done, budget);
- e100_tx_clean(nic);
+ tx_cleaned = e100_tx_clean(nic);
- /* If budget not fully consumed, exit the polling mode */
- if (work_done < budget) {
+ /* If no Rx and Tx cleanup work was done, exit polling mode. */
+ if((!tx_cleaned && (work_done == 0)) || !netif_running(netdev)) {
netif_rx_complete(netdev, napi);
e100_enable_irq(nic);
}
diff --git a/trunk/drivers/net/e1000/e1000_main.c b/trunk/drivers/net/e1000/e1000_main.c
index 76c0fa690cc6..4f37506ad374 100644
--- a/trunk/drivers/net/e1000/e1000_main.c
+++ b/trunk/drivers/net/e1000/e1000_main.c
@@ -632,7 +632,6 @@ e1000_down(struct e1000_adapter *adapter)
#ifdef CONFIG_E1000_NAPI
napi_disable(&adapter->napi);
- atomic_set(&adapter->irq_sem, 0);
#endif
e1000_irq_disable(adapter);
@@ -3925,24 +3924,27 @@ e1000_clean(struct napi_struct *napi, int budget)
/* Must NOT use netdev_priv macro here. */
adapter = poll_dev->priv;
+ /* Keep link state information with original netdev */
+ if (!netif_carrier_ok(poll_dev))
+ goto quit_polling;
+
/* e1000_clean is called per-cpu. This lock protects
* tx_ring[0] from being cleaned by multiple cpus
* simultaneously. A failure obtaining the lock means
* tx_ring[0] is currently being cleaned anyway. */
if (spin_trylock(&adapter->tx_queue_lock)) {
tx_cleaned = e1000_clean_tx_irq(adapter,
- &adapter->tx_ring[0]);
+ &adapter->tx_ring[0]);
spin_unlock(&adapter->tx_queue_lock);
}
adapter->clean_rx(adapter, &adapter->rx_ring[0],
&work_done, budget);
- if (tx_cleaned)
- work_done = budget;
-
- /* If budget not fully consumed, exit the polling mode */
- if (work_done < budget) {
+ /* If no Tx and not enough Rx work done, exit the polling mode */
+ if ((!tx_cleaned && (work_done == 0)) ||
+ !netif_running(poll_dev)) {
+quit_polling:
if (likely(adapter->itr_setting & 3))
e1000_set_itr(adapter);
netif_rx_complete(poll_dev, napi);
diff --git a/trunk/drivers/net/e1000e/netdev.c b/trunk/drivers/net/e1000e/netdev.c
index 9cc5a6b01bc1..4fd2e23720b6 100644
--- a/trunk/drivers/net/e1000e/netdev.c
+++ b/trunk/drivers/net/e1000e/netdev.c
@@ -1389,6 +1389,10 @@ static int e1000_clean(struct napi_struct *napi, int budget)
/* Must NOT use netdev_priv macro here. */
adapter = poll_dev->priv;
+ /* Keep link state information with original netdev */
+ if (!netif_carrier_ok(poll_dev))
+ goto quit_polling;
+
/* e1000_clean is called per-cpu. This lock protects
* tx_ring from being cleaned by multiple cpus
* simultaneously. A failure obtaining the lock means
@@ -1400,11 +1404,10 @@ static int e1000_clean(struct napi_struct *napi, int budget)
adapter->clean_rx(adapter, &work_done, budget);
- if (tx_cleaned)
- work_done = budget;
-
- /* If budget not fully consumed, exit the polling mode */
- if (work_done < budget) {
+ /* If no Tx and not enough Rx work done, exit the polling mode */
+ if ((!tx_cleaned && (work_done < budget)) ||
+ !netif_running(poll_dev)) {
+quit_polling:
if (adapter->itr_setting & 3)
e1000_set_itr(adapter);
netif_rx_complete(poll_dev, napi);
@@ -2183,7 +2186,6 @@ void e1000e_down(struct e1000_adapter *adapter)
msleep(10);
napi_disable(&adapter->napi);
- atomic_set(&adapter->irq_sem, 0);
e1000_irq_disable(adapter);
del_timer_sync(&adapter->watchdog_timer);
diff --git a/trunk/drivers/net/epic100.c b/trunk/drivers/net/epic100.c
index 0b365b8d947b..ecdd3fc8d70c 100644
--- a/trunk/drivers/net/epic100.c
+++ b/trunk/drivers/net/epic100.c
@@ -1273,7 +1273,7 @@ static int epic_poll(struct napi_struct *napi, int budget)
epic_rx_err(dev, ep);
- if (work_done < budget) {
+ if (netif_running(dev) && (work_done < budget)) {
unsigned long flags;
int more;
diff --git a/trunk/drivers/net/fec_8xx/fec_main.c b/trunk/drivers/net/fec_8xx/fec_main.c
index ab9637ab3a8d..8d2904fa5789 100644
--- a/trunk/drivers/net/fec_8xx/fec_main.c
+++ b/trunk/drivers/net/fec_8xx/fec_main.c
@@ -476,6 +476,11 @@ static int fec_enet_rx_common(struct fec_enet_private *ep,
__u16 pkt_len, sc;
int curidx;
+ if (fpi->use_napi) {
+ if (!netif_running(dev))
+ return 0;
+ }
+
/*
* First, grab all of the stats for the incoming packet.
* These get messed up if we get called due to a busy condition.
diff --git a/trunk/drivers/net/fec_mpc52xx.c b/trunk/drivers/net/fec_mpc52xx.c
index f91ee700e605..79f7eade4773 100644
--- a/trunk/drivers/net/fec_mpc52xx.c
+++ b/trunk/drivers/net/fec_mpc52xx.c
@@ -568,9 +568,8 @@ static void mpc52xx_fec_reset_stats(struct net_device *dev)
struct mpc52xx_fec __iomem *fec = priv->fec;
out_be32(&fec->mib_control, FEC_MIB_DISABLE);
- memset_io(&fec->rmon_t_drop, 0,
- offsetof(struct mpc52xx_fec, reserved10) -
- offsetof(struct mpc52xx_fec, rmon_t_drop));
+ memset_io(&fec->rmon_t_drop, 0, (__force u32)&fec->reserved10 -
+ (__force u32)&fec->rmon_t_drop);
out_be32(&fec->mib_control, 0);
memset(&dev->stats, 0, sizeof(dev->stats));
diff --git a/trunk/drivers/net/forcedeth.c b/trunk/drivers/net/forcedeth.c
index f84c752997a4..a96583cceb5e 100644
--- a/trunk/drivers/net/forcedeth.c
+++ b/trunk/drivers/net/forcedeth.c
@@ -5199,6 +5199,10 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
dev->dev_addr[3] = (np->orig_mac[0] >> 16) & 0xff;
dev->dev_addr[4] = (np->orig_mac[0] >> 8) & 0xff;
dev->dev_addr[5] = (np->orig_mac[0] >> 0) & 0xff;
+ /* set permanent address to be correct aswell */
+ np->orig_mac[0] = (dev->dev_addr[0] << 0) + (dev->dev_addr[1] << 8) +
+ (dev->dev_addr[2] << 16) + (dev->dev_addr[3] << 24);
+ np->orig_mac[1] = (dev->dev_addr[4] << 0) + (dev->dev_addr[5] << 8);
writel(txreg|NVREG_TRANSMITPOLL_MAC_ADDR_REV, base + NvRegTransmitPoll);
}
memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
@@ -5410,8 +5414,6 @@ static void __devexit nv_remove(struct pci_dev *pci_dev)
*/
writel(np->orig_mac[0], base + NvRegMacAddrA);
writel(np->orig_mac[1], base + NvRegMacAddrB);
- writel(readl(base + NvRegTransmitPoll) & ~NVREG_TRANSMITPOLL_MAC_ADDR_REV,
- base + NvRegTransmitPoll);
/* free all structures */
free_rings(dev);
diff --git a/trunk/drivers/net/fs_enet/fs_enet-main.c b/trunk/drivers/net/fs_enet/fs_enet-main.c
index c83bd6560088..f2a4d399a6e5 100644
--- a/trunk/drivers/net/fs_enet/fs_enet-main.c
+++ b/trunk/drivers/net/fs_enet/fs_enet-main.c
@@ -96,6 +96,9 @@ static int fs_enet_rx_napi(struct napi_struct *napi, int budget)
u16 pkt_len, sc;
int curidx;
+ if (!netif_running(dev))
+ return 0;
+
/*
* First, grab all of the stats for the incoming packet.
* These get messed up if we get called due to a busy condition.
@@ -894,21 +897,14 @@ static void fs_get_regs(struct net_device *dev, struct ethtool_regs *regs,
static int fs_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
{
struct fs_enet_private *fep = netdev_priv(dev);
-
- if (!fep->phydev)
- return -ENODEV;
-
return phy_ethtool_gset(fep->phydev, cmd);
}
static int fs_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
{
struct fs_enet_private *fep = netdev_priv(dev);
-
- if (!fep->phydev)
- return -ENODEV;
-
- return phy_ethtool_sset(fep->phydev, cmd);
+ phy_ethtool_sset(fep->phydev, cmd);
+ return 0;
}
static int fs_nway_reset(struct net_device *dev)
diff --git a/trunk/drivers/net/ipg.c b/trunk/drivers/net/ipg.c
index 50f0c17451b1..dbd23bb65d1e 100644
--- a/trunk/drivers/net/ipg.c
+++ b/trunk/drivers/net/ipg.c
@@ -857,14 +857,21 @@ static void init_tfdlist(struct net_device *dev)
static void ipg_nic_txfree(struct net_device *dev)
{
struct ipg_nic_private *sp = netdev_priv(dev);
- unsigned int released, pending, dirty;
+ void __iomem *ioaddr = sp->ioaddr;
+ unsigned int curr;
+ u64 txd_map;
+ unsigned int released, pending;
+
+ txd_map = (u64)sp->txd_map;
+ curr = ipg_r32(TFD_LIST_PTR_0) -
+ do_div(txd_map, sizeof(struct ipg_tx)) - 1;
IPG_DEBUG_MSG("_nic_txfree\n");
pending = sp->tx_current - sp->tx_dirty;
- dirty = sp->tx_dirty % IPG_TFDLIST_LENGTH;
for (released = 0; released < pending; released++) {
+ unsigned int dirty = sp->tx_dirty % IPG_TFDLIST_LENGTH;
struct sk_buff *skb = sp->TxBuff[dirty];
struct ipg_tx *txfd = sp->txd + dirty;
@@ -875,8 +882,11 @@ static void ipg_nic_txfree(struct net_device *dev)
* If the TFDDone bit is set, free the associated
* buffer.
*/
- if (!(txfd->tfc & cpu_to_le64(IPG_TFC_TFDDONE)))
- break;
+ if (dirty == curr)
+ break;
+
+ /* Setup TFDDONE for compatible issue. */
+ txfd->tfc |= cpu_to_le64(IPG_TFC_TFDDONE);
/* Free the transmit buffer. */
if (skb) {
@@ -888,7 +898,6 @@ static void ipg_nic_txfree(struct net_device *dev)
sp->TxBuff[dirty] = NULL;
}
- dirty = (dirty + 1) % IPG_TFDLIST_LENGTH;
}
sp->tx_dirty += released;
@@ -1621,8 +1630,6 @@ static irqreturn_t ipg_interrupt_handler(int irq, void *dev_inst)
#ifdef JUMBO_FRAME
ipg_nic_rxrestore(dev);
#endif
- spin_lock(&sp->lock);
-
/* Get interrupt source information, and acknowledge
* some (i.e. TxDMAComplete, RxDMAComplete, RxEarly,
* IntRequested, MacControlFrame, LinkEvent) interrupts
@@ -1640,7 +1647,9 @@ static irqreturn_t ipg_interrupt_handler(int irq, void *dev_inst)
handled = 1;
if (unlikely(!netif_running(dev)))
- goto out_unlock;
+ goto out;
+
+ spin_lock(&sp->lock);
/* If RFDListEnd interrupt, restore all used RFDs. */
if (status & IPG_IS_RFD_LIST_END) {
@@ -1724,9 +1733,9 @@ static irqreturn_t ipg_interrupt_handler(int irq, void *dev_inst)
ipg_w16(IPG_IE_TX_DMA_COMPLETE | IPG_IE_RX_DMA_COMPLETE |
IPG_IE_HOST_ERROR | IPG_IE_INT_REQUESTED | IPG_IE_TX_COMPLETE |
IPG_IE_LINK_EVENT | IPG_IE_UPDATE_STATS, INT_ENABLE);
-out_unlock:
- spin_unlock(&sp->lock);
+ spin_unlock(&sp->lock);
+out:
return IRQ_RETVAL(handled);
}
@@ -1934,7 +1943,10 @@ static int ipg_nic_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
*/
if (sp->tenmbpsmode)
txfd->tfc |= cpu_to_le64(IPG_TFC_TXINDICATE);
- txfd->tfc |= cpu_to_le64(IPG_TFC_TXDMAINDICATE);
+ else if (!((sp->tx_current - sp->tx_dirty + 1) >
+ IPG_FRAMESBETWEENTXDMACOMPLETES)) {
+ txfd->tfc |= cpu_to_le64(IPG_TFC_TXDMAINDICATE);
+ }
/* Based on compilation option, determine if FCS is to be
* appended to transmit frame by IPG.
*/
@@ -1991,7 +2003,7 @@ static int ipg_nic_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
ipg_w32(IPG_DC_TX_DMA_POLL_NOW, DMA_CTRL);
if (sp->tx_current == (sp->tx_dirty + IPG_TFDLIST_LENGTH))
- netif_stop_queue(dev);
+ netif_wake_queue(dev);
spin_unlock_irqrestore(&sp->lock, flags);
diff --git a/trunk/drivers/net/ixgb/ixgb_main.c b/trunk/drivers/net/ixgb/ixgb_main.c
index 4f63839051b0..bf9085fe035a 100644
--- a/trunk/drivers/net/ixgb/ixgb_main.c
+++ b/trunk/drivers/net/ixgb/ixgb_main.c
@@ -296,11 +296,6 @@ ixgb_down(struct ixgb_adapter *adapter, boolean_t kill_watchdog)
{
struct net_device *netdev = adapter->netdev;
-#ifdef CONFIG_IXGB_NAPI
- napi_disable(&adapter->napi);
- atomic_set(&adapter->irq_sem, 0);
-#endif
-
ixgb_irq_disable(adapter);
free_irq(adapter->pdev->irq, netdev);
@@ -309,7 +304,9 @@ ixgb_down(struct ixgb_adapter *adapter, boolean_t kill_watchdog)
if(kill_watchdog)
del_timer_sync(&adapter->watchdog_timer);
-
+#ifdef CONFIG_IXGB_NAPI
+ napi_disable(&adapter->napi);
+#endif
adapter->link_speed = 0;
adapter->link_duplex = 0;
netif_carrier_off(netdev);
@@ -1790,13 +1787,14 @@ ixgb_clean(struct napi_struct *napi, int budget)
{
struct ixgb_adapter *adapter = container_of(napi, struct ixgb_adapter, napi);
struct net_device *netdev = adapter->netdev;
+ int tx_cleaned;
int work_done = 0;
- ixgb_clean_tx_irq(adapter);
+ tx_cleaned = ixgb_clean_tx_irq(adapter);
ixgb_clean_rx_irq(adapter, &work_done, budget);
- /* If budget not fully consumed, exit the polling mode */
- if (work_done < budget) {
+ /* if no Tx and not enough Rx work done, exit the polling mode */
+ if((!tx_cleaned && (work_done == 0)) || !netif_running(netdev)) {
netif_rx_complete(netdev, napi);
ixgb_irq_enable(adapter);
}
diff --git a/trunk/drivers/net/ixgbe/ixgbe_main.c b/trunk/drivers/net/ixgbe/ixgbe_main.c
index a4265bc1cebb..00bc525c6560 100644
--- a/trunk/drivers/net/ixgbe/ixgbe_main.c
+++ b/trunk/drivers/net/ixgbe/ixgbe_main.c
@@ -1409,11 +1409,9 @@ void ixgbe_down(struct ixgbe_adapter *adapter)
IXGBE_WRITE_FLUSH(&adapter->hw);
msleep(10);
- napi_disable(&adapter->napi);
- atomic_set(&adapter->irq_sem, 0);
-
ixgbe_irq_disable(adapter);
+ napi_disable(&adapter->napi);
del_timer_sync(&adapter->watchdog_timer);
netif_carrier_off(netdev);
@@ -1472,16 +1470,19 @@ static int ixgbe_clean(struct napi_struct *napi, int budget)
struct net_device *netdev = adapter->netdev;
int tx_cleaned = 0, work_done = 0;
+ /* Keep link state information with original netdev */
+ if (!netif_carrier_ok(adapter->netdev))
+ goto quit_polling;
+
/* In non-MSIX case, there is no multi-Tx/Rx queue */
tx_cleaned = ixgbe_clean_tx_irq(adapter, adapter->tx_ring);
ixgbe_clean_rx_irq(adapter, &adapter->rx_ring[0], &work_done,
budget);
- if (tx_cleaned)
- work_done = budget;
-
- /* If budget not fully consumed, exit the polling mode */
- if (work_done < budget) {
+ /* If no Tx and not enough Rx work done, exit the polling mode */
+ if ((!tx_cleaned && (work_done < budget)) ||
+ !netif_running(adapter->netdev)) {
+quit_polling:
netif_rx_complete(netdev, napi);
ixgbe_irq_enable(adapter);
}
diff --git a/trunk/drivers/net/ixp2000/ixpdev.c b/trunk/drivers/net/ixp2000/ixpdev.c
index 484cb2ba717f..6c0dd49149d0 100644
--- a/trunk/drivers/net/ixp2000/ixpdev.c
+++ b/trunk/drivers/net/ixp2000/ixpdev.c
@@ -135,6 +135,8 @@ static int ixpdev_poll(struct napi_struct *napi, int budget)
struct net_device *dev = ip->dev;
int rx;
+ /* @@@ Have to stop polling when nds[0] is administratively
+ * downed while we are polling. */
rx = 0;
do {
ixp2000_reg_write(IXP2000_IRQ_THD_RAW_STATUS_A_0, 0x00ff);
diff --git a/trunk/drivers/net/loopback.c b/trunk/drivers/net/loopback.c
index fa147cd5d68c..662b8d16803c 100644
--- a/trunk/drivers/net/loopback.c
+++ b/trunk/drivers/net/loopback.c
@@ -242,7 +242,7 @@ static void loopback_setup(struct net_device *dev)
| NETIF_F_NO_CSUM
| NETIF_F_HIGHDMA
| NETIF_F_LLTX
- | NETIF_F_NETNS_LOCAL;
+ | NETIF_F_NETNS_LOCAL,
dev->ethtool_ops = &loopback_ethtool_ops;
dev->header_ops = ð_header_ops;
dev->init = loopback_dev_init;
diff --git a/trunk/drivers/net/macb.c b/trunk/drivers/net/macb.c
index e10528ed9081..047ea7be4850 100644
--- a/trunk/drivers/net/macb.c
+++ b/trunk/drivers/net/macb.c
@@ -307,31 +307,8 @@ static void macb_tx(struct macb *bp)
(unsigned long)status);
if (status & MACB_BIT(UND)) {
- int i;
printk(KERN_ERR "%s: TX underrun, resetting buffers\n",
- bp->dev->name);
-
- head = bp->tx_head;
-
- /*Mark all the buffer as used to avoid sending a lost buffer*/
- for (i = 0; i < TX_RING_SIZE; i++)
- bp->tx_ring[i].ctrl = MACB_BIT(TX_USED);
-
- /* free transmit buffer in upper layer*/
- for (tail = bp->tx_tail; tail != head; tail = NEXT_TX(tail)) {
- struct ring_info *rp = &bp->tx_skb[tail];
- struct sk_buff *skb = rp->skb;
-
- BUG_ON(skb == NULL);
-
- rmb();
-
- dma_unmap_single(&bp->pdev->dev, rp->mapping, skb->len,
- DMA_TO_DEVICE);
- rp->skb = NULL;
- dev_kfree_skb_irq(skb);
- }
-
+ bp->dev->name);
bp->tx_head = bp->tx_tail = 0;
}
diff --git a/trunk/drivers/net/macvlan.c b/trunk/drivers/net/macvlan.c
index e8dc2f44fec9..2e4bcd5654c4 100644
--- a/trunk/drivers/net/macvlan.c
+++ b/trunk/drivers/net/macvlan.c
@@ -384,13 +384,6 @@ static int macvlan_newlink(struct net_device *dev,
if (lowerdev == NULL)
return -ENODEV;
- /* Don't allow macvlans on top of other macvlans - its not really
- * wrong, but lockdep can't handle it and its not useful for anything
- * you couldn't do directly on top of the real device.
- */
- if (lowerdev->rtnl_link_ops == dev->rtnl_link_ops)
- return -ENODEV;
-
if (!tb[IFLA_MTU])
dev->mtu = lowerdev->mtu;
else if (dev->mtu > lowerdev->mtu)
diff --git a/trunk/drivers/net/meth.c b/trunk/drivers/net/meth.c
index cdaa8fc21809..0c89b028a80c 100644
--- a/trunk/drivers/net/meth.c
+++ b/trunk/drivers/net/meth.c
@@ -95,14 +95,11 @@ static inline void load_eaddr(struct net_device *dev)
{
int i;
DECLARE_MAC_BUF(mac);
- u64 macaddr;
- DPRINTK("Loading MAC Address: %s\n", print_mac(mac, dev->dev_addr));
- macaddr = 0;
for (i = 0; i < 6; i++)
- macaddr |= dev->dev_addr[i] << ((5 - i) * 8);
-
- mace->eth.mac_addr = macaddr;
+ dev->dev_addr[i] = o2meth_eaddr[i];
+ DPRINTK("Loading MAC Address: %s\n", print_mac(mac, dev->dev_addr));
+ mace->eth.mac_addr = (*(unsigned long*)o2meth_eaddr) >> 16;
}
/*
@@ -797,7 +794,6 @@ static int __init meth_probe(struct platform_device *pdev)
#endif
dev->irq = MACE_ETHERNET_IRQ;
dev->base_addr = (unsigned long)&mace->eth;
- memcpy(dev->dev_addr, o2meth_eaddr, 6);
priv = netdev_priv(dev);
spin_lock_init(&priv->meth_lock);
diff --git a/trunk/drivers/net/myri10ge/myri10ge.c b/trunk/drivers/net/myri10ge/myri10ge.c
index c90958f6d3fe..8def8657251f 100644
--- a/trunk/drivers/net/myri10ge/myri10ge.c
+++ b/trunk/drivers/net/myri10ge/myri10ge.c
@@ -1239,7 +1239,7 @@ static int myri10ge_poll(struct napi_struct *napi, int budget)
/* process as many rx events as NAPI will allow */
work_done = myri10ge_clean_rx_done(mgp, budget);
- if (work_done < budget) {
+ if (work_done < budget || !netif_running(netdev)) {
netif_rx_complete(netdev, napi);
put_be32(htonl(3), mgp->irq_claim);
}
diff --git a/trunk/drivers/net/natsemi.c b/trunk/drivers/net/natsemi.c
index c329a4f5840c..87cde062fd63 100644
--- a/trunk/drivers/net/natsemi.c
+++ b/trunk/drivers/net/natsemi.c
@@ -2266,7 +2266,7 @@ static int natsemi_poll(struct napi_struct *napi, int budget)
/* Reenable interrupts providing nothing is trying to shut
* the chip down. */
spin_lock(&np->lock);
- if (!np->hands_off)
+ if (!np->hands_off && netif_running(dev))
natsemi_irq_enable(dev);
spin_unlock(&np->lock);
diff --git a/trunk/drivers/net/netx-eth.c b/trunk/drivers/net/netx-eth.c
index 78d34af13a1c..5267e031daa0 100644
--- a/trunk/drivers/net/netx-eth.c
+++ b/trunk/drivers/net/netx-eth.c
@@ -169,8 +169,8 @@ static void netx_eth_receive(struct net_device *ndev)
ndev->last_rx = jiffies;
skb->protocol = eth_type_trans(skb, ndev);
netif_rx(skb);
- ndev->stats.rx_packets++;
- ndev->stats.rx_bytes += len;
+ dev->stats.rx_packets++;
+ dev->stats.rx_bytes += len;
}
static irqreturn_t
diff --git a/trunk/drivers/net/netxen/netxen_nic.h b/trunk/drivers/net/netxen/netxen_nic.h
index a8f63c47b3cd..fbc2553275dc 100644
--- a/trunk/drivers/net/netxen/netxen_nic.h
+++ b/trunk/drivers/net/netxen/netxen_nic.h
@@ -65,8 +65,8 @@
#define _NETXEN_NIC_LINUX_MAJOR 3
#define _NETXEN_NIC_LINUX_MINOR 4
-#define _NETXEN_NIC_LINUX_SUBVERSION 18
-#define NETXEN_NIC_LINUX_VERSIONID "3.4.18"
+#define _NETXEN_NIC_LINUX_SUBVERSION 2
+#define NETXEN_NIC_LINUX_VERSIONID "3.4.2"
#define NETXEN_NUM_FLASH_SECTORS (64)
#define NETXEN_FLASH_SECTOR_SIZE (64 * 1024)
@@ -309,26 +309,23 @@ struct netxen_ring_ctx {
((cmd_desc)->port_ctxid |= ((var) & 0xF0))
#define netxen_set_cmd_desc_flags(cmd_desc, val) \
- (cmd_desc)->flags_opcode = ((cmd_desc)->flags_opcode & \
- ~cpu_to_le16(0x7f)) | cpu_to_le16((val) & 0x7f)
+ ((cmd_desc)->flags_opcode &= ~cpu_to_le16(0x7f), \
+ (cmd_desc)->flags_opcode |= cpu_to_le16((val) & 0x7f))
#define netxen_set_cmd_desc_opcode(cmd_desc, val) \
- (cmd_desc)->flags_opcode = ((cmd_desc)->flags_opcode & \
- ~cpu_to_le16((u16)0x3f << 7)) | cpu_to_le16(((val) & 0x3f) << 7)
+ ((cmd_desc)->flags_opcode &= ~cpu_to_le16(0x3f<<7), \
+ (cmd_desc)->flags_opcode |= cpu_to_le16(((val & 0x3f)<<7)))
#define netxen_set_cmd_desc_num_of_buff(cmd_desc, val) \
- (cmd_desc)->num_of_buffers_total_length = \
- ((cmd_desc)->num_of_buffers_total_length & \
- ~cpu_to_le32(0xff)) | cpu_to_le32((val) & 0xff)
+ ((cmd_desc)->num_of_buffers_total_length &= ~cpu_to_le32(0xff), \
+ (cmd_desc)->num_of_buffers_total_length |= cpu_to_le32((val) & 0xff))
#define netxen_set_cmd_desc_totallength(cmd_desc, val) \
- (cmd_desc)->num_of_buffers_total_length = \
- ((cmd_desc)->num_of_buffers_total_length & \
- ~cpu_to_le32((u32)0xffffff << 8)) | \
- cpu_to_le32(((val) & 0xffffff) << 8)
+ ((cmd_desc)->num_of_buffers_total_length &= ~cpu_to_le32(0xffffff00), \
+ (cmd_desc)->num_of_buffers_total_length |= cpu_to_le32(val << 8))
#define netxen_get_cmd_desc_opcode(cmd_desc) \
- ((le16_to_cpu((cmd_desc)->flags_opcode) >> 7) & 0x003f)
+ ((le16_to_cpu((cmd_desc)->flags_opcode) >> 7) & 0x003F)
#define netxen_get_cmd_desc_totallength(cmd_desc) \
- ((le32_to_cpu((cmd_desc)->num_of_buffers_total_length) >> 8) & 0xffffff)
+ (le32_to_cpu((cmd_desc)->num_of_buffers_total_length) >> 8)
struct cmd_desc_type0 {
u8 tcp_hdr_offset; /* For LSO only */
@@ -415,29 +412,29 @@ struct rcv_desc {
#define netxen_get_sts_desc_lro_last_frag(status_desc) \
(((status_desc)->lro & 0x80) >> 7)
-#define netxen_get_sts_port(sts_data) \
- ((sts_data) & 0x0F)
-#define netxen_get_sts_status(sts_data) \
- (((sts_data) >> 4) & 0x0F)
-#define netxen_get_sts_type(sts_data) \
- (((sts_data) >> 8) & 0x0F)
-#define netxen_get_sts_totallength(sts_data) \
- (((sts_data) >> 12) & 0xFFFF)
-#define netxen_get_sts_refhandle(sts_data) \
- (((sts_data) >> 28) & 0xFFFF)
-#define netxen_get_sts_prot(sts_data) \
- (((sts_data) >> 44) & 0x0F)
-#define netxen_get_sts_opcode(sts_data) \
- (((sts_data) >> 58) & 0x03F)
-
+#define netxen_get_sts_port(status_desc) \
+ (le64_to_cpu((status_desc)->status_desc_data) & 0x0F)
+#define netxen_get_sts_status(status_desc) \
+ ((le64_to_cpu((status_desc)->status_desc_data) >> 4) & 0x0F)
+#define netxen_get_sts_type(status_desc) \
+ ((le64_to_cpu((status_desc)->status_desc_data) >> 8) & 0x0F)
+#define netxen_get_sts_totallength(status_desc) \
+ ((le64_to_cpu((status_desc)->status_desc_data) >> 12) & 0xFFFF)
+#define netxen_get_sts_refhandle(status_desc) \
+ ((le64_to_cpu((status_desc)->status_desc_data) >> 28) & 0xFFFF)
+#define netxen_get_sts_prot(status_desc) \
+ ((le64_to_cpu((status_desc)->status_desc_data) >> 44) & 0x0F)
#define netxen_get_sts_owner(status_desc) \
((le64_to_cpu((status_desc)->status_desc_data) >> 56) & 0x03)
-#define netxen_set_sts_owner(status_desc, val) { \
- (status_desc)->status_desc_data = \
- ((status_desc)->status_desc_data & \
- ~cpu_to_le64(0x3ULL << 56)) | \
- cpu_to_le64((u64)((val) & 0x3) << 56); \
-}
+#define netxen_get_sts_opcode(status_desc) \
+ ((le64_to_cpu((status_desc)->status_desc_data) >> 58) & 0x03F)
+
+#define netxen_clear_sts_owner(status_desc) \
+ ((status_desc)->status_desc_data &= \
+ ~cpu_to_le64(((unsigned long long)3) << 56 ))
+#define netxen_set_sts_owner(status_desc, val) \
+ ((status_desc)->status_desc_data |= \
+ cpu_to_le64(((unsigned long long)((val) & 0x3)) << 56 ))
struct status_desc {
/* Bit pattern: 0-3 port, 4-7 status, 8-11 type, 12-27 total_length
diff --git a/trunk/drivers/net/netxen/netxen_nic_init.c b/trunk/drivers/net/netxen/netxen_nic_init.c
index 485ff9398910..37589265297e 100644
--- a/trunk/drivers/net/netxen/netxen_nic_init.c
+++ b/trunk/drivers/net/netxen/netxen_nic_init.c
@@ -1070,17 +1070,16 @@ netxen_process_rcv(struct netxen_adapter *adapter, int ctxid,
{
struct pci_dev *pdev = adapter->pdev;
struct net_device *netdev = adapter->netdev;
- u64 sts_data = le64_to_cpu(desc->status_desc_data);
- int index = netxen_get_sts_refhandle(sts_data);
+ int index = netxen_get_sts_refhandle(desc);
struct netxen_recv_context *recv_ctx = &(adapter->recv_ctx[ctxid]);
struct netxen_rx_buffer *buffer;
struct sk_buff *skb;
- u32 length = netxen_get_sts_totallength(sts_data);
+ u32 length = netxen_get_sts_totallength(desc);
u32 desc_ctx;
struct netxen_rcv_desc_ctx *rcv_desc;
int ret;
- desc_ctx = netxen_get_sts_type(sts_data);
+ desc_ctx = netxen_get_sts_type(desc);
if (unlikely(desc_ctx >= NUM_RCV_DESC_RINGS)) {
printk("%s: %s Bad Rcv descriptor ring\n",
netxen_nic_driver_name, netdev->name);
@@ -1120,7 +1119,7 @@ netxen_process_rcv(struct netxen_adapter *adapter, int ctxid,
skb = (struct sk_buff *)buffer->skb;
if (likely(adapter->rx_csum &&
- netxen_get_sts_status(sts_data) == STATUS_CKSUM_OK)) {
+ netxen_get_sts_status(desc) == STATUS_CKSUM_OK)) {
adapter->stats.csummed++;
skb->ip_summed = CHECKSUM_UNNECESSARY;
} else
@@ -1210,6 +1209,7 @@ u32 netxen_process_rcv_ring(struct netxen_adapter *adapter, int ctxid, int max)
break;
}
netxen_process_rcv(adapter, ctxid, desc);
+ netxen_clear_sts_owner(desc);
netxen_set_sts_owner(desc, STATUS_OWNER_PHANTOM);
consumer = (consumer + 1) & (adapter->max_rx_desc_count - 1);
count++;
@@ -1248,6 +1248,7 @@ int netxen_process_cmd_ring(unsigned long data)
struct pci_dev *pdev;
struct netxen_skb_frag *frag;
u32 i;
+ struct sk_buff *skb = NULL;
int done;
spin_lock(&adapter->tx_lock);
@@ -1277,8 +1278,9 @@ int netxen_process_cmd_ring(unsigned long data)
while ((last_consumer != consumer) && (count1 < MAX_STATUS_HANDLE)) {
buffer = &adapter->cmd_buf_arr[last_consumer];
pdev = adapter->pdev;
- if (buffer->skb) {
- frag = &buffer->frag_array[0];
+ frag = &buffer->frag_array[0];
+ skb = buffer->skb;
+ if (skb && (cmpxchg(&buffer->skb, skb, 0) == skb)) {
pci_unmap_single(pdev, frag->dma, frag->length,
PCI_DMA_TODEVICE);
frag->dma = 0ULL;
@@ -1291,8 +1293,8 @@ int netxen_process_cmd_ring(unsigned long data)
}
adapter->stats.skbfreed++;
- dev_kfree_skb_any(buffer->skb);
- buffer->skb = NULL;
+ dev_kfree_skb_any(skb);
+ skb = NULL;
} else if (adapter->proc_cmd_buf_counter == 1) {
adapter->stats.txnullskb++;
}
diff --git a/trunk/drivers/net/netxen/netxen_nic_main.c b/trunk/drivers/net/netxen/netxen_nic_main.c
index 263b55e36c7a..a80f0cd6b528 100644
--- a/trunk/drivers/net/netxen/netxen_nic_main.c
+++ b/trunk/drivers/net/netxen/netxen_nic_main.c
@@ -732,6 +732,11 @@ static void __devexit netxen_nic_remove(struct pci_dev *pdev)
unregister_netdev(netdev);
+ if (adapter->stop_port)
+ adapter->stop_port(adapter);
+
+ netxen_nic_disable_int(adapter);
+
if (adapter->is_up == NETXEN_ADAPTER_UP_MAGIC) {
init_firmware_done++;
netxen_free_hw_resources(adapter);
@@ -914,9 +919,6 @@ static int netxen_nic_close(struct net_device *netdev)
netif_stop_queue(netdev);
napi_disable(&adapter->napi);
- if (adapter->stop_port)
- adapter->stop_port(adapter);
-
netxen_nic_disable_int(adapter);
cmd_buff = adapter->cmd_buf_arr;
@@ -994,6 +996,28 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
return NETDEV_TX_OK;
}
+ /*
+ * Everything is set up. Now, we just need to transmit it out.
+ * Note that we have to copy the contents of buffer over to
+ * right place. Later on, this can be optimized out by de-coupling the
+ * producer index from the buffer index.
+ */
+ retry_getting_window:
+ spin_lock_bh(&adapter->tx_lock);
+ if (adapter->total_threads >= MAX_XMIT_PRODUCERS) {
+ spin_unlock_bh(&adapter->tx_lock);
+ /*
+ * Yield CPU
+ */
+ if (!in_atomic())
+ schedule();
+ else {
+ for (i = 0; i < 20; i++)
+ cpu_relax(); /*This a nop instr on i386 */
+ }
+ goto retry_getting_window;
+ }
+ local_producer = adapter->cmd_producer;
/* There 4 fragments per descriptor */
no_of_desc = (frag_count + 3) >> 2;
if (netdev->features & NETIF_F_TSO) {
@@ -1007,19 +1031,16 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
}
}
}
-
- spin_lock_bh(&adapter->tx_lock);
- if (adapter->total_threads >= MAX_XMIT_PRODUCERS) {
- goto out_requeue;
- }
- local_producer = adapter->cmd_producer;
k = adapter->cmd_producer;
max_tx_desc_count = adapter->max_tx_desc_count;
last_cmd_consumer = adapter->last_cmd_consumer;
if ((k + no_of_desc) >=
((last_cmd_consumer <= k) ? last_cmd_consumer + max_tx_desc_count :
last_cmd_consumer)) {
- goto out_requeue;
+ netif_stop_queue(netdev);
+ adapter->flags |= NETXEN_NETDEV_STATUS;
+ spin_unlock_bh(&adapter->tx_lock);
+ return NETDEV_TX_BUSY;
}
k = get_index_range(k, max_tx_desc_count, no_of_desc);
adapter->cmd_producer = k;
@@ -1072,8 +1093,6 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
adapter->max_tx_desc_count);
hwdesc = &hw->cmd_desc_head[producer];
memset(hwdesc, 0, sizeof(struct cmd_desc_type0));
- pbuf = &adapter->cmd_buf_arr[producer];
- pbuf->skb = NULL;
}
frag = &skb_shinfo(skb)->frags[i - 1];
len = frag->size;
@@ -1129,8 +1148,6 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
}
/* copy the MAC/IP/TCP headers to the cmd descriptor list */
hwdesc = &hw->cmd_desc_head[producer];
- pbuf = &adapter->cmd_buf_arr[producer];
- pbuf->skb = NULL;
/* copy the first 64 bytes */
memcpy(((void *)hwdesc) + 2,
@@ -1139,8 +1156,6 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
if (more_hdr) {
hwdesc = &hw->cmd_desc_head[producer];
- pbuf = &adapter->cmd_buf_arr[producer];
- pbuf->skb = NULL;
/* copy the next 64 bytes - should be enough except
* for pathological case
*/
@@ -1152,8 +1167,16 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
}
}
+ i = netxen_get_cmd_desc_totallength(&hw->cmd_desc_head[saved_producer]);
+
+ hw->cmd_desc_head[saved_producer].flags_opcode =
+ cpu_to_le16(hw->cmd_desc_head[saved_producer].flags_opcode);
+ hw->cmd_desc_head[saved_producer].num_of_buffers_total_length =
+ cpu_to_le32(hw->cmd_desc_head[saved_producer].
+ num_of_buffers_total_length);
+
spin_lock_bh(&adapter->tx_lock);
- adapter->stats.txbytes += skb->len;
+ adapter->stats.txbytes += i;
/* Code to update the adapter considering how many producer threads
are currently working */
@@ -1166,17 +1189,14 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
}
adapter->stats.xmitfinished++;
- netdev->trans_start = jiffies;
-
spin_unlock_bh(&adapter->tx_lock);
- return NETDEV_TX_OK;
-out_requeue:
- netif_stop_queue(netdev);
- adapter->flags |= NETXEN_NETDEV_STATUS;
+ netdev->trans_start = jiffies;
- spin_unlock_bh(&adapter->tx_lock);
- return NETDEV_TX_BUSY;
+ DPRINTK(INFO, "wrote CMD producer %x to phantom\n", producer);
+
+ DPRINTK(INFO, "Done. Send\n");
+ return NETDEV_TX_OK;
}
static void netxen_watchdog(unsigned long v)
@@ -1301,7 +1321,7 @@ static int netxen_nic_poll(struct napi_struct *napi, int budget)
budget / MAX_RCV_CTX);
}
- if (work_done >= budget)
+ if (work_done >= budget && netxen_nic_rx_has_work(adapter) != 0)
done = 0;
if (netxen_process_cmd_ring((unsigned long)adapter) == 0)
diff --git a/trunk/drivers/net/netxen/netxen_nic_niu.c b/trunk/drivers/net/netxen/netxen_nic_niu.c
index d04ecb77d08c..5b9e1b300fab 100644
--- a/trunk/drivers/net/netxen/netxen_nic_niu.c
+++ b/trunk/drivers/net/netxen/netxen_nic_niu.c
@@ -736,12 +736,12 @@ int netxen_niu_disable_xg_port(struct netxen_adapter *adapter)
__u32 mac_cfg;
u32 port = physical_port[adapter->portnum];
- if (port > NETXEN_NIU_MAX_XG_PORTS)
+ if (port != 0)
return -EINVAL;
-
mac_cfg = 0;
- if (netxen_nic_hw_write_wx(adapter,
- NETXEN_NIU_XGE_CONFIG_0 + (0x10000 * port), &mac_cfg, 4))
+ netxen_xg_soft_reset(mac_cfg);
+ if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_XGE_CONFIG_0,
+ &mac_cfg, 4))
return -EIO;
return 0;
}
diff --git a/trunk/drivers/net/niu.c b/trunk/drivers/net/niu.c
index 5f6beabf2d17..abfc61c3a38c 100644
--- a/trunk/drivers/net/niu.c
+++ b/trunk/drivers/net/niu.c
@@ -33,8 +33,8 @@
#define DRV_MODULE_NAME "niu"
#define PFX DRV_MODULE_NAME ": "
-#define DRV_MODULE_VERSION "0.6"
-#define DRV_MODULE_RELDATE "January 5, 2008"
+#define DRV_MODULE_VERSION "0.5"
+#define DRV_MODULE_RELDATE "October 5, 2007"
static char version[] __devinitdata =
DRV_MODULE_NAME ".c:v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";
@@ -801,90 +801,22 @@ static int bcm8704_init_user_dev3(struct niu *np)
return 0;
}
-static int mrvl88x2011_act_led(struct niu *np, int val)
-{
- int err;
-
- err = mdio_read(np, np->phy_addr, MRVL88X2011_USER_DEV2_ADDR,
- MRVL88X2011_LED_8_TO_11_CTL);
- if (err < 0)
- return err;
-
- err &= ~MRVL88X2011_LED(MRVL88X2011_LED_ACT,MRVL88X2011_LED_CTL_MASK);
- err |= MRVL88X2011_LED(MRVL88X2011_LED_ACT,val);
-
- return mdio_write(np, np->phy_addr, MRVL88X2011_USER_DEV2_ADDR,
- MRVL88X2011_LED_8_TO_11_CTL, err);
-}
-
-static int mrvl88x2011_led_blink_rate(struct niu *np, int rate)
-{
- int err;
-
- err = mdio_read(np, np->phy_addr, MRVL88X2011_USER_DEV2_ADDR,
- MRVL88X2011_LED_BLINK_CTL);
- if (err >= 0) {
- err &= ~MRVL88X2011_LED_BLKRATE_MASK;
- err |= (rate << 4);
-
- err = mdio_write(np, np->phy_addr, MRVL88X2011_USER_DEV2_ADDR,
- MRVL88X2011_LED_BLINK_CTL, err);
- }
-
- return err;
-}
-
-static int xcvr_init_10g_mrvl88x2011(struct niu *np)
-{
- int err;
-
- /* Set LED functions */
- err = mrvl88x2011_led_blink_rate(np, MRVL88X2011_LED_BLKRATE_134MS);
- if (err)
- return err;
-
- /* led activity */
- err = mrvl88x2011_act_led(np, MRVL88X2011_LED_CTL_OFF);
- if (err)
- return err;
-
- err = mdio_read(np, np->phy_addr, MRVL88X2011_USER_DEV3_ADDR,
- MRVL88X2011_GENERAL_CTL);
- if (err < 0)
- return err;
-
- err |= MRVL88X2011_ENA_XFPREFCLK;
-
- err = mdio_write(np, np->phy_addr, MRVL88X2011_USER_DEV3_ADDR,
- MRVL88X2011_GENERAL_CTL, err);
- if (err < 0)
- return err;
-
- err = mdio_read(np, np->phy_addr, MRVL88X2011_USER_DEV1_ADDR,
- MRVL88X2011_PMA_PMD_CTL_1);
- if (err < 0)
- return err;
-
- if (np->link_config.loopback_mode == LOOPBACK_MAC)
- err |= MRVL88X2011_LOOPBACK;
- else
- err &= ~MRVL88X2011_LOOPBACK;
-
- err = mdio_write(np, np->phy_addr, MRVL88X2011_USER_DEV1_ADDR,
- MRVL88X2011_PMA_PMD_CTL_1, err);
- if (err < 0)
- return err;
-
- /* Enable PMD */
- return mdio_write(np, np->phy_addr, MRVL88X2011_USER_DEV1_ADDR,
- MRVL88X2011_10G_PMD_TX_DIS, MRVL88X2011_ENA_PMDTX);
-}
-
-static int xcvr_init_10g_bcm8704(struct niu *np)
+static int xcvr_init_10g(struct niu *np)
{
struct niu_link_config *lp = &np->link_config;
u16 analog_stat0, tx_alarm_status;
int err;
+ u64 val;
+
+ val = nr64_mac(XMAC_CONFIG);
+ val &= ~XMAC_CONFIG_LED_POLARITY;
+ val |= XMAC_CONFIG_FORCE_LED_ON;
+ nw64_mac(XMAC_CONFIG, val);
+
+ /* XXX shared resource, lock parent XXX */
+ val = nr64(MIF_CONFIG);
+ val |= MIF_CONFIG_INDIRECT_MODE;
+ nw64(MIF_CONFIG, val);
err = bcm8704_reset(np);
if (err)
@@ -964,38 +896,6 @@ static int xcvr_init_10g_bcm8704(struct niu *np)
return 0;
}
-static int xcvr_init_10g(struct niu *np)
-{
- int phy_id, err;
- u64 val;
-
- val = nr64_mac(XMAC_CONFIG);
- val &= ~XMAC_CONFIG_LED_POLARITY;
- val |= XMAC_CONFIG_FORCE_LED_ON;
- nw64_mac(XMAC_CONFIG, val);
-
- /* XXX shared resource, lock parent XXX */
- val = nr64(MIF_CONFIG);
- val |= MIF_CONFIG_INDIRECT_MODE;
- nw64(MIF_CONFIG, val);
-
- phy_id = phy_decode(np->parent->port_phy, np->port);
- phy_id = np->parent->phy_probe_info.phy_id[phy_id][np->port];
-
- /* handle different phy types */
- switch (phy_id & NIU_PHY_ID_MASK) {
- case NIU_PHY_ID_MRVL88X2011:
- err = xcvr_init_10g_mrvl88x2011(np);
- break;
-
- default: /* bcom 8704 */
- err = xcvr_init_10g_bcm8704(np);
- break;
- }
-
- return 0;
-}
-
static int mii_reset(struct niu *np)
{
int limit, err;
@@ -1182,68 +1082,19 @@ static int niu_link_status_common(struct niu *np, int link_up)
return 0;
}
-static int link_status_10g_mrvl(struct niu *np, int *link_up_p)
+static int link_status_10g(struct niu *np, int *link_up_p)
{
- int err, link_up, pma_status, pcs_status;
+ unsigned long flags;
+ int err, link_up;
link_up = 0;
- err = mdio_read(np, np->phy_addr, MRVL88X2011_USER_DEV1_ADDR,
- MRVL88X2011_10G_PMD_STATUS_2);
- if (err < 0)
- goto out;
-
- /* Check PMA/PMD Register: 1.0001.2 == 1 */
- err = mdio_read(np, np->phy_addr, MRVL88X2011_USER_DEV1_ADDR,
- MRVL88X2011_PMA_PMD_STATUS_1);
- if (err < 0)
- goto out;
-
- pma_status = ((err & MRVL88X2011_LNK_STATUS_OK) ? 1 : 0);
-
- /* Check PMC Register : 3.0001.2 == 1: read twice */
- err = mdio_read(np, np->phy_addr, MRVL88X2011_USER_DEV3_ADDR,
- MRVL88X2011_PMA_PMD_STATUS_1);
- if (err < 0)
- goto out;
-
- err = mdio_read(np, np->phy_addr, MRVL88X2011_USER_DEV3_ADDR,
- MRVL88X2011_PMA_PMD_STATUS_1);
- if (err < 0)
- goto out;
-
- pcs_status = ((err & MRVL88X2011_LNK_STATUS_OK) ? 1 : 0);
+ spin_lock_irqsave(&np->lock, flags);
- /* Check XGXS Register : 4.0018.[0-3,12] */
- err = mdio_read(np, np->phy_addr, MRVL88X2011_USER_DEV4_ADDR,
- MRVL88X2011_10G_XGXS_LANE_STAT);
- if (err < 0)
+ err = -EINVAL;
+ if (np->link_config.loopback_mode != LOOPBACK_DISABLED)
goto out;
- if (err == (PHYXS_XGXS_LANE_STAT_ALINGED | PHYXS_XGXS_LANE_STAT_LANE3 |
- PHYXS_XGXS_LANE_STAT_LANE2 | PHYXS_XGXS_LANE_STAT_LANE1 |
- PHYXS_XGXS_LANE_STAT_LANE0 | PHYXS_XGXS_LANE_STAT_MAGIC |
- 0x800))
- link_up = (pma_status && pcs_status) ? 1 : 0;
-
- np->link_config.active_speed = SPEED_10000;
- np->link_config.active_duplex = DUPLEX_FULL;
- err = 0;
-out:
- mrvl88x2011_act_led(np, (link_up ?
- MRVL88X2011_LED_CTL_PCS_ACT :
- MRVL88X2011_LED_CTL_OFF));
-
- *link_up_p = link_up;
- return err;
-}
-
-static int link_status_10g_bcom(struct niu *np, int *link_up_p)
-{
- int err, link_up;
-
- link_up = 0;
-
err = mdio_read(np, np->phy_addr, BCM8704_PMA_PMD_DEV_ADDR,
BCM8704_PMD_RCV_SIGDET);
if (err < 0)
@@ -1283,43 +1134,14 @@ static int link_status_10g_bcom(struct niu *np, int *link_up_p)
err = 0;
out:
- *link_up_p = link_up;
- return err;
-}
-
-static int link_status_10g(struct niu *np, int *link_up_p)
-{
- unsigned long flags;
- int err = -EINVAL;
-
- spin_lock_irqsave(&np->lock, flags);
-
- if (np->link_config.loopback_mode == LOOPBACK_DISABLED) {
- int phy_id;
-
- phy_id = phy_decode(np->parent->port_phy, np->port);
- phy_id = np->parent->phy_probe_info.phy_id[phy_id][np->port];
-
- /* handle different phy types */
- switch (phy_id & NIU_PHY_ID_MASK) {
- case NIU_PHY_ID_MRVL88X2011:
- err = link_status_10g_mrvl(np, link_up_p);
- break;
-
- default: /* bcom 8704 */
- err = link_status_10g_bcom(np, link_up_p);
- break;
- }
- }
-
spin_unlock_irqrestore(&np->lock, flags);
+ *link_up_p = link_up;
return err;
}
static int link_status_1g(struct niu *np, int *link_up_p)
{
- struct niu_link_config *lp = &np->link_config;
u16 current_speed, bmsr;
unsigned long flags;
u8 current_duplex;
@@ -1387,8 +1209,6 @@ static int link_status_1g(struct niu *np, int *link_up_p)
link_up = 0;
}
}
- lp->active_speed = current_speed;
- lp->active_duplex = current_duplex;
err = 0;
out:
@@ -2421,8 +2241,6 @@ static int niu_process_rx_pkt(struct niu *np, struct rx_ring_info *rp)
skb->protocol = eth_type_trans(skb, np->dev);
netif_receive_skb(skb);
- np->dev->last_rx = jiffies;
-
return num_rcr;
}
@@ -2690,19 +2508,15 @@ static int niu_rx_error(struct niu *np, struct rx_ring_info *rp)
u64 stat = nr64(RX_DMA_CTL_STAT(rp->rx_channel));
int err = 0;
+ dev_err(np->device, PFX "%s: RX channel %u error, stat[%llx]\n",
+ np->dev->name, rp->rx_channel, (unsigned long long) stat);
+
+ niu_log_rxchan_errors(np, rp, stat);
if (stat & (RX_DMA_CTL_STAT_CHAN_FATAL |
RX_DMA_CTL_STAT_PORT_FATAL))
err = -EINVAL;
- if (err) {
- dev_err(np->device, PFX "%s: RX channel %u error, stat[%llx]\n",
- np->dev->name, rp->rx_channel,
- (unsigned long long) stat);
-
- niu_log_rxchan_errors(np, rp, stat);
- }
-
nw64(RX_DMA_CTL_STAT(rp->rx_channel),
stat & RX_DMA_CTL_WRITE_CLEAR_ERRS);
@@ -2935,16 +2749,13 @@ static int niu_device_error(struct niu *np)
return -ENODEV;
}
-static int niu_slowpath_interrupt(struct niu *np, struct niu_ldg *lp,
- u64 v0, u64 v1, u64 v2)
+static int niu_slowpath_interrupt(struct niu *np, struct niu_ldg *lp)
{
-
+ u64 v0 = lp->v0;
+ u64 v1 = lp->v1;
+ u64 v2 = lp->v2;
int i, err = 0;
- lp->v0 = v0;
- lp->v1 = v1;
- lp->v2 = v2;
-
if (v1 & 0x00000000ffffffffULL) {
u32 rx_vec = (v1 & 0xffffffff);
@@ -2953,13 +2764,8 @@ static int niu_slowpath_interrupt(struct niu *np, struct niu_ldg *lp,
if (rx_vec & (1 << rp->rx_channel)) {
int r = niu_rx_error(np, rp);
- if (r) {
+ if (r)
err = r;
- } else {
- if (!v0)
- nw64(RX_DMA_CTL_STAT(rp->rx_channel),
- RX_DMA_CTL_STAT_MEX);
- }
}
}
}
@@ -2997,7 +2803,7 @@ static int niu_slowpath_interrupt(struct niu *np, struct niu_ldg *lp,
if (err)
niu_enable_interrupts(np, 0);
- return err;
+ return -EINVAL;
}
static void niu_rxchan_intr(struct niu *np, struct rx_ring_info *rp,
@@ -3099,7 +2905,7 @@ static irqreturn_t niu_interrupt(int irq, void *dev_id)
}
if (unlikely((v0 & ((u64)1 << LDN_MIF)) || v1 || v2)) {
- int err = niu_slowpath_interrupt(np, lp, v0, v1, v2);
+ int err = niu_slowpath_interrupt(np, lp);
if (err)
goto out;
}
@@ -5388,8 +5194,7 @@ static int niu_start_xmit(struct sk_buff *skb, struct net_device *dev)
}
kfree_skb(skb);
skb = skb_new;
- } else
- skb_orphan(skb);
+ }
align = ((unsigned long) skb->data & (16 - 1));
headroom = align + sizeof(struct tx_pkt_hdr);
@@ -6477,8 +6282,7 @@ static int __devinit phy_record(struct niu_parent *parent,
if (dev_id_1 < 0 || dev_id_2 < 0)
return 0;
if (type == PHY_TYPE_PMA_PMD || type == PHY_TYPE_PCS) {
- if (((id & NIU_PHY_ID_MASK) != NIU_PHY_ID_BCM8704) &&
- ((id & NIU_PHY_ID_MASK) != NIU_PHY_ID_MRVL88X2011))
+ if ((id & NIU_PHY_ID_MASK) != NIU_PHY_ID_BCM8704)
return 0;
} else {
if ((id & NIU_PHY_ID_MASK) != NIU_PHY_ID_BCM5464R)
diff --git a/trunk/drivers/net/niu.h b/trunk/drivers/net/niu.h
index 0e8626adc573..10e3f111b6d5 100644
--- a/trunk/drivers/net/niu.h
+++ b/trunk/drivers/net/niu.h
@@ -2538,39 +2538,6 @@ struct fcram_hash_ipv6 {
#define NIU_PHY_ID_MASK 0xfffff0f0
#define NIU_PHY_ID_BCM8704 0x00206030
#define NIU_PHY_ID_BCM5464R 0x002060b0
-#define NIU_PHY_ID_MRVL88X2011 0x01410020
-
-/* MRVL88X2011 register addresses */
-#define MRVL88X2011_USER_DEV1_ADDR 1
-#define MRVL88X2011_USER_DEV2_ADDR 2
-#define MRVL88X2011_USER_DEV3_ADDR 3
-#define MRVL88X2011_USER_DEV4_ADDR 4
-#define MRVL88X2011_PMA_PMD_CTL_1 0x0000
-#define MRVL88X2011_PMA_PMD_STATUS_1 0x0001
-#define MRVL88X2011_10G_PMD_STATUS_2 0x0008
-#define MRVL88X2011_10G_PMD_TX_DIS 0x0009
-#define MRVL88X2011_10G_XGXS_LANE_STAT 0x0018
-#define MRVL88X2011_GENERAL_CTL 0x8300
-#define MRVL88X2011_LED_BLINK_CTL 0x8303
-#define MRVL88X2011_LED_8_TO_11_CTL 0x8306
-
-/* MRVL88X2011 register control */
-#define MRVL88X2011_ENA_XFPREFCLK 0x0001
-#define MRVL88X2011_ENA_PMDTX 0x0000
-#define MRVL88X2011_LOOPBACK 0x1
-#define MRVL88X2011_LED_ACT 0x1
-#define MRVL88X2011_LNK_STATUS_OK 0x4
-#define MRVL88X2011_LED_BLKRATE_MASK 0x70
-#define MRVL88X2011_LED_BLKRATE_034MS 0x0
-#define MRVL88X2011_LED_BLKRATE_067MS 0x1
-#define MRVL88X2011_LED_BLKRATE_134MS 0x2
-#define MRVL88X2011_LED_BLKRATE_269MS 0x3
-#define MRVL88X2011_LED_BLKRATE_538MS 0x4
-#define MRVL88X2011_LED_CTL_OFF 0x0
-#define MRVL88X2011_LED_CTL_PCS_ACT 0x5
-#define MRVL88X2011_LED_CTL_MASK 0x7
-#define MRVL88X2011_LED(n,v) ((v)<<((n)*4))
-#define MRVL88X2011_LED_STAT(n,v) ((v)>>((n)*4))
#define BCM8704_PMA_PMD_DEV_ADDR 1
#define BCM8704_PCS_DEV_ADDR 2
diff --git a/trunk/drivers/net/pcmcia/3c574_cs.c b/trunk/drivers/net/pcmcia/3c574_cs.c
index 36a7ba3134ce..ad134a61302a 100644
--- a/trunk/drivers/net/pcmcia/3c574_cs.c
+++ b/trunk/drivers/net/pcmcia/3c574_cs.c
@@ -187,16 +187,14 @@ enum Window1 {
enum Window3 { /* Window 3: MAC/config bits. */
Wn3_Config=0, Wn3_MAC_Ctrl=6, Wn3_Options=8,
};
-enum wn3_config {
- Ram_size = 7,
- Ram_width = 8,
- Ram_speed = 0x30,
- Rom_size = 0xc0,
- Ram_split_shift = 16,
- Ram_split = 3 << Ram_split_shift,
- Xcvr_shift = 20,
- Xcvr = 7 << Xcvr_shift,
- Autoselect = 0x1000000,
+union wn3_config {
+ int i;
+ struct w3_config_fields {
+ unsigned int ram_size:3, ram_width:1, ram_speed:2, rom_size:2;
+ int pad8:8;
+ unsigned int ram_split:2, pad18:2, xcvr:3, pad21:1, autoselect:1;
+ int pad24:7;
+ } u;
};
enum Window4 { /* Window 4: Xcvr/media bits. */
@@ -339,15 +337,15 @@ static int tc574_config(struct pcmcia_device *link)
struct net_device *dev = link->priv;
struct el3_private *lp = netdev_priv(dev);
tuple_t tuple;
- __le16 buf[32];
+ unsigned short buf[32];
int last_fn, last_ret, i, j;
kio_addr_t ioaddr;
- __be16 *phys_addr;
+ u16 *phys_addr;
char *cardname;
- __u32 config;
+ union wn3_config config;
DECLARE_MAC_BUF(mac);
- phys_addr = (__be16 *)dev->dev_addr;
+ phys_addr = (u16 *)dev->dev_addr;
DEBUG(0, "3c574_config(0x%p)\n", link);
@@ -380,12 +378,12 @@ static int tc574_config(struct pcmcia_device *link)
if (pcmcia_get_first_tuple(link, &tuple) == CS_SUCCESS) {
pcmcia_get_tuple_data(link, &tuple);
for (i = 0; i < 3; i++)
- phys_addr[i] = htons(le16_to_cpu(buf[i]));
+ phys_addr[i] = htons(buf[i]);
} else {
EL3WINDOW(0);
for (i = 0; i < 3; i++)
phys_addr[i] = htons(read_eeprom(ioaddr, i + 10));
- if (phys_addr[0] == htons(0x6060)) {
+ if (phys_addr[0] == 0x6060) {
printk(KERN_NOTICE "3c574_cs: IO port conflict at 0x%03lx"
"-0x%03lx\n", dev->base_addr, dev->base_addr+15);
goto failed;
@@ -403,9 +401,9 @@ static int tc574_config(struct pcmcia_device *link)
outw(0<<11, ioaddr + RunnerRdCtrl);
printk(KERN_INFO " ASIC rev %d,", mcr>>3);
EL3WINDOW(3);
- config = inl(ioaddr + Wn3_Config);
- lp->default_media = (config & Xcvr) >> Xcvr_shift;
- lp->autoselect = config & Autoselect ? 1 : 0;
+ config.i = inl(ioaddr + Wn3_Config);
+ lp->default_media = config.u.xcvr;
+ lp->autoselect = config.u.autoselect;
}
init_timer(&lp->media);
@@ -466,9 +464,8 @@ static int tc574_config(struct pcmcia_device *link)
dev->name, cardname, dev->base_addr, dev->irq,
print_mac(mac, dev->dev_addr));
printk(" %dK FIFO split %s Rx:Tx, %sMII interface.\n",
- 8 << config & Ram_size,
- ram_split[(config & Ram_split) >> Ram_split_shift],
- config & Autoselect ? "autoselect " : "");
+ 8 << config.u.ram_size, ram_split[config.u.ram_split],
+ config.u.autoselect ? "autoselect " : "");
return 0;
diff --git a/trunk/drivers/net/pcmcia/3c589_cs.c b/trunk/drivers/net/pcmcia/3c589_cs.c
index e862d14ece79..a98fe07cce70 100644
--- a/trunk/drivers/net/pcmcia/3c589_cs.c
+++ b/trunk/drivers/net/pcmcia/3c589_cs.c
@@ -251,8 +251,7 @@ static int tc589_config(struct pcmcia_device *link)
struct net_device *dev = link->priv;
struct el3_private *lp = netdev_priv(dev);
tuple_t tuple;
- __le16 buf[32];
- __be16 *phys_addr;
+ u16 buf[32], *phys_addr;
int last_fn, last_ret, i, j, multi = 0, fifo;
kio_addr_t ioaddr;
char *ram_split[] = {"5:3", "3:1", "1:1", "3:5"};
@@ -260,7 +259,7 @@ static int tc589_config(struct pcmcia_device *link)
DEBUG(0, "3c589_config(0x%p)\n", link);
- phys_addr = (__be16 *)dev->dev_addr;
+ phys_addr = (u16 *)dev->dev_addr;
tuple.Attributes = 0;
tuple.TupleData = (cisdata_t *)buf;
tuple.TupleDataMax = sizeof(buf);
@@ -299,11 +298,11 @@ static int tc589_config(struct pcmcia_device *link)
if (pcmcia_get_first_tuple(link, &tuple) == CS_SUCCESS) {
pcmcia_get_tuple_data(link, &tuple);
for (i = 0; i < 3; i++)
- phys_addr[i] = htons(le16_to_cpu(buf[i]));
+ phys_addr[i] = htons(buf[i]);
} else {
for (i = 0; i < 3; i++)
phys_addr[i] = htons(read_eeprom(ioaddr, i));
- if (phys_addr[0] == htons(0x6060)) {
+ if (phys_addr[0] == 0x6060) {
printk(KERN_ERR "3c589_cs: IO port conflict at 0x%03lx"
"-0x%03lx\n", dev->base_addr, dev->base_addr+15);
goto failed;
diff --git a/trunk/drivers/net/pcnet32.c b/trunk/drivers/net/pcnet32.c
index 90498ffe26f2..ff92aca0a7b3 100644
--- a/trunk/drivers/net/pcnet32.c
+++ b/trunk/drivers/net/pcnet32.c
@@ -455,14 +455,9 @@ static void pcnet32_netif_start(struct net_device *dev)
{
#ifdef CONFIG_PCNET32_NAPI
struct pcnet32_private *lp = netdev_priv(dev);
- ulong ioaddr = dev->base_addr;
- u16 val;
#endif
netif_wake_queue(dev);
#ifdef CONFIG_PCNET32_NAPI
- val = lp->a.read_csr(ioaddr, CSR3);
- val &= 0x00ff;
- lp->a.write_csr(ioaddr, CSR3, val);
napi_enable(&lp->napi);
#endif
}
diff --git a/trunk/drivers/net/qla3xxx.c b/trunk/drivers/net/qla3xxx.c
index cf0774de6c41..a5791114b7bd 100644
--- a/trunk/drivers/net/qla3xxx.c
+++ b/trunk/drivers/net/qla3xxx.c
@@ -2320,9 +2320,14 @@ static int ql_poll(struct napi_struct *napi, int budget)
unsigned long hw_flags;
struct ql3xxx_port_registers __iomem *port_regs = qdev->mem_map_registers;
+ if (!netif_carrier_ok(ndev))
+ goto quit_polling;
+
ql_tx_rx_clean(qdev, &tx_cleaned, &rx_cleaned, budget);
- if (tx_cleaned + rx_cleaned != budget) {
+ if (tx_cleaned + rx_cleaned != budget ||
+ !netif_running(ndev)) {
+quit_polling:
spin_lock_irqsave(&qdev->hw_lock, hw_flags);
__netif_rx_complete(ndev, napi);
ql_update_small_bufq_prod_index(qdev);
diff --git a/trunk/drivers/net/r8169.c b/trunk/drivers/net/r8169.c
index 3acfeeabdee1..1f647b9ce352 100644
--- a/trunk/drivers/net/r8169.c
+++ b/trunk/drivers/net/r8169.c
@@ -2002,7 +2002,7 @@ static void rtl8169_set_magic_reg(void __iomem *ioaddr, unsigned mac_version)
u32 clk;
clk = RTL_R8(Config2) & PCI_Clock_66MHz;
- for (i = 0; i < ARRAY_SIZE(cfg2_info); i++, p++) {
+ for (i = 0; i < ARRAY_SIZE(cfg2_info); i++) {
if ((p->mac_version == mac_version) && (p->clk == clk)) {
RTL_W32(0x7c, p->val);
break;
@@ -2211,7 +2211,7 @@ static int rtl8169_change_mtu(struct net_device *dev, int new_mtu)
static inline void rtl8169_make_unusable_by_asic(struct RxDesc *desc)
{
- desc->addr = cpu_to_le64(0x0badbadbadbadbadull);
+ desc->addr = 0x0badbadbadbadbadull;
desc->opts1 &= ~cpu_to_le32(DescOwn | RsvdMask);
}
@@ -2398,8 +2398,6 @@ static void rtl8169_wait_for_quiescence(struct net_device *dev)
rtl8169_irq_mask_and_ack(ioaddr);
#ifdef CONFIG_R8169_NAPI
- tp->intr_mask = 0xffff;
- RTL_W16(IntrMask, tp->intr_event);
napi_enable(&tp->napi);
#endif
}
@@ -2837,7 +2835,7 @@ static int rtl8169_rx_interrupt(struct net_device *dev,
}
/* Work around for AMD plateform. */
- if ((desc->opts2 & cpu_to_le32(0xfffe000)) &&
+ if ((desc->opts2 & 0xfffe000) &&
(tp->mac_version == RTL_GIGA_MAC_VER_05)) {
desc->opts2 = 0;
cur_rx++;
diff --git a/trunk/drivers/net/rrunner.c b/trunk/drivers/net/rrunner.c
index 55a590ab1e17..73a7e6529ee0 100644
--- a/trunk/drivers/net/rrunner.c
+++ b/trunk/drivers/net/rrunner.c
@@ -294,6 +294,7 @@ static int rr_reset(struct net_device *dev)
{
struct rr_private *rrpriv;
struct rr_regs __iomem *regs;
+ struct eeprom *hw = NULL;
u32 start_pc;
int i;
@@ -380,8 +381,7 @@ static int rr_reset(struct net_device *dev)
writel(RBURST_64|WBURST_64, ®s->PciState);
wmb();
- start_pc = rr_read_eeprom_word(rrpriv,
- offsetof(struct eeprom, rncd_info.FwStart));
+ start_pc = rr_read_eeprom_word(rrpriv, &hw->rncd_info.FwStart);
#if (DEBUG > 1)
printk("%s: Executing firmware at address 0x%06x\n",
@@ -438,12 +438,12 @@ static unsigned int rr_read_eeprom(struct rr_private *rrpriv,
* it to our CPU byte-order.
*/
static u32 rr_read_eeprom_word(struct rr_private *rrpriv,
- size_t offset)
+ void * offset)
{
- __be32 word;
+ u32 word;
- if ((rr_read_eeprom(rrpriv, offset,
- (unsigned char *)&word, 4) == 4))
+ if ((rr_read_eeprom(rrpriv, (unsigned long)offset,
+ (char *)&word, 4) == 4))
return be32_to_cpu(word);
return 0;
}
@@ -510,6 +510,7 @@ static int __devinit rr_init(struct net_device *dev)
{
struct rr_private *rrpriv;
struct rr_regs __iomem *regs;
+ struct eeprom *hw = NULL;
u32 sram_size, rev;
DECLARE_MAC_BUF(mac);
@@ -544,14 +545,14 @@ static int __devinit rr_init(struct net_device *dev)
* other method I've seen. -VAL
*/
- *(__be16 *)(dev->dev_addr) =
- htons(rr_read_eeprom_word(rrpriv, offsetof(struct eeprom, manf.BoardULA)));
- *(__be32 *)(dev->dev_addr+2) =
- htonl(rr_read_eeprom_word(rrpriv, offsetof(struct eeprom, manf.BoardULA[4])));
+ *(u16 *)(dev->dev_addr) =
+ htons(rr_read_eeprom_word(rrpriv, &hw->manf.BoardULA));
+ *(u32 *)(dev->dev_addr+2) =
+ htonl(rr_read_eeprom_word(rrpriv, &hw->manf.BoardULA[4]));
printk(" MAC: %s\n", print_mac(mac, dev->dev_addr));
- sram_size = rr_read_eeprom_word(rrpriv, 8);
+ sram_size = rr_read_eeprom_word(rrpriv, (void *)8);
printk(" SRAM size 0x%06x\n", sram_size);
return 0;
@@ -1476,10 +1477,11 @@ static int rr_load_firmware(struct net_device *dev)
{
struct rr_private *rrpriv;
struct rr_regs __iomem *regs;
- size_t eptr, segptr;
+ unsigned long eptr, segptr;
int i, j;
u32 localctrl, sptr, len, tmp;
u32 p2len, p2size, nr_seg, revision, io, sram_size;
+ struct eeprom *hw = NULL;
rrpriv = netdev_priv(dev);
regs = rrpriv->regs;
@@ -1507,7 +1509,7 @@ static int rr_load_firmware(struct net_device *dev)
*/
io = readl(®s->ExtIo);
writel(0, ®s->ExtIo);
- sram_size = rr_read_eeprom_word(rrpriv, 8);
+ sram_size = rr_read_eeprom_word(rrpriv, (void *)8);
for (i = 200; i < sram_size / 4; i++){
writel(i * 4, ®s->WinBase);
@@ -1518,13 +1520,13 @@ static int rr_load_firmware(struct net_device *dev)
writel(io, ®s->ExtIo);
mb();
- eptr = rr_read_eeprom_word(rrpriv,
- offsetof(struct eeprom, rncd_info.AddrRunCodeSegs));
+ eptr = (unsigned long)rr_read_eeprom_word(rrpriv,
+ &hw->rncd_info.AddrRunCodeSegs);
eptr = ((eptr & 0x1fffff) >> 3);
- p2len = rr_read_eeprom_word(rrpriv, 0x83*4);
+ p2len = rr_read_eeprom_word(rrpriv, (void *)(0x83*4));
p2len = (p2len << 2);
- p2size = rr_read_eeprom_word(rrpriv, 0x84*4);
+ p2size = rr_read_eeprom_word(rrpriv, (void *)(0x84*4));
p2size = ((p2size & 0x1fffff) >> 3);
if ((eptr < p2size) || (eptr > (p2size + p2len))){
@@ -1532,8 +1534,7 @@ static int rr_load_firmware(struct net_device *dev)
goto out;
}
- revision = rr_read_eeprom_word(rrpriv,
- offsetof(struct eeprom, manf.HeaderFmt));
+ revision = rr_read_eeprom_word(rrpriv, &hw->manf.HeaderFmt);
if (revision != 1){
printk("%s: invalid firmware format (%i)\n",
@@ -1541,18 +1542,18 @@ static int rr_load_firmware(struct net_device *dev)
goto out;
}
- nr_seg = rr_read_eeprom_word(rrpriv, eptr);
+ nr_seg = rr_read_eeprom_word(rrpriv, (void *)eptr);
eptr +=4;
#if (DEBUG > 1)
printk("%s: nr_seg %i\n", dev->name, nr_seg);
#endif
for (i = 0; i < nr_seg; i++){
- sptr = rr_read_eeprom_word(rrpriv, eptr);
+ sptr = rr_read_eeprom_word(rrpriv, (void *)eptr);
eptr += 4;
- len = rr_read_eeprom_word(rrpriv, eptr);
+ len = rr_read_eeprom_word(rrpriv, (void *)eptr);
eptr += 4;
- segptr = rr_read_eeprom_word(rrpriv, eptr);
+ segptr = (unsigned long)rr_read_eeprom_word(rrpriv, (void *)eptr);
segptr = ((segptr & 0x1fffff) >> 3);
eptr += 4;
#if (DEBUG > 1)
@@ -1560,7 +1561,7 @@ static int rr_load_firmware(struct net_device *dev)
dev->name, i, sptr, len, segptr);
#endif
for (j = 0; j < len; j++){
- tmp = rr_read_eeprom_word(rrpriv, segptr);
+ tmp = rr_read_eeprom_word(rrpriv, (void *)segptr);
writel(sptr, ®s->WinBase);
mb();
writel(tmp, ®s->WinData);
diff --git a/trunk/drivers/net/rrunner.h b/trunk/drivers/net/rrunner.h
index 6173f11218df..6a79825bc8cf 100644
--- a/trunk/drivers/net/rrunner.h
+++ b/trunk/drivers/net/rrunner.h
@@ -838,7 +838,7 @@ static unsigned int rr_read_eeprom(struct rr_private *rrpriv,
unsigned long offset,
unsigned char *buf,
unsigned long length);
-static u32 rr_read_eeprom_word(struct rr_private *rrpriv, size_t offset);
+static u32 rr_read_eeprom_word(struct rr_private *rrpriv, void * offset);
static int rr_load_firmware(struct net_device *dev);
static inline void rr_raz_tx(struct rr_private *, struct net_device *);
static inline void rr_raz_rx(struct rr_private *, struct net_device *);
diff --git a/trunk/drivers/net/s2io.c b/trunk/drivers/net/s2io.c
index f2ba944e035e..9d80f1cf73ac 100644
--- a/trunk/drivers/net/s2io.c
+++ b/trunk/drivers/net/s2io.c
@@ -84,7 +84,7 @@
#include "s2io.h"
#include "s2io-regs.h"
-#define DRV_VERSION "2.0.26.17"
+#define DRV_VERSION "2.0.26.10"
/* S2io Driver name & version. */
static char s2io_driver_name[] = "Neterion";
@@ -2704,6 +2704,9 @@ static int s2io_poll(struct napi_struct *napi, int budget)
struct XENA_dev_config __iomem *bar0 = nic->bar0;
int i;
+ if (!is_s2io_card_up(nic))
+ return 0;
+
mac_control = &nic->mac_control;
config = &nic->config;
@@ -3848,6 +3851,8 @@ static int s2io_open(struct net_device *dev)
netif_carrier_off(dev);
sp->last_link_state = 0;
+ napi_enable(&sp->napi);
+
if (sp->config.intr_type == MSI_X) {
int ret = s2io_enable_msi_x(sp);
@@ -3890,6 +3895,7 @@ static int s2io_open(struct net_device *dev)
return 0;
hw_init_failed:
+ napi_disable(&sp->napi);
if (sp->config.intr_type == MSI_X) {
if (sp->entries) {
kfree(sp->entries);
@@ -3929,6 +3935,7 @@ static int s2io_close(struct net_device *dev)
return 0;
netif_stop_queue(dev);
+ napi_disable(&sp->napi);
/* Reset card, kill tasklet and free Tx and Rx buffers. */
s2io_card_down(sp);
@@ -6792,8 +6799,6 @@ static void do_s2io_card_down(struct s2io_nic * sp, int do_io)
struct XENA_dev_config __iomem *bar0 = sp->bar0;
unsigned long flags;
register u64 val64 = 0;
- struct config_param *config;
- config = &sp->config;
if (!is_s2io_card_up(sp))
return;
@@ -6805,10 +6810,6 @@ static void do_s2io_card_down(struct s2io_nic * sp, int do_io)
}
clear_bit(__S2IO_STATE_CARD_UP, &sp->state);
- /* Disable napi */
- if (config->napi)
- napi_disable(&sp->napi);
-
/* disable Tx and Rx traffic on the NIC */
if (do_io)
stop_nic(sp);
@@ -6902,11 +6903,6 @@ static int s2io_card_up(struct s2io_nic * sp)
DBG_PRINT(INFO_DBG, "Buf in ring:%d is %d:\n", i,
atomic_read(&sp->rx_bufs_left[i]));
}
-
- /* Initialise napi */
- if (config->napi)
- napi_enable(&sp->napi);
-
/* Maintain the state prior to the open */
if (sp->promisc_flg)
sp->promisc_flg = 0;
diff --git a/trunk/drivers/net/sky2.c b/trunk/drivers/net/sky2.c
index bc15940ce1bc..a74fc11a6482 100644
--- a/trunk/drivers/net/sky2.c
+++ b/trunk/drivers/net/sky2.c
@@ -944,6 +944,7 @@ static void tx_init(struct sky2_port *sky2)
le = get_tx_le(sky2);
le->addr = 0;
le->opcode = OP_ADDR64 | HW_OWNER;
+ sky2->tx_addr64 = 0;
}
static inline struct tx_ring_info *tx_le_re(struct sky2_port *sky2,
@@ -977,11 +978,13 @@ static void sky2_rx_add(struct sky2_port *sky2, u8 op,
dma_addr_t map, unsigned len)
{
struct sky2_rx_le *le;
+ u32 hi = upper_32_bits(map);
- if (sizeof(dma_addr_t) > sizeof(u32)) {
+ if (sky2->rx_addr64 != hi) {
le = sky2_next_rx(sky2);
- le->addr = cpu_to_le32(upper_32_bits(map));
+ le->addr = cpu_to_le32(hi);
le->opcode = OP_ADDR64 | HW_OWNER;
+ sky2->rx_addr64 = upper_32_bits(map + len);
}
le = sky2_next_rx(sky2);
@@ -1165,7 +1168,6 @@ static void sky2_vlan_rx_register(struct net_device *dev, struct vlan_group *grp
TX_VLAN_TAG_OFF);
}
- sky2_read32(hw, B0_Y2_SP_LISR);
napi_enable(&hw->napi);
netif_tx_unlock_bh(dev);
}
@@ -1477,6 +1479,7 @@ static int sky2_xmit_frame(struct sk_buff *skb, struct net_device *dev)
struct tx_ring_info *re;
unsigned i, len;
dma_addr_t mapping;
+ u32 addr64;
u16 mss;
u8 ctrl;
@@ -1489,12 +1492,15 @@ static int sky2_xmit_frame(struct sk_buff *skb, struct net_device *dev)
len = skb_headlen(skb);
mapping = pci_map_single(hw->pdev, skb->data, len, PCI_DMA_TODEVICE);
+ addr64 = upper_32_bits(mapping);
- /* Send high bits if needed */
- if (sizeof(dma_addr_t) > sizeof(u32)) {
+ /* Send high bits if changed or crosses boundary */
+ if (addr64 != sky2->tx_addr64 ||
+ upper_32_bits(mapping + len) != sky2->tx_addr64) {
le = get_tx_le(sky2);
- le->addr = cpu_to_le32(upper_32_bits(mapping));
+ le->addr = cpu_to_le32(addr64);
le->opcode = OP_ADDR64 | HW_OWNER;
+ sky2->tx_addr64 = upper_32_bits(mapping + len);
}
/* Check for TCP Segmentation Offload */
@@ -1575,12 +1581,13 @@ static int sky2_xmit_frame(struct sk_buff *skb, struct net_device *dev)
mapping = pci_map_page(hw->pdev, frag->page, frag->page_offset,
frag->size, PCI_DMA_TODEVICE);
-
- if (sizeof(dma_addr_t) > sizeof(u32)) {
+ addr64 = upper_32_bits(mapping);
+ if (addr64 != sky2->tx_addr64) {
le = get_tx_le(sky2);
- le->addr = cpu_to_le32(upper_32_bits(mapping));
+ le->addr = cpu_to_le32(addr64);
le->ctrl = 0;
le->opcode = OP_ADDR64 | HW_OWNER;
+ sky2->tx_addr64 = addr64;
}
le = get_tx_le(sky2);
@@ -2036,7 +2043,6 @@ static int sky2_change_mtu(struct net_device *dev, int new_mtu)
err = sky2_rx_start(sky2);
sky2_write32(hw, B0_IMSK, imask);
- sky2_read32(hw, B0_Y2_SP_LISR);
napi_enable(&hw->napi);
if (err)
@@ -3855,7 +3861,6 @@ static int sky2_debug_show(struct seq_file *seq, void *v)
last = sky2_read16(hw, Y2_QADDR(rxqaddr[port], PREF_UNIT_PUT_IDX)),
sky2_read16(hw, Y2_QADDR(rxqaddr[port], PREF_UNIT_LAST_IDX)));
- sky2_read32(hw, B0_Y2_SP_LISR);
napi_enable(&hw->napi);
return 0;
}
diff --git a/trunk/drivers/net/sky2.h b/trunk/drivers/net/sky2.h
index ffe9b8a50a1b..bc646a47edd2 100644
--- a/trunk/drivers/net/sky2.h
+++ b/trunk/drivers/net/sky2.h
@@ -1991,14 +1991,14 @@ struct sky2_port {
u16 tx_cons; /* next le to check */
u16 tx_prod; /* next le to use */
u16 tx_next; /* debug only */
-
+ u32 tx_addr64;
u16 tx_pending;
u16 tx_last_mss;
u32 tx_tcpsum;
struct rx_ring_info *rx_ring ____cacheline_aligned_in_smp;
struct sky2_rx_le *rx_le;
-
+ u32 rx_addr64;
u16 rx_next; /* next re to check */
u16 rx_put; /* next le index to use */
u16 rx_pending;
diff --git a/trunk/drivers/net/tc35815.c b/trunk/drivers/net/tc35815.c
index 370d329d15d9..d887c05588d5 100644
--- a/trunk/drivers/net/tc35815.c
+++ b/trunk/drivers/net/tc35815.c
@@ -611,7 +611,7 @@ static int __devinit tc35815_mac_match(struct device *dev, void *data)
{
struct platform_device *plat_dev = to_platform_device(dev);
struct pci_dev *pci_dev = data;
- unsigned int id = pci_dev->irq;
+ unsigned int id = (pci_dev->bus->number << 8) | pci_dev->devfn;
return !strcmp(plat_dev->name, "tc35815-mac") && plat_dev->id == id;
}
diff --git a/trunk/drivers/net/tg3.c b/trunk/drivers/net/tg3.c
index 22eb7c8c1a25..4942f7d18937 100644
--- a/trunk/drivers/net/tg3.c
+++ b/trunk/drivers/net/tg3.c
@@ -8189,7 +8189,6 @@ static int tg3_get_eeprom_len(struct net_device *dev)
}
static int tg3_nvram_read(struct tg3 *tp, u32 offset, u32 *val);
-static int tg3_nvram_read_le(struct tg3 *tp, u32 offset, __le32 *val);
static int tg3_nvram_read_swab(struct tg3 *tp, u32 offset, u32 *val);
static int tg3_get_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom, u8 *data)
@@ -8197,8 +8196,7 @@ static int tg3_get_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
struct tg3 *tp = netdev_priv(dev);
int ret;
u8 *pd;
- u32 i, offset, len, b_offset, b_count;
- __le32 val;
+ u32 i, offset, len, val, b_offset, b_count;
if (tp->link_config.phy_is_low_power)
return -EAGAIN;
@@ -8217,9 +8215,10 @@ static int tg3_get_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
/* i.e. offset=1 len=2 */
b_count = len;
}
- ret = tg3_nvram_read_le(tp, offset-b_offset, &val);
+ ret = tg3_nvram_read(tp, offset-b_offset, &val);
if (ret)
return ret;
+ val = cpu_to_le32(val);
memcpy(data, ((char*)&val) + b_offset, b_count);
len -= b_count;
offset += b_count;
@@ -8229,11 +8228,12 @@ static int tg3_get_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
/* read bytes upto the last 4 byte boundary */
pd = &data[eeprom->len];
for (i = 0; i < (len - (len & 3)); i += 4) {
- ret = tg3_nvram_read_le(tp, offset + i, &val);
+ ret = tg3_nvram_read(tp, offset + i, &val);
if (ret) {
eeprom->len += i;
return ret;
}
+ val = cpu_to_le32(val);
memcpy(pd + i, &val, 4);
}
eeprom->len += i;
@@ -8243,10 +8243,11 @@ static int tg3_get_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
pd = &data[eeprom->len];
b_count = len & 3;
b_offset = offset + len - b_count;
- ret = tg3_nvram_read_le(tp, b_offset, &val);
+ ret = tg3_nvram_read(tp, b_offset, &val);
if (ret)
return ret;
- memcpy(pd, &val, b_count);
+ val = cpu_to_le32(val);
+ memcpy(pd, ((char*)&val), b_count);
eeprom->len += b_count;
}
return 0;
@@ -8258,9 +8259,8 @@ static int tg3_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
{
struct tg3 *tp = netdev_priv(dev);
int ret;
- u32 offset, len, b_offset, odd_len;
+ u32 offset, len, b_offset, odd_len, start, end;
u8 *buf;
- __le32 start, end;
if (tp->link_config.phy_is_low_power)
return -EAGAIN;
@@ -8273,9 +8273,10 @@ static int tg3_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
if ((b_offset = (offset & 3))) {
/* adjustments to start on required 4 byte boundary */
- ret = tg3_nvram_read_le(tp, offset-b_offset, &start);
+ ret = tg3_nvram_read(tp, offset-b_offset, &start);
if (ret)
return ret;
+ start = cpu_to_le32(start);
len += b_offset;
offset &= ~3;
if (len < 4)
@@ -8287,9 +8288,10 @@ static int tg3_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
/* adjustments to end on required 4 byte boundary */
odd_len = 1;
len = (len + 3) & ~3;
- ret = tg3_nvram_read_le(tp, offset+len-4, &end);
+ ret = tg3_nvram_read(tp, offset+len-4, &end);
if (ret)
return ret;
+ end = cpu_to_le32(end);
}
buf = data;
@@ -8732,8 +8734,7 @@ static void tg3_get_ethtool_stats (struct net_device *dev,
static int tg3_test_nvram(struct tg3 *tp)
{
- u32 csum, magic;
- __le32 *buf;
+ u32 *buf, csum, magic;
int i, j, k, err = 0, size;
if (tg3_nvram_read_swab(tp, 0, &magic) != 0)
@@ -8770,19 +8771,21 @@ static int tg3_test_nvram(struct tg3 *tp)
err = -EIO;
for (i = 0, j = 0; i < size; i += 4, j++) {
- if ((err = tg3_nvram_read_le(tp, i, &buf[j])) != 0)
+ u32 val;
+
+ if ((err = tg3_nvram_read(tp, i, &val)) != 0)
break;
+ buf[j] = cpu_to_le32(val);
}
if (i < size)
goto out;
/* Selfboot format */
- magic = swab32(le32_to_cpu(buf[0]));
- if ((magic & TG3_EEPROM_MAGIC_FW_MSK) ==
+ if ((cpu_to_be32(buf[0]) & TG3_EEPROM_MAGIC_FW_MSK) ==
TG3_EEPROM_MAGIC_FW) {
u8 *buf8 = (u8 *) buf, csum8 = 0;
- if ((magic & TG3_EEPROM_SB_REVISION_MASK) ==
+ if ((cpu_to_be32(buf[0]) & TG3_EEPROM_SB_REVISION_MASK) ==
TG3_EEPROM_SB_REVISION_2) {
/* For rev 2, the csum doesn't include the MBA. */
for (i = 0; i < TG3_EEPROM_SB_F1R2_MBA_OFF; i++)
@@ -8803,7 +8806,7 @@ static int tg3_test_nvram(struct tg3 *tp)
goto out;
}
- if ((magic & TG3_EEPROM_MAGIC_HW_MSK) ==
+ if ((cpu_to_be32(buf[0]) & TG3_EEPROM_MAGIC_HW_MSK) ==
TG3_EEPROM_MAGIC_HW) {
u8 data[NVRAM_SELFBOOT_DATA_SIZE];
u8 parity[NVRAM_SELFBOOT_DATA_SIZE];
@@ -8849,12 +8852,12 @@ static int tg3_test_nvram(struct tg3 *tp)
/* Bootstrap checksum at offset 0x10 */
csum = calc_crc((unsigned char *) buf, 0x10);
- if(csum != le32_to_cpu(buf[0x10/4]))
+ if(csum != cpu_to_le32(buf[0x10/4]))
goto out;
/* Manufacturing block starts at offset 0x74, checksum at 0xfc */
csum = calc_crc((unsigned char *) &buf[0x74/4], 0x88);
- if (csum != le32_to_cpu(buf[0xfc/4]))
+ if (csum != cpu_to_le32(buf[0xfc/4]))
goto out;
err = 0;
@@ -10168,15 +10171,6 @@ static int tg3_nvram_read(struct tg3 *tp, u32 offset, u32 *val)
return ret;
}
-static int tg3_nvram_read_le(struct tg3 *tp, u32 offset, __le32 *val)
-{
- u32 v;
- int res = tg3_nvram_read(tp, offset, &v);
- if (!res)
- *val = cpu_to_le32(v);
- return res;
-}
-
static int tg3_nvram_read_swab(struct tg3 *tp, u32 offset, u32 *val)
{
int err;
@@ -10194,14 +10188,13 @@ static int tg3_nvram_write_block_using_eeprom(struct tg3 *tp,
u32 val;
for (i = 0; i < len; i += 4) {
- u32 addr;
- __le32 data;
+ u32 addr, data;
addr = offset + i;
memcpy(&data, buf + i, 4);
- tw32(GRC_EEPROM_DATA, le32_to_cpu(data));
+ tw32(GRC_EEPROM_DATA, cpu_to_le32(data));
val = tr32(GRC_EEPROM_ADDR);
tw32(GRC_EEPROM_ADDR, val | EEPROM_ADDR_COMPLETE);
@@ -10251,8 +10244,8 @@ static int tg3_nvram_write_block_unbuffered(struct tg3 *tp, u32 offset, u32 len,
phy_addr = offset & ~pagemask;
for (j = 0; j < pagesize; j += 4) {
- if ((ret = tg3_nvram_read_le(tp, phy_addr + j,
- (__le32 *) (tmp + j))))
+ if ((ret = tg3_nvram_read(tp, phy_addr + j,
+ (u32 *) (tmp + j))))
break;
}
if (ret)
@@ -10296,11 +10289,10 @@ static int tg3_nvram_write_block_unbuffered(struct tg3 *tp, u32 offset, u32 len,
break;
for (j = 0; j < pagesize; j += 4) {
- __be32 data;
+ u32 data;
- data = *((__be32 *) (tmp + j));
- /* swab32(le32_to_cpu(data)), actually */
- tw32(NVRAM_WRDATA, be32_to_cpu(data));
+ data = *((u32 *) (tmp + j));
+ tw32(NVRAM_WRDATA, cpu_to_be32(data));
tw32(NVRAM_ADDR, phy_addr + j);
@@ -10334,11 +10326,10 @@ static int tg3_nvram_write_block_buffered(struct tg3 *tp, u32 offset, u32 len,
int i, ret = 0;
for (i = 0; i < len; i += 4, offset += 4) {
- u32 page_off, phy_addr, nvram_cmd;
- __be32 data;
+ u32 data, page_off, phy_addr, nvram_cmd;
memcpy(&data, buf + i, 4);
- tw32(NVRAM_WRDATA, be32_to_cpu(data));
+ tw32(NVRAM_WRDATA, cpu_to_be32(data));
page_off = offset % tp->nvram_pagesize;
@@ -10840,7 +10831,6 @@ static void __devinit tg3_read_partno(struct tg3 *tp)
vpd_cap = pci_find_capability(tp->pdev, PCI_CAP_ID_VPD);
for (i = 0; i < 256; i += 4) {
u32 tmp, j = 0;
- __le32 v;
u16 tmp16;
pci_write_config_word(tp->pdev, vpd_cap + PCI_VPD_ADDR,
@@ -10857,8 +10847,8 @@ static void __devinit tg3_read_partno(struct tg3 *tp)
pci_read_config_dword(tp->pdev, vpd_cap + PCI_VPD_DATA,
&tmp);
- v = cpu_to_le32(tmp);
- memcpy(&vpd_data[i], &v, 4);
+ tmp = cpu_to_le32(tmp);
+ memcpy(&vpd_data[i], &tmp, 4);
}
}
@@ -10951,11 +10941,11 @@ static void __devinit tg3_read_fw_ver(struct tg3 *tp)
offset = offset + ver_offset - start;
for (i = 0; i < 16; i += 4) {
- __le32 v;
- if (tg3_nvram_read_le(tp, offset + i, &v))
+ if (tg3_nvram_read(tp, offset + i, &val))
return;
- memcpy(tp->fw_ver + i, &v, 4);
+ val = le32_to_cpu(val);
+ memcpy(tp->fw_ver + i, &val, 4);
}
if (!(tp->tg3_flags & TG3_FLAG_ENABLE_ASF) ||
@@ -10993,19 +10983,19 @@ static void __devinit tg3_read_fw_ver(struct tg3 *tp)
tp->fw_ver[bcnt++] = ' ';
for (i = 0; i < 4; i++) {
- __le32 v;
- if (tg3_nvram_read_le(tp, offset, &v))
+ if (tg3_nvram_read(tp, offset, &val))
return;
- offset += sizeof(v);
+ val = le32_to_cpu(val);
+ offset += sizeof(val);
- if (bcnt > TG3_VER_SIZE - sizeof(v)) {
- memcpy(&tp->fw_ver[bcnt], &v, TG3_VER_SIZE - bcnt);
+ if (bcnt > TG3_VER_SIZE - sizeof(val)) {
+ memcpy(&tp->fw_ver[bcnt], &val, TG3_VER_SIZE - bcnt);
break;
}
- memcpy(&tp->fw_ver[bcnt], &v, sizeof(v));
- bcnt += sizeof(v);
+ memcpy(&tp->fw_ver[bcnt], &val, sizeof(val));
+ bcnt += sizeof(val);
}
tp->fw_ver[TG3_VER_SIZE - 1] = 0;
diff --git a/trunk/drivers/net/tokenring/3c359.c b/trunk/drivers/net/tokenring/3c359.c
index 44a06f8b588f..5d31519a6c67 100644
--- a/trunk/drivers/net/tokenring/3c359.c
+++ b/trunk/drivers/net/tokenring/3c359.c
@@ -570,7 +570,7 @@ static int xl_open(struct net_device *dev)
struct xl_private *xl_priv=netdev_priv(dev);
u8 __iomem *xl_mmio = xl_priv->xl_mmio ;
u8 i ;
- __le16 hwaddr[3] ; /* Should be u8[6] but we get word return values */
+ u16 hwaddr[3] ; /* Should be u8[6] but we get word return values */
int open_err ;
u16 switchsettings, switchsettings_eeprom ;
@@ -580,12 +580,15 @@ static int xl_open(struct net_device *dev)
}
/*
- * Read the information from the EEPROM that we need.
+ * Read the information from the EEPROM that we need. I know we
+ * should use ntohs, but the word gets stored reversed in the 16
+ * bit field anyway and it all works its self out when we memcpy
+ * it into dev->dev_addr.
*/
- hwaddr[0] = cpu_to_le16(xl_ee_read(dev,0x10));
- hwaddr[1] = cpu_to_le16(xl_ee_read(dev,0x11));
- hwaddr[2] = cpu_to_le16(xl_ee_read(dev,0x12));
+ hwaddr[0] = xl_ee_read(dev,0x10) ;
+ hwaddr[1] = xl_ee_read(dev,0x11) ;
+ hwaddr[2] = xl_ee_read(dev,0x12) ;
/* Ring speed */
@@ -662,8 +665,8 @@ static int xl_open(struct net_device *dev)
break ;
skb->dev = dev ;
- xl_priv->xl_rx_ring[i].upfragaddr = cpu_to_le32(pci_map_single(xl_priv->pdev, skb->data,xl_priv->pkt_buf_sz, PCI_DMA_FROMDEVICE));
- xl_priv->xl_rx_ring[i].upfraglen = cpu_to_le32(xl_priv->pkt_buf_sz) | RXUPLASTFRAG;
+ xl_priv->xl_rx_ring[i].upfragaddr = pci_map_single(xl_priv->pdev, skb->data,xl_priv->pkt_buf_sz, PCI_DMA_FROMDEVICE) ;
+ xl_priv->xl_rx_ring[i].upfraglen = xl_priv->pkt_buf_sz | RXUPLASTFRAG;
xl_priv->rx_ring_skb[i] = skb ;
}
@@ -677,7 +680,7 @@ static int xl_open(struct net_device *dev)
xl_priv->rx_ring_tail = 0 ;
xl_priv->rx_ring_dma_addr = pci_map_single(xl_priv->pdev,xl_priv->xl_rx_ring, sizeof(struct xl_rx_desc) * XL_RX_RING_SIZE, PCI_DMA_TODEVICE) ;
for (i=0;i<(xl_priv->rx_ring_no-1);i++) {
- xl_priv->xl_rx_ring[i].upnextptr = cpu_to_le32(xl_priv->rx_ring_dma_addr + (sizeof (struct xl_rx_desc) * (i+1)));
+ xl_priv->xl_rx_ring[i].upnextptr = xl_priv->rx_ring_dma_addr + (sizeof (struct xl_rx_desc) * (i+1)) ;
}
xl_priv->xl_rx_ring[i].upnextptr = 0 ;
@@ -695,7 +698,7 @@ static int xl_open(struct net_device *dev)
* Setup the first dummy DPD entry for polling to start working.
*/
- xl_priv->xl_tx_ring[0].framestartheader = TXDPDEMPTY;
+ xl_priv->xl_tx_ring[0].framestartheader = TXDPDEMPTY ;
xl_priv->xl_tx_ring[0].buffer = 0 ;
xl_priv->xl_tx_ring[0].buffer_length = 0 ;
xl_priv->xl_tx_ring[0].dnnextptr = 0 ;
@@ -808,17 +811,17 @@ static int xl_open_hw(struct net_device *dev)
return open_err ;
} else {
writel( (MEM_WORD_READ | 0xD0000 | xl_priv->srb) + 8, xl_mmio + MMIO_MAC_ACCESS_CMD) ;
- xl_priv->asb = swab16(readw(xl_mmio + MMIO_MACDATA)) ;
+ xl_priv->asb = ntohs(readw(xl_mmio + MMIO_MACDATA)) ;
printk(KERN_INFO "%s: Adapter Opened Details: ",dev->name) ;
printk("ASB: %04x",xl_priv->asb ) ;
writel( (MEM_WORD_READ | 0xD0000 | xl_priv->srb) + 10, xl_mmio + MMIO_MAC_ACCESS_CMD) ;
- printk(", SRB: %04x",swab16(readw(xl_mmio + MMIO_MACDATA)) ) ;
+ printk(", SRB: %04x",ntohs(readw(xl_mmio + MMIO_MACDATA)) ) ;
writel( (MEM_WORD_READ | 0xD0000 | xl_priv->srb) + 12, xl_mmio + MMIO_MAC_ACCESS_CMD) ;
- xl_priv->arb = swab16(readw(xl_mmio + MMIO_MACDATA)) ;
+ xl_priv->arb = ntohs(readw(xl_mmio + MMIO_MACDATA)) ;
printk(", ARB: %04x \n",xl_priv->arb ) ;
writel( (MEM_WORD_READ | 0xD0000 | xl_priv->srb) + 14, xl_mmio + MMIO_MAC_ACCESS_CMD) ;
- vsoff = swab16(readw(xl_mmio + MMIO_MACDATA)) ;
+ vsoff = ntohs(readw(xl_mmio + MMIO_MACDATA)) ;
/*
* Interesting, sending the individual characters directly to printk was causing klogd to use
@@ -870,15 +873,16 @@ static int xl_open_hw(struct net_device *dev)
static void adv_rx_ring(struct net_device *dev) /* Advance rx_ring, cut down on bloat in xl_rx */
{
struct xl_private *xl_priv=netdev_priv(dev);
- int n = xl_priv->rx_ring_tail;
- int prev_ring_loc;
-
- prev_ring_loc = (n + XL_RX_RING_SIZE - 1) & (XL_RX_RING_SIZE - 1);
- xl_priv->xl_rx_ring[prev_ring_loc].upnextptr = cpu_to_le32(xl_priv->rx_ring_dma_addr + (sizeof (struct xl_rx_desc) * n));
- xl_priv->xl_rx_ring[n].framestatus = 0;
- xl_priv->xl_rx_ring[n].upnextptr = 0;
- xl_priv->rx_ring_tail++;
- xl_priv->rx_ring_tail &= (XL_RX_RING_SIZE-1);
+ int prev_ring_loc ;
+
+ prev_ring_loc = (xl_priv->rx_ring_tail + XL_RX_RING_SIZE - 1) & (XL_RX_RING_SIZE - 1);
+ xl_priv->xl_rx_ring[prev_ring_loc].upnextptr = xl_priv->rx_ring_dma_addr + (sizeof (struct xl_rx_desc) * xl_priv->rx_ring_tail) ;
+ xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].framestatus = 0 ;
+ xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upnextptr = 0 ;
+ xl_priv->rx_ring_tail++ ;
+ xl_priv->rx_ring_tail &= (XL_RX_RING_SIZE-1) ;
+
+ return ;
}
static void xl_rx(struct net_device *dev)
@@ -910,7 +914,7 @@ static void xl_rx(struct net_device *dev)
temp_ring_loc &= (XL_RX_RING_SIZE-1) ;
}
- frame_length = le32_to_cpu(xl_priv->xl_rx_ring[temp_ring_loc].framestatus) & 0x7FFF;
+ frame_length = xl_priv->xl_rx_ring[temp_ring_loc].framestatus & 0x7FFF ;
skb = dev_alloc_skb(frame_length) ;
@@ -927,29 +931,29 @@ static void xl_rx(struct net_device *dev)
}
while (xl_priv->rx_ring_tail != temp_ring_loc) {
- copy_len = le32_to_cpu(xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfraglen) & 0x7FFF;
+ copy_len = xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfraglen & 0x7FFF ;
frame_length -= copy_len ;
- pci_dma_sync_single_for_cpu(xl_priv->pdev,le32_to_cpu(xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr),xl_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE);
+ pci_dma_sync_single_for_cpu(xl_priv->pdev,xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr,xl_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ;
skb_copy_from_linear_data(xl_priv->rx_ring_skb[xl_priv->rx_ring_tail],
skb_put(skb, copy_len),
copy_len);
- pci_dma_sync_single_for_device(xl_priv->pdev,le32_to_cpu(xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr),xl_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE);
+ pci_dma_sync_single_for_device(xl_priv->pdev,xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr,xl_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ;
adv_rx_ring(dev) ;
}
/* Now we have found the last fragment */
- pci_dma_sync_single_for_cpu(xl_priv->pdev,le32_to_cpu(xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr),xl_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE);
+ pci_dma_sync_single_for_cpu(xl_priv->pdev,xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr,xl_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ;
skb_copy_from_linear_data(xl_priv->rx_ring_skb[xl_priv->rx_ring_tail],
skb_put(skb,copy_len), frame_length);
/* memcpy(skb_put(skb,frame_length), bus_to_virt(xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr), frame_length) ; */
- pci_dma_sync_single_for_device(xl_priv->pdev,le32_to_cpu(xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr),xl_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE);
+ pci_dma_sync_single_for_device(xl_priv->pdev,xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr,xl_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ;
adv_rx_ring(dev) ;
skb->protocol = tr_type_trans(skb,dev) ;
netif_rx(skb) ;
} else { /* Single Descriptor Used, simply swap buffers over, fast path */
- frame_length = le32_to_cpu(xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].framestatus) & 0x7FFF;
+ frame_length = xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].framestatus & 0x7FFF ;
skb = dev_alloc_skb(xl_priv->pkt_buf_sz) ;
@@ -962,13 +966,13 @@ static void xl_rx(struct net_device *dev)
}
skb2 = xl_priv->rx_ring_skb[xl_priv->rx_ring_tail] ;
- pci_unmap_single(xl_priv->pdev, le32_to_cpu(xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr), xl_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ;
+ pci_unmap_single(xl_priv->pdev, xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr, xl_priv->pkt_buf_sz,PCI_DMA_FROMDEVICE) ;
skb_put(skb2, frame_length) ;
skb2->protocol = tr_type_trans(skb2,dev) ;
xl_priv->rx_ring_skb[xl_priv->rx_ring_tail] = skb ;
- xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr = cpu_to_le32(pci_map_single(xl_priv->pdev,skb->data,xl_priv->pkt_buf_sz, PCI_DMA_FROMDEVICE));
- xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfraglen = cpu_to_le32(xl_priv->pkt_buf_sz) | RXUPLASTFRAG;
+ xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr = pci_map_single(xl_priv->pdev,skb->data,xl_priv->pkt_buf_sz, PCI_DMA_FROMDEVICE) ;
+ xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfraglen = xl_priv->pkt_buf_sz | RXUPLASTFRAG ;
adv_rx_ring(dev) ;
xl_priv->xl_stats.rx_packets++ ;
xl_priv->xl_stats.rx_bytes += frame_length ;
@@ -1018,7 +1022,7 @@ static void xl_freemem(struct net_device *dev)
for (i=0;irx_ring_skb[xl_priv->rx_ring_tail]) ;
- pci_unmap_single(xl_priv->pdev,le32_to_cpu(xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr),xl_priv->pkt_buf_sz, PCI_DMA_FROMDEVICE);
+ pci_unmap_single(xl_priv->pdev,xl_priv->xl_rx_ring[xl_priv->rx_ring_tail].upfragaddr,xl_priv->pkt_buf_sz, PCI_DMA_FROMDEVICE) ;
xl_priv->rx_ring_tail++ ;
xl_priv->rx_ring_tail &= XL_RX_RING_SIZE-1;
}
@@ -1177,9 +1181,9 @@ static int xl_xmit(struct sk_buff *skb, struct net_device *dev)
txd = &(xl_priv->xl_tx_ring[tx_head]) ;
txd->dnnextptr = 0 ;
- txd->framestartheader = cpu_to_le32(skb->len) | TXDNINDICATE;
- txd->buffer = cpu_to_le32(pci_map_single(xl_priv->pdev, skb->data, skb->len, PCI_DMA_TODEVICE));
- txd->buffer_length = cpu_to_le32(skb->len) | TXDNFRAGLAST;
+ txd->framestartheader = skb->len | TXDNINDICATE ;
+ txd->buffer = pci_map_single(xl_priv->pdev, skb->data, skb->len, PCI_DMA_TODEVICE) ;
+ txd->buffer_length = skb->len | TXDNFRAGLAST ;
xl_priv->tx_ring_skb[tx_head] = skb ;
xl_priv->xl_stats.tx_packets++ ;
xl_priv->xl_stats.tx_bytes += skb->len ;
@@ -1195,7 +1199,7 @@ static int xl_xmit(struct sk_buff *skb, struct net_device *dev)
xl_priv->tx_ring_head &= (XL_TX_RING_SIZE - 1) ;
xl_priv->free_ring_entries-- ;
- xl_priv->xl_tx_ring[tx_prev].dnnextptr = cpu_to_le32(xl_priv->tx_ring_dma_addr + (sizeof (struct xl_tx_desc) * tx_head));
+ xl_priv->xl_tx_ring[tx_prev].dnnextptr = xl_priv->tx_ring_dma_addr + (sizeof (struct xl_tx_desc) * tx_head) ;
/* Sneaky, by doing a read on DnListPtr we can force the card to poll on the DnNextPtr */
/* readl(xl_mmio + MMIO_DNLISTPTR) ; */
@@ -1233,9 +1237,9 @@ static void xl_dn_comp(struct net_device *dev)
while (xl_priv->xl_tx_ring[xl_priv->tx_ring_tail].framestartheader & TXDNCOMPLETE ) {
txd = &(xl_priv->xl_tx_ring[xl_priv->tx_ring_tail]) ;
- pci_unmap_single(xl_priv->pdev, le32_to_cpu(txd->buffer), xl_priv->tx_ring_skb[xl_priv->tx_ring_tail]->len, PCI_DMA_TODEVICE);
+ pci_unmap_single(xl_priv->pdev,txd->buffer, xl_priv->tx_ring_skb[xl_priv->tx_ring_tail]->len, PCI_DMA_TODEVICE) ;
txd->framestartheader = 0 ;
- txd->buffer = cpu_to_le32(0xdeadbeef);
+ txd->buffer = 0xdeadbeef ;
txd->buffer_length = 0 ;
dev_kfree_skb_irq(xl_priv->tx_ring_skb[xl_priv->tx_ring_tail]) ;
xl_priv->tx_ring_tail++ ;
@@ -1503,9 +1507,9 @@ static void xl_arb_cmd(struct net_device *dev)
if (arb_cmd == RING_STATUS_CHANGE) { /* Ring.Status.Change */
writel( ( (MEM_WORD_READ | 0xD0000 | xl_priv->arb) + 6), xl_mmio + MMIO_MAC_ACCESS_CMD) ;
- printk(KERN_INFO "%s: Ring Status Change: New Status = %04x\n", dev->name, swab16(readw(xl_mmio + MMIO_MACDATA) )) ;
+ printk(KERN_INFO "%s: Ring Status Change: New Status = %04x\n", dev->name, ntohs(readw(xl_mmio + MMIO_MACDATA) )) ;
- lan_status = swab16(readw(xl_mmio + MMIO_MACDATA));
+ lan_status = ntohs(readw(xl_mmio + MMIO_MACDATA));
/* Acknowledge interrupt, this tells nic we are done with the arb */
writel(ACK_INTERRUPT | ARBCACK | LATCH_ACK, xl_mmio + MMIO_COMMAND) ;
@@ -1569,7 +1573,7 @@ static void xl_arb_cmd(struct net_device *dev)
printk(KERN_INFO "Received.Data \n") ;
#endif
writel( ((MEM_WORD_READ | 0xD0000 | xl_priv->arb) + 6), xl_mmio + MMIO_MAC_ACCESS_CMD) ;
- xl_priv->mac_buffer = swab16(readw(xl_mmio + MMIO_MACDATA)) ;
+ xl_priv->mac_buffer = ntohs(readw(xl_mmio + MMIO_MACDATA)) ;
/* Now we are going to be really basic here and not do anything
* with the data at all. The tech docs do not give me enough
@@ -1630,7 +1634,7 @@ static void xl_asb_cmd(struct net_device *dev)
writeb(0x81, xl_mmio + MMIO_MACDATA) ;
writel(MEM_WORD_WRITE | 0xd0000 | xl_priv->asb | 6, xl_mmio + MMIO_MAC_ACCESS_CMD) ;
- writew(swab16(xl_priv->mac_buffer), xl_mmio + MMIO_MACDATA) ;
+ writew(ntohs(xl_priv->mac_buffer), xl_mmio + MMIO_MACDATA) ;
xl_wait_misr_flags(dev) ;
diff --git a/trunk/drivers/net/tokenring/3c359.h b/trunk/drivers/net/tokenring/3c359.h
index b880cba0f6fd..05c860368852 100644
--- a/trunk/drivers/net/tokenring/3c359.h
+++ b/trunk/drivers/net/tokenring/3c359.h
@@ -156,19 +156,19 @@
#define HOSTERRINT (1<<1)
/* Receive descriptor bits */
-#define RXOVERRUN cpu_to_le32(1<<19)
-#define RXFC cpu_to_le32(1<<21)
-#define RXAR cpu_to_le32(1<<22)
-#define RXUPDCOMPLETE cpu_to_le32(1<<23)
-#define RXUPDFULL cpu_to_le32(1<<24)
-#define RXUPLASTFRAG cpu_to_le32(1<<31)
+#define RXOVERRUN (1<<19)
+#define RXFC (1<<21)
+#define RXAR (1<<22)
+#define RXUPDCOMPLETE (1<<23)
+#define RXUPDFULL (1<<24)
+#define RXUPLASTFRAG (1<<31)
/* Transmit descriptor bits */
-#define TXDNCOMPLETE cpu_to_le32(1<<16)
-#define TXTXINDICATE cpu_to_le32(1<<27)
-#define TXDPDEMPTY cpu_to_le32(1<<29)
-#define TXDNINDICATE cpu_to_le32(1<<31)
-#define TXDNFRAGLAST cpu_to_le32(1<<31)
+#define TXDNCOMPLETE (1<<16)
+#define TXTXINDICATE (1<<27)
+#define TXDPDEMPTY (1<<29)
+#define TXDNINDICATE (1<<31)
+#define TXDNFRAGLAST (1<<31)
/* Interrupts to Acknowledge */
#define LATCH_ACK 1
@@ -232,17 +232,17 @@
/* 3c359 data structures */
struct xl_tx_desc {
- __le32 dnnextptr;
- __le32 framestartheader;
- __le32 buffer;
- __le32 buffer_length;
+ u32 dnnextptr ;
+ u32 framestartheader ;
+ u32 buffer ;
+ u32 buffer_length ;
};
struct xl_rx_desc {
- __le32 upnextptr;
- __le32 framestatus;
- __le32 upfragaddr;
- __le32 upfraglen;
+ u32 upnextptr ;
+ u32 framestatus ;
+ u32 upfragaddr ;
+ u32 upfraglen ;
};
struct xl_private {
diff --git a/trunk/drivers/net/tulip/de4x5.c b/trunk/drivers/net/tulip/de4x5.c
index 6e8b18a3b3cc..41f34bb91cad 100644
--- a/trunk/drivers/net/tulip/de4x5.c
+++ b/trunk/drivers/net/tulip/de4x5.c
@@ -911,7 +911,7 @@ static int de4x5_init(struct net_device *dev);
static int de4x5_sw_reset(struct net_device *dev);
static int de4x5_rx(struct net_device *dev);
static int de4x5_tx(struct net_device *dev);
-static void de4x5_ast(struct net_device *dev);
+static int de4x5_ast(struct net_device *dev);
static int de4x5_txur(struct net_device *dev);
static int de4x5_rx_ovfc(struct net_device *dev);
@@ -984,9 +984,11 @@ static int test_bad_enet(struct net_device *dev, int status);
static int an_exception(struct de4x5_private *lp);
static char *build_setup_frame(struct net_device *dev, int mode);
static void disable_ast(struct net_device *dev);
+static void enable_ast(struct net_device *dev, u32 time_out);
static long de4x5_switch_mac_port(struct net_device *dev);
static int gep_rd(struct net_device *dev);
static void gep_wr(s32 data, struct net_device *dev);
+static void timeout(struct net_device *dev, void (*fn)(u_long data), u_long data, u_long msec);
static void yawn(struct net_device *dev, int state);
static void de4x5_parse_params(struct net_device *dev);
static void de4x5_dbg_open(struct net_device *dev);
@@ -1137,8 +1139,6 @@ de4x5_hw_init(struct net_device *dev, u_long iobase, struct device *gendev)
lp->gendev = gendev;
spin_lock_init(&lp->lock);
init_timer(&lp->timer);
- lp->timer.function = (void (*)(unsigned long))de4x5_ast;
- lp->timer.data = (unsigned long)dev;
de4x5_parse_params(dev);
/*
@@ -1311,7 +1311,7 @@ de4x5_open(struct net_device *dev)
lp->state = OPEN;
de4x5_dbg_open(dev);
- if (request_irq(dev->irq, de4x5_interrupt, IRQF_SHARED,
+ if (request_irq(dev->irq, (void *)de4x5_interrupt, IRQF_SHARED,
lp->adapter_name, dev)) {
printk("de4x5_open(): Requested IRQ%d is busy - attemping FAST/SHARE...", dev->irq);
if (request_irq(dev->irq, de4x5_interrupt, IRQF_DISABLED | IRQF_SHARED,
@@ -1737,29 +1737,27 @@ de4x5_tx(struct net_device *dev)
return 0;
}
-static void
+static int
de4x5_ast(struct net_device *dev)
{
- struct de4x5_private *lp = netdev_priv(dev);
- int next_tick = DE4X5_AUTOSENSE_MS;
- int dt;
-
- if (lp->useSROM)
- next_tick = srom_autoconf(dev);
- else if (lp->chipset == DC21140)
- next_tick = dc21140m_autoconf(dev);
- else if (lp->chipset == DC21041)
- next_tick = dc21041_autoconf(dev);
- else if (lp->chipset == DC21040)
- next_tick = dc21040_autoconf(dev);
- lp->linkOK = 0;
+ struct de4x5_private *lp = netdev_priv(dev);
+ int next_tick = DE4X5_AUTOSENSE_MS;
- dt = (next_tick * HZ) / 1000;
+ disable_ast(dev);
- if (!dt)
- dt = 1;
+ if (lp->useSROM) {
+ next_tick = srom_autoconf(dev);
+ } else if (lp->chipset == DC21140) {
+ next_tick = dc21140m_autoconf(dev);
+ } else if (lp->chipset == DC21041) {
+ next_tick = dc21041_autoconf(dev);
+ } else if (lp->chipset == DC21040) {
+ next_tick = dc21040_autoconf(dev);
+ }
+ lp->linkOK = 0;
+ enable_ast(dev, next_tick);
- mod_timer(&lp->timer, jiffies + dt);
+ return 0;
}
static int
@@ -2176,7 +2174,7 @@ srom_search(struct net_device *dev, struct pci_dev *pdev)
for (j=0, i=0; isrom + SROM_HWADD + i);
}
- if (j != 0 && j != 6 * 0xff) {
+ if ((j != 0) && (j != 0x5fa)) {
last.chipset = device;
last.bus = pb;
last.irq = irq;
@@ -2373,19 +2371,30 @@ static struct pci_driver de4x5_pci_driver = {
static int
autoconf_media(struct net_device *dev)
{
- struct de4x5_private *lp = netdev_priv(dev);
- u_long iobase = dev->base_addr;
+ struct de4x5_private *lp = netdev_priv(dev);
+ u_long iobase = dev->base_addr;
+ int next_tick = DE4X5_AUTOSENSE_MS;
- disable_ast(dev);
+ lp->linkOK = 0;
+ lp->c_media = AUTO; /* Bogus last media */
+ disable_ast(dev);
+ inl(DE4X5_MFC); /* Zero the lost frames counter */
+ lp->media = INIT;
+ lp->tcount = 0;
- lp->c_media = AUTO; /* Bogus last media */
- inl(DE4X5_MFC); /* Zero the lost frames counter */
- lp->media = INIT;
- lp->tcount = 0;
+ if (lp->useSROM) {
+ next_tick = srom_autoconf(dev);
+ } else if (lp->chipset == DC21040) {
+ next_tick = dc21040_autoconf(dev);
+ } else if (lp->chipset == DC21041) {
+ next_tick = dc21041_autoconf(dev);
+ } else if (lp->chipset == DC21140) {
+ next_tick = dc21140m_autoconf(dev);
+ }
- de4x5_ast(dev);
+ enable_ast(dev, next_tick);
- return lp->media;
+ return (lp->media);
}
/*
@@ -4009,22 +4018,20 @@ DevicePresent(struct net_device *dev, u_long aprom_addr)
outl(0, aprom_addr); /* Reset Ethernet Address ROM Pointer */
}
} else { /* Read new srom */
- u_short tmp;
- __le16 *p = (__le16 *)((char *)&lp->srom + SROM_HWADD);
+ u_short tmp, *p = (short *)((char *)&lp->srom + SROM_HWADD);
for (i=0; i<(ETH_ALEN>>1); i++) {
tmp = srom_rd(aprom_addr, (SROM_HWADD>>1) + i);
- j += tmp; /* for check for 0:0:0:0:0:0 or ff:ff:ff:ff:ff:ff */
- *p = cpu_to_le16(tmp);
+ *p = le16_to_cpu(tmp);
+ j += *p++;
}
- if (j == 0 || j == 3 * 0xffff) {
- /* could get 0 only from all-0 and 3 * 0xffff only from all-1 */
- return;
+ if ((j == 0) || (j == 0x2fffd)) {
+ return;
}
- p = (__le16 *)&lp->srom;
+ p=(short *)&lp->srom;
for (i=0; i<(sizeof(struct de4x5_srom)>>1); i++) {
tmp = srom_rd(aprom_addr, i);
- *p++ = cpu_to_le16(tmp);
+ *p++ = le16_to_cpu(tmp);
}
de4x5_dbg_srom((struct de4x5_srom *)&lp->srom);
}
@@ -5153,11 +5160,22 @@ build_setup_frame(struct net_device *dev, int mode)
return pa; /* Points to the next entry */
}
+static void
+enable_ast(struct net_device *dev, u32 time_out)
+{
+ timeout(dev, (void *)&de4x5_ast, (u_long)dev, time_out);
+
+ return;
+}
+
static void
disable_ast(struct net_device *dev)
{
- struct de4x5_private *lp = netdev_priv(dev);
- del_timer_sync(&lp->timer);
+ struct de4x5_private *lp = netdev_priv(dev);
+
+ del_timer(&lp->timer);
+
+ return;
}
static long
@@ -5226,6 +5244,29 @@ gep_rd(struct net_device *dev)
return 0;
}
+static void
+timeout(struct net_device *dev, void (*fn)(u_long data), u_long data, u_long msec)
+{
+ struct de4x5_private *lp = netdev_priv(dev);
+ int dt;
+
+ /* First, cancel any pending timer events */
+ del_timer(&lp->timer);
+
+ /* Convert msec to ticks */
+ dt = (msec * HZ) / 1000;
+ if (dt==0) dt=1;
+
+ /* Set up timer */
+ init_timer(&lp->timer);
+ lp->timer.expires = jiffies + dt;
+ lp->timer.function = fn;
+ lp->timer.data = data;
+ add_timer(&lp->timer);
+
+ return;
+}
+
static void
yawn(struct net_device *dev, int state)
{
diff --git a/trunk/drivers/net/tulip/interrupt.c b/trunk/drivers/net/tulip/interrupt.c
index 6284afd14bbb..365331446387 100644
--- a/trunk/drivers/net/tulip/interrupt.c
+++ b/trunk/drivers/net/tulip/interrupt.c
@@ -117,6 +117,9 @@ int tulip_poll(struct napi_struct *napi, int budget)
int received = 0;
#endif
+ if (!netif_running(dev))
+ goto done;
+
#ifdef CONFIG_TULIP_NAPI_HW_MITIGATION
/* that one buffer is needed for mit activation; or might be a
@@ -148,8 +151,7 @@ int tulip_poll(struct napi_struct *napi, int budget)
if (tulip_debug > 5)
printk(KERN_DEBUG "%s: In tulip_rx(), entry %d %8.8x.\n",
dev->name, entry, status);
-
- if (++work_done >= budget)
+ if (work_done++ >= budget)
goto not_done;
if ((status & 0x38008300) != 0x0300) {
@@ -258,6 +260,8 @@ int tulip_poll(struct napi_struct *napi, int budget)
* finally: amount of IO did not increase at all. */
} while ((ioread32(tp->base_addr + CSR5) & RxIntr));
+done:
+
#ifdef CONFIG_TULIP_NAPI_HW_MITIGATION
/* We use this simplistic scheme for IM. It's proven by
diff --git a/trunk/drivers/net/tulip/tulip_core.c b/trunk/drivers/net/tulip/tulip_core.c
index ed600bf56e78..e5e2c9c4ebfe 100644
--- a/trunk/drivers/net/tulip/tulip_core.c
+++ b/trunk/drivers/net/tulip/tulip_core.c
@@ -797,8 +797,7 @@ static int tulip_close (struct net_device *dev)
tp->rx_ring[i].status = 0; /* Not owned by Tulip chip. */
tp->rx_ring[i].length = 0;
- /* An invalid address. */
- tp->rx_ring[i].buffer1 = cpu_to_le32(0xBADF00D0);
+ tp->rx_ring[i].buffer1 = 0xBADF00D0; /* An invalid address. */
if (skb) {
pci_unmap_single(tp->pdev, mapping, PKT_BUF_SZ,
PCI_DMA_FROMDEVICE);
diff --git a/trunk/drivers/net/tulip/xircom_cb.c b/trunk/drivers/net/tulip/xircom_cb.c
index 8fc7274642eb..70befe33e454 100644
--- a/trunk/drivers/net/tulip/xircom_cb.c
+++ b/trunk/drivers/net/tulip/xircom_cb.c
@@ -83,8 +83,8 @@ static int bufferoffsets[NUMDESCRIPTORS] = {128,2048,4096,6144};
struct xircom_private {
/* Send and receive buffers, kernel-addressable and dma addressable forms */
- __le32 *rx_buffer;
- __le32 *tx_buffer;
+ unsigned int *rx_buffer;
+ unsigned int *tx_buffer;
dma_addr_t rx_dma_handle;
dma_addr_t tx_dma_handle;
@@ -412,20 +412,19 @@ static int xircom_start_xmit(struct sk_buff *skb, struct net_device *dev)
/* FIXME: The specification tells us that the length we send HAS to be a multiple of
4 bytes. */
- card->tx_buffer[4*desc+1] = cpu_to_le32(skb->len);
- if (desc == NUMDESCRIPTORS - 1) /* bit 25: last descriptor of the ring */
- card->tx_buffer[4*desc+1] |= cpu_to_le32(1<<25);
+ card->tx_buffer[4*desc+1] = skb->len;
+ if (desc == NUMDESCRIPTORS-1)
+ card->tx_buffer[4*desc+1] |= (1<<25); /* bit 25: last descriptor of the ring */
- card->tx_buffer[4*desc+1] |= cpu_to_le32(0xF0000000);
+ card->tx_buffer[4*desc+1] |= 0xF0000000;
/* 0xF0... means want interrupts*/
card->tx_skb[desc] = skb;
wmb();
/* This gives the descriptor to the card */
- card->tx_buffer[4*desc] = cpu_to_le32(0x80000000);
+ card->tx_buffer[4*desc] = 0x80000000;
trigger_transmit(card);
- if (card->tx_buffer[nextdescriptor*4] & cpu_to_le32(0x8000000)) {
- /* next descriptor is occupied... */
+ if (((int)card->tx_buffer[nextdescriptor*4])<0) { /* next descriptor is occupied... */
netif_stop_queue(dev);
}
card->transmit_used = nextdescriptor;
@@ -591,7 +590,8 @@ descriptors and programs the addresses into the card.
*/
static void setup_descriptors(struct xircom_private *card)
{
- u32 address;
+ unsigned int val;
+ unsigned int address;
int i;
enter("setup_descriptors");
@@ -604,16 +604,16 @@ static void setup_descriptors(struct xircom_private *card)
for (i=0;i 0x80000000 */
- card->rx_buffer[i*4 + 0] = cpu_to_le32(0x80000000);
+ card->rx_buffer[i*4 + 0] = 0x80000000;
/* Rx Descr1: buffer 1 is 1536 bytes, buffer 2 is 0 bytes */
- card->rx_buffer[i*4 + 1] = cpu_to_le32(1536);
- if (i == NUMDESCRIPTORS - 1) /* bit 25 is "last descriptor" */
- card->rx_buffer[i*4 + 1] |= cpu_to_le32(1 << 25);
+ card->rx_buffer[i*4 + 1] = 1536;
+ if (i==NUMDESCRIPTORS-1)
+ card->rx_buffer[i*4 + 1] |= (1 << 25); /* bit 25 is "last descriptor" */
/* Rx Descr2: address of the buffer
we store the buffer at the 2nd half of the page */
- address = card->rx_dma_handle;
+ address = (unsigned long) card->rx_dma_handle;
card->rx_buffer[i*4 + 2] = cpu_to_le32(address + bufferoffsets[i]);
/* Rx Desc3: address of 2nd buffer -> 0 */
card->rx_buffer[i*4 + 3] = 0;
@@ -621,8 +621,9 @@ static void setup_descriptors(struct xircom_private *card)
wmb();
/* Write the receive descriptor ring address to the card */
- address = card->rx_dma_handle;
- outl(address, card->io_port + CSR3); /* Receive descr list address */
+ address = (unsigned long) card->rx_dma_handle;
+ val = cpu_to_le32(address);
+ outl(val, card->io_port + CSR3); /* Receive descr list address */
/* transmit descriptors */
@@ -632,13 +633,13 @@ static void setup_descriptors(struct xircom_private *card)
/* Tx Descr0: Empty, we own it, no errors -> 0x00000000 */
card->tx_buffer[i*4 + 0] = 0x00000000;
/* Tx Descr1: buffer 1 is 1536 bytes, buffer 2 is 0 bytes */
- card->tx_buffer[i*4 + 1] = cpu_to_le32(1536);
- if (i == NUMDESCRIPTORS - 1) /* bit 25 is "last descriptor" */
- card->tx_buffer[i*4 + 1] |= cpu_to_le32(1 << 25);
+ card->tx_buffer[i*4 + 1] = 1536;
+ if (i==NUMDESCRIPTORS-1)
+ card->tx_buffer[i*4 + 1] |= (1 << 25); /* bit 25 is "last descriptor" */
/* Tx Descr2: address of the buffer
we store the buffer at the 2nd half of the page */
- address = card->tx_dma_handle;
+ address = (unsigned long) card->tx_dma_handle;
card->tx_buffer[i*4 + 2] = cpu_to_le32(address + bufferoffsets[i]);
/* Tx Desc3: address of 2nd buffer -> 0 */
card->tx_buffer[i*4 + 3] = 0;
@@ -646,8 +647,9 @@ static void setup_descriptors(struct xircom_private *card)
wmb();
/* wite the transmit descriptor ring to the card */
- address = card->tx_dma_handle;
- outl(address, card->io_port + CSR4); /* xmit descr list address */
+ address = (unsigned long) card->tx_dma_handle;
+ val =cpu_to_le32(address);
+ outl(val, card->io_port + CSR4); /* xmit descr list address */
leave("setup_descriptors");
}
@@ -1178,7 +1180,7 @@ static void investigate_read_descriptor(struct net_device *dev,struct xircom_pri
int status;
enter("investigate_read_descriptor");
- status = le32_to_cpu(card->rx_buffer[4*descnr]);
+ status = card->rx_buffer[4*descnr];
if ((status > 0)) { /* packet received */
@@ -1208,7 +1210,7 @@ static void investigate_read_descriptor(struct net_device *dev,struct xircom_pri
out:
/* give the buffer back to the card */
- card->rx_buffer[4*descnr] = cpu_to_le32(0x80000000);
+ card->rx_buffer[4*descnr] = 0x80000000;
trigger_receive(card);
}
@@ -1224,7 +1226,7 @@ static void investigate_write_descriptor(struct net_device *dev, struct xircom_p
enter("investigate_write_descriptor");
- status = le32_to_cpu(card->tx_buffer[4*descnr]);
+ status = card->tx_buffer[4*descnr];
#if 0
if (status & 0x8000) { /* Major error */
printk(KERN_ERR "Major transmit error status %x \n", status);
diff --git a/trunk/drivers/net/tun.c b/trunk/drivers/net/tun.c
index f8b8c71187a0..1f7644695976 100644
--- a/trunk/drivers/net/tun.c
+++ b/trunk/drivers/net/tun.c
@@ -610,7 +610,7 @@ static int tun_chr_ioctl(struct inode *inode, struct file *file,
tun->flags &= ~TUN_PERSIST;
DBG(KERN_INFO "%s: persist %s\n",
- tun->dev->name, arg ? "enabled" : "disabled");
+ tun->dev->name, arg ? "disabled" : "enabled");
break;
case TUNSETOWNER:
diff --git a/trunk/drivers/net/typhoon.c b/trunk/drivers/net/typhoon.c
index f50cb520dffb..94ac5869bb18 100644
--- a/trunk/drivers/net/typhoon.c
+++ b/trunk/drivers/net/typhoon.c
@@ -813,7 +813,8 @@ typhoon_start_tx(struct sk_buff *skb, struct net_device *dev)
first_txd->flags = TYPHOON_TX_DESC | TYPHOON_DESC_VALID;
first_txd->numDesc = 0;
first_txd->len = 0;
- first_txd->tx_addr = (u64)((unsigned long) skb);
+ first_txd->addr = (u64)((unsigned long) skb) & 0xffffffff;
+ first_txd->addrHi = (u64)((unsigned long) skb) >> 32;
first_txd->processFlags = 0;
if(skb->ip_summed == CHECKSUM_PARTIAL) {
@@ -849,8 +850,8 @@ typhoon_start_tx(struct sk_buff *skb, struct net_device *dev)
PCI_DMA_TODEVICE);
txd->flags = TYPHOON_FRAG_DESC | TYPHOON_DESC_VALID;
txd->len = cpu_to_le16(skb->len);
- txd->frag.addr = cpu_to_le32(skb_dma);
- txd->frag.addrHi = 0;
+ txd->addr = cpu_to_le32(skb_dma);
+ txd->addrHi = 0;
first_txd->numDesc++;
} else {
int i, len;
@@ -860,8 +861,8 @@ typhoon_start_tx(struct sk_buff *skb, struct net_device *dev)
PCI_DMA_TODEVICE);
txd->flags = TYPHOON_FRAG_DESC | TYPHOON_DESC_VALID;
txd->len = cpu_to_le16(len);
- txd->frag.addr = cpu_to_le32(skb_dma);
- txd->frag.addrHi = 0;
+ txd->addr = cpu_to_le32(skb_dma);
+ txd->addrHi = 0;
first_txd->numDesc++;
for(i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
@@ -879,8 +880,8 @@ typhoon_start_tx(struct sk_buff *skb, struct net_device *dev)
PCI_DMA_TODEVICE);
txd->flags = TYPHOON_FRAG_DESC | TYPHOON_DESC_VALID;
txd->len = cpu_to_le16(len);
- txd->frag.addr = cpu_to_le32(skb_dma);
- txd->frag.addrHi = 0;
+ txd->addr = cpu_to_le32(skb_dma);
+ txd->addrHi = 0;
first_txd->numDesc++;
}
}
@@ -976,12 +977,12 @@ typhoon_do_get_stats(struct typhoon *tp)
* ethtool_ops->get_{strings,stats}()
*/
stats->tx_packets = le32_to_cpu(s->txPackets);
- stats->tx_bytes = le64_to_cpu(s->txBytes);
+ stats->tx_bytes = le32_to_cpu(s->txBytes);
stats->tx_errors = le32_to_cpu(s->txCarrierLost);
stats->tx_carrier_errors = le32_to_cpu(s->txCarrierLost);
stats->collisions = le32_to_cpu(s->txMultipleCollisions);
stats->rx_packets = le32_to_cpu(s->rxPacketsGood);
- stats->rx_bytes = le64_to_cpu(s->rxBytesGood);
+ stats->rx_bytes = le32_to_cpu(s->rxBytesGood);
stats->rx_fifo_errors = le32_to_cpu(s->rxFifoOverruns);
stats->rx_errors = le32_to_cpu(s->rxFifoOverruns) +
le32_to_cpu(s->BadSSD) + le32_to_cpu(s->rxCrcErrors);
@@ -1055,7 +1056,7 @@ typhoon_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
if(typhoon_issue_command(tp, 1, &xp_cmd, 3, xp_resp) < 0) {
strcpy(info->fw_version, "Unknown runtime");
} else {
- u32 sleep_ver = le32_to_cpu(xp_resp[0].parm2);
+ u32 sleep_ver = xp_resp[0].parm2;
snprintf(info->fw_version, 32, "%02x.%03x.%03x",
sleep_ver >> 24, (sleep_ver >> 12) & 0xfff,
sleep_ver & 0xfff);
@@ -1156,7 +1157,7 @@ typhoon_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
}
INIT_COMMAND_NO_RESPONSE(&xp_cmd, TYPHOON_CMD_XCVR_SELECT);
- xp_cmd.parm1 = xcvr;
+ xp_cmd.parm1 = cpu_to_le16(xcvr);
err = typhoon_issue_command(tp, 1, &xp_cmd, 0, NULL);
if(err < 0)
goto out;
@@ -1319,7 +1320,7 @@ typhoon_init_interface(struct typhoon *tp)
tp->txLoRing.writeRegister = TYPHOON_REG_TX_LO_READY;
tp->txHiRing.writeRegister = TYPHOON_REG_TX_HI_READY;
- tp->txlo_dma_addr = le32_to_cpu(iface->txLoAddr);
+ tp->txlo_dma_addr = iface->txLoAddr;
tp->card_state = Sleeping;
smp_wmb();
@@ -1357,7 +1358,7 @@ typhoon_download_firmware(struct typhoon *tp)
u8 *image_data;
void *dpage;
dma_addr_t dpage_dma;
- __sum16 csum;
+ unsigned int csum;
u32 irqEnabled;
u32 irqMasked;
u32 numSections;
@@ -1449,13 +1450,13 @@ typhoon_download_firmware(struct typhoon *tp)
* summing. Fortunately, due to the properties of
* the checksum, we can do this once, at the end.
*/
- csum = csum_fold(csum_partial_copy_nocheck(image_data,
- dpage, len,
- 0));
+ csum = csum_partial_copy_nocheck(image_data, dpage,
+ len, 0);
+ csum = csum_fold(csum);
+ csum = le16_to_cpu(csum);
iowrite32(len, ioaddr + TYPHOON_REG_BOOT_LENGTH);
- iowrite32(le16_to_cpu((__force __le16)csum),
- ioaddr + TYPHOON_REG_BOOT_CHECKSUM);
+ iowrite32(csum, ioaddr + TYPHOON_REG_BOOT_CHECKSUM);
iowrite32(load_addr,
ioaddr + TYPHOON_REG_BOOT_DEST_ADDR);
iowrite32(0, ioaddr + TYPHOON_REG_BOOT_DATA_HI);
@@ -1550,13 +1551,13 @@ typhoon_clean_tx(struct typhoon *tp, struct transmit_ring *txRing,
if(type == TYPHOON_TX_DESC) {
/* This tx_desc describes a packet.
*/
- unsigned long ptr = tx->tx_addr;
+ unsigned long ptr = tx->addr | ((u64)tx->addrHi << 32);
struct sk_buff *skb = (struct sk_buff *) ptr;
dev_kfree_skb_irq(skb);
} else if(type == TYPHOON_FRAG_DESC) {
/* This tx_desc describes a memory mapping. Free it.
*/
- skb_dma = (dma_addr_t) le32_to_cpu(tx->frag.addr);
+ skb_dma = (dma_addr_t) le32_to_cpu(tx->addr);
dma_len = le16_to_cpu(tx->len);
pci_unmap_single(tp->pdev, skb_dma, dma_len,
PCI_DMA_TODEVICE);
@@ -1595,7 +1596,7 @@ typhoon_recycle_rx_skb(struct typhoon *tp, u32 idx)
struct rx_free *r;
if((ring->lastWrite + sizeof(*r)) % (RXFREE_ENTRIES * sizeof(*r)) ==
- le32_to_cpu(indexes->rxBuffCleared)) {
+ indexes->rxBuffCleared) {
/* no room in ring, just drop the skb
*/
dev_kfree_skb_any(rxb->skb);
@@ -1626,7 +1627,7 @@ typhoon_alloc_rx_skb(struct typhoon *tp, u32 idx)
rxb->skb = NULL;
if((ring->lastWrite + sizeof(*r)) % (RXFREE_ENTRIES * sizeof(*r)) ==
- le32_to_cpu(indexes->rxBuffCleared))
+ indexes->rxBuffCleared)
return -ENOMEM;
skb = dev_alloc_skb(PKT_BUF_SZ);
diff --git a/trunk/drivers/net/typhoon.h b/trunk/drivers/net/typhoon.h
index dd7022ca7354..19df20889b82 100644
--- a/trunk/drivers/net/typhoon.h
+++ b/trunk/drivers/net/typhoon.h
@@ -73,7 +73,7 @@ struct typhoon_indexes {
volatile __le32 txLoCleared;
volatile __le32 txHiCleared;
volatile __le32 rxLoReady;
- volatile __le32 rxBuffCleared;
+ volatile __u32 rxBuffCleared; /* AV: really? */
volatile __le32 cmdCleared;
volatile __le32 respReady;
volatile __le32 rxHiReady;
@@ -166,13 +166,8 @@ struct tx_desc {
#define TYPHOON_DESC_VALID 0x80
u8 numDesc;
__le16 len;
- union {
- struct {
- __le32 addr;
- __le32 addrHi;
- } frag;
- u64 tx_addr; /* opaque for hardware, for TX_DESC */
- };
+ u32 addr;
+ u32 addrHi;
__le32 processFlags;
#define TYPHOON_TX_PF_NO_CRC __constant_cpu_to_le32(0x00000001)
#define TYPHOON_TX_PF_IP_CHKSUM __constant_cpu_to_le32(0x00000002)
@@ -245,8 +240,8 @@ struct rx_desc {
u8 flags;
u8 numDesc;
__le16 frameLen;
- u32 addr; /* opaque, comes from virtAddr */
- u32 addrHi; /* opaque, comes from virtAddrHi */
+ u32 addr;
+ u32 addrHi;
__le32 rxStatus;
#define TYPHOON_RX_ERR_INTERNAL __constant_cpu_to_le32(0x00000000)
#define TYPHOON_RX_ERR_FIFO_UNDERRUN __constant_cpu_to_le32(0x00000001)
diff --git a/trunk/drivers/net/usb/asix.c b/trunk/drivers/net/usb/asix.c
index 569028b2baf2..61daa096de66 100644
--- a/trunk/drivers/net/usb/asix.c
+++ b/trunk/drivers/net/usb/asix.c
@@ -172,76 +172,45 @@ struct asix_data {
};
struct ax88172_int_data {
- __le16 res1;
+ u16 res1;
u8 link;
- __le16 res2;
+ u16 res2;
u8 status;
- __le16 res3;
+ u16 res3;
} __attribute__ ((packed));
static int asix_read_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index,
u16 size, void *data)
{
- void *buf;
- int err = -ENOMEM;
-
devdbg(dev,"asix_read_cmd() cmd=0x%02x value=0x%04x index=0x%04x size=%d",
cmd, value, index, size);
-
- buf = kmalloc(size, GFP_KERNEL);
- if (!buf)
- goto out;
-
- err = usb_control_msg(
+ return usb_control_msg(
dev->udev,
usb_rcvctrlpipe(dev->udev, 0),
cmd,
USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
value,
index,
- buf,
+ data,
size,
USB_CTRL_GET_TIMEOUT);
- if (err == size)
- memcpy(data, buf, size);
- else if (err >= 0)
- err = -EINVAL;
- kfree(buf);
-
-out:
- return err;
}
static int asix_write_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index,
u16 size, void *data)
{
- void *buf = NULL;
- int err = -ENOMEM;
-
devdbg(dev,"asix_write_cmd() cmd=0x%02x value=0x%04x index=0x%04x size=%d",
cmd, value, index, size);
-
- if (data) {
- buf = kmalloc(size, GFP_KERNEL);
- if (!buf)
- goto out;
- memcpy(buf, data, size);
- }
-
- err = usb_control_msg(
+ return usb_control_msg(
dev->udev,
usb_sndctrlpipe(dev->udev, 0),
cmd,
USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
value,
index,
- buf,
+ data,
size,
USB_CTRL_SET_TIMEOUT);
- kfree(buf);
-
-out:
- return err;
}
static void asix_async_cmd_callback(struct urb *urb)
@@ -433,19 +402,25 @@ static inline int asix_set_hw_mii(struct usbnet *dev)
static inline int asix_get_phy_addr(struct usbnet *dev)
{
- u8 buf[2];
- int ret = asix_read_cmd(dev, AX_CMD_READ_PHY_ID, 0, 0, 2, buf);
+ int ret = 0;
+ void *buf;
devdbg(dev, "asix_get_phy_addr()");
- if (ret < 0) {
+ buf = kmalloc(2, GFP_KERNEL);
+ if (!buf)
+ goto out1;
+
+ if ((ret = asix_read_cmd(dev, AX_CMD_READ_PHY_ID,
+ 0, 0, 2, buf)) < 2) {
deverr(dev, "Error reading PHYID register: %02x", ret);
- goto out;
+ goto out2;
}
- devdbg(dev, "asix_get_phy_addr() returning 0x%04x", *((__le16 *)buf));
- ret = buf[1];
-
-out:
+ devdbg(dev, "asix_get_phy_addr() returning 0x%04x", *((u16 *)buf));
+ ret = *((u8 *)buf + 1);
+out2:
+ kfree(buf);
+out1:
return ret;
}
@@ -462,15 +437,22 @@ static int asix_sw_reset(struct usbnet *dev, u8 flags)
static u16 asix_read_rx_ctl(struct usbnet *dev)
{
- __le16 v;
- int ret = asix_read_cmd(dev, AX_CMD_READ_RX_CTL, 0, 0, 2, &v);
+ u16 ret = 0;
+ void *buf;
+
+ buf = kmalloc(2, GFP_KERNEL);
+ if (!buf)
+ goto out1;
- if (ret < 0) {
+ if ((ret = asix_read_cmd(dev, AX_CMD_READ_RX_CTL,
+ 0, 0, 2, buf)) < 2) {
deverr(dev, "Error reading RX_CTL register: %02x", ret);
- goto out;
+ goto out2;
}
- ret = le16_to_cpu(v);
-out:
+ ret = le16_to_cpu(*((u16 *)buf));
+out2:
+ kfree(buf);
+out1:
return ret;
}
@@ -489,15 +471,22 @@ static int asix_write_rx_ctl(struct usbnet *dev, u16 mode)
static u16 asix_read_medium_status(struct usbnet *dev)
{
- __le16 v;
- int ret = asix_read_cmd(dev, AX_CMD_READ_MEDIUM_STATUS, 0, 0, 2, &v);
+ u16 ret = 0;
+ void *buf;
- if (ret < 0) {
+ buf = kmalloc(2, GFP_KERNEL);
+ if (!buf)
+ goto out1;
+
+ if ((ret = asix_read_cmd(dev, AX_CMD_READ_MEDIUM_STATUS,
+ 0, 0, 2, buf)) < 2) {
deverr(dev, "Error reading Medium Status register: %02x", ret);
- goto out;
+ goto out2;
}
- ret = le16_to_cpu(v);
-out:
+ ret = le16_to_cpu(*((u16 *)buf));
+out2:
+ kfree(buf);
+out1:
return ret;
}
@@ -579,30 +568,31 @@ static void asix_set_multicast(struct net_device *net)
static int asix_mdio_read(struct net_device *netdev, int phy_id, int loc)
{
struct usbnet *dev = netdev_priv(netdev);
- __le16 res;
+ u16 res;
mutex_lock(&dev->phy_mutex);
asix_set_sw_mii(dev);
asix_read_cmd(dev, AX_CMD_READ_MII_REG, phy_id,
- (__u16)loc, 2, &res);
+ (__u16)loc, 2, (u16 *)&res);
asix_set_hw_mii(dev);
mutex_unlock(&dev->phy_mutex);
- devdbg(dev, "asix_mdio_read() phy_id=0x%02x, loc=0x%02x, returns=0x%04x", phy_id, loc, le16_to_cpu(res));
+ devdbg(dev, "asix_mdio_read() phy_id=0x%02x, loc=0x%02x, returns=0x%04x", phy_id, loc, le16_to_cpu(res & 0xffff));
- return le16_to_cpu(res);
+ return le16_to_cpu(res & 0xffff);
}
static void
asix_mdio_write(struct net_device *netdev, int phy_id, int loc, int val)
{
struct usbnet *dev = netdev_priv(netdev);
- __le16 res = cpu_to_le16(val);
+ u16 res = cpu_to_le16(val);
devdbg(dev, "asix_mdio_write() phy_id=0x%02x, loc=0x%02x, val=0x%04x", phy_id, loc, val);
mutex_lock(&dev->phy_mutex);
asix_set_sw_mii(dev);
- asix_write_cmd(dev, AX_CMD_WRITE_MII_REG, phy_id, (__u16)loc, 2, &res);
+ asix_write_cmd(dev, AX_CMD_WRITE_MII_REG, phy_id,
+ (__u16)loc, 2, (u16 *)&res);
asix_set_hw_mii(dev);
mutex_unlock(&dev->phy_mutex);
}
@@ -654,6 +644,7 @@ asix_set_wol(struct net_device *net, struct ethtool_wolinfo *wolinfo)
{
struct usbnet *dev = netdev_priv(net);
u8 opt = 0;
+ u8 buf[1];
if (wolinfo->wolopts & WAKE_PHY)
opt |= AX_MONITOR_LINK;
@@ -663,7 +654,7 @@ asix_set_wol(struct net_device *net, struct ethtool_wolinfo *wolinfo)
opt |= AX_MONITOR_MODE;
if (asix_write_cmd(dev, AX_CMD_WRITE_MONITOR_MODE,
- opt, 0, 0, NULL) < 0)
+ opt, 0, 0, &buf) < 0)
return -EINVAL;
return 0;
@@ -681,7 +672,7 @@ static int asix_get_eeprom(struct net_device *net,
struct ethtool_eeprom *eeprom, u8 *data)
{
struct usbnet *dev = netdev_priv(net);
- __le16 *ebuf = (__le16 *)data;
+ u16 *ebuf = (u16 *)data;
int i;
/* Crude hack to ensure that we don't overwrite memory
@@ -810,7 +801,7 @@ static int ax88172_link_reset(struct usbnet *dev)
static int ax88172_bind(struct usbnet *dev, struct usb_interface *intf)
{
int ret = 0;
- u8 buf[ETH_ALEN];
+ void *buf;
int i;
unsigned long gpio_bits = dev->driver_info->data;
struct asix_data *data = (struct asix_data *)&dev->data;
@@ -819,23 +810,30 @@ static int ax88172_bind(struct usbnet *dev, struct usb_interface *intf)
usbnet_get_endpoints(dev,intf);
+ buf = kmalloc(ETH_ALEN, GFP_KERNEL);
+ if(!buf) {
+ ret = -ENOMEM;
+ goto out1;
+ }
+
/* Toggle the GPIOs in a manufacturer/model specific way */
for (i = 2; i >= 0; i--) {
if ((ret = asix_write_cmd(dev, AX_CMD_WRITE_GPIOS,
(gpio_bits >> (i * 8)) & 0xff, 0, 0,
- NULL)) < 0)
- goto out;
+ buf)) < 0)
+ goto out2;
msleep(5);
}
if ((ret = asix_write_rx_ctl(dev, 0x80)) < 0)
- goto out;
+ goto out2;
/* Get the MAC address */
+ memset(buf, 0, ETH_ALEN);
if ((ret = asix_read_cmd(dev, AX88172_CMD_READ_NODE_ID,
- 0, 0, ETH_ALEN, buf)) < 0) {
+ 0, 0, 6, buf)) < 0) {
dbg("read AX_CMD_READ_NODE_ID failed: %d", ret);
- goto out;
+ goto out2;
}
memcpy(dev->net->dev_addr, buf, ETH_ALEN);
@@ -857,8 +855,9 @@ static int ax88172_bind(struct usbnet *dev, struct usb_interface *intf)
mii_nway_restart(&dev->mii);
return 0;
-
-out:
+out2:
+ kfree(buf);
+out1:
return ret;
}
@@ -901,58 +900,66 @@ static int ax88772_link_reset(struct usbnet *dev)
static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
{
int ret, embd_phy;
+ void *buf;
u16 rx_ctl;
struct asix_data *data = (struct asix_data *)&dev->data;
- u8 buf[ETH_ALEN];
u32 phyid;
data->eeprom_len = AX88772_EEPROM_LEN;
usbnet_get_endpoints(dev,intf);
+ buf = kmalloc(6, GFP_KERNEL);
+ if(!buf) {
+ dbg ("Cannot allocate memory for buffer");
+ ret = -ENOMEM;
+ goto out1;
+ }
+
if ((ret = asix_write_gpio(dev,
AX_GPIO_RSE | AX_GPIO_GPO_2 | AX_GPIO_GPO2EN, 5)) < 0)
- goto out;
+ goto out2;
/* 0x10 is the phy id of the embedded 10/100 ethernet phy */
embd_phy = ((asix_get_phy_addr(dev) & 0x1f) == 0x10 ? 1 : 0);
if ((ret = asix_write_cmd(dev, AX_CMD_SW_PHY_SELECT,
- embd_phy, 0, 0, NULL)) < 0) {
+ embd_phy, 0, 0, buf)) < 0) {
dbg("Select PHY #1 failed: %d", ret);
- goto out;
+ goto out2;
}
if ((ret = asix_sw_reset(dev, AX_SWRESET_IPPD | AX_SWRESET_PRL)) < 0)
- goto out;
+ goto out2;
msleep(150);
if ((ret = asix_sw_reset(dev, AX_SWRESET_CLEAR)) < 0)
- goto out;
+ goto out2;
msleep(150);
if (embd_phy) {
if ((ret = asix_sw_reset(dev, AX_SWRESET_IPRL)) < 0)
- goto out;
+ goto out2;
}
else {
if ((ret = asix_sw_reset(dev, AX_SWRESET_PRTE)) < 0)
- goto out;
+ goto out2;
}
msleep(150);
rx_ctl = asix_read_rx_ctl(dev);
dbg("RX_CTL is 0x%04x after software reset", rx_ctl);
if ((ret = asix_write_rx_ctl(dev, 0x0000)) < 0)
- goto out;
+ goto out2;
rx_ctl = asix_read_rx_ctl(dev);
dbg("RX_CTL is 0x%04x setting to 0x0000", rx_ctl);
/* Get the MAC address */
+ memset(buf, 0, ETH_ALEN);
if ((ret = asix_read_cmd(dev, AX_CMD_READ_NODE_ID,
0, 0, ETH_ALEN, buf)) < 0) {
dbg("Failed to read MAC address: %d", ret);
- goto out;
+ goto out2;
}
memcpy(dev->net->dev_addr, buf, ETH_ALEN);
@@ -969,12 +976,12 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
dbg("PHYID=0x%08x", phyid);
if ((ret = asix_sw_reset(dev, AX_SWRESET_PRL)) < 0)
- goto out;
+ goto out2;
msleep(150);
if ((ret = asix_sw_reset(dev, AX_SWRESET_IPRL | AX_SWRESET_PRL)) < 0)
- goto out;
+ goto out2;
msleep(150);
@@ -987,18 +994,18 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
mii_nway_restart(&dev->mii);
if ((ret = asix_write_medium_mode(dev, AX88772_MEDIUM_DEFAULT)) < 0)
- goto out;
+ goto out2;
if ((ret = asix_write_cmd(dev, AX_CMD_WRITE_IPG0,
AX88772_IPG0_DEFAULT | AX88772_IPG1_DEFAULT,
- AX88772_IPG2_DEFAULT, 0, NULL)) < 0) {
+ AX88772_IPG2_DEFAULT, 0, buf)) < 0) {
dbg("Write IPG,IPG1,IPG2 failed: %d", ret);
- goto out;
+ goto out2;
}
/* Set RX_CTL to default values with 2k buffer, and enable cactus */
if ((ret = asix_write_rx_ctl(dev, AX_DEFAULT_RX_CTL)) < 0)
- goto out;
+ goto out2;
rx_ctl = asix_read_rx_ctl(dev);
dbg("RX_CTL is 0x%04x after all initializations", rx_ctl);
@@ -1006,15 +1013,20 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf)
rx_ctl = asix_read_medium_status(dev);
dbg("Medium Status is 0x%04x after all initializations", rx_ctl);
+ kfree(buf);
+
/* Asix framing packs multiple eth frames into a 2K usb bulk transfer */
if (dev->driver_info->flags & FLAG_FRAMING_AX) {
/* hard_mtu is still the default - the device does not support
jumbo eth frames */
dev->rx_urb_size = 2048;
}
+
return 0;
-out:
+out2:
+ kfree(buf);
+out1:
return ret;
}
@@ -1183,16 +1195,23 @@ static int ax88178_bind(struct usbnet *dev, struct usb_interface *intf)
{
struct asix_data *data = (struct asix_data *)&dev->data;
int ret;
- u8 buf[ETH_ALEN];
- __le16 eeprom;
- u8 status;
+ void *buf;
+ u16 eeprom;
int gpio0 = 0;
u32 phyid;
usbnet_get_endpoints(dev,intf);
- asix_read_cmd(dev, AX_CMD_READ_GPIOS, 0, 0, 1, &status);
- dbg("GPIO Status: 0x%04x", status);
+ buf = kmalloc(6, GFP_KERNEL);
+ if(!buf) {
+ dbg ("Cannot allocate memory for buffer");
+ ret = -ENOMEM;
+ goto out1;
+ }
+
+ eeprom = 0;
+ asix_read_cmd(dev, AX_CMD_READ_GPIOS, 0, 0, 1, &eeprom);
+ dbg("GPIO Status: 0x%04x", eeprom);
asix_write_cmd(dev, AX_CMD_WRITE_ENABLE, 0, 0, 0, NULL);
asix_read_cmd(dev, AX_CMD_READ_EEPROM, 0x0017, 0, 2, &eeprom);
@@ -1200,19 +1219,19 @@ static int ax88178_bind(struct usbnet *dev, struct usb_interface *intf)
dbg("EEPROM index 0x17 is 0x%04x", eeprom);
- if (eeprom == cpu_to_le16(0xffff)) {
+ if (eeprom == 0xffff) {
data->phymode = PHY_MODE_MARVELL;
data->ledmode = 0;
gpio0 = 1;
} else {
- data->phymode = le16_to_cpu(eeprom) & 7;
- data->ledmode = le16_to_cpu(eeprom) >> 8;
- gpio0 = (le16_to_cpu(eeprom) & 0x80) ? 0 : 1;
+ data->phymode = eeprom & 7;
+ data->ledmode = eeprom >> 8;
+ gpio0 = (eeprom & 0x80) ? 0 : 1;
}
dbg("GPIO0: %d, PhyMode: %d", gpio0, data->phymode);
asix_write_gpio(dev, AX_GPIO_RSE | AX_GPIO_GPO_1 | AX_GPIO_GPO1EN, 40);
- if ((le16_to_cpu(eeprom) >> 8) != 1) {
+ if ((eeprom >> 8) != 1) {
asix_write_gpio(dev, 0x003c, 30);
asix_write_gpio(dev, 0x001c, 300);
asix_write_gpio(dev, 0x003c, 30);
@@ -1231,10 +1250,11 @@ static int ax88178_bind(struct usbnet *dev, struct usb_interface *intf)
asix_write_rx_ctl(dev, 0);
/* Get the MAC address */
+ memset(buf, 0, ETH_ALEN);
if ((ret = asix_read_cmd(dev, AX_CMD_READ_NODE_ID,
0, 0, ETH_ALEN, buf)) < 0) {
dbg("Failed to read MAC address: %d", ret);
- goto out;
+ goto out2;
}
memcpy(dev->net->dev_addr, buf, ETH_ALEN);
@@ -1269,10 +1289,12 @@ static int ax88178_bind(struct usbnet *dev, struct usb_interface *intf)
mii_nway_restart(&dev->mii);
if ((ret = asix_write_medium_mode(dev, AX88178_MEDIUM_DEFAULT)) < 0)
- goto out;
+ goto out2;
if ((ret = asix_write_rx_ctl(dev, AX_DEFAULT_RX_CTL)) < 0)
- goto out;
+ goto out2;
+
+ kfree(buf);
/* Asix framing packs multiple eth frames into a 2K usb bulk transfer */
if (dev->driver_info->flags & FLAG_FRAMING_AX) {
@@ -1280,9 +1302,12 @@ static int ax88178_bind(struct usbnet *dev, struct usb_interface *intf)
jumbo eth frames */
dev->rx_urb_size = 2048;
}
+
return 0;
-out:
+out2:
+ kfree(buf);
+out1:
return ret;
}
diff --git a/trunk/drivers/net/usb/kaweth.c b/trunk/drivers/net/usb/kaweth.c
index 569ad8bfd383..58a53a641754 100644
--- a/trunk/drivers/net/usb/kaweth.c
+++ b/trunk/drivers/net/usb/kaweth.c
@@ -70,7 +70,7 @@
#define KAWETH_TX_TIMEOUT (5 * HZ)
#define KAWETH_SCRATCH_SIZE 32
#define KAWETH_FIRMWARE_BUF_SIZE 4096
-#define KAWETH_CONTROL_TIMEOUT (30000)
+#define KAWETH_CONTROL_TIMEOUT (30 * HZ)
#define KAWETH_STATUS_BROKEN 0x0000001
#define KAWETH_STATUS_CLOSING 0x0000002
diff --git a/trunk/drivers/net/usb/mcs7830.c b/trunk/drivers/net/usb/mcs7830.c
index 5ea7411e1337..f55a5951733a 100644
--- a/trunk/drivers/net/usb/mcs7830.c
+++ b/trunk/drivers/net/usb/mcs7830.c
@@ -94,7 +94,7 @@ static int mcs7830_get_reg(struct usbnet *dev, u16 index, u16 size, void *data)
ret = usb_control_msg(xdev, usb_rcvctrlpipe(xdev, 0), MCS7830_RD_BREQ,
MCS7830_RD_BMREQ, 0x0000, index, data,
- size, MCS7830_CTRL_TIMEOUT);
+ size, msecs_to_jiffies(MCS7830_CTRL_TIMEOUT));
return ret;
}
@@ -105,7 +105,7 @@ static int mcs7830_set_reg(struct usbnet *dev, u16 index, u16 size, void *data)
ret = usb_control_msg(xdev, usb_sndctrlpipe(xdev, 0), MCS7830_WR_BREQ,
MCS7830_WR_BMREQ, 0x0000, index, data,
- size, MCS7830_CTRL_TIMEOUT);
+ size, msecs_to_jiffies(MCS7830_CTRL_TIMEOUT));
return ret;
}
diff --git a/trunk/drivers/net/veth.c b/trunk/drivers/net/veth.c
index 3f67a29593bc..fdd1e034569d 100644
--- a/trunk/drivers/net/veth.c
+++ b/trunk/drivers/net/veth.c
@@ -15,7 +15,7 @@
#include
#include
-#include
+#include
#define DRV_NAME "veth"
#define DRV_VERSION "1.0"
@@ -459,7 +459,19 @@ static __init int veth_init(void)
static __exit void veth_exit(void)
{
- rtnl_link_unregister(&veth_link_ops);
+ struct veth_priv *priv, *next;
+
+ rtnl_lock();
+ /*
+ * cannot trust __rtnl_link_unregister() to unregister all
+ * devices, as each ->dellink call will remove two devices
+ * from the list at once.
+ */
+ list_for_each_entry_safe(priv, next, &veth_list, list)
+ veth_dellink(priv->dev);
+
+ __rtnl_link_unregister(&veth_link_ops);
+ rtnl_unlock();
}
module_init(veth_init);
diff --git a/trunk/drivers/net/wan/cycx_x25.c b/trunk/drivers/net/wan/cycx_x25.c
index d3b28b01b9f9..8a1778cf98d1 100644
--- a/trunk/drivers/net/wan/cycx_x25.c
+++ b/trunk/drivers/net/wan/cycx_x25.c
@@ -503,7 +503,7 @@ static int cycx_netdevice_init(struct net_device *dev)
dev->addr_len = 0; /* hardware address length */
if (!chan->svc)
- *(__be16*)dev->dev_addr = htons(chan->lcn);
+ *(u16*)dev->dev_addr = htons(chan->lcn);
/* Initialize hardware parameters (just for reference) */
dev->irq = wandev->irq;
@@ -565,7 +565,7 @@ static int cycx_netdevice_hard_header(struct sk_buff *skb,
const void *daddr, const void *saddr,
unsigned len)
{
- skb->protocol = htons(type);
+ skb->protocol = type;
return dev->hard_header_len;
}
@@ -600,15 +600,15 @@ static int cycx_netdevice_hard_start_xmit(struct sk_buff *skb,
struct cycx_device *card = chan->card;
if (!chan->svc)
- chan->protocol = ntohs(skb->protocol);
+ chan->protocol = skb->protocol;
if (card->wandev.state != WAN_CONNECTED)
++chan->ifstats.tx_dropped;
else if (chan->svc && chan->protocol &&
- chan->protocol != ntohs(skb->protocol)) {
+ chan->protocol != skb->protocol) {
printk(KERN_INFO
"%s: unsupported Ethertype 0x%04X on interface %s!\n",
- card->devname, ntohs(skb->protocol), dev->name);
+ card->devname, skb->protocol, dev->name);
++chan->ifstats.tx_errors;
} else if (chan->protocol == ETH_P_IP) {
switch (chan->state) {
@@ -1401,7 +1401,7 @@ static void cycx_x25_set_chan_state(struct net_device *dev, u8 state)
switch (state) {
case WAN_CONNECTED:
string_state = "connected!";
- *(__be16*)dev->dev_addr = htons(chan->lcn);
+ *(u16*)dev->dev_addr = htons(chan->lcn);
netif_wake_queue(dev);
reset_timer(dev);
diff --git a/trunk/drivers/net/wan/dscc4.c b/trunk/drivers/net/wan/dscc4.c
index c6f26e28e376..33dc713b5301 100644
--- a/trunk/drivers/net/wan/dscc4.c
+++ b/trunk/drivers/net/wan/dscc4.c
@@ -139,21 +139,19 @@ struct thingie {
};
struct TxFD {
- __le32 state;
- __le32 next;
- __le32 data;
- __le32 complete;
+ u32 state;
+ u32 next;
+ u32 data;
+ u32 complete;
u32 jiffies; /* Allows sizeof(TxFD) == sizeof(RxFD) + extra hack */
- /* FWIW, datasheet calls that "dummy" and says that card
- * never looks at it; neither does the driver */
};
struct RxFD {
- __le32 state1;
- __le32 next;
- __le32 data;
- __le32 state2;
- __le32 end;
+ u32 state1;
+ u32 next;
+ u32 data;
+ u32 state2;
+ u32 end;
};
#define DUMMY_SKB_SIZE 64
@@ -183,7 +181,7 @@ struct RxFD {
#define SCC_REG_START(dpriv) (SCC_START+(dpriv->dev_id)*SCC_OFFSET)
struct dscc4_pci_priv {
- __le32 *iqcfg;
+ u32 *iqcfg;
int cfg_cur;
spinlock_t lock;
struct pci_dev *pdev;
@@ -199,8 +197,8 @@ struct dscc4_dev_priv {
struct RxFD *rx_fd;
struct TxFD *tx_fd;
- __le32 *iqrx;
- __le32 *iqtx;
+ u32 *iqrx;
+ u32 *iqtx;
/* FIXME: check all the volatile are required */
volatile u32 tx_current;
@@ -300,7 +298,7 @@ struct dscc4_dev_priv {
#define BrrExpMask 0x00000f00
#define BrrMultMask 0x0000003f
#define EncodingMask 0x00700000
-#define Hold cpu_to_le32(0x40000000)
+#define Hold 0x40000000
#define SccBusy 0x10000000
#define PowerUp 0x80000000
#define Vis 0x00001000
@@ -309,14 +307,14 @@ struct dscc4_dev_priv {
#define FrameRdo 0x40
#define FrameCrc 0x20
#define FrameRab 0x10
-#define FrameAborted cpu_to_le32(0x00000200)
-#define FrameEnd cpu_to_le32(0x80000000)
-#define DataComplete cpu_to_le32(0x40000000)
+#define FrameAborted 0x00000200
+#define FrameEnd 0x80000000
+#define DataComplete 0x40000000
#define LengthCheck 0x00008000
#define SccEvt 0x02000000
#define NoAck 0x00000200
#define Action 0x00000001
-#define HiDesc cpu_to_le32(0x20000000)
+#define HiDesc 0x20000000
/* SCC events */
#define RxEvt 0xf0000000
@@ -491,8 +489,8 @@ static void dscc4_release_ring(struct dscc4_dev_priv *dpriv)
skbuff = dpriv->tx_skbuff;
for (i = 0; i < TX_RING_SIZE; i++) {
if (*skbuff) {
- pci_unmap_single(pdev, le32_to_cpu(tx_fd->data),
- (*skbuff)->len, PCI_DMA_TODEVICE);
+ pci_unmap_single(pdev, tx_fd->data, (*skbuff)->len,
+ PCI_DMA_TODEVICE);
dev_kfree_skb(*skbuff);
}
skbuff++;
@@ -502,7 +500,7 @@ static void dscc4_release_ring(struct dscc4_dev_priv *dpriv)
skbuff = dpriv->rx_skbuff;
for (i = 0; i < RX_RING_SIZE; i++) {
if (*skbuff) {
- pci_unmap_single(pdev, le32_to_cpu(rx_fd->data),
+ pci_unmap_single(pdev, rx_fd->data,
RX_MAX(HDLC_MAX_MRU), PCI_DMA_FROMDEVICE);
dev_kfree_skb(*skbuff);
}
@@ -524,10 +522,10 @@ static inline int try_get_rx_skb(struct dscc4_dev_priv *dpriv,
dpriv->rx_skbuff[dirty] = skb;
if (skb) {
skb->protocol = hdlc_type_trans(skb, dev);
- rx_fd->data = cpu_to_le32(pci_map_single(dpriv->pci_priv->pdev,
- skb->data, len, PCI_DMA_FROMDEVICE));
+ rx_fd->data = pci_map_single(dpriv->pci_priv->pdev, skb->data,
+ len, PCI_DMA_FROMDEVICE);
} else {
- rx_fd->data = 0;
+ rx_fd->data = (u32) NULL;
ret = -1;
}
return ret;
@@ -589,7 +587,7 @@ static inline int dscc4_xpr_ack(struct dscc4_dev_priv *dpriv)
do {
if (!(dpriv->flags & (NeedIDR | NeedIDT)) ||
- (dpriv->iqtx[cur] & cpu_to_le32(Xpr)))
+ (dpriv->iqtx[cur] & Xpr))
break;
smp_rmb();
schedule_timeout_uninterruptible(10);
@@ -652,9 +650,8 @@ static inline void dscc4_rx_skb(struct dscc4_dev_priv *dpriv,
printk(KERN_DEBUG "%s: skb=0 (%s)\n", dev->name, __FUNCTION__);
goto refill;
}
- pkt_len = TO_SIZE(le32_to_cpu(rx_fd->state2));
- pci_unmap_single(pdev, le32_to_cpu(rx_fd->data),
- RX_MAX(HDLC_MAX_MRU), PCI_DMA_FROMDEVICE);
+ pkt_len = TO_SIZE(rx_fd->state2);
+ pci_unmap_single(pdev, rx_fd->data, RX_MAX(HDLC_MAX_MRU), PCI_DMA_FROMDEVICE);
if ((skb->data[--pkt_len] & FrameOk) == FrameOk) {
stats->rx_packets++;
stats->rx_bytes += pkt_len;
@@ -682,7 +679,7 @@ static inline void dscc4_rx_skb(struct dscc4_dev_priv *dpriv,
}
dscc4_rx_update(dpriv, dev);
rx_fd->state2 = 0x00000000;
- rx_fd->end = cpu_to_le32(0xbabeface);
+ rx_fd->end = 0xbabeface;
}
static void dscc4_free1(struct pci_dev *pdev)
@@ -775,8 +772,8 @@ static int __devinit dscc4_init_one(struct pci_dev *pdev,
}
/* Global interrupt queue */
writel((u32)(((IRQ_RING_SIZE >> 5) - 1) << 20), ioaddr + IQLENR1);
- priv->iqcfg = (__le32 *) pci_alloc_consistent(pdev,
- IRQ_RING_SIZE*sizeof(__le32), &priv->iqcfg_dma);
+ priv->iqcfg = (u32 *) pci_alloc_consistent(pdev,
+ IRQ_RING_SIZE*sizeof(u32), &priv->iqcfg_dma);
if (!priv->iqcfg)
goto err_free_irq_5;
writel(priv->iqcfg_dma, ioaddr + IQCFG);
@@ -789,7 +786,7 @@ static int __devinit dscc4_init_one(struct pci_dev *pdev,
*/
for (i = 0; i < dev_per_card; i++) {
dpriv = priv->root + i;
- dpriv->iqtx = (__le32 *) pci_alloc_consistent(pdev,
+ dpriv->iqtx = (u32 *) pci_alloc_consistent(pdev,
IRQ_RING_SIZE*sizeof(u32), &dpriv->iqtx_dma);
if (!dpriv->iqtx)
goto err_free_iqtx_6;
@@ -797,7 +794,7 @@ static int __devinit dscc4_init_one(struct pci_dev *pdev,
}
for (i = 0; i < dev_per_card; i++) {
dpriv = priv->root + i;
- dpriv->iqrx = (__le32 *) pci_alloc_consistent(pdev,
+ dpriv->iqrx = (u32 *) pci_alloc_consistent(pdev,
IRQ_RING_SIZE*sizeof(u32), &dpriv->iqrx_dma);
if (!dpriv->iqrx)
goto err_free_iqrx_7;
@@ -1159,8 +1156,8 @@ static int dscc4_start_xmit(struct sk_buff *skb, struct net_device *dev)
dpriv->tx_skbuff[next] = skb;
tx_fd = dpriv->tx_fd + next;
tx_fd->state = FrameEnd | TO_STATE_TX(skb->len);
- tx_fd->data = cpu_to_le32(pci_map_single(ppriv->pdev, skb->data, skb->len,
- PCI_DMA_TODEVICE));
+ tx_fd->data = pci_map_single(ppriv->pdev, skb->data, skb->len,
+ PCI_DMA_TODEVICE);
tx_fd->complete = 0x00000000;
tx_fd->jiffies = jiffies;
mb();
@@ -1511,7 +1508,7 @@ static irqreturn_t dscc4_irq(int irq, void *token)
if (state & Cfg) {
if (debug > 0)
printk(KERN_DEBUG "%s: CfgIV\n", DRV_NAME);
- if (priv->iqcfg[priv->cfg_cur++%IRQ_RING_SIZE] & cpu_to_le32(Arf))
+ if (priv->iqcfg[priv->cfg_cur++%IRQ_RING_SIZE] & Arf)
printk(KERN_ERR "%s: %s failed\n", dev->name, "CFG");
if (!(state &= ~Cfg))
goto out;
@@ -1544,7 +1541,7 @@ static void dscc4_tx_irq(struct dscc4_pci_priv *ppriv,
try:
cur = dpriv->iqtx_current%IRQ_RING_SIZE;
- state = le32_to_cpu(dpriv->iqtx[cur]);
+ state = dpriv->iqtx[cur];
if (!state) {
if (debug > 4)
printk(KERN_DEBUG "%s: Tx ISR = 0x%08x\n", dev->name,
@@ -1583,7 +1580,7 @@ static void dscc4_tx_irq(struct dscc4_pci_priv *ppriv,
tx_fd = dpriv->tx_fd + cur;
skb = dpriv->tx_skbuff[cur];
if (skb) {
- pci_unmap_single(ppriv->pdev, le32_to_cpu(tx_fd->data),
+ pci_unmap_single(ppriv->pdev, tx_fd->data,
skb->len, PCI_DMA_TODEVICE);
if (tx_fd->state & FrameEnd) {
stats->tx_packets++;
@@ -1714,7 +1711,7 @@ static void dscc4_rx_irq(struct dscc4_pci_priv *priv,
try:
cur = dpriv->iqrx_current%IRQ_RING_SIZE;
- state = le32_to_cpu(dpriv->iqrx[cur]);
+ state = dpriv->iqrx[cur];
if (!state)
return;
dpriv->iqrx[cur] = 0;
@@ -1758,7 +1755,7 @@ static void dscc4_rx_irq(struct dscc4_pci_priv *priv,
goto try;
rx_fd->state1 &= ~Hold;
rx_fd->state2 = 0x00000000;
- rx_fd->end = cpu_to_le32(0xbabeface);
+ rx_fd->end = 0xbabeface;
//}
goto try;
}
@@ -1837,7 +1834,7 @@ static void dscc4_rx_irq(struct dscc4_pci_priv *priv,
hdlc_stats(dev)->rx_over_errors++;
rx_fd->state1 |= Hold;
rx_fd->state2 = 0x00000000;
- rx_fd->end = cpu_to_le32(0xbabeface);
+ rx_fd->end = 0xbabeface;
} else
dscc4_rx_skb(dpriv, dev);
} while (1);
@@ -1907,9 +1904,8 @@ static struct sk_buff *dscc4_init_dummy_skb(struct dscc4_dev_priv *dpriv)
skb_copy_to_linear_data(skb, version,
strlen(version) % DUMMY_SKB_SIZE);
tx_fd->state = FrameEnd | TO_STATE_TX(DUMMY_SKB_SIZE);
- tx_fd->data = cpu_to_le32(pci_map_single(dpriv->pci_priv->pdev,
- skb->data, DUMMY_SKB_SIZE,
- PCI_DMA_TODEVICE));
+ tx_fd->data = pci_map_single(dpriv->pci_priv->pdev, skb->data,
+ DUMMY_SKB_SIZE, PCI_DMA_TODEVICE);
dpriv->tx_skbuff[last] = skb;
}
return skb;
@@ -1941,8 +1937,8 @@ static int dscc4_init_ring(struct net_device *dev)
tx_fd->state = FrameEnd | TO_STATE_TX(2*DUMMY_SKB_SIZE);
tx_fd->complete = 0x00000000;
/* FIXME: NULL should be ok - to be tried */
- tx_fd->data = cpu_to_le32(dpriv->tx_fd_dma);
- (tx_fd++)->next = cpu_to_le32(dpriv->tx_fd_dma +
+ tx_fd->data = dpriv->tx_fd_dma;
+ (tx_fd++)->next = (u32)(dpriv->tx_fd_dma +
(++i%TX_RING_SIZE)*sizeof(*tx_fd));
} while (i < TX_RING_SIZE);
@@ -1955,12 +1951,12 @@ static int dscc4_init_ring(struct net_device *dev)
/* size set by the host. Multiple of 4 bytes please */
rx_fd->state1 = HiDesc;
rx_fd->state2 = 0x00000000;
- rx_fd->end = cpu_to_le32(0xbabeface);
+ rx_fd->end = 0xbabeface;
rx_fd->state1 |= TO_STATE_RX(HDLC_MAX_MRU);
// FIXME: return value verifiee mais traitement suspect
if (try_get_rx_skb(dpriv, dev) >= 0)
dpriv->rx_dirty++;
- (rx_fd++)->next = cpu_to_le32(dpriv->rx_fd_dma +
+ (rx_fd++)->next = (u32)(dpriv->rx_fd_dma +
(++i%RX_RING_SIZE)*sizeof(*rx_fd));
} while (i < RX_RING_SIZE);
diff --git a/trunk/drivers/net/wan/lmc/lmc_media.c b/trunk/drivers/net/wan/lmc/lmc_media.c
index c9c878cd5c72..574737b55f39 100644
--- a/trunk/drivers/net/wan/lmc/lmc_media.c
+++ b/trunk/drivers/net/wan/lmc/lmc_media.c
@@ -890,8 +890,16 @@ write_av9110 (lmc_softc_t * sc, u_int32_t n, u_int32_t m, u_int32_t v,
static void
lmc_ssi_watchdog (lmc_softc_t * const sc)
{
- u_int16_t mii17 = lmc_mii_readreg (sc, 0, 17);
- if (((mii17 >> 3) & 7) == 7)
+ u_int16_t mii17;
+ struct ssicsr2
+ {
+ unsigned short dtr:1, dsr:1, rts:1, cable:3, crc:1, led0:1, led1:1,
+ led2:1, led3:1, fifo:1, ll:1, rl:1, tm:1, loop:1;
+ };
+ struct ssicsr2 *ssicsr;
+ mii17 = lmc_mii_readreg (sc, 0, 17);
+ ssicsr = (struct ssicsr2 *) &mii17;
+ if (ssicsr->cable == 7)
{
lmc_led_off (sc, LMC_MII16_LED2);
}
diff --git a/trunk/drivers/net/wan/sbni.h b/trunk/drivers/net/wan/sbni.h
index 84264510a8ed..27715e70f28b 100644
--- a/trunk/drivers/net/wan/sbni.h
+++ b/trunk/drivers/net/wan/sbni.h
@@ -44,15 +44,9 @@ enum {
#define PR_RES 0x80
struct sbni_csr1 {
-#ifdef __LITTLE_ENDIAN_BITFIELD
- u8 rxl : 5;
- u8 rate : 2;
- u8 : 1;
-#else
- u8 : 1;
- u8 rate : 2;
- u8 rxl : 5;
-#endif
+ unsigned rxl : 5;
+ unsigned rate : 2;
+ unsigned : 1;
};
/* fields in frame header */
diff --git a/trunk/drivers/net/wireless/Kconfig b/trunk/drivers/net/wireless/Kconfig
index 2c08c0a5a0df..5583719a0dca 100644
--- a/trunk/drivers/net/wireless/Kconfig
+++ b/trunk/drivers/net/wireless/Kconfig
@@ -68,7 +68,7 @@ config WAVELAN
. Some more specific
information is contained in
and in the source code
- .
+ .
You will also need the wireless tools package available from
.
@@ -587,66 +587,15 @@ config ADM8211
config P54_COMMON
tristate "Softmac Prism54 support"
depends on MAC80211 && WLAN_80211 && FW_LOADER && EXPERIMENTAL
- ---help---
- This is common code for isl38xx based cards.
- This module does nothing by itself - the USB/PCI frontends
- also need to be enabled in order to support any devices.
-
- These devices require softmac firmware which can be found at
- http://prism54.org/
-
- If you choose to build a module, it'll be called p54common.
config P54_USB
tristate "Prism54 USB support"
depends on P54_COMMON && USB
select CRC32
- ---help---
- This driver is for USB isl38xx based wireless cards.
- These are USB based adapters found in devices such as:
-
- 3COM 3CRWE254G72
- SMC 2862W-G
- Accton 802.11g WN4501 USB
- Siemens Gigaset USB
- Netgear WG121
- Netgear WG111
- Medion 40900, Roper Europe
- Shuttle PN15, Airvast WM168g, IOGear GWU513
- Linksys WUSB54G
- Linksys WUSB54G Portable
- DLink DWL-G120 Spinnaker
- DLink DWL-G122
- Belkin F5D7050 ver 1000
- Cohiba Proto board
- SMC 2862W-G version 2
- U.S. Robotics U5 802.11g Adapter
- FUJITSU E-5400 USB D1700
- Sagem XG703A
- DLink DWL-G120 Cohiba
- Spinnaker Proto board
- Linksys WUSB54AG
- Inventel UR054G
- Spinnaker DUT
-
- These devices require softmac firmware which can be found at
- http://prism54.org/
-
- If you choose to build a module, it'll be called p54usb.
config P54_PCI
tristate "Prism54 PCI support"
depends on P54_COMMON && PCI
- ---help---
- This driver is for PCI isl38xx based wireless cards.
- This driver supports most devices that are supported by the
- fullmac prism54 driver plus many devices which are not
- supported by the fullmac driver/firmware.
-
- This driver requires softmac firmware which can be found at
- http://prism54.org/
-
- If you choose to build a module, it'll be called p54pci.
source "drivers/net/wireless/iwlwifi/Kconfig"
source "drivers/net/wireless/hostap/Kconfig"
diff --git a/trunk/drivers/net/wireless/b43/b43.h b/trunk/drivers/net/wireless/b43/b43.h
index 7b6fc1ab2b90..a28ad230d63e 100644
--- a/trunk/drivers/net/wireless/b43/b43.h
+++ b/trunk/drivers/net/wireless/b43/b43.h
@@ -273,8 +273,6 @@ enum {
#define B43_PHYTYPE_A 0x00
#define B43_PHYTYPE_B 0x01
#define B43_PHYTYPE_G 0x02
-#define B43_PHYTYPE_N 0x04
-#define B43_PHYTYPE_LP 0x05
/* PHYRegisters */
#define B43_PHY_ILT_A_CTRL 0x0072
diff --git a/trunk/drivers/net/wireless/b43/main.h b/trunk/drivers/net/wireless/b43/main.h
index 08e2e56e48f4..284d17da17d1 100644
--- a/trunk/drivers/net/wireless/b43/main.h
+++ b/trunk/drivers/net/wireless/b43/main.h
@@ -39,11 +39,11 @@
#define PAD_BYTES(nr_bytes) P4D_BYTES( __LINE__ , (nr_bytes))
/* Lightweight function to convert a frequency (in Mhz) to a channel number. */
-static inline u8 b43_freq_to_channel_5ghz(int freq)
+static inline u8 b43_freq_to_channel_a(int freq)
{
return ((freq - 5000) / 5);
}
-static inline u8 b43_freq_to_channel_2ghz(int freq)
+static inline u8 b43_freq_to_channel_bg(int freq)
{
u8 channel;
@@ -54,13 +54,19 @@ static inline u8 b43_freq_to_channel_2ghz(int freq)
return channel;
}
+static inline u8 b43_freq_to_channel(struct b43_wldev *dev, int freq)
+{
+ if (dev->phy.type == B43_PHYTYPE_A)
+ return b43_freq_to_channel_a(freq);
+ return b43_freq_to_channel_bg(freq);
+}
/* Lightweight function to convert a channel number to a frequency (in Mhz). */
-static inline int b43_channel_to_freq_5ghz(u8 channel)
+static inline int b43_channel_to_freq_a(u8 channel)
{
return (5000 + (5 * channel));
}
-static inline int b43_channel_to_freq_2ghz(u8 channel)
+static inline int b43_channel_to_freq_bg(u8 channel)
{
int freq;
@@ -71,6 +77,12 @@ static inline int b43_channel_to_freq_2ghz(u8 channel)
return freq;
}
+static inline int b43_channel_to_freq(struct b43_wldev *dev, u8 channel)
+{
+ if (dev->phy.type == B43_PHYTYPE_A)
+ return b43_channel_to_freq_a(channel);
+ return b43_channel_to_freq_bg(channel);
+}
static inline int b43_is_cck_rate(int rate)
{
diff --git a/trunk/drivers/net/wireless/b43/rfkill.c b/trunk/drivers/net/wireless/b43/rfkill.c
index 11f53cb1139e..98cf70c5fd47 100644
--- a/trunk/drivers/net/wireless/b43/rfkill.c
+++ b/trunk/drivers/net/wireless/b43/rfkill.c
@@ -138,11 +138,8 @@ void b43_rfkill_init(struct b43_wldev *dev)
rfk->rfkill->user_claim_unsupported = 1;
rfk->poll_dev = input_allocate_polled_device();
- if (!rfk->poll_dev) {
- rfkill_free(rfk->rfkill);
- goto err_freed_rfk;
- }
-
+ if (!rfk->poll_dev)
+ goto err_free_rfk;
rfk->poll_dev->private = dev;
rfk->poll_dev->poll = b43_rfkill_poll;
rfk->poll_dev->poll_interval = 1000; /* msecs */
@@ -178,7 +175,8 @@ void b43_rfkill_init(struct b43_wldev *dev)
err_free_polldev:
input_free_polled_device(rfk->poll_dev);
rfk->poll_dev = NULL;
-err_freed_rfk:
+err_free_rfk:
+ rfkill_free(rfk->rfkill);
rfk->rfkill = NULL;
out_error:
rfk->registered = 0;
@@ -197,5 +195,6 @@ void b43_rfkill_exit(struct b43_wldev *dev)
rfkill_unregister(rfk->rfkill);
input_free_polled_device(rfk->poll_dev);
rfk->poll_dev = NULL;
+ rfkill_free(rfk->rfkill);
rfk->rfkill = NULL;
}
diff --git a/trunk/drivers/net/wireless/b43/xmit.c b/trunk/drivers/net/wireless/b43/xmit.c
index 3307ba1856b1..0bd6f8a348a8 100644
--- a/trunk/drivers/net/wireless/b43/xmit.c
+++ b/trunk/drivers/net/wireless/b43/xmit.c
@@ -531,32 +531,21 @@ void b43_rx(struct b43_wldev *dev, struct sk_buff *skb, const void *_rxhdr)
switch (chanstat & B43_RX_CHAN_PHYTYPE) {
case B43_PHYTYPE_A:
status.phymode = MODE_IEEE80211A;
- B43_WARN_ON(1);
- /* FIXME: We don't really know which value the "chanid" contains.
- * So the following assignment might be wrong. */
- status.channel = chanid;
- status.freq = b43_channel_to_freq_5ghz(status.channel);
+ status.freq = chanid;
+ status.channel = b43_freq_to_channel_a(chanid);
+ break;
+ case B43_PHYTYPE_B:
+ status.phymode = MODE_IEEE80211B;
+ status.freq = chanid + 2400;
+ status.channel = b43_freq_to_channel_bg(chanid + 2400);
break;
case B43_PHYTYPE_G:
status.phymode = MODE_IEEE80211G;
- /* chanid is the radio channel cookie value as used
- * to tune the radio. */
status.freq = chanid + 2400;
- status.channel = b43_freq_to_channel_2ghz(status.freq);
- break;
- case B43_PHYTYPE_N:
- status.phymode = 0xDEAD /*FIXME MODE_IEEE80211N*/;
- /* chanid is the SHM channel cookie. Which is the plain
- * channel number in b43. */
- status.channel = chanid;
- if (chanstat & B43_RX_CHAN_5GHZ)
- status.freq = b43_freq_to_channel_5ghz(status.freq);
- else
- status.freq = b43_freq_to_channel_2ghz(status.freq);
+ status.channel = b43_freq_to_channel_bg(chanid + 2400);
break;
default:
B43_WARN_ON(1);
- goto drop;
}
dev->stats.last_rx = jiffies;
diff --git a/trunk/drivers/net/wireless/b43/xmit.h b/trunk/drivers/net/wireless/b43/xmit.h
index 6dc079382f7f..03bddd251618 100644
--- a/trunk/drivers/net/wireless/b43/xmit.h
+++ b/trunk/drivers/net/wireless/b43/xmit.h
@@ -142,56 +142,49 @@ struct b43_rxhdr_fw4 {
} __attribute__ ((__packed__));
/* PHY RX Status 0 */
-#define B43_RX_PHYST0_GAINCTL 0x4000 /* Gain Control */
-#define B43_RX_PHYST0_PLCPHCF 0x0200
-#define B43_RX_PHYST0_PLCPFV 0x0100
-#define B43_RX_PHYST0_SHORTPRMBL 0x0080 /* Received with Short Preamble */
+#define B43_RX_PHYST0_GAINCTL 0x4000 /* Gain Control */
+#define B43_RX_PHYST0_PLCPHCF 0x0200
+#define B43_RX_PHYST0_PLCPFV 0x0100
+#define B43_RX_PHYST0_SHORTPRMBL 0x0080 /* Received with Short Preamble */
#define B43_RX_PHYST0_LCRS 0x0040
-#define B43_RX_PHYST0_ANT 0x0020 /* Antenna */
-#define B43_RX_PHYST0_UNSRATE 0x0010
+#define B43_RX_PHYST0_ANT 0x0020 /* Antenna */
+#define B43_RX_PHYST0_UNSRATE 0x0010
#define B43_RX_PHYST0_CLIP 0x000C
#define B43_RX_PHYST0_CLIP_SHIFT 2
-#define B43_RX_PHYST0_FTYPE 0x0003 /* Frame type */
-#define B43_RX_PHYST0_CCK 0x0000 /* Frame type: CCK */
-#define B43_RX_PHYST0_OFDM 0x0001 /* Frame type: OFDM */
-#define B43_RX_PHYST0_PRE_N 0x0002 /* Pre-standard N-PHY frame */
-#define B43_RX_PHYST0_STD_N 0x0003 /* Standard N-PHY frame */
+#define B43_RX_PHYST0_FTYPE 0x0003 /* Frame type */
+#define B43_RX_PHYST0_CCK 0x0000 /* Frame type: CCK */
+#define B43_RX_PHYST0_OFDM 0x0001 /* Frame type: OFDM */
+#define B43_RX_PHYST0_PRE_N 0x0002 /* Pre-standard N-PHY frame */
+#define B43_RX_PHYST0_STD_N 0x0003 /* Standard N-PHY frame */
/* PHY RX Status 2 */
-#define B43_RX_PHYST2_LNAG 0xC000 /* LNA Gain */
+#define B43_RX_PHYST2_LNAG 0xC000 /* LNA Gain */
#define B43_RX_PHYST2_LNAG_SHIFT 14
-#define B43_RX_PHYST2_PNAG 0x3C00 /* PNA Gain */
+#define B43_RX_PHYST2_PNAG 0x3C00 /* PNA Gain */
#define B43_RX_PHYST2_PNAG_SHIFT 10
-#define B43_RX_PHYST2_FOFF 0x03FF /* F offset */
+#define B43_RX_PHYST2_FOFF 0x03FF /* F offset */
/* PHY RX Status 3 */
-#define B43_RX_PHYST3_DIGG 0x1800 /* DIG Gain */
+#define B43_RX_PHYST3_DIGG 0x1800 /* DIG Gain */
#define B43_RX_PHYST3_DIGG_SHIFT 11
-#define B43_RX_PHYST3_TRSTATE 0x0400 /* TR state */
+#define B43_RX_PHYST3_TRSTATE 0x0400 /* TR state */
/* MAC RX Status */
-#define B43_RX_MAC_RXST_VALID 0x01000000 /* PHY RXST valid */
-#define B43_RX_MAC_TKIP_MICERR 0x00100000 /* TKIP MIC error */
-#define B43_RX_MAC_TKIP_MICATT 0x00080000 /* TKIP MIC attempted */
-#define B43_RX_MAC_AGGTYPE 0x00060000 /* Aggregation type */
-#define B43_RX_MAC_AGGTYPE_SHIFT 17
-#define B43_RX_MAC_AMSDU 0x00010000 /* A-MSDU mask */
-#define B43_RX_MAC_BEACONSENT 0x00008000 /* Beacon sent flag */
-#define B43_RX_MAC_KEYIDX 0x000007E0 /* Key index */
-#define B43_RX_MAC_KEYIDX_SHIFT 5
-#define B43_RX_MAC_DECERR 0x00000010 /* Decrypt error */
-#define B43_RX_MAC_DEC 0x00000008 /* Decryption attempted */
-#define B43_RX_MAC_PADDING 0x00000004 /* Pad bytes present */
-#define B43_RX_MAC_RESP 0x00000002 /* Response frame transmitted */
-#define B43_RX_MAC_FCSERR 0x00000001 /* FCS error */
+#define B43_RX_MAC_BEACONSENT 0x00008000 /* Beacon send flag */
+#define B43_RX_MAC_KEYIDX 0x000007E0 /* Key index */
+#define B43_RX_MAC_KEYIDX_SHIFT 5
+#define B43_RX_MAC_DECERR 0x00000010 /* Decrypt error */
+#define B43_RX_MAC_DEC 0x00000008 /* Decryption attempted */
+#define B43_RX_MAC_PADDING 0x00000004 /* Pad bytes present */
+#define B43_RX_MAC_RESP 0x00000002 /* Response frame transmitted */
+#define B43_RX_MAC_FCSERR 0x00000001 /* FCS error */
/* RX channel */
-#define B43_RX_CHAN_40MHZ 0x1000 /* 40 Mhz channel width */
-#define B43_RX_CHAN_5GHZ 0x0800 /* 5 Ghz band */
-#define B43_RX_CHAN_ID 0x07F8 /* Channel ID */
-#define B43_RX_CHAN_ID_SHIFT 3
-#define B43_RX_CHAN_PHYTYPE 0x0007 /* PHY type */
-
+#define B43_RX_CHAN_GAIN 0xFC00 /* Gain */
+#define B43_RX_CHAN_GAIN_SHIFT 10
+#define B43_RX_CHAN_ID 0x03FC /* Channel ID */
+#define B43_RX_CHAN_ID_SHIFT 2
+#define B43_RX_CHAN_PHYTYPE 0x0003 /* PHY type */
u8 b43_plcp_get_ratecode_cck(const u8 bitrate);
u8 b43_plcp_get_ratecode_ofdm(const u8 bitrate);
diff --git a/trunk/drivers/net/wireless/hostap/hostap_plx.c b/trunk/drivers/net/wireless/hostap/hostap_plx.c
index cbf15d703201..040dc3e36410 100644
--- a/trunk/drivers/net/wireless/hostap/hostap_plx.c
+++ b/trunk/drivers/net/wireless/hostap/hostap_plx.c
@@ -608,7 +608,7 @@ static void prism2_plx_remove(struct pci_dev *pdev)
MODULE_DEVICE_TABLE(pci, prism2_plx_id_table);
-static struct pci_driver prism2_plx_driver = {
+static struct pci_driver prism2_plx_drv_id = {
.name = "hostap_plx",
.id_table = prism2_plx_id_table,
.probe = prism2_plx_probe,
@@ -618,13 +618,13 @@ static struct pci_driver prism2_plx_driver = {
static int __init init_prism2_plx(void)
{
- return pci_register_driver(&prism2_plx_driver);
+ return pci_register_driver(&prism2_plx_drv_id);
}
static void __exit exit_prism2_plx(void)
{
- pci_unregister_driver(&prism2_plx_driver);
+ pci_unregister_driver(&prism2_plx_drv_id);
}
diff --git a/trunk/drivers/net/wireless/ipw2200.c b/trunk/drivers/net/wireless/ipw2200.c
index 003f73f89efa..da51f477e9df 100644
--- a/trunk/drivers/net/wireless/ipw2200.c
+++ b/trunk/drivers/net/wireless/ipw2200.c
@@ -1233,19 +1233,9 @@ static ssize_t show_event_log(struct device *d,
{
struct ipw_priv *priv = dev_get_drvdata(d);
u32 log_len = ipw_get_event_log_len(priv);
- u32 log_size;
- struct ipw_event *log;
+ struct ipw_event log[log_len];
u32 len = 0, i;
- /* not using min() because of its strict type checking */
- log_size = PAGE_SIZE / sizeof(*log) > log_len ?
- sizeof(*log) * log_len : PAGE_SIZE;
- log = kzalloc(log_size, GFP_KERNEL);
- if (!log) {
- IPW_ERROR("Unable to allocate memory for log\n");
- return 0;
- }
- log_len = log_size / sizeof(*log);
ipw_capture_event_log(priv, log_len, log);
len += snprintf(buf + len, PAGE_SIZE - len, "%08X", log_len);
@@ -1254,7 +1244,6 @@ static ssize_t show_event_log(struct device *d,
"\n%08X%08X%08X",
log[i].time, log[i].event, log[i].data);
len += snprintf(buf + len, PAGE_SIZE - len, "\n");
- kfree(log);
return len;
}
@@ -4935,7 +4924,7 @@ static int ipw_queue_reset(struct ipw_priv *priv)
/**
* Reclaim Tx queue entries no more used by NIC.
*
- * When FW advances 'R' index, all entries between old and
+ * When FW adwances 'R' index, all entries between old and
* new 'R' index need to be reclaimed. As result, some free space
* forms. If there is enough free space (> low mark), wake Tx queue.
*
diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl3945-base.c b/trunk/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 1a6b0e0edf6f..3d1da0759b97 100644
--- a/trunk/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/trunk/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -6246,6 +6246,8 @@ static void __iwl_down(struct iwl_priv *priv)
/* Unblock any waiting calls */
wake_up_interruptible_all(&priv->wait_command_queue);
+ iwl_cancel_deferred_work(priv);
+
/* Wipe out the EXIT_PENDING status bit if we are not actually
* exiting the module */
if (!exit_pending)
@@ -6320,8 +6322,6 @@ static void iwl_down(struct iwl_priv *priv)
mutex_lock(&priv->mutex);
__iwl_down(priv);
mutex_unlock(&priv->mutex);
-
- iwl_cancel_deferred_work(priv);
}
#define MAX_HW_RESTARTS 5
@@ -8580,9 +8580,10 @@ static void iwl_pci_remove(struct pci_dev *pdev)
IWL_DEBUG_INFO("*** UNLOAD DRIVER ***\n");
+ mutex_lock(&priv->mutex);
set_bit(STATUS_EXIT_PENDING, &priv->status);
-
- iwl_down(priv);
+ __iwl_down(priv);
+ mutex_unlock(&priv->mutex);
/* Free MAC hash list for ADHOC */
for (i = 0; i < IWL_IBSS_MAC_HASH_SIZE; i++) {
@@ -8641,10 +8642,12 @@ static int iwl_pci_suspend(struct pci_dev *pdev, pm_message_t state)
{
struct iwl_priv *priv = pci_get_drvdata(pdev);
+ mutex_lock(&priv->mutex);
+
set_bit(STATUS_IN_SUSPEND, &priv->status);
/* Take down the device; powers it off, etc. */
- iwl_down(priv);
+ __iwl_down(priv);
if (priv->mac80211_registered)
ieee80211_stop_queues(priv->hw);
@@ -8653,6 +8656,8 @@ static int iwl_pci_suspend(struct pci_dev *pdev, pm_message_t state)
pci_disable_device(pdev);
pci_set_power_state(pdev, PCI_D3hot);
+ mutex_unlock(&priv->mutex);
+
return 0;
}
@@ -8710,6 +8715,8 @@ static int iwl_pci_resume(struct pci_dev *pdev)
printk(KERN_INFO "Coming out of suspend...\n");
+ mutex_lock(&priv->mutex);
+
pci_set_power_state(pdev, PCI_D0);
err = pci_enable_device(pdev);
pci_restore_state(pdev);
@@ -8723,6 +8730,7 @@ static int iwl_pci_resume(struct pci_dev *pdev)
pci_write_config_byte(pdev, 0x41, 0x00);
iwl_resume(priv);
+ mutex_unlock(&priv->mutex);
return 0;
}
diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl4965-base.c b/trunk/drivers/net/wireless/iwlwifi/iwl4965-base.c
index 6cd57c220631..b54fe5e6d529 100644
--- a/trunk/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/trunk/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -6601,6 +6601,8 @@ static void __iwl_down(struct iwl_priv *priv)
/* Unblock any waiting calls */
wake_up_interruptible_all(&priv->wait_command_queue);
+ iwl_cancel_deferred_work(priv);
+
/* Wipe out the EXIT_PENDING status bit if we are not actually
* exiting the module */
if (!exit_pending)
@@ -6675,8 +6677,6 @@ static void iwl_down(struct iwl_priv *priv)
mutex_lock(&priv->mutex);
__iwl_down(priv);
mutex_unlock(&priv->mutex);
-
- iwl_cancel_deferred_work(priv);
}
#define MAX_HW_RESTARTS 5
@@ -9174,9 +9174,10 @@ static void iwl_pci_remove(struct pci_dev *pdev)
IWL_DEBUG_INFO("*** UNLOAD DRIVER ***\n");
+ mutex_lock(&priv->mutex);
set_bit(STATUS_EXIT_PENDING, &priv->status);
-
- iwl_down(priv);
+ __iwl_down(priv);
+ mutex_unlock(&priv->mutex);
/* Free MAC hash list for ADHOC */
for (i = 0; i < IWL_IBSS_MAC_HASH_SIZE; i++) {
@@ -9235,10 +9236,12 @@ static int iwl_pci_suspend(struct pci_dev *pdev, pm_message_t state)
{
struct iwl_priv *priv = pci_get_drvdata(pdev);
+ mutex_lock(&priv->mutex);
+
set_bit(STATUS_IN_SUSPEND, &priv->status);
/* Take down the device; powers it off, etc. */
- iwl_down(priv);
+ __iwl_down(priv);
if (priv->mac80211_registered)
ieee80211_stop_queues(priv->hw);
@@ -9247,6 +9250,8 @@ static int iwl_pci_suspend(struct pci_dev *pdev, pm_message_t state)
pci_disable_device(pdev);
pci_set_power_state(pdev, PCI_D3hot);
+ mutex_unlock(&priv->mutex);
+
return 0;
}
@@ -9304,6 +9309,8 @@ static int iwl_pci_resume(struct pci_dev *pdev)
printk(KERN_INFO "Coming out of suspend...\n");
+ mutex_lock(&priv->mutex);
+
pci_set_power_state(pdev, PCI_D0);
err = pci_enable_device(pdev);
pci_restore_state(pdev);
@@ -9317,6 +9324,7 @@ static int iwl_pci_resume(struct pci_dev *pdev)
pci_write_config_byte(pdev, 0x41, 0x00);
iwl_resume(priv);
+ mutex_unlock(&priv->mutex);
return 0;
}
diff --git a/trunk/drivers/net/wireless/libertas/if_sdio.c b/trunk/drivers/net/wireless/libertas/if_sdio.c
index 4f1efb108c28..b24425f74883 100644
--- a/trunk/drivers/net/wireless/libertas/if_sdio.c
+++ b/trunk/drivers/net/wireless/libertas/if_sdio.c
@@ -871,10 +871,6 @@ static int if_sdio_probe(struct sdio_func *func,
if (sscanf(func->card->info[i],
"ID: %x", &model) == 1)
break;
- if (!strcmp(func->card->info[i], "IBIS Wireless SDIO Card")) {
- model = 4;
- break;
- }
}
if (i == func->card->num_info) {
diff --git a/trunk/drivers/net/wireless/rt2x00/rt2500usb.c b/trunk/drivers/net/wireless/rt2x00/rt2500usb.c
index 18b1f9145389..50775f9234cc 100644
--- a/trunk/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/trunk/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -257,7 +257,7 @@ static const struct rt2x00debug rt2500usb_rt2x00debug = {
static void rt2500usb_config_mac_addr(struct rt2x00_dev *rt2x00dev,
__le32 *mac)
{
- rt2500usb_register_multiwrite(rt2x00dev, MAC_CSR2, mac,
+ rt2500usb_register_multiwrite(rt2x00dev, MAC_CSR2, &mac,
(3 * sizeof(__le16)));
}
diff --git a/trunk/drivers/net/wireless/rt2x00/rt2x00pci.c b/trunk/drivers/net/wireless/rt2x00/rt2x00pci.c
index 04663eb31950..2780df00623c 100644
--- a/trunk/drivers/net/wireless/rt2x00/rt2x00pci.c
+++ b/trunk/drivers/net/wireless/rt2x00/rt2x00pci.c
@@ -124,10 +124,7 @@ void rt2x00pci_rxdone(struct rt2x00_dev *rt2x00dev)
struct data_entry *entry;
struct data_desc *rxd;
struct sk_buff *skb;
- struct ieee80211_hdr *hdr;
struct rxdata_entry_desc desc;
- int header_size;
- int align;
u32 word;
while (1) {
@@ -141,26 +138,17 @@ void rt2x00pci_rxdone(struct rt2x00_dev *rt2x00dev)
memset(&desc, 0x00, sizeof(desc));
rt2x00dev->ops->lib->fill_rxdone(entry, &desc);
- hdr = (struct ieee80211_hdr *)entry->data_addr;
- header_size =
- ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_control));
-
- /*
- * The data behind the ieee80211 header must be
- * aligned on a 4 byte boundary.
- */
- align = header_size % 4;
-
/*
* Allocate the sk_buffer, initialize it and copy
* all data into it.
*/
- skb = dev_alloc_skb(desc.size + align);
+ skb = dev_alloc_skb(desc.size + NET_IP_ALIGN);
if (!skb)
return;
- skb_reserve(skb, align);
- memcpy(skb_put(skb, desc.size), entry->data_addr, desc.size);
+ skb_reserve(skb, NET_IP_ALIGN);
+ skb_put(skb, desc.size);
+ memcpy(skb->data, entry->data_addr, desc.size);
/*
* Send the frame to rt2x00lib for further processing.
diff --git a/trunk/drivers/net/wireless/rt2x00/rt2x00usb.c b/trunk/drivers/net/wireless/rt2x00/rt2x00usb.c
index 568d73847dca..1f5675dd329f 100644
--- a/trunk/drivers/net/wireless/rt2x00/rt2x00usb.c
+++ b/trunk/drivers/net/wireless/rt2x00/rt2x00usb.c
@@ -221,9 +221,7 @@ static void rt2x00usb_interrupt_rxdone(struct urb *urb)
struct data_ring *ring = entry->ring;
struct rt2x00_dev *rt2x00dev = ring->rt2x00dev;
struct sk_buff *skb;
- struct ieee80211_hdr *hdr;
struct rxdata_entry_desc desc;
- int header_size;
int frame_size;
if (!test_bit(DEVICE_ENABLED_RADIO, &rt2x00dev->flags) ||
@@ -245,37 +243,19 @@ static void rt2x00usb_interrupt_rxdone(struct urb *urb)
* Allocate a new sk buffer to replace the current one.
* If allocation fails, we should drop the current frame
* so we can recycle the existing sk buffer for the new frame.
- * As alignment we use 2 and not NET_IP_ALIGN because we need
- * to be sure we have 2 bytes room in the head. (NET_IP_ALIGN
- * can be 0 on some hardware). We use these 2 bytes for frame
- * alignment later, we assume that the chance that
- * header_size % 4 == 2 is bigger then header_size % 2 == 0
- * and thus optimize alignment by reserving the 2 bytes in
- * advance.
*/
frame_size = entry->ring->data_size + entry->ring->desc_size;
- skb = dev_alloc_skb(frame_size + 2);
+ skb = dev_alloc_skb(frame_size + NET_IP_ALIGN);
if (!skb)
goto skip_entry;
- skb_reserve(skb, 2);
+ skb_reserve(skb, NET_IP_ALIGN);
skb_put(skb, frame_size);
/*
- * The data behind the ieee80211 header must be
- * aligned on a 4 byte boundary.
- * After that trim the entire buffer down to only
- * contain the valid frame data excluding the device
- * descriptor.
+ * Trim the skb_buffer to only contain the valid
+ * frame data (so ignore the device's descriptor).
*/
- hdr = (struct ieee80211_hdr *)entry->skb->data;
- header_size =
- ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_control));
-
- if (header_size % 4 == 0) {
- skb_push(entry->skb, 2);
- memmove(entry->skb->data, entry->skb->data + 2, skb->len - 2);
- }
skb_trim(entry->skb, desc.size);
/*
diff --git a/trunk/drivers/net/wireless/rt2x00/rt61pci.c b/trunk/drivers/net/wireless/rt2x00/rt61pci.c
index ecae968ce091..01dbef19d651 100644
--- a/trunk/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/trunk/drivers/net/wireless/rt2x00/rt61pci.c
@@ -1738,7 +1738,6 @@ static void rt61pci_txdone(struct rt2x00_dev *rt2x00dev)
{
struct data_ring *ring;
struct data_entry *entry;
- struct data_entry *entry_done;
struct data_desc *txd;
u32 word;
u32 reg;
@@ -1792,17 +1791,6 @@ static void rt61pci_txdone(struct rt2x00_dev *rt2x00dev)
!rt2x00_get_field32(word, TXD_W0_VALID))
return;
- entry_done = rt2x00_get_data_entry_done(ring);
- while (entry != entry_done) {
- /* Catch up. Just report any entries we missed as
- * failed. */
- WARNING(rt2x00dev,
- "TX status report missed for entry %p\n",
- entry_done);
- rt2x00lib_txdone(entry_done, TX_FAIL_OTHER, 0);
- entry_done = rt2x00_get_data_entry_done(ring);
- }
-
/*
* Obtain the status about this packet.
*/
diff --git a/trunk/drivers/net/wireless/rtl8187_dev.c b/trunk/drivers/net/wireless/rtl8187_dev.c
index bd1ab3b3afc0..e454ae83e97a 100644
--- a/trunk/drivers/net/wireless/rtl8187_dev.c
+++ b/trunk/drivers/net/wireless/rtl8187_dev.c
@@ -38,8 +38,6 @@ static struct usb_device_id rtl8187_table[] __devinitdata = {
{USB_DEVICE(0x0846, 0x6a00)},
/* HP */
{USB_DEVICE(0x03f0, 0xca02)},
- /* Sitecom */
- {USB_DEVICE(0x0df6, 0x000d)},
{}
};
diff --git a/trunk/drivers/net/xen-netfront.c b/trunk/drivers/net/xen-netfront.c
index bca37bf0f545..2a8fc431099f 100644
--- a/trunk/drivers/net/xen-netfront.c
+++ b/trunk/drivers/net/xen-netfront.c
@@ -852,6 +852,11 @@ static int xennet_poll(struct napi_struct *napi, int budget)
spin_lock(&np->rx_lock);
+ if (unlikely(!netif_carrier_ok(dev))) {
+ spin_unlock(&np->rx_lock);
+ return 0;
+ }
+
skb_queue_head_init(&rxq);
skb_queue_head_init(&errq);
skb_queue_head_init(&tmpq);
diff --git a/trunk/drivers/net/yellowfin.c b/trunk/drivers/net/yellowfin.c
index fe6ff3e3d525..87f002ade531 100644
--- a/trunk/drivers/net/yellowfin.c
+++ b/trunk/drivers/net/yellowfin.c
@@ -265,10 +265,10 @@ enum yellowfin_offsets {
/* The Yellowfin Rx and Tx buffer descriptors.
Elements are written as 32 bit for endian portability. */
struct yellowfin_desc {
- __le32 dbdma_cmd;
- __le32 addr;
- __le32 branch_addr;
- __le32 result_status;
+ u32 dbdma_cmd;
+ u32 addr;
+ u32 branch_addr;
+ u32 result_status;
};
struct tx_status_words {
@@ -922,7 +922,7 @@ static irqreturn_t yellowfin_interrupt(int irq, void *dev_instance)
dev->stats.tx_packets++;
dev->stats.tx_bytes += skb->len;
/* Free the original skb. */
- pci_unmap_single(yp->pci_dev, le32_to_cpu(yp->tx_ring[entry].addr),
+ pci_unmap_single(yp->pci_dev, yp->tx_ring[entry].addr,
skb->len, PCI_DMA_TODEVICE);
dev_kfree_skb_irq(skb);
yp->tx_skbuff[entry] = NULL;
@@ -1056,13 +1056,13 @@ static int yellowfin_rx(struct net_device *dev)
if(!desc->result_status)
break;
- pci_dma_sync_single_for_cpu(yp->pci_dev, le32_to_cpu(desc->addr),
+ pci_dma_sync_single_for_cpu(yp->pci_dev, desc->addr,
yp->rx_buf_sz, PCI_DMA_FROMDEVICE);
desc_status = le32_to_cpu(desc->result_status) >> 16;
buf_addr = rx_skb->data;
data_size = (le32_to_cpu(desc->dbdma_cmd) -
le32_to_cpu(desc->result_status)) & 0xffff;
- frame_status = le16_to_cpu(get_unaligned((__le16*)&(buf_addr[data_size - 2])));
+ frame_status = le16_to_cpu(get_unaligned((s16*)&(buf_addr[data_size - 2])));
if (yellowfin_debug > 4)
printk(KERN_DEBUG " yellowfin_rx() status was %4.4x.\n",
frame_status);
@@ -1123,7 +1123,7 @@ static int yellowfin_rx(struct net_device *dev)
if (pkt_len > rx_copybreak) {
skb_put(skb = rx_skb, pkt_len);
pci_unmap_single(yp->pci_dev,
- le32_to_cpu(yp->rx_ring[entry].addr),
+ yp->rx_ring[entry].addr,
yp->rx_buf_sz,
PCI_DMA_FROMDEVICE);
yp->rx_skbuff[entry] = NULL;
@@ -1134,10 +1134,9 @@ static int yellowfin_rx(struct net_device *dev)
skb_reserve(skb, 2); /* 16 byte align the IP header */
skb_copy_to_linear_data(skb, rx_skb->data, pkt_len);
skb_put(skb, pkt_len);
- pci_dma_sync_single_for_device(yp->pci_dev,
- le32_to_cpu(desc->addr),
- yp->rx_buf_sz,
- PCI_DMA_FROMDEVICE);
+ pci_dma_sync_single_for_device(yp->pci_dev, desc->addr,
+ yp->rx_buf_sz,
+ PCI_DMA_FROMDEVICE);
}
skb->protocol = eth_type_trans(skb, dev);
netif_rx(skb);
@@ -1253,7 +1252,7 @@ static int yellowfin_close(struct net_device *dev)
/* Free all the skbuffs in the Rx queue. */
for (i = 0; i < RX_RING_SIZE; i++) {
yp->rx_ring[i].dbdma_cmd = cpu_to_le32(CMD_STOP);
- yp->rx_ring[i].addr = cpu_to_le32(0xBADF00D0); /* An invalid address. */
+ yp->rx_ring[i].addr = 0xBADF00D0; /* An invalid address. */
if (yp->rx_skbuff[i]) {
dev_kfree_skb(yp->rx_skbuff[i]);
}
diff --git a/trunk/drivers/pci/probe.c b/trunk/drivers/pci/probe.c
index c5ca3134513a..2f75d695eed7 100644
--- a/trunk/drivers/pci/probe.c
+++ b/trunk/drivers/pci/probe.c
@@ -455,6 +455,22 @@ struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, int
return child;
}
+static void pci_enable_crs(struct pci_dev *dev)
+{
+ u16 cap, rpctl;
+ int rpcap = pci_find_capability(dev, PCI_CAP_ID_EXP);
+ if (!rpcap)
+ return;
+
+ pci_read_config_word(dev, rpcap + PCI_CAP_FLAGS, &cap);
+ if (((cap & PCI_EXP_FLAGS_TYPE) >> 4) != PCI_EXP_TYPE_ROOT_PORT)
+ return;
+
+ pci_read_config_word(dev, rpcap + PCI_EXP_RTCTL, &rpctl);
+ rpctl |= PCI_EXP_RTCTL_CRSSVE;
+ pci_write_config_word(dev, rpcap + PCI_EXP_RTCTL, rpctl);
+}
+
static void pci_fixup_parent_subordinate_busnr(struct pci_bus *child, int max)
{
struct pci_bus *parent = child->parent;
@@ -501,6 +517,8 @@ int pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max, int pass
pci_write_config_word(dev, PCI_BRIDGE_CONTROL,
bctl & ~PCI_BRIDGE_CTL_MASTER_ABORT);
+ pci_enable_crs(dev);
+
if ((buses & 0xffff00) && !pcibios_assign_all_busses() && !is_cardbus) {
unsigned int cmax, busnr;
/*
diff --git a/trunk/drivers/pci/quirks.c b/trunk/drivers/pci/quirks.c
index 72e0bd5d80ac..26cc4dcf4f0e 100644
--- a/trunk/drivers/pci/quirks.c
+++ b/trunk/drivers/pci/quirks.c
@@ -465,12 +465,6 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_31, quirk
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_0, quirk_ich6_lpc_acpi );
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_2, quirk_ich6_lpc_acpi );
DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_3, quirk_ich6_lpc_acpi );
-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_1, quirk_ich6_lpc_acpi );
-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH8_4, quirk_ich6_lpc_acpi );
-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9_2, quirk_ich6_lpc_acpi );
-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9_4, quirk_ich6_lpc_acpi );
-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9_7, quirk_ich6_lpc_acpi );
-DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9_8, quirk_ich6_lpc_acpi );
/*
* VIA ACPI: One IO region pointed to by longword at
diff --git a/trunk/drivers/pcmcia/pxa2xx_lubbock.c b/trunk/drivers/pcmcia/pxa2xx_lubbock.c
index 4a05802213c8..1510d6cde3e2 100644
--- a/trunk/drivers/pcmcia/pxa2xx_lubbock.c
+++ b/trunk/drivers/pcmcia/pxa2xx_lubbock.c
@@ -213,7 +213,7 @@ static struct pcmcia_low_level lubbock_pcmcia_ops = {
#include "pxa2xx_base.h"
-int pcmcia_lubbock_init(struct sa1111_dev *sadev)
+int __init pcmcia_lubbock_init(struct sa1111_dev *sadev)
{
int ret = -ENODEV;
diff --git a/trunk/drivers/pnp/pnpacpi/rsparser.c b/trunk/drivers/pnp/pnpacpi/rsparser.c
index 6b9840cce0f4..3c5eb374adf8 100644
--- a/trunk/drivers/pnp/pnpacpi/rsparser.c
+++ b/trunk/drivers/pnp/pnpacpi/rsparser.c
@@ -76,7 +76,6 @@ static void pnpacpi_parse_allocated_irqresource(struct pnp_resource_table *res,
int i = 0;
int irq;
int p, t;
- static unsigned char warned;
if (!valid_IRQ(gsi))
return;
@@ -84,10 +83,9 @@ static void pnpacpi_parse_allocated_irqresource(struct pnp_resource_table *res,
while (!(res->irq_resource[i].flags & IORESOURCE_UNSET) &&
i < PNP_MAX_IRQ)
i++;
- if (i >= PNP_MAX_IRQ && !warned) {
+ if (i >= PNP_MAX_IRQ) {
printk(KERN_ERR "pnpacpi: exceeded the max number of IRQ "
"resources: %d \n", PNP_MAX_IRQ);
- warned = 1;
return;
}
/*
@@ -171,7 +169,6 @@ static void pnpacpi_parse_allocated_dmaresource(struct pnp_resource_table *res,
int bus_master, int transfer)
{
int i = 0;
- static unsigned char warned;
while (i < PNP_MAX_DMA &&
!(res->dma_resource[i].flags & IORESOURCE_UNSET))
@@ -186,10 +183,9 @@ static void pnpacpi_parse_allocated_dmaresource(struct pnp_resource_table *res,
}
res->dma_resource[i].start = dma;
res->dma_resource[i].end = dma;
- } else if (!warned) {
+ } else {
printk(KERN_ERR "pnpacpi: exceeded the max number of DMA "
"resources: %d \n", PNP_MAX_DMA);
- warned = 1;
}
}
@@ -197,7 +193,6 @@ static void pnpacpi_parse_allocated_ioresource(struct pnp_resource_table *res,
u64 io, u64 len, int io_decode)
{
int i = 0;
- static unsigned char warned;
while (!(res->port_resource[i].flags & IORESOURCE_UNSET) &&
i < PNP_MAX_PORT)
@@ -212,10 +207,9 @@ static void pnpacpi_parse_allocated_ioresource(struct pnp_resource_table *res,
}
res->port_resource[i].start = io;
res->port_resource[i].end = io + len - 1;
- } else if (!warned) {
+ } else {
printk(KERN_ERR "pnpacpi: exceeded the max number of IO "
"resources: %d \n", PNP_MAX_PORT);
- warned = 1;
}
}
@@ -224,7 +218,6 @@ static void pnpacpi_parse_allocated_memresource(struct pnp_resource_table *res,
int write_protect)
{
int i = 0;
- static unsigned char warned;
while (!(res->mem_resource[i].flags & IORESOURCE_UNSET) &&
(i < PNP_MAX_MEM))
@@ -240,10 +233,9 @@ static void pnpacpi_parse_allocated_memresource(struct pnp_resource_table *res,
res->mem_resource[i].start = mem;
res->mem_resource[i].end = mem + len - 1;
- } else if (!warned) {
+ } else {
printk(KERN_ERR "pnpacpi: exceeded the max number of mem "
"resources: %d\n", PNP_MAX_MEM);
- warned = 1;
}
}
diff --git a/trunk/drivers/ps3/ps3-vuart.c b/trunk/drivers/ps3/ps3-vuart.c
index bb8d5b1eec90..9dea585ef806 100644
--- a/trunk/drivers/ps3/ps3-vuart.c
+++ b/trunk/drivers/ps3/ps3-vuart.c
@@ -1074,6 +1074,7 @@ static int ps3_vuart_probe(struct ps3_system_bus_device *dev)
if (result) {
dev_dbg(&dev->core, "%s:%d: drv->probe failed\n",
__func__, __LINE__);
+ down(&vuart_bus_priv.probe_mutex);
goto fail_probe;
}
diff --git a/trunk/drivers/scsi/Kconfig b/trunk/drivers/scsi/Kconfig
index 184c7ae78519..a6676be87843 100644
--- a/trunk/drivers/scsi/Kconfig
+++ b/trunk/drivers/scsi/Kconfig
@@ -732,7 +732,7 @@ config SCSI_GDTH
This is a driver for RAID/SCSI Disk Array Controllers (EISA/ISA/PCI)
manufactured by Intel Corporation/ICP vortex GmbH. It is documented
in the kernel source in and
- .
+
To compile this driver as a module, choose M here: the
module will be called gdth.
diff --git a/trunk/drivers/scsi/advansys.c b/trunk/drivers/scsi/advansys.c
index 38a1ee2eacd8..9dd3952516c5 100644
--- a/trunk/drivers/scsi/advansys.c
+++ b/trunk/drivers/scsi/advansys.c
@@ -13906,7 +13906,7 @@ static int advansys_release(struct Scsi_Host *shost)
#define ASC_IOADR_TABLE_MAX_IX 11
-static PortAddr _asc_def_iop_base[ASC_IOADR_TABLE_MAX_IX] = {
+static PortAddr _asc_def_iop_base[ASC_IOADR_TABLE_MAX_IX] __devinitdata = {
0x100, 0x0110, 0x120, 0x0130, 0x140, 0x0150, 0x0190,
0x0210, 0x0230, 0x0250, 0x0330
};
diff --git a/trunk/drivers/scsi/qla1280.c b/trunk/drivers/scsi/qla1280.c
index 288640756099..146d540f6281 100644
--- a/trunk/drivers/scsi/qla1280.c
+++ b/trunk/drivers/scsi/qla1280.c
@@ -3041,6 +3041,7 @@ qla1280_32bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp)
int cnt;
int req_cnt;
int seg_cnt;
+ dma_addr_t dma_handle;
u8 dir;
ENTER("qla1280_32bit_start_scsi");
@@ -3049,7 +3050,6 @@ qla1280_32bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp)
cmd->cmnd[0]);
/* Calculate number of entries and segments required. */
- req_cnt = 1;
seg_cnt = scsi_dma_map(cmd);
if (seg_cnt) {
/*
diff --git a/trunk/drivers/scsi/qla2xxx/qla_os.c b/trunk/drivers/scsi/qla2xxx/qla_os.c
index 8ecc0470b8f3..a5bcf1f390b3 100644
--- a/trunk/drivers/scsi/qla2xxx/qla_os.c
+++ b/trunk/drivers/scsi/qla2xxx/qla_os.c
@@ -1831,7 +1831,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
return ret;
}
-static void
+static void __devexit
qla2x00_remove_one(struct pci_dev *pdev)
{
scsi_qla_host_t *ha;
@@ -2965,7 +2965,7 @@ static struct pci_driver qla2xxx_pci_driver = {
},
.id_table = qla2xxx_pci_tbl,
.probe = qla2x00_probe_one,
- .remove = qla2x00_remove_one,
+ .remove = __devexit_p(qla2x00_remove_one),
.err_handler = &qla2xxx_err_handler,
};
diff --git a/trunk/drivers/scsi/scsi_lib.c b/trunk/drivers/scsi/scsi_lib.c
index a9ac5b1b1667..0e81e4cf8876 100644
--- a/trunk/drivers/scsi/scsi_lib.c
+++ b/trunk/drivers/scsi/scsi_lib.c
@@ -1332,7 +1332,7 @@ int scsi_prep_return(struct request_queue *q, struct request *req, int ret)
}
EXPORT_SYMBOL(scsi_prep_return);
-int scsi_prep_fn(struct request_queue *q, struct request *req)
+static int scsi_prep_fn(struct request_queue *q, struct request *req)
{
struct scsi_device *sdev = q->queuedata;
int ret = BLKPREP_KILL;
diff --git a/trunk/drivers/scsi/scsi_priv.h b/trunk/drivers/scsi/scsi_priv.h
index 3f34e9376b0a..eff005951895 100644
--- a/trunk/drivers/scsi/scsi_priv.h
+++ b/trunk/drivers/scsi/scsi_priv.h
@@ -74,9 +74,6 @@ extern struct request_queue *scsi_alloc_queue(struct scsi_device *sdev);
extern void scsi_free_queue(struct request_queue *q);
extern int scsi_init_queue(void);
extern void scsi_exit_queue(void);
-struct request_queue;
-struct request;
-extern int scsi_prep_fn(struct request_queue *, struct request *);
/* scsi_proc.c */
#ifdef CONFIG_SCSI_PROC_FS
diff --git a/trunk/drivers/scsi/scsi_sysfs.c b/trunk/drivers/scsi/scsi_sysfs.c
index 00b386677392..f374fdcb6815 100644
--- a/trunk/drivers/scsi/scsi_sysfs.c
+++ b/trunk/drivers/scsi/scsi_sysfs.c
@@ -373,29 +373,12 @@ static int scsi_bus_resume(struct device * dev)
return err;
}
-static int scsi_bus_remove(struct device *dev)
-{
- struct device_driver *drv = dev->driver;
- struct scsi_device *sdev = to_scsi_device(dev);
- int err = 0;
-
- /* reset the prep_fn back to the default since the
- * driver may have altered it and it's being removed */
- blk_queue_prep_rq(sdev->request_queue, scsi_prep_fn);
-
- if (drv && drv->remove)
- err = drv->remove(dev);
-
- return 0;
-}
-
struct bus_type scsi_bus_type = {
.name = "scsi",
.match = scsi_bus_match,
.uevent = scsi_bus_uevent,
.suspend = scsi_bus_suspend,
.resume = scsi_bus_resume,
- .remove = scsi_bus_remove,
};
int scsi_sysfs_register(void)
diff --git a/trunk/drivers/scsi/scsi_transport_srp.c b/trunk/drivers/scsi/scsi_transport_srp.c
index 65c584db33bd..44a340bd937b 100644
--- a/trunk/drivers/scsi/scsi_transport_srp.c
+++ b/trunk/drivers/scsi/scsi_transport_srp.c
@@ -265,8 +265,7 @@ EXPORT_SYMBOL_GPL(srp_rport_del);
static int do_srp_rport_del(struct device *dev, void *data)
{
- if (scsi_is_srp_rport(dev))
- srp_rport_del(dev_to_rport(dev));
+ srp_rport_del(dev_to_rport(dev));
return 0;
}
diff --git a/trunk/drivers/serial/mpc52xx_uart.c b/trunk/drivers/serial/mpc52xx_uart.c
index 1e3721a0eef7..7e3ba8b455a8 100644
--- a/trunk/drivers/serial/mpc52xx_uart.c
+++ b/trunk/drivers/serial/mpc52xx_uart.c
@@ -36,7 +36,7 @@
* DCD. However, the pin multiplexing aren't changed and should be set either
* by the bootloader or in the platform init code.
*
- * The idx field must be equal to the PSC index (e.g. 0 for PSC1, 1 for PSC2,
+ * The idx field must be equal to the PSC index ( e.g. 0 for PSC1, 1 for PSC2,
* and so on). So the PSC1 is mapped to /dev/ttyPSC0, PSC2 to /dev/ttyPSC1 and
* so on. But be warned, it's an ABSOLUTE REQUIREMENT ! This is needed mainly
* fpr the console code : without this 1:1 mapping, at early boot time, when we
@@ -68,8 +68,8 @@
#include
#include
-#include
-#include
+#include
+#include
#if defined(CONFIG_PPC_MERGE)
#include
@@ -112,18 +112,16 @@ static void mpc52xx_uart_of_enumerate(void);
#endif
#define PSC(port) ((struct mpc52xx_psc __iomem *)((port)->membase))
-#define FIFO(port) ((struct mpc52xx_psc_fifo __iomem *)(PSC(port)+1))
/* Forward declaration of the interruption handling routine */
-static irqreturn_t mpc52xx_uart_int(int irq, void *dev_id);
+static irqreturn_t mpc52xx_uart_int(int irq,void *dev_id);
/* Simple macro to test if a port is console or not. This one is taken
* for serial_core.c and maybe should be moved to serial_core.h ? */
#ifdef CONFIG_SERIAL_CORE_CONSOLE
-#define uart_console(port) \
- ((port)->cons && (port)->cons->index == (port)->line)
+#define uart_console(port) ((port)->cons && (port)->cons->index == (port)->line)
#else
#define uart_console(port) (0)
#endif
@@ -165,7 +163,7 @@ mpc52xx_uart_stop_tx(struct uart_port *port)
{
/* port->lock taken by caller */
port->read_status_mask &= ~MPC52xx_PSC_IMR_TXRDY;
- out_be16(&PSC(port)->mpc52xx_psc_imr, port->read_status_mask);
+ out_be16(&PSC(port)->mpc52xx_psc_imr,port->read_status_mask);
}
static void
@@ -173,7 +171,7 @@ mpc52xx_uart_start_tx(struct uart_port *port)
{
/* port->lock taken by caller */
port->read_status_mask |= MPC52xx_PSC_IMR_TXRDY;
- out_be16(&PSC(port)->mpc52xx_psc_imr, port->read_status_mask);
+ out_be16(&PSC(port)->mpc52xx_psc_imr,port->read_status_mask);
}
static void
@@ -187,7 +185,7 @@ mpc52xx_uart_send_xchar(struct uart_port *port, char ch)
/* Make sure tx interrupts are on */
/* Truly necessary ??? They should be anyway */
port->read_status_mask |= MPC52xx_PSC_IMR_TXRDY;
- out_be16(&PSC(port)->mpc52xx_psc_imr, port->read_status_mask);
+ out_be16(&PSC(port)->mpc52xx_psc_imr,port->read_status_mask);
}
spin_unlock_irqrestore(&port->lock, flags);
@@ -198,7 +196,7 @@ mpc52xx_uart_stop_rx(struct uart_port *port)
{
/* port->lock taken by caller */
port->read_status_mask &= ~MPC52xx_PSC_IMR_RXRDY;
- out_be16(&PSC(port)->mpc52xx_psc_imr, port->read_status_mask);
+ out_be16(&PSC(port)->mpc52xx_psc_imr,port->read_status_mask);
}
static void
@@ -213,10 +211,10 @@ mpc52xx_uart_break_ctl(struct uart_port *port, int ctl)
unsigned long flags;
spin_lock_irqsave(&port->lock, flags);
- if (ctl == -1)
- out_8(&PSC(port)->command, MPC52xx_PSC_START_BRK);
+ if ( ctl == -1 )
+ out_8(&PSC(port)->command,MPC52xx_PSC_START_BRK);
else
- out_8(&PSC(port)->command, MPC52xx_PSC_STOP_BRK);
+ out_8(&PSC(port)->command,MPC52xx_PSC_STOP_BRK);
spin_unlock_irqrestore(&port->lock, flags);
}
@@ -225,7 +223,6 @@ static int
mpc52xx_uart_startup(struct uart_port *port)
{
struct mpc52xx_psc __iomem *psc = PSC(port);
- struct mpc52xx_psc_fifo __iomem *fifo = FIFO(port);
int ret;
/* Request IRQ */
@@ -235,23 +232,23 @@ mpc52xx_uart_startup(struct uart_port *port)
return ret;
/* Reset/activate the port, clear and enable interrupts */
- out_8(&psc->command, MPC52xx_PSC_RST_RX);
- out_8(&psc->command, MPC52xx_PSC_RST_TX);
+ out_8(&psc->command,MPC52xx_PSC_RST_RX);
+ out_8(&psc->command,MPC52xx_PSC_RST_TX);
- out_be32(&psc->sicr, 0); /* UART mode DCD ignored */
+ out_be32(&psc->sicr,0); /* UART mode DCD ignored */
out_be16(&psc->mpc52xx_psc_clock_select, 0xdd00); /* /16 prescaler on */
- out_8(&fifo->rfcntl, 0x00);
- out_be16(&fifo->rfalarm, 0x1ff);
- out_8(&fifo->tfcntl, 0x07);
- out_be16(&fifo->tfalarm, 0x80);
+ out_8(&psc->rfcntl, 0x00);
+ out_be16(&psc->rfalarm, 0x1ff);
+ out_8(&psc->tfcntl, 0x07);
+ out_be16(&psc->tfalarm, 0x80);
port->read_status_mask |= MPC52xx_PSC_IMR_RXRDY | MPC52xx_PSC_IMR_TXRDY;
- out_be16(&psc->mpc52xx_psc_imr, port->read_status_mask);
+ out_be16(&psc->mpc52xx_psc_imr,port->read_status_mask);
- out_8(&psc->command, MPC52xx_PSC_TX_ENABLE);
- out_8(&psc->command, MPC52xx_PSC_RX_ENABLE);
+ out_8(&psc->command,MPC52xx_PSC_TX_ENABLE);
+ out_8(&psc->command,MPC52xx_PSC_RX_ENABLE);
return 0;
}
@@ -262,12 +259,12 @@ mpc52xx_uart_shutdown(struct uart_port *port)
struct mpc52xx_psc __iomem *psc = PSC(port);
/* Shut down the port. Leave TX active if on a console port */
- out_8(&psc->command, MPC52xx_PSC_RST_RX);
+ out_8(&psc->command,MPC52xx_PSC_RST_RX);
if (!uart_console(port))
- out_8(&psc->command, MPC52xx_PSC_RST_TX);
+ out_8(&psc->command,MPC52xx_PSC_RST_TX);
port->read_status_mask = 0;
- out_be16(&psc->mpc52xx_psc_imr, port->read_status_mask);
+ out_be16(&psc->mpc52xx_psc_imr,port->read_status_mask);
/* Release interrupt */
free_irq(port->irq, port);
@@ -275,7 +272,7 @@ mpc52xx_uart_shutdown(struct uart_port *port)
static void
mpc52xx_uart_set_termios(struct uart_port *port, struct ktermios *new,
- struct ktermios *old)
+ struct ktermios *old)
{
struct mpc52xx_psc __iomem *psc = PSC(port);
unsigned long flags;
@@ -287,14 +284,14 @@ mpc52xx_uart_set_termios(struct uart_port *port, struct ktermios *new,
mr1 = 0;
switch (new->c_cflag & CSIZE) {
- case CS5: mr1 |= MPC52xx_PSC_MODE_5_BITS;
- break;
- case CS6: mr1 |= MPC52xx_PSC_MODE_6_BITS;
- break;
- case CS7: mr1 |= MPC52xx_PSC_MODE_7_BITS;
- break;
- case CS8:
- default: mr1 |= MPC52xx_PSC_MODE_8_BITS;
+ case CS5: mr1 |= MPC52xx_PSC_MODE_5_BITS;
+ break;
+ case CS6: mr1 |= MPC52xx_PSC_MODE_6_BITS;
+ break;
+ case CS7: mr1 |= MPC52xx_PSC_MODE_7_BITS;
+ break;
+ case CS8:
+ default: mr1 |= MPC52xx_PSC_MODE_8_BITS;
}
if (new->c_cflag & PARENB) {
@@ -336,24 +333,24 @@ mpc52xx_uart_set_termios(struct uart_port *port, struct ktermios *new,
udelay(1);
if (!j)
- printk(KERN_ERR "mpc52xx_uart.c: "
+ printk( KERN_ERR "mpc52xx_uart.c: "
"Unable to flush RX & TX fifos in-time in set_termios."
- "Some chars may have been lost.\n");
+ "Some chars may have been lost.\n" );
/* Reset the TX & RX */
- out_8(&psc->command, MPC52xx_PSC_RST_RX);
- out_8(&psc->command, MPC52xx_PSC_RST_TX);
+ out_8(&psc->command,MPC52xx_PSC_RST_RX);
+ out_8(&psc->command,MPC52xx_PSC_RST_TX);
/* Send new mode settings */
- out_8(&psc->command, MPC52xx_PSC_SEL_MODE_REG_1);
- out_8(&psc->mode, mr1);
- out_8(&psc->mode, mr2);
- out_8(&psc->ctur, ctr >> 8);
- out_8(&psc->ctlr, ctr & 0xff);
+ out_8(&psc->command,MPC52xx_PSC_SEL_MODE_REG_1);
+ out_8(&psc->mode,mr1);
+ out_8(&psc->mode,mr2);
+ out_8(&psc->ctur,ctr >> 8);
+ out_8(&psc->ctlr,ctr & 0xff);
/* Reenable TX & RX */
- out_8(&psc->command, MPC52xx_PSC_TX_ENABLE);
- out_8(&psc->command, MPC52xx_PSC_RX_ENABLE);
+ out_8(&psc->command,MPC52xx_PSC_TX_ENABLE);
+ out_8(&psc->command,MPC52xx_PSC_RX_ENABLE);
/* We're all set, release the lock */
spin_unlock_irqrestore(&port->lock, flags);
@@ -368,8 +365,7 @@ mpc52xx_uart_type(struct uart_port *port)
static void
mpc52xx_uart_release_port(struct uart_port *port)
{
- /* remapped by us ? */
- if (port->flags & UPF_IOREMAP) {
+ if (port->flags & UPF_IOREMAP) { /* remapped by us ? */
iounmap(port->membase);
port->membase = NULL;
}
@@ -384,7 +380,7 @@ mpc52xx_uart_request_port(struct uart_port *port)
if (port->flags & UPF_IOREMAP) /* Need to remap ? */
port->membase = ioremap(port->mapbase,
- sizeof(struct mpc52xx_psc));
+ sizeof(struct mpc52xx_psc));
if (!port->membase)
return -EINVAL;
@@ -403,22 +399,22 @@ mpc52xx_uart_request_port(struct uart_port *port)
static void
mpc52xx_uart_config_port(struct uart_port *port, int flags)
{
- if ((flags & UART_CONFIG_TYPE)
- && (mpc52xx_uart_request_port(port) == 0))
- port->type = PORT_MPC52xx;
+ if ( (flags & UART_CONFIG_TYPE) &&
+ (mpc52xx_uart_request_port(port) == 0) )
+ port->type = PORT_MPC52xx;
}
static int
mpc52xx_uart_verify_port(struct uart_port *port, struct serial_struct *ser)
{
- if (ser->type != PORT_UNKNOWN && ser->type != PORT_MPC52xx)
+ if ( ser->type != PORT_UNKNOWN && ser->type != PORT_MPC52xx )
return -EINVAL;
- if ((ser->irq != port->irq) ||
- (ser->io_type != SERIAL_IO_MEM) ||
- (ser->baud_base != port->uartclk) ||
- (ser->iomem_base != (void *)port->mapbase) ||
- (ser->hub6 != 0))
+ if ( (ser->irq != port->irq) ||
+ (ser->io_type != SERIAL_IO_MEM) ||
+ (ser->baud_base != port->uartclk) ||
+ (ser->iomem_base != (void*)port->mapbase) ||
+ (ser->hub6 != 0 ) )
return -EINVAL;
return 0;
@@ -460,8 +456,8 @@ mpc52xx_uart_int_rx_chars(struct uart_port *port)
unsigned short status;
/* While we can read, do so ! */
- while ((status = in_be16(&PSC(port)->mpc52xx_psc_status)) &
- MPC52xx_PSC_SR_RXRDY) {
+ while ( (status = in_be16(&PSC(port)->mpc52xx_psc_status)) &
+ MPC52xx_PSC_SR_RXRDY) {
/* Get the char */
ch = in_8(&PSC(port)->mpc52xx_psc_buffer_8);
@@ -479,9 +475,9 @@ mpc52xx_uart_int_rx_chars(struct uart_port *port)
flag = TTY_NORMAL;
port->icount.rx++;
- if (status & (MPC52xx_PSC_SR_PE |
- MPC52xx_PSC_SR_FE |
- MPC52xx_PSC_SR_RB)) {
+ if ( status & (MPC52xx_PSC_SR_PE |
+ MPC52xx_PSC_SR_FE |
+ MPC52xx_PSC_SR_RB) ) {
if (status & MPC52xx_PSC_SR_RB) {
flag = TTY_BREAK;
@@ -492,7 +488,7 @@ mpc52xx_uart_int_rx_chars(struct uart_port *port)
flag = TTY_FRAME;
/* Clear error condition */
- out_8(&PSC(port)->command, MPC52xx_PSC_RST_ERR_STAT);
+ out_8(&PSC(port)->command,MPC52xx_PSC_RST_ERR_STAT);
}
tty_insert_flip_char(tty, ch, flag);
@@ -573,16 +569,16 @@ mpc52xx_uart_int(int irq, void *dev_id)
/* Do we need to receive chars ? */
/* For this RX interrupts must be on and some chars waiting */
- if (status & MPC52xx_PSC_IMR_RXRDY)
+ if ( status & MPC52xx_PSC_IMR_RXRDY )
keepgoing |= mpc52xx_uart_int_rx_chars(port);
/* Do we need to send chars ? */
/* For this, TX must be ready and TX interrupt enabled */
- if (status & MPC52xx_PSC_IMR_TXRDY)
+ if ( status & MPC52xx_PSC_IMR_TXRDY )
keepgoing |= mpc52xx_uart_int_tx_chars(port);
/* Limit number of iteration */
- if (!(--pass))
+ if ( !(--pass) )
keepgoing = 0;
} while (keepgoing);
@@ -601,7 +597,7 @@ mpc52xx_uart_int(int irq, void *dev_id)
static void __init
mpc52xx_console_get_options(struct uart_port *port,
- int *baud, int *parity, int *bits, int *flow)
+ int *baud, int *parity, int *bits, int *flow)
{
struct mpc52xx_psc __iomem *psc = PSC(port);
unsigned char mr1;
@@ -609,7 +605,7 @@ mpc52xx_console_get_options(struct uart_port *port,
pr_debug("mpc52xx_console_get_options(port=%p)\n", port);
/* Read the mode registers */
- out_8(&psc->command, MPC52xx_PSC_SEL_MODE_REG_1);
+ out_8(&psc->command,MPC52xx_PSC_SEL_MODE_REG_1);
mr1 = in_8(&psc->mode);
/* CT{U,L}R are write-only ! */
@@ -621,18 +617,11 @@ mpc52xx_console_get_options(struct uart_port *port,
/* Parse them */
switch (mr1 & MPC52xx_PSC_MODE_BITS_MASK) {
- case MPC52xx_PSC_MODE_5_BITS:
- *bits = 5;
- break;
- case MPC52xx_PSC_MODE_6_BITS:
- *bits = 6;
- break;
- case MPC52xx_PSC_MODE_7_BITS:
- *bits = 7;
- break;
- case MPC52xx_PSC_MODE_8_BITS:
- default:
- *bits = 8;
+ case MPC52xx_PSC_MODE_5_BITS: *bits = 5; break;
+ case MPC52xx_PSC_MODE_6_BITS: *bits = 6; break;
+ case MPC52xx_PSC_MODE_7_BITS: *bits = 7; break;
+ case MPC52xx_PSC_MODE_8_BITS:
+ default: *bits = 8;
}
if (mr1 & MPC52xx_PSC_MODE_PARNONE)
@@ -669,7 +658,7 @@ mpc52xx_console_write(struct console *co, const char *s, unsigned int count)
/* Wait the TX buffer to be empty */
j = 20000; /* Maximum wait */
while (!(in_be16(&psc->mpc52xx_psc_status) &
- MPC52xx_PSC_SR_TXEMP) && --j)
+ MPC52xx_PSC_SR_TXEMP) && --j)
udelay(1);
}
@@ -742,18 +731,16 @@ mpc52xx_console_setup(struct console *co, char *options)
}
pr_debug("Console on ttyPSC%x is %s\n",
- co->index, mpc52xx_uart_nodes[co->index]->full_name);
+ co->index, mpc52xx_uart_nodes[co->index]->full_name);
/* Fetch register locations */
- ret = of_address_to_resource(np, 0, &res);
- if (ret) {
+ if ((ret = of_address_to_resource(np, 0, &res)) != 0) {
pr_debug("Could not get resources for PSC%x\n", co->index);
return ret;
}
/* Search for bus-frequency property in this node or a parent */
- ipb_freq = mpc52xx_find_ipb_freq(np);
- if (ipb_freq == 0) {
+ if ((ipb_freq = mpc52xx_find_ipb_freq(np)) == 0) {
pr_debug("Could not find IPB bus frequency!\n");
return -EINVAL;
}
@@ -771,8 +758,7 @@ mpc52xx_console_setup(struct console *co, char *options)
return -EINVAL;
pr_debug("mpc52xx-psc uart at %p, mapped to %p, irq=%x, freq=%i\n",
- (void *)port->mapbase, port->membase,
- port->irq, port->uartclk);
+ (void*)port->mapbase, port->membase, port->irq, port->uartclk);
/* Setup the port parameters accoding to options */
if (options)
@@ -781,7 +767,7 @@ mpc52xx_console_setup(struct console *co, char *options)
mpc52xx_console_get_options(port, &baud, &parity, &bits, &flow);
pr_debug("Setting console parameters: %i %i%c1 flow=%c\n",
- baud, bits, parity, flow);
+ baud, bits, parity, flow);
return uart_set_options(port, co, baud, parity, bits, flow);
}
@@ -796,7 +782,7 @@ static struct console mpc52xx_console = {
.device = uart_console_device,
.setup = mpc52xx_console_setup,
.flags = CON_PRINTBUFFER,
- .index = -1, /* Specified on the cmdline (e.g. console=ttyPSC0) */
+ .index = -1, /* Specified on the cmdline (e.g. console=ttyPSC0 ) */
.data = &mpc52xx_uart_driver,
};
@@ -824,6 +810,7 @@ console_initcall(mpc52xx_console_init);
/* ======================================================================== */
static struct uart_driver mpc52xx_uart_driver = {
+ .owner = THIS_MODULE,
.driver_name = "mpc52xx_psc_uart",
.dev_name = "ttyPSC",
.major = SERIAL_PSC_MAJOR,
@@ -851,7 +838,7 @@ mpc52xx_uart_probe(struct platform_device *dev)
if (idx < 0 || idx >= MPC52xx_PSC_MAXNUM)
return -EINVAL;
- if (!mpc52xx_match_psc_function(idx, "uart"))
+ if (!mpc52xx_match_psc_function(idx,"uart"))
return -ENODEV;
/* Init the port structure */
@@ -862,13 +849,13 @@ mpc52xx_uart_probe(struct platform_device *dev)
port->fifosize = 512;
port->iotype = UPIO_MEM;
port->flags = UPF_BOOT_AUTOCONF |
- (uart_console(port) ? 0 : UPF_IOREMAP);
+ ( uart_console(port) ? 0 : UPF_IOREMAP );
port->line = idx;
port->ops = &mpc52xx_uart_ops;
port->dev = &dev->dev;
/* Search for IRQ and mapbase */
- for (i = 0 ; i < dev->num_resources ; i++, res++) {
+ for (i=0 ; inum_resources ; i++, res++) {
if (res->flags & IORESOURCE_MEM)
port->mapbase = res->start;
else if (res->flags & IORESOURCE_IRQ)
@@ -880,7 +867,7 @@ mpc52xx_uart_probe(struct platform_device *dev)
/* Add the port to the uart sub-system */
ret = uart_add_one_port(&mpc52xx_uart_driver, port);
if (!ret)
- platform_set_drvdata(dev, (void *)port);
+ platform_set_drvdata(dev, (void*)port);
return ret;
}
@@ -931,7 +918,6 @@ static struct platform_driver mpc52xx_uart_platform_driver = {
.resume = mpc52xx_uart_resume,
#endif
.driver = {
- .owner = THIS_MODULE,
.name = "mpc52xx-psc",
},
};
@@ -961,11 +947,10 @@ mpc52xx_uart_of_probe(struct of_device *op, const struct of_device_id *match)
if (idx >= MPC52xx_PSC_MAXNUM)
return -EINVAL;
pr_debug("Found %s assigned to ttyPSC%x\n",
- mpc52xx_uart_nodes[idx]->full_name, idx);
+ mpc52xx_uart_nodes[idx]->full_name, idx);
/* Search for bus-frequency property in this node or a parent */
- ipb_freq = mpc52xx_find_ipb_freq(op->node);
- if (ipb_freq == 0) {
+ if ((ipb_freq = mpc52xx_find_ipb_freq(op->node)) == 0) {
dev_dbg(&op->dev, "Could not find IPB bus frequency!\n");
return -EINVAL;
}
@@ -978,23 +963,22 @@ mpc52xx_uart_of_probe(struct of_device *op, const struct of_device_id *match)
port->fifosize = 512;
port->iotype = UPIO_MEM;
port->flags = UPF_BOOT_AUTOCONF |
- (uart_console(port) ? 0 : UPF_IOREMAP);
+ ( uart_console(port) ? 0 : UPF_IOREMAP );
port->line = idx;
port->ops = &mpc52xx_uart_ops;
port->dev = &op->dev;
/* Search for IRQ and mapbase */
- ret = of_address_to_resource(op->node, 0, &res);
- if (ret)
+ if ((ret = of_address_to_resource(op->node, 0, &res)) != 0)
return ret;
port->mapbase = res.start;
port->irq = irq_of_parse_and_map(op->node, 0);
dev_dbg(&op->dev, "mpc52xx-psc uart at %p, irq=%x, freq=%i\n",
- (void *)port->mapbase, port->irq, port->uartclk);
+ (void*)port->mapbase, port->irq, port->uartclk);
- if ((port->irq == NO_IRQ) || !port->mapbase) {
+ if ((port->irq==NO_IRQ) || !port->mapbase) {
printk(KERN_ERR "Could not allocate resources for PSC\n");
return -EINVAL;
}
@@ -1002,7 +986,7 @@ mpc52xx_uart_of_probe(struct of_device *op, const struct of_device_id *match)
/* Add the port to the uart sub-system */
ret = uart_add_one_port(&mpc52xx_uart_driver, port);
if (!ret)
- dev_set_drvdata(&op->dev, (void *)port);
+ dev_set_drvdata(&op->dev, (void*)port);
return ret;
}
@@ -1065,7 +1049,6 @@ mpc52xx_uart_of_assign(struct device_node *np, int idx)
if (idx < 0)
return; /* No free slot; abort */
- of_node_get(np);
/* If the slot is already occupied, then swap slots */
if (mpc52xx_uart_nodes[idx] && (free_idx != -1))
mpc52xx_uart_nodes[free_idx] = mpc52xx_uart_nodes[idx];
@@ -1075,7 +1058,7 @@ mpc52xx_uart_of_assign(struct device_node *np, int idx)
static void
mpc52xx_uart_of_enumerate(void)
{
- static int enum_done;
+ static int enum_done = 0;
struct device_node *np;
const unsigned int *devno;
int i;
@@ -1089,7 +1072,7 @@ mpc52xx_uart_of_enumerate(void)
/* Is a particular device number requested? */
devno = of_get_property(np, "port-number", NULL);
- mpc52xx_uart_of_assign(np, devno ? *devno : -1);
+ mpc52xx_uart_of_assign(of_node_get(np), devno ? *devno : -1);
}
enum_done = 1;
@@ -1097,13 +1080,15 @@ mpc52xx_uart_of_enumerate(void)
for (i = 0; i < MPC52xx_PSC_MAXNUM; i++) {
if (mpc52xx_uart_nodes[i])
pr_debug("%s assigned to ttyPSC%x\n",
- mpc52xx_uart_nodes[i]->full_name, i);
+ mpc52xx_uart_nodes[i]->full_name, i);
}
}
MODULE_DEVICE_TABLE(of, mpc52xx_uart_of_match);
static struct of_platform_driver mpc52xx_uart_of_driver = {
+ .owner = THIS_MODULE,
+ .name = "mpc52xx-psc-uart",
.match_table = mpc52xx_uart_of_match,
.probe = mpc52xx_uart_of_probe,
.remove = mpc52xx_uart_of_remove,
@@ -1129,8 +1114,7 @@ mpc52xx_uart_init(void)
printk(KERN_INFO "Serial: MPC52xx PSC UART driver\n");
- ret = uart_register_driver(&mpc52xx_uart_driver);
- if (ret) {
+ if ((ret = uart_register_driver(&mpc52xx_uart_driver)) != 0) {
printk(KERN_ERR "%s: uart_register_driver failed (%i)\n",
__FILE__, ret);
return ret;
diff --git a/trunk/drivers/serial/suncore.c b/trunk/drivers/serial/suncore.c
index a2d4a19550ab..707c5b03bce9 100644
--- a/trunk/drivers/serial/suncore.c
+++ b/trunk/drivers/serial/suncore.c
@@ -52,7 +52,7 @@ void sunserial_unregister_minors(struct uart_driver *drv, int count)
}
EXPORT_SYMBOL(sunserial_unregister_minors);
-int sunserial_console_match(struct console *con, struct device_node *dp,
+int __init sunserial_console_match(struct console *con, struct device_node *dp,
struct uart_driver *drv, int line)
{
int off;
diff --git a/trunk/drivers/spi/mpc52xx_psc_spi.c b/trunk/drivers/spi/mpc52xx_psc_spi.c
index d398c93195e6..7051e6c5edc3 100644
--- a/trunk/drivers/spi/mpc52xx_psc_spi.c
+++ b/trunk/drivers/spi/mpc52xx_psc_spi.c
@@ -330,7 +330,6 @@ static void mpc52xx_psc_spi_cleanup(struct spi_device *spi)
static int mpc52xx_psc_spi_port_config(int psc_id, struct mpc52xx_psc_spi *mps)
{
- struct device_node *np;
struct mpc52xx_cdm __iomem *cdm;
struct mpc52xx_gpio __iomem *gpio;
struct mpc52xx_psc __iomem *psc = mps->psc;
@@ -339,12 +338,8 @@ static int mpc52xx_psc_spi_port_config(int psc_id, struct mpc52xx_psc_spi *mps)
int ret = 0;
#if defined(CONFIG_PPC_MERGE)
- np = of_find_compatible_node(NULL, NULL, "mpc5200-cdm");
- cdm = of_iomap(np, 0);
- of_node_put(np);
- np = of_find_compatible_node(NULL, NULL, "mpc5200-gpio");
- gpio = of_iomap(np, 0);
- of_node_put(np);
+ cdm = mpc52xx_find_and_map("mpc5200-cdm");
+ gpio = mpc52xx_find_and_map("mpc5200-gpio");
#else
cdm = ioremap(MPC52xx_PA(MPC52xx_CDM_OFFSET), MPC52xx_CDM_SIZE);
gpio = ioremap(MPC52xx_PA(MPC52xx_GPIO_OFFSET), MPC52xx_GPIO_SIZE);
diff --git a/trunk/drivers/spi/spi_bitbang.c b/trunk/drivers/spi/spi_bitbang.c
index f7f8580edad8..81639c6be1c7 100644
--- a/trunk/drivers/spi/spi_bitbang.c
+++ b/trunk/drivers/spi/spi_bitbang.c
@@ -184,7 +184,6 @@ int spi_bitbang_setup(struct spi_device *spi)
struct spi_bitbang_cs *cs = spi->controller_state;
struct spi_bitbang *bitbang;
int retval;
- unsigned long flags;
bitbang = spi_master_get_devdata(spi->master);
@@ -223,12 +222,12 @@ int spi_bitbang_setup(struct spi_device *spi)
*/
/* deselect chip (low or high) */
- spin_lock_irqsave(&bitbang->lock, flags);
+ spin_lock(&bitbang->lock);
if (!bitbang->busy) {
bitbang->chipselect(spi, BITBANG_CS_INACTIVE);
ndelay(cs->nsecs);
}
- spin_unlock_irqrestore(&bitbang->lock, flags);
+ spin_unlock(&bitbang->lock);
return 0;
}
diff --git a/trunk/drivers/ssb/scan.c b/trunk/drivers/ssb/scan.c
index 63ee5cfbefbb..96258c60919d 100644
--- a/trunk/drivers/ssb/scan.c
+++ b/trunk/drivers/ssb/scan.c
@@ -388,17 +388,6 @@ int ssb_bus_scan(struct ssb_bus *bus,
case SSB_DEV_PCI:
case SSB_DEV_PCIE:
#ifdef CONFIG_SSB_DRIVER_PCICORE
- if (bus->bustype == SSB_BUSTYPE_PCI) {
- /* Ignore PCI cores on PCI-E cards.
- * Ignore PCI-E cores on PCI cards. */
- if (dev->id.coreid == SSB_DEV_PCI) {
- if (bus->host_pci->is_pcie)
- continue;
- } else {
- if (!bus->host_pci->is_pcie)
- continue;
- }
- }
if (bus->pcicore.dev) {
ssb_printk(KERN_WARNING PFX
"WARNING: Multiple PCI(E) cores found\n");
diff --git a/trunk/drivers/usb/gadget/fsl_usb2_udc.c b/trunk/drivers/usb/gadget/fsl_usb2_udc.c
index 038e7d7b4da1..9bb7f64a85cd 100644
--- a/trunk/drivers/usb/gadget/fsl_usb2_udc.c
+++ b/trunk/drivers/usb/gadget/fsl_usb2_udc.c
@@ -1318,7 +1318,7 @@ static void setup_received_irq(struct fsl_udc *udc,
| USB_TYPE_STANDARD)) {
/* Note: The driver has not include OTG support yet.
* This will be set when OTG support is added */
- if (!gadget_is_otg(&udc->gadget))
+ if (!gadget_is_otg(udc->gadget))
break;
else if (setup->bRequest == USB_DEVICE_B_HNP_ENABLE)
udc->gadget.b_hnp_enable = 1;
diff --git a/trunk/drivers/usb/serial/cp2101.c b/trunk/drivers/usb/serial/cp2101.c
index 22833589c4be..da16b5157816 100644
--- a/trunk/drivers/usb/serial/cp2101.c
+++ b/trunk/drivers/usb/serial/cp2101.c
@@ -55,7 +55,6 @@ static int debug;
static struct usb_device_id id_table [] = {
{ USB_DEVICE(0x08e6, 0x5501) }, /* Gemalto Prox-PU/CU contactless smartcard reader */
{ USB_DEVICE(0x0FCF, 0x1003) }, /* Dynastream ANT development board */
- { USB_DEVICE(0x0FCF, 0x1004) }, /* Dynastream ANT2USB */
{ USB_DEVICE(0x10A6, 0xAA26) }, /* Knock-off DCU-11 cable */
{ USB_DEVICE(0x10AB, 0x10C5) }, /* Siemens MC60 Cable */
{ USB_DEVICE(0x10B5, 0xAC70) }, /* Nokia CA-42 USB */
diff --git a/trunk/drivers/usb/serial/keyspan.c b/trunk/drivers/usb/serial/keyspan.c
index 7c069a02c1dd..feba9679ace8 100644
--- a/trunk/drivers/usb/serial/keyspan.c
+++ b/trunk/drivers/usb/serial/keyspan.c
@@ -447,7 +447,7 @@ static void usa26_indat_callback(struct urb *urb)
port = (struct usb_serial_port *) urb->context;
tty = port->tty;
- if (tty && urb->actual_length) {
+ if (urb->actual_length) {
/* 0x80 bit is error flag */
if ((data[0] & 0x80) == 0) {
/* no errors on individual bytes, only possible overrun err*/
diff --git a/trunk/drivers/usb/serial/pl2303.c b/trunk/drivers/usb/serial/pl2303.c
index 0da1df9c79bf..cf8add91de05 100644
--- a/trunk/drivers/usb/serial/pl2303.c
+++ b/trunk/drivers/usb/serial/pl2303.c
@@ -483,13 +483,6 @@ static void pl2303_set_termios(struct usb_serial_port *port,
}
spin_unlock_irqrestore(&priv->lock, flags);
- /* The PL2303 is reported to lose bytes if you change
- serial settings even to the same values as before. Thus
- we actually need to filter in this specific case */
-
- if (!tty_termios_hw_change(port->tty->termios, old_termios))
- return;
-
cflag = port->tty->termios->c_cflag;
buf = kzalloc(7, GFP_KERNEL);
diff --git a/trunk/drivers/usb/serial/sierra.c b/trunk/drivers/usb/serial/sierra.c
index c295d0495f96..e5c274044a5f 100644
--- a/trunk/drivers/usb/serial/sierra.c
+++ b/trunk/drivers/usb/serial/sierra.c
@@ -109,7 +109,6 @@ static struct usb_device_id id_table [] = {
{ USB_DEVICE(0x1199, 0x6804) }, /* Sierra Wireless MC8755 */
{ USB_DEVICE(0x1199, 0x6803) }, /* Sierra Wireless MC8765 */
{ USB_DEVICE(0x1199, 0x6812) }, /* Sierra Wireless MC8775 & AC 875U */
- { USB_DEVICE(0x1199, 0x6813) }, /* Sierra Wireless MC8775 (Thinkpad internal) */
{ USB_DEVICE(0x1199, 0x6820) }, /* Sierra Wireless AirCard 875 */
{ USB_DEVICE(0x1199, 0x6832) }, /* Sierra Wireless MC8780*/
{ USB_DEVICE(0x1199, 0x6833) }, /* Sierra Wireless MC8781*/
@@ -147,7 +146,6 @@ static struct usb_device_id id_table_3port [] = {
{ USB_DEVICE(0x1199, 0x6804) }, /* Sierra Wireless MC8755 */
{ USB_DEVICE(0x1199, 0x6803) }, /* Sierra Wireless MC8765 */
{ USB_DEVICE(0x1199, 0x6812) }, /* Sierra Wireless MC8775 & AC 875U */
- { USB_DEVICE(0x1199, 0x6813) }, /* Sierra Wireless MC8775 (Thinkpad internal) */
{ USB_DEVICE(0x1199, 0x6820) }, /* Sierra Wireless AirCard 875 */
{ USB_DEVICE(0x1199, 0x6832) }, /* Sierra Wireless MC8780*/
{ USB_DEVICE(0x1199, 0x6833) }, /* Sierra Wireless MC8781*/
diff --git a/trunk/drivers/video/atmel_lcdfb.c b/trunk/drivers/video/atmel_lcdfb.c
index 7c30cc8df71e..11a3a222dfc3 100644
--- a/trunk/drivers/video/atmel_lcdfb.c
+++ b/trunk/drivers/video/atmel_lcdfb.c
@@ -801,5 +801,5 @@ module_init(atmel_lcdfb_init);
module_exit(atmel_lcdfb_exit);
MODULE_DESCRIPTION("AT91/AT32 LCD Controller framebuffer driver");
-MODULE_AUTHOR("Nicolas Ferre ");
+MODULE_AUTHOR("Nicolas Ferre ");
MODULE_LICENSE("GPL");
diff --git a/trunk/drivers/video/modedb.c b/trunk/drivers/video/modedb.c
index 08d072552233..8d81ef019c6c 100644
--- a/trunk/drivers/video/modedb.c
+++ b/trunk/drivers/video/modedb.c
@@ -259,10 +259,6 @@ static const struct fb_videomode modedb[] = {
/* 1366x768, 60 Hz, 47.403 kHz hsync, WXGA 16:9 aspect ratio */
NULL, 60, 1366, 768, 13806, 120, 10, 14, 3, 32, 5,
0, FB_VMODE_NONINTERLACED
- }, {
- /* 1280x800, 60 Hz, 47.403 kHz hsync, WXGA 16:10 aspect ratio */
- NULL, 60, 1280, 800, 12048, 200, 64, 24, 1, 136, 3,
- 0, FB_VMODE_NONINTERLACED
},
};
diff --git a/trunk/drivers/video/ps3fb.c b/trunk/drivers/video/ps3fb.c
index 044a423a72cb..b3128903d673 100644
--- a/trunk/drivers/video/ps3fb.c
+++ b/trunk/drivers/video/ps3fb.c
@@ -443,6 +443,8 @@ static int ps3fb_sync(struct fb_info *info, u32 frame)
u32 ddr_line_length, xdr_line_length;
u64 ddr_base, xdr_base;
+ acquire_console_sem();
+
if (frame > par->num_frames - 1) {
dev_dbg(info->device, "%s: invalid frame number (%u)\n",
__func__, frame);
@@ -462,6 +464,7 @@ static int ps3fb_sync(struct fb_info *info, u32 frame)
xdr_line_length);
out:
+ release_console_sem();
return error;
}
@@ -476,10 +479,7 @@ static int ps3fb_release(struct fb_info *info, int user)
if (atomic_dec_and_test(&ps3fb.f_count)) {
if (atomic_read(&ps3fb.ext_flip)) {
atomic_set(&ps3fb.ext_flip, 0);
- if (!try_acquire_console_sem()) {
- ps3fb_sync(info, 0); /* single buffer */
- release_console_sem();
- }
+ ps3fb_sync(info, 0); /* single buffer */
}
}
return 0;
@@ -865,9 +865,7 @@ static int ps3fb_ioctl(struct fb_info *info, unsigned int cmd,
break;
dev_dbg(info->device, "PS3FB_IOCTL_FSEL:%d\n", val);
- acquire_console_sem();
retval = ps3fb_sync(info, val);
- release_console_sem();
break;
default:
@@ -887,9 +885,7 @@ static int ps3fbd(void *arg)
set_current_state(TASK_INTERRUPTIBLE);
if (ps3fb.is_kicked) {
ps3fb.is_kicked = 0;
- acquire_console_sem();
ps3fb_sync(info, 0); /* single buffer */
- release_console_sem();
}
schedule();
}
@@ -1238,6 +1234,12 @@ static int ps3fb_shutdown(struct ps3_system_bus_device *dev)
ps3fb_flip_ctl(0, &ps3fb); /* flip off */
ps3fb.dinfo->irq.mask = 0;
+ if (info) {
+ unregister_framebuffer(info);
+ fb_dealloc_cmap(&info->cmap);
+ framebuffer_release(info);
+ }
+
ps3av_register_flip_ctl(NULL, NULL);
if (ps3fb.task) {
struct task_struct *task = ps3fb.task;
@@ -1248,12 +1250,6 @@ static int ps3fb_shutdown(struct ps3_system_bus_device *dev)
free_irq(ps3fb.irq_no, &dev->core);
ps3_irq_plug_destroy(ps3fb.irq_no);
}
- if (info) {
- unregister_framebuffer(info);
- fb_dealloc_cmap(&info->cmap);
- framebuffer_release(info);
- info = dev->core.driver_data = NULL;
- }
iounmap((u8 __iomem *)ps3fb.dinfo);
status = lv1_gpu_context_free(ps3fb.context_handle);
diff --git a/trunk/drivers/video/s3c2410fb.c b/trunk/drivers/video/s3c2410fb.c
index b3c31d9dc591..5857ccf5f6b1 100644
--- a/trunk/drivers/video/s3c2410fb.c
+++ b/trunk/drivers/video/s3c2410fb.c
@@ -488,7 +488,7 @@ static int s3c2410fb_set_par(struct fb_info *info)
break;
}
- info->fix.line_length = (var->xres_virtual * var->bits_per_pixel) / 8;
+ info->fix.line_length = (var->width * var->bits_per_pixel) / 8;
/* activate this new configuration */
@@ -1026,7 +1026,7 @@ static int s3c2410fb_resume(struct platform_device *dev)
clk_enable(info->clk);
msleep(1);
- s3c2410fb_init_registers(fbinfo);
+ s3c2410fb_init_registers(info);
return 0;
}
diff --git a/trunk/drivers/video/uvesafb.c b/trunk/drivers/video/uvesafb.c
index a14ef894d571..d1d6c0facd54 100644
--- a/trunk/drivers/video/uvesafb.c
+++ b/trunk/drivers/video/uvesafb.c
@@ -43,7 +43,7 @@ static struct fb_fix_screeninfo uvesafb_fix __devinitdata = {
};
static int mtrr __devinitdata = 3; /* enable mtrr by default */
-static int blank = 1; /* enable blanking by default */
+static int blank __devinitdata = 1; /* enable blanking by default */
static int ypan __devinitdata = 1; /* 0: scroll, 1: ypan, 2: ywrap */
static int pmi_setpal __devinitdata = 1; /* use PMI for palette changes */
static int nocrtc __devinitdata; /* ignore CRTC settings */
@@ -1549,7 +1549,7 @@ static void __devinit uvesafb_init_info(struct fb_info *info,
info->fbops->fb_pan_display = NULL;
}
-static void __devinit uvesafb_init_mtrr(struct fb_info *info)
+static void uvesafb_init_mtrr(struct fb_info *info)
{
#ifdef CONFIG_MTRR
if (mtrr && !(info->fix.smem_start & (PAGE_SIZE - 1))) {
diff --git a/trunk/drivers/w1/slaves/w1_therm.c b/trunk/drivers/w1/slaves/w1_therm.c
index 112f4ec59035..4318935678c5 100644
--- a/trunk/drivers/w1/slaves/w1_therm.c
+++ b/trunk/drivers/w1/slaves/w1_therm.c
@@ -112,7 +112,7 @@ static struct w1_therm_family_converter w1_therm_families[] = {
static inline int w1_DS18B20_convert_temp(u8 rom[9])
{
- s16 t = (rom[1] << 8) | rom[0];
+ int t = (rom[1] << 8) | rom[0];
t /= 16;
return t;
}
@@ -204,7 +204,7 @@ static ssize_t w1_therm_read_bin(struct kobject *kobj,
crc = w1_calc_crc8(rom, 8);
- if (rom[8] == crc)
+ if (rom[8] == crc && rom[0])
verdict = 1;
}
}
diff --git a/trunk/drivers/w1/w1.c b/trunk/drivers/w1/w1.c
index 33e50310e9e0..070217322c9f 100644
--- a/trunk/drivers/w1/w1.c
+++ b/trunk/drivers/w1/w1.c
@@ -869,9 +869,11 @@ void w1_search_process(struct w1_master *dev, u8 search_type)
w1_search_devices(dev, search_type, w1_slave_found);
list_for_each_entry_safe(sl, sln, &dev->slist, w1_slave_entry) {
- if (!test_bit(W1_SLAVE_ACTIVE, (unsigned long *)&sl->flags) && !--sl->ttl)
+ if (!test_bit(W1_SLAVE_ACTIVE, (unsigned long *)&sl->flags) && !--sl->ttl) {
w1_slave_detach(sl);
- else if (test_bit(W1_SLAVE_ACTIVE, (unsigned long *)&sl->flags))
+
+ dev->slave_count--;
+ } else if (test_bit(W1_SLAVE_ACTIVE, (unsigned long *)&sl->flags))
sl->ttl = dev->slave_ttl;
}
diff --git a/trunk/drivers/watchdog/w83697hf_wdt.c b/trunk/drivers/watchdog/w83697hf_wdt.c
index c622a0e6c9ae..6ea125eabeaa 100644
--- a/trunk/drivers/watchdog/w83697hf_wdt.c
+++ b/trunk/drivers/watchdog/w83697hf_wdt.c
@@ -382,8 +382,10 @@ wdt_init(void)
/* we will autodetect the W83697HF/HG watchdog */
for (i = 0; ((!found) && (w83697hf_ioports[i] != 0)); i++) {
wdt_io = w83697hf_ioports[i];
- if (!w83697hf_check_wdt())
+ if (!w83697hf_check_wdt()) {
found++;
+ break;
+ }
}
} else {
if (!w83697hf_check_wdt())
diff --git a/trunk/fs/Kconfig b/trunk/fs/Kconfig
index 781b47d2f9f2..487236c65837 100644
--- a/trunk/fs/Kconfig
+++ b/trunk/fs/Kconfig
@@ -1112,8 +1112,8 @@ config HFS_FS
help
If you say Y here, you will be able to mount Macintosh-formatted
floppy disks and hard drive partitions with full read-write access.
- Please read to learn about
- the available mount options.
+ Please read to learn about the available mount
+ options.
To compile this file system support as a module, choose M here: the
module will be called hfs.
diff --git a/trunk/fs/binfmt_elf.c b/trunk/fs/binfmt_elf.c
index f0b3171842f2..ba8de7ca260b 100644
--- a/trunk/fs/binfmt_elf.c
+++ b/trunk/fs/binfmt_elf.c
@@ -1384,7 +1384,7 @@ static void fill_prstatus(struct elf_prstatus *prstatus,
prstatus->pr_sigpend = p->pending.signal.sig[0];
prstatus->pr_sighold = p->blocked.sig[0];
prstatus->pr_pid = task_pid_vnr(p);
- prstatus->pr_ppid = task_pid_vnr(p->real_parent);
+ prstatus->pr_ppid = task_pid_vnr(p->parent);
prstatus->pr_pgrp = task_pgrp_vnr(p);
prstatus->pr_sid = task_session_vnr(p);
if (thread_group_leader(p)) {
@@ -1430,7 +1430,7 @@ static int fill_psinfo(struct elf_prpsinfo *psinfo, struct task_struct *p,
psinfo->pr_psargs[len] = 0;
psinfo->pr_pid = task_pid_vnr(p);
- psinfo->pr_ppid = task_pid_vnr(p->real_parent);
+ psinfo->pr_ppid = task_pid_vnr(p->parent);
psinfo->pr_pgrp = task_pgrp_vnr(p);
psinfo->pr_sid = task_session_vnr(p);
diff --git a/trunk/fs/compat_ioctl.c b/trunk/fs/compat_ioctl.c
index da8cb3b3592c..e8b7c3a98a54 100644
--- a/trunk/fs/compat_ioctl.c
+++ b/trunk/fs/compat_ioctl.c
@@ -10,8 +10,6 @@
* ioctls.
*/
-#include
-
#include
#include
#include
@@ -2644,12 +2642,6 @@ COMPATIBLE_IOCTL(VIDEO_SET_ATTRIBUTES)
COMPATIBLE_IOCTL(VIDEO_GET_SIZE)
COMPATIBLE_IOCTL(VIDEO_GET_FRAME_RATE)
-/* joystick */
-COMPATIBLE_IOCTL(JSIOCGVERSION)
-COMPATIBLE_IOCTL(JSIOCGAXES)
-COMPATIBLE_IOCTL(JSIOCGBUTTONS)
-COMPATIBLE_IOCTL(JSIOCGNAME(0))
-
/* now things that need handlers */
HANDLE_IOCTL(MEMREADOOB32, mtd_rw_oob)
HANDLE_IOCTL(MEMWRITEOOB32, mtd_rw_oob)
diff --git a/trunk/fs/dquot.c b/trunk/fs/dquot.c
index cee7c6f428f0..686ab63a7c6c 100644
--- a/trunk/fs/dquot.c
+++ b/trunk/fs/dquot.c
@@ -827,18 +827,6 @@ static inline void dquot_decr_space(struct dquot *dquot, qsize_t number)
clear_bit(DQ_BLKS_B, &dquot->dq_flags);
}
-static int warning_issued(struct dquot *dquot, const int warntype)
-{
- int flag = (warntype == QUOTA_NL_BHARDWARN ||
- warntype == QUOTA_NL_BSOFTLONGWARN) ? DQ_BLKS_B :
- ((warntype == QUOTA_NL_IHARDWARN ||
- warntype == QUOTA_NL_ISOFTLONGWARN) ? DQ_INODES_B : 0);
-
- if (!flag)
- return 0;
- return test_and_set_bit(flag, &dquot->dq_flags);
-}
-
#ifdef CONFIG_PRINT_QUOTA_WARNING
static int flag_print_warnings = 1;
@@ -857,12 +845,16 @@ static inline int need_print_warning(struct dquot *dquot)
}
/* Print warning to user which exceeded quota */
-static void print_warning(struct dquot *dquot, const int warntype)
+static void print_warning(struct dquot *dquot, const char warntype)
{
char *msg = NULL;
struct tty_struct *tty;
+ int flag = (warntype == QUOTA_NL_BHARDWARN ||
+ warntype == QUOTA_NL_BSOFTLONGWARN) ? DQ_BLKS_B :
+ ((warntype == QUOTA_NL_IHARDWARN ||
+ warntype == QUOTA_NL_ISOFTLONGWARN) ? DQ_INODES_B : 0);
- if (!need_print_warning(dquot))
+ if (!need_print_warning(dquot) || (flag && test_and_set_bit(flag, &dquot->dq_flags)))
return;
mutex_lock(&tty_mutex);
@@ -903,6 +895,9 @@ static void print_warning(struct dquot *dquot, const int warntype)
#ifdef CONFIG_QUOTA_NETLINK_INTERFACE
+/* Size of quota netlink message - actually an upperbound for buffer size */
+#define QUOTA_NL_MSG_SIZE 32
+
/* Netlink family structure for quota */
static struct genl_family quota_genl_family = {
.id = GENL_ID_GENERATE,
@@ -919,13 +914,11 @@ static void send_warning(const struct dquot *dquot, const char warntype)
struct sk_buff *skb;
void *msg_head;
int ret;
- int msg_size = 4 * nla_total_size(sizeof(u32)) +
- 2 * nla_total_size(sizeof(u64));
/* We have to allocate using GFP_NOFS as we are called from a
* filesystem performing write and thus further recursion into
* the fs to free some data could cause deadlocks. */
- skb = genlmsg_new(msg_size, GFP_NOFS);
+ skb = genlmsg_new(QUOTA_NL_MSG_SIZE, GFP_NOFS);
if (!skb) {
printk(KERN_ERR
"VFS: Not enough memory to send quota warning.\n");
@@ -966,7 +959,7 @@ static void send_warning(const struct dquot *dquot, const char warntype)
"VFS: Failed to send notification message: %d\n", ret);
return;
attr_err_out:
- printk(KERN_ERR "VFS: Not enough space to compose quota message!\n");
+ printk(KERN_ERR "VFS: Failed to compose quota message: %d\n", ret);
err_out:
kfree_skb(skb);
}
@@ -977,8 +970,7 @@ static inline void flush_warnings(struct dquot * const *dquots, char *warntype)
int i;
for (i = 0; i < MAXQUOTAS; i++)
- if (dquots[i] != NODQUOT && warntype[i] != QUOTA_NL_NOWARN &&
- !warning_issued(dquots[i], warntype[i])) {
+ if (dquots[i] != NODQUOT && warntype[i] != QUOTA_NL_NOWARN) {
#ifdef CONFIG_PRINT_QUOTA_WARNING
print_warning(dquots[i], warntype[i]);
#endif
diff --git a/trunk/fs/ecryptfs/crypto.c b/trunk/fs/ecryptfs/crypto.c
index f8ef0af919e7..bbed2fd40fdc 100644
--- a/trunk/fs/ecryptfs/crypto.c
+++ b/trunk/fs/ecryptfs/crypto.c
@@ -799,7 +799,7 @@ int ecryptfs_init_crypt_ctx(struct ecryptfs_crypt_stat *crypt_stat)
rc = ecryptfs_crypto_api_algify_cipher_name(&full_alg_name,
crypt_stat->cipher, "cbc");
if (rc)
- goto out_unlock;
+ goto out;
crypt_stat->tfm = crypto_alloc_blkcipher(full_alg_name, 0,
CRYPTO_ALG_ASYNC);
kfree(full_alg_name);
@@ -808,12 +808,12 @@ int ecryptfs_init_crypt_ctx(struct ecryptfs_crypt_stat *crypt_stat)
ecryptfs_printk(KERN_ERR, "cryptfs: init_crypt_ctx(): "
"Error initializing cipher [%s]\n",
crypt_stat->cipher);
- goto out_unlock;
+ mutex_unlock(&crypt_stat->cs_tfm_mutex);
+ goto out;
}
crypto_blkcipher_set_flags(crypt_stat->tfm, CRYPTO_TFM_REQ_WEAK_KEY);
- rc = 0;
-out_unlock:
mutex_unlock(&crypt_stat->cs_tfm_mutex);
+ rc = 0;
out:
return rc;
}
@@ -1847,7 +1847,6 @@ ecryptfs_add_new_key_tfm(struct ecryptfs_key_tfm **key_tfm, char *cipher_name,
mutex_init(&tmp_tfm->key_tfm_mutex);
strncpy(tmp_tfm->cipher_name, cipher_name,
ECRYPTFS_MAX_CIPHER_NAME_SIZE);
- tmp_tfm->cipher_name[ECRYPTFS_MAX_CIPHER_NAME_SIZE] = '\0';
tmp_tfm->key_size = key_size;
rc = ecryptfs_process_key_cipher(&tmp_tfm->key_tfm,
tmp_tfm->cipher_name,
diff --git a/trunk/fs/ecryptfs/inode.c b/trunk/fs/ecryptfs/inode.c
index 5a719180983c..0b1ab016fa2e 100644
--- a/trunk/fs/ecryptfs/inode.c
+++ b/trunk/fs/ecryptfs/inode.c
@@ -120,9 +120,22 @@ ecryptfs_do_create(struct inode *directory_inode,
rc = ecryptfs_create_underlying_file(lower_dir_dentry->d_inode,
ecryptfs_dentry, mode, nd);
if (rc) {
- printk(KERN_ERR "%s: Failure to create dentry in lower fs; "
- "rc = [%d]\n", __FUNCTION__, rc);
- goto out_lock;
+ struct inode *ecryptfs_inode = ecryptfs_dentry->d_inode;
+ struct ecryptfs_inode_info *inode_info =
+ ecryptfs_inode_to_private(ecryptfs_inode);
+
+ printk(KERN_WARNING "%s: Error creating underlying file; "
+ "rc = [%d]; checking for existing\n", __FUNCTION__, rc);
+ if (inode_info) {
+ mutex_lock(&inode_info->lower_file_mutex);
+ if (!inode_info->lower_file) {
+ mutex_unlock(&inode_info->lower_file_mutex);
+ printk(KERN_ERR "%s: Failure to set underlying "
+ "file; rc = [%d]\n", __FUNCTION__, rc);
+ goto out_lock;
+ }
+ mutex_unlock(&inode_info->lower_file_mutex);
+ }
}
rc = ecryptfs_interpose(lower_dentry, ecryptfs_dentry,
directory_inode->i_sb, 0);
@@ -438,7 +451,6 @@ static int ecryptfs_unlink(struct inode *dir, struct dentry *dentry)
dentry->d_inode->i_nlink =
ecryptfs_inode_to_lower(dentry->d_inode)->i_nlink;
dentry->d_inode->i_ctime = dir->i_ctime;
- d_drop(dentry);
out_unlock:
unlock_parent(lower_dentry);
return rc;
diff --git a/trunk/fs/ecryptfs/main.c b/trunk/fs/ecryptfs/main.c
index e5580bcb923a..a277754da171 100644
--- a/trunk/fs/ecryptfs/main.c
+++ b/trunk/fs/ecryptfs/main.c
@@ -138,14 +138,11 @@ int ecryptfs_init_persistent_file(struct dentry *ecryptfs_dentry)
inode_info->lower_file = dentry_open(lower_dentry,
lower_mnt,
(O_RDWR | O_LARGEFILE));
- if (IS_ERR(inode_info->lower_file)) {
- dget(lower_dentry);
- mntget(lower_mnt);
+ if (IS_ERR(inode_info->lower_file))
inode_info->lower_file = dentry_open(lower_dentry,
lower_mnt,
(O_RDONLY
| O_LARGEFILE));
- }
if (IS_ERR(inode_info->lower_file)) {
printk(KERN_ERR "Error opening lower persistent file "
"for lower_dentry [0x%p] and lower_mnt [0x%p]\n",
diff --git a/trunk/fs/ecryptfs/messaging.c b/trunk/fs/ecryptfs/messaging.c
index 9cc2aec27b0d..a96d341d154d 100644
--- a/trunk/fs/ecryptfs/messaging.c
+++ b/trunk/fs/ecryptfs/messaging.c
@@ -427,7 +427,6 @@ int ecryptfs_init_messaging(unsigned int transport)
if (!ecryptfs_daemon_id_hash) {
rc = -ENOMEM;
ecryptfs_printk(KERN_ERR, "Failed to allocate memory\n");
- mutex_unlock(&ecryptfs_daemon_id_hash_mux);
goto out;
}
for (i = 0; i < ecryptfs_hash_buckets; i++)
diff --git a/trunk/fs/ecryptfs/super.c b/trunk/fs/ecryptfs/super.c
index 4859c4eecd65..f8cdab2bee3d 100644
--- a/trunk/fs/ecryptfs/super.c
+++ b/trunk/fs/ecryptfs/super.c
@@ -86,6 +86,7 @@ static void ecryptfs_destroy_inode(struct inode *inode)
fput(inode_info->lower_file);
inode_info->lower_file = NULL;
d_drop(lower_dentry);
+ d_delete(lower_dentry);
}
}
mutex_unlock(&inode_info->lower_file_mutex);
diff --git a/trunk/fs/fat/fatent.c b/trunk/fs/fat/fatent.c
index 5fb366992b73..2c1b73fb82ae 100644
--- a/trunk/fs/fat/fatent.c
+++ b/trunk/fs/fat/fatent.c
@@ -590,49 +590,21 @@ int fat_free_clusters(struct inode *inode, int cluster)
EXPORT_SYMBOL_GPL(fat_free_clusters);
-/* 128kb is the whole sectors for FAT12 and FAT16 */
-#define FAT_READA_SIZE (128 * 1024)
-
-static void fat_ent_reada(struct super_block *sb, struct fat_entry *fatent,
- unsigned long reada_blocks)
-{
- struct fatent_operations *ops = MSDOS_SB(sb)->fatent_ops;
- sector_t blocknr;
- int i, offset;
-
- ops->ent_blocknr(sb, fatent->entry, &offset, &blocknr);
-
- for (i = 0; i < reada_blocks; i++)
- sb_breadahead(sb, blocknr + i);
-}
-
int fat_count_free_clusters(struct super_block *sb)
{
struct msdos_sb_info *sbi = MSDOS_SB(sb);
struct fatent_operations *ops = sbi->fatent_ops;
struct fat_entry fatent;
- unsigned long reada_blocks, reada_mask, cur_block;
int err = 0, free;
lock_fat(sbi);
if (sbi->free_clusters != -1)
goto out;
- reada_blocks = FAT_READA_SIZE >> sb->s_blocksize_bits;
- reada_mask = reada_blocks - 1;
- cur_block = 0;
-
free = 0;
fatent_init(&fatent);
fatent_set_entry(&fatent, FAT_START_ENT);
while (fatent.entry < sbi->max_cluster) {
- /* readahead of fat blocks */
- if ((cur_block & reada_mask) == 0) {
- unsigned long rest = sbi->fat_length - cur_block;
- fat_ent_reada(sb, &fatent, min(reada_blocks, rest));
- }
- cur_block++;
-
err = fat_ent_read_block(sb, &fatent);
if (err)
goto out;
diff --git a/trunk/fs/fs-writeback.c b/trunk/fs/fs-writeback.c
index 300324bd563c..0fca82021d76 100644
--- a/trunk/fs/fs-writeback.c
+++ b/trunk/fs/fs-writeback.c
@@ -482,6 +482,8 @@ sync_sb_inodes(struct super_block *sb, struct writeback_control *wbc)
if (wbc->nr_to_write <= 0)
break;
}
+ if (!list_empty(&sb->s_more_io))
+ wbc->more_io = 1;
return; /* Leave any unwritten inodes on s_io */
}
diff --git a/trunk/fs/hfs/bfind.c b/trunk/fs/hfs/bfind.c
index f8452a0eab56..f13f1494d4fe 100644
--- a/trunk/fs/hfs/bfind.c
+++ b/trunk/fs/hfs/bfind.c
@@ -52,10 +52,6 @@ int __hfs_brec_find(struct hfs_bnode *bnode, struct hfs_find_data *fd)
rec = (e + b) / 2;
len = hfs_brec_lenoff(bnode, rec, &off);
keylen = hfs_brec_keylen(bnode, rec);
- if (keylen == HFS_BAD_KEYLEN) {
- res = -EINVAL;
- goto done;
- }
hfs_bnode_read(bnode, fd->key, off, keylen);
cmpval = bnode->tree->keycmp(fd->key, fd->search_key);
if (!cmpval) {
@@ -71,10 +67,6 @@ int __hfs_brec_find(struct hfs_bnode *bnode, struct hfs_find_data *fd)
if (rec != e && e >= 0) {
len = hfs_brec_lenoff(bnode, e, &off);
keylen = hfs_brec_keylen(bnode, e);
- if (keylen == HFS_BAD_KEYLEN) {
- res = -EINVAL;
- goto done;
- }
hfs_bnode_read(bnode, fd->key, off, keylen);
}
done:
@@ -206,10 +198,6 @@ int hfs_brec_goto(struct hfs_find_data *fd, int cnt)
len = hfs_brec_lenoff(bnode, fd->record, &off);
keylen = hfs_brec_keylen(bnode, fd->record);
- if (keylen == HFS_BAD_KEYLEN) {
- res = -EINVAL;
- goto out;
- }
fd->keyoffset = off;
fd->keylength = keylen;
fd->entryoffset = off + keylen;
diff --git a/trunk/fs/hfs/brec.c b/trunk/fs/hfs/brec.c
index 8626ee375ea8..5c87cf4801fc 100644
--- a/trunk/fs/hfs/brec.c
+++ b/trunk/fs/hfs/brec.c
@@ -44,21 +44,10 @@ u16 hfs_brec_keylen(struct hfs_bnode *node, u16 rec)
recoff = hfs_bnode_read_u16(node, node->tree->node_size - (rec + 1) * 2);
if (!recoff)
return 0;
- if (node->tree->attributes & HFS_TREE_BIGKEYS) {
+ if (node->tree->attributes & HFS_TREE_BIGKEYS)
retval = hfs_bnode_read_u16(node, recoff) + 2;
- if (retval > node->tree->max_key_len + 2) {
- printk(KERN_ERR "hfs: keylen %d too large\n",
- retval);
- retval = HFS_BAD_KEYLEN;
- }
- } else {
+ else
retval = (hfs_bnode_read_u8(node, recoff) | 1) + 1;
- if (retval > node->tree->max_key_len + 1) {
- printk(KERN_ERR "hfs: keylen %d too large\n",
- retval);
- retval = HFS_BAD_KEYLEN;
- }
- }
}
return retval;
}
diff --git a/trunk/fs/hfs/btree.c b/trunk/fs/hfs/btree.c
index 110dd3515dc8..8a3a650abc87 100644
--- a/trunk/fs/hfs/btree.c
+++ b/trunk/fs/hfs/btree.c
@@ -61,7 +61,7 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id, btree_keycmp ke
mapping = tree->inode->i_mapping;
page = read_mapping_page(mapping, 0, NULL);
if (IS_ERR(page))
- goto free_inode;
+ goto free_tree;
/* Load the header */
head = (struct hfs_btree_header_rec *)(kmap(page) + sizeof(struct hfs_bnode_desc));
@@ -81,17 +81,6 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id, btree_keycmp ke
goto fail_page;
if (!tree->node_count)
goto fail_page;
- if ((id == HFS_EXT_CNID) && (tree->max_key_len != HFS_MAX_EXT_KEYLEN)) {
- printk(KERN_ERR "hfs: invalid extent max_key_len %d\n",
- tree->max_key_len);
- goto fail_page;
- }
- if ((id == HFS_CAT_CNID) && (tree->max_key_len != HFS_MAX_CAT_KEYLEN)) {
- printk(KERN_ERR "hfs: invalid catalog max_key_len %d\n",
- tree->max_key_len);
- goto fail_page;
- }
-
tree->node_size_shift = ffs(size) - 1;
tree->pages_per_bnode = (tree->node_size + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
@@ -99,12 +88,11 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id, btree_keycmp ke
page_cache_release(page);
return tree;
-fail_page:
- page_cache_release(page);
-free_inode:
+ fail_page:
tree->inode->i_mapping->a_ops = &hfs_aops;
+ page_cache_release(page);
+ free_tree:
iput(tree->inode);
-free_tree:
kfree(tree);
return NULL;
}
diff --git a/trunk/fs/hfs/hfs.h b/trunk/fs/hfs/hfs.h
index c6aae61adfe6..1445e3a56ed4 100644
--- a/trunk/fs/hfs/hfs.h
+++ b/trunk/fs/hfs/hfs.h
@@ -28,8 +28,6 @@
#define HFS_MAX_NAMELEN 128
#define HFS_MAX_VALENCE 32767U
-#define HFS_BAD_KEYLEN 0xFF
-
/* Meanings of the drAtrb field of the MDB,
* Reference: _Inside Macintosh: Files_ p. 2-61
*/
@@ -169,9 +167,6 @@ typedef union hfs_btree_key {
struct hfs_ext_key ext;
} hfs_btree_key;
-#define HFS_MAX_CAT_KEYLEN (sizeof(struct hfs_cat_key) - sizeof(u8))
-#define HFS_MAX_EXT_KEYLEN (sizeof(struct hfs_ext_key) - sizeof(u8))
-
typedef union hfs_btree_key btree_key;
struct hfs_extent {
diff --git a/trunk/fs/jbd/transaction.c b/trunk/fs/jbd/transaction.c
index 038ed7436199..08ff6c7028cc 100644
--- a/trunk/fs/jbd/transaction.c
+++ b/trunk/fs/jbd/transaction.c
@@ -288,12 +288,10 @@ handle_t *journal_start(journal_t *journal, int nblocks)
jbd_free_handle(handle);
current->journal_info = NULL;
handle = ERR_PTR(err);
- goto out;
}
lock_acquire(&handle->h_lockdep_map, 0, 0, 0, 2, _THIS_IP_);
-out:
return handle;
}
diff --git a/trunk/fs/namei.c b/trunk/fs/namei.c
index 73e2e665817a..3b993db26cee 100644
--- a/trunk/fs/namei.c
+++ b/trunk/fs/namei.c
@@ -1605,7 +1605,7 @@ int may_open(struct nameidata *nd, int acc_mode, int flag)
if (S_ISLNK(inode->i_mode))
return -ELOOP;
- if (S_ISDIR(inode->i_mode) && (acc_mode & MAY_WRITE))
+ if (S_ISDIR(inode->i_mode) && (flag & FMODE_WRITE))
return -EISDIR;
/*
@@ -1620,7 +1620,7 @@ int may_open(struct nameidata *nd, int acc_mode, int flag)
return -EACCES;
flag &= ~O_TRUNC;
- } else if (IS_RDONLY(inode) && (acc_mode & MAY_WRITE))
+ } else if (IS_RDONLY(inode) && (flag & FMODE_WRITE))
return -EROFS;
error = vfs_permission(nd, acc_mode);
diff --git a/trunk/fs/nfs/nfs4_fs.h b/trunk/fs/nfs/nfs4_fs.h
index bd1b9d663fb9..b35069a2aa9e 100644
--- a/trunk/fs/nfs/nfs4_fs.h
+++ b/trunk/fs/nfs/nfs4_fs.h
@@ -115,7 +115,6 @@ struct nfs4_lock_state {
#define NFS_LOCK_INITIALIZED 1
int ls_flags;
struct nfs_seqid_counter ls_seqid;
- struct rpc_sequence ls_sequence;
struct nfs_unique_id ls_id;
nfs4_stateid ls_stateid;
atomic_t ls_count;
diff --git a/trunk/fs/nfs/nfs4proc.c b/trunk/fs/nfs/nfs4proc.c
index 9e2e1c7291db..f03d9d5f5ba4 100644
--- a/trunk/fs/nfs/nfs4proc.c
+++ b/trunk/fs/nfs/nfs4proc.c
@@ -741,10 +741,10 @@ static void nfs4_open_confirm_done(struct rpc_task *task, void *calldata)
if (data->rpc_status == 0) {
memcpy(data->o_res.stateid.data, data->c_res.stateid.data,
sizeof(data->o_res.stateid.data));
- nfs_confirm_seqid(&data->owner->so_seqid, 0);
renew_lease(data->o_res.server, data->timestamp);
data->rpc_done = 1;
}
+ nfs_confirm_seqid(&data->owner->so_seqid, data->rpc_status);
nfs_increment_open_seqid(data->rpc_status, data->c_arg.seqid);
}
@@ -759,6 +759,7 @@ static void nfs4_open_confirm_release(void *calldata)
/* In case of error, no cleanup! */
if (!data->rpc_done)
goto out_free;
+ nfs_confirm_seqid(&data->owner->so_seqid, 0);
state = nfs4_opendata_to_nfs4_state(data);
if (!IS_ERR(state))
nfs4_close_state(&data->path, state, data->o_arg.open_flags);
@@ -885,6 +886,7 @@ static void nfs4_open_release(void *calldata)
/* In case we need an open_confirm, no cleanup! */
if (data->o_res.rflags & NFS4_OPEN_RESULT_CONFIRM)
goto out_free;
+ nfs_confirm_seqid(&data->owner->so_seqid, 0);
state = nfs4_opendata_to_nfs4_state(data);
if (!IS_ERR(state))
nfs4_close_state(&data->path, state, data->o_arg.open_flags);
@@ -3331,12 +3333,6 @@ static struct nfs4_lockdata *nfs4_alloc_lockdata(struct file_lock *fl,
p->arg.fh = NFS_FH(inode);
p->arg.fl = &p->fl;
- if (!(lsp->ls_seqid.flags & NFS_SEQID_CONFIRMED)) {
- p->arg.open_seqid = nfs_alloc_seqid(&lsp->ls_state->owner->so_seqid);
- if (p->arg.open_seqid == NULL)
- goto out_free;
-
- }
p->arg.lock_seqid = nfs_alloc_seqid(&lsp->ls_seqid);
if (p->arg.lock_seqid == NULL)
goto out_free;
@@ -3349,8 +3345,6 @@ static struct nfs4_lockdata *nfs4_alloc_lockdata(struct file_lock *fl,
memcpy(&p->fl, fl, sizeof(p->fl));
return p;
out_free:
- if (p->arg.open_seqid != NULL)
- nfs_free_seqid(p->arg.open_seqid);
kfree(p);
return NULL;
}
@@ -3367,23 +3361,23 @@ static void nfs4_lock_prepare(struct rpc_task *task, void *calldata)
.rpc_cred = sp->so_cred,
};
+ if (nfs_wait_on_sequence(data->arg.lock_seqid, task) != 0)
+ return;
dprintk("%s: begin!\n", __FUNCTION__);
/* Do we need to do an open_to_lock_owner? */
if (!(data->arg.lock_seqid->sequence->flags & NFS_SEQID_CONFIRMED)) {
- if (nfs_wait_on_sequence(data->arg.open_seqid, task) != 0)
- return;
+ data->arg.open_seqid = nfs_alloc_seqid(&sp->so_seqid);
+ if (data->arg.open_seqid == NULL) {
+ data->rpc_status = -ENOMEM;
+ task->tk_action = NULL;
+ goto out;
+ }
data->arg.open_stateid = &state->stateid;
data->arg.new_lock_owner = 1;
- /* Retest in case we raced... */
- if (!(data->arg.lock_seqid->sequence->flags & NFS_SEQID_CONFIRMED))
- goto do_rpc;
}
- if (nfs_wait_on_sequence(data->arg.lock_seqid, task) != 0)
- return;
- data->arg.new_lock_owner = 0;
-do_rpc:
data->timestamp = jiffies;
rpc_call_setup(task, &msg, 0);
+out:
dprintk("%s: done!, ret = %d\n", __FUNCTION__, data->rpc_status);
}
@@ -3419,6 +3413,8 @@ static void nfs4_lock_release(void *calldata)
struct nfs4_lockdata *data = calldata;
dprintk("%s: begin!\n", __FUNCTION__);
+ if (data->arg.open_seqid != NULL)
+ nfs_free_seqid(data->arg.open_seqid);
if (data->cancelled != 0) {
struct rpc_task *task;
task = nfs4_do_unlck(&data->fl, data->ctx, data->lsp,
@@ -3428,8 +3424,6 @@ static void nfs4_lock_release(void *calldata)
dprintk("%s: cancelling lock!\n", __FUNCTION__);
} else
nfs_free_seqid(data->arg.lock_seqid);
- if (data->arg.open_seqid != NULL)
- nfs_free_seqid(data->arg.open_seqid);
nfs4_put_lock_state(data->lsp);
put_nfs_open_context(data->ctx);
kfree(data);
diff --git a/trunk/fs/nfs/nfs4renewd.c b/trunk/fs/nfs/nfs4renewd.c
index 5e2e4af1a0e6..3ea352d82eba 100644
--- a/trunk/fs/nfs/nfs4renewd.c
+++ b/trunk/fs/nfs/nfs4renewd.c
@@ -133,7 +133,9 @@ nfs4_renewd_prepare_shutdown(struct nfs_server *server)
void
nfs4_kill_renewd(struct nfs_client *clp)
{
+ down_read(&clp->cl_sem);
cancel_delayed_work_sync(&clp->cl_renewd);
+ up_read(&clp->cl_sem);
}
/*
diff --git a/trunk/fs/nfs/nfs4state.c b/trunk/fs/nfs/nfs4state.c
index 5a39c6f78acf..23a9a36556bf 100644
--- a/trunk/fs/nfs/nfs4state.c
+++ b/trunk/fs/nfs/nfs4state.c
@@ -509,10 +509,7 @@ static struct nfs4_lock_state *nfs4_alloc_lock_state(struct nfs4_state *state, f
lsp = kzalloc(sizeof(*lsp), GFP_KERNEL);
if (lsp == NULL)
return NULL;
- rpc_init_wait_queue(&lsp->ls_sequence.wait, "lock_seqid_waitqueue");
- spin_lock_init(&lsp->ls_sequence.lock);
- INIT_LIST_HEAD(&lsp->ls_sequence.list);
- lsp->ls_seqid.sequence = &lsp->ls_sequence;
+ lsp->ls_seqid.sequence = &state->owner->so_sequence;
atomic_set(&lsp->ls_count, 1);
lsp->ls_owner = fl_owner;
spin_lock(&clp->cl_lock);
diff --git a/trunk/fs/nfs/super.c b/trunk/fs/nfs/super.c
index 0b0c72a072ff..ea929207f274 100644
--- a/trunk/fs/nfs/super.c
+++ b/trunk/fs/nfs/super.c
@@ -1475,7 +1475,7 @@ static int nfs_xdev_get_sb(struct file_system_type *fs_type, int flags,
error = PTR_ERR(mntroot);
goto error_splat_super;
}
- if (mntroot->d_inode->i_op != NFS_SB(s)->nfs_client->rpc_ops->dir_inode_ops) {
+ if (mntroot->d_inode->i_op != server->nfs_client->rpc_ops->dir_inode_ops) {
dput(mntroot);
error = -ESTALE;
goto error_splat_super;
@@ -1826,11 +1826,6 @@ static int nfs4_xdev_get_sb(struct file_system_type *fs_type, int flags,
error = PTR_ERR(mntroot);
goto error_splat_super;
}
- if (mntroot->d_inode->i_op != NFS_SB(s)->nfs_client->rpc_ops->dir_inode_ops) {
- dput(mntroot);
- error = -ESTALE;
- goto error_splat_super;
- }
s->s_flags |= MS_ACTIVE;
mnt->mnt_sb = s;
@@ -1905,11 +1900,6 @@ static int nfs4_referral_get_sb(struct file_system_type *fs_type, int flags,
error = PTR_ERR(mntroot);
goto error_splat_super;
}
- if (mntroot->d_inode->i_op != NFS_SB(s)->nfs_client->rpc_ops->dir_inode_ops) {
- dput(mntroot);
- error = -ESTALE;
- goto error_splat_super;
- }
s->s_flags |= MS_ACTIVE;
mnt->mnt_sb = s;
diff --git a/trunk/fs/nfsd/nfs3xdr.c b/trunk/fs/nfsd/nfs3xdr.c
index f917fd25858a..2d116d2298f8 100644
--- a/trunk/fs/nfsd/nfs3xdr.c
+++ b/trunk/fs/nfsd/nfs3xdr.c
@@ -388,11 +388,8 @@ nfs3svc_decode_writeargs(struct svc_rqst *rqstp, __be32 *p,
* Round the length of the data which was specified up to
* the next multiple of XDR units and then compare that
* against the length which was actually received.
- * Note that when RPCSEC/GSS (for example) is used, the
- * data buffer can be padded so dlen might be larger
- * than required. It must never be smaller.
*/
- if (dlen < XDR_QUADLEN(len)*4)
+ if (dlen != XDR_QUADLEN(len)*4)
return 0;
if (args->count > max_blocksize) {
diff --git a/trunk/fs/nfsd/nfsxdr.c b/trunk/fs/nfsd/nfsxdr.c
index b86e3658a0af..986f9b32083c 100644
--- a/trunk/fs/nfsd/nfsxdr.c
+++ b/trunk/fs/nfsd/nfsxdr.c
@@ -313,11 +313,8 @@ nfssvc_decode_writeargs(struct svc_rqst *rqstp, __be32 *p,
* Round the length of the data which was specified up to
* the next multiple of XDR units and then compare that
* against the length which was actually received.
- * Note that when RPCSEC/GSS (for example) is used, the
- * data buffer can be padded so dlen might be larger
- * than required. It must never be smaller.
*/
- if (dlen < XDR_QUADLEN(len)*4)
+ if (dlen != XDR_QUADLEN(len)*4)
return 0;
rqstp->rq_vec[0].iov_base = (void*)p;
diff --git a/trunk/fs/proc/array.c b/trunk/fs/proc/array.c
index eb97f2897e2b..65c62e1bfd6f 100644
--- a/trunk/fs/proc/array.c
+++ b/trunk/fs/proc/array.c
@@ -169,7 +169,7 @@ static inline char *task_state(struct task_struct *p, char *buffer)
ppid = pid_alive(p) ?
task_tgid_nr_ns(rcu_dereference(p->real_parent), ns) : 0;
tpid = pid_alive(p) && p->ptrace ?
- task_pid_nr_ns(rcu_dereference(p->parent), ns) : 0;
+ task_ppid_nr_ns(rcu_dereference(p->parent), ns) : 0;
buffer += sprintf(buffer,
"State:\t%s\n"
"Tgid:\t%d\n"
@@ -464,8 +464,8 @@ static int do_task_stat(struct task_struct *task, char *buffer, int whole)
}
sid = task_session_nr_ns(task, ns);
- ppid = task_tgid_nr_ns(task->real_parent, ns);
pgid = task_pgrp_nr_ns(task, ns);
+ ppid = task_ppid_nr_ns(task, ns);
unlock_task_sighand(task, &flags);
}
diff --git a/trunk/fs/proc/base.c b/trunk/fs/proc/base.c
index 7411bfb0b7cc..02a63ac04178 100644
--- a/trunk/fs/proc/base.c
+++ b/trunk/fs/proc/base.c
@@ -202,26 +202,6 @@ static int proc_root_link(struct inode *inode, struct dentry **dentry, struct vf
(task->state == TASK_STOPPED || task->state == TASK_TRACED) && \
security_ptrace(current,task) == 0))
-struct mm_struct *mm_for_maps(struct task_struct *task)
-{
- struct mm_struct *mm = get_task_mm(task);
- if (!mm)
- return NULL;
- down_read(&mm->mmap_sem);
- task_lock(task);
- if (task->mm != mm)
- goto out;
- if (task->mm != current->mm && __ptrace_may_attach(task) < 0)
- goto out;
- task_unlock(task);
- return mm;
-out:
- task_unlock(task);
- up_read(&mm->mmap_sem);
- mmput(mm);
- return NULL;
-}
-
static int proc_pid_cmdline(struct task_struct *task, char * buffer)
{
int res = 0;
diff --git a/trunk/fs/proc/internal.h b/trunk/fs/proc/internal.h
index 05b3e9006262..1820eb2ef762 100644
--- a/trunk/fs/proc/internal.h
+++ b/trunk/fs/proc/internal.h
@@ -27,8 +27,6 @@ struct vmalloc_info {
unsigned long largest_chunk;
};
-extern struct mm_struct *mm_for_maps(struct task_struct *);
-
#ifdef CONFIG_MMU
#define VMALLOC_TOTAL (VMALLOC_END - VMALLOC_START)
extern void get_vmalloc_info(struct vmalloc_info *vmi);
diff --git a/trunk/fs/proc/proc_misc.c b/trunk/fs/proc/proc_misc.c
index 3462bfde89f6..e0d064e9764e 100644
--- a/trunk/fs/proc/proc_misc.c
+++ b/trunk/fs/proc/proc_misc.c
@@ -410,7 +410,7 @@ static const struct file_operations proc_modules_operations = {
};
#endif
-#ifdef CONFIG_SLABINFO
+#ifdef CONFIG_SLAB
static int slabinfo_open(struct inode *inode, struct file *file)
{
return seq_open(file, &slabinfo_op);
@@ -728,7 +728,7 @@ void __init proc_misc_init(void)
#endif
create_seq_entry("stat", 0, &proc_stat_operations);
create_seq_entry("interrupts", 0, &proc_interrupts_operations);
-#ifdef CONFIG_SLABINFO
+#ifdef CONFIG_SLAB
create_seq_entry("slabinfo",S_IWUSR|S_IRUGO,&proc_slabinfo_operations);
#ifdef CONFIG_DEBUG_SLAB_LEAK
create_seq_entry("slab_allocators", 0 ,&proc_slabstats_operations);
diff --git a/trunk/fs/proc/task_mmu.c b/trunk/fs/proc/task_mmu.c
index 8043a3eab52c..c24d81a5a040 100644
--- a/trunk/fs/proc/task_mmu.c
+++ b/trunk/fs/proc/task_mmu.c
@@ -397,11 +397,12 @@ static void *m_start(struct seq_file *m, loff_t *pos)
if (!priv->task)
return NULL;
- mm = mm_for_maps(priv->task);
+ mm = get_task_mm(priv->task);
if (!mm)
return NULL;
priv->tail_vma = tail_vma = get_gate_vma(priv->task);
+ down_read(&mm->mmap_sem);
/* Start with last addr hint */
if (last_addr && (vma = find_vma(mm, last_addr))) {
diff --git a/trunk/fs/proc/task_nommu.c b/trunk/fs/proc/task_nommu.c
index 1932c2ca3457..d8b8c7183c24 100644
--- a/trunk/fs/proc/task_nommu.c
+++ b/trunk/fs/proc/task_nommu.c
@@ -165,13 +165,15 @@ static void *m_start(struct seq_file *m, loff_t *pos)
if (!priv->task)
return NULL;
- mm = mm_for_maps(priv->task);
+ mm = get_task_mm(priv->task);
if (!mm) {
put_task_struct(priv->task);
priv->task = NULL;
return NULL;
}
+ down_read(&mm->mmap_sem);
+
/* start from the Nth VMA */
for (vml = mm->context.vmlist; vml; vml = vml->next)
if (n-- == 0)
diff --git a/trunk/fs/sysfs/dir.c b/trunk/fs/sysfs/dir.c
index f281cc6584b0..337162935d21 100644
--- a/trunk/fs/sysfs/dir.c
+++ b/trunk/fs/sysfs/dir.c
@@ -678,10 +678,8 @@ static struct dentry * sysfs_lookup(struct inode *dir, struct dentry *dentry,
sd = sysfs_find_dirent(parent_sd, dentry->d_name.name);
/* no such entry */
- if (!sd) {
- ret = ERR_PTR(-ENOENT);
+ if (!sd)
goto out_unlock;
- }
/* attach dentry and inode */
inode = sysfs_get_inode(sd);
@@ -783,7 +781,6 @@ int sysfs_rename_dir(struct kobject * kobj, const char *new_name)
old_dentry = sysfs_get_dentry(sd);
if (IS_ERR(old_dentry)) {
error = PTR_ERR(old_dentry);
- old_dentry = NULL;
goto out;
}
@@ -851,7 +848,6 @@ int sysfs_move_dir(struct kobject *kobj, struct kobject *new_parent_kobj)
old_dentry = sysfs_get_dentry(sd);
if (IS_ERR(old_dentry)) {
error = PTR_ERR(old_dentry);
- old_dentry = NULL;
goto out;
}
old_parent = old_dentry->d_parent;
@@ -859,7 +855,6 @@ int sysfs_move_dir(struct kobject *kobj, struct kobject *new_parent_kobj)
new_parent = sysfs_get_dentry(new_parent_sd);
if (IS_ERR(new_parent)) {
error = PTR_ERR(new_parent);
- new_parent = NULL;
goto out;
}
@@ -883,6 +878,7 @@ int sysfs_move_dir(struct kobject *kobj, struct kobject *new_parent_kobj)
error = 0;
d_add(new_dentry, NULL);
d_move(old_dentry, new_dentry);
+ dput(new_dentry);
/* Remove from old parent's list and insert into new parent's list. */
sysfs_unlink_sibling(sd);
diff --git a/trunk/fs/xfs/linux-2.6/xfs_file.c b/trunk/fs/xfs/linux-2.6/xfs_file.c
index 21a1c2b1c5fc..4847eb83fc18 100644
--- a/trunk/fs/xfs/linux-2.6/xfs_file.c
+++ b/trunk/fs/xfs/linux-2.6/xfs_file.c
@@ -261,9 +261,9 @@ xfs_file_readdir(
#else
struct hack_dirent {
- u64 ino;
- loff_t offset;
int namlen;
+ loff_t offset;
+ u64 ino;
unsigned int d_type;
char name[];
};
@@ -285,10 +285,8 @@ xfs_hack_filldir(
{
struct hack_callback *buf = __buf;
struct hack_dirent *de = (struct hack_dirent *)(buf->dirent + buf->used);
- unsigned int reclen;
- reclen = ALIGN(sizeof(struct hack_dirent) + namlen, sizeof(u64));
- if (buf->used + reclen > buf->len)
+ if (buf->used + sizeof(struct hack_dirent) + namlen > buf->len)
return -EINVAL;
de->namlen = namlen;
@@ -296,7 +294,7 @@ xfs_hack_filldir(
de->ino = ino;
de->d_type = d_type;
memcpy(de->name, name, namlen);
- buf->used += reclen;
+ buf->used += sizeof(struct hack_dirent) + namlen;
return 0;
}
@@ -336,8 +334,7 @@ xfs_file_readdir(
offset = filp->f_pos;
while (!eof) {
- unsigned int reclen;
-
+ int reclen;
start_offset = offset;
buf.used = 0;
@@ -358,8 +355,7 @@ xfs_file_readdir(
goto done;
}
- reclen = ALIGN(sizeof(struct hack_dirent) + de->namlen,
- sizeof(u64));
+ reclen = sizeof(struct hack_dirent) + de->namlen;
size -= reclen;
de = (struct hack_dirent *)((char *)de + reclen);
curr_offset = de->offset /* & 0x7fffffff */;
diff --git a/trunk/include/asm-arm/arch-pxa/hardware.h b/trunk/include/asm-arm/arch-pxa/hardware.h
index e25558faa5a4..ab2d963e742a 100644
--- a/trunk/include/asm-arm/arch-pxa/hardware.h
+++ b/trunk/include/asm-arm/arch-pxa/hardware.h
@@ -121,32 +121,38 @@
#define cpu_is_pxa21x() \
({ \
- __cpu_is_pxa21x(read_cpuid_id()); \
+ unsigned int id = read_cpuid(CPUID_ID); \
+ __cpu_is_pxa21x(id); \
})
#define cpu_is_pxa25x() \
({ \
- __cpu_is_pxa25x(read_cpuid_id()); \
+ unsigned int id = read_cpuid(CPUID_ID); \
+ __cpu_is_pxa25x(id); \
})
#define cpu_is_pxa27x() \
({ \
- __cpu_is_pxa27x(read_cpuid_id()); \
+ unsigned int id = read_cpuid(CPUID_ID); \
+ __cpu_is_pxa27x(id); \
})
#define cpu_is_pxa300() \
({ \
- __cpu_is_pxa300(read_cpuid_id()); \
+ unsigned int id = read_cpuid(CPUID_ID); \
+ __cpu_is_pxa300(id); \
})
#define cpu_is_pxa310() \
({ \
- __cpu_is_pxa310(read_cpuid_id()); \
+ unsigned int id = read_cpuid(CPUID_ID); \
+ __cpu_is_pxa310(id); \
})
#define cpu_is_pxa320() \
({ \
- __cpu_is_pxa320(read_cpuid_id()); \
+ unsigned int id = read_cpuid(CPUID_ID); \
+ __cpu_is_pxa320(id); \
})
/*
@@ -168,12 +174,14 @@
#define cpu_is_pxa2xx() \
({ \
- __cpu_is_pxa2xx(read_cpuid_id()); \
+ unsigned int id = read_cpuid(CPUID_ID); \
+ __cpu_is_pxa2xx(id); \
})
#define cpu_is_pxa3xx() \
({ \
- __cpu_is_pxa3xx(read_cpuid_id()); \
+ unsigned int id = read_cpuid(CPUID_ID); \
+ __cpu_is_pxa3xx(id); \
})
/*
diff --git a/trunk/include/asm-arm/system.h b/trunk/include/asm-arm/system.h
index 28425c473e71..94ea8c6dc1a4 100644
--- a/trunk/include/asm-arm/system.h
+++ b/trunk/include/asm-arm/system.h
@@ -75,21 +75,8 @@
#ifndef __ASSEMBLY__
#include
-#include
#include
-/*
- * The CPU ID never changes at run time, so we might as well tell the
- * compiler that it's constant. Use this function to read the CPU ID
- * rather than directly reading processor_id or read_cpuid() directly.
- */
-static inline unsigned int read_cpuid_id(void) __attribute_const__;
-
-static inline unsigned int read_cpuid_id(void)
-{
- return read_cpuid(CPUID_ID);
-}
-
#define __exception __attribute__((section(".exception.text")))
struct thread_info;
diff --git a/trunk/include/asm-cris/page.h b/trunk/include/asm-cris/page.h
index b84353ef6998..0648e3153f81 100644
--- a/trunk/include/asm-cris/page.h
+++ b/trunk/include/asm-cris/page.h
@@ -4,11 +4,14 @@
#ifdef __KERNEL__
#include
-#include
/* PAGE_SHIFT determines the page size */
#define PAGE_SHIFT 13
-#define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT)
+#ifndef __ASSEMBLY__
+#define PAGE_SIZE (1UL << PAGE_SHIFT)
+#else
+#define PAGE_SIZE (1 << PAGE_SHIFT)
+#endif
#define PAGE_MASK (~(PAGE_SIZE-1))
#define clear_page(page) memset((void *)(page), 0, PAGE_SIZE)
diff --git a/trunk/include/asm-cris/unistd.h b/trunk/include/asm-cris/unistd.h
index bd57a7949170..6f2d924f4fd6 100644
--- a/trunk/include/asm-cris/unistd.h
+++ b/trunk/include/asm-cris/unistd.h
@@ -358,7 +358,6 @@
#define __ARCH_WANT_SYS_SIGPENDING
#define __ARCH_WANT_SYS_SIGPROCMASK
#define __ARCH_WANT_SYS_RT_SIGACTION
-#define __ARCH_WANT_SYS_RT_SIGSUSPEND
/*
* "Conditional" syscalls
diff --git a/trunk/include/asm-generic/tlb.h b/trunk/include/asm-generic/tlb.h
index 75f2bfab614f..799307eea40f 100644
--- a/trunk/include/asm-generic/tlb.h
+++ b/trunk/include/asm-generic/tlb.h
@@ -86,6 +86,9 @@ tlb_flush_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end)
static inline void
tlb_finish_mmu(struct mmu_gather *tlb, unsigned long start, unsigned long end)
{
+#ifdef CONFIG_QUICKLIST
+ tlb->need_flush += &__get_cpu_var(quicklist)[0].nr_pages != 0;
+#endif
tlb_flush_mmu(tlb, start, end);
/* keep the page table cache within bounds */
diff --git a/trunk/include/asm-ia64/sn/xpc.h b/trunk/include/asm-ia64/sn/xpc.h
index 3c0900ab8003..8e5d7de9c632 100644
--- a/trunk/include/asm-ia64/sn/xpc.h
+++ b/trunk/include/asm-ia64/sn/xpc.h
@@ -1211,13 +1211,11 @@ xpc_IPI_init(int index)
static inline enum xpc_retval
xpc_map_bte_errors(bte_result_t error)
{
- if (error == BTE_SUCCESS)
- return xpcSuccess;
-
if (is_shub2()) {
if (BTE_VALID_SH2_ERROR(error))
return xpcBteSh2Start + error;
- return xpcBteUnmappedError;
+ else
+ return xpcBteUnmappedError;
}
switch (error) {
case BTE_SUCCESS: return xpcSuccess;
diff --git a/trunk/include/asm-mips/cacheops.h b/trunk/include/asm-mips/cacheops.h
index 256ad2cc6eb8..df7f2deb3b56 100644
--- a/trunk/include/asm-mips/cacheops.h
+++ b/trunk/include/asm-mips/cacheops.h
@@ -64,7 +64,7 @@
#define Page_Invalidate_T 0x16
/*
- * R10000-specific cacheops
+ * R1000-specific cacheops
*
* Cacheops 0x02, 0x06, 0x0a, 0x0c-0x0e, 0x16, 0x1a and 0x1e are unused.
* Most of the _S cacheops are identical to the R4000SC _SD cacheops.
diff --git a/trunk/include/asm-mips/smtc_ipi.h b/trunk/include/asm-mips/smtc_ipi.h
index 8ce517574340..e09131a6127d 100644
--- a/trunk/include/asm-mips/smtc_ipi.h
+++ b/trunk/include/asm-mips/smtc_ipi.h
@@ -49,7 +49,7 @@ struct smtc_ipi_q {
static inline void smtc_ipi_nq(struct smtc_ipi_q *q, struct smtc_ipi *p)
{
- unsigned long flags;
+ long flags;
spin_lock_irqsave(&q->lock, flags);
if (q->head == NULL)
@@ -98,7 +98,7 @@ static inline struct smtc_ipi *smtc_ipi_dq(struct smtc_ipi_q *q)
static inline void smtc_ipi_req(struct smtc_ipi_q *q, struct smtc_ipi *p)
{
- unsigned long flags;
+ long flags;
spin_lock_irqsave(&q->lock, flags);
if (q->head == NULL) {
@@ -114,7 +114,7 @@ static inline void smtc_ipi_req(struct smtc_ipi_q *q, struct smtc_ipi *p)
static inline int smtc_ipi_qdepth(struct smtc_ipi_q *q)
{
- unsigned long flags;
+ long flags;
int retval;
spin_lock_irqsave(&q->lock, flags);
diff --git a/trunk/include/asm-powerpc/lmb.h b/trunk/include/asm-powerpc/lmb.h
index b5f9f4c9c294..5d1dc48a0bb8 100644
--- a/trunk/include/asm-powerpc/lmb.h
+++ b/trunk/include/asm-powerpc/lmb.h
@@ -51,6 +51,7 @@ extern unsigned long __init __lmb_alloc_base(unsigned long size,
extern unsigned long __init lmb_phys_mem_size(void);
extern unsigned long __init lmb_end_of_DRAM(void);
extern void __init lmb_enforce_memory_limit(unsigned long memory_limit);
+extern int __init lmb_is_reserved(unsigned long addr);
extern void lmb_dump_all(void);
diff --git a/trunk/include/asm-powerpc/mmu-hash64.h b/trunk/include/asm-powerpc/mmu-hash64.h
index 2864fa3989ea..2a1b4040e20d 100644
--- a/trunk/include/asm-powerpc/mmu-hash64.h
+++ b/trunk/include/asm-powerpc/mmu-hash64.h
@@ -265,7 +265,7 @@ static inline unsigned long hpt_hash(unsigned long va, unsigned int shift,
extern int __hash_page_4K(unsigned long ea, unsigned long access,
unsigned long vsid, pte_t *ptep, unsigned long trap,
- unsigned int local, int ssize, int subpage_prot);
+ unsigned int local, int ssize);
extern int __hash_page_64K(unsigned long ea, unsigned long access,
unsigned long vsid, pte_t *ptep, unsigned long trap,
unsigned int local, int ssize);
@@ -279,7 +279,6 @@ extern int htab_bolt_mapping(unsigned long vstart, unsigned long vend,
unsigned long pstart, unsigned long mode,
int psize, int ssize);
extern void set_huge_psize(int psize);
-extern void demote_segment_4k(struct mm_struct *mm, unsigned long addr);
extern void htab_initialize(void);
extern void htab_initialize_secondary(void);
diff --git a/trunk/include/asm-powerpc/mpc52xx.h b/trunk/include/asm-powerpc/mpc52xx.h
index 1c48c6d16335..fcb2ebbfddbc 100644
--- a/trunk/include/asm-powerpc/mpc52xx.h
+++ b/trunk/include/asm-powerpc/mpc52xx.h
@@ -248,6 +248,8 @@ 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);
@@ -255,12 +257,7 @@ extern void mpc52xx_declare_of_platform_devices(void);
extern void mpc52xx_init_irq(void);
extern unsigned int mpc52xx_get_irq(void);
-#ifdef CONFIG_PCI
extern int __init mpc52xx_add_bridge(struct device_node *node);
-extern void __init mpc52xx_setup_pci(void);
-#else
-static inline void mpc52xx_setup_pci(void) { }
-#endif
extern void __init mpc52xx_map_wdt(void);
extern void mpc52xx_restart(char *cmd);
diff --git a/trunk/include/asm-powerpc/mpc52xx_psc.h b/trunk/include/asm-powerpc/mpc52xx_psc.h
index bea42b95390f..26690d2b32f5 100644
--- a/trunk/include/asm-powerpc/mpc52xx_psc.h
+++ b/trunk/include/asm-powerpc/mpc52xx_psc.h
@@ -153,9 +153,6 @@ struct mpc52xx_psc {
u8 reserved16[3];
u8 irfdr; /* PSC + 0x54 */
u8 reserved17[3];
-};
-
-struct mpc52xx_psc_fifo {
u16 rfnum; /* PSC + 0x58 */
u16 reserved18;
u16 tfnum; /* PSC + 0x5c */
diff --git a/trunk/include/asm-powerpc/pgalloc-64.h b/trunk/include/asm-powerpc/pgalloc-64.h
index 43214c8085b7..94d0294341d6 100644
--- a/trunk/include/asm-powerpc/pgalloc-64.h
+++ b/trunk/include/asm-powerpc/pgalloc-64.h
@@ -12,10 +12,6 @@
#include
#include
-#ifndef CONFIG_PPC_SUBPAGE_PROT
-static inline void subpage_prot_free(pgd_t *pgd) {}
-#endif
-
extern struct kmem_cache *pgtable_cache[];
#define PGD_CACHE_NUM 0
@@ -31,7 +27,6 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm)
static inline void pgd_free(pgd_t *pgd)
{
- subpage_prot_free(pgd);
kmem_cache_free(pgtable_cache[PGD_CACHE_NUM], pgd);
}
diff --git a/trunk/include/asm-powerpc/pgtable-64k.h b/trunk/include/asm-powerpc/pgtable-64k.h
index 1cbd6b377eea..bd54b772fbc6 100644
--- a/trunk/include/asm-powerpc/pgtable-64k.h
+++ b/trunk/include/asm-powerpc/pgtable-64k.h
@@ -13,49 +13,12 @@
#define PTE_TABLE_SIZE (sizeof(real_pte_t) << PTE_INDEX_SIZE)
#define PMD_TABLE_SIZE (sizeof(pmd_t) << PMD_INDEX_SIZE)
#define PGD_TABLE_SIZE (sizeof(pgd_t) << PGD_INDEX_SIZE)
+#endif /* __ASSEMBLY__ */
#define PTRS_PER_PTE (1 << PTE_INDEX_SIZE)
#define PTRS_PER_PMD (1 << PMD_INDEX_SIZE)
#define PTRS_PER_PGD (1 << PGD_INDEX_SIZE)
-#ifdef CONFIG_PPC_SUBPAGE_PROT
-/*
- * For the sub-page protection option, we extend the PGD with one of
- * these. Basically we have a 3-level tree, with the top level being
- * the protptrs array. To optimize speed and memory consumption when
- * only addresses < 4GB are being protected, pointers to the first
- * four pages of sub-page protection words are stored in the low_prot
- * array.
- * Each page of sub-page protection words protects 1GB (4 bytes
- * protects 64k). For the 3-level tree, each page of pointers then
- * protects 8TB.
- */
-struct subpage_prot_table {
- unsigned long maxaddr; /* only addresses < this are protected */
- unsigned int **protptrs[2];
- unsigned int *low_prot[4];
-};
-
-#undef PGD_TABLE_SIZE
-#define PGD_TABLE_SIZE ((sizeof(pgd_t) << PGD_INDEX_SIZE) + \
- sizeof(struct subpage_prot_table))
-
-#define SBP_L1_BITS (PAGE_SHIFT - 2)
-#define SBP_L2_BITS (PAGE_SHIFT - 3)
-#define SBP_L1_COUNT (1 << SBP_L1_BITS)
-#define SBP_L2_COUNT (1 << SBP_L2_BITS)
-#define SBP_L2_SHIFT (PAGE_SHIFT + SBP_L1_BITS)
-#define SBP_L3_SHIFT (SBP_L2_SHIFT + SBP_L2_BITS)
-
-extern void subpage_prot_free(pgd_t *pgd);
-
-static inline struct subpage_prot_table *pgd_subpage_prot(pgd_t *pgd)
-{
- return (struct subpage_prot_table *)(pgd + PTRS_PER_PGD);
-}
-#endif /* CONFIG_PPC_SUBPAGE_PROT */
-#endif /* __ASSEMBLY__ */
-
/* With 4k base page size, hugepage PTEs go at the PMD level */
#define MIN_HUGEPTE_SHIFT PAGE_SHIFT
diff --git a/trunk/include/asm-powerpc/spu.h b/trunk/include/asm-powerpc/spu.h
index f07c99ba5d13..5ca30e2e2639 100644
--- a/trunk/include/asm-powerpc/spu.h
+++ b/trunk/include/asm-powerpc/spu.h
@@ -248,7 +248,6 @@ struct spufs_calls {
__u32 __user *ustatus);
int (*coredump_extra_notes_size)(void);
int (*coredump_extra_notes_write)(struct file *file, loff_t *foffset);
- void (*notify_spus_active)(void);
struct module *owner;
};
@@ -303,9 +302,6 @@ struct notifier_block;
int spu_switch_event_register(struct notifier_block * n);
int spu_switch_event_unregister(struct notifier_block * n);
-extern void notify_spus_active(void);
-extern void do_notify_spus_active(void);
-
/*
* This defines the Local Store, Problem Area and Privilege Area of an SPU.
*/
diff --git a/trunk/include/asm-powerpc/systbl.h b/trunk/include/asm-powerpc/systbl.h
index 0c8b0d679139..11d5383b2f09 100644
--- a/trunk/include/asm-powerpc/systbl.h
+++ b/trunk/include/asm-powerpc/systbl.h
@@ -313,4 +313,3 @@ COMPAT_SYS_SPU(timerfd)
SYSCALL_SPU(eventfd)
COMPAT_SYS_SPU(sync_file_range2)
COMPAT_SYS(fallocate)
-SYSCALL(subpage_prot)
diff --git a/trunk/include/asm-powerpc/unistd.h b/trunk/include/asm-powerpc/unistd.h
index fedc4b8e49e2..97d82b6a9406 100644
--- a/trunk/include/asm-powerpc/unistd.h
+++ b/trunk/include/asm-powerpc/unistd.h
@@ -332,11 +332,10 @@
#define __NR_eventfd 307
#define __NR_sync_file_range2 308
#define __NR_fallocate 309
-#define __NR_subpage_prot 310
#ifdef __KERNEL__
-#define __NR_syscalls 311
+#define __NR_syscalls 310
#define __NR__exit __NR_exit
#define NR_syscalls __NR_syscalls
diff --git a/trunk/include/asm-ppc/mpc52xx_psc.h b/trunk/include/asm-ppc/mpc52xx_psc.h
index 39fcd02cd4e8..c82b8d49a7da 100644
--- a/trunk/include/asm-ppc/mpc52xx_psc.h
+++ b/trunk/include/asm-ppc/mpc52xx_psc.h
@@ -159,9 +159,6 @@ struct mpc52xx_psc {
u8 reserved16[3];
u8 irfdr; /* PSC + 0x54 */
u8 reserved17[3];
-};
-
-struct mpc52xx_psc_fifo {
u16 rfnum; /* PSC + 0x58 */
u16 reserved18;
u16 tfnum; /* PSC + 0x5c */
diff --git a/trunk/include/asm-sh/cacheflush.h b/trunk/include/asm-sh/cacheflush.h
index e034c3604111..9d528ada3c14 100644
--- a/trunk/include/asm-sh/cacheflush.h
+++ b/trunk/include/asm-sh/cacheflush.h
@@ -43,12 +43,6 @@ extern void __flush_purge_region(void *start, int size);
extern void __flush_invalidate_region(void *start, int size);
#endif
-#define ARCH_HAS_FLUSH_KERNEL_DCACHE_PAGE
-static inline void flush_kernel_dcache_page(struct page *page)
-{
- flush_dcache_page(page);
-}
-
#if defined(CONFIG_CPU_SH4) && !defined(CONFIG_CACHE_OFF)
extern void copy_to_user_page(struct vm_area_struct *vma,
struct page *page, unsigned long vaddr, void *dst, const void *src,
diff --git a/trunk/include/asm-sh/uaccess.h b/trunk/include/asm-sh/uaccess.h
index 77c391fa93d6..f18a1a5c95c0 100644
--- a/trunk/include/asm-sh/uaccess.h
+++ b/trunk/include/asm-sh/uaccess.h
@@ -73,26 +73,38 @@ static inline int __access_ok(unsigned long addr, unsigned long size)
/*
* __access_ok: Check if address with size is OK or not.
*
- * Uhhuh, this needs 33-bit arithmetic. We have a carry..
+ * We do three checks:
+ * (1) is it user space?
+ * (2) addr + size --> carry?
+ * (3) addr + size >= 0x80000000 (PAGE_OFFSET)
*
- * sum := addr + size; carry? --> flag = true;
- * if (sum >= addr_limit) flag = true;
+ * (1) (2) (3) | RESULT
+ * 0 0 0 | ok
+ * 0 0 1 | ok
+ * 0 1 0 | bad
+ * 0 1 1 | bad
+ * 1 0 0 | ok
+ * 1 0 1 | bad
+ * 1 1 0 | bad
+ * 1 1 1 | bad
*/
static inline int __access_ok(unsigned long addr, unsigned long size)
{
- unsigned long flag, sum;
-
- __asm__("clrt\n\t"
- "addc %3, %1\n\t"
- "movt %0\n\t"
- "cmp/hi %4, %1\n\t"
- "rotcl %0"
- :"=&r" (flag), "=r" (sum)
- :"1" (addr), "r" (size),
- "r" (current_thread_info()->addr_limit.seg)
- :"t");
- return flag == 0;
+ unsigned long flag, tmp;
+
+ __asm__("stc r7_bank, %0\n\t"
+ "mov.l @(8,%0), %0\n\t"
+ "clrt\n\t"
+ "addc %2, %1\n\t"
+ "and %1, %0\n\t"
+ "rotcl %0\n\t"
+ "rotcl %0\n\t"
+ "and #3, %0"
+ : "=&z" (flag), "=r" (tmp)
+ : "r" (addr), "1" (size)
+ : "t");
+ return flag == 0;
}
#endif /* CONFIG_MMU */
diff --git a/trunk/include/asm-sparc64/dma-mapping.h b/trunk/include/asm-sparc64/dma-mapping.h
index 38cbec76a33f..1fc655452b81 100644
--- a/trunk/include/asm-sparc64/dma-mapping.h
+++ b/trunk/include/asm-sparc64/dma-mapping.h
@@ -25,9 +25,15 @@ struct dma_ops {
void (*sync_single_for_cpu)(struct device *dev,
dma_addr_t dma_handle, size_t size,
enum dma_data_direction direction);
+ void (*sync_single_for_device)(struct device *dev,
+ dma_addr_t dma_handle, size_t size,
+ enum dma_data_direction direction);
void (*sync_sg_for_cpu)(struct device *dev, struct scatterlist *sg,
int nelems,
enum dma_data_direction direction);
+ void (*sync_sg_for_device)(struct device *dev, struct scatterlist *sg,
+ int nelems,
+ enum dma_data_direction direction);
};
extern const struct dma_ops *dma_ops;
@@ -99,7 +105,7 @@ static inline void dma_sync_single_for_device(struct device *dev,
size_t size,
enum dma_data_direction direction)
{
- /* No flushing needed to sync cpu writes to the device. */
+ dma_ops->sync_single_for_device(dev, dma_handle, size, direction);
}
static inline void dma_sync_single_range_for_cpu(struct device *dev,
@@ -117,7 +123,7 @@ static inline void dma_sync_single_range_for_device(struct device *dev,
size_t size,
enum dma_data_direction direction)
{
- /* No flushing needed to sync cpu writes to the device. */
+ dma_sync_single_for_device(dev, dma_handle+offset, size, direction);
}
@@ -132,7 +138,7 @@ static inline void dma_sync_sg_for_device(struct device *dev,
struct scatterlist *sg, int nelems,
enum dma_data_direction direction)
{
- /* No flushing needed to sync cpu writes to the device. */
+ dma_ops->sync_sg_for_device(dev, sg, nelems, direction);
}
static inline int dma_mapping_error(dma_addr_t dma_addr)
diff --git a/trunk/include/asm-sparc64/pci.h b/trunk/include/asm-sparc64/pci.h
index f59f2571295b..1393e57d50fb 100644
--- a/trunk/include/asm-sparc64/pci.h
+++ b/trunk/include/asm-sparc64/pci.h
@@ -200,10 +200,6 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
struct device_node;
extern struct device_node *pci_device_to_OF_node(struct pci_dev *pdev);
-#define HAVE_ARCH_PCI_RESOURCE_TO_USER
-extern void pci_resource_to_user(const struct pci_dev *dev, int bar,
- const struct resource *rsrc,
- resource_size_t *start, resource_size_t *end);
#endif /* __KERNEL__ */
#endif /* __SPARC64_PCI_H */
diff --git a/trunk/include/asm-x86/byteorder.h b/trunk/include/asm-x86/byteorder.h
index fe2f2e5d51ba..1f2d6d5bf20d 100644
--- a/trunk/include/asm-x86/byteorder.h
+++ b/trunk/include/asm-x86/byteorder.h
@@ -30,13 +30,13 @@ static __inline__ __attribute_const__ __u64 ___arch__swab64(__u64 val)
} v;
v.u = val;
#ifdef CONFIG_X86_BSWAP
- __asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1"
+ asm("bswapl %0 ; bswapl %1 ; xchgl %0,%1"
: "=r" (v.s.a), "=r" (v.s.b)
: "0" (v.s.a), "1" (v.s.b));
#else
v.s.a = ___arch__swab32(v.s.a);
v.s.b = ___arch__swab32(v.s.b);
- __asm__("xchgl %0,%1" : "=r" (v.s.a), "=r" (v.s.b) : "0" (v.s.a), "1" (v.s.b));
+ asm("xchgl %0,%1" : "=r" (v.s.a), "=r" (v.s.b) : "0" (v.s.a), "1" (v.s.b));
#endif
return v.u;
}
diff --git a/trunk/include/asm-x86/msr.h b/trunk/include/asm-x86/msr.h
index 80b027081b3c..ba4b31432120 100644
--- a/trunk/include/asm-x86/msr.h
+++ b/trunk/include/asm-x86/msr.h
@@ -3,10 +3,6 @@
#include
-#ifndef __ASSEMBLY__
-# include
-#endif
-
#ifdef __i386__
#ifdef __KERNEL__
@@ -195,6 +191,38 @@ static inline int wrmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h)
#define wrmsrl(msr,val) wrmsr(msr,(__u32)((__u64)(val)),((__u64)(val))>>32)
+/* wrmsr with exception handling */
+#define wrmsr_safe(msr,a,b) ({ int ret__; \
+ asm volatile("2: wrmsr ; xorl %0,%0\n" \
+ "1:\n\t" \
+ ".section .fixup,\"ax\"\n\t" \
+ "3: movl %4,%0 ; jmp 1b\n\t" \
+ ".previous\n\t" \
+ ".section __ex_table,\"a\"\n" \
+ " .align 8\n\t" \
+ " .quad 2b,3b\n\t" \
+ ".previous" \
+ : "=a" (ret__) \
+ : "c" (msr), "0" (a), "d" (b), "i" (-EFAULT)); \
+ ret__; })
+
+#define checking_wrmsrl(msr,val) wrmsr_safe(msr,(u32)(val),(u32)((val)>>32))
+
+#define rdmsr_safe(msr,a,b) \
+ ({ int ret__; \
+ asm volatile ("1: rdmsr\n" \
+ "2:\n" \
+ ".section .fixup,\"ax\"\n" \
+ "3: movl %4,%0\n" \
+ " jmp 2b\n" \
+ ".previous\n" \
+ ".section __ex_table,\"a\"\n" \
+ " .align 8\n" \
+ " .quad 1b,3b\n" \
+ ".previous":"=&bDS" (ret__), "=a"(*(a)), "=d"(*(b)) \
+ :"c"(msr), "i"(-EIO), "0"(0)); \
+ ret__; })
+
#define rdtsc(low,high) \
__asm__ __volatile__("rdtsc" : "=a" (low), "=d" (high))
@@ -202,17 +230,17 @@ static inline int wrmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h)
__asm__ __volatile__ ("rdtsc" : "=a" (low) : : "edx")
#define rdtscp(low,high,aux) \
- __asm__ __volatile__ (".byte 0x0f,0x01,0xf9" : "=a" (low), "=d" (high), "=c" (aux))
+ asm volatile (".byte 0x0f,0x01,0xf9" : "=a" (low), "=d" (high), "=c" (aux))
#define rdtscll(val) do { \
unsigned int __a,__d; \
- __asm__ __volatile__("rdtsc" : "=a" (__a), "=d" (__d)); \
+ asm volatile("rdtsc" : "=a" (__a), "=d" (__d)); \
(val) = ((unsigned long)__a) | (((unsigned long)__d)<<32); \
} while(0)
#define rdtscpll(val, aux) do { \
unsigned long __a, __d; \
- __asm__ __volatile__ (".byte 0x0f,0x01,0xf9" : "=a" (__a), "=d" (__d), "=c" (aux)); \
+ asm volatile (".byte 0x0f,0x01,0xf9" : "=a" (__a), "=d" (__d), "=c" (aux)); \
(val) = (__d << 32) | __a; \
} while (0)
@@ -225,7 +253,6 @@ static inline int wrmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h)
: "=a" (low), "=d" (high) \
: "c" (counter))
-
static inline void cpuid(int op, unsigned int *eax, unsigned int *ebx,
unsigned int *ecx, unsigned int *edx)
{
@@ -293,40 +320,6 @@ static inline unsigned int cpuid_edx(unsigned int op)
return edx;
}
-#ifdef __KERNEL__
-
-/* wrmsr with exception handling */
-#define wrmsr_safe(msr,a,b) ({ int ret__; \
- asm volatile("2: wrmsr ; xorl %0,%0\n" \
- "1:\n\t" \
- ".section .fixup,\"ax\"\n\t" \
- "3: movl %4,%0 ; jmp 1b\n\t" \
- ".previous\n\t" \
- ".section __ex_table,\"a\"\n" \
- " .align 8\n\t" \
- " .quad 2b,3b\n\t" \
- ".previous" \
- : "=a" (ret__) \
- : "c" (msr), "0" (a), "d" (b), "i" (-EFAULT)); \
- ret__; })
-
-#define checking_wrmsrl(msr,val) wrmsr_safe(msr,(u32)(val),(u32)((val)>>32))
-
-#define rdmsr_safe(msr,a,b) \
- ({ int ret__; \
- asm volatile ("1: rdmsr\n" \
- "2:\n" \
- ".section .fixup,\"ax\"\n" \
- "3: movl %4,%0\n" \
- " jmp 2b\n" \
- ".previous\n" \
- ".section __ex_table,\"a\"\n" \
- " .align 8\n" \
- " .quad 1b,3b\n" \
- ".previous":"=&bDS" (ret__), "=a"(*(a)), "=d"(*(b)) \
- :"c"(msr), "i"(-EIO), "0"(0)); \
- ret__; })
-
#ifdef CONFIG_SMP
void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h);
void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h);
@@ -350,7 +343,6 @@ static inline int wrmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h)
return wrmsr_safe(msr_no, l, h);
}
#endif /* CONFIG_SMP */
-#endif /* __KERNEL__ */
#endif /* __ASSEMBLY__ */
#endif /* !__i386__ */
diff --git a/trunk/include/linux/Kbuild b/trunk/include/linux/Kbuild
index f30fa92a44a1..9abf5a806c15 100644
--- a/trunk/include/linux/Kbuild
+++ b/trunk/include/linux/Kbuild
@@ -153,7 +153,6 @@ header-y += toshiba.h
header-y += ultrasound.h
header-y += un.h
header-y += utime.h
-header-y += veth.h
header-y += video_decoder.h
header-y += video_encoder.h
header-y += videotext.h
diff --git a/trunk/include/linux/ata.h b/trunk/include/linux/ata.h
index e672e80202a8..72ab80801ef6 100644
--- a/trunk/include/linux/ata.h
+++ b/trunk/include/linux/ata.h
@@ -554,6 +554,8 @@ static inline int ata_drive_40wire(const u16 *dev_id)
static inline int ata_drive_40wire_relaxed(const u16 *dev_id)
{
+ if (ata_id_is_sata(dev_id))
+ return 0; /* SATA */
if ((dev_id[93] & 0x2000) == 0x2000)
return 0; /* 80 wire */
return 1;
diff --git a/trunk/include/linux/cpu.h b/trunk/include/linux/cpu.h
index 92f2029a34f3..b79c57569367 100644
--- a/trunk/include/linux/cpu.h
+++ b/trunk/include/linux/cpu.h
@@ -107,6 +107,7 @@ extern void unlock_cpu_hotplug(void);
#define register_hotcpu_notifier(nb) register_cpu_notifier(nb)
#define unregister_hotcpu_notifier(nb) unregister_cpu_notifier(nb)
int cpu_down(unsigned int cpu);
+#define cpu_is_offline(cpu) unlikely(!cpu_online(cpu))
#else /* CONFIG_HOTPLUG_CPU */
@@ -121,6 +122,9 @@ static inline void cpuhotplug_mutex_unlock(struct mutex *cpu_hp_mutex)
/* These aren't inline functions due to a GCC bug. */
#define register_hotcpu_notifier(nb) ({ (void)(nb); 0; })
#define unregister_hotcpu_notifier(nb) ({ (void)(nb); })
+
+/* CPUs don't go offline once they're online w/o CONFIG_HOTPLUG_CPU */
+static inline int cpu_is_offline(int cpu) { return 0; }
#endif /* CONFIG_HOTPLUG_CPU */
#ifdef CONFIG_PM_SLEEP_SMP
diff --git a/trunk/include/linux/cpumask.h b/trunk/include/linux/cpumask.h
index 85bd790c201e..23f55140ccd5 100644
--- a/trunk/include/linux/cpumask.h
+++ b/trunk/include/linux/cpumask.h
@@ -397,8 +397,6 @@ extern cpumask_t cpu_present_map;
#define cpu_present(cpu) ((cpu) == 0)
#endif
-#define cpu_is_offline(cpu) unlikely(!cpu_online(cpu))
-
#ifdef CONFIG_SMP
extern int nr_cpu_ids;
#define any_online_cpu(mask) __any_online_cpu(&(mask))
diff --git a/trunk/include/linux/i2c-id.h b/trunk/include/linux/i2c-id.h
index e18017d45758..88c81403eb3f 100644
--- a/trunk/include/linux/i2c-id.h
+++ b/trunk/include/linux/i2c-id.h
@@ -23,10 +23,6 @@
#ifndef LINUX_I2C_ID_H
#define LINUX_I2C_ID_H
-/* Please note that I2C driver IDs are optional. They are only needed if a
- legacy chip driver needs to identify a bus or a bus driver needs to
- identify a legacy client. If you don't need them, just don't set them. */
-
/*
* ---- Driver types -----------------------------------------------------
*/
diff --git a/trunk/include/linux/key.h b/trunk/include/linux/key.h
index a70b8a8f2005..fcdbd5ed227b 100644
--- a/trunk/include/linux/key.h
+++ b/trunk/include/linux/key.h
@@ -290,7 +290,7 @@ extern void key_init(void);
#define key_get(k) ({ NULL; })
#define key_put(k) do { } while(0)
#define key_ref_put(k) do { } while(0)
-#define make_key_ref(k, p) ({ NULL; })
+#define make_key_ref(k) ({ NULL; })
#define key_ref_to_ptr(k) ({ NULL; })
#define is_key_possessed(k) 0
#define alloc_uid_keyring(u,c) 0
diff --git a/trunk/include/linux/netdevice.h b/trunk/include/linux/netdevice.h
index b0813c3286b1..1e6af4f174b6 100644
--- a/trunk/include/linux/netdevice.h
+++ b/trunk/include/linux/netdevice.h
@@ -319,29 +319,21 @@ struct napi_struct {
enum
{
NAPI_STATE_SCHED, /* Poll is scheduled */
- NAPI_STATE_DISABLE, /* Disable pending */
};
extern void FASTCALL(__napi_schedule(struct napi_struct *n));
-static inline int napi_disable_pending(struct napi_struct *n)
-{
- return test_bit(NAPI_STATE_DISABLE, &n->state);
-}
-
/**
* napi_schedule_prep - check if napi can be scheduled
* @n: napi context
*
* Test if NAPI routine is already running, and if not mark
* it as running. This is used as a condition variable
- * insure only one NAPI poll instance runs. We also make
- * sure there is no pending NAPI disable.
+ * insure only one NAPI poll instance runs
*/
static inline int napi_schedule_prep(struct napi_struct *n)
{
- return !napi_disable_pending(n) &&
- !test_and_set_bit(NAPI_STATE_SCHED, &n->state);
+ return !test_and_set_bit(NAPI_STATE_SCHED, &n->state);
}
/**
@@ -397,10 +389,8 @@ static inline void napi_complete(struct napi_struct *n)
*/
static inline void napi_disable(struct napi_struct *n)
{
- set_bit(NAPI_STATE_DISABLE, &n->state);
while (test_and_set_bit(NAPI_STATE_SCHED, &n->state))
msleep(1);
- clear_bit(NAPI_STATE_DISABLE, &n->state);
}
/**
@@ -1278,7 +1268,7 @@ static inline u32 netif_msg_init(int debug_value, int default_msg_enable_bits)
static inline int netif_rx_schedule_prep(struct net_device *dev,
struct napi_struct *napi)
{
- return napi_schedule_prep(napi);
+ return netif_running(dev) && napi_schedule_prep(napi);
}
/* Add interface to tail of rx poll list. This assumes that _prep has
@@ -1287,6 +1277,7 @@ static inline int netif_rx_schedule_prep(struct net_device *dev,
static inline void __netif_rx_schedule(struct net_device *dev,
struct napi_struct *napi)
{
+ dev_hold(dev);
__napi_schedule(napi);
}
@@ -1317,6 +1308,7 @@ static inline void __netif_rx_complete(struct net_device *dev,
struct napi_struct *napi)
{
__napi_complete(napi);
+ dev_put(dev);
}
/* Remove interface from poll list: it must be in the poll list
diff --git a/trunk/include/linux/pci_ids.h b/trunk/include/linux/pci_ids.h
index 7f2215139e9a..023656d2f1da 100644
--- a/trunk/include/linux/pci_ids.h
+++ b/trunk/include/linux/pci_ids.h
@@ -2322,8 +2322,6 @@
#define PCI_DEVICE_ID_INTEL_ICH9_4 0x2914
#define PCI_DEVICE_ID_INTEL_ICH9_5 0x2919
#define PCI_DEVICE_ID_INTEL_ICH9_6 0x2930
-#define PCI_DEVICE_ID_INTEL_ICH9_7 0x2916
-#define PCI_DEVICE_ID_INTEL_ICH9_8 0x2918
#define PCI_DEVICE_ID_INTEL_82855PM_HB 0x3340
#define PCI_DEVICE_ID_INTEL_82830_HB 0x3575
#define PCI_DEVICE_ID_INTEL_82830_CGC 0x3577
diff --git a/trunk/include/linux/pm.h b/trunk/include/linux/pm.h
index b78e0295adf4..09a309b7b5d2 100644
--- a/trunk/include/linux/pm.h
+++ b/trunk/include/linux/pm.h
@@ -246,15 +246,6 @@ static inline int call_platform_enable_wakeup(struct device *dev, int is_on)
device_set_wakeup_enable(dev,val); \
} while(0)
-/*
- * Global Power Management flags
- * Used to keep APM and ACPI from both being active
- */
-extern unsigned int pm_flags;
-
-#define PM_APM 1
-#define PM_ACPI 2
-
#endif /* __KERNEL__ */
#endif /* _LINUX_PM_H */
diff --git a/trunk/include/linux/pm_legacy.h b/trunk/include/linux/pm_legacy.h
index 446f4f42b952..514729a44688 100644
--- a/trunk/include/linux/pm_legacy.h
+++ b/trunk/include/linux/pm_legacy.h
@@ -4,6 +4,10 @@
#ifdef CONFIG_PM_LEGACY
+extern int pm_active;
+
+#define PM_IS_ACTIVE() (pm_active != 0)
+
/*
* Register a device with power management
*/
@@ -17,6 +21,8 @@ int __deprecated pm_send_all(pm_request_t rqst, void *data);
#else /* CONFIG_PM_LEGACY */
+#define PM_IS_ACTIVE() 0
+
static inline struct pm_dev *pm_register(pm_dev_t type,
unsigned long id,
pm_callback callback)
diff --git a/trunk/include/linux/pnp.h b/trunk/include/linux/pnp.h
index 2a6d62c7d2d1..0a0426c2867d 100644
--- a/trunk/include/linux/pnp.h
+++ b/trunk/include/linux/pnp.h
@@ -13,7 +13,7 @@
#include
#include
-#define PNP_MAX_PORT 40
+#define PNP_MAX_PORT 24
#define PNP_MAX_MEM 12
#define PNP_MAX_IRQ 2
#define PNP_MAX_DMA 2
diff --git a/trunk/include/linux/ptrace.h b/trunk/include/linux/ptrace.h
index 3ea5750a0f7e..ae8146abd746 100644
--- a/trunk/include/linux/ptrace.h
+++ b/trunk/include/linux/ptrace.h
@@ -97,7 +97,6 @@ extern void __ptrace_link(struct task_struct *child,
extern void __ptrace_unlink(struct task_struct *child);
extern void ptrace_untrace(struct task_struct *child);
extern int ptrace_may_attach(struct task_struct *task);
-extern int __ptrace_may_attach(struct task_struct *task);
static inline void ptrace_link(struct task_struct *child,
struct task_struct *new_parent)
diff --git a/trunk/include/linux/quicklist.h b/trunk/include/linux/quicklist.h
index 39b66713a0bb..9371c6116df3 100644
--- a/trunk/include/linux/quicklist.h
+++ b/trunk/include/linux/quicklist.h
@@ -56,6 +56,14 @@ static inline void __quicklist_free(int nr, void (*dtor)(void *), void *p,
struct page *page)
{
struct quicklist *q;
+ int nid = page_to_nid(page);
+
+ if (unlikely(nid != numa_node_id())) {
+ if (dtor)
+ dtor(p);
+ __free_page(page);
+ return;
+ }
q = &get_cpu_var(quicklist)[nr];
*(void **)p = q->page;
diff --git a/trunk/include/linux/scatterlist.h b/trunk/include/linux/scatterlist.h
index e3ff21dbac53..416e000dfe81 100644
--- a/trunk/include/linux/scatterlist.h
+++ b/trunk/include/linux/scatterlist.h
@@ -191,8 +191,8 @@ static inline void sg_chain(struct scatterlist *prv, unsigned int prv_nents,
/*
* offset and length are unused for chain entry. Clear them.
*/
- prv[prv_nents - 1].offset = 0;
- prv[prv_nents - 1].length = 0;
+ prv->offset = 0;
+ prv->length = 0;
/*
* Set lowest bit to indicate a link pointer, and make sure to clear
diff --git a/trunk/include/linux/sched.h b/trunk/include/linux/sched.h
index cc14656f8682..ac3d496fbd20 100644
--- a/trunk/include/linux/sched.h
+++ b/trunk/include/linux/sched.h
@@ -1255,6 +1255,13 @@ struct pid_namespace;
*
* set_task_vxid() : assigns a virtual id to a task;
*
+ * task_ppid_nr_ns() : the parent's id as seen from the namespace specified.
+ * the result depends on the namespace and whether the
+ * task in question is the namespace's init. e.g. for the
+ * namespace's init this will return 0 when called from
+ * the namespace of this init, or appropriate id otherwise.
+ *
+ *
* see also pid_nr() etc in include/linux/pid.h
*/
@@ -1310,6 +1317,12 @@ static inline pid_t task_session_vnr(struct task_struct *tsk)
}
+static inline pid_t task_ppid_nr_ns(struct task_struct *tsk,
+ struct pid_namespace *ns)
+{
+ return pid_nr_ns(task_pid(rcu_dereference(tsk->real_parent)), ns);
+}
+
/**
* pid_alive - check that a task structure is not stale
* @p: Task structure to be checked.
diff --git a/trunk/include/linux/slab.h b/trunk/include/linux/slab.h
index f62caaad94e0..f3a8eecd99f3 100644
--- a/trunk/include/linux/slab.h
+++ b/trunk/include/linux/slab.h
@@ -271,10 +271,5 @@ static inline void *kzalloc(size_t size, gfp_t flags)
return kmalloc(size, flags | __GFP_ZERO);
}
-#ifdef CONFIG_SLABINFO
-extern const struct seq_operations slabinfo_op;
-ssize_t slabinfo_write(struct file *, const char __user *, size_t, loff_t *);
-#endif
-
#endif /* __KERNEL__ */
#endif /* _LINUX_SLAB_H */
diff --git a/trunk/include/linux/slab_def.h b/trunk/include/linux/slab_def.h
index fcc48096ee64..32bdc2ffd715 100644
--- a/trunk/include/linux/slab_def.h
+++ b/trunk/include/linux/slab_def.h
@@ -95,4 +95,7 @@ static inline void *kmalloc_node(size_t size, gfp_t flags, int node)
#endif /* CONFIG_NUMA */
+extern const struct seq_operations slabinfo_op;
+ssize_t slabinfo_write(struct file *, const char __user *, size_t, loff_t *);
+
#endif /* _LINUX_SLAB_DEF_H */
diff --git a/trunk/include/linux/tc_act/Kbuild b/trunk/include/linux/tc_act/Kbuild
index 6dac0d7365cc..78dfbac36375 100644
--- a/trunk/include/linux/tc_act/Kbuild
+++ b/trunk/include/linux/tc_act/Kbuild
@@ -2,4 +2,3 @@ header-y += tc_gact.h
header-y += tc_ipt.h
header-y += tc_mirred.h
header-y += tc_pedit.h
-header-y += tc_nat.h
diff --git a/trunk/include/linux/tty.h b/trunk/include/linux/tty.h
index defd2ab72449..c555f5442bd7 100644
--- a/trunk/include/linux/tty.h
+++ b/trunk/include/linux/tty.h
@@ -319,7 +319,6 @@ extern speed_t tty_termios_input_baud_rate(struct ktermios *termios);
extern void tty_termios_encode_baud_rate(struct ktermios *termios, speed_t ibaud, speed_t obaud);
extern void tty_encode_baud_rate(struct tty_struct *tty, speed_t ibaud, speed_t obaud);
extern void tty_termios_copy_hw(struct ktermios *new, struct ktermios *old);
-extern int tty_termios_hw_change(struct ktermios *a, struct ktermios *b);
extern struct tty_ldisc *tty_ldisc_ref(struct tty_struct *);
extern void tty_ldisc_deref(struct tty_ldisc *);
diff --git a/trunk/include/linux/workqueue.h b/trunk/include/linux/workqueue.h
index 7f28c32d9aca..7daafdc2514b 100644
--- a/trunk/include/linux/workqueue.h
+++ b/trunk/include/linux/workqueue.h
@@ -149,27 +149,19 @@ struct execute_work {
extern struct workqueue_struct *
__create_workqueue_key(const char *name, int singlethread,
- int freezeable, struct lock_class_key *key,
- const char *lock_name);
+ int freezeable, struct lock_class_key *key);
#ifdef CONFIG_LOCKDEP
#define __create_workqueue(name, singlethread, freezeable) \
({ \
static struct lock_class_key __key; \
- const char *__lock_name; \
- \
- if (__builtin_constant_p(name)) \
- __lock_name = (name); \
- else \
- __lock_name = #name; \
\
__create_workqueue_key((name), (singlethread), \
- (freezeable), &__key, \
- __lock_name); \
+ (freezeable), &__key); \
})
#else
#define __create_workqueue(name, singlethread, freezeable) \
- __create_workqueue_key((name), (singlethread), (freezeable), NULL, NULL)
+ __create_workqueue_key((name), (singlethread), (freezeable), NULL)
#endif
#define create_workqueue(name) __create_workqueue((name), 0, 0)
diff --git a/trunk/include/linux/writeback.h b/trunk/include/linux/writeback.h
index c6148bbf1250..bef7d66601cb 100644
--- a/trunk/include/linux/writeback.h
+++ b/trunk/include/linux/writeback.h
@@ -62,6 +62,7 @@ struct writeback_control {
unsigned for_reclaim:1; /* Invoked from the page allocator */
unsigned for_writepages:1; /* This is a writepages() call */
unsigned range_cyclic:1; /* range_start is cyclic */
+ unsigned more_io:1; /* more io to be dispatched */
};
/*
diff --git a/trunk/include/net/ax25.h b/trunk/include/net/ax25.h
index 32a57e1dee3a..4e3cd93f81fc 100644
--- a/trunk/include/net/ax25.h
+++ b/trunk/include/net/ax25.h
@@ -35,7 +35,7 @@
#define AX25_P_ATALK 0xca /* Appletalk */
#define AX25_P_ATALK_ARP 0xcb /* Appletalk ARP */
#define AX25_P_IP 0xcc /* ARPA Internet Protocol */
-#define AX25_P_ARP 0xcd /* ARPA Address Resolution */
+#define AX25_P_ARP 0xcd /* ARPA Adress Resolution */
#define AX25_P_FLEXNET 0xce /* FlexNet */
#define AX25_P_NETROM 0xcf /* NET/ROM */
#define AX25_P_TEXT 0xF0 /* No layer 3 protocol impl. */
diff --git a/trunk/include/net/ip6_tunnel.h b/trunk/include/net/ip6_tunnel.h
index c17fa1fdc356..29c9da707c7a 100644
--- a/trunk/include/net/ip6_tunnel.h
+++ b/trunk/include/net/ip6_tunnel.h
@@ -23,7 +23,7 @@ struct ip6_tnl {
struct net_device *dev; /* virtual device associated with tunnel */
struct net_device_stats stat; /* statistics for tunnel device */
int recursion; /* depth of hard_start_xmit recursion */
- struct ip6_tnl_parm parms; /* tunnel configuration parameters */
+ struct ip6_tnl_parm parms; /* tunnel configuration paramters */
struct flowi fl; /* flowi template for xmit */
struct dst_entry *dst_cache; /* cached dst */
u32 dst_cookie;
diff --git a/trunk/include/net/irda/discovery.h b/trunk/include/net/irda/discovery.h
index e4efad1f9eff..eb0f9de47294 100644
--- a/trunk/include/net/irda/discovery.h
+++ b/trunk/include/net/irda/discovery.h
@@ -80,7 +80,7 @@ typedef struct discovery_t {
irda_queue_t q; /* Must be first! */
discinfo_t data; /* Basic discovery information */
- int name_len; /* Length of nickname */
+ int name_len; /* Lenght of nickname */
LAP_REASON condition; /* More info about the discovery */
int gen_addr_bit; /* Need to generate a new device
diff --git a/trunk/include/net/netfilter/nf_conntrack.h b/trunk/include/net/netfilter/nf_conntrack.h
index 4ac5ab187c2a..90fb66d99d0c 100644
--- a/trunk/include/net/netfilter/nf_conntrack.h
+++ b/trunk/include/net/netfilter/nf_conntrack.h
@@ -249,7 +249,6 @@ static inline int nf_ct_is_untracked(const struct sk_buff *skb)
return (skb->nfct == &nf_conntrack_untracked.ct_general);
}
-extern int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp);
extern unsigned int nf_conntrack_htable_size;
extern int nf_conntrack_checksum;
extern atomic_t nf_conntrack_count;
diff --git a/trunk/include/net/sch_generic.h b/trunk/include/net/sch_generic.h
index 4c3b35153c37..c9265518a378 100644
--- a/trunk/include/net/sch_generic.h
+++ b/trunk/include/net/sch_generic.h
@@ -325,6 +325,7 @@ static inline struct sk_buff *skb_act_clone(struct sk_buff *skb, gfp_t gfp_mask)
n->tc_verd = SET_TC_VERD(n->tc_verd, 0);
n->tc_verd = CLR_TC_OK2MUNGE(n->tc_verd);
n->tc_verd = CLR_TC_MUNGED(n->tc_verd);
+ n->iif = skb->iif;
}
return n;
}
diff --git a/trunk/include/net/sctp/structs.h b/trunk/include/net/sctp/structs.h
index bb965742b64e..002a00a4e6be 100644
--- a/trunk/include/net/sctp/structs.h
+++ b/trunk/include/net/sctp/structs.h
@@ -301,7 +301,7 @@ struct sctp_sock {
/* The default SACK delay timeout for new associations. */
__u32 sackdelay;
- /* Flags controlling Heartbeat, SACK delay, and Path MTU Discovery. */
+ /* Flags controling Heartbeat, SACK delay, and Path MTU Discovery. */
__u32 param_flags;
struct sctp_initmsg initmsg;
@@ -955,7 +955,7 @@ struct sctp_transport {
/* PMTU : The current known path MTU. */
__u32 pathmtu;
- /* Flags controlling Heartbeat, SACK delay, and Path MTU Discovery. */
+ /* Flags controling Heartbeat, SACK delay, and Path MTU Discovery. */
__u32 param_flags;
/* The number of times INIT has been sent on this transport. */
@@ -1638,7 +1638,7 @@ struct sctp_association {
*/
__u32 pathmtu;
- /* Flags controlling Heartbeat, SACK delay, and Path MTU Discovery. */
+ /* Flags controling Heartbeat, SACK delay, and Path MTU Discovery. */
__u32 param_flags;
/* SACK delay timeout */
diff --git a/trunk/include/net/sctp/user.h b/trunk/include/net/sctp/user.h
index 954090b1e354..00848b641f59 100644
--- a/trunk/include/net/sctp/user.h
+++ b/trunk/include/net/sctp/user.h
@@ -450,7 +450,7 @@ enum sctp_sn_type {
SCTP_SHUTDOWN_EVENT,
SCTP_PARTIAL_DELIVERY_EVENT,
SCTP_ADAPTATION_INDICATION,
- SCTP_AUTHENTICATION_INDICATION,
+ SCTP_AUTHENTICATION_EVENT,
};
/* Notification error codes used to fill up the error fields in some
diff --git a/trunk/include/net/sock.h b/trunk/include/net/sock.h
index 6e1542da33a1..67e35c7e230c 100644
--- a/trunk/include/net/sock.h
+++ b/trunk/include/net/sock.h
@@ -944,7 +944,7 @@ static inline int sk_filter(struct sock *sk, struct sk_buff *skb)
return err;
rcu_read_lock_bh();
- filter = rcu_dereference(sk->sk_filter);
+ filter = sk->sk_filter;
if (filter) {
unsigned int pkt_len = sk_run_filter(skb, filter->insns,
filter->len);
diff --git a/trunk/include/linux/veth.h b/trunk/include/net/veth.h
similarity index 100%
rename from trunk/include/linux/veth.h
rename to trunk/include/net/veth.h
diff --git a/trunk/include/net/xfrm.h b/trunk/include/net/xfrm.h
index 1dd20cf17982..58dfa82889aa 100644
--- a/trunk/include/net/xfrm.h
+++ b/trunk/include/net/xfrm.h
@@ -1188,15 +1188,10 @@ static inline int xfrm_aevent_is_on(void)
return ret;
}
-static inline int xfrm_alg_len(struct xfrm_algo *alg)
-{
- return sizeof(*alg) + ((alg->alg_key_len + 7) / 8);
-}
-
#ifdef CONFIG_XFRM_MIGRATE
static inline struct xfrm_algo *xfrm_algo_clone(struct xfrm_algo *orig)
{
- return kmemdup(orig, xfrm_alg_len(orig), GFP_KERNEL);
+ return (struct xfrm_algo *)kmemdup(orig, sizeof(*orig) + orig->alg_key_len, GFP_KERNEL);
}
static inline void xfrm_states_put(struct xfrm_state **states, int n)
diff --git a/trunk/init/Kconfig b/trunk/init/Kconfig
index b9d11a899b88..404bbf3699be 100644
--- a/trunk/init/Kconfig
+++ b/trunk/init/Kconfig
@@ -658,12 +658,6 @@ endchoice
endmenu # General setup
-config SLABINFO
- bool
- depends on PROC_FS
- depends on SLAB || SLUB
- default y
-
config RT_MUTEXES
boolean
select PLIST
diff --git a/trunk/kernel/acct.c b/trunk/kernel/acct.c
index 521dfa53cb99..cf19547cc9e4 100644
--- a/trunk/kernel/acct.c
+++ b/trunk/kernel/acct.c
@@ -482,7 +482,7 @@ static void do_acct_process(struct file *file)
#endif
#if ACCT_VERSION==3
ac.ac_pid = current->tgid;
- ac.ac_ppid = current->real_parent->tgid;
+ ac.ac_ppid = current->parent->tgid;
#endif
spin_lock_irq(¤t->sighand->siglock);
diff --git a/trunk/kernel/futex.c b/trunk/kernel/futex.c
index db9824de8bf0..172a1aeeafdb 100644
--- a/trunk/kernel/futex.c
+++ b/trunk/kernel/futex.c
@@ -1097,15 +1097,15 @@ static void unqueue_me_pi(struct futex_q *q)
}
/*
- * Fixup the pi_state owner with the new owner.
+ * Fixup the pi_state owner with current.
*
* Must be called with hash bucket lock held and mm->sem held for non
* private futexes.
*/
static int fixup_pi_state_owner(u32 __user *uaddr, struct futex_q *q,
- struct task_struct *newowner)
+ struct task_struct *curr)
{
- u32 newtid = task_pid_vnr(newowner) | FUTEX_WAITERS;
+ u32 newtid = task_pid_vnr(curr) | FUTEX_WAITERS;
struct futex_pi_state *pi_state = q->pi_state;
u32 uval, curval, newval;
int ret;
@@ -1119,12 +1119,12 @@ static int fixup_pi_state_owner(u32 __user *uaddr, struct futex_q *q,
} else
newtid |= FUTEX_OWNER_DIED;
- pi_state->owner = newowner;
+ pi_state->owner = curr;
- spin_lock_irq(&newowner->pi_lock);
+ spin_lock_irq(&curr->pi_lock);
WARN_ON(!list_empty(&pi_state->list));
- list_add(&pi_state->list, &newowner->pi_state_list);
- spin_unlock_irq(&newowner->pi_lock);
+ list_add(&pi_state->list, &curr->pi_state_list);
+ spin_unlock_irq(&curr->pi_lock);
/*
* We own it, so we have to replace the pending owner
@@ -1508,40 +1508,9 @@ static int futex_lock_pi(u32 __user *uaddr, struct rw_semaphore *fshared,
* when we were on the way back before we locked the
* hash bucket.
*/
- if (q.pi_state->owner == curr) {
- /*
- * Try to get the rt_mutex now. This might
- * fail as some other task acquired the
- * rt_mutex after we removed ourself from the
- * rt_mutex waiters list.
- */
- if (rt_mutex_trylock(&q.pi_state->pi_mutex))
- ret = 0;
- else {
- /*
- * pi_state is incorrect, some other
- * task did a lock steal and we
- * returned due to timeout or signal
- * without taking the rt_mutex. Too
- * late. We can access the
- * rt_mutex_owner without locking, as
- * the other task is now blocked on
- * the hash bucket lock. Fix the state
- * up.
- */
- struct task_struct *owner;
- int res;
-
- owner = rt_mutex_owner(&q.pi_state->pi_mutex);
- res = fixup_pi_state_owner(uaddr, &q, owner);
-
- WARN_ON(rt_mutex_owner(&q.pi_state->pi_mutex) !=
- owner);
-
- /* propagate -EFAULT, if the fixup failed */
- if (res)
- ret = res;
- }
+ if (q.pi_state->owner == curr &&
+ rt_mutex_trylock(&q.pi_state->pi_mutex)) {
+ ret = 0;
} else {
/*
* Paranoia check. If we did not take the lock
diff --git a/trunk/kernel/hrtimer.c b/trunk/kernel/hrtimer.c
index f994bb8065e6..e65dd0b47cdc 100644
--- a/trunk/kernel/hrtimer.c
+++ b/trunk/kernel/hrtimer.c
@@ -1378,7 +1378,7 @@ sys_nanosleep(struct timespec __user *rqtp, struct timespec __user *rmtp)
/*
* Functions related to boot-time initialization:
*/
-static void __cpuinit init_hrtimers_cpu(int cpu)
+static void __devinit init_hrtimers_cpu(int cpu)
{
struct hrtimer_cpu_base *cpu_base = &per_cpu(hrtimer_bases, cpu);
int i;
diff --git a/trunk/kernel/kexec.c b/trunk/kernel/kexec.c
index 9a26eec9eb04..aa74a1ef2da8 100644
--- a/trunk/kernel/kexec.c
+++ b/trunk/kernel/kexec.c
@@ -1404,7 +1404,6 @@ static int __init crash_save_vmcoreinfo_init(void)
VMCOREINFO_OFFSET(list_head, next);
VMCOREINFO_OFFSET(list_head, prev);
VMCOREINFO_LENGTH(zone.free_area, MAX_ORDER);
- VMCOREINFO_LENGTH(free_area.free_list, MIGRATE_TYPES);
VMCOREINFO_NUMBER(NR_FREE_PAGES);
arch_crash_save_vmcoreinfo();
diff --git a/trunk/kernel/kmod.c b/trunk/kernel/kmod.c
index bb7df2a28bd7..c6a4f8aebeba 100644
--- a/trunk/kernel/kmod.c
+++ b/trunk/kernel/kmod.c
@@ -451,11 +451,13 @@ int call_usermodehelper_exec(struct subprocess_info *sub_info,
enum umh_wait wait)
{
DECLARE_COMPLETION_ONSTACK(done);
- int retval = 0;
+ int retval;
helper_lock();
- if (sub_info->path[0] == '\0')
+ if (sub_info->path[0] == '\0') {
+ retval = 0;
goto out;
+ }
if (!khelper_wq || usermodehelper_disabled) {
retval = -EBUSY;
@@ -466,14 +468,13 @@ int call_usermodehelper_exec(struct subprocess_info *sub_info,
sub_info->wait = wait;
queue_work(khelper_wq, &sub_info->work);
- if (wait == UMH_NO_WAIT) /* task has freed sub_info */
- goto unlock;
+ if (wait == UMH_NO_WAIT) /* task has freed sub_info */
+ return 0;
wait_for_completion(&done);
retval = sub_info->retval;
-out:
+ out:
call_usermodehelper_freeinfo(sub_info);
-unlock:
helper_unlock();
return retval;
}
diff --git a/trunk/kernel/lockdep.c b/trunk/kernel/lockdep.c
index 4335f12a27c6..723bd9f92556 100644
--- a/trunk/kernel/lockdep.c
+++ b/trunk/kernel/lockdep.c
@@ -2943,10 +2943,9 @@ void lockdep_free_key_range(void *start, unsigned long size)
struct list_head *head;
unsigned long flags;
int i;
- int locked;
raw_local_irq_save(flags);
- locked = graph_lock();
+ graph_lock();
/*
* Unhash all classes that were created by this module:
@@ -2960,8 +2959,7 @@ void lockdep_free_key_range(void *start, unsigned long size)
zap_class(class);
}
- if (locked)
- graph_unlock();
+ graph_unlock();
raw_local_irq_restore(flags);
}
@@ -2971,7 +2969,6 @@ void lockdep_reset_lock(struct lockdep_map *lock)
struct list_head *head;
unsigned long flags;
int i, j;
- int locked;
raw_local_irq_save(flags);
@@ -2990,7 +2987,7 @@ void lockdep_reset_lock(struct lockdep_map *lock)
* Debug check: in the end all mapped classes should
* be gone.
*/
- locked = graph_lock();
+ graph_lock();
for (i = 0; i < CLASSHASH_SIZE; i++) {
head = classhash_table + i;
if (list_empty(head))
@@ -3003,8 +3000,7 @@ void lockdep_reset_lock(struct lockdep_map *lock)
}
}
}
- if (locked)
- graph_unlock();
+ graph_unlock();
out_restore:
raw_local_irq_restore(flags);
diff --git a/trunk/kernel/module.c b/trunk/kernel/module.c
index c2e3e2e98801..91fe6958b6e1 100644
--- a/trunk/kernel/module.c
+++ b/trunk/kernel/module.c
@@ -2214,34 +2214,29 @@ static const char *get_ksymbol(struct module *mod,
/* For kallsyms to ask for address resolution. NULL means not found.
We don't lock, as this is used for oops resolution and races are a
lesser concern. */
-/* FIXME: Risky: returns a pointer into a module w/o lock */
const char *module_address_lookup(unsigned long addr,
unsigned long *size,
unsigned long *offset,
char **modname)
{
struct module *mod;
- const char *ret = NULL;
- preempt_disable();
list_for_each_entry(mod, &modules, list) {
if (within(addr, mod->module_init, mod->init_size)
|| within(addr, mod->module_core, mod->core_size)) {
if (modname)
*modname = mod->name;
- ret = get_ksymbol(mod, addr, size, offset);
- break;
+ return get_ksymbol(mod, addr, size, offset);
}
}
- preempt_enable();
- return ret;
+ return NULL;
}
int lookup_module_symbol_name(unsigned long addr, char *symname)
{
struct module *mod;
- preempt_disable();
+ mutex_lock(&module_mutex);
list_for_each_entry(mod, &modules, list) {
if (within(addr, mod->module_init, mod->init_size) ||
within(addr, mod->module_core, mod->core_size)) {
@@ -2251,12 +2246,12 @@ int lookup_module_symbol_name(unsigned long addr, char *symname)
if (!sym)
goto out;
strlcpy(symname, sym, KSYM_NAME_LEN);
- preempt_enable();
+ mutex_unlock(&module_mutex);
return 0;
}
}
out:
- preempt_enable();
+ mutex_unlock(&module_mutex);
return -ERANGE;
}
@@ -2265,7 +2260,7 @@ int lookup_module_symbol_attrs(unsigned long addr, unsigned long *size,
{
struct module *mod;
- preempt_disable();
+ mutex_lock(&module_mutex);
list_for_each_entry(mod, &modules, list) {
if (within(addr, mod->module_init, mod->init_size) ||
within(addr, mod->module_core, mod->core_size)) {
@@ -2278,12 +2273,12 @@ int lookup_module_symbol_attrs(unsigned long addr, unsigned long *size,
strlcpy(modname, mod->name, MODULE_NAME_LEN);
if (name)
strlcpy(name, sym, KSYM_NAME_LEN);
- preempt_enable();
+ mutex_unlock(&module_mutex);
return 0;
}
}
out:
- preempt_enable();
+ mutex_unlock(&module_mutex);
return -ERANGE;
}
@@ -2292,7 +2287,7 @@ int module_get_kallsym(unsigned int symnum, unsigned long *value, char *type,
{
struct module *mod;
- preempt_disable();
+ mutex_lock(&module_mutex);
list_for_each_entry(mod, &modules, list) {
if (symnum < mod->num_symtab) {
*value = mod->symtab[symnum].st_value;
@@ -2301,12 +2296,12 @@ int module_get_kallsym(unsigned int symnum, unsigned long *value, char *type,
KSYM_NAME_LEN);
strlcpy(module_name, mod->name, MODULE_NAME_LEN);
*exported = is_exported(name, mod);
- preempt_enable();
+ mutex_unlock(&module_mutex);
return 0;
}
symnum -= mod->num_symtab;
}
- preempt_enable();
+ mutex_unlock(&module_mutex);
return -ERANGE;
}
@@ -2329,7 +2324,6 @@ unsigned long module_kallsyms_lookup_name(const char *name)
unsigned long ret = 0;
/* Don't lock: we're in enough trouble already. */
- preempt_disable();
if ((colon = strchr(name, ':')) != NULL) {
*colon = '\0';
if ((mod = find_module(name)) != NULL)
@@ -2340,7 +2334,6 @@ unsigned long module_kallsyms_lookup_name(const char *name)
if ((ret = mod_find_symname(mod, name)) != 0)
break;
}
- preempt_enable();
return ret;
}
#endif /* CONFIG_KALLSYMS */
diff --git a/trunk/kernel/params.c b/trunk/kernel/params.c
index 7686417ee00e..2a4c51487e72 100644
--- a/trunk/kernel/params.c
+++ b/trunk/kernel/params.c
@@ -697,18 +697,8 @@ static struct kset_uevent_ops module_uevent_ops = {
decl_subsys(module, &module_ktype, &module_uevent_ops);
int module_sysfs_initialized;
-static void module_release(struct kobject *kobj)
-{
- /*
- * Stupid empty release function to allow the memory for the kobject to
- * be properly cleaned up. This will not need to be present for 2.6.25
- * with the upcoming kobject core rework.
- */
-}
-
static struct kobj_type module_ktype = {
.sysfs_ops = &module_sysfs_ops,
- .release = module_release,
};
/*
diff --git a/trunk/kernel/power/main.c b/trunk/kernel/power/main.c
index f71c9504a5c5..3cdf95b1dc92 100644
--- a/trunk/kernel/power/main.c
+++ b/trunk/kernel/power/main.c
@@ -28,9 +28,6 @@ BLOCKING_NOTIFIER_HEAD(pm_chain_head);
DEFINE_MUTEX(pm_mutex);
-unsigned int pm_flags;
-EXPORT_SYMBOL(pm_flags);
-
#ifdef CONFIG_SUSPEND
/* This is just an arbitrary number */
diff --git a/trunk/kernel/power/pm.c b/trunk/kernel/power/pm.c
index 60c73fa670d5..c50d15266c10 100644
--- a/trunk/kernel/power/pm.c
+++ b/trunk/kernel/power/pm.c
@@ -27,6 +27,8 @@
#include
#include
+int pm_active;
+
/*
* Locking notes:
* pm_devs_lock can be a semaphore providing pm ops are not called
@@ -202,4 +204,6 @@ int pm_send_all(pm_request_t rqst, void *data)
EXPORT_SYMBOL(pm_register);
EXPORT_SYMBOL(pm_send_all);
+EXPORT_SYMBOL(pm_active);
+
diff --git a/trunk/kernel/printk.c b/trunk/kernel/printk.c
index 89011bf8c106..a30fe33de395 100644
--- a/trunk/kernel/printk.c
+++ b/trunk/kernel/printk.c
@@ -817,7 +817,7 @@ __setup("console=", console_setup);
* commonly to provide a default console (ie from PROM variables) when
* the user has not supplied one.
*/
-int add_preferred_console(char *name, int idx, char *options)
+int __init add_preferred_console(char *name, int idx, char *options)
{
struct console_cmdline *c;
int i;
diff --git a/trunk/kernel/ptrace.c b/trunk/kernel/ptrace.c
index c25db863081d..7c76f2ffaeaa 100644
--- a/trunk/kernel/ptrace.c
+++ b/trunk/kernel/ptrace.c
@@ -120,7 +120,7 @@ int ptrace_check_attach(struct task_struct *child, int kill)
return ret;
}
-int __ptrace_may_attach(struct task_struct *task)
+static int may_attach(struct task_struct *task)
{
/* May we inspect the given task?
* This check is used both for attaching with ptrace
@@ -154,7 +154,7 @@ int ptrace_may_attach(struct task_struct *task)
{
int err;
task_lock(task);
- err = __ptrace_may_attach(task);
+ err = may_attach(task);
task_unlock(task);
return !err;
}
@@ -196,7 +196,7 @@ int ptrace_attach(struct task_struct *task)
/* the same process cannot be attached many times */
if (task->ptrace & PT_PTRACED)
goto bad;
- retval = __ptrace_may_attach(task);
+ retval = may_attach(task);
if (retval)
goto bad;
diff --git a/trunk/kernel/rcupdate.c b/trunk/kernel/rcupdate.c
index f2c1a04e9b18..a66d4d1615f7 100644
--- a/trunk/kernel/rcupdate.c
+++ b/trunk/kernel/rcupdate.c
@@ -549,7 +549,7 @@ static void rcu_init_percpu_data(int cpu, struct rcu_ctrlblk *rcp,
rdp->blimit = blimit;
}
-static void __cpuinit rcu_online_cpu(int cpu)
+static void __devinit rcu_online_cpu(int cpu)
{
struct rcu_data *rdp = &per_cpu(rcu_data, cpu);
struct rcu_data *bh_rdp = &per_cpu(rcu_bh_data, cpu);
diff --git a/trunk/kernel/sched.c b/trunk/kernel/sched.c
index e76b11ca6df3..3df84ea6aba9 100644
--- a/trunk/kernel/sched.c
+++ b/trunk/kernel/sched.c
@@ -4918,7 +4918,7 @@ static void show_task(struct task_struct *p)
}
#endif
printk(KERN_CONT "%5lu %5d %6d\n", free,
- task_pid_nr(p), task_pid_nr(p->real_parent));
+ task_pid_nr(p), task_pid_nr(p->parent));
if (state != TASK_RUNNING)
show_stack(p, NULL);
@@ -7153,14 +7153,6 @@ int sched_group_set_shares(struct task_group *tg, unsigned long shares)
{
int i;
- /*
- * A weight of 0 or 1 can cause arithmetics problems.
- * (The default weight is 1024 - so there's no practical
- * limitation from this.)
- */
- if (shares < 2)
- shares = 2;
-
spin_lock(&tg->lock);
if (tg->shares == shares)
goto done;
diff --git a/trunk/kernel/sched_debug.c b/trunk/kernel/sched_debug.c
index 80fbbfc04290..d30467b47ddd 100644
--- a/trunk/kernel/sched_debug.c
+++ b/trunk/kernel/sched_debug.c
@@ -31,9 +31,9 @@
/*
* Ease the printing of nsec fields:
*/
-static long long nsec_high(unsigned long long nsec)
+static long long nsec_high(long long nsec)
{
- if ((long long)nsec < 0) {
+ if (nsec < 0) {
nsec = -nsec;
do_div(nsec, 1000000);
return -nsec;
@@ -43,9 +43,9 @@ static long long nsec_high(unsigned long long nsec)
return nsec;
}
-static unsigned long nsec_low(unsigned long long nsec)
+static unsigned long nsec_low(long long nsec)
{
- if ((long long)nsec < 0)
+ if (nsec < 0)
nsec = -nsec;
return do_div(nsec, 1000000);
diff --git a/trunk/kernel/sys_ni.c b/trunk/kernel/sys_ni.c
index beee5b3b68a2..56cb009a4b35 100644
--- a/trunk/kernel/sys_ni.c
+++ b/trunk/kernel/sys_ni.c
@@ -131,7 +131,6 @@ cond_syscall(sys32_sysctl);
cond_syscall(ppc_rtas);
cond_syscall(sys_spu_run);
cond_syscall(sys_spu_create);
-cond_syscall(sys_subpage_prot);
/* mmu depending weak syscall entries */
cond_syscall(sys_mprotect);
diff --git a/trunk/kernel/timer.c b/trunk/kernel/timer.c
index 2a00c22203f3..d4527dcef1af 100644
--- a/trunk/kernel/timer.c
+++ b/trunk/kernel/timer.c
@@ -978,7 +978,7 @@ asmlinkage long sys_getppid(void)
int pid;
rcu_read_lock();
- pid = task_tgid_nr_ns(current->real_parent, current->nsproxy->pid_ns);
+ pid = task_ppid_nr_ns(current, current->nsproxy->pid_ns);
rcu_read_unlock();
return pid;
@@ -1289,7 +1289,7 @@ static void migrate_timer_list(tvec_base_t *new_base, struct list_head *head)
}
}
-static void __cpuinit migrate_timers(int cpu)
+static void __devinit migrate_timers(int cpu)
{
tvec_base_t *old_base;
tvec_base_t *new_base;
diff --git a/trunk/kernel/workqueue.c b/trunk/kernel/workqueue.c
index 8db0b597509e..52d5e7c9a8e6 100644
--- a/trunk/kernel/workqueue.c
+++ b/trunk/kernel/workqueue.c
@@ -722,8 +722,7 @@ static void start_workqueue_thread(struct cpu_workqueue_struct *cwq, int cpu)
struct workqueue_struct *__create_workqueue_key(const char *name,
int singlethread,
int freezeable,
- struct lock_class_key *key,
- const char *lock_name)
+ struct lock_class_key *key)
{
struct workqueue_struct *wq;
struct cpu_workqueue_struct *cwq;
@@ -740,7 +739,7 @@ struct workqueue_struct *__create_workqueue_key(const char *name,
}
wq->name = name;
- lockdep_init_map(&wq->lockdep_map, lock_name, key, 0);
+ lockdep_init_map(&wq->lockdep_map, name, key, 0);
wq->singlethread = singlethread;
wq->freezeable = freezeable;
INIT_LIST_HEAD(&wq->list);
diff --git a/trunk/lib/proportions.c b/trunk/lib/proportions.c
index 9508d9a7af3e..332d8c58184d 100644
--- a/trunk/lib/proportions.c
+++ b/trunk/lib/proportions.c
@@ -190,8 +190,6 @@ prop_adjust_shift(int *pl_shift, unsigned long *pl_period, int new_shift)
* PERCPU
*/
-#define PROP_BATCH (8*(1+ilog2(nr_cpu_ids)))
-
int prop_local_init_percpu(struct prop_local_percpu *pl)
{
spin_lock_init(&pl->lock);
@@ -232,24 +230,31 @@ void prop_norm_percpu(struct prop_global *pg, struct prop_local_percpu *pl)
spin_lock_irqsave(&pl->lock, flags);
prop_adjust_shift(&pl->shift, &pl->period, pg->shift);
-
/*
* For each missed period, we half the local counter.
* basically:
* pl->events >> (global_period - pl->period);
+ *
+ * but since the distributed nature of percpu counters make division
+ * rather hard, use a regular subtraction loop. This is safe, because
+ * the events will only every be incremented, hence the subtraction
+ * can never result in a negative number.
*/
- period = (global_period - pl->period) >> (pg->shift - 1);
- if (period < BITS_PER_LONG) {
- s64 val = percpu_counter_read(&pl->events);
-
- if (val < (nr_cpu_ids * PROP_BATCH))
- val = percpu_counter_sum(&pl->events);
-
- __percpu_counter_add(&pl->events, -val + (val >> period),
- PROP_BATCH);
- } else
- percpu_counter_set(&pl->events, 0);
-
+ while (pl->period != global_period) {
+ unsigned long val = percpu_counter_read(&pl->events);
+ unsigned long half = (val + 1) >> 1;
+
+ /*
+ * Half of zero won't be much less, break out.
+ * This limits the loop to shift iterations, even
+ * if we missed a million.
+ */
+ if (!val)
+ break;
+
+ percpu_counter_add(&pl->events, -half);
+ pl->period += period;
+ }
pl->period = global_period;
spin_unlock_irqrestore(&pl->lock, flags);
}
@@ -262,7 +267,7 @@ void __prop_inc_percpu(struct prop_descriptor *pd, struct prop_local_percpu *pl)
struct prop_global *pg = prop_get_global(pd);
prop_norm_percpu(pg, pl);
- __percpu_counter_add(&pl->events, 1, PROP_BATCH);
+ percpu_counter_add(&pl->events, 1);
percpu_counter_add(&pg->events, 1);
prop_put_global(pd, pg);
}
diff --git a/trunk/mm/filemap_xip.c b/trunk/mm/filemap_xip.c
index f874ae818ad3..e233fff61b4b 100644
--- a/trunk/mm/filemap_xip.c
+++ b/trunk/mm/filemap_xip.c
@@ -25,15 +25,14 @@ static struct page *__xip_sparse_page;
static struct page *xip_sparse_page(void)
{
if (!__xip_sparse_page) {
- struct page *page = alloc_page(GFP_HIGHUSER | __GFP_ZERO);
-
- if (page) {
+ unsigned long zeroes = get_zeroed_page(GFP_HIGHUSER);
+ if (zeroes) {
static DEFINE_SPINLOCK(xip_alloc_lock);
spin_lock(&xip_alloc_lock);
if (!__xip_sparse_page)
- __xip_sparse_page = page;
+ __xip_sparse_page = virt_to_page(zeroes);
else
- __free_page(page);
+ free_page(zeroes);
spin_unlock(&xip_alloc_lock);
}
}
diff --git a/trunk/mm/hugetlb.c b/trunk/mm/hugetlb.c
index e0fda156f021..7224a4f07106 100644
--- a/trunk/mm/hugetlb.c
+++ b/trunk/mm/hugetlb.c
@@ -418,14 +418,9 @@ static struct page *alloc_huge_page_private(struct vm_area_struct *vma,
if (free_huge_pages > resv_huge_pages)
page = dequeue_huge_page(vma, addr);
spin_unlock(&hugetlb_lock);
- if (!page) {
+ if (!page)
page = alloc_buddy_huge_page(vma, addr);
- if (!page) {
- hugetlb_put_quota(vma->vm_file->f_mapping, 1);
- return ERR_PTR(-VM_FAULT_OOM);
- }
- }
- return page;
+ return page ? page : ERR_PTR(-VM_FAULT_OOM);
}
static struct page *alloc_huge_page(struct vm_area_struct *vma,
@@ -1211,10 +1206,8 @@ int hugetlb_reserve_pages(struct inode *inode, long from, long to)
if (hugetlb_get_quota(inode->i_mapping, chg))
return -ENOSPC;
ret = hugetlb_acct_memory(chg);
- if (ret < 0) {
- hugetlb_put_quota(inode->i_mapping, chg);
+ if (ret < 0)
return ret;
- }
region_add(&inode->i_mapping->private_list, from, to);
return 0;
}
diff --git a/trunk/mm/memory.c b/trunk/mm/memory.c
index 4b0144b24c12..4bf0b6d0eb2a 100644
--- a/trunk/mm/memory.c
+++ b/trunk/mm/memory.c
@@ -392,7 +392,6 @@ struct page *vm_normal_page(struct vm_area_struct *vma, unsigned long addr, pte_
return NULL;
}
-#ifdef CONFIG_DEBUG_VM
/*
* Add some anal sanity checks for now. Eventually,
* we should just do "return pfn_to_page(pfn)", but
@@ -403,7 +402,6 @@ struct page *vm_normal_page(struct vm_area_struct *vma, unsigned long addr, pte_
print_bad_pte(vma, pte, addr);
return NULL;
}
-#endif
/*
* NOTE! We still have PageReserved() pages in the page
@@ -1670,9 +1668,6 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct *vma,
unlock:
pte_unmap_unlock(page_table, ptl);
if (dirty_page) {
- if (vma->vm_file)
- file_update_time(vma->vm_file);
-
/*
* Yes, Virginia, this is actually required to prevent a race
* with clear_page_dirty_for_io() from clearing the page dirty
@@ -2346,9 +2341,6 @@ static int __do_fault(struct mm_struct *mm, struct vm_area_struct *vma,
if (anon)
page_cache_release(vmf.page);
else if (dirty_page) {
- if (vma->vm_file)
- file_update_time(vma->vm_file);
-
set_page_dirty_balance(dirty_page, page_mkwrite);
put_page(dirty_page);
}
diff --git a/trunk/mm/page-writeback.c b/trunk/mm/page-writeback.c
index 3d3848fa6324..d55cfcae2ef1 100644
--- a/trunk/mm/page-writeback.c
+++ b/trunk/mm/page-writeback.c
@@ -558,6 +558,7 @@ static void background_writeout(unsigned long _min_pages)
global_page_state(NR_UNSTABLE_NFS) < background_thresh
&& min_pages <= 0)
break;
+ wbc.more_io = 0;
wbc.encountered_congestion = 0;
wbc.nr_to_write = MAX_WRITEBACK_PAGES;
wbc.pages_skipped = 0;
@@ -565,8 +566,9 @@ static void background_writeout(unsigned long _min_pages)
min_pages -= MAX_WRITEBACK_PAGES - wbc.nr_to_write;
if (wbc.nr_to_write > 0 || wbc.pages_skipped > 0) {
/* Wrote less than expected */
- congestion_wait(WRITE, HZ/10);
- if (!wbc.encountered_congestion)
+ if (wbc.encountered_congestion || wbc.more_io)
+ congestion_wait(WRITE, HZ/10);
+ else
break;
}
}
@@ -631,11 +633,12 @@ static void wb_kupdate(unsigned long arg)
global_page_state(NR_UNSTABLE_NFS) +
(inodes_stat.nr_inodes - inodes_stat.nr_unused);
while (nr_to_write > 0) {
+ wbc.more_io = 0;
wbc.encountered_congestion = 0;
wbc.nr_to_write = MAX_WRITEBACK_PAGES;
writeback_inodes(&wbc);
if (wbc.nr_to_write > 0) {
- if (wbc.encountered_congestion)
+ if (wbc.encountered_congestion || wbc.more_io)
congestion_wait(WRITE, HZ/10);
else
break; /* All the old data is written */
diff --git a/trunk/mm/page_alloc.c b/trunk/mm/page_alloc.c
index b2838c24e582..d73bfad1c32f 100644
--- a/trunk/mm/page_alloc.c
+++ b/trunk/mm/page_alloc.c
@@ -2566,7 +2566,7 @@ static void __meminit zone_init_free_lists(struct pglist_data *pgdat,
memmap_init_zone((size), (nid), (zone), (start_pfn), MEMMAP_EARLY)
#endif
-static int zone_batchsize(struct zone *zone)
+static int __devinit zone_batchsize(struct zone *zone)
{
int batch;
@@ -3438,7 +3438,7 @@ static void __init_refok alloc_node_mem_map(struct pglist_data *pgdat)
mem_map = NODE_DATA(0)->node_mem_map;
#ifdef CONFIG_ARCH_POPULATES_NODE_MAP
if (page_to_pfn(mem_map) != pgdat->node_start_pfn)
- mem_map -= (pgdat->node_start_pfn - ARCH_PFN_OFFSET);
+ mem_map -= pgdat->node_start_pfn;
#endif /* CONFIG_ARCH_POPULATES_NODE_MAP */
}
#endif
diff --git a/trunk/mm/quicklist.c b/trunk/mm/quicklist.c
index 3f703f7cb398..ae8189c2799e 100644
--- a/trunk/mm/quicklist.c
+++ b/trunk/mm/quicklist.c
@@ -26,17 +26,9 @@ DEFINE_PER_CPU(struct quicklist, quicklist)[CONFIG_NR_QUICK];
static unsigned long max_pages(unsigned long min_pages)
{
unsigned long node_free_pages, max;
- struct zone *zones = NODE_DATA(numa_node_id())->node_zones;
-
- node_free_pages =
-#ifdef CONFIG_ZONE_DMA
- zone_page_state(&zones[ZONE_DMA], NR_FREE_PAGES) +
-#endif
-#ifdef CONFIG_ZONE_DMA32
- zone_page_state(&zones[ZONE_DMA32], NR_FREE_PAGES) +
-#endif
- zone_page_state(&zones[ZONE_NORMAL], NR_FREE_PAGES);
+ node_free_pages = node_page_state(numa_node_id(),
+ NR_FREE_PAGES);
max = node_free_pages / FRACTION_OF_NODE_MEM;
return max(max, min_pages);
}
diff --git a/trunk/mm/slab.c b/trunk/mm/slab.c
index aebb9f68557a..2e338a5f7b14 100644
--- a/trunk/mm/slab.c
+++ b/trunk/mm/slab.c
@@ -4105,7 +4105,7 @@ static void cache_reap(struct work_struct *w)
schedule_delayed_work(work, round_jiffies_relative(REAPTIMEOUT_CPUC));
}
-#ifdef CONFIG_SLABINFO
+#ifdef CONFIG_PROC_FS
static void print_slabinfo_header(struct seq_file *m)
{
diff --git a/trunk/mm/slub.c b/trunk/mm/slub.c
index 474945ecd89d..b9f37cb0f2e6 100644
--- a/trunk/mm/slub.c
+++ b/trunk/mm/slub.c
@@ -172,7 +172,7 @@ static inline void ClearSlabDebug(struct page *page)
* Mininum number of partial slabs. These will be left on the partial
* lists even if they are empty. kmem_cache_shrink may reclaim them.
*/
-#define MIN_PARTIAL 5
+#define MIN_PARTIAL 2
/*
* Maximum number of desirable partial slabs.
@@ -1613,7 +1613,7 @@ static void __slab_free(struct kmem_cache *s, struct page *page,
* then add it.
*/
if (unlikely(!prior))
- add_partial_tail(get_node(s, page_to_nid(page)), page);
+ add_partial(get_node(s, page_to_nid(page)), page);
out_unlock:
slab_unlock(page);
@@ -3076,19 +3076,6 @@ void *__kmalloc_node_track_caller(size_t size, gfp_t gfpflags,
return slab_alloc(s, gfpflags, node, caller);
}
-static unsigned long count_partial(struct kmem_cache_node *n)
-{
- unsigned long flags;
- unsigned long x = 0;
- struct page *page;
-
- spin_lock_irqsave(&n->list_lock, flags);
- list_for_each_entry(page, &n->partial, lru)
- x += page->inuse;
- spin_unlock_irqrestore(&n->list_lock, flags);
- return x;
-}
-
#if defined(CONFIG_SYSFS) && defined(CONFIG_SLUB_DEBUG)
static int validate_slab(struct kmem_cache *s, struct page *page,
unsigned long *map)
@@ -3471,6 +3458,19 @@ static int list_locations(struct kmem_cache *s, char *buf,
return n;
}
+static unsigned long count_partial(struct kmem_cache_node *n)
+{
+ unsigned long flags;
+ unsigned long x = 0;
+ struct page *page;
+
+ spin_lock_irqsave(&n->list_lock, flags);
+ list_for_each_entry(page, &n->partial, lru)
+ x += page->inuse;
+ spin_unlock_irqrestore(&n->list_lock, flags);
+ return x;
+}
+
enum slab_stat_type {
SL_FULL,
SL_PARTIAL,
@@ -4123,89 +4123,3 @@ static int __init slab_sysfs_init(void)
__initcall(slab_sysfs_init);
#endif
-
-/*
- * The /proc/slabinfo ABI
- */
-#ifdef CONFIG_SLABINFO
-
-ssize_t slabinfo_write(struct file *file, const char __user * buffer,
- size_t count, loff_t *ppos)
-{
- return -EINVAL;
-}
-
-
-static void print_slabinfo_header(struct seq_file *m)
-{
- seq_puts(m, "slabinfo - version: 2.1\n");
- seq_puts(m, "# name "
- " ");
- seq_puts(m, " : tunables ");
- seq_puts(m, " : slabdata ");
- seq_putc(m, '\n');
-}
-
-static void *s_start(struct seq_file *m, loff_t *pos)
-{
- loff_t n = *pos;
-
- down_read(&slub_lock);
- if (!n)
- print_slabinfo_header(m);
-
- return seq_list_start(&slab_caches, *pos);
-}
-
-static void *s_next(struct seq_file *m, void *p, loff_t *pos)
-{
- return seq_list_next(p, &slab_caches, pos);
-}
-
-static void s_stop(struct seq_file *m, void *p)
-{
- up_read(&slub_lock);
-}
-
-static int s_show(struct seq_file *m, void *p)
-{
- unsigned long nr_partials = 0;
- unsigned long nr_slabs = 0;
- unsigned long nr_inuse = 0;
- unsigned long nr_objs;
- struct kmem_cache *s;
- int node;
-
- s = list_entry(p, struct kmem_cache, list);
-
- for_each_online_node(node) {
- struct kmem_cache_node *n = get_node(s, node);
-
- if (!n)
- continue;
-
- nr_partials += n->nr_partial;
- nr_slabs += atomic_long_read(&n->nr_slabs);
- nr_inuse += count_partial(n);
- }
-
- nr_objs = nr_slabs * s->objects;
- nr_inuse += (nr_slabs - nr_partials) * s->objects;
-
- seq_printf(m, "%-17s %6lu %6lu %6u %4u %4d", s->name, nr_inuse,
- nr_objs, s->size, s->objects, (1 << s->order));
- seq_printf(m, " : tunables %4u %4u %4u", 0, 0, 0);
- seq_printf(m, " : slabdata %6lu %6lu %6lu", nr_slabs, nr_slabs,
- 0UL);
- seq_putc(m, '\n');
- return 0;
-}
-
-const struct seq_operations slabinfo_op = {
- .start = s_start,
- .next = s_next,
- .stop = s_stop,
- .show = s_show,
-};
-
-#endif /* CONFIG_SLABINFO */
diff --git a/trunk/net/802/tr.c b/trunk/net/802/tr.c
index 1e115e5beab6..a2bd0f2e3af8 100644
--- a/trunk/net/802/tr.c
+++ b/trunk/net/802/tr.c
@@ -642,7 +642,7 @@ struct net_device *alloc_trdev(int sizeof_priv)
static int __init rif_init(void)
{
init_timer(&rif_timer);
- rif_timer.expires = jiffies + sysctl_tr_rif_timeout;
+ rif_timer.expires = sysctl_tr_rif_timeout;
rif_timer.data = 0L;
rif_timer.function = rif_check_expire;
add_timer(&rif_timer);
diff --git a/trunk/net/8021q/vlan.c b/trunk/net/8021q/vlan.c
index 032bf44eca5e..4add9bd4bc8d 100644
--- a/trunk/net/8021q/vlan.c
+++ b/trunk/net/8021q/vlan.c
@@ -323,7 +323,6 @@ static const struct header_ops vlan_header_ops = {
static int vlan_dev_init(struct net_device *dev)
{
struct net_device *real_dev = VLAN_DEV_INFO(dev)->real_dev;
- int subclass = 0;
/* IFF_BROADCAST|IFF_MULTICAST; ??? */
dev->flags = real_dev->flags & ~IFF_UP;
@@ -350,11 +349,7 @@ static int vlan_dev_init(struct net_device *dev)
dev->hard_start_xmit = vlan_dev_hard_start_xmit;
}
- if (real_dev->priv_flags & IFF_802_1Q_VLAN)
- subclass = 1;
-
- lockdep_set_class_and_subclass(&dev->_xmit_lock,
- &vlan_netdev_xmit_lock_key, subclass);
+ lockdep_set_class(&dev->_xmit_lock, &vlan_netdev_xmit_lock_key);
return 0;
}
diff --git a/trunk/net/atm/mpc.c b/trunk/net/atm/mpc.c
index 9c7f712fc7e9..2086396de177 100644
--- a/trunk/net/atm/mpc.c
+++ b/trunk/net/atm/mpc.c
@@ -542,13 +542,6 @@ static int mpc_send_packet(struct sk_buff *skb, struct net_device *dev)
if (eth->h_proto != htons(ETH_P_IP))
goto non_ip; /* Multi-Protocol Over ATM :-) */
- /* Weed out funny packets (e.g., AF_PACKET or raw). */
- if (skb->len < ETH_HLEN + sizeof(struct iphdr))
- goto non_ip;
- skb_set_network_header(skb, ETH_HLEN);
- if (skb->len < ETH_HLEN + ip_hdr(skb)->ihl * 4 || ip_hdr(skb)->ihl < 5)
- goto non_ip;
-
while (i < mpc->number_of_mps_macs) {
if (!compare_ether_addr(eth->h_dest, (mpc->mps_macs + i*ETH_ALEN)))
if ( send_via_shortcut(skb, mpc) == 0 ) /* try shortcut */
diff --git a/trunk/net/ax25/af_ax25.c b/trunk/net/ax25/af_ax25.c
index b4725ff317c0..8378afd54b30 100644
--- a/trunk/net/ax25/af_ax25.c
+++ b/trunk/net/ax25/af_ax25.c
@@ -87,22 +87,10 @@ static void ax25_kill_by_device(struct net_device *dev)
return;
spin_lock_bh(&ax25_list_lock);
-again:
ax25_for_each(s, node, &ax25_list) {
if (s->ax25_dev == ax25_dev) {
s->ax25_dev = NULL;
- spin_unlock_bh(&ax25_list_lock);
ax25_disconnect(s, ENETUNREACH);
- spin_lock_bh(&ax25_list_lock);
-
- /* The entry could have been deleted from the
- * list meanwhile and thus the next pointer is
- * no longer valid. Play it safe and restart
- * the scan. Forward progress is ensured
- * because we set s->ax25_dev to NULL and we
- * are never passed a NULL 'dev' argument.
- */
- goto again;
}
}
spin_unlock_bh(&ax25_list_lock);
@@ -1121,19 +1109,21 @@ static int __must_check ax25_connect(struct socket *sock,
* some sanity checks. code further down depends on this
*/
- if (addr_len == sizeof(struct sockaddr_ax25))
- /* support for this will go away in early 2.5.x
- * ax25_connect(): uses obsolete socket structure
- */
- ;
- else if (addr_len != sizeof(struct full_sockaddr_ax25))
- /* support for old structure may go away some time
- * ax25_connect(): uses old (6 digipeater) socket structure.
- */
+ if (addr_len == sizeof(struct sockaddr_ax25)) {
+ /* support for this will go away in early 2.5.x */
+ printk(KERN_WARNING "ax25_connect(): %s uses obsolete socket structure\n",
+ current->comm);
+ }
+ else if (addr_len != sizeof(struct full_sockaddr_ax25)) {
+ /* support for old structure may go away some time */
if ((addr_len < sizeof(struct sockaddr_ax25) + sizeof(ax25_address) * 6) ||
- (addr_len > sizeof(struct full_sockaddr_ax25)))
+ (addr_len > sizeof(struct full_sockaddr_ax25))) {
return -EINVAL;
+ }
+ printk(KERN_WARNING "ax25_connect(): %s uses old (6 digipeater) socket structure.\n",
+ current->comm);
+ }
if (fsa->fsa_ax25.sax25_family != AF_AX25)
return -EINVAL;
@@ -1477,20 +1467,21 @@ static int ax25_sendmsg(struct kiocb *iocb, struct socket *sock,
goto out;
}
- if (addr_len == sizeof(struct sockaddr_ax25))
- /* ax25_sendmsg(): uses obsolete socket structure */
- ;
- else if (addr_len != sizeof(struct full_sockaddr_ax25))
- /* support for old structure may go away some time
- * ax25_sendmsg(): uses old (6 digipeater)
- * socket structure.
- */
+ if (addr_len == sizeof(struct sockaddr_ax25)) {
+ printk(KERN_WARNING "ax25_sendmsg(): %s uses obsolete socket structure\n",
+ current->comm);
+ }
+ else if (addr_len != sizeof(struct full_sockaddr_ax25)) {
+ /* support for old structure may go away some time */
if ((addr_len < sizeof(struct sockaddr_ax25) + sizeof(ax25_address) * 6) ||
(addr_len > sizeof(struct full_sockaddr_ax25))) {
err = -EINVAL;
goto out;
}
+ printk(KERN_WARNING "ax25_sendmsg(): %s uses old (6 digipeater) socket structure.\n",
+ current->comm);
+ }
if (addr_len > sizeof(struct sockaddr_ax25) && usax->sax25_ndigis != 0) {
int ct = 0;
diff --git a/trunk/net/ax25/ax25_in.c b/trunk/net/ax25/ax25_in.c
index d1be080dcb25..3b7d1720c2ee 100644
--- a/trunk/net/ax25/ax25_in.c
+++ b/trunk/net/ax25/ax25_in.c
@@ -124,7 +124,7 @@ int ax25_rx_iframe(ax25_cb *ax25, struct sk_buff *skb)
}
skb_pull(skb, 1); /* Remove PID */
- skb->mac_header = skb->network_header;
+ skb_reset_mac_header(skb);
skb_reset_network_header(skb);
skb->dev = ax25->ax25_dev->dev;
skb->pkt_type = PACKET_HOST;
diff --git a/trunk/net/bluetooth/hci_conn.c b/trunk/net/bluetooth/hci_conn.c
index 34d1a3c822bf..9483320f6dad 100644
--- a/trunk/net/bluetooth/hci_conn.c
+++ b/trunk/net/bluetooth/hci_conn.c
@@ -259,14 +259,22 @@ int hci_conn_del(struct hci_conn *conn)
}
tasklet_disable(&hdev->tx_task);
+
+ hci_conn_del_sysfs(conn);
+
hci_conn_hash_del(hdev, conn);
if (hdev->notify)
hdev->notify(hdev, HCI_NOTIFY_CONN_DEL);
+
tasklet_enable(&hdev->tx_task);
+
skb_queue_purge(&conn->data_q);
- hci_conn_del_sysfs(conn);
+
hci_dev_put(hdev);
+ /* will free via device release */
+ put_device(&conn->dev);
+
return 0;
}
diff --git a/trunk/net/bluetooth/hci_sysfs.c b/trunk/net/bluetooth/hci_sysfs.c
index cad510309dcf..cef1e3e1881c 100644
--- a/trunk/net/bluetooth/hci_sysfs.c
+++ b/trunk/net/bluetooth/hci_sysfs.c
@@ -320,7 +320,6 @@ static void del_conn(struct work_struct *work)
{
struct hci_conn *conn = container_of(work, struct hci_conn, work);
device_del(&conn->dev);
- put_device(&conn->dev);
}
void hci_conn_del_sysfs(struct hci_conn *conn)
diff --git a/trunk/net/bluetooth/rfcomm/tty.c b/trunk/net/bluetooth/rfcomm/tty.c
index a6a758dd1f7d..e447651a2dbe 100644
--- a/trunk/net/bluetooth/rfcomm/tty.c
+++ b/trunk/net/bluetooth/rfcomm/tty.c
@@ -95,10 +95,9 @@ static void rfcomm_dev_destruct(struct rfcomm_dev *dev)
BT_DBG("dev %p dlc %p", dev, dlc);
- /* Refcount should only hit zero when called from rfcomm_dev_del()
- which will have taken us off the list. Everything else are
- refcounting bugs. */
- BUG_ON(!list_empty(&dev->list));
+ write_lock_bh(&rfcomm_dev_lock);
+ list_del_init(&dev->list);
+ write_unlock_bh(&rfcomm_dev_lock);
rfcomm_dlc_lock(dlc);
/* Detach DLC if it's owned by this dev */
@@ -110,6 +109,11 @@ static void rfcomm_dev_destruct(struct rfcomm_dev *dev)
tty_unregister_device(rfcomm_tty_driver, dev->id);
+ /* Refcount should only hit zero when called from rfcomm_dev_del()
+ which will have taken us off the list. Everything else are
+ refcounting bugs. */
+ BUG_ON(!list_empty(&dev->list));
+
kfree(dev);
/* It's safe to call module_put() here because socket still
@@ -309,15 +313,7 @@ static void rfcomm_dev_del(struct rfcomm_dev *dev)
{
BT_DBG("dev %p", dev);
- if (test_bit(RFCOMM_TTY_RELEASED, &dev->flags))
- BUG_ON(1);
- else
- set_bit(RFCOMM_TTY_RELEASED, &dev->flags);
-
- write_lock_bh(&rfcomm_dev_lock);
- list_del_init(&dev->list);
- write_unlock_bh(&rfcomm_dev_lock);
-
+ set_bit(RFCOMM_TTY_RELEASED, &dev->flags);
rfcomm_dev_put(dev);
}
diff --git a/trunk/net/bridge/br_netfilter.c b/trunk/net/bridge/br_netfilter.c
index 9f78a69d6b8b..c1757c79dfbb 100644
--- a/trunk/net/bridge/br_netfilter.c
+++ b/trunk/net/bridge/br_netfilter.c
@@ -142,23 +142,6 @@ static inline struct nf_bridge_info *nf_bridge_alloc(struct sk_buff *skb)
return skb->nf_bridge;
}
-static inline struct nf_bridge_info *nf_bridge_unshare(struct sk_buff *skb)
-{
- struct nf_bridge_info *nf_bridge = skb->nf_bridge;
-
- if (atomic_read(&nf_bridge->use) > 1) {
- struct nf_bridge_info *tmp = nf_bridge_alloc(skb);
-
- if (tmp) {
- memcpy(tmp, nf_bridge, sizeof(struct nf_bridge_info));
- atomic_set(&tmp->use, 1);
- nf_bridge_put(nf_bridge);
- }
- nf_bridge = tmp;
- }
- return nf_bridge;
-}
-
static inline void nf_bridge_push_encap_header(struct sk_buff *skb)
{
unsigned int len = nf_bridge_encap_header_len(skb);
@@ -264,9 +247,8 @@ static void __br_dnat_complain(void)
* Let us first consider the case that ip_route_input() succeeds:
*
* If skb->dst->dev equals the logical bridge device the packet
- * came in on, we can consider this bridging. The packet is passed
- * through the neighbour output function to build a new destination
- * MAC address, which will make the packet enter br_nf_local_out()
+ * came in on, we can consider this bridging. We then call
+ * skb->dst->output() which will make the packet enter br_nf_local_out()
* not much later. In that function it is assured that the iptables
* FORWARD chain is traversed for the packet.
*
@@ -303,17 +285,12 @@ static int br_nf_pre_routing_finish_bridge(struct sk_buff *skb)
skb->nf_bridge->mask ^= BRNF_NF_BRIDGE_PREROUTING;
skb->dev = bridge_parent(skb->dev);
- if (skb->dev) {
- struct dst_entry *dst = skb->dst;
-
+ if (!skb->dev)
+ kfree_skb(skb);
+ else {
nf_bridge_pull_encap_header(skb);
-
- if (dst->hh)
- return neigh_hh_output(dst->hh, skb);
- else if (dst->neighbour)
- return dst->neighbour->output(skb);
+ skb->dst->output(skb);
}
- kfree_skb(skb);
return 0;
}
@@ -654,11 +631,6 @@ static unsigned int br_nf_forward_ip(unsigned int hook, struct sk_buff *skb,
if (!skb->nf_bridge)
return NF_ACCEPT;
- /* Need exclusive nf_bridge_info since we might have multiple
- * different physoutdevs. */
- if (!nf_bridge_unshare(skb))
- return NF_DROP;
-
parent = bridge_parent(out);
if (!parent)
return NF_DROP;
@@ -740,11 +712,6 @@ static unsigned int br_nf_local_out(unsigned int hook, struct sk_buff *skb,
if (!skb->nf_bridge)
return NF_ACCEPT;
- /* Need exclusive nf_bridge_info since we might have multiple
- * different physoutdevs. */
- if (!nf_bridge_unshare(skb))
- return NF_DROP;
-
nf_bridge = skb->nf_bridge;
if (!(nf_bridge->mask & BRNF_BRIDGED_DNAT))
return NF_ACCEPT;
diff --git a/trunk/net/compat.c b/trunk/net/compat.c
index 377e560ab5c9..d74d82155d78 100644
--- a/trunk/net/compat.c
+++ b/trunk/net/compat.c
@@ -254,8 +254,6 @@ int put_cmsg_compat(struct msghdr *kmsg, int level, int type, int len, void *dat
if (copy_to_user(CMSG_COMPAT_DATA(cm), data, cmlen - sizeof(struct compat_cmsghdr)))
return -EFAULT;
cmlen = CMSG_COMPAT_SPACE(len);
- if (kmsg->msg_controllen < cmlen)
- cmlen = kmsg->msg_controllen;
kmsg->msg_control += cmlen;
kmsg->msg_controllen -= cmlen;
return 0;
diff --git a/trunk/net/core/dev.c b/trunk/net/core/dev.c
index 0879f52115eb..26a3a3a15be0 100644
--- a/trunk/net/core/dev.c
+++ b/trunk/net/core/dev.c
@@ -2207,12 +2207,8 @@ static void net_rx_action(struct softirq_action *h)
* still "owns" the NAPI instance and therefore can
* move the instance around on the list at-will.
*/
- if (unlikely(work == weight)) {
- if (unlikely(napi_disable_pending(n)))
- __napi_complete(n);
- else
- list_move_tail(&n->poll_list, list);
- }
+ if (unlikely(work == weight))
+ list_move_tail(&n->poll_list, list);
netpoll_poll_unlock(have);
}
@@ -2823,7 +2819,7 @@ void dev_set_allmulti(struct net_device *dev, int inc)
/*
* Upload unicast and multicast address lists to device and
* configure RX filtering. When the device doesn't support unicast
- * filtering it is put in promiscuous mode while unicast addresses
+ * filtering it is put in promiscous mode while unicast addresses
* are present.
*/
void __dev_set_rx_mode(struct net_device *dev)
diff --git a/trunk/net/core/rtnetlink.c b/trunk/net/core/rtnetlink.c
index fed95a323b28..e1ba26fb4bf2 100644
--- a/trunk/net/core/rtnetlink.c
+++ b/trunk/net/core/rtnetlink.c
@@ -308,12 +308,9 @@ void __rtnl_link_unregister(struct rtnl_link_ops *ops)
struct net *net;
for_each_net(net) {
-restart:
for_each_netdev_safe(net, dev, n) {
- if (dev->rtnl_link_ops == ops) {
+ if (dev->rtnl_link_ops == ops)
ops->dellink(dev);
- goto restart;
- }
}
}
list_del(&ops->list);
diff --git a/trunk/net/core/scm.c b/trunk/net/core/scm.c
index 10f5c65f6a47..100ba6d9d478 100644
--- a/trunk/net/core/scm.c
+++ b/trunk/net/core/scm.c
@@ -196,8 +196,6 @@ int put_cmsg(struct msghdr * msg, int level, int type, int len, void *data)
if (copy_to_user(CMSG_DATA(cm), data, cmlen - sizeof(struct cmsghdr)))
goto out;
cmlen = CMSG_SPACE(len);
- if (msg->msg_controllen < cmlen)
- cmlen = msg->msg_controllen;
msg->msg_control += cmlen;
msg->msg_controllen -= cmlen;
err = 0;
diff --git a/trunk/net/core/skbuff.c b/trunk/net/core/skbuff.c
index b6283779e93d..5b4ce9b4dd20 100644
--- a/trunk/net/core/skbuff.c
+++ b/trunk/net/core/skbuff.c
@@ -416,17 +416,16 @@ static struct sk_buff *__skb_clone(struct sk_buff *n, struct sk_buff *skb)
C(len);
C(data_len);
C(mac_len);
- n->hdr_len = skb->nohdr ? skb_headroom(skb) : skb->hdr_len;
n->cloned = 1;
+ n->hdr_len = skb->nohdr ? skb_headroom(skb) : skb->hdr_len;
n->nohdr = 0;
n->destructor = NULL;
- C(iif);
- C(tail);
- C(end);
- C(head);
- C(data);
C(truesize);
atomic_set(&n->users, 1);
+ C(head);
+ C(data);
+ C(tail);
+ C(end);
atomic_inc(&(skb_shinfo(skb)->dataref));
skb->cloned = 1;
diff --git a/trunk/net/dccp/ackvec.h b/trunk/net/dccp/ackvec.h
index 9671ecd17e00..9ef0737043ee 100644
--- a/trunk/net/dccp/ackvec.h
+++ b/trunk/net/dccp/ackvec.h
@@ -71,7 +71,7 @@ struct dccp_ackvec {
* @dccpavr_ack_ackno - sequence number being acknowledged
* @dccpavr_ack_ptr - pointer into dccpav_buf where this record starts
* @dccpavr_ack_nonce - dccpav_ack_nonce at the time this record was sent
- * @dccpavr_sent_len - length of the record in dccpav_buf
+ * @dccpavr_sent_len - lenght of the record in dccpav_buf
*/
struct dccp_ackvec_record {
struct list_head dccpavr_node;
diff --git a/trunk/net/dccp/ccids/ccid3.c b/trunk/net/dccp/ccids/ccid3.c
index d133416d3970..19b33586333d 100644
--- a/trunk/net/dccp/ccids/ccid3.c
+++ b/trunk/net/dccp/ccids/ccid3.c
@@ -239,7 +239,7 @@ static void ccid3_hc_tx_no_feedback_timer(unsigned long data)
ccid3_tx_state_name(hctx->ccid3hctx_state),
(unsigned)(hctx->ccid3hctx_x >> 6));
/* The value of R is still undefined and so we can not recompute
- * the timeout value. Keep initial value as per [RFC 4342, 5]. */
+ * the timout value. Keep initial value as per [RFC 4342, 5]. */
t_nfb = TFRC_INITIAL_TIMEOUT;
ccid3_update_send_interval(hctx);
break;
diff --git a/trunk/net/decnet/dn_route.c b/trunk/net/decnet/dn_route.c
index 0e10ff21e292..66663e5d7acd 100644
--- a/trunk/net/decnet/dn_route.c
+++ b/trunk/net/decnet/dn_route.c
@@ -1665,12 +1665,12 @@ static struct dn_route *dn_rt_cache_get_first(struct seq_file *seq)
break;
rcu_read_unlock_bh();
}
- return rcu_dereference(rt);
+ return rt;
}
static struct dn_route *dn_rt_cache_get_next(struct seq_file *seq, struct dn_route *rt)
{
- struct dn_rt_cache_iter_state *s = seq->private;
+ struct dn_rt_cache_iter_state *s = rcu_dereference(seq->private);
rt = rt->u.dst.dn_next;
while(!rt) {
@@ -1680,7 +1680,7 @@ static struct dn_route *dn_rt_cache_get_next(struct seq_file *seq, struct dn_rou
rcu_read_lock_bh();
rt = dn_rt_hash_table[s->bucket].chain;
}
- return rcu_dereference(rt);
+ return rt;
}
static void *dn_rt_cache_seq_start(struct seq_file *seq, loff_t *pos)
diff --git a/trunk/net/ipv4/arp.c b/trunk/net/ipv4/arp.c
index 08174a2aa878..b3f366a33a5c 100644
--- a/trunk/net/ipv4/arp.c
+++ b/trunk/net/ipv4/arp.c
@@ -706,7 +706,7 @@ static int arp_process(struct sk_buff *skb)
struct arphdr *arp;
unsigned char *arp_ptr;
struct rtable *rt;
- unsigned char *sha;
+ unsigned char *sha, *tha;
__be32 sip, tip;
u16 dev_type = dev->type;
int addr_type;
@@ -771,6 +771,7 @@ static int arp_process(struct sk_buff *skb)
arp_ptr += dev->addr_len;
memcpy(&sip, arp_ptr, 4);
arp_ptr += 4;
+ tha = arp_ptr;
arp_ptr += dev->addr_len;
memcpy(&tip, arp_ptr, 4);
/*
diff --git a/trunk/net/ipv4/devinet.c b/trunk/net/ipv4/devinet.c
index b42f74617bac..3168c3de4919 100644
--- a/trunk/net/ipv4/devinet.c
+++ b/trunk/net/ipv4/devinet.c
@@ -1027,7 +1027,7 @@ static void inetdev_changename(struct net_device *dev, struct in_device *in_dev)
memcpy(ifa->ifa_label, dev->name, IFNAMSIZ);
if (named++ == 0)
continue;
- dot = strchr(old, ':');
+ dot = strchr(ifa->ifa_label, ':');
if (dot == NULL) {
sprintf(old, ":%d", named);
dot = old;
diff --git a/trunk/net/ipv4/fib_frontend.c b/trunk/net/ipv4/fib_frontend.c
index 97abf934d185..732d8f088b13 100644
--- a/trunk/net/ipv4/fib_frontend.c
+++ b/trunk/net/ipv4/fib_frontend.c
@@ -804,13 +804,10 @@ static void nl_fib_input(struct sk_buff *skb)
nlh = nlmsg_hdr(skb);
if (skb->len < NLMSG_SPACE(0) || skb->len < nlh->nlmsg_len ||
- nlh->nlmsg_len < NLMSG_LENGTH(sizeof(*frn)))
+ nlh->nlmsg_len < NLMSG_LENGTH(sizeof(*frn))) {
+ kfree_skb(skb);
return;
-
- skb = skb_clone(skb, GFP_KERNEL);
- if (skb == NULL)
- return;
- nlh = nlmsg_hdr(skb);
+ }
frn = (struct fib_result_nl *) NLMSG_DATA(nlh);
tb = fib_get_table(frn->tb_id_in);
diff --git a/trunk/net/ipv4/fib_hash.c b/trunk/net/ipv4/fib_hash.c
index 0dfee27cfbcd..527a6e0af5b6 100644
--- a/trunk/net/ipv4/fib_hash.c
+++ b/trunk/net/ipv4/fib_hash.c
@@ -444,9 +444,6 @@ static int fn_hash_insert(struct fib_table *tb, struct fib_config *cfg)
struct fib_info *fi_drop;
u8 state;
- if (fi->fib_treeref > 1)
- goto out;
-
write_lock_bh(&fib_hash_lock);
fi_drop = fa->fa_info;
fa->fa_info = fi;
@@ -721,18 +718,19 @@ fn_hash_dump_zone(struct sk_buff *skb, struct netlink_callback *cb,
{
int h, s_h;
- if (fz->fz_hash == NULL)
- return skb->len;
s_h = cb->args[3];
- for (h = s_h; h < fz->fz_divisor; h++) {
- if (hlist_empty(&fz->fz_hash[h]))
+ for (h=0; h < fz->fz_divisor; h++) {
+ if (h < s_h) continue;
+ if (h > s_h)
+ memset(&cb->args[4], 0,
+ sizeof(cb->args) - 4*sizeof(cb->args[0]));
+ if (fz->fz_hash == NULL ||
+ hlist_empty(&fz->fz_hash[h]))
continue;
- if (fn_hash_dump_bucket(skb, cb, tb, fz, &fz->fz_hash[h]) < 0) {
+ if (fn_hash_dump_bucket(skb, cb, tb, fz, &fz->fz_hash[h])<0) {
cb->args[3] = h;
return -1;
}
- memset(&cb->args[4], 0,
- sizeof(cb->args) - 4*sizeof(cb->args[0]));
}
cb->args[3] = h;
return skb->len;
@@ -748,13 +746,14 @@ static int fn_hash_dump(struct fib_table *tb, struct sk_buff *skb, struct netlin
read_lock(&fib_hash_lock);
for (fz = table->fn_zone_list, m=0; fz; fz = fz->fz_next, m++) {
if (m < s_m) continue;
+ if (m > s_m)
+ memset(&cb->args[3], 0,
+ sizeof(cb->args) - 3*sizeof(cb->args[0]));
if (fn_hash_dump_zone(skb, cb, tb, fz) < 0) {
cb->args[2] = m;
read_unlock(&fib_hash_lock);
return -1;
}
- memset(&cb->args[3], 0,
- sizeof(cb->args) - 3*sizeof(cb->args[0]));
}
read_unlock(&fib_hash_lock);
cb->args[2] = m;
diff --git a/trunk/net/ipv4/fib_trie.c b/trunk/net/ipv4/fib_trie.c
index 1010b469d7d3..8d8c2915e064 100644
--- a/trunk/net/ipv4/fib_trie.c
+++ b/trunk/net/ipv4/fib_trie.c
@@ -1214,9 +1214,6 @@ static int fn_trie_insert(struct fib_table *tb, struct fib_config *cfg)
struct fib_info *fi_drop;
u8 state;
- if (fi->fib_treeref > 1)
- goto out;
-
err = -ENOBUFS;
new_fa = kmem_cache_alloc(fn_alias_kmem, GFP_KERNEL);
if (new_fa == NULL)
diff --git a/trunk/net/ipv4/icmp.c b/trunk/net/ipv4/icmp.c
index 82baea026484..233de0634298 100644
--- a/trunk/net/ipv4/icmp.c
+++ b/trunk/net/ipv4/icmp.c
@@ -540,6 +540,7 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info)
icmp_param.data.icmph.checksum = 0;
icmp_param.skb = skb_in;
icmp_param.offset = skb_network_offset(skb_in);
+ icmp_out_count(icmp_param.data.icmph.type);
inet_sk(icmp_socket->sk)->tos = tos;
ipc.addr = iph->saddr;
ipc.opt = &icmp_param.replyopts;
diff --git a/trunk/net/ipv4/inet_lro.c b/trunk/net/ipv4/inet_lro.c
index 4a4d49fca1f2..9a96c277393d 100644
--- a/trunk/net/ipv4/inet_lro.c
+++ b/trunk/net/ipv4/inet_lro.c
@@ -310,7 +310,7 @@ static void lro_flush(struct net_lro_mgr *lro_mgr,
skb_shinfo(lro_desc->parent)->gso_size = lro_desc->mss;
if (lro_desc->vgrp) {
- if (lro_mgr->features & LRO_F_NAPI)
+ if (test_bit(LRO_F_NAPI, &lro_mgr->features))
vlan_hwaccel_receive_skb(lro_desc->parent,
lro_desc->vgrp,
lro_desc->vlan_tag);
@@ -320,7 +320,7 @@ static void lro_flush(struct net_lro_mgr *lro_mgr,
lro_desc->vlan_tag);
} else {
- if (lro_mgr->features & LRO_F_NAPI)
+ if (test_bit(LRO_F_NAPI, &lro_mgr->features))
netif_receive_skb(lro_desc->parent);
else
netif_rx(lro_desc->parent);
@@ -352,7 +352,7 @@ static int __lro_proc_skb(struct net_lro_mgr *lro_mgr, struct sk_buff *skb,
goto out;
if ((skb->protocol == htons(ETH_P_8021Q))
- && !(lro_mgr->features & LRO_F_EXTRACT_VLAN_ID))
+ && !test_bit(LRO_F_EXTRACT_VLAN_ID, &lro_mgr->features))
vlan_hdr_len = VLAN_HLEN;
if (!lro_desc->active) { /* start new lro session */
@@ -474,7 +474,7 @@ static struct sk_buff *__lro_proc_segment(struct net_lro_mgr *lro_mgr,
goto out;
if ((skb->protocol == htons(ETH_P_8021Q))
- && !(lro_mgr->features & LRO_F_EXTRACT_VLAN_ID))
+ && !test_bit(LRO_F_EXTRACT_VLAN_ID, &lro_mgr->features))
vlan_hdr_len = VLAN_HLEN;
iph = (void *)(skb->data + vlan_hdr_len);
@@ -516,7 +516,7 @@ void lro_receive_skb(struct net_lro_mgr *lro_mgr,
void *priv)
{
if (__lro_proc_skb(lro_mgr, skb, NULL, 0, priv)) {
- if (lro_mgr->features & LRO_F_NAPI)
+ if (test_bit(LRO_F_NAPI, &lro_mgr->features))
netif_receive_skb(skb);
else
netif_rx(skb);
@@ -531,7 +531,7 @@ void lro_vlan_hwaccel_receive_skb(struct net_lro_mgr *lro_mgr,
void *priv)
{
if (__lro_proc_skb(lro_mgr, skb, vgrp, vlan_tag, priv)) {
- if (lro_mgr->features & LRO_F_NAPI)
+ if (test_bit(LRO_F_NAPI, &lro_mgr->features))
vlan_hwaccel_receive_skb(skb, vgrp, vlan_tag);
else
vlan_hwaccel_rx(skb, vgrp, vlan_tag);
@@ -550,7 +550,7 @@ void lro_receive_frags(struct net_lro_mgr *lro_mgr,
if (!skb)
return;
- if (lro_mgr->features & LRO_F_NAPI)
+ if (test_bit(LRO_F_NAPI, &lro_mgr->features))
netif_receive_skb(skb);
else
netif_rx(skb);
@@ -570,7 +570,7 @@ void lro_vlan_hwaccel_receive_frags(struct net_lro_mgr *lro_mgr,
if (!skb)
return;
- if (lro_mgr->features & LRO_F_NAPI)
+ if (test_bit(LRO_F_NAPI, &lro_mgr->features))
vlan_hwaccel_receive_skb(skb, vgrp, vlan_tag);
else
vlan_hwaccel_rx(skb, vgrp, vlan_tag);
diff --git a/trunk/net/ipv4/ip_gre.c b/trunk/net/ipv4/ip_gre.c
index 4b93f32de10d..02b02a8d681c 100644
--- a/trunk/net/ipv4/ip_gre.c
+++ b/trunk/net/ipv4/ip_gre.c
@@ -613,7 +613,7 @@ static int ipgre_rcv(struct sk_buff *skb)
offset += 4;
}
- skb->mac_header = skb->network_header;
+ skb_reset_mac_header(skb);
__pskb_pull(skb, offset);
skb_reset_network_header(skb);
skb_postpull_rcsum(skb, skb_transport_header(skb), offset);
diff --git a/trunk/net/ipv4/ipconfig.c b/trunk/net/ipv4/ipconfig.c
index b8f7763b2261..96400b0bd08a 100644
--- a/trunk/net/ipv4/ipconfig.c
+++ b/trunk/net/ipv4/ipconfig.c
@@ -1403,9 +1403,6 @@ static int __init ic_proto_name(char *name)
if (!strcmp(name, "on") || !strcmp(name, "any")) {
return 1;
}
- if (!strcmp(name, "off") || !strcmp(name, "none")) {
- return 0;
- }
#ifdef CONFIG_IP_PNP_DHCP
else if (!strcmp(name, "dhcp")) {
ic_proto_enabled &= ~IC_RARP;
@@ -1439,24 +1436,17 @@ static int __init ip_auto_config_setup(char *addrs)
int num = 0;
ic_set_manually = 1;
- ic_enable = 1;
- /*
- * If any dhcp, bootp etc options are set, leave autoconfig on
- * and skip the below static IP processing.
- */
- if (ic_proto_name(addrs))
+ ic_enable = (*addrs &&
+ (strcmp(addrs, "off") != 0) &&
+ (strcmp(addrs, "none") != 0));
+ if (!ic_enable)
return 1;
- /* If no static IP is given, turn off autoconfig and bail. */
- if (*addrs == 0 ||
- strcmp(addrs, "off") == 0 ||
- strcmp(addrs, "none") == 0) {
- ic_enable = 0;
+ if (ic_proto_name(addrs))
return 1;
- }
- /* Parse string for static IP assignment. */
+ /* Parse the whole string */
ip = addrs;
while (ip && *ip) {
if ((cp = strchr(ip, ':')))
@@ -1494,10 +1484,7 @@ static int __init ip_auto_config_setup(char *addrs)
strlcpy(user_dev_name, ip, sizeof(user_dev_name));
break;
case 6:
- if (ic_proto_name(ip) == 0 &&
- ic_myaddr == NONE) {
- ic_enable = 0;
- }
+ ic_proto_name(ip);
break;
}
}
diff --git a/trunk/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c b/trunk/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
index 910dae732a0f..831e9b29806d 100644
--- a/trunk/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
+++ b/trunk/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
@@ -419,9 +419,6 @@ struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv4 __read_mostly = {
.me = THIS_MODULE,
};
-module_param_call(hashsize, nf_conntrack_set_hashsize, param_get_uint,
- &nf_conntrack_htable_size, 0600);
-
MODULE_ALIAS("nf_conntrack-" __stringify(AF_INET));
MODULE_ALIAS("ip_conntrack");
MODULE_LICENSE("GPL");
diff --git a/trunk/net/ipv4/netfilter/nf_nat_sip.c b/trunk/net/ipv4/netfilter/nf_nat_sip.c
index 8996ccb757db..3ca98971a1e9 100644
--- a/trunk/net/ipv4/netfilter/nf_nat_sip.c
+++ b/trunk/net/ipv4/netfilter/nf_nat_sip.c
@@ -165,7 +165,7 @@ static int mangle_content_len(struct sk_buff *skb,
dataoff = ip_hdrlen(skb) + sizeof(struct udphdr);
- /* Get actual SDP length */
+ /* Get actual SDP lenght */
if (ct_sip_get_info(ct, dptr, skb->len - dataoff, &matchoff,
&matchlen, POS_SDP_HEADER) > 0) {
diff --git a/trunk/net/ipv4/raw.c b/trunk/net/ipv4/raw.c
index e7050f8eabeb..66b42f547bf9 100644
--- a/trunk/net/ipv4/raw.c
+++ b/trunk/net/ipv4/raw.c
@@ -271,7 +271,6 @@ static int raw_send_hdrinc(struct sock *sk, void *from, size_t length,
int hh_len;
struct iphdr *iph;
struct sk_buff *skb;
- unsigned int iphlen;
int err;
if (length > rt->u.dst.dev->mtu) {
@@ -305,8 +304,7 @@ static int raw_send_hdrinc(struct sock *sk, void *from, size_t length,
goto error_fault;
/* We don't modify invalid header */
- iphlen = iph->ihl * 4;
- if (iphlen >= sizeof(*iph) && iphlen <= length) {
+ if (length >= sizeof(*iph) && iph->ihl * 4U <= length) {
if (!iph->saddr)
iph->saddr = rt->rt_src;
iph->check = 0;
diff --git a/trunk/net/ipv4/route.c b/trunk/net/ipv4/route.c
index 28484f396b04..d2bc6148a737 100644
--- a/trunk/net/ipv4/route.c
+++ b/trunk/net/ipv4/route.c
@@ -283,12 +283,12 @@ static struct rtable *rt_cache_get_first(struct seq_file *seq)
break;
rcu_read_unlock_bh();
}
- return rcu_dereference(r);
+ return r;
}
static struct rtable *rt_cache_get_next(struct seq_file *seq, struct rtable *r)
{
- struct rt_cache_iter_state *st = seq->private;
+ struct rt_cache_iter_state *st = rcu_dereference(seq->private);
r = r->u.dst.rt_next;
while (!r) {
@@ -298,7 +298,7 @@ static struct rtable *rt_cache_get_next(struct seq_file *seq, struct rtable *r)
rcu_read_lock_bh();
r = rt_hash_table[st->bucket].chain;
}
- return rcu_dereference(r);
+ return r;
}
static struct rtable *rt_cache_get_idx(struct seq_file *seq, loff_t pos)
@@ -2626,10 +2626,11 @@ int ip_rt_dump(struct sk_buff *skb, struct netlink_callback *cb)
int idx, s_idx;
s_h = cb->args[0];
- if (s_h < 0)
- s_h = 0;
s_idx = idx = cb->args[1];
- for (h = s_h; h <= rt_hash_mask; h++) {
+ for (h = 0; h <= rt_hash_mask; h++) {
+ if (h < s_h) continue;
+ if (h > s_h)
+ s_idx = 0;
rcu_read_lock_bh();
for (rt = rcu_dereference(rt_hash_table[h].chain), idx = 0; rt;
rt = rcu_dereference(rt->u.dst.rt_next), idx++) {
@@ -2646,7 +2647,6 @@ int ip_rt_dump(struct sk_buff *skb, struct netlink_callback *cb)
dst_release(xchg(&skb->dst, NULL));
}
rcu_read_unlock_bh();
- s_idx = 0;
}
done:
diff --git a/trunk/net/ipv4/tcp_input.c b/trunk/net/ipv4/tcp_input.c
index b39f0d86e44c..889c89362bfc 100644
--- a/trunk/net/ipv4/tcp_input.c
+++ b/trunk/net/ipv4/tcp_input.c
@@ -2651,7 +2651,6 @@ static int tcp_clean_rtx_queue(struct sock *sk, s32 *seq_rtt_p,
u32 cnt = 0;
u32 reord = tp->packets_out;
s32 seq_rtt = -1;
- s32 ca_seq_rtt = -1;
ktime_t last_ackt = net_invalid_timestamp();
while ((skb = tcp_write_queue_head(sk)) && skb != tcp_send_head(sk)) {
@@ -2660,7 +2659,6 @@ static int tcp_clean_rtx_queue(struct sock *sk, s32 *seq_rtt_p,
u32 packets_acked;
u8 sacked = scb->sacked;
- /* Determine how many packets and what bytes were acked, tso and else */
if (after(scb->end_seq, tp->snd_una)) {
if (tcp_skb_pcount(skb) == 1 ||
!after(tp->snd_una, scb->seq))
@@ -2688,16 +2686,15 @@ static int tcp_clean_rtx_queue(struct sock *sk, s32 *seq_rtt_p,
if (sacked & TCPCB_SACKED_RETRANS)
tp->retrans_out -= packets_acked;
flag |= FLAG_RETRANS_DATA_ACKED;
- ca_seq_rtt = -1;
seq_rtt = -1;
if ((flag & FLAG_DATA_ACKED) ||
(packets_acked > 1))
flag |= FLAG_NONHEAD_RETRANS_ACKED;
} else {
- ca_seq_rtt = now - scb->when;
- last_ackt = skb->tstamp;
if (seq_rtt < 0) {
- seq_rtt = ca_seq_rtt;
+ seq_rtt = now - scb->when;
+ if (fully_acked)
+ last_ackt = skb->tstamp;
}
if (!(sacked & TCPCB_SACKED_ACKED))
reord = min(cnt, reord);
@@ -2712,10 +2709,10 @@ static int tcp_clean_rtx_queue(struct sock *sk, s32 *seq_rtt_p,
!before(end_seq, tp->snd_up))
tp->urg_mode = 0;
} else {
- ca_seq_rtt = now - scb->when;
- last_ackt = skb->tstamp;
if (seq_rtt < 0) {
- seq_rtt = ca_seq_rtt;
+ seq_rtt = now - scb->when;
+ if (fully_acked)
+ last_ackt = skb->tstamp;
}
reord = min(cnt, reord);
}
@@ -2775,8 +2772,8 @@ static int tcp_clean_rtx_queue(struct sock *sk, s32 *seq_rtt_p,
net_invalid_timestamp()))
rtt_us = ktime_us_delta(ktime_get_real(),
last_ackt);
- else if (ca_seq_rtt > 0)
- rtt_us = jiffies_to_usecs(ca_seq_rtt);
+ else if (seq_rtt > 0)
+ rtt_us = jiffies_to_usecs(seq_rtt);
}
ca_ops->pkts_acked(sk, pkts_acked, rtt_us);
diff --git a/trunk/net/ipv6/datagram.c b/trunk/net/ipv6/datagram.c
index 5d4245ab4183..2ed689ac449e 100644
--- a/trunk/net/ipv6/datagram.c
+++ b/trunk/net/ipv6/datagram.c
@@ -123,11 +123,11 @@ int ip6_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
goto out;
}
sk->sk_bound_dev_if = usin->sin6_scope_id;
+ if (!sk->sk_bound_dev_if &&
+ (addr_type & IPV6_ADDR_MULTICAST))
+ fl.oif = np->mcast_oif;
}
- if (!sk->sk_bound_dev_if && (addr_type & IPV6_ADDR_MULTICAST))
- sk->sk_bound_dev_if = np->mcast_oif;
-
/* Connect to link-local address requires an interface */
if (!sk->sk_bound_dev_if) {
err = -EINVAL;
diff --git a/trunk/net/ipv6/icmp.c b/trunk/net/ipv6/icmp.c
index f1240688dc58..9bb031fa1c2f 100644
--- a/trunk/net/ipv6/icmp.c
+++ b/trunk/net/ipv6/icmp.c
@@ -458,6 +458,8 @@ void icmpv6_send(struct sk_buff *skb, int type, int code, __u32 info,
}
err = icmpv6_push_pending_frames(sk, &fl, &tmp_hdr, len + sizeof(struct icmp6hdr));
+ ICMP6_INC_STATS_BH(idev, ICMP6_MIB_OUTMSGS);
+
out_put:
if (likely(idev != NULL))
in6_dev_put(idev);
diff --git a/trunk/net/ipv6/inet6_hashtables.c b/trunk/net/ipv6/inet6_hashtables.c
index 0765d8bd380f..adc73adadfae 100644
--- a/trunk/net/ipv6/inet6_hashtables.c
+++ b/trunk/net/ipv6/inet6_hashtables.c
@@ -193,7 +193,7 @@ static int __inet6_check_established(struct inet_timewait_death_row *death_row,
sk2->sk_family == PF_INET6 &&
ipv6_addr_equal(&tw6->tw_v6_daddr, saddr) &&
ipv6_addr_equal(&tw6->tw_v6_rcv_saddr, daddr) &&
- (!sk2->sk_bound_dev_if || sk2->sk_bound_dev_if == dif)) {
+ sk2->sk_bound_dev_if == sk->sk_bound_dev_if) {
if (twsk_unique(sk, sk2, twp))
goto unique;
else
diff --git a/trunk/net/ipv6/ndisc.c b/trunk/net/ipv6/ndisc.c
index 777ed733b2d7..67997a74ddce 100644
--- a/trunk/net/ipv6/ndisc.c
+++ b/trunk/net/ipv6/ndisc.c
@@ -612,7 +612,7 @@ void ndisc_send_rs(struct net_device *dev, struct in6_addr *saddr,
* optimistic addresses, but we may send the solicitation
* if we don't include the sllao. So here we check
* if our address is optimistic, and if so, we
- * suppress the inclusion of the sllao.
+ * supress the inclusion of the sllao.
*/
if (send_sllao) {
struct inet6_ifaddr *ifp = ipv6_get_ifaddr(saddr, dev, 1);
diff --git a/trunk/net/ipv6/netfilter/ip6t_eui64.c b/trunk/net/ipv6/netfilter/ip6t_eui64.c
index 41df9a578c7a..34ba150bfe5d 100644
--- a/trunk/net/ipv6/netfilter/ip6t_eui64.c
+++ b/trunk/net/ipv6/netfilter/ip6t_eui64.c
@@ -47,7 +47,7 @@ match(const struct sk_buff *skb,
memcpy(eui64 + 5, eth_hdr(skb)->h_source + 3, 3);
eui64[3] = 0xff;
eui64[4] = 0xfe;
- eui64[0] ^= 0x02;
+ eui64[0] |= 0x02;
i = 0;
while (ipv6_hdr(skb)->saddr.s6_addr[8 + i] == eui64[i]
diff --git a/trunk/net/ipv6/proc.c b/trunk/net/ipv6/proc.c
index 44937616057e..8631ed7fe8a9 100644
--- a/trunk/net/ipv6/proc.c
+++ b/trunk/net/ipv6/proc.c
@@ -88,7 +88,7 @@ static char *icmp6type2name[256] = {
[ICMPV6_PKT_TOOBIG] = "PktTooBigs",
[ICMPV6_TIME_EXCEED] = "TimeExcds",
[ICMPV6_PARAMPROB] = "ParmProblems",
- [ICMPV6_ECHO_REQUEST] = "Echos",
+ [ICMPV6_ECHO_REQUEST] = "EchoRequest",
[ICMPV6_ECHO_REPLY] = "EchoReplies",
[ICMPV6_MGM_QUERY] = "GroupMembQueries",
[ICMPV6_MGM_REPORT] = "GroupMembResponses",
@@ -98,7 +98,7 @@ static char *icmp6type2name[256] = {
[NDISC_ROUTER_SOLICITATION] = "RouterSolicits",
[NDISC_NEIGHBOUR_ADVERTISEMENT] = "NeighborAdvertisements",
[NDISC_NEIGHBOUR_SOLICITATION] = "NeighborSolicits",
- [NDISC_REDIRECT] = "Redirects",
+ [NDISC_REDIRECT] = "NeighborRedirects",
};
diff --git a/trunk/net/ipv6/route.c b/trunk/net/ipv6/route.c
index 20083e0d3995..6ecb5e6fae2e 100644
--- a/trunk/net/ipv6/route.c
+++ b/trunk/net/ipv6/route.c
@@ -329,7 +329,7 @@ static inline int rt6_check_dev(struct rt6_info *rt, int oif)
static inline int rt6_check_neigh(struct rt6_info *rt)
{
struct neighbour *neigh = rt->rt6i_nexthop;
- int m;
+ int m = 0;
if (rt->rt6i_flags & RTF_NONEXTHOP ||
!(rt->rt6i_flags & RTF_GATEWAY))
m = 1;
@@ -337,15 +337,10 @@ static inline int rt6_check_neigh(struct rt6_info *rt)
read_lock_bh(&neigh->lock);
if (neigh->nud_state & NUD_VALID)
m = 2;
-#ifdef CONFIG_IPV6_ROUTER_PREF
- else if (neigh->nud_state & NUD_FAILED)
- m = 0;
-#endif
- else
+ else if (!(neigh->nud_state & NUD_FAILED))
m = 1;
read_unlock_bh(&neigh->lock);
- } else
- m = 0;
+ }
return m;
}
diff --git a/trunk/net/irda/af_irda.c b/trunk/net/irda/af_irda.c
index 07dfa7fdd2a0..48ce59a6e026 100644
--- a/trunk/net/irda/af_irda.c
+++ b/trunk/net/irda/af_irda.c
@@ -802,18 +802,12 @@ static int irda_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
}
#endif /* CONFIG_IRDA_ULTRA */
- self->ias_obj = irias_new_object(addr->sir_name, jiffies);
- if (self->ias_obj == NULL)
- return -ENOMEM;
-
err = irda_open_tsap(self, addr->sir_lsap_sel, addr->sir_name);
- if (err < 0) {
- kfree(self->ias_obj->name);
- kfree(self->ias_obj);
+ if (err < 0)
return err;
- }
/* Register with LM-IAS */
+ self->ias_obj = irias_new_object(addr->sir_name, jiffies);
irias_add_integer_attrib(self->ias_obj, "IrDA:TinyTP:LsapSel",
self->stsap_sel, IAS_KERNEL_ATTR);
irias_insert_object(self->ias_obj);
@@ -1124,6 +1118,8 @@ static int irda_create(struct net *net, struct socket *sock, int protocol)
self->max_sdu_size_rx = TTP_SAR_UNBOUND;
break;
default:
+ IRDA_ERROR("%s: protocol not supported!\n",
+ __FUNCTION__);
return -ESOCKTNOSUPPORT;
}
break;
@@ -1831,7 +1827,7 @@ static int irda_setsockopt(struct socket *sock, int level, int optname,
struct irda_ias_set *ias_opt;
struct ias_object *ias_obj;
struct ias_attrib * ias_attr; /* Attribute in IAS object */
- int opt, free_ias = 0;
+ int opt;
IRDA_DEBUG(2, "%s(%p)\n", __FUNCTION__, self);
@@ -1887,20 +1883,11 @@ static int irda_setsockopt(struct socket *sock, int level, int optname,
/* Create a new object */
ias_obj = irias_new_object(ias_opt->irda_class_name,
jiffies);
- if (ias_obj == NULL) {
- kfree(ias_opt);
- return -ENOMEM;
- }
- free_ias = 1;
}
/* Do we have the attribute already ? */
if(irias_find_attrib(ias_obj, ias_opt->irda_attrib_name)) {
kfree(ias_opt);
- if (free_ias) {
- kfree(ias_obj->name);
- kfree(ias_obj);
- }
return -EINVAL;
}
@@ -1919,11 +1906,6 @@ static int irda_setsockopt(struct socket *sock, int level, int optname,
if(ias_opt->attribute.irda_attrib_octet_seq.len >
IAS_MAX_OCTET_STRING) {
kfree(ias_opt);
- if (free_ias) {
- kfree(ias_obj->name);
- kfree(ias_obj);
- }
-
return -EINVAL;
}
/* Add an octet sequence attribute */
@@ -1952,10 +1934,6 @@ static int irda_setsockopt(struct socket *sock, int level, int optname,
break;
default :
kfree(ias_opt);
- if (free_ias) {
- kfree(ias_obj->name);
- kfree(ias_obj);
- }
return -EINVAL;
}
irias_insert_object(ias_obj);
diff --git a/trunk/net/irda/ircomm/ircomm_param.c b/trunk/net/irda/ircomm/ircomm_param.c
index 598dcbe4a501..e5e4792a0314 100644
--- a/trunk/net/irda/ircomm/ircomm_param.c
+++ b/trunk/net/irda/ircomm/ircomm_param.c
@@ -496,7 +496,7 @@ static int ircomm_param_poll(void *instance, irda_param_t *param, int get)
IRDA_ASSERT(self != NULL, return -1;);
IRDA_ASSERT(self->magic == IRCOMM_TTY_MAGIC, return -1;);
- /* Poll parameters are always of length 0 (just a signal) */
+ /* Poll parameters are always of lenght 0 (just a signal) */
if (!get) {
/* Respond with DTE line settings */
ircomm_param_request(self, IRCOMM_DTE, TRUE);
diff --git a/trunk/net/irda/irlan/irlan_eth.c b/trunk/net/irda/irlan/irlan_eth.c
index 1ab91f787cc1..c68220773d28 100644
--- a/trunk/net/irda/irlan/irlan_eth.c
+++ b/trunk/net/irda/irlan/irlan_eth.c
@@ -342,7 +342,7 @@ static void irlan_eth_set_multicast_list(struct net_device *dev)
if (dev->flags & IFF_PROMISC) {
/* Enable promiscuous mode */
- IRDA_WARNING("Promiscuous mode not implemented by IrLAN!\n");
+ IRDA_WARNING("Promiscous mode not implemented by IrLAN!\n");
}
else if ((dev->flags & IFF_ALLMULTI) || dev->mc_count > HW_MAX_ADDRS) {
/* Disable promiscuous mode, use normal mode. */
diff --git a/trunk/net/irda/irlap_frame.c b/trunk/net/irda/irlap_frame.c
index 7c132d6342af..4f3764546b2f 100644
--- a/trunk/net/irda/irlap_frame.c
+++ b/trunk/net/irda/irlap_frame.c
@@ -144,7 +144,7 @@ void irlap_send_snrm_frame(struct irlap_cb *self, struct qos_info *qos)
frame->control = SNRM_CMD | PF_BIT;
/*
- * If we are establishing a connection then insert QoS parameters
+ * If we are establishing a connection then insert QoS paramerters
*/
if (qos) {
skb_put(tx_skb, 9); /* 25 left */
diff --git a/trunk/net/irda/parameters.c b/trunk/net/irda/parameters.c
index 722bbe044d9c..7183e9ef7996 100644
--- a/trunk/net/irda/parameters.c
+++ b/trunk/net/irda/parameters.c
@@ -133,7 +133,7 @@ static int irda_insert_integer(void *self, __u8 *buf, int len, __u8 pi,
int err;
p.pi = pi; /* In case handler needs to know */
- p.pl = type & PV_MASK; /* The integer type codes the length as well */
+ p.pl = type & PV_MASK; /* The integer type codes the lenght as well */
p.pv.i = 0; /* Clear value */
/* Call handler for this parameter */
@@ -142,7 +142,7 @@ static int irda_insert_integer(void *self, __u8 *buf, int len, __u8 pi,
return err;
/*
- * If parameter length is still 0, then (1) this is an any length
+ * If parameter lenght is still 0, then (1) this is an any length
* integer, and (2) the handler function does not care which length
* we choose to use, so we pick the one the gives the fewest bytes.
*/
@@ -206,11 +206,11 @@ static int irda_extract_integer(void *self, __u8 *buf, int len, __u8 pi,
{
irda_param_t p;
int n = 0;
- int extract_len; /* Real length we extract */
+ int extract_len; /* Real lenght we extract */
int err;
p.pi = pi; /* In case handler needs to know */
- p.pl = buf[1]; /* Extract length of value */
+ p.pl = buf[1]; /* Extract lenght of value */
p.pv.i = 0; /* Clear value */
extract_len = p.pl; /* Default : extract all */
@@ -297,7 +297,7 @@ static int irda_extract_string(void *self, __u8 *buf, int len, __u8 pi,
IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
p.pi = pi; /* In case handler needs to know */
- p.pl = buf[1]; /* Extract length of value */
+ p.pl = buf[1]; /* Extract lenght of value */
IRDA_DEBUG(2, "%s(), pi=%#x, pl=%d\n", __FUNCTION__,
p.pi, p.pl);
@@ -339,7 +339,7 @@ static int irda_extract_octseq(void *self, __u8 *buf, int len, __u8 pi,
irda_param_t p;
p.pi = pi; /* In case handler needs to know */
- p.pl = buf[1]; /* Extract length of value */
+ p.pl = buf[1]; /* Extract lenght of value */
/* Check if buffer is long enough for parsing */
if (len < (2+p.pl)) {
diff --git a/trunk/net/irda/wrapper.c b/trunk/net/irda/wrapper.c
index c246983308b8..e71286768a48 100644
--- a/trunk/net/irda/wrapper.c
+++ b/trunk/net/irda/wrapper.c
@@ -238,7 +238,7 @@ async_bump(struct net_device *dev,
skb_reserve(newskb, 1);
if(docopy) {
- /* Copy data without CRC (length already checked) */
+ /* Copy data without CRC (lenght already checked) */
skb_copy_to_linear_data(newskb, rx_buff->data,
rx_buff->len - 2);
/* Deliver this skb */
diff --git a/trunk/net/key/af_key.c b/trunk/net/key/af_key.c
index 76dcd882f87b..878039b9557d 100644
--- a/trunk/net/key/af_key.c
+++ b/trunk/net/key/af_key.c
@@ -2784,22 +2784,12 @@ static struct sadb_msg *pfkey_get_base_msg(struct sk_buff *skb, int *errp)
static inline int aalg_tmpl_set(struct xfrm_tmpl *t, struct xfrm_algo_desc *d)
{
- unsigned int id = d->desc.sadb_alg_id;
-
- if (id >= sizeof(t->aalgos) * 8)
- return 0;
-
- return (t->aalgos >> id) & 1;
+ return t->aalgos & (1 << d->desc.sadb_alg_id);
}
static inline int ealg_tmpl_set(struct xfrm_tmpl *t, struct xfrm_algo_desc *d)
{
- unsigned int id = d->desc.sadb_alg_id;
-
- if (id >= sizeof(t->ealgos) * 8)
- return 0;
-
- return (t->ealgos >> id) & 1;
+ return t->ealgos & (1 << d->desc.sadb_alg_id);
}
static int count_ah_combs(struct xfrm_tmpl *t)
@@ -3593,29 +3583,27 @@ static int pfkey_send_migrate(struct xfrm_selector *sel, u8 dir, u8 type,
/* old ipsecrequest */
int mode = pfkey_mode_from_xfrm(mp->mode);
if (mode < 0)
- goto err;
+ return -EINVAL;
if (set_ipsecrequest(skb, mp->proto, mode,
(mp->reqid ? IPSEC_LEVEL_UNIQUE : IPSEC_LEVEL_REQUIRE),
mp->reqid, mp->old_family,
- &mp->old_saddr, &mp->old_daddr) < 0)
- goto err;
+ &mp->old_saddr, &mp->old_daddr) < 0) {
+ return -EINVAL;
+ }
/* new ipsecrequest */
if (set_ipsecrequest(skb, mp->proto, mode,
(mp->reqid ? IPSEC_LEVEL_UNIQUE : IPSEC_LEVEL_REQUIRE),
mp->reqid, mp->new_family,
- &mp->new_saddr, &mp->new_daddr) < 0)
- goto err;
+ &mp->new_saddr, &mp->new_daddr) < 0) {
+ return -EINVAL;
+ }
}
/* broadcast migrate message to sockets */
pfkey_broadcast(skb, GFP_ATOMIC, BROADCAST_ALL, NULL);
return 0;
-
-err:
- kfree_skb(skb);
- return -EINVAL;
}
#else
static int pfkey_send_migrate(struct xfrm_selector *sel, u8 dir, u8 type,
diff --git a/trunk/net/mac80211/ieee80211.c b/trunk/net/mac80211/ieee80211.c
index 6378850d8580..505af1f067ab 100644
--- a/trunk/net/mac80211/ieee80211.c
+++ b/trunk/net/mac80211/ieee80211.c
@@ -427,6 +427,7 @@ static const struct header_ops ieee80211_header_ops = {
void ieee80211_if_setup(struct net_device *dev)
{
ether_setup(dev);
+ dev->header_ops = &ieee80211_header_ops;
dev->hard_start_xmit = ieee80211_subif_start_xmit;
dev->wireless_handlers = &ieee80211_iw_handler_def;
dev->set_multicast_list = ieee80211_set_multicast_list;
diff --git a/trunk/net/mac80211/ieee80211_ioctl.c b/trunk/net/mac80211/ieee80211_ioctl.c
index 308bbe4a1333..7027eed4d4ae 100644
--- a/trunk/net/mac80211/ieee80211_ioctl.c
+++ b/trunk/net/mac80211/ieee80211_ioctl.c
@@ -591,7 +591,7 @@ static int ieee80211_ioctl_siwrate(struct net_device *dev,
sdata->bss->force_unicast_rateidx = -1;
if (rate->value < 0)
return 0;
- for (i=0; i < mode->num_rates; i++) {
+ for (i=0; i< mode->num_rates; i++) {
struct ieee80211_rate *rates = &mode->rates[i];
int this_rate = rates->rate;
@@ -599,10 +599,10 @@ static int ieee80211_ioctl_siwrate(struct net_device *dev,
sdata->bss->max_ratectrl_rateidx = i;
if (rate->fixed)
sdata->bss->force_unicast_rateidx = i;
- return 0;
+ break;
}
}
- return -EINVAL;
+ return 0;
}
static int ieee80211_ioctl_giwrate(struct net_device *dev,
diff --git a/trunk/net/mac80211/ieee80211_rate.c b/trunk/net/mac80211/ieee80211_rate.c
index c3f278393741..3260a4a0ecc5 100644
--- a/trunk/net/mac80211/ieee80211_rate.c
+++ b/trunk/net/mac80211/ieee80211_rate.c
@@ -60,11 +60,11 @@ void ieee80211_rate_control_unregister(struct rate_control_ops *ops)
list_for_each_entry(alg, &rate_ctrl_algs, list) {
if (alg->ops == ops) {
list_del(&alg->list);
- kfree(alg);
break;
}
}
mutex_unlock(&rate_ctrl_mutex);
+ kfree(alg);
}
EXPORT_SYMBOL(ieee80211_rate_control_unregister);
diff --git a/trunk/net/mac80211/ieee80211_sta.c b/trunk/net/mac80211/ieee80211_sta.c
index bee8080f2249..16afd24d4f6b 100644
--- a/trunk/net/mac80211/ieee80211_sta.c
+++ b/trunk/net/mac80211/ieee80211_sta.c
@@ -808,8 +808,12 @@ static void ieee80211_associated(struct net_device *dev,
sta_info_put(sta);
}
if (disassoc) {
- ifsta->state = IEEE80211_DISABLED;
- ieee80211_set_associated(dev, ifsta, 0);
+ union iwreq_data wrqu;
+ memset(wrqu.ap_addr.sa_data, 0, ETH_ALEN);
+ wrqu.ap_addr.sa_family = ARPHRD_ETHER;
+ wireless_send_event(dev, SIOCGIWAP, &wrqu, NULL);
+ mod_timer(&ifsta->timer, jiffies +
+ IEEE80211_MONITORING_INTERVAL + 30 * HZ);
} else {
mod_timer(&ifsta->timer, jiffies +
IEEE80211_MONITORING_INTERVAL);
diff --git a/trunk/net/mac80211/rx.c b/trunk/net/mac80211/rx.c
index a7263fc476bd..00f908d9275e 100644
--- a/trunk/net/mac80211/rx.c
+++ b/trunk/net/mac80211/rx.c
@@ -1443,7 +1443,6 @@ void __ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb,
struct ieee80211_sub_if_data *prev = NULL;
struct sk_buff *skb_new;
u8 *bssid;
- int hdrlen;
/*
* key references and virtual interfaces are protected using RCU
@@ -1473,18 +1472,6 @@ void __ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb,
rx.fc = le16_to_cpu(hdr->frame_control);
type = rx.fc & IEEE80211_FCTL_FTYPE;
- /*
- * Drivers are required to align the payload data to a four-byte
- * boundary, so the last two bits of the address where it starts
- * may not be set. The header is required to be directly before
- * the payload data, padding like atheros hardware adds which is
- * inbetween the 802.11 header and the payload is not supported,
- * the driver is required to move the 802.11 header further back
- * in that case.
- */
- hdrlen = ieee80211_get_hdrlen(rx.fc);
- WARN_ON_ONCE(((unsigned long)(skb->data + hdrlen)) & 3);
-
if (type == IEEE80211_FTYPE_DATA || type == IEEE80211_FTYPE_MGMT)
local->dot11ReceivedFragmentCount++;
diff --git a/trunk/net/mac80211/sta_info.c b/trunk/net/mac80211/sta_info.c
index cfd8ee9adad0..e8491554a5dc 100644
--- a/trunk/net/mac80211/sta_info.c
+++ b/trunk/net/mac80211/sta_info.c
@@ -14,7 +14,6 @@
#include
#include
#include
-#include
#include
#include "ieee80211_i.h"
@@ -307,8 +306,7 @@ static void sta_info_cleanup(unsigned long data)
}
read_unlock_bh(&local->sta_lock);
- local->sta_cleanup.expires =
- round_jiffies(jiffies + STA_INFO_CLEANUP_INTERVAL);
+ local->sta_cleanup.expires = jiffies + STA_INFO_CLEANUP_INTERVAL;
add_timer(&local->sta_cleanup);
}
@@ -347,8 +345,7 @@ void sta_info_init(struct ieee80211_local *local)
INIT_LIST_HEAD(&local->sta_list);
init_timer(&local->sta_cleanup);
- local->sta_cleanup.expires =
- round_jiffies(jiffies + STA_INFO_CLEANUP_INTERVAL);
+ local->sta_cleanup.expires = jiffies + STA_INFO_CLEANUP_INTERVAL;
local->sta_cleanup.data = (unsigned long) local;
local->sta_cleanup.function = sta_info_cleanup;
diff --git a/trunk/net/netfilter/nf_conntrack_core.c b/trunk/net/netfilter/nf_conntrack_core.c
index a4d5cdeb0110..000c2fb462d0 100644
--- a/trunk/net/netfilter/nf_conntrack_core.c
+++ b/trunk/net/netfilter/nf_conntrack_core.c
@@ -1016,7 +1016,7 @@ struct hlist_head *nf_ct_alloc_hashtable(int *sizep, int *vmalloced)
}
EXPORT_SYMBOL_GPL(nf_ct_alloc_hashtable);
-int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp)
+int set_hashsize(const char *val, struct kernel_param *kp)
{
int i, bucket, hashsize, vmalloced;
int old_vmalloced, old_size;
@@ -1063,9 +1063,8 @@ int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp)
nf_ct_free_hashtable(old_hash, old_vmalloced, old_size);
return 0;
}
-EXPORT_SYMBOL_GPL(nf_conntrack_set_hashsize);
-module_param_call(hashsize, nf_conntrack_set_hashsize, param_get_uint,
+module_param_call(hashsize, set_hashsize, param_get_uint,
&nf_conntrack_htable_size, 0600);
int __init nf_conntrack_init(void)
diff --git a/trunk/net/netfilter/nf_conntrack_sip.c b/trunk/net/netfilter/nf_conntrack_sip.c
index 515abffc4a09..8f8b5a48df38 100644
--- a/trunk/net/netfilter/nf_conntrack_sip.c
+++ b/trunk/net/netfilter/nf_conntrack_sip.c
@@ -187,7 +187,7 @@ static const struct sip_header_nfo ct_sip_hdrs[] = {
}
};
-/* get line length until first CR or LF seen. */
+/* get line lenght until first CR or LF seen. */
int ct_sip_lnlen(const char *line, const char *limit)
{
const char *k = line;
@@ -236,7 +236,7 @@ static int digits_len(struct nf_conn *ct, const char *dptr,
return len;
}
-/* get digits length, skipping blank spaces. */
+/* get digits lenght, skiping blank spaces. */
static int skp_digits_len(struct nf_conn *ct, const char *dptr,
const char *limit, int *shift)
{
diff --git a/trunk/net/netfilter/xt_helper.c b/trunk/net/netfilter/xt_helper.c
index d842c4a6d63f..0a1f4c6bcdef 100644
--- a/trunk/net/netfilter/xt_helper.c
+++ b/trunk/net/netfilter/xt_helper.c
@@ -56,8 +56,8 @@ match(const struct sk_buff *skb,
if (info->name[0] == '\0')
ret = !ret;
else
- ret ^= !strncmp(helper->name, info->name,
- strlen(helper->name));
+ ret ^= !strncmp(master_help->helper->name, info->name,
+ strlen(master_help->helper->name));
return ret;
}
diff --git a/trunk/net/netlabel/netlabel_mgmt.c b/trunk/net/netlabel/netlabel_mgmt.c
index 9c41464d58d1..56483377997a 100644
--- a/trunk/net/netlabel/netlabel_mgmt.c
+++ b/trunk/net/netlabel/netlabel_mgmt.c
@@ -71,7 +71,7 @@ static const struct nla_policy netlbl_mgmt_genl_policy[NLBL_MGMT_A_MAX + 1] = {
};
/*
- * NetLabel Misc Management Functions
+ * NetLabel Misc Managment Functions
*/
/**
diff --git a/trunk/net/netrom/nr_dev.c b/trunk/net/netrom/nr_dev.c
index 6caf459665f2..8c68da5ef0a1 100644
--- a/trunk/net/netrom/nr_dev.c
+++ b/trunk/net/netrom/nr_dev.c
@@ -56,7 +56,7 @@ int nr_rx_ip(struct sk_buff *skb, struct net_device *dev)
/* Spoof incoming device */
skb->dev = dev;
- skb->mac_header = skb->network_header;
+ skb_reset_mac_header(skb);
skb_reset_network_header(skb);
skb->pkt_type = PACKET_HOST;
diff --git a/trunk/net/rfkill/rfkill.c b/trunk/net/rfkill/rfkill.c
index d06d338812e9..4469a7be006c 100644
--- a/trunk/net/rfkill/rfkill.c
+++ b/trunk/net/rfkill/rfkill.c
@@ -392,14 +392,11 @@ int rfkill_register(struct rfkill *rfkill)
rfkill_led_trigger_register(rfkill);
error = rfkill_add_switch(rfkill);
- if (error) {
- rfkill_led_trigger_unregister(rfkill);
+ if (error)
return error;
- }
error = device_add(dev);
if (error) {
- rfkill_led_trigger_unregister(rfkill);
rfkill_remove_switch(rfkill);
return error;
}
diff --git a/trunk/net/sched/sch_hfsc.c b/trunk/net/sched/sch_hfsc.c
index a6ad491e434b..55e7e4530f43 100644
--- a/trunk/net/sched/sch_hfsc.c
+++ b/trunk/net/sched/sch_hfsc.c
@@ -160,7 +160,7 @@ struct hfsc_class
u64 cl_vtoff; /* inter-period cumulative vt offset */
u64 cl_cvtmax; /* max child's vt in the last period */
u64 cl_cvtoff; /* cumulative cvtmax of all periods */
- u64 cl_pcvtoff; /* parent's cvtoff at initialization
+ u64 cl_pcvtoff; /* parent's cvtoff at initalization
time */
struct internal_sc cl_rsc; /* internal real-time service curve */
diff --git a/trunk/net/sctp/sm_make_chunk.c b/trunk/net/sctp/sm_make_chunk.c
index 3cc629d3c9ff..f4876291bb5e 100644
--- a/trunk/net/sctp/sm_make_chunk.c
+++ b/trunk/net/sctp/sm_make_chunk.c
@@ -210,9 +210,6 @@ struct sctp_chunk *sctp_make_init(const struct sctp_association *asoc,
chunksize = sizeof(init) + addrs_len + SCTP_SAT_LEN(num_types);
chunksize += sizeof(ecap_param);
- if (sctp_prsctp_enable)
- chunksize += sizeof(prsctp_param);
-
/* ADDIP: Section 4.2.7:
* An implementation supporting this extension [ADDIP] MUST list
* the ASCONF,the ASCONF-ACK, and the AUTH chunks in its INIT and
@@ -289,7 +286,7 @@ struct sctp_chunk *sctp_make_init(const struct sctp_association *asoc,
sctp_addto_chunk(retval, sizeof(ecap_param), &ecap_param);
- /* Add the supported extensions parameter. Be nice and add this
+ /* Add the supported extensions paramter. Be nice and add this
* fist before addiding the parameters for the extensions themselves
*/
if (num_ext) {
@@ -372,9 +369,6 @@ struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *asoc,
if (asoc->peer.ecn_capable)
chunksize += sizeof(ecap_param);
- if (sctp_prsctp_enable)
- chunksize += sizeof(prsctp_param);
-
if (sctp_addip_enable) {
extensions[num_ext] = SCTP_CID_ASCONF;
extensions[num_ext+1] = SCTP_CID_ASCONF_ACK;
@@ -2865,7 +2859,7 @@ struct sctp_chunk *sctp_process_asconf(struct sctp_association *asoc,
chunk_len -= length;
/* Skip the address parameter and store a pointer to the first
- * asconf parameter.
+ * asconf paramter.
*/
length = ntohs(addr_param->v4.param_hdr.length);
asconf_param = (sctp_addip_param_t *)((void *)addr_param + length);
@@ -2874,7 +2868,7 @@ struct sctp_chunk *sctp_process_asconf(struct sctp_association *asoc,
/* create an ASCONF_ACK chunk.
* Based on the definitions of parameters, we know that the size of
* ASCONF_ACK parameters are less than or equal to the twice of ASCONF
- * parameters.
+ * paramters.
*/
asconf_ack = sctp_make_asconf_ack(asoc, serial, chunk_len * 2);
if (!asconf_ack)
@@ -3068,7 +3062,7 @@ int sctp_process_asconf_ack(struct sctp_association *asoc,
asconf_len -= length;
/* Skip the address parameter in the last asconf sent and store a
- * pointer to the first asconf parameter.
+ * pointer to the first asconf paramter.
*/
length = ntohs(addr_param->v4.param_hdr.length);
asconf_param = (sctp_addip_param_t *)((void *)addr_param + length);
diff --git a/trunk/net/sctp/sm_statefuns.c b/trunk/net/sctp/sm_statefuns.c
index d247ed4ee423..5fb84778846d 100644
--- a/trunk/net/sctp/sm_statefuns.c
+++ b/trunk/net/sctp/sm_statefuns.c
@@ -1309,6 +1309,26 @@ static void sctp_tietags_populate(struct sctp_association *new_asoc,
new_asoc->c.initial_tsn = asoc->c.initial_tsn;
}
+static void sctp_auth_params_populate(struct sctp_association *new_asoc,
+ const struct sctp_association *asoc)
+{
+ /* Only perform this if AUTH extension is enabled */
+ if (!sctp_auth_enable)
+ return;
+
+ /* We need to provide the same parameter information as
+ * was in the original INIT. This means that we need to copy
+ * the HMACS, CHUNKS, and RANDOM parameter from the original
+ * assocaition.
+ */
+ memcpy(new_asoc->c.auth_random, asoc->c.auth_random,
+ sizeof(asoc->c.auth_random));
+ memcpy(new_asoc->c.auth_hmacs, asoc->c.auth_hmacs,
+ sizeof(asoc->c.auth_hmacs));
+ memcpy(new_asoc->c.auth_chunks, asoc->c.auth_chunks,
+ sizeof(asoc->c.auth_chunks));
+}
+
/*
* Compare vtag/tietag values to determine unexpected COOKIE-ECHO
* handling action.
@@ -1466,6 +1486,8 @@ static sctp_disposition_t sctp_sf_do_unexpected_init(
sctp_tietags_populate(new_asoc, asoc);
+ sctp_auth_params_populate(new_asoc, asoc);
+
/* B) "Z" shall respond immediately with an INIT ACK chunk. */
/* If there are errors need to be reported for unknown parameters,
diff --git a/trunk/net/sctp/ulpevent.c b/trunk/net/sctp/ulpevent.c
index 307314356e16..2c17c7efad46 100644
--- a/trunk/net/sctp/ulpevent.c
+++ b/trunk/net/sctp/ulpevent.c
@@ -830,7 +830,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_authkey(
ak = (struct sctp_authkey_event *)
skb_put(skb, sizeof(struct sctp_authkey_event));
- ak->auth_type = SCTP_AUTHENTICATION_INDICATION;
+ ak->auth_type = SCTP_AUTHENTICATION_EVENT;
ak->auth_flags = 0;
ak->auth_length = sizeof(struct sctp_authkey_event);
diff --git a/trunk/net/sunrpc/auth_gss/auth_gss.c b/trunk/net/sunrpc/auth_gss/auth_gss.c
index 1f2d85e869c0..a6e57d1c2eb6 100644
--- a/trunk/net/sunrpc/auth_gss/auth_gss.c
+++ b/trunk/net/sunrpc/auth_gss/auth_gss.c
@@ -625,7 +625,7 @@ gss_create(struct rpc_clnt *clnt, rpc_authflavor_t flavor)
err = -EINVAL;
gss_auth->mech = gss_mech_get_by_pseudoflavor(flavor);
if (!gss_auth->mech) {
- printk(KERN_WARNING "%s: Pseudoflavor %d not found!\n",
+ printk(KERN_WARNING "%s: Pseudoflavor %d not found!",
__FUNCTION__, flavor);
goto err_free;
}
diff --git a/trunk/net/x25/x25_forward.c b/trunk/net/x25/x25_forward.c
index 34478035e05e..8738ec7ce693 100644
--- a/trunk/net/x25/x25_forward.c
+++ b/trunk/net/x25/x25_forward.c
@@ -118,14 +118,13 @@ int x25_forward_data(int lci, struct x25_neigh *from, struct sk_buff *skb) {
goto out;
if ( (skbn = pskb_copy(skb, GFP_ATOMIC)) == NULL){
- goto output;
+ goto out;
}
x25_transmit_link(skbn, nb);
- rc = 1;
-output:
x25_neigh_put(nb);
+ rc = 1;
out:
return rc;
}
diff --git a/trunk/net/xfrm/xfrm_policy.c b/trunk/net/xfrm/xfrm_policy.c
index 26b846e11bfb..b91b16671c1e 100644
--- a/trunk/net/xfrm/xfrm_policy.c
+++ b/trunk/net/xfrm/xfrm_policy.c
@@ -2162,7 +2162,7 @@ xfrm_audit_policy_add(struct xfrm_policy *xp, int result, u32 auid, u32 sid)
if (audit_enabled == 0)
return;
- audit_buf = xfrm_audit_start(auid, sid);
+ audit_buf = xfrm_audit_start(sid, auid);
if (audit_buf == NULL)
return;
audit_log_format(audit_buf, " op=SPD-add res=%u", result);
@@ -2179,7 +2179,7 @@ xfrm_audit_policy_delete(struct xfrm_policy *xp, int result, u32 auid, u32 sid)
if (audit_enabled == 0)
return;
- audit_buf = xfrm_audit_start(auid, sid);
+ audit_buf = xfrm_audit_start(sid, auid);
if (audit_buf == NULL)
return;
audit_log_format(audit_buf, " op=SPD-delete res=%u", result);
diff --git a/trunk/net/xfrm/xfrm_state.c b/trunk/net/xfrm/xfrm_state.c
index f26aaaca1fae..1af522bf12ca 100644
--- a/trunk/net/xfrm/xfrm_state.c
+++ b/trunk/net/xfrm/xfrm_state.c
@@ -1749,7 +1749,6 @@ void km_policy_expired(struct xfrm_policy *pol, int dir, int hard, u32 pid)
}
EXPORT_SYMBOL(km_policy_expired);
-#ifdef CONFIG_XFRM_MIGRATE
int km_migrate(struct xfrm_selector *sel, u8 dir, u8 type,
struct xfrm_migrate *m, int num_migrate)
{
@@ -1769,7 +1768,6 @@ int km_migrate(struct xfrm_selector *sel, u8 dir, u8 type,
return err;
}
EXPORT_SYMBOL(km_migrate);
-#endif
int km_report(u8 proto, struct xfrm_selector *sel, xfrm_address_t *addr)
{
@@ -2035,7 +2033,7 @@ xfrm_audit_state_add(struct xfrm_state *x, int result, u32 auid, u32 sid)
if (audit_enabled == 0)
return;
- audit_buf = xfrm_audit_start(auid, sid);
+ audit_buf = xfrm_audit_start(sid, auid);
if (audit_buf == NULL)
return;
audit_log_format(audit_buf, " op=SAD-add res=%u",result);
@@ -2055,7 +2053,7 @@ xfrm_audit_state_delete(struct xfrm_state *x, int result, u32 auid, u32 sid)
if (audit_enabled == 0)
return;
- audit_buf = xfrm_audit_start(auid, sid);
+ audit_buf = xfrm_audit_start(sid, auid);
if (audit_buf == NULL)
return;
audit_log_format(audit_buf, " op=SAD-delete res=%u",result);
diff --git a/trunk/net/xfrm/xfrm_user.c b/trunk/net/xfrm/xfrm_user.c
index c4f6419b1769..e75dbdcb08a4 100644
--- a/trunk/net/xfrm/xfrm_user.c
+++ b/trunk/net/xfrm/xfrm_user.c
@@ -31,6 +31,11 @@
#include
#endif
+static inline int alg_len(struct xfrm_algo *alg)
+{
+ return sizeof(*alg) + ((alg->alg_key_len + 7) / 8);
+}
+
static int verify_one_alg(struct nlattr **attrs, enum xfrm_attr_type_t type)
{
struct nlattr *rt = attrs[type];
@@ -40,7 +45,7 @@ static int verify_one_alg(struct nlattr **attrs, enum xfrm_attr_type_t type)
return 0;
algp = nla_data(rt);
- if (nla_len(rt) < xfrm_alg_len(algp))
+ if (nla_len(rt) < alg_len(algp))
return -EINVAL;
switch (type) {
@@ -199,7 +204,7 @@ static int attach_one_algo(struct xfrm_algo **algpp, u8 *props,
return -ENOSYS;
*props = algo->desc.sadb_alg_id;
- p = kmemdup(ualg, xfrm_alg_len(ualg), GFP_KERNEL);
+ p = kmemdup(ualg, alg_len(ualg), GFP_KERNEL);
if (!p)
return -ENOMEM;
@@ -511,9 +516,9 @@ static int copy_to_user_state_extra(struct xfrm_state *x,
NLA_PUT_U64(skb, XFRMA_LASTUSED, x->lastused);
if (x->aalg)
- NLA_PUT(skb, XFRMA_ALG_AUTH, xfrm_alg_len(x->aalg), x->aalg);
+ NLA_PUT(skb, XFRMA_ALG_AUTH, alg_len(x->aalg), x->aalg);
if (x->ealg)
- NLA_PUT(skb, XFRMA_ALG_CRYPT, xfrm_alg_len(x->ealg), x->ealg);
+ NLA_PUT(skb, XFRMA_ALG_CRYPT, alg_len(x->ealg), x->ealg);
if (x->calg)
NLA_PUT(skb, XFRMA_ALG_COMP, sizeof(*(x->calg)), x->calg);
@@ -1973,9 +1978,9 @@ static inline size_t xfrm_sa_len(struct xfrm_state *x)
{
size_t l = 0;
if (x->aalg)
- l += nla_total_size(xfrm_alg_len(x->aalg));
+ l += nla_total_size(alg_len(x->aalg));
if (x->ealg)
- l += nla_total_size(xfrm_alg_len(x->ealg));
+ l += nla_total_size(alg_len(x->ealg));
if (x->calg)
l += nla_total_size(sizeof(*x->calg));
if (x->encap)
diff --git a/trunk/scripts/kconfig/conf.c b/trunk/scripts/kconfig/conf.c
index 8d6f17490c5e..a38787a881ea 100644
--- a/trunk/scripts/kconfig/conf.c
+++ b/trunk/scripts/kconfig/conf.c
@@ -374,8 +374,7 @@ static int conf_choice(struct menu *menu)
continue;
break;
case set_random:
- if (is_new)
- def = (random() % cnt) + 1;
+ def = (random() % cnt) + 1;
case set_default:
case set_yes:
case set_mod:
diff --git a/trunk/security/commoncap.c b/trunk/security/commoncap.c
index ea61bc73f6d3..5bc1895f3f9c 100644
--- a/trunk/security/commoncap.c
+++ b/trunk/security/commoncap.c
@@ -59,12 +59,6 @@ int cap_netlink_recv(struct sk_buff *skb, int cap)
EXPORT_SYMBOL(cap_netlink_recv);
-/*
- * NOTE WELL: cap_capable() cannot be used like the kernel's capable()
- * function. That is, it has the reverse semantics: cap_capable()
- * returns 0 when a task has a capability, but the kernel's capable()
- * returns 1 for this case.
- */
int cap_capable (struct task_struct *tsk, int cap)
{
/* Derived from include/linux/sched.h:capable. */
@@ -113,11 +107,10 @@ static inline int cap_block_setpcap(struct task_struct *target)
static inline int cap_inh_is_capped(void)
{
/*
- * Return 1 if changes to the inheritable set are limited
- * to the old permitted set. That is, if the current task
- * does *not* possess the CAP_SETPCAP capability.
+ * return 1 if changes to the inheritable set are limited
+ * to the old permitted set.
*/
- return (cap_capable(current, CAP_SETPCAP) != 0);
+ return !cap_capable(current, CAP_SETPCAP);
}
#else /* ie., ndef CONFIG_SECURITY_FILE_CAPABILITIES */
diff --git a/trunk/security/selinux/netlabel.c b/trunk/security/selinux/netlabel.c
index 66e013d6f6f6..d243ddc723a5 100644
--- a/trunk/security/selinux/netlabel.c
+++ b/trunk/security/selinux/netlabel.c
@@ -53,11 +53,10 @@ static int selinux_netlbl_sock_setsid(struct sock *sk, u32 sid)
struct sk_security_struct *sksec = sk->sk_security;
struct netlbl_lsm_secattr secattr;
- netlbl_secattr_init(&secattr);
-
rc = security_netlbl_sid_to_secattr(sid, &secattr);
if (rc != 0)
- goto sock_setsid_return;
+ return rc;
+
rc = netlbl_sock_setattr(sk, &secattr);
if (rc == 0) {
spin_lock_bh(&sksec->nlbl_lock);
@@ -65,8 +64,6 @@ static int selinux_netlbl_sock_setsid(struct sock *sk, u32 sid)
spin_unlock_bh(&sksec->nlbl_lock);
}
-sock_setsid_return:
- netlbl_secattr_destroy(&secattr);
return rc;
}
diff --git a/trunk/security/selinux/ss/services.c b/trunk/security/selinux/ss/services.c
index f83b19daed16..d572dc908f31 100644
--- a/trunk/security/selinux/ss/services.c
+++ b/trunk/security/selinux/ss/services.c
@@ -2606,6 +2606,8 @@ int security_netlbl_sid_to_secattr(u32 sid, struct netlbl_lsm_secattr *secattr)
int rc = -ENOENT;
struct context *ctx;
+ netlbl_secattr_init(secattr);
+
if (!ss_initialized)
return 0;
diff --git a/trunk/sound/core/oss/mixer_oss.c b/trunk/sound/core/oss/mixer_oss.c
index c5a5ab9cae8c..3ace4a5680ba 100644
--- a/trunk/sound/core/oss/mixer_oss.c
+++ b/trunk/sound/core/oss/mixer_oss.c
@@ -925,68 +925,6 @@ static void mixer_slot_clear(struct snd_mixer_oss_slot *rslot)
rslot->number = idx;
}
-/* In a separate function to keep gcc 3.2 happy - do NOT merge this in
- snd_mixer_oss_build_input! */
-static int snd_mixer_oss_build_test_all(struct snd_mixer_oss *mixer,
- struct snd_mixer_oss_assign_table *ptr,
- struct slot *slot)
-{
- char str[64];
- int err;
-
- err = snd_mixer_oss_build_test(mixer, slot, ptr->name, ptr->index,
- SNDRV_MIXER_OSS_ITEM_GLOBAL);
- if (err)
- return err;
- sprintf(str, "%s Switch", ptr->name);
- err = snd_mixer_oss_build_test(mixer, slot, str, ptr->index,
- SNDRV_MIXER_OSS_ITEM_GSWITCH);
- if (err)
- return err;
- sprintf(str, "%s Route", ptr->name);
- err = snd_mixer_oss_build_test(mixer, slot, str, ptr->index,
- SNDRV_MIXER_OSS_ITEM_GROUTE);
- if (err)
- return err;
- sprintf(str, "%s Volume", ptr->name);
- err = snd_mixer_oss_build_test(mixer, slot, str, ptr->index,
- SNDRV_MIXER_OSS_ITEM_GVOLUME);
- if (err)
- return err;
- sprintf(str, "%s Playback Switch", ptr->name);
- err = snd_mixer_oss_build_test(mixer, slot, str, ptr->index,
- SNDRV_MIXER_OSS_ITEM_PSWITCH);
- if (err)
- return err;
- sprintf(str, "%s Playback Route", ptr->name);
- err = snd_mixer_oss_build_test(mixer, slot, str, ptr->index,
- SNDRV_MIXER_OSS_ITEM_PROUTE);
- if (err)
- return err;
- sprintf(str, "%s Playback Volume", ptr->name);
- err = snd_mixer_oss_build_test(mixer, slot, str, ptr->index,
- SNDRV_MIXER_OSS_ITEM_PVOLUME);
- if (err)
- return err;
- sprintf(str, "%s Capture Switch", ptr->name);
- err = snd_mixer_oss_build_test(mixer, slot, str, ptr->index,
- SNDRV_MIXER_OSS_ITEM_CSWITCH);
- if (err)
- return err;
- sprintf(str, "%s Capture Route", ptr->name);
- err = snd_mixer_oss_build_test(mixer, slot, str, ptr->index,
- SNDRV_MIXER_OSS_ITEM_CROUTE);
- if (err)
- return err;
- sprintf(str, "%s Capture Volume", ptr->name);
- err = snd_mixer_oss_build_test(mixer, slot, str, ptr->index,
- SNDRV_MIXER_OSS_ITEM_CVOLUME);
- if (err)
- return err;
-
- return 0;
-}
-
/*
* build an OSS mixer element.
* ptr_allocated means the entry is dynamically allocated (change via proc file).
@@ -1006,7 +944,44 @@ static int snd_mixer_oss_build_input(struct snd_mixer_oss *mixer, struct snd_mix
memset(&slot, 0, sizeof(slot));
memset(slot.numid, 0xff, sizeof(slot.numid)); /* ID_UNKNOWN */
- if (snd_mixer_oss_build_test_all(mixer, ptr, &slot))
+ if (snd_mixer_oss_build_test(mixer, &slot, ptr->name, ptr->index,
+ SNDRV_MIXER_OSS_ITEM_GLOBAL))
+ return 0;
+ sprintf(str, "%s Switch", ptr->name);
+ if (snd_mixer_oss_build_test(mixer, &slot, str, ptr->index,
+ SNDRV_MIXER_OSS_ITEM_GSWITCH))
+ return 0;
+ sprintf(str, "%s Route", ptr->name);
+ if (snd_mixer_oss_build_test(mixer, &slot, str, ptr->index,
+ SNDRV_MIXER_OSS_ITEM_GROUTE))
+ return 0;
+ sprintf(str, "%s Volume", ptr->name);
+ if (snd_mixer_oss_build_test(mixer, &slot, str, ptr->index,
+ SNDRV_MIXER_OSS_ITEM_GVOLUME))
+ return 0;
+ sprintf(str, "%s Playback Switch", ptr->name);
+ if (snd_mixer_oss_build_test(mixer, &slot, str, ptr->index,
+ SNDRV_MIXER_OSS_ITEM_PSWITCH))
+ return 0;
+ sprintf(str, "%s Playback Route", ptr->name);
+ if (snd_mixer_oss_build_test(mixer, &slot, str, ptr->index,
+ SNDRV_MIXER_OSS_ITEM_PROUTE))
+ return 0;
+ sprintf(str, "%s Playback Volume", ptr->name);
+ if (snd_mixer_oss_build_test(mixer, &slot, str, ptr->index,
+ SNDRV_MIXER_OSS_ITEM_PVOLUME))
+ return 0;
+ sprintf(str, "%s Capture Switch", ptr->name);
+ if (snd_mixer_oss_build_test(mixer, &slot, str, ptr->index,
+ SNDRV_MIXER_OSS_ITEM_CSWITCH))
+ return 0;
+ sprintf(str, "%s Capture Route", ptr->name);
+ if (snd_mixer_oss_build_test(mixer, &slot, str, ptr->index,
+ SNDRV_MIXER_OSS_ITEM_CROUTE))
+ return 0;
+ sprintf(str, "%s Capture Volume", ptr->name);
+ if (snd_mixer_oss_build_test(mixer, &slot, str, ptr->index,
+ SNDRV_MIXER_OSS_ITEM_CVOLUME))
return 0;
down_read(&mixer->card->controls_rwsem);
if (ptr->index == 0 && (kctl = snd_mixer_oss_test_id(mixer, "Capture Source", 0)) != NULL) {
diff --git a/trunk/sound/oss/Kconfig b/trunk/sound/oss/Kconfig
index 857008bb7167..af37cd09bddd 100644
--- a/trunk/sound/oss/Kconfig
+++ b/trunk/sound/oss/Kconfig
@@ -75,7 +75,7 @@ config SOUND_TRIDENT
This driver differs slightly from OSS/Free, so PLEASE READ the
- comments at the top of .
+ comments at the top of .
config SOUND_MSNDCLAS
tristate "Support for Turtle Beach MultiSound Classic, Tahiti, Monterey"
@@ -564,7 +564,7 @@ config SOUND_AEDSP16
questions.
Read the file and the head of
- as well as
+ as well as
to get more information
about this driver and its configuration.
diff --git a/trunk/sound/oss/msnd.h b/trunk/sound/oss/msnd.h
index d0ca582c4583..05cf7865be5e 100644
--- a/trunk/sound/oss/msnd.h
+++ b/trunk/sound/oss/msnd.h
@@ -233,8 +233,8 @@ typedef struct multisound_dev {
spinlock_t lock;
int nresets;
unsigned long recsrc;
- int left_levels[32];
- int right_levels[32];
+ int left_levels[16];
+ int right_levels[16];
int mixer_mod_count;
int calibrate_signal;
int play_sample_size, play_sample_rate, play_channels;