diff --git a/[refs] b/[refs]
index feefc5b8db6b..f4b38dafc55a 100644
--- a/[refs]
+++ b/[refs]
@@ -1,2 +1,2 @@
---
-refs/heads/master: 8df042e85c4462f97be286ef0fd82a627f27e9c8
+refs/heads/master: 66a21736defda339cd93a0e70c1120ab813640f6
diff --git a/trunk/Documentation/kernel-parameters.txt b/trunk/Documentation/kernel-parameters.txt
index c4178778e7fd..33121d6c827c 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.
@@ -883,14 +882,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/nfsroot.txt b/trunk/Documentation/nfsroot.txt
index 31b329172343..c86dd38e2281 100644
--- a/trunk/Documentation/nfsroot.txt
+++ b/trunk/Documentation/nfsroot.txt
@@ -145,7 +145,6 @@ 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
diff --git a/trunk/MAINTAINERS b/trunk/MAINTAINERS
index b4f611c60cfc..79c711e6074b 100644
--- a/trunk/MAINTAINERS
+++ b/trunk/MAINTAINERS
@@ -1919,7 +1919,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
@@ -1984,27 +1984,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
diff --git a/trunk/Makefile b/trunk/Makefile
index 8f08a29539ea..fbb8dfc063d3 100644
--- a/trunk/Makefile
+++ b/trunk/Makefile
@@ -1,7 +1,7 @@
VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 24
-EXTRAVERSION = -rc7
+EXTRAVERSION = -rc6
NAME = Arr Matey! A Hairy Bilge Rat!
# *DOCUMENTATION*
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-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/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 291d368ffd28..c6fc405a6c8e 100644
--- a/trunk/arch/mips/Kconfig
+++ b/trunk/arch/mips/Kconfig
@@ -992,6 +992,8 @@ config BOOT_ELF64
menu "CPU selection"
+source "kernel/time/Kconfig"
+
choice
prompt "CPU type"
default CPU_R4X00
@@ -1766,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/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/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/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/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/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 39d695cb9693..61d12f183036 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-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 adf0a030d6fe..9cb081c26e71 100644
--- a/trunk/arch/powerpc/platforms/cell/spufs/context.c
+++ b/trunk/arch/powerpc/platforms/cell/spufs/context.c
@@ -190,3 +190,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 9ad53e637aee..4d257b3f9336 100644
--- a/trunk/arch/powerpc/platforms/cell/spufs/sched.c
+++ b/trunk/arch/powerpc/platforms/cell/spufs/sched.c
@@ -166,7 +166,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;
@@ -193,6 +201,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/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/smpboot_64.c b/trunk/arch/x86/kernel/smpboot_64.c
index aaf4e1291217..500670c93d81 100644
--- a/trunk/arch/x86/kernel/smpboot_64.c
+++ b/trunk/arch/x86/kernel/smpboot_64.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/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/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 264ae60e3fd8..a883bb03d4c7 100644
--- a/trunk/drivers/ata/libata-scsi.c
+++ b/trunk/drivers/ata/libata-scsi.c
@@ -872,8 +872,7 @@ int ata_scsi_slave_config(struct scsi_device *sdev)
ata_scsi_sdev_config(sdev);
- if (dev->class == ATA_DEV_ATA)
- sdev->manage_start_stop = 1;
+ 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_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_pdc202xx_old.c b/trunk/drivers/ata/pata_pdc202xx_old.c
index 8f2815601791..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,17 +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);
-}
-
static struct scsi_host_template pdc202xx_sht = {
.module = THIS_MODULE,
.name = DRV_NAME,
@@ -324,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/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 b4c674d83769..96fd5260446d 100644
--- a/trunk/drivers/ata/sata_sil24.c
+++ b/trunk/drivers/ata/sata_sil24.c
@@ -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;
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/char/tty_ioctl.c b/trunk/drivers/char/tty_ioctl.c
index d4b6d64e858b..e02d59245a17 100644
--- a/trunk/drivers/char/tty_ioctl.c
+++ b/trunk/drivers/char/tty_ioctl.c
@@ -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/crypto/padlock-aes.c b/trunk/drivers/crypto/padlock-aes.c
index 5f7e71810489..abbcff0762b1 100644
--- a/trunk/drivers/crypto/padlock-aes.c
+++ b/trunk/drivers/crypto/padlock-aes.c
@@ -419,58 +419,13 @@ static int aes_set_key(struct crypto_tfm *tfm, const u8 *in_key,
/* ====== Encryption/decryption routines ====== */
/* These are the real call to PadLock. */
-static inline void padlock_xcrypt(const u8 *input, u8 *output, void *key,
- void *control_word)
-{
- asm volatile (".byte 0xf3,0x0f,0xa7,0xc8" /* rep xcryptecb */
- : "+S"(input), "+D"(output)
- : "d"(control_word), "b"(key), "c"(1));
-}
-
-static void aes_crypt_copy(const u8 *in, u8 *out, u32 *key, struct cword *cword)
-{
- u8 buf[AES_BLOCK_SIZE * 2 + PADLOCK_ALIGNMENT - 1];
- u8 *tmp = PTR_ALIGN(&buf[0], PADLOCK_ALIGNMENT);
-
- memcpy(tmp, in, AES_BLOCK_SIZE);
- padlock_xcrypt(tmp, out, key, cword);
-}
-
-static inline void aes_crypt(const u8 *in, u8 *out, u32 *key,
- struct cword *cword)
-{
- asm volatile ("pushfl; popfl");
-
- /* padlock_xcrypt requires at least two blocks of data. */
- if (unlikely(!(((unsigned long)in ^ (PAGE_SIZE - AES_BLOCK_SIZE)) &
- (PAGE_SIZE - 1)))) {
- aes_crypt_copy(in, out, key, cword);
- return;
- }
-
- padlock_xcrypt(in, out, key, cword);
-}
-
static inline void padlock_xcrypt_ecb(const u8 *input, u8 *output, void *key,
void *control_word, u32 count)
{
- if (count == 1) {
- aes_crypt(input, output, key, control_word);
- return;
- }
-
asm volatile ("pushfl; popfl"); /* enforce key reload. */
- asm volatile ("test $1, %%cl;"
- "je 1f;"
- "lea -1(%%ecx), %%eax;"
- "mov $1, %%ecx;"
- ".byte 0xf3,0x0f,0xa7,0xc8;" /* rep xcryptecb */
- "mov %%eax, %%ecx;"
- "1:"
- ".byte 0xf3,0x0f,0xa7,0xc8" /* rep xcryptecb */
+ asm volatile (".byte 0xf3,0x0f,0xa7,0xc8" /* rep xcryptecb */
: "+S"(input), "+D"(output)
- : "d"(control_word), "b"(key), "c"(count)
- : "ax");
+ : "d"(control_word), "b"(key), "c"(count));
}
static inline u8 *padlock_xcrypt_cbc(const u8 *input, u8 *output, void *key,
@@ -488,13 +443,13 @@ static inline u8 *padlock_xcrypt_cbc(const u8 *input, u8 *output, void *key,
static void aes_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in)
{
struct aes_ctx *ctx = aes_ctx(tfm);
- aes_crypt(in, out, ctx->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/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/ide/ide-acpi.c b/trunk/drivers/ide/ide-acpi.c
index fe6768a7d658..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,37 +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")
- },
- },
-};
-
-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
@@ -655,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");
@@ -700,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-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/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/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/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/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/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/ivtv/ivtv-driver.c b/trunk/drivers/media/video/ivtv/ivtv-driver.c
index 10d6faf8ccda..6d2dd8764f81 100644
--- a/trunk/drivers/media/video/ivtv/ivtv-driver.c
+++ b/trunk/drivers/media/video/ivtv/ivtv-driver.c
@@ -1076,10 +1076,6 @@ static int __devinit ivtv_probe(struct pci_dev *dev,
ivtv_process_eeprom(itv);
}
- /* The mspx4xx chips need a longer delay for some reason */
- if (!(itv->hw_flags & IVTV_HW_MSP34XX))
- itv->i2c_algo.udelay = 5;
-
if (itv->std == 0) {
itv->std = V4L2_STD_NTSC_M;
}
diff --git a/trunk/drivers/media/video/ivtv/ivtv-i2c.c b/trunk/drivers/media/video/ivtv/ivtv-i2c.c
index 36e54f78aa2a..44678fe27a04 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,
};
@@ -718,6 +718,9 @@ int init_ivtv_i2c(struct ivtv *itv)
sizeof(struct i2c_adapter));
memcpy(&itv->i2c_algo, &ivtv_i2c_algo_template,
sizeof(struct i2c_algo_bit_data));
+ /* The mspx4xx chips need a longer delay for some reason */
+ if (itv->hw_flags & IVTV_HW_MSP34XX)
+ itv->i2c_algo.udelay = 10;
itv->i2c_algo.data = itv;
itv->i2c_adap.algo_data = &itv->i2c_algo;
}
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/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 13d57b0a88fa..4f37506ad374 100644
--- a/trunk/drivers/net/e1000/e1000_main.c
+++ b/trunk/drivers/net/e1000/e1000_main.c
@@ -3919,26 +3919,32 @@ e1000_clean(struct napi_struct *napi, int budget)
{
struct e1000_adapter *adapter = container_of(napi, struct e1000_adapter, napi);
struct net_device *poll_dev = adapter->netdev;
- int work_done = 0;
+ int tx_cleaned = 0, work_done = 0;
/* 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)) {
- e1000_clean_tx_irq(adapter,
- &adapter->tx_ring[0]);
+ tx_cleaned = e1000_clean_tx_irq(adapter,
+ &adapter->tx_ring[0]);
spin_unlock(&adapter->tx_queue_lock);
}
adapter->clean_rx(adapter, &adapter->rx_ring[0],
&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 4a6fc7453776..4fd2e23720b6 100644
--- a/trunk/drivers/net/e1000e/netdev.c
+++ b/trunk/drivers/net/e1000e/netdev.c
@@ -1384,24 +1384,30 @@ static int e1000_clean(struct napi_struct *napi, int budget)
{
struct e1000_adapter *adapter = container_of(napi, struct e1000_adapter, napi);
struct net_device *poll_dev = adapter->netdev;
- int work_done = 0;
+ int tx_cleaned = 0, work_done = 0;
/* 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
* tx_ring is currently being cleaned anyway. */
if (spin_trylock(&adapter->tx_queue_lock)) {
- e1000_clean_tx_irq(adapter);
+ tx_cleaned = e1000_clean_tx_irq(adapter);
spin_unlock(&adapter->tx_queue_lock);
}
adapter->clean_rx(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 < budget)) ||
+ !netif_running(poll_dev)) {
+quit_polling:
if (adapter->itr_setting & 3)
e1000_set_itr(adapter);
netif_rx_complete(poll_dev, napi);
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/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 3e1a57a42f11..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.
diff --git a/trunk/drivers/net/ixgb/ixgb_main.c b/trunk/drivers/net/ixgb/ixgb_main.c
index d2fb88d5cda2..bf9085fe035a 100644
--- a/trunk/drivers/net/ixgb/ixgb_main.c
+++ b/trunk/drivers/net/ixgb/ixgb_main.c
@@ -1787,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 a56491617661..00bc525c6560 100644
--- a/trunk/drivers/net/ixgbe/ixgbe_main.c
+++ b/trunk/drivers/net/ixgbe/ixgbe_main.c
@@ -1468,15 +1468,21 @@ static int ixgbe_clean(struct napi_struct *napi, int budget)
struct ixgbe_adapter *adapter = container_of(napi,
struct ixgbe_adapter, napi);
struct net_device *netdev = adapter->netdev;
- int work_done = 0;
+ 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 */
- ixgbe_clean_tx_irq(adapter, adapter->tx_ring);
+ tx_cleaned = ixgbe_clean_tx_irq(adapter, adapter->tx_ring);
ixgbe_clean_rx_irq(adapter, &adapter->rx_ring[0], &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/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_main.c b/trunk/drivers/net/netxen/netxen_nic_main.c
index 454226f7baa8..a80f0cd6b528 100644
--- a/trunk/drivers/net/netxen/netxen_nic_main.c
+++ b/trunk/drivers/net/netxen/netxen_nic_main.c
@@ -1321,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/niu.c b/trunk/drivers/net/niu.c
index 9a0c6d3adfe9..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";
@@ -2241,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;
}
@@ -2510,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);
@@ -2755,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);
@@ -2773,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);
- }
}
}
}
@@ -2817,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,
@@ -2919,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;
}
@@ -5208,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);
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 af8030981f10..5863190894cc 100644
--- a/trunk/drivers/net/r8169.c
+++ b/trunk/drivers/net/r8169.c
@@ -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
}
diff --git a/trunk/drivers/net/s2io.c b/trunk/drivers/net/s2io.c
index fa57c49c0c51..9d80f1cf73ac 100644
--- a/trunk/drivers/net/s2io.c
+++ b/trunk/drivers/net/s2io.c
@@ -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;
diff --git a/trunk/drivers/net/sky2.c b/trunk/drivers/net/sky2.c
index 52ec89b82f64..a74fc11a6482 100644
--- a/trunk/drivers/net/sky2.c
+++ b/trunk/drivers/net/sky2.c
@@ -1168,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);
}
@@ -2044,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)
@@ -3863,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/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/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/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/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/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/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/pnp/pnpacpi/rsparser.c b/trunk/drivers/pnp/pnpacpi/rsparser.c
index 3c5eb374adf8..f7b8648acbfa 100644
--- a/trunk/drivers/pnp/pnpacpi/rsparser.c
+++ b/trunk/drivers/pnp/pnpacpi/rsparser.c
@@ -76,6 +76,7 @@ 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;
@@ -83,9 +84,10 @@ 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) {
+ if (i >= PNP_MAX_IRQ && !warned) {
printk(KERN_ERR "pnpacpi: exceeded the max number of IRQ "
"resources: %d \n", PNP_MAX_IRQ);
+ warned = 1;
return;
}
/*
@@ -169,6 +171,7 @@ 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))
@@ -183,9 +186,10 @@ static void pnpacpi_parse_allocated_dmaresource(struct pnp_resource_table *res,
}
res->dma_resource[i].start = dma;
res->dma_resource[i].end = dma;
- } else {
+ } else if (!warned) {
printk(KERN_ERR "pnpacpi: exceeded the max number of DMA "
"resources: %d \n", PNP_MAX_DMA);
+ warned = 1;
}
}
@@ -193,6 +197,7 @@ 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)
@@ -207,7 +212,7 @@ 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 {
+ } else if (!warned) {
printk(KERN_ERR "pnpacpi: exceeded the max number of IO "
"resources: %d \n", PNP_MAX_PORT);
}
@@ -218,6 +223,7 @@ 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))
@@ -233,7 +239,7 @@ 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 {
+ } else if (!warned) {
printk(KERN_ERR "pnpacpi: exceeded the max number of mem "
"resources: %d\n", PNP_MAX_MEM);
}
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/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/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/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/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/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/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/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/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 31284c77bba8..8a3a650abc87 100644
--- a/trunk/fs/hfs/btree.c
+++ b/trunk/fs/hfs/btree.c
@@ -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;
@@ -100,9 +89,9 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id, btree_keycmp ke
return tree;
fail_page:
+ tree->inode->i_mapping->a_ops = &hfs_aops;
page_cache_release(page);
free_tree:
- tree->inode->i_mapping->a_ops = &hfs_aops;
iput(tree->inode);
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/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/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/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-powerpc/spu.h b/trunk/include/asm-powerpc/spu.h
index 34b7807f068b..b1accce77bb5 100644
--- a/trunk/include/asm-powerpc/spu.h
+++ b/trunk/include/asm-powerpc/spu.h
@@ -246,7 +246,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;
};
@@ -299,9 +298,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 Privlege Area of an SPU.
*/
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 664a2fa7adc9..ba4b31432120 100644
--- a/trunk/include/asm-x86/msr.h
+++ b/trunk/include/asm-x86/msr.h
@@ -191,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))
@@ -198,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)
@@ -221,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)
{
@@ -289,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);
@@ -346,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/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/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/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/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/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/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/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/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/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/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/sched.c b/trunk/kernel/sched.c
index 37cf07aa4164..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);
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/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/page_alloc.c b/trunk/mm/page_alloc.c
index e1028fae3ebb..d73bfad1c32f 100644
--- a/trunk/mm/page_alloc.c
+++ b/trunk/mm/page_alloc.c
@@ -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/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..3655ad359f03 100644
--- a/trunk/mm/slub.c
+++ b/trunk/mm/slub.c
@@ -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/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/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/core/dev.c b/trunk/net/core/dev.c
index 0879f52115eb..be9d3015beaa 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);
}
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/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/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/ipconfig.c b/trunk/net/ipv4/ipconfig.c
index b8f7763b2261..420f56ad59f8 100644
--- a/trunk/net/ipv4/ipconfig.c
+++ b/trunk/net/ipv4/ipconfig.c
@@ -1404,7 +1404,8 @@ static int __init ic_proto_name(char *name)
return 1;
}
if (!strcmp(name, "off") || !strcmp(name, "none")) {
- return 0;
+ ic_enable = 0;
+ return 1;
}
#ifdef CONFIG_IP_PNP_DHCP
else if (!strcmp(name, "dhcp")) {
@@ -1439,24 +1440,11 @@ 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))
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;
- return 1;
- }
-
- /* Parse string for static IP assignment. */
+ /* Parse the whole string */
ip = addrs;
while (ip && *ip) {
if ((cp = strchr(ip, ':')))
@@ -1494,10 +1482,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/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 d3377069ce05..d2bc6148a737 100644
--- a/trunk/net/ipv4/route.c
+++ b/trunk/net/ipv4/route.c
@@ -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/irda/af_irda.c b/trunk/net/irda/af_irda.c
index d5e4dd75200b..48ce59a6e026 100644
--- a/trunk/net/irda/af_irda.c
+++ b/trunk/net/irda/af_irda.c
@@ -1118,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;
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/sctp/sm_make_chunk.c b/trunk/net/sctp/sm_make_chunk.c
index 3cc629d3c9ff..ed7c9e30ebc9 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
@@ -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;
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_state.c b/trunk/net/xfrm/xfrm_state.c
index f26aaaca1fae..ee1e69753932 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)
{
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/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) {