diff --git a/[refs] b/[refs]
index 1ee62c72997f..f34b8cb0ab2a 100644
--- a/[refs]
+++ b/[refs]
@@ -1,2 +1,2 @@
---
-refs/heads/master: eb90d81d03c0917b0fd629f6342554a3b58ea52c
+refs/heads/master: b9e16bc548600124da9d24186364ee8d06040569
diff --git a/trunk/Documentation/ABI/testing/sysfs-class-bdi b/trunk/Documentation/ABI/testing/sysfs-class-bdi
index 5f500977b42f..5ac1e01bbd48 100644
--- a/trunk/Documentation/ABI/testing/sysfs-class-bdi
+++ b/trunk/Documentation/ABI/testing/sysfs-class-bdi
@@ -14,10 +14,6 @@ MAJOR:MINOR
non-block filesystems which provide their own BDI, such as NFS
and FUSE.
-MAJOR:MINOR-fuseblk
-
- Value of st_dev on fuseblk filesystems.
-
default
The default backing dev, used for non-block device backed
diff --git a/trunk/Documentation/DocBook/kernel-locking.tmpl b/trunk/Documentation/DocBook/kernel-locking.tmpl
index 2510763295d0..77c42f40be5d 100644
--- a/trunk/Documentation/DocBook/kernel-locking.tmpl
+++ b/trunk/Documentation/DocBook/kernel-locking.tmpl
@@ -703,31 +703,6 @@
-
- The trylock Functions
-
- There are functions that try to acquire a lock only once and immediately
- return a value telling about success or failure to acquire the lock.
- They can be used if you need no access to the data protected with the lock
- when some other thread is holding the lock. You should acquire the lock
- later if you then need access to the data protected with the lock.
-
-
-
- spin_trylock() does not spin but returns non-zero if
- it acquires the spinlock on the first try or 0 if not. This function can
- be used in all contexts like spin_lock: you must have
- disabled the contexts that might interrupt you and acquire the spin lock.
-
-
-
- mutex_trylock() does not suspend your task
- but returns non-zero if it could lock the mutex on the first try
- or 0 if not. This function cannot be safely used in hardware or software
- interrupt contexts despite not sleeping.
-
-
-
Common Examples
diff --git a/trunk/Documentation/cpu-freq/governors.txt b/trunk/Documentation/cpu-freq/governors.txt
index dcec0564d040..6a9c55bd556b 100644
--- a/trunk/Documentation/cpu-freq/governors.txt
+++ b/trunk/Documentation/cpu-freq/governors.txt
@@ -129,6 +129,14 @@ to its default value of '80' it means that between the checking
intervals the CPU needs to be on average more than 80% in use to then
decide that the CPU frequency needs to be increased.
+sampling_down_factor: this parameter controls the rate that the CPU
+makes a decision on when to decrease the frequency. When set to its
+default value of '5' it means that at 1/5 the sampling_rate the kernel
+makes a decision to lower the frequency. Five "lower rate" decisions
+have to be made in a row before the CPU frequency is actually lower.
+If set to '1' then the frequency decreases as quickly as it increases,
+if set to '2' it decreases at half the rate of the increase.
+
ignore_nice_load: this parameter takes a value of '0' or '1'. When
set to '0' (its default), all processes are counted towards the
'cpu utilisation' value. When set to '1', the processes that are
diff --git a/trunk/Documentation/hwmon/ibmaem b/trunk/Documentation/hwmon/ibmaem
deleted file mode 100644
index 2fefaf582a43..000000000000
--- a/trunk/Documentation/hwmon/ibmaem
+++ /dev/null
@@ -1,37 +0,0 @@
-Kernel driver ibmaem
-======================
-
-Supported systems:
- * Any recent IBM System X server with Active Energy Manager support.
- This includes the x3350, x3550, x3650, x3655, x3755, x3850 M2,
- x3950 M2, and certain HS2x/LS2x/QS2x blades. The IPMI host interface
- driver ("ipmi-si") needs to be loaded for this driver to do anything.
- Prefix: 'ibmaem'
- Datasheet: Not available
-
-Author: Darrick J. Wong
-
-Description
------------
-
-This driver implements sensor reading support for the energy and power
-meters available on various IBM System X hardware through the BMC. All
-sensor banks will be exported as platform devices; this driver can talk
-to both v1 and v2 interfaces. This driver is completely separate from the
-older ibmpex driver.
-
-The v1 AEM interface has a simple set of features to monitor energy use.
-There is a register that displays an estimate of raw energy consumption
-since the last BMC reset, and a power sensor that returns average power
-use over a configurable interval.
-
-The v2 AEM interface is a bit more sophisticated, being able to present
-a wider range of energy and power use registers, the power cap as
-set by the AEM software, and temperature sensors.
-
-Special Features
-----------------
-
-The "power_cap" value displays the current system power cap, as set by
-the Active Energy Manager software. Setting the power cap from the host
-is not currently supported.
diff --git a/trunk/MAINTAINERS b/trunk/MAINTAINERS
index 0a6d2ca03cea..b42dcfcbee44 100644
--- a/trunk/MAINTAINERS
+++ b/trunk/MAINTAINERS
@@ -1240,20 +1240,6 @@ L: video4linux-list@redhat.com
W: http://linuxtv.org
S: Maintained
-CXGB3 ETHERNET DRIVER (CXGB3)
-P: Divy Le Ray
-M: divy@chelsio.com
-L: netdev@vger.kernel.org
-W: http://www.chelsio.com
-S: Supported
-
-CXGB3 IWARP RNIC DRIVER (IW_CXGB3)
-P: Steve Wise
-M: swise@chelsio.com
-L: general@lists.openfabrics.org
-W: http://www.openfabrics.org
-S: Supported
-
CYBERPRO FB DRIVER
P: Russell King
M: rmk@arm.linux.org.uk
@@ -4375,14 +4361,6 @@ M: gregkh@suse.de
L: linux-kernel@vger.kernel.org
S: Maintained
-UTIL-LINUX-NG PACKAGE
-P: Karel Zak
-M: kzak@redhat.com
-L: util-linux-ng@vger.kernel.org
-W: http://kernel.org/~kzak/util-linux-ng/
-T: git://git.kernel.org/pub/scm/utils/util-linux-ng/util-linux-ng.git
-S: Maintained
-
VFAT/FAT/MSDOS FILESYSTEM:
P: OGAWA Hirofumi
M: hirofumi@mail.parknet.co.jp
diff --git a/trunk/arch/arm/mach-at91/at91x40.c b/trunk/arch/arm/mach-at91/at91x40.c
index f44647738ee4..1de121fc55f4 100644
--- a/trunk/arch/arm/mach-at91/at91x40.c
+++ b/trunk/arch/arm/mach-at91/at91x40.c
@@ -16,32 +16,16 @@
#include
#include
#include
-#include
#include "generic.h"
/*
- * Export the clock functions for the AT91X40. Some external code common
- * to all AT91 family parts relys on this, like the gpio and serial support.
+ * This is used in the gpio code, stub locally.
*/
int clk_enable(struct clk *clk)
{
return 0;
}
-void clk_disable(struct clk *clk)
-{
-}
-
-unsigned long clk_get_rate(struct clk *clk)
-{
- return AT91X40_MASTER_CLOCK;
-}
-
-struct clk *clk_get(struct device *dev, const char *id)
-{
- return NULL;
-}
-
void __init at91x40_initialize(unsigned long main_clock)
{
at91_extern_irq = (1 << AT91X40_ID_IRQ0) | (1 << AT91X40_ID_IRQ1)
diff --git a/trunk/arch/arm/mach-integrator/impd1.c b/trunk/arch/arm/mach-integrator/impd1.c
index 62e653a3ea1a..92d79fb39311 100644
--- a/trunk/arch/arm/mach-integrator/impd1.c
+++ b/trunk/arch/arm/mach-integrator/impd1.c
@@ -369,8 +369,7 @@ static int impd1_probe(struct lm_device *dev)
lm_set_drvdata(dev, impd1);
- printk("IM-PD1 found at 0x%08lx\n",
- (unsigned long)dev->resource.start);
+ printk("IM-PD1 found at 0x%08lx\n", dev->resource.start);
for (i = 0; i < ARRAY_SIZE(impd1->vcos); i++) {
impd1->vcos[i].owner = THIS_MODULE,
diff --git a/trunk/arch/arm/mach-integrator/pci_v3.c b/trunk/arch/arm/mach-integrator/pci_v3.c
index c07f497000ca..d55fa4e9bb43 100644
--- a/trunk/arch/arm/mach-integrator/pci_v3.c
+++ b/trunk/arch/arm/mach-integrator/pci_v3.c
@@ -405,6 +405,7 @@ v3_pci_fault(unsigned long addr, unsigned int fsr, struct pt_regs *regs)
addr, fsr, pc, instr, __raw_readl(SC_LBFADDR), __raw_readl(SC_LBFCODE) & 255,
v3_readb(V3_LB_ISTAT));
printk(KERN_DEBUG "%s", buf);
+ printascii(buf);
#endif
v3_writeb(V3_LB_ISTAT, 0);
@@ -446,7 +447,6 @@ static irqreturn_t v3_irq(int dummy, void *devid)
unsigned long pc = instruction_pointer(regs);
unsigned long instr = *(unsigned long *)pc;
char buf[128];
- extern void printascii(const char *);
sprintf(buf, "V3 int %d: pc=0x%08lx [%08lx] LBFADDR=%08x LBFCODE=%02x "
"ISTAT=%02x\n", IRQ_AP_V3INT, pc, instr,
diff --git a/trunk/arch/arm/mach-omap1/board-palmte.c b/trunk/arch/arm/mach-omap1/board-palmte.c
index a4d20127a60e..a0b16a7e8a04 100644
--- a/trunk/arch/arm/mach-omap1/board-palmte.c
+++ b/trunk/arch/arm/mach-omap1/board-palmte.c
@@ -24,6 +24,7 @@
#include
#include
#include
+#include
#include
#include
@@ -314,6 +315,14 @@ static void palmte_get_power_status(struct apm_power_info *info, int *battery)
#define palmte_get_power_status NULL
#endif
+static struct tsc2102_config palmte_tsc2102_config = {
+ .use_internal = 0,
+ .monitor = TSC_BAT1 | TSC_AUX | TSC_TEMP,
+ .temp_at25c = { 2200, 2615 },
+ .apm_report = palmte_get_power_status,
+ .alsa_config = &palmte_alsa_config,
+};
+
static struct omap_board_config_kernel palmte_config[] __initdata = {
{ OMAP_TAG_USB, &palmte_usb_config },
{ OMAP_TAG_MMC, &palmte_mmc_config },
@@ -327,6 +336,7 @@ static struct spi_board_info palmte_spi_info[] __initdata = {
.bus_num = 2, /* uWire (officially) */
.chip_select = 0, /* As opposed to 3 */
.irq = OMAP_GPIO_IRQ(PALMTE_PINTDAV_GPIO),
+ .platform_data = &palmte_tsc2102_config,
.max_speed_hz = 8000000,
},
};
diff --git a/trunk/arch/arm/mach-pxa/spitz.c b/trunk/arch/arm/mach-pxa/spitz.c
index e7d0fcd9b43f..dace3820f1ee 100644
--- a/trunk/arch/arm/mach-pxa/spitz.c
+++ b/trunk/arch/arm/mach-pxa/spitz.c
@@ -38,6 +38,7 @@
#include
#include
#include
+#include
#include
#include
#include
diff --git a/trunk/arch/arm/mach-s3c2410/mach-bast.c b/trunk/arch/arm/mach-s3c2410/mach-bast.c
index 27f63d5d3a7b..661a2358ac22 100644
--- a/trunk/arch/arm/mach-s3c2410/mach-bast.c
+++ b/trunk/arch/arm/mach-s3c2410/mach-bast.c
@@ -374,7 +374,7 @@ static struct resource bast_dm9k_resource[] = {
[2] = {
.start = IRQ_DM9000,
.end = IRQ_DM9000,
- .flags = IORESOURCE_IRQ | IRQF_TRIGGER_HIGH,
+ .flags = IORESOURCE_IRQ,
}
};
diff --git a/trunk/arch/arm/mach-s3c2410/mach-vr1000.c b/trunk/arch/arm/mach-s3c2410/mach-vr1000.c
index 4c4b5c4207c4..c56423373ff3 100644
--- a/trunk/arch/arm/mach-s3c2410/mach-vr1000.c
+++ b/trunk/arch/arm/mach-s3c2410/mach-vr1000.c
@@ -263,7 +263,7 @@ static struct resource vr1000_dm9k0_resource[] = {
[2] = {
.start = IRQ_VR1000_DM9000A,
.end = IRQ_VR1000_DM9000A,
- .flags = IORESOURCE_IRQ | IRQF_TRIGGER_HIGH,
+ .flags = IORESOURCE_IRQ
}
};
@@ -282,7 +282,7 @@ static struct resource vr1000_dm9k1_resource[] = {
[2] = {
.start = IRQ_VR1000_DM9000N,
.end = IRQ_VR1000_DM9000N,
- .flags = IORESOURCE_IRQ | IRQF_TRIGGER_HIGH,
+ .flags = IORESOURCE_IRQ
}
};
diff --git a/trunk/arch/arm/mach-sa1100/collie.c b/trunk/arch/arm/mach-sa1100/collie.c
index 2f772a3965c4..6496eb645cee 100644
--- a/trunk/arch/arm/mach-sa1100/collie.c
+++ b/trunk/arch/arm/mach-sa1100/collie.c
@@ -225,28 +225,26 @@ static void __init collie_init(void)
int ret = 0;
/* cpu initialize */
- GAFR = GPIO_SSP_TXD | GPIO_SSP_SCLK | GPIO_SSP_SFRM | GPIO_SSP_CLK |
- GPIO_MCP_CLK | GPIO_32_768kHz;
-
- GPDR = GPIO_LDD8 | GPIO_LDD9 | GPIO_LDD10 | GPIO_LDD11 | GPIO_LDD12 |
- GPIO_LDD13 | GPIO_LDD14 | GPIO_LDD15 | GPIO_SSP_TXD |
- GPIO_SSP_SCLK | GPIO_SSP_SFRM | GPIO_SDLC_SCLK |
- COLLIE_GPIO_UCB1x00_RESET | COLLIE_GPIO_nMIC_ON |
- COLLIE_GPIO_nREMOCON_ON | GPIO_32_768kHz;
-
- PPDR = PPC_LDD0 | PPC_LDD1 | PPC_LDD2 | PPC_LDD3 | PPC_LDD4 | PPC_LDD5 |
- PPC_LDD6 | PPC_LDD7 | PPC_L_PCLK | PPC_L_LCLK | PPC_L_FCLK | PPC_L_BIAS |
- PPC_TXD1 | PPC_TXD2 | PPC_TXD3 | PPC_TXD4 | PPC_SCLK | PPC_SFRM;
-
- PWER = COLLIE_GPIO_AC_IN | COLLIE_GPIO_CO | COLLIE_GPIO_ON_KEY |
- COLLIE_GPIO_WAKEUP | COLLIE_GPIO_nREMOCON_INT | PWER_RTC;
-
- PGSR = COLLIE_GPIO_nREMOCON_ON;
-
- PSDR = PPC_RXD1 | PPC_RXD2 | PPC_RXD3 | PPC_RXD4;
-
- PCFR = PCFR_OPDE;
-
+ GAFR = ( GPIO_SSP_TXD | \
+ GPIO_SSP_SCLK | GPIO_SSP_SFRM | GPIO_SSP_CLK | GPIO_TIC_ACK | \
+ GPIO_32_768kHz );
+
+ GPDR = ( GPIO_LDD8 | GPIO_LDD9 | GPIO_LDD10 | GPIO_LDD11 | GPIO_LDD12 | \
+ GPIO_LDD13 | GPIO_LDD14 | GPIO_LDD15 | GPIO_SSP_TXD | \
+ GPIO_SSP_SCLK | GPIO_SSP_SFRM | GPIO_SDLC_SCLK | \
+ GPIO_SDLC_AAF | GPIO_UART_SCLK1 | GPIO_32_768kHz );
+ GPLR = GPIO_GPIO18;
+
+ // PPC pin setting
+ PPDR = ( PPC_LDD0 | PPC_LDD1 | PPC_LDD2 | PPC_LDD3 | PPC_LDD4 | PPC_LDD5 | \
+ PPC_LDD6 | PPC_LDD7 | PPC_L_PCLK | PPC_L_LCLK | PPC_L_FCLK | PPC_L_BIAS | \
+ PPC_TXD1 | PPC_TXD2 | PPC_RXD2 | PPC_TXD3 | PPC_TXD4 | PPC_SCLK | PPC_SFRM );
+
+ PSDR = ( PPC_RXD1 | PPC_RXD2 | PPC_RXD3 | PPC_RXD4 );
+
+ GAFR |= GPIO_32_768kHz;
+ GPDR |= GPIO_32_768kHz;
+ TUCR = TUCR_32_768kHz;
platform_scoop_config = &collie_pcmcia_config;
diff --git a/trunk/arch/arm/plat-omap/clock.c b/trunk/arch/arm/plat-omap/clock.c
index 2db5580048d8..2946c193a7d6 100644
--- a/trunk/arch/arm/plat-omap/clock.c
+++ b/trunk/arch/arm/plat-omap/clock.c
@@ -21,7 +21,6 @@
#include
#include
#include
-#include
#include
diff --git a/trunk/arch/arm/plat-s3c24xx/s3c244x.c b/trunk/arch/arm/plat-s3c24xx/s3c244x.c
index 2f01af5f64c4..f197bb3a2366 100644
--- a/trunk/arch/arm/plat-s3c24xx/s3c244x.c
+++ b/trunk/arch/arm/plat-s3c24xx/s3c244x.c
@@ -65,7 +65,6 @@ void __init s3c244x_map_io(struct map_desc *mach_desc, int size)
/* rename any peripherals used differing from the s3c2410 */
- s3c_device_sdi.name = "s3c2440-sdi";
s3c_device_i2c.name = "s3c2440-i2c";
s3c_device_nand.name = "s3c2440-nand";
s3c_device_usbgadget.name = "s3c2440-usbgadget";
diff --git a/trunk/arch/frv/mm/init.c b/trunk/arch/frv/mm/init.c
index 9af7740f32fb..b841ecfd5d5a 100644
--- a/trunk/arch/frv/mm/init.c
+++ b/trunk/arch/frv/mm/init.c
@@ -26,7 +26,6 @@
#include
#include
#include
-#include
#include
#include
@@ -57,9 +56,7 @@ DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
*/
static unsigned long empty_bad_page_table;
static unsigned long empty_bad_page;
-
unsigned long empty_zero_page;
-EXPORT_SYMBOL(empty_zero_page);
/*****************************************************************************/
/*
diff --git a/trunk/arch/powerpc/kernel/prom_init_check.sh b/trunk/arch/powerpc/kernel/prom_init_check.sh
index 31729a9387df..8e24fc1821e8 100644
--- a/trunk/arch/powerpc/kernel/prom_init_check.sh
+++ b/trunk/arch/powerpc/kernel/prom_init_check.sh
@@ -20,7 +20,7 @@ WHITELIST="add_reloc_offset __bss_start __bss_stop copy_and_flush
_end enter_prom memcpy memset reloc_offset __secondary_hold
__secondary_hold_acknowledge __secondary_hold_spinloop __start
strcmp strcpy strlcpy strlen strncmp strstr logo_linux_clut224
-reloc_got2 kernstart_addr"
+reloc_got2"
NM="$1"
OBJ="$2"
diff --git a/trunk/arch/powerpc/mm/pgtable_32.c b/trunk/arch/powerpc/mm/pgtable_32.c
index e0ff59f21135..80d1babb230d 100644
--- a/trunk/arch/powerpc/mm/pgtable_32.c
+++ b/trunk/arch/powerpc/mm/pgtable_32.c
@@ -402,7 +402,7 @@ void __set_fixmap (enum fixed_addresses idx, phys_addr_t phys, pgprot_t flags)
return;
}
- map_page(address, phys, pgprot_val(flags));
+ map_page(address, phys, flags);
fixmaps++;
}
diff --git a/trunk/arch/powerpc/platforms/ps3/mm.c b/trunk/arch/powerpc/platforms/ps3/mm.c
index 3a58ffabccd9..5b3fb2b321ab 100644
--- a/trunk/arch/powerpc/platforms/ps3/mm.c
+++ b/trunk/arch/powerpc/platforms/ps3/mm.c
@@ -317,9 +317,6 @@ static int __init ps3_mm_add_memory(void)
return result;
}
- lmb_add(start_addr, map.r1.size);
- lmb_analyze();
-
result = online_pages(start_pfn, nr_pages);
if (result)
diff --git a/trunk/arch/powerpc/sysdev/mpic.c b/trunk/arch/powerpc/sysdev/mpic.c
index 7680001676a6..8619f2a3f1f6 100644
--- a/trunk/arch/powerpc/sysdev/mpic.c
+++ b/trunk/arch/powerpc/sysdev/mpic.c
@@ -1331,9 +1331,6 @@ void mpic_irq_set_priority(unsigned int irq, unsigned int pri)
unsigned long flags;
u32 reg;
- if (!mpic)
- return;
-
spin_lock_irqsave(&mpic_lock, flags);
if (is_ipi) {
reg = mpic_ipi_read(src - mpic->ipi_vecs[0]) &
@@ -1349,6 +1346,23 @@ void mpic_irq_set_priority(unsigned int irq, unsigned int pri)
spin_unlock_irqrestore(&mpic_lock, flags);
}
+unsigned int mpic_irq_get_priority(unsigned int irq)
+{
+ unsigned int is_ipi;
+ struct mpic *mpic = mpic_find(irq, &is_ipi);
+ unsigned int src = mpic_irq_to_hw(irq);
+ unsigned long flags;
+ u32 reg;
+
+ spin_lock_irqsave(&mpic_lock, flags);
+ if (is_ipi)
+ reg = mpic_ipi_read(src = mpic->ipi_vecs[0]);
+ else
+ reg = mpic_irq_read(src, MPIC_INFO(IRQ_VECTOR_PRI));
+ spin_unlock_irqrestore(&mpic_lock, flags);
+ return (reg & MPIC_VECPRI_PRIORITY_MASK) >> MPIC_VECPRI_PRIORITY_SHIFT;
+}
+
void mpic_setup_this_cpu(void)
{
#ifdef CONFIG_SMP
diff --git a/trunk/arch/x86/boot/printf.c b/trunk/arch/x86/boot/printf.c
index 50e47cdbdddd..c1d00c0274c4 100644
--- a/trunk/arch/x86/boot/printf.c
+++ b/trunk/arch/x86/boot/printf.c
@@ -56,7 +56,7 @@ static char *number(char *str, long num, int base, int size, int precision,
if (type & LEFT)
type &= ~ZEROPAD;
if (base < 2 || base > 36)
- return NULL;
+ return 0;
c = (type & ZEROPAD) ? '0' : ' ';
sign = 0;
if (type & SIGN) {
diff --git a/trunk/arch/x86/kernel/apic_64.c b/trunk/arch/x86/kernel/apic_64.c
index 0633cfd0dc29..5910020c3f24 100644
--- a/trunk/arch/x86/kernel/apic_64.c
+++ b/trunk/arch/x86/kernel/apic_64.c
@@ -534,7 +534,7 @@ int setup_profiling_timer(unsigned int multiplier)
*/
void clear_local_APIC(void)
{
- int maxlvt;
+ int maxlvt = lapic_get_maxlvt();
u32 v;
/* APIC hasn't been mapped yet */
diff --git a/trunk/arch/x86/kernel/cpu/cpufreq/longrun.c b/trunk/arch/x86/kernel/cpu/cpufreq/longrun.c
index 777a7ff075de..af4a867a097c 100644
--- a/trunk/arch/x86/kernel/cpu/cpufreq/longrun.c
+++ b/trunk/arch/x86/kernel/cpu/cpufreq/longrun.c
@@ -245,7 +245,7 @@ static unsigned int __init longrun_determine_freqs(unsigned int *low_freq,
if ((ecx > 95) || (ecx == 0) || (eax < ebx))
return -EIO;
- edx = ((eax - ebx) * 100) / (100 - ecx);
+ edx = (eax - ebx) / (100 - ecx);
*low_freq = edx * 1000; /* back to kHz */
dprintk("low frequency is %u kHz\n", *low_freq);
diff --git a/trunk/arch/x86/kernel/cpu/cpufreq/powernow-k8.c b/trunk/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
index 206791eb46e3..46d4034d9f37 100644
--- a/trunk/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
+++ b/trunk/arch/x86/kernel/cpu/cpufreq/powernow-k8.c
@@ -1127,23 +1127,12 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol)
* an UP version, and is deprecated by AMD.
*/
if (num_online_cpus() != 1) {
-#ifndef CONFIG_ACPI_PROCESSOR
- printk(KERN_ERR PFX "ACPI Processor support is required "
- "for SMP systems but is absent. Please load the "
- "ACPI Processor module before starting this "
- "driver.\n");
-#else
- printk(KERN_ERR PFX "Your BIOS does not provide ACPI "
- "_PSS objects in a way that Linux understands. "
- "Please report this to the Linux ACPI maintainers"
- " and complain to your BIOS vendor.\n");
-#endif
+ printk(KERN_ERR PFX "MP systems not supported by PSB BIOS structure\n");
kfree(data);
return -ENODEV;
}
if (pol->cpu != 0) {
- printk(KERN_ERR PFX "No ACPI _PSS objects for CPU other than "
- "CPU0. Complain to your BIOS vendor.\n");
+ printk(KERN_ERR PFX "No _PSS objects for CPU other than CPU0\n");
kfree(data);
return -ENODEV;
}
diff --git a/trunk/arch/x86/kernel/kvmclock.c b/trunk/arch/x86/kernel/kvmclock.c
index 08a30986d472..4bc1be5d5472 100644
--- a/trunk/arch/x86/kernel/kvmclock.c
+++ b/trunk/arch/x86/kernel/kvmclock.c
@@ -53,7 +53,7 @@ static cycle_t kvm_clock_read(void);
* have elapsed since the hypervisor wrote the data. So we try to account for
* that with system time
*/
-static unsigned long kvm_get_wallclock(void)
+unsigned long kvm_get_wallclock(void)
{
u32 wc_sec, wc_nsec;
u64 delta;
@@ -86,7 +86,7 @@ static unsigned long kvm_get_wallclock(void)
return ts.tv_sec + 1;
}
-static int kvm_set_wallclock(unsigned long now)
+int kvm_set_wallclock(unsigned long now)
{
return 0;
}
diff --git a/trunk/arch/x86/kernel/tsc_32.c b/trunk/arch/x86/kernel/tsc_32.c
index 068759db63dd..e4790728b224 100644
--- a/trunk/arch/x86/kernel/tsc_32.c
+++ b/trunk/arch/x86/kernel/tsc_32.c
@@ -14,7 +14,7 @@
#include "mach_timer.h"
-static int tsc_disabled;
+static int tsc_enabled;
/*
* On some systems the TSC frequency does not
@@ -28,8 +28,8 @@ EXPORT_SYMBOL_GPL(tsc_khz);
static int __init tsc_setup(char *str)
{
printk(KERN_WARNING "notsc: Kernel compiled with CONFIG_X86_TSC, "
- "cannot disable TSC completely.\n");
- tsc_disabled = 1;
+ "cannot disable TSC completely.\n");
+ mark_tsc_unstable("user disabled TSC");
return 1;
}
#else
@@ -120,7 +120,7 @@ unsigned long long native_sched_clock(void)
* very important for it to be as fast as the platform
* can achive it. )
*/
- if (unlikely(tsc_disabled))
+ if (unlikely(!tsc_enabled && !tsc_unstable))
/* No locking but a rare wrong value is not a big deal: */
return (jiffies_64 - INITIAL_JIFFIES) * (1000000000 / HZ);
@@ -322,6 +322,7 @@ void mark_tsc_unstable(char *reason)
{
if (!tsc_unstable) {
tsc_unstable = 1;
+ tsc_enabled = 0;
printk("Marking TSC unstable due to: %s.\n", reason);
/* Can be called before registration */
if (clocksource_tsc.mult)
@@ -335,7 +336,7 @@ EXPORT_SYMBOL_GPL(mark_tsc_unstable);
static int __init dmi_mark_tsc_unstable(const struct dmi_system_id *d)
{
printk(KERN_NOTICE "%s detected: marking TSC unstable.\n",
- d->ident);
+ d->ident);
tsc_unstable = 1;
return 0;
}
@@ -402,22 +403,14 @@ void __init tsc_init(void)
{
int cpu;
- if (!cpu_has_tsc || tsc_disabled) {
- /* Disable the TSC in case of !cpu_has_tsc */
- tsc_disabled = 1;
+ if (!cpu_has_tsc)
return;
- }
cpu_khz = calculate_cpu_khz();
tsc_khz = cpu_khz;
if (!cpu_khz) {
mark_tsc_unstable("could not calculate TSC khz");
- /*
- * We need to disable the TSC completely in this case
- * to prevent sched_clock() from using it.
- */
- tsc_disabled = 1;
return;
}
@@ -448,6 +441,8 @@ void __init tsc_init(void)
if (check_tsc_unstable()) {
clocksource_tsc.rating = 0;
clocksource_tsc.flags &= ~CLOCK_SOURCE_IS_CONTINUOUS;
- }
+ } else
+ tsc_enabled = 1;
+
clocksource_register(&clocksource_tsc);
}
diff --git a/trunk/arch/x86/kernel/tsc_64.c b/trunk/arch/x86/kernel/tsc_64.c
index 1784b8077a12..fcc16e58609e 100644
--- a/trunk/arch/x86/kernel/tsc_64.c
+++ b/trunk/arch/x86/kernel/tsc_64.c
@@ -227,14 +227,14 @@ void __init tsc_calibrate(void)
/* hpet or pmtimer available ? */
if (!hpet && !pm1 && !pm2) {
printk(KERN_INFO "TSC calibrated against PIT\n");
- goto out;
+ return;
}
/* Check, whether the sampling was disturbed by an SMI */
if (tsc1 == ULONG_MAX || tsc2 == ULONG_MAX) {
printk(KERN_WARNING "TSC calibration disturbed by SMI, "
"using PIT calibration result\n");
- goto out;
+ return;
}
tsc2 = (tsc2 - tsc1) * 1000000L;
@@ -255,7 +255,6 @@ void __init tsc_calibrate(void)
tsc_khz = tsc2 / tsc1;
-out:
for_each_possible_cpu(cpu)
set_cyc2ns_scale(tsc_khz, cpu);
}
diff --git a/trunk/arch/x86/kvm/mmu.c b/trunk/arch/x86/kvm/mmu.c
index 7246b60afb96..36c5406b1813 100644
--- a/trunk/arch/x86/kvm/mmu.c
+++ b/trunk/arch/x86/kvm/mmu.c
@@ -1996,7 +1996,7 @@ static struct shrinker mmu_shrinker = {
.seeks = DEFAULT_SEEKS * 10,
};
-static void mmu_destroy_caches(void)
+void mmu_destroy_caches(void)
{
if (pte_chain_cache)
kmem_cache_destroy(pte_chain_cache);
diff --git a/trunk/arch/x86/vdso/vclock_gettime.c b/trunk/arch/x86/vdso/vclock_gettime.c
index efa2ba7c6005..23476c2ebfc4 100644
--- a/trunk/arch/x86/vdso/vclock_gettime.c
+++ b/trunk/arch/x86/vdso/vclock_gettime.c
@@ -106,9 +106,9 @@ int __vdso_gettimeofday(struct timeval *tv, struct timezone *tz)
do_realtime((struct timespec *)tv);
tv->tv_usec /= 1000;
if (unlikely(tz != NULL)) {
- /* Avoid memcpy. Some old compilers fail to inline it */
- tz->tz_minuteswest = gtod->sys_tz.tz_minuteswest;
- tz->tz_dsttime = gtod->sys_tz.tz_dsttime;
+ /* This relies on gcc inlining the memcpy. We'll notice
+ if it ever fails to do so. */
+ memcpy(tz, >od->sys_tz, sizeof(struct timezone));
}
return 0;
}
diff --git a/trunk/arch/x86/xen/mmu.c b/trunk/arch/x86/xen/mmu.c
index 3525ef523a74..126766d43aea 100644
--- a/trunk/arch/x86/xen/mmu.c
+++ b/trunk/arch/x86/xen/mmu.c
@@ -60,7 +60,7 @@ xmaddr_t arbitrary_virt_to_machine(unsigned long address)
{
unsigned int level;
pte_t *pte = lookup_address(address, &level);
- unsigned offset = address & ~PAGE_MASK;
+ unsigned offset = address & PAGE_MASK;
BUG_ON(pte == NULL);
diff --git a/trunk/drivers/acpi/dispatcher/dsmethod.c b/trunk/drivers/acpi/dispatcher/dsmethod.c
index 2509809a36cf..e48a3ea03117 100644
--- a/trunk/drivers/acpi/dispatcher/dsmethod.c
+++ b/trunk/drivers/acpi/dispatcher/dsmethod.c
@@ -565,7 +565,7 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
acpi_os_release_mutex(method_desc->method.
mutex->mutex.os_mutex);
- method_desc->method.mutex->mutex.thread_id = NULL;
+ method_desc->method.mutex->mutex.thread_id = 0;
}
}
diff --git a/trunk/drivers/acpi/executer/exmutex.c b/trunk/drivers/acpi/executer/exmutex.c
index a8bf3d713e28..c873ab40cd0e 100644
--- a/trunk/drivers/acpi/executer/exmutex.c
+++ b/trunk/drivers/acpi/executer/exmutex.c
@@ -326,7 +326,7 @@ acpi_status acpi_ex_release_mutex_object(union acpi_operand_object *obj_desc)
/* Clear mutex info */
- obj_desc->mutex.thread_id = NULL;
+ obj_desc->mutex.thread_id = 0;
return_ACPI_STATUS(status);
}
@@ -463,7 +463,7 @@ void acpi_ex_release_all_mutexes(struct acpi_thread_state *thread)
/* Mark mutex unowned */
obj_desc->mutex.owner_thread = NULL;
- obj_desc->mutex.thread_id = NULL;
+ obj_desc->mutex.thread_id = 0;
/* Update Thread sync_level (Last mutex is the important one) */
diff --git a/trunk/drivers/block/brd.c b/trunk/drivers/block/brd.c
index 680cdfc00b90..a196ef7f147f 100644
--- a/trunk/drivers/block/brd.c
+++ b/trunk/drivers/block/brd.c
@@ -447,7 +447,6 @@ static struct brd_device *brd_alloc(int i)
disk->fops = &brd_fops;
disk->private_data = brd;
disk->queue = brd->brd_queue;
- disk->flags |= GENHD_FL_SUPPRESS_PARTITION_INFO;
sprintf(disk->disk_name, "ram%d", i);
set_capacity(disk, rd_size * 2);
diff --git a/trunk/drivers/block/viodasd.c b/trunk/drivers/block/viodasd.c
index f1c8feb5510b..ebfe038d859e 100644
--- a/trunk/drivers/block/viodasd.c
+++ b/trunk/drivers/block/viodasd.c
@@ -3,7 +3,7 @@
* Authors: Dave Boutcher
* Ryan Arnold
* Colin Devilbiss
- * Stephen Rothwell
+ * Stephen Rothwell
*
* (C) Copyright 2000-2004 IBM Corporation
*
diff --git a/trunk/drivers/cdrom/viocd.c b/trunk/drivers/cdrom/viocd.c
index 9d0dfe6e0d63..5245a4a0ba74 100644
--- a/trunk/drivers/cdrom/viocd.c
+++ b/trunk/drivers/cdrom/viocd.c
@@ -6,7 +6,7 @@
* Authors: Dave Boutcher
* Ryan Arnold
* Colin Devilbiss
- * Stephen Rothwell
+ * Stephen Rothwell
*
* (C) Copyright 2000-2004 IBM Corporation
*
diff --git a/trunk/drivers/char/drm/drm_sysfs.c b/trunk/drivers/char/drm/drm_sysfs.c
index af211a0ef179..9a32169e88fb 100644
--- a/trunk/drivers/char/drm/drm_sysfs.c
+++ b/trunk/drivers/char/drm/drm_sysfs.c
@@ -34,6 +34,8 @@ static int drm_sysfs_suspend(struct device *dev, pm_message_t state)
struct drm_minor *drm_minor = to_drm_minor(dev);
struct drm_device *drm_dev = drm_minor->dev;
+ printk(KERN_ERR "%s\n", __func__);
+
if (drm_dev->driver->suspend)
return drm_dev->driver->suspend(drm_dev, state);
diff --git a/trunk/drivers/char/ip2/Makefile b/trunk/drivers/char/ip2/Makefile
index 939618f62fe1..6bfe2543ddc2 100644
--- a/trunk/drivers/char/ip2/Makefile
+++ b/trunk/drivers/char/ip2/Makefile
@@ -2,7 +2,7 @@
# Makefile for the Computone IntelliPort Plus Driver
#
-obj-$(CONFIG_COMPUTONE) += ip2.o
+obj-$(CONFIG_COMPUTONE) += ip2.o ip2main.o
-ip2-objs := ip2base.o ip2main.o
+ip2-objs := ip2base.o
diff --git a/trunk/drivers/char/ip2/ip2main.c b/trunk/drivers/char/ip2/ip2main.c
index c12cf8fc4be0..70957acaa960 100644
--- a/trunk/drivers/char/ip2/ip2main.c
+++ b/trunk/drivers/char/ip2/ip2main.c
@@ -345,6 +345,27 @@ have_requested_irq( char irq )
return 0;
}
+/******************************************************************************/
+/* Function: init_module() */
+/* Parameters: None */
+/* Returns: Success (0) */
+/* */
+/* Description: */
+/* This is a required entry point for an installable module. It simply calls */
+/* the driver initialisation function and returns what it returns. */
+/******************************************************************************/
+#ifdef MODULE
+static int __init
+ip2_init_module(void)
+{
+#ifdef IP2DEBUG_INIT
+ printk (KERN_DEBUG "Loading module ...\n" );
+#endif
+ return 0;
+}
+module_init(ip2_init_module);
+#endif /* MODULE */
+
/******************************************************************************/
/* Function: cleanup_module() */
/* Parameters: None */
@@ -758,6 +779,8 @@ ip2_loadmain(int *iop, int *irqp, unsigned char *firmware, int firmsize)
return err;
}
+EXPORT_SYMBOL(ip2_loadmain);
+
/******************************************************************************/
/* Function: ip2_init_board() */
/* Parameters: Index of board in configuration structure */
diff --git a/trunk/drivers/char/viocons.c b/trunk/drivers/char/viocons.c
index 65fb848e1cce..3d3e1c2b310f 100644
--- a/trunk/drivers/char/viocons.c
+++ b/trunk/drivers/char/viocons.c
@@ -7,7 +7,7 @@
* Authors: Dave Boutcher
* Ryan Arnold
* Colin Devilbiss
- * Stephen Rothwell
+ * Stephen Rothwell
*
* (C) Copyright 2000, 2001, 2002, 2003, 2004 IBM Corporation
*
diff --git a/trunk/drivers/char/viotape.c b/trunk/drivers/char/viotape.c
index c39ddaff5e8f..58aad63831f4 100644
--- a/trunk/drivers/char/viotape.c
+++ b/trunk/drivers/char/viotape.c
@@ -6,7 +6,7 @@
* Authors: Dave Boutcher
* Ryan Arnold
* Colin Devilbiss
- * Stephen Rothwell
+ * Stephen Rothwell
*
* (C) Copyright 2000-2004 IBM Corporation
*
diff --git a/trunk/drivers/cpufreq/freq_table.c b/trunk/drivers/cpufreq/freq_table.c
index b64c6bc445e3..ae6cd60d5c14 100644
--- a/trunk/drivers/cpufreq/freq_table.c
+++ b/trunk/drivers/cpufreq/freq_table.c
@@ -2,11 +2,6 @@
* linux/drivers/cpufreq/freq_table.c
*
* Copyright (C) 2002 - 2003 Dominik Brodowski
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
*/
#include
diff --git a/trunk/drivers/edac/mpc85xx_edac.c b/trunk/drivers/edac/mpc85xx_edac.c
index d49361bfe670..065732ddf40c 100644
--- a/trunk/drivers/edac/mpc85xx_edac.c
+++ b/trunk/drivers/edac/mpc85xx_edac.c
@@ -20,6 +20,7 @@
#include
#include
+#include
#include "edac_module.h"
#include "edac_core.h"
#include "mpc85xx_edac.h"
@@ -42,6 +43,8 @@ static u32 orig_pci_err_en;
static u32 orig_l2_err_disable;
static u32 orig_hid1;
+static const char *mpc85xx_ctl_name = "MPC85xx";
+
/************************ MC SYSFS parts ***********************************/
static ssize_t mpc85xx_mc_inject_data_hi_show(struct mem_ctl_info *mci,
diff --git a/trunk/drivers/gpio/gpiolib.c b/trunk/drivers/gpio/gpiolib.c
index beaf6b3a37dc..7f138c6195ff 100644
--- a/trunk/drivers/gpio/gpiolib.c
+++ b/trunk/drivers/gpio/gpiolib.c
@@ -127,7 +127,7 @@ int __init gpiochip_reserve(int start, int ngpio)
unsigned long flags;
int i;
- if (!gpio_is_valid(start) || !gpio_is_valid(start + ngpio - 1))
+ if (!gpio_is_valid(start) || !gpio_is_valid(start + ngpio))
return -EINVAL;
spin_lock_irqsave(&gpio_lock, flags);
@@ -170,7 +170,7 @@ int gpiochip_add(struct gpio_chip *chip)
unsigned id;
int base = chip->base;
- if ((!gpio_is_valid(base) || !gpio_is_valid(base + chip->ngpio - 1))
+ if ((!gpio_is_valid(base) || !gpio_is_valid(base + chip->ngpio))
&& base >= 0) {
status = -EINVAL;
goto fail;
@@ -207,7 +207,7 @@ int gpiochip_add(struct gpio_chip *chip)
/* failures here can mean systems won't boot... */
if (status)
pr_err("gpiochip_add: gpios %d..%d (%s) not registered\n",
- chip->base, chip->base + chip->ngpio - 1,
+ chip->base, chip->base + chip->ngpio,
chip->label ? : "generic");
return status;
}
diff --git a/trunk/drivers/gpio/mcp23s08.c b/trunk/drivers/gpio/mcp23s08.c
index 7f92fdd5f0e2..7fb5b9d009d4 100644
--- a/trunk/drivers/gpio/mcp23s08.c
+++ b/trunk/drivers/gpio/mcp23s08.c
@@ -168,7 +168,7 @@ static void mcp23s08_dbg_show(struct seq_file *s, struct gpio_chip *chip)
{
struct mcp23s08 *mcp;
char bank;
- int t;
+ unsigned t;
unsigned mask;
mcp = container_of(chip, struct mcp23s08, chip);
diff --git a/trunk/drivers/gpio/pca953x.c b/trunk/drivers/gpio/pca953x.c
index 7e40e8a55edf..93f916720b13 100644
--- a/trunk/drivers/gpio/pca953x.c
+++ b/trunk/drivers/gpio/pca953x.c
@@ -30,7 +30,6 @@ static const struct i2c_device_id pca953x_id[] = {
{ "pca9537", 4, },
{ "pca9538", 8, },
{ "pca9539", 16, },
- { "pca9554", 8, },
{ "pca9555", 16, },
{ "pca9557", 8, },
/* REVISIT several pca955x parts should work here too */
diff --git a/trunk/drivers/hwmon/Kconfig b/trunk/drivers/hwmon/Kconfig
index 00ff53348491..4dc76bc45c9d 100644
--- a/trunk/drivers/hwmon/Kconfig
+++ b/trunk/drivers/hwmon/Kconfig
@@ -330,20 +330,6 @@ config SENSORS_CORETEMP
sensor inside your CPU. Supported all are all known variants
of Intel Core family.
-config SENSORS_IBMAEM
- tristate "IBM Active Energy Manager temperature/power sensors and control"
- select IPMI_SI
- depends on IPMI_HANDLER
- help
- If you say yes here you get support for the temperature and
- power sensors and capping hardware in various IBM System X
- servers that support Active Energy Manager. This includes
- the x3350, x3550, x3650, x3655, x3755, x3850 M2, x3950 M2,
- and certain HS2x/LS2x/QS2x blades.
-
- This driver can also be built as a module. If so, the module
- will be called ibmaem.
-
config SENSORS_IBMPEX
tristate "IBM PowerExecutive temperature/power sensors"
select IPMI_SI
diff --git a/trunk/drivers/hwmon/Makefile b/trunk/drivers/hwmon/Makefile
index d098677e08de..3bdb05a5cbd7 100644
--- a/trunk/drivers/hwmon/Makefile
+++ b/trunk/drivers/hwmon/Makefile
@@ -41,7 +41,6 @@ obj-$(CONFIG_SENSORS_GL518SM) += gl518sm.o
obj-$(CONFIG_SENSORS_GL520SM) += gl520sm.o
obj-$(CONFIG_SENSORS_HDAPS) += hdaps.o
obj-$(CONFIG_SENSORS_I5K_AMB) += i5k_amb.o
-obj-$(CONFIG_SENSORS_IBMAEM) += ibmaem.o
obj-$(CONFIG_SENSORS_IBMPEX) += ibmpex.o
obj-$(CONFIG_SENSORS_IT87) += it87.o
obj-$(CONFIG_SENSORS_K8TEMP) += k8temp.o
diff --git a/trunk/drivers/hwmon/hdaps.c b/trunk/drivers/hwmon/hdaps.c
index 88e89653daaf..bab5fd2e4dfd 100644
--- a/trunk/drivers/hwmon/hdaps.c
+++ b/trunk/drivers/hwmon/hdaps.c
@@ -515,7 +515,6 @@ static struct dmi_system_id __initdata hdaps_whitelist[] = {
HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad R50"),
HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad R51"),
HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad R52"),
- HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad R61i"),
HDAPS_DMI_MATCH_INVERT("IBM", "ThinkPad T41p"),
HDAPS_DMI_MATCH_NORMAL("IBM", "ThinkPad T41"),
HDAPS_DMI_MATCH_INVERT("IBM", "ThinkPad T42p"),
diff --git a/trunk/drivers/hwmon/i5k_amb.c b/trunk/drivers/hwmon/i5k_amb.c
index f9e2ed621f7b..6ac5c6f53585 100644
--- a/trunk/drivers/hwmon/i5k_amb.c
+++ b/trunk/drivers/hwmon/i5k_amb.c
@@ -111,7 +111,6 @@ struct i5k_amb_data {
void __iomem *amb_mmio;
struct i5k_device_attribute *attrs;
unsigned int num_attrs;
- unsigned long chipset_id;
};
static ssize_t show_name(struct device *dev, struct device_attribute *devattr,
@@ -383,8 +382,7 @@ static int __devinit i5k_amb_add(void)
return res;
}
-static int __devinit i5k_find_amb_registers(struct i5k_amb_data *data,
- unsigned long devid)
+static int __devinit i5k_find_amb_registers(struct i5k_amb_data *data)
{
struct pci_dev *pcidev;
u32 val32;
@@ -392,7 +390,7 @@ static int __devinit i5k_find_amb_registers(struct i5k_amb_data *data,
/* Find AMB register memory space */
pcidev = pci_get_device(PCI_VENDOR_ID_INTEL,
- devid,
+ PCI_DEVICE_ID_INTEL_5000_ERR,
NULL);
if (!pcidev)
return -ENODEV;
@@ -411,8 +409,6 @@ static int __devinit i5k_find_amb_registers(struct i5k_amb_data *data,
goto out;
}
- data->chipset_id = devid;
-
res = 0;
out:
pci_dev_put(pcidev);
@@ -445,30 +441,10 @@ static int __devinit i5k_channel_probe(u16 *amb_present, unsigned long dev_id)
return res;
}
-static unsigned long i5k_channel_pci_id(struct i5k_amb_data *data,
- unsigned long channel)
-{
- switch (data->chipset_id) {
- case PCI_DEVICE_ID_INTEL_5000_ERR:
- return PCI_DEVICE_ID_INTEL_5000_FBD0 + channel;
- case PCI_DEVICE_ID_INTEL_5400_ERR:
- return PCI_DEVICE_ID_INTEL_5400_FBD0 + channel;
- default:
- BUG();
- }
-}
-
-static unsigned long chipset_ids[] = {
- PCI_DEVICE_ID_INTEL_5000_ERR,
- PCI_DEVICE_ID_INTEL_5400_ERR,
- 0
-};
-
static int __devinit i5k_amb_probe(struct platform_device *pdev)
{
struct i5k_amb_data *data;
struct resource *reso;
- int i;
int res = -ENODEV;
data = kzalloc(sizeof(*data), GFP_KERNEL);
@@ -476,24 +452,19 @@ static int __devinit i5k_amb_probe(struct platform_device *pdev)
return -ENOMEM;
/* Figure out where the AMB registers live */
- i = 0;
- do {
- res = i5k_find_amb_registers(data, chipset_ids[i]);
- i++;
- } while (res && chipset_ids[i]);
-
+ res = i5k_find_amb_registers(data);
if (res)
goto err;
/* Copy the DIMM presence map for the first two channels */
res = i5k_channel_probe(&data->amb_present[0],
- i5k_channel_pci_id(data, 0));
+ PCI_DEVICE_ID_INTEL_5000_FBD0);
if (res)
goto err;
/* Copy the DIMM presence map for the optional second two channels */
i5k_channel_probe(&data->amb_present[2],
- i5k_channel_pci_id(data, 1));
+ PCI_DEVICE_ID_INTEL_5000_FBD1);
/* Set up resource regions */
reso = request_mem_region(data->amb_base, data->amb_len, DRVNAME);
diff --git a/trunk/drivers/hwmon/ibmaem.c b/trunk/drivers/hwmon/ibmaem.c
deleted file mode 100644
index 5c006c9a4311..000000000000
--- a/trunk/drivers/hwmon/ibmaem.c
+++ /dev/null
@@ -1,1111 +0,0 @@
-/*
- * A hwmon driver for the IBM Active Energy Manager temperature/power sensors
- * and capping functionality.
- * Copyright (C) 2008 IBM
- *
- * Author: Darrick J. Wong
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#define REFRESH_INTERVAL (HZ)
-#define IPMI_TIMEOUT (30 * HZ)
-#define DRVNAME "aem"
-
-#define AEM_NETFN 0x2E
-
-#define AEM_FIND_FW_CMD 0x80
-#define AEM_ELEMENT_CMD 0x81
-#define AEM_FW_INSTANCE_CMD 0x82
-
-#define AEM_READ_ELEMENT_CFG 0x80
-#define AEM_READ_BUFFER 0x81
-#define AEM_READ_REGISTER 0x82
-#define AEM_WRITE_REGISTER 0x83
-#define AEM_SET_REG_MASK 0x84
-#define AEM_CLEAR_REG_MASK 0x85
-#define AEM_READ_ELEMENT_CFG2 0x86
-
-#define AEM_CONTROL_ELEMENT 0
-#define AEM_ENERGY_ELEMENT 1
-#define AEM_CLOCK_ELEMENT 4
-#define AEM_POWER_CAP_ELEMENT 7
-#define AEM_EXHAUST_ELEMENT 9
-#define AEM_POWER_ELEMENT 10
-
-#define AEM_MODULE_TYPE_ID 0x0001
-
-#define AEM2_NUM_ENERGY_REGS 2
-#define AEM2_NUM_PCAP_REGS 6
-#define AEM2_NUM_TEMP_REGS 2
-#define AEM2_NUM_SENSORS 14
-
-#define AEM1_NUM_ENERGY_REGS 1
-#define AEM1_NUM_SENSORS 3
-
-/* AEM 2.x has more energy registers */
-#define AEM_NUM_ENERGY_REGS AEM2_NUM_ENERGY_REGS
-/* AEM 2.x needs more sensor files */
-#define AEM_NUM_SENSORS AEM2_NUM_SENSORS
-
-#define POWER_CAP 0
-#define POWER_CAP_MAX_HOTPLUG 1
-#define POWER_CAP_MAX 2
-#define POWER_CAP_MIN_WARNING 3
-#define POWER_CAP_MIN 4
-#define POWER_AUX 5
-
-#define AEM_DEFAULT_POWER_INTERVAL 1000
-#define AEM_MIN_POWER_INTERVAL 200
-#define UJ_PER_MJ 1000L
-
-static DEFINE_IDR(aem_idr);
-static DEFINE_SPINLOCK(aem_idr_lock);
-
-static struct device_driver aem_driver = {
- .name = DRVNAME,
- .bus = &platform_bus_type,
-};
-
-struct aem_ipmi_data {
- struct completion read_complete;
- struct ipmi_addr address;
- ipmi_user_t user;
- int interface;
-
- struct kernel_ipmi_msg tx_message;
- long tx_msgid;
-
- void *rx_msg_data;
- unsigned short rx_msg_len;
- unsigned char rx_result;
- int rx_recv_type;
-
- struct device *bmc_device;
-};
-
-struct aem_ro_sensor_template {
- char *label;
- ssize_t (*show)(struct device *dev,
- struct device_attribute *devattr,
- char *buf);
- int index;
-};
-
-struct aem_rw_sensor_template {
- char *label;
- ssize_t (*show)(struct device *dev,
- struct device_attribute *devattr,
- char *buf);
- ssize_t (*set)(struct device *dev,
- struct device_attribute *devattr,
- const char *buf, size_t count);
- int index;
-};
-
-struct aem_data {
- struct list_head list;
-
- struct device *hwmon_dev;
- struct platform_device *pdev;
- struct mutex lock;
- char valid;
- unsigned long last_updated; /* In jiffies */
- u8 ver_major;
- u8 ver_minor;
- u8 module_handle;
- int id;
- struct aem_ipmi_data ipmi;
-
- /* Function to update sensors */
- void (*update)(struct aem_data *data);
-
- /*
- * AEM 1.x sensors:
- * Available sensors:
- * Energy meter
- * Power meter
- *
- * AEM 2.x sensors:
- * Two energy meters
- * Two power meters
- * Two temperature sensors
- * Six power cap registers
- */
-
- /* sysfs attrs */
- struct sensor_device_attribute sensors[AEM_NUM_SENSORS];
-
- /* energy use in mJ */
- u64 energy[AEM_NUM_ENERGY_REGS];
-
- /* power sampling interval in ms */
- unsigned long power_period[AEM_NUM_ENERGY_REGS];
-
- /* Everything past here is for AEM2 only */
-
- /* power caps in dW */
- u16 pcap[AEM2_NUM_PCAP_REGS];
-
- /* exhaust temperature in C */
- u8 temp[AEM2_NUM_TEMP_REGS];
-};
-
-/* Data structures returned by the AEM firmware */
-struct aem_iana_id {
- u8 bytes[3];
-};
-static struct aem_iana_id system_x_id = {
- .bytes = {0x4D, 0x4F, 0x00}
-};
-
-/* These are used to find AEM1 instances */
-struct aem_find_firmware_req {
- struct aem_iana_id id;
- u8 rsvd;
- u16 index;
- u16 module_type_id;
-} __packed;
-
-struct aem_find_firmware_resp {
- struct aem_iana_id id;
- u8 num_instances;
-} __packed;
-
-/* These are used to find AEM2 instances */
-struct aem_find_instance_req {
- struct aem_iana_id id;
- u8 instance_number;
- u16 module_type_id;
-} __packed;
-
-struct aem_find_instance_resp {
- struct aem_iana_id id;
- u8 num_instances;
- u8 major;
- u8 minor;
- u8 module_handle;
- u16 record_id;
-} __packed;
-
-/* These are used to query sensors */
-struct aem_read_sensor_req {
- struct aem_iana_id id;
- u8 module_handle;
- u8 element;
- u8 subcommand;
- u8 reg;
- u8 rx_buf_size;
-} __packed;
-
-struct aem_read_sensor_resp {
- struct aem_iana_id id;
- u8 bytes[0];
-} __packed;
-
-/* Data structures to talk to the IPMI layer */
-struct aem_driver_data {
- struct list_head aem_devices;
- struct ipmi_smi_watcher bmc_events;
- struct ipmi_user_hndl ipmi_hndlrs;
-};
-
-static void aem_register_bmc(int iface, struct device *dev);
-static void aem_bmc_gone(int iface);
-static void aem_msg_handler(struct ipmi_recv_msg *msg, void *user_msg_data);
-
-static void aem_remove_sensors(struct aem_data *data);
-static int aem_init_aem1(struct aem_ipmi_data *probe);
-static int aem_init_aem2(struct aem_ipmi_data *probe);
-static int aem1_find_sensors(struct aem_data *data);
-static int aem2_find_sensors(struct aem_data *data);
-static void update_aem1_sensors(struct aem_data *data);
-static void update_aem2_sensors(struct aem_data *data);
-
-static struct aem_driver_data driver_data = {
- .aem_devices = LIST_HEAD_INIT(driver_data.aem_devices),
- .bmc_events = {
- .owner = THIS_MODULE,
- .new_smi = aem_register_bmc,
- .smi_gone = aem_bmc_gone,
- },
- .ipmi_hndlrs = {
- .ipmi_recv_hndl = aem_msg_handler,
- },
-};
-
-/* Functions to talk to the IPMI layer */
-
-/* Initialize IPMI address, message buffers and user data */
-static int aem_init_ipmi_data(struct aem_ipmi_data *data, int iface,
- struct device *bmc)
-{
- int err;
-
- init_completion(&data->read_complete);
- data->bmc_device = bmc;
-
- /* Initialize IPMI address */
- data->address.addr_type = IPMI_SYSTEM_INTERFACE_ADDR_TYPE;
- data->address.channel = IPMI_BMC_CHANNEL;
- data->address.data[0] = 0;
- data->interface = iface;
-
- /* Initialize message buffers */
- data->tx_msgid = 0;
- data->tx_message.netfn = AEM_NETFN;
-
- /* Create IPMI messaging interface user */
- err = ipmi_create_user(data->interface, &driver_data.ipmi_hndlrs,
- data, &data->user);
- if (err < 0) {
- dev_err(bmc, "Unable to register user with IPMI "
- "interface %d\n", data->interface);
- return -EACCES;
- }
-
- return 0;
-}
-
-/* Send an IPMI command */
-static int aem_send_message(struct aem_ipmi_data *data)
-{
- int err;
-
- err = ipmi_validate_addr(&data->address, sizeof(data->address));
- if (err)
- goto out;
-
- data->tx_msgid++;
- err = ipmi_request_settime(data->user, &data->address, data->tx_msgid,
- &data->tx_message, data, 0, 0, 0);
- if (err)
- goto out1;
-
- return 0;
-out1:
- dev_err(data->bmc_device, "request_settime=%x\n", err);
- return err;
-out:
- dev_err(data->bmc_device, "validate_addr=%x\n", err);
- return err;
-}
-
-/* Dispatch IPMI messages to callers */
-static void aem_msg_handler(struct ipmi_recv_msg *msg, void *user_msg_data)
-{
- unsigned short rx_len;
- struct aem_ipmi_data *data = user_msg_data;
-
- if (msg->msgid != data->tx_msgid) {
- dev_err(data->bmc_device, "Mismatch between received msgid "
- "(%02x) and transmitted msgid (%02x)!\n",
- (int)msg->msgid,
- (int)data->tx_msgid);
- ipmi_free_recv_msg(msg);
- return;
- }
-
- data->rx_recv_type = msg->recv_type;
- if (msg->msg.data_len > 0)
- data->rx_result = msg->msg.data[0];
- else
- data->rx_result = IPMI_UNKNOWN_ERR_COMPLETION_CODE;
-
- if (msg->msg.data_len > 1) {
- rx_len = msg->msg.data_len - 1;
- if (data->rx_msg_len < rx_len)
- rx_len = data->rx_msg_len;
- data->rx_msg_len = rx_len;
- memcpy(data->rx_msg_data, msg->msg.data + 1, data->rx_msg_len);
- } else
- data->rx_msg_len = 0;
-
- ipmi_free_recv_msg(msg);
- complete(&data->read_complete);
-}
-
-/* ID functions */
-
-/* Obtain an id */
-static int aem_idr_get(int *id)
-{
- int i, err;
-
-again:
- if (unlikely(!idr_pre_get(&aem_idr, GFP_KERNEL)))
- return -ENOMEM;
-
- spin_lock(&aem_idr_lock);
- err = idr_get_new(&aem_idr, NULL, &i);
- spin_unlock(&aem_idr_lock);
-
- if (unlikely(err == -EAGAIN))
- goto again;
- else if (unlikely(err))
- return err;
-
- *id = i & MAX_ID_MASK;
- return 0;
-}
-
-/* Release an object ID */
-static void aem_idr_put(int id)
-{
- spin_lock(&aem_idr_lock);
- idr_remove(&aem_idr, id);
- spin_unlock(&aem_idr_lock);
-}
-
-/* Sensor support functions */
-
-/* Read a sensor value */
-static int aem_read_sensor(struct aem_data *data, u8 elt, u8 reg,
- void *buf, size_t size)
-{
- int rs_size, res;
- struct aem_read_sensor_req rs_req;
- struct aem_read_sensor_resp *rs_resp;
- struct aem_ipmi_data *ipmi = &data->ipmi;
-
- /* AEM registers are 1, 2, 4 or 8 bytes */
- switch (size) {
- case 1:
- case 2:
- case 4:
- case 8:
- break;
- default:
- return -EINVAL;
- }
-
- rs_req.id = system_x_id;
- rs_req.module_handle = data->module_handle;
- rs_req.element = elt;
- rs_req.subcommand = AEM_READ_REGISTER;
- rs_req.reg = reg;
- rs_req.rx_buf_size = size;
-
- ipmi->tx_message.cmd = AEM_ELEMENT_CMD;
- ipmi->tx_message.data = (char *)&rs_req;
- ipmi->tx_message.data_len = sizeof(rs_req);
-
- rs_size = sizeof(*rs_resp) + size;
- rs_resp = kzalloc(rs_size, GFP_KERNEL);
- if (!rs_resp)
- return -ENOMEM;
-
- ipmi->rx_msg_data = rs_resp;
- ipmi->rx_msg_len = rs_size;
-
- aem_send_message(ipmi);
-
- res = wait_for_completion_timeout(&ipmi->read_complete, IPMI_TIMEOUT);
- if (!res)
- return -ETIMEDOUT;
-
- if (ipmi->rx_result || ipmi->rx_msg_len != rs_size ||
- memcmp(&rs_resp->id, &system_x_id, sizeof(system_x_id))) {
- kfree(rs_resp);
- return -ENOENT;
- }
-
- switch (size) {
- case 1: {
- u8 *x = buf;
- *x = rs_resp->bytes[0];
- break;
- }
- case 2: {
- u16 *x = buf;
- *x = be16_to_cpup((u16 *)rs_resp->bytes);
- break;
- }
- case 4: {
- u32 *x = buf;
- *x = be32_to_cpup((u32 *)rs_resp->bytes);
- break;
- }
- case 8: {
- u64 *x = buf;
- *x = be64_to_cpup((u64 *)rs_resp->bytes);
- break;
- }
- }
-
- return 0;
-}
-
-/* Update AEM energy registers */
-static void update_aem_energy(struct aem_data *data)
-{
- aem_read_sensor(data, AEM_ENERGY_ELEMENT, 0, &data->energy[0], 8);
- if (data->ver_major < 2)
- return;
- aem_read_sensor(data, AEM_ENERGY_ELEMENT, 1, &data->energy[1], 8);
-}
-
-/* Update all AEM1 sensors */
-static void update_aem1_sensors(struct aem_data *data)
-{
- mutex_lock(&data->lock);
- if (time_before(jiffies, data->last_updated + REFRESH_INTERVAL) &&
- data->valid)
- goto out;
-
- update_aem_energy(data);
-out:
- mutex_unlock(&data->lock);
-}
-
-/* Update all AEM2 sensors */
-static void update_aem2_sensors(struct aem_data *data)
-{
- int i;
-
- mutex_lock(&data->lock);
- if (time_before(jiffies, data->last_updated + REFRESH_INTERVAL) &&
- data->valid)
- goto out;
-
- update_aem_energy(data);
- aem_read_sensor(data, AEM_EXHAUST_ELEMENT, 0, &data->temp[0], 1);
- aem_read_sensor(data, AEM_EXHAUST_ELEMENT, 1, &data->temp[1], 1);
-
- for (i = POWER_CAP; i <= POWER_AUX; i++)
- aem_read_sensor(data, AEM_POWER_CAP_ELEMENT, i,
- &data->pcap[i], 2);
-out:
- mutex_unlock(&data->lock);
-}
-
-/* Delete an AEM instance */
-static void aem_delete(struct aem_data *data)
-{
- list_del(&data->list);
- aem_remove_sensors(data);
- hwmon_device_unregister(data->hwmon_dev);
- ipmi_destroy_user(data->ipmi.user);
- dev_set_drvdata(&data->pdev->dev, NULL);
- platform_device_unregister(data->pdev);
- aem_idr_put(data->id);
- kfree(data);
-}
-
-/* Probe functions for AEM1 devices */
-
-/* Retrieve version and module handle for an AEM1 instance */
-static int aem_find_aem1_count(struct aem_ipmi_data *data)
-{
- int res;
- struct aem_find_firmware_req ff_req;
- struct aem_find_firmware_resp ff_resp;
-
- ff_req.id = system_x_id;
- ff_req.index = 0;
- ff_req.module_type_id = cpu_to_be16(AEM_MODULE_TYPE_ID);
-
- data->tx_message.cmd = AEM_FIND_FW_CMD;
- data->tx_message.data = (char *)&ff_req;
- data->tx_message.data_len = sizeof(ff_req);
-
- data->rx_msg_data = &ff_resp;
- data->rx_msg_len = sizeof(ff_resp);
-
- aem_send_message(data);
-
- res = wait_for_completion_timeout(&data->read_complete, IPMI_TIMEOUT);
- if (!res)
- return -ETIMEDOUT;
-
- if (data->rx_result || data->rx_msg_len != sizeof(ff_resp) ||
- memcmp(&ff_resp.id, &system_x_id, sizeof(system_x_id)))
- return -ENOENT;
-
- return ff_resp.num_instances;
-}
-
-/* Find and initialize one AEM1 instance */
-static int aem_init_aem1_inst(struct aem_ipmi_data *probe, u8 module_handle)
-{
- struct aem_data *data;
- int i;
- int res = -ENOMEM;
-
- data = kzalloc(sizeof(*data), GFP_KERNEL);
- if (!data)
- return res;
- mutex_init(&data->lock);
-
- /* Copy instance data */
- data->ver_major = 1;
- data->ver_minor = 0;
- data->module_handle = module_handle;
- for (i = 0; i < AEM1_NUM_ENERGY_REGS; i++)
- data->power_period[i] = AEM_DEFAULT_POWER_INTERVAL;
-
- /* Create sub-device for this fw instance */
- if (aem_idr_get(&data->id))
- goto id_err;
-
- data->pdev = platform_device_alloc(DRVNAME, data->id);
- if (!data->pdev)
- goto dev_err;
- data->pdev->dev.driver = &aem_driver;
-
- res = platform_device_add(data->pdev);
- if (res)
- goto ipmi_err;
-
- dev_set_drvdata(&data->pdev->dev, data);
-
- /* Set up IPMI interface */
- if (aem_init_ipmi_data(&data->ipmi, probe->interface,
- probe->bmc_device))
- goto ipmi_err;
-
- /* Register with hwmon */
- data->hwmon_dev = hwmon_device_register(&data->pdev->dev);
-
- if (IS_ERR(data->hwmon_dev)) {
- dev_err(&data->pdev->dev, "Unable to register hwmon "
- "device for IPMI interface %d\n",
- probe->interface);
- goto hwmon_reg_err;
- }
-
- data->update = update_aem1_sensors;
-
- /* Find sensors */
- if (aem1_find_sensors(data))
- goto sensor_err;
-
- /* Add to our list of AEM devices */
- list_add_tail(&data->list, &driver_data.aem_devices);
-
- dev_info(data->ipmi.bmc_device, "Found AEM v%d.%d at 0x%X\n",
- data->ver_major, data->ver_minor,
- data->module_handle);
- return 0;
-
-sensor_err:
- hwmon_device_unregister(data->hwmon_dev);
-hwmon_reg_err:
- ipmi_destroy_user(data->ipmi.user);
-ipmi_err:
- dev_set_drvdata(&data->pdev->dev, NULL);
- platform_device_unregister(data->pdev);
-dev_err:
- aem_idr_put(data->id);
-id_err:
- kfree(data);
-
- return res;
-}
-
-/* Find and initialize all AEM1 instances */
-static int aem_init_aem1(struct aem_ipmi_data *probe)
-{
- int num, i, err;
-
- num = aem_find_aem1_count(probe);
- for (i = 0; i < num; i++) {
- err = aem_init_aem1_inst(probe, i);
- if (err) {
- dev_err(probe->bmc_device,
- "Error %d initializing AEM1 0x%X\n",
- err, i);
- return err;
- }
- }
-
- return 0;
-}
-
-/* Probe functions for AEM2 devices */
-
-/* Retrieve version and module handle for an AEM2 instance */
-static int aem_find_aem2(struct aem_ipmi_data *data,
- struct aem_find_instance_resp *fi_resp,
- int instance_num)
-{
- int res;
- struct aem_find_instance_req fi_req;
-
- fi_req.id = system_x_id;
- fi_req.instance_number = instance_num;
- fi_req.module_type_id = cpu_to_be16(AEM_MODULE_TYPE_ID);
-
- data->tx_message.cmd = AEM_FW_INSTANCE_CMD;
- data->tx_message.data = (char *)&fi_req;
- data->tx_message.data_len = sizeof(fi_req);
-
- data->rx_msg_data = fi_resp;
- data->rx_msg_len = sizeof(*fi_resp);
-
- aem_send_message(data);
-
- res = wait_for_completion_timeout(&data->read_complete, IPMI_TIMEOUT);
- if (!res)
- return -ETIMEDOUT;
-
- if (data->rx_result || data->rx_msg_len != sizeof(*fi_resp) ||
- memcmp(&fi_resp->id, &system_x_id, sizeof(system_x_id)))
- return -ENOENT;
-
- return 0;
-}
-
-/* Find and initialize one AEM2 instance */
-static int aem_init_aem2_inst(struct aem_ipmi_data *probe,
- struct aem_find_instance_resp *fi_resp)
-{
- struct aem_data *data;
- int i;
- int res = -ENOMEM;
-
- data = kzalloc(sizeof(*data), GFP_KERNEL);
- if (!data)
- return res;
- mutex_init(&data->lock);
-
- /* Copy instance data */
- data->ver_major = fi_resp->major;
- data->ver_minor = fi_resp->minor;
- data->module_handle = fi_resp->module_handle;
- for (i = 0; i < AEM2_NUM_ENERGY_REGS; i++)
- data->power_period[i] = AEM_DEFAULT_POWER_INTERVAL;
-
- /* Create sub-device for this fw instance */
- if (aem_idr_get(&data->id))
- goto id_err;
-
- data->pdev = platform_device_alloc(DRVNAME, data->id);
- if (!data->pdev)
- goto dev_err;
- data->pdev->dev.driver = &aem_driver;
-
- res = platform_device_add(data->pdev);
- if (res)
- goto ipmi_err;
-
- dev_set_drvdata(&data->pdev->dev, data);
-
- /* Set up IPMI interface */
- if (aem_init_ipmi_data(&data->ipmi, probe->interface,
- probe->bmc_device))
- goto ipmi_err;
-
- /* Register with hwmon */
- data->hwmon_dev = hwmon_device_register(&data->pdev->dev);
-
- if (IS_ERR(data->hwmon_dev)) {
- dev_err(&data->pdev->dev, "Unable to register hwmon "
- "device for IPMI interface %d\n",
- probe->interface);
- goto hwmon_reg_err;
- }
-
- data->update = update_aem2_sensors;
-
- /* Find sensors */
- if (aem2_find_sensors(data))
- goto sensor_err;
-
- /* Add to our list of AEM devices */
- list_add_tail(&data->list, &driver_data.aem_devices);
-
- dev_info(data->ipmi.bmc_device, "Found AEM v%d.%d at 0x%X\n",
- data->ver_major, data->ver_minor,
- data->module_handle);
- return 0;
-
-sensor_err:
- hwmon_device_unregister(data->hwmon_dev);
-hwmon_reg_err:
- ipmi_destroy_user(data->ipmi.user);
-ipmi_err:
- dev_set_drvdata(&data->pdev->dev, NULL);
- platform_device_unregister(data->pdev);
-dev_err:
- aem_idr_put(data->id);
-id_err:
- kfree(data);
-
- return res;
-}
-
-/* Find and initialize all AEM2 instances */
-static int aem_init_aem2(struct aem_ipmi_data *probe)
-{
- struct aem_find_instance_resp fi_resp;
- int err;
- int i = 0;
-
- while (!aem_find_aem2(probe, &fi_resp, i)) {
- if (fi_resp.major != 2) {
- dev_err(probe->bmc_device, "Unknown AEM v%d; please "
- "report this to the maintainer.\n",
- fi_resp.major);
- i++;
- continue;
- }
- err = aem_init_aem2_inst(probe, &fi_resp);
- if (err) {
- dev_err(probe->bmc_device,
- "Error %d initializing AEM2 0x%X\n",
- err, fi_resp.module_handle);
- return err;
- }
- i++;
- }
-
- return 0;
-}
-
-/* Probe a BMC for AEM firmware instances */
-static void aem_register_bmc(int iface, struct device *dev)
-{
- struct aem_ipmi_data probe;
-
- if (aem_init_ipmi_data(&probe, iface, dev))
- return;
-
- /* Ignore probe errors; they won't cause problems */
- aem_init_aem1(&probe);
- aem_init_aem2(&probe);
-
- ipmi_destroy_user(probe.user);
-}
-
-/* Handle BMC deletion */
-static void aem_bmc_gone(int iface)
-{
- struct aem_data *p1, *next1;
-
- list_for_each_entry_safe(p1, next1, &driver_data.aem_devices, list)
- if (p1->ipmi.interface == iface)
- aem_delete(p1);
-}
-
-/* sysfs support functions */
-
-/* AEM device name */
-static ssize_t show_name(struct device *dev, struct device_attribute *devattr,
- char *buf)
-{
- struct aem_data *data = dev_get_drvdata(dev);
-
- return sprintf(buf, "%s%d\n", DRVNAME, data->ver_major);
-}
-static SENSOR_DEVICE_ATTR(name, S_IRUGO, show_name, NULL, 0);
-
-/* AEM device version */
-static ssize_t show_version(struct device *dev,
- struct device_attribute *devattr,
- char *buf)
-{
- struct aem_data *data = dev_get_drvdata(dev);
-
- return sprintf(buf, "%d.%d\n", data->ver_major, data->ver_minor);
-}
-static SENSOR_DEVICE_ATTR(version, S_IRUGO, show_version, NULL, 0);
-
-/* Display power use */
-static ssize_t aem_show_power(struct device *dev,
- struct device_attribute *devattr,
- char *buf)
-{
- struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
- struct aem_data *data = dev_get_drvdata(dev);
- u64 before, after, delta, time;
- signed long leftover;
- struct timespec b, a;
-
- mutex_lock(&data->lock);
- update_aem_energy(data);
- getnstimeofday(&b);
- before = data->energy[attr->index];
-
- leftover = schedule_timeout_interruptible(
- msecs_to_jiffies(data->power_period[attr->index])
- );
- if (leftover) {
- mutex_unlock(&data->lock);
- return 0;
- }
-
- update_aem_energy(data);
- getnstimeofday(&a);
- after = data->energy[attr->index];
- mutex_unlock(&data->lock);
-
- time = timespec_to_ns(&a) - timespec_to_ns(&b);
- delta = (after - before) * UJ_PER_MJ;
-
- return sprintf(buf, "%llu\n",
- (unsigned long long)div64_u64(delta * NSEC_PER_SEC, time));
-}
-
-/* Display energy use */
-static ssize_t aem_show_energy(struct device *dev,
- struct device_attribute *devattr,
- char *buf)
-{
- struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
- struct aem_data *a = dev_get_drvdata(dev);
- a->update(a);
-
- return sprintf(buf, "%llu\n",
- (unsigned long long)a->energy[attr->index] * 1000);
-}
-
-/* Display power interval registers */
-static ssize_t aem_show_power_period(struct device *dev,
- struct device_attribute *devattr,
- char *buf)
-{
- struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
- struct aem_data *a = dev_get_drvdata(dev);
- a->update(a);
-
- return sprintf(buf, "%lu\n", a->power_period[attr->index]);
-}
-
-/* Set power interval registers */
-static ssize_t aem_set_power_period(struct device *dev,
- struct device_attribute *devattr,
- const char *buf, size_t count)
-{
- struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
- struct aem_data *a = dev_get_drvdata(dev);
- unsigned long temp;
- int res;
-
- res = strict_strtoul(buf, 10, &temp);
- if (res)
- return res;
-
- if (temp < AEM_MIN_POWER_INTERVAL)
- return -EINVAL;
-
- mutex_lock(&a->lock);
- a->power_period[attr->index] = temp;
- mutex_unlock(&a->lock);
-
- return count;
-}
-
-/* Discover sensors on an AEM device */
-static int aem_register_sensors(struct aem_data *data,
- struct aem_ro_sensor_template *ro,
- struct aem_rw_sensor_template *rw)
-{
- struct device *dev = &data->pdev->dev;
- struct sensor_device_attribute *sensors = data->sensors;
- int err;
-
- /* Set up read-only sensors */
- while (ro->label) {
- sensors->dev_attr.attr.name = ro->label;
- sensors->dev_attr.attr.mode = S_IRUGO;
- sensors->dev_attr.show = ro->show;
- sensors->index = ro->index;
-
- err = device_create_file(dev, &sensors->dev_attr);
- if (err) {
- sensors->dev_attr.attr.name = NULL;
- goto error;
- }
- sensors++;
- ro++;
- }
-
- /* Set up read-write sensors */
- while (rw->label) {
- sensors->dev_attr.attr.name = rw->label;
- sensors->dev_attr.attr.mode = S_IRUGO | S_IWUSR;
- sensors->dev_attr.show = rw->show;
- sensors->dev_attr.store = rw->set;
- sensors->index = rw->index;
-
- err = device_create_file(dev, &sensors->dev_attr);
- if (err) {
- sensors->dev_attr.attr.name = NULL;
- goto error;
- }
- sensors++;
- rw++;
- }
-
- err = device_create_file(dev, &sensor_dev_attr_name.dev_attr);
- if (err)
- goto error;
- err = device_create_file(dev, &sensor_dev_attr_version.dev_attr);
- return err;
-
-error:
- aem_remove_sensors(data);
- return err;
-}
-
-/* sysfs support functions for AEM2 sensors */
-
-/* Display temperature use */
-static ssize_t aem2_show_temp(struct device *dev,
- struct device_attribute *devattr,
- char *buf)
-{
- struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
- struct aem_data *a = dev_get_drvdata(dev);
- a->update(a);
-
- return sprintf(buf, "%u\n", a->temp[attr->index] * 1000);
-}
-
-/* Display power-capping registers */
-static ssize_t aem2_show_pcap_value(struct device *dev,
- struct device_attribute *devattr,
- char *buf)
-{
- struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
- struct aem_data *a = dev_get_drvdata(dev);
- a->update(a);
-
- return sprintf(buf, "%u\n", a->pcap[attr->index] * 100000);
-}
-
-/* Remove sensors attached to an AEM device */
-static void aem_remove_sensors(struct aem_data *data)
-{
- int i;
-
- for (i = 0; i < AEM_NUM_SENSORS; i++) {
- if (!data->sensors[i].dev_attr.attr.name)
- continue;
- device_remove_file(&data->pdev->dev,
- &data->sensors[i].dev_attr);
- }
-
- device_remove_file(&data->pdev->dev,
- &sensor_dev_attr_name.dev_attr);
- device_remove_file(&data->pdev->dev,
- &sensor_dev_attr_version.dev_attr);
-}
-
-/* Sensor probe functions */
-
-/* Description of AEM1 sensors */
-static struct aem_ro_sensor_template aem1_ro_sensors[] = {
-{"energy1_input", aem_show_energy, 0},
-{"power1_average", aem_show_power, 0},
-{NULL, NULL, 0},
-};
-
-static struct aem_rw_sensor_template aem1_rw_sensors[] = {
-{"power1_average_interval", aem_show_power_period, aem_set_power_period, 0},
-{NULL, NULL, NULL, 0},
-};
-
-/* Description of AEM2 sensors */
-static struct aem_ro_sensor_template aem2_ro_sensors[] = {
-{"energy1_input", aem_show_energy, 0},
-{"energy2_input", aem_show_energy, 1},
-{"power1_average", aem_show_power, 0},
-{"power2_average", aem_show_power, 1},
-{"temp1_input", aem2_show_temp, 0},
-{"temp2_input", aem2_show_temp, 1},
-
-{"power4_average", aem2_show_pcap_value, POWER_CAP_MAX_HOTPLUG},
-{"power5_average", aem2_show_pcap_value, POWER_CAP_MAX},
-{"power6_average", aem2_show_pcap_value, POWER_CAP_MIN_WARNING},
-{"power7_average", aem2_show_pcap_value, POWER_CAP_MIN},
-
-{"power3_average", aem2_show_pcap_value, POWER_AUX},
-{"power_cap", aem2_show_pcap_value, POWER_CAP},
-{NULL, NULL, 0},
-};
-
-static struct aem_rw_sensor_template aem2_rw_sensors[] = {
-{"power1_average_interval", aem_show_power_period, aem_set_power_period, 0},
-{"power2_average_interval", aem_show_power_period, aem_set_power_period, 1},
-{NULL, NULL, NULL, 0},
-};
-
-/* Set up AEM1 sensor attrs */
-static int aem1_find_sensors(struct aem_data *data)
-{
- return aem_register_sensors(data, aem1_ro_sensors, aem1_rw_sensors);
-}
-
-/* Set up AEM2 sensor attrs */
-static int aem2_find_sensors(struct aem_data *data)
-{
- return aem_register_sensors(data, aem2_ro_sensors, aem2_rw_sensors);
-}
-
-/* Module init/exit routines */
-
-static int __init aem_init(void)
-{
- int res;
-
- res = driver_register(&aem_driver);
- if (res) {
- printk(KERN_ERR "Can't register aem driver\n");
- return res;
- }
-
- res = ipmi_smi_watcher_register(&driver_data.bmc_events);
- if (res)
- goto ipmi_reg_err;
- return 0;
-
-ipmi_reg_err:
- driver_unregister(&aem_driver);
- return res;
-
-}
-
-static void __exit aem_exit(void)
-{
- struct aem_data *p1, *next1;
-
- ipmi_smi_watcher_unregister(&driver_data.bmc_events);
- driver_unregister(&aem_driver);
- list_for_each_entry_safe(p1, next1, &driver_data.aem_devices, list)
- aem_delete(p1);
-}
-
-MODULE_AUTHOR("Darrick J. Wong ");
-MODULE_DESCRIPTION("IBM Active Energy Manager power/temp sensor driver");
-MODULE_LICENSE("GPL");
-
-module_init(aem_init);
-module_exit(aem_exit);
diff --git a/trunk/drivers/infiniband/core/mad.c b/trunk/drivers/infiniband/core/mad.c
index 1adf2efd3cb3..fbe16d5250a4 100644
--- a/trunk/drivers/infiniband/core/mad.c
+++ b/trunk/drivers/infiniband/core/mad.c
@@ -747,9 +747,7 @@ static int handle_outgoing_dr_smp(struct ib_mad_agent_private *mad_agent_priv,
break;
case IB_MAD_RESULT_SUCCESS | IB_MAD_RESULT_CONSUMED:
kmem_cache_free(ib_mad_cache, mad_priv);
- kfree(local);
- ret = 1;
- goto out;
+ break;
case IB_MAD_RESULT_SUCCESS:
/* Treat like an incoming receive MAD */
port_priv = ib_get_mad_port(mad_agent_priv->agent.device,
diff --git a/trunk/drivers/infiniband/hw/cxgb3/iwch_qp.c b/trunk/drivers/infiniband/hw/cxgb3/iwch_qp.c
index 992613799228..79dbe5beae52 100644
--- a/trunk/drivers/infiniband/hw/cxgb3/iwch_qp.c
+++ b/trunk/drivers/infiniband/hw/cxgb3/iwch_qp.c
@@ -229,7 +229,7 @@ int iwch_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
struct ib_send_wr **bad_wr)
{
int err = 0;
- u8 uninitialized_var(t3_wr_flit_cnt);
+ u8 t3_wr_flit_cnt;
enum t3_wr_opcode t3_wr_opcode = 0;
enum t3_wr_flags t3_wr_flags;
struct iwch_qp *qhp;
diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_sdma.c b/trunk/drivers/infiniband/hw/ipath/ipath_sdma.c
index 0a8c1b8091a2..3697449c1ba4 100644
--- a/trunk/drivers/infiniband/hw/ipath/ipath_sdma.c
+++ b/trunk/drivers/infiniband/hw/ipath/ipath_sdma.c
@@ -345,7 +345,7 @@ static void sdma_abort_task(unsigned long opaque)
* state change
*/
if (jiffies > dd->ipath_sdma_abort_jiffies) {
- ipath_dbg("looping with status 0x%08lx\n",
+ ipath_dbg("looping with status 0x%016llx\n",
dd->ipath_sdma_status);
dd->ipath_sdma_abort_jiffies = jiffies + 5 * HZ;
}
@@ -615,7 +615,7 @@ void ipath_restart_sdma(struct ipath_devdata *dd)
}
spin_unlock_irqrestore(&dd->ipath_sdma_lock, flags);
if (!needed) {
- ipath_dbg("invalid attempt to restart SDMA, status 0x%08lx\n",
+ ipath_dbg("invalid attempt to restart SDMA, status 0x%016llx\n",
dd->ipath_sdma_status);
goto bail;
}
diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_uc.c b/trunk/drivers/infiniband/hw/ipath/ipath_uc.c
index 0596ec16fcbd..7fd18e833907 100644
--- a/trunk/drivers/infiniband/hw/ipath/ipath_uc.c
+++ b/trunk/drivers/infiniband/hw/ipath/ipath_uc.c
@@ -407,11 +407,12 @@ void ipath_uc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr,
dev->n_pkt_drops++;
goto done;
}
- wc.opcode = IB_WC_RECV;
+ /* XXX Need to free SGEs */
last_imm:
ipath_copy_sge(&qp->r_sge, data, tlen);
wc.wr_id = qp->r_wr_id;
wc.status = IB_WC_SUCCESS;
+ wc.opcode = IB_WC_RECV;
wc.qp = &qp->ibqp;
wc.src_qp = qp->remote_qpn;
wc.slid = qp->remote_ah_attr.dlid;
@@ -513,7 +514,6 @@ void ipath_uc_rcv(struct ipath_ibdev *dev, struct ipath_ib_header *hdr,
goto done;
}
wc.byte_len = qp->r_len;
- wc.opcode = IB_WC_RECV_RDMA_WITH_IMM;
goto last_imm;
case OP(RDMA_WRITE_LAST):
diff --git a/trunk/drivers/infiniband/hw/mlx4/qp.c b/trunk/drivers/infiniband/hw/mlx4/qp.c
index a80df22deae8..8e02ecfec188 100644
--- a/trunk/drivers/infiniband/hw/mlx4/qp.c
+++ b/trunk/drivers/infiniband/hw/mlx4/qp.c
@@ -333,9 +333,6 @@ static int set_kernel_sq_size(struct mlx4_ib_dev *dev, struct ib_qp_cap *cap,
cap->max_inline_data + sizeof (struct mlx4_wqe_inline_seg)) +
send_wqe_overhead(type, qp->flags);
- if (s > dev->dev->caps.max_sq_desc_sz)
- return -EINVAL;
-
/*
* Hermon supports shrinking WQEs, such that a single work
* request can include multiple units of 1 << wqe_shift. This
@@ -375,6 +372,9 @@ static int set_kernel_sq_size(struct mlx4_ib_dev *dev, struct ib_qp_cap *cap,
qp->sq.wqe_shift = ilog2(roundup_pow_of_two(s));
for (;;) {
+ if (1 << qp->sq.wqe_shift > dev->dev->caps.max_sq_desc_sz)
+ return -EINVAL;
+
qp->sq_max_wqes_per_wr = DIV_ROUND_UP(s, 1U << qp->sq.wqe_shift);
/*
@@ -395,8 +395,7 @@ static int set_kernel_sq_size(struct mlx4_ib_dev *dev, struct ib_qp_cap *cap,
++qp->sq.wqe_shift;
}
- qp->sq.max_gs = (min(dev->dev->caps.max_sq_desc_sz,
- (qp->sq_max_wqes_per_wr << qp->sq.wqe_shift)) -
+ qp->sq.max_gs = ((qp->sq_max_wqes_per_wr << qp->sq.wqe_shift) -
send_wqe_overhead(type, qp->flags)) /
sizeof (struct mlx4_wqe_data_seg);
@@ -412,9 +411,7 @@ static int set_kernel_sq_size(struct mlx4_ib_dev *dev, struct ib_qp_cap *cap,
cap->max_send_wr = qp->sq.max_post =
(qp->sq.wqe_cnt - qp->sq_spare_wqes) / qp->sq_max_wqes_per_wr;
- cap->max_send_sge = min(qp->sq.max_gs,
- min(dev->dev->caps.max_sq_sg,
- dev->dev->caps.max_rq_sg));
+ cap->max_send_sge = qp->sq.max_gs;
/* We don't support inline sends for kernel QPs (yet) */
cap->max_inline_data = 0;
@@ -1460,7 +1457,7 @@ int mlx4_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr,
unsigned ind;
int uninitialized_var(stamp);
int uninitialized_var(size);
- unsigned uninitialized_var(seglen);
+ unsigned seglen;
int i;
spin_lock_irqsave(&qp->sq.lock, flags);
diff --git a/trunk/drivers/infiniband/hw/mthca/mthca_main.c b/trunk/drivers/infiniband/hw/mthca/mthca_main.c
index 200cf13fc9bb..9ebadd6e0cfb 100644
--- a/trunk/drivers/infiniband/hw/mthca/mthca_main.c
+++ b/trunk/drivers/infiniband/hw/mthca/mthca_main.c
@@ -45,7 +45,6 @@
#include "mthca_cmd.h"
#include "mthca_profile.h"
#include "mthca_memfree.h"
-#include "mthca_wqe.h"
MODULE_AUTHOR("Roland Dreier");
MODULE_DESCRIPTION("Mellanox InfiniBand HCA low-level driver");
@@ -201,18 +200,7 @@ static int mthca_dev_lim(struct mthca_dev *mdev, struct mthca_dev_lim *dev_lim)
mdev->limits.gid_table_len = dev_lim->max_gids;
mdev->limits.pkey_table_len = dev_lim->max_pkeys;
mdev->limits.local_ca_ack_delay = dev_lim->local_ca_ack_delay;
- /*
- * Need to allow for worst case send WQE overhead and check
- * whether max_desc_sz imposes a lower limit than max_sg; UD
- * send has the biggest overhead.
- */
- mdev->limits.max_sg = min_t(int, dev_lim->max_sg,
- (dev_lim->max_desc_sz -
- sizeof (struct mthca_next_seg) -
- (mthca_is_memfree(mdev) ?
- sizeof (struct mthca_arbel_ud_seg) :
- sizeof (struct mthca_tavor_ud_seg))) /
- sizeof (struct mthca_data_seg));
+ mdev->limits.max_sg = dev_lim->max_sg;
mdev->limits.max_wqes = dev_lim->max_qp_sz;
mdev->limits.max_qp_init_rdma = dev_lim->max_requester_per_qp;
mdev->limits.reserved_qps = dev_lim->reserved_qps;
diff --git a/trunk/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/trunk/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
index 3f663fb852c1..d00a2c174aee 100644
--- a/trunk/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
+++ b/trunk/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
@@ -194,13 +194,7 @@ static int ipoib_mcast_join_finish(struct ipoib_mcast *mcast,
/* Set the cached Q_Key before we attach if it's the broadcast group */
if (!memcmp(mcast->mcmember.mgid.raw, priv->dev->broadcast + 4,
sizeof (union ib_gid))) {
- spin_lock_irq(&priv->lock);
- if (!priv->broadcast) {
- spin_unlock_irq(&priv->lock);
- return -EAGAIN;
- }
priv->qkey = be32_to_cpu(priv->broadcast->mcmember.qkey);
- spin_unlock_irq(&priv->lock);
priv->tx_wr.wr.ud.remote_qkey = priv->qkey;
}
diff --git a/trunk/drivers/isdn/hysdn/hycapi.c b/trunk/drivers/isdn/hysdn/hycapi.c
index 53f6ad1235db..d3999a8e9f88 100644
--- a/trunk/drivers/isdn/hysdn/hycapi.c
+++ b/trunk/drivers/isdn/hysdn/hycapi.c
@@ -462,11 +462,11 @@ static int hycapi_read_proc(char *page, char **start, off_t off,
default: s = "???"; break;
}
len += sprintf(page+len, "%-16s %s\n", "type", s);
- if ((s = cinfo->version[VER_DRIVER]) != NULL)
+ if ((s = cinfo->version[VER_DRIVER]) != 0)
len += sprintf(page+len, "%-16s %s\n", "ver_driver", s);
- if ((s = cinfo->version[VER_CARDTYPE]) != NULL)
+ if ((s = cinfo->version[VER_CARDTYPE]) != 0)
len += sprintf(page+len, "%-16s %s\n", "ver_cardtype", s);
- if ((s = cinfo->version[VER_SERIAL]) != NULL)
+ if ((s = cinfo->version[VER_SERIAL]) != 0)
len += sprintf(page+len, "%-16s %s\n", "ver_serial", s);
len += sprintf(page+len, "%-16s %s\n", "cardname", cinfo->cardname);
diff --git a/trunk/drivers/md/bitmap.c b/trunk/drivers/md/bitmap.c
index b26927ce889c..c14dacdacfac 100644
--- a/trunk/drivers/md/bitmap.c
+++ b/trunk/drivers/md/bitmap.c
@@ -203,6 +203,17 @@ static void bitmap_checkfree(struct bitmap *bitmap, unsigned long page)
* bitmap file handling - read and write the bitmap file and its superblock
*/
+/* copy the pathname of a file to a buffer */
+char *file_path(struct file *file, char *buf, int count)
+{
+ if (!buf)
+ return NULL;
+
+ buf = d_path(&file->f_path, buf, count);
+
+ return IS_ERR(buf) ? NULL : buf;
+}
+
/*
* basic page I/O operations
*/
@@ -710,13 +721,11 @@ static void bitmap_file_kick(struct bitmap *bitmap)
if (bitmap->file) {
path = kmalloc(PAGE_SIZE, GFP_KERNEL);
if (path)
- ptr = d_path(&bitmap->file->f_path, path,
- PAGE_SIZE);
-
+ ptr = file_path(bitmap->file, path, PAGE_SIZE);
printk(KERN_ALERT
"%s: kicking failed bitmap file %s from array!\n",
- bmname(bitmap), IS_ERR(ptr) ? "" : ptr);
+ bmname(bitmap), ptr ? ptr : "");
kfree(path);
} else
diff --git a/trunk/drivers/md/md.c b/trunk/drivers/md/md.c
index 51c19f86ff99..83eb78b00137 100644
--- a/trunk/drivers/md/md.c
+++ b/trunk/drivers/md/md.c
@@ -74,8 +74,6 @@ static DEFINE_SPINLOCK(pers_lock);
static void md_print_devices(void);
-static DECLARE_WAIT_QUEUE_HEAD(resync_wait);
-
#define MD_BUG(x...) { printk("md: bug in file %s, line %d\n", __FILE__, __LINE__); md_print_devices(); }
/*
@@ -3014,36 +3012,6 @@ degraded_show(mddev_t *mddev, char *page)
}
static struct md_sysfs_entry md_degraded = __ATTR_RO(degraded);
-static ssize_t
-sync_force_parallel_show(mddev_t *mddev, char *page)
-{
- return sprintf(page, "%d\n", mddev->parallel_resync);
-}
-
-static ssize_t
-sync_force_parallel_store(mddev_t *mddev, const char *buf, size_t len)
-{
- long n;
-
- if (strict_strtol(buf, 10, &n))
- return -EINVAL;
-
- if (n != 0 && n != 1)
- return -EINVAL;
-
- mddev->parallel_resync = n;
-
- if (mddev->sync_thread)
- wake_up(&resync_wait);
-
- return len;
-}
-
-/* force parallel resync, even with shared block devices */
-static struct md_sysfs_entry md_sync_force_parallel =
-__ATTR(sync_force_parallel, S_IRUGO|S_IWUSR,
- sync_force_parallel_show, sync_force_parallel_store);
-
static ssize_t
sync_speed_show(mddev_t *mddev, char *page)
{
@@ -3219,7 +3187,6 @@ static struct attribute *md_redundancy_attrs[] = {
&md_sync_min.attr,
&md_sync_max.attr,
&md_sync_speed.attr,
- &md_sync_force_parallel.attr,
&md_sync_completed.attr,
&md_max_sync.attr,
&md_suspend_lo.attr,
@@ -3724,8 +3691,6 @@ static int do_md_stop(mddev_t * mddev, int mode)
module_put(mddev->pers->owner);
mddev->pers = NULL;
- /* tell userspace to handle 'inactive' */
- sysfs_notify(&mddev->kobj, NULL, "array_state");
set_capacity(disk, 0);
mddev->changed = 1;
@@ -4022,8 +3987,8 @@ static int get_bitmap_file(mddev_t * mddev, void __user * arg)
if (!buf)
goto out;
- ptr = d_path(&mddev->bitmap->file->f_path, buf, sizeof(file->pathname));
- if (IS_ERR(ptr))
+ ptr = file_path(mddev->bitmap->file, buf, sizeof(file->pathname));
+ if (!ptr)
goto out;
strcpy(file->pathname, ptr);
@@ -5434,7 +5399,7 @@ void md_done_sync(mddev_t *mddev, int blocks, int ok)
atomic_sub(blocks, &mddev->recovery_active);
wake_up(&mddev->recovery_wait);
if (!ok) {
- set_bit(MD_RECOVERY_INTR, &mddev->recovery);
+ set_bit(MD_RECOVERY_ERR, &mddev->recovery);
md_wakeup_thread(mddev->thread);
// stop recovery, signal do_sync ....
}
@@ -5470,11 +5435,8 @@ void md_write_start(mddev_t *mddev, struct bio *bi)
md_wakeup_thread(mddev->thread);
}
spin_unlock_irq(&mddev->write_lock);
- sysfs_notify(&mddev->kobj, NULL, "array_state");
}
- wait_event(mddev->sb_wait,
- !test_bit(MD_CHANGE_CLEAN, &mddev->flags) &&
- !test_bit(MD_CHANGE_PENDING, &mddev->flags));
+ wait_event(mddev->sb_wait, mddev->flags==0);
}
void md_write_end(mddev_t *mddev)
@@ -5509,17 +5471,13 @@ void md_allow_write(mddev_t *mddev)
mddev->safemode = 1;
spin_unlock_irq(&mddev->write_lock);
md_update_sb(mddev, 0);
-
- sysfs_notify(&mddev->kobj, NULL, "array_state");
- /* wait for the dirty state to be recorded in the metadata */
- wait_event(mddev->sb_wait,
- !test_bit(MD_CHANGE_CLEAN, &mddev->flags) &&
- !test_bit(MD_CHANGE_PENDING, &mddev->flags));
} else
spin_unlock_irq(&mddev->write_lock);
}
EXPORT_SYMBOL_GPL(md_allow_write);
+static DECLARE_WAIT_QUEUE_HEAD(resync_wait);
+
#define SYNC_MARKS 10
#define SYNC_MARK_STEP (3*HZ)
void md_do_sync(mddev_t *mddev)
@@ -5583,9 +5541,8 @@ void md_do_sync(mddev_t *mddev)
for_each_mddev(mddev2, tmp) {
if (mddev2 == mddev)
continue;
- if (!mddev->parallel_resync
- && mddev2->curr_resync
- && match_mddev_units(mddev, mddev2)) {
+ if (mddev2->curr_resync &&
+ match_mddev_units(mddev,mddev2)) {
DEFINE_WAIT(wq);
if (mddev < mddev2 && mddev->curr_resync == 2) {
/* arbitrarily yield */
@@ -5690,7 +5647,7 @@ void md_do_sync(mddev_t *mddev)
sectors = mddev->pers->sync_request(mddev, j, &skipped,
currspeed < speed_min(mddev));
if (sectors == 0) {
- set_bit(MD_RECOVERY_INTR, &mddev->recovery);
+ set_bit(MD_RECOVERY_ERR, &mddev->recovery);
goto out;
}
@@ -5713,7 +5670,8 @@ void md_do_sync(mddev_t *mddev)
last_check = io_sectors;
- if (test_bit(MD_RECOVERY_INTR, &mddev->recovery))
+ if (test_bit(MD_RECOVERY_INTR, &mddev->recovery) ||
+ test_bit(MD_RECOVERY_ERR, &mddev->recovery))
break;
repeat:
@@ -5767,7 +5725,8 @@ void md_do_sync(mddev_t *mddev)
/* tell personality that we are finished */
mddev->pers->sync_request(mddev, max_sectors, &skipped, 1);
- if (!test_bit(MD_RECOVERY_CHECK, &mddev->recovery) &&
+ if (!test_bit(MD_RECOVERY_ERR, &mddev->recovery) &&
+ !test_bit(MD_RECOVERY_CHECK, &mddev->recovery) &&
mddev->curr_resync > 2) {
if (test_bit(MD_RECOVERY_SYNC, &mddev->recovery)) {
if (test_bit(MD_RECOVERY_INTR, &mddev->recovery)) {
@@ -5836,10 +5795,7 @@ static int remove_and_add_spares(mddev_t *mddev)
}
if (mddev->degraded) {
- rdev_for_each(rdev, rtmp, mddev) {
- if (rdev->raid_disk >= 0 &&
- !test_bit(In_sync, &rdev->flags))
- spares++;
+ rdev_for_each(rdev, rtmp, mddev)
if (rdev->raid_disk < 0
&& !test_bit(Faulty, &rdev->flags)) {
rdev->recovery_offset = 0;
@@ -5857,7 +5813,6 @@ static int remove_and_add_spares(mddev_t *mddev)
} else
break;
}
- }
}
return spares;
}
@@ -5871,7 +5826,7 @@ static int remove_and_add_spares(mddev_t *mddev)
* to do that as needed.
* When it is determined that resync is needed, we set MD_RECOVERY_RUNNING in
* "->recovery" and create a thread at ->sync_thread.
- * When the thread finishes it sets MD_RECOVERY_DONE
+ * When the thread finishes it sets MD_RECOVERY_DONE (and might set MD_RECOVERY_ERR)
* and wakeups up this thread which will reap the thread and finish up.
* This thread also removes any faulty devices (with nr_pending == 0).
*
@@ -5946,7 +5901,8 @@ void md_check_recovery(mddev_t *mddev)
/* resync has finished, collect result */
md_unregister_thread(mddev->sync_thread);
mddev->sync_thread = NULL;
- if (!test_bit(MD_RECOVERY_INTR, &mddev->recovery)) {
+ if (!test_bit(MD_RECOVERY_ERR, &mddev->recovery) &&
+ !test_bit(MD_RECOVERY_INTR, &mddev->recovery)) {
/* success...*/
/* activate any spares */
mddev->pers->spare_active(mddev);
@@ -5970,6 +5926,7 @@ void md_check_recovery(mddev_t *mddev)
* might be left set
*/
clear_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
+ clear_bit(MD_RECOVERY_ERR, &mddev->recovery);
clear_bit(MD_RECOVERY_INTR, &mddev->recovery);
clear_bit(MD_RECOVERY_DONE, &mddev->recovery);
diff --git a/trunk/drivers/md/multipath.c b/trunk/drivers/md/multipath.c
index e968116e0de9..4f4d1f383842 100644
--- a/trunk/drivers/md/multipath.c
+++ b/trunk/drivers/md/multipath.c
@@ -327,8 +327,7 @@ static int multipath_remove_disk(mddev_t *mddev, int number)
if (rdev) {
if (test_bit(In_sync, &rdev->flags) ||
atomic_read(&rdev->nr_pending)) {
- printk(KERN_ERR "hot-remove-disk, slot %d is identified"
- " but is still operational!\n", number);
+ printk(KERN_ERR "hot-remove-disk, slot %d is identified" " but is still operational!\n", number);
err = -EBUSY;
goto abort;
}
diff --git a/trunk/drivers/md/raid1.c b/trunk/drivers/md/raid1.c
index c610b947218a..ac409b7d83f5 100644
--- a/trunk/drivers/md/raid1.c
+++ b/trunk/drivers/md/raid1.c
@@ -773,7 +773,7 @@ static int make_request(struct request_queue *q, struct bio * bio)
r1bio_t *r1_bio;
struct bio *read_bio;
int i, targets = 0, disks;
- struct bitmap *bitmap;
+ struct bitmap *bitmap = mddev->bitmap;
unsigned long flags;
struct bio_list bl;
struct page **behind_pages = NULL;
@@ -802,8 +802,6 @@ static int make_request(struct request_queue *q, struct bio * bio)
wait_barrier(conf);
- bitmap = mddev->bitmap;
-
disk_stat_inc(mddev->gendisk, ios[rw]);
disk_stat_add(mddev->gendisk, sectors[rw], bio_sectors(bio));
@@ -1027,7 +1025,7 @@ static void error(mddev_t *mddev, mdk_rdev_t *rdev)
/*
* if recovery is running, make sure it aborts.
*/
- set_bit(MD_RECOVERY_INTR, &mddev->recovery);
+ set_bit(MD_RECOVERY_ERR, &mddev->recovery);
} else
set_bit(Faulty, &rdev->flags);
set_bit(MD_CHANGE_DEVS, &mddev->flags);
@@ -1148,14 +1146,6 @@ static int raid1_remove_disk(mddev_t *mddev, int number)
err = -EBUSY;
goto abort;
}
- /* Only remove non-faulty devices is recovery
- * is not possible.
- */
- if (!test_bit(Faulty, &rdev->flags) &&
- mddev->degraded < conf->raid_disks) {
- err = -EBUSY;
- goto abort;
- }
p->rdev = NULL;
synchronize_rcu();
if (atomic_read(&rdev->nr_pending)) {
@@ -1292,7 +1282,6 @@ static void sync_request_write(mddev_t *mddev, r1bio_t *r1_bio)
rdev_dec_pending(conf->mirrors[i].rdev, mddev);
} else {
/* fixup the bio for reuse */
- int size;
sbio->bi_vcnt = vcnt;
sbio->bi_size = r1_bio->sectors << 9;
sbio->bi_idx = 0;
@@ -1306,20 +1295,10 @@ static void sync_request_write(mddev_t *mddev, r1bio_t *r1_bio)
sbio->bi_sector = r1_bio->sector +
conf->mirrors[i].rdev->data_offset;
sbio->bi_bdev = conf->mirrors[i].rdev->bdev;
- size = sbio->bi_size;
- for (j = 0; j < vcnt ; j++) {
- struct bio_vec *bi;
- bi = &sbio->bi_io_vec[j];
- bi->bv_offset = 0;
- if (size > PAGE_SIZE)
- bi->bv_len = PAGE_SIZE;
- else
- bi->bv_len = size;
- size -= PAGE_SIZE;
- memcpy(page_address(bi->bv_page),
+ for (j = 0; j < vcnt ; j++)
+ memcpy(page_address(sbio->bi_io_vec[j].bv_page),
page_address(pbio->bi_io_vec[j].bv_page),
PAGE_SIZE);
- }
}
}
diff --git a/trunk/drivers/md/raid10.c b/trunk/drivers/md/raid10.c
index 1de17da34a95..8536ede1e712 100644
--- a/trunk/drivers/md/raid10.c
+++ b/trunk/drivers/md/raid10.c
@@ -1020,7 +1020,7 @@ static void error(mddev_t *mddev, mdk_rdev_t *rdev)
/*
* if recovery is running, make sure it aborts.
*/
- set_bit(MD_RECOVERY_INTR, &mddev->recovery);
+ set_bit(MD_RECOVERY_ERR, &mddev->recovery);
}
set_bit(Faulty, &rdev->flags);
set_bit(MD_CHANGE_DEVS, &mddev->flags);
@@ -1171,14 +1171,6 @@ static int raid10_remove_disk(mddev_t *mddev, int number)
err = -EBUSY;
goto abort;
}
- /* Only remove faulty devices in recovery
- * is not possible.
- */
- if (!test_bit(Faulty, &rdev->flags) &&
- enough(conf)) {
- err = -EBUSY;
- goto abort;
- }
p->rdev = NULL;
synchronize_rcu();
if (atomic_read(&rdev->nr_pending)) {
@@ -1245,7 +1237,6 @@ static void end_sync_write(struct bio *bio, int error)
if (!uptodate)
md_error(mddev, conf->mirrors[d].rdev);
-
update_head_pos(i, r10_bio);
while (atomic_dec_and_test(&r10_bio->remaining)) {
@@ -1853,8 +1844,7 @@ static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, i
if (rb2)
atomic_dec(&rb2->remaining);
r10_bio = rb2;
- if (!test_and_set_bit(MD_RECOVERY_INTR,
- &mddev->recovery))
+ if (!test_and_set_bit(MD_RECOVERY_ERR, &mddev->recovery))
printk(KERN_INFO "raid10: %s: insufficient working devices for recovery.\n",
mdname(mddev));
break;
diff --git a/trunk/drivers/md/raid5.c b/trunk/drivers/md/raid5.c
index 425958a76b84..93fde48c0f42 100644
--- a/trunk/drivers/md/raid5.c
+++ b/trunk/drivers/md/raid5.c
@@ -94,8 +94,6 @@
#define __inline__
#endif
-#define printk_rl(args...) ((void) (printk_ratelimit() && printk(args)))
-
#if !RAID6_USE_EMPTY_ZERO_PAGE
/* In .bss so it's zeroed */
const char raid6_empty_zero_page[PAGE_SIZE] __attribute__((aligned(256)));
@@ -1145,12 +1143,10 @@ static void raid5_end_read_request(struct bio * bi, int error)
set_bit(R5_UPTODATE, &sh->dev[i].flags);
if (test_bit(R5_ReadError, &sh->dev[i].flags)) {
rdev = conf->disks[i].rdev;
- printk_rl(KERN_INFO "raid5:%s: read error corrected"
- " (%lu sectors at %llu on %s)\n",
- mdname(conf->mddev), STRIPE_SECTORS,
- (unsigned long long)(sh->sector
- + rdev->data_offset),
- bdevname(rdev->bdev, b));
+ printk(KERN_INFO "raid5:%s: read error corrected (%lu sectors at %llu on %s)\n",
+ mdname(conf->mddev), STRIPE_SECTORS,
+ (unsigned long long)(sh->sector + rdev->data_offset),
+ bdevname(rdev->bdev, b));
clear_bit(R5_ReadError, &sh->dev[i].flags);
clear_bit(R5_ReWrite, &sh->dev[i].flags);
}
@@ -1164,22 +1160,16 @@ static void raid5_end_read_request(struct bio * bi, int error)
clear_bit(R5_UPTODATE, &sh->dev[i].flags);
atomic_inc(&rdev->read_errors);
if (conf->mddev->degraded)
- printk_rl(KERN_WARNING
- "raid5:%s: read error not correctable "
- "(sector %llu on %s).\n",
- mdname(conf->mddev),
- (unsigned long long)(sh->sector
- + rdev->data_offset),
- bdn);
+ printk(KERN_WARNING "raid5:%s: read error not correctable (sector %llu on %s).\n",
+ mdname(conf->mddev),
+ (unsigned long long)(sh->sector + rdev->data_offset),
+ bdn);
else if (test_bit(R5_ReWrite, &sh->dev[i].flags))
/* Oh, no!!! */
- printk_rl(KERN_WARNING
- "raid5:%s: read error NOT corrected!! "
- "(sector %llu on %s).\n",
- mdname(conf->mddev),
- (unsigned long long)(sh->sector
- + rdev->data_offset),
- bdn);
+ printk(KERN_WARNING "raid5:%s: read error NOT corrected!! (sector %llu on %s).\n",
+ mdname(conf->mddev),
+ (unsigned long long)(sh->sector + rdev->data_offset),
+ bdn);
else if (atomic_read(&rdev->read_errors)
> conf->max_nr_stripes)
printk(KERN_WARNING
@@ -1268,7 +1258,7 @@ static void error(mddev_t *mddev, mdk_rdev_t *rdev)
/*
* if recovery was running, make sure it aborts.
*/
- set_bit(MD_RECOVERY_INTR, &mddev->recovery);
+ set_bit(MD_RECOVERY_ERR, &mddev->recovery);
}
set_bit(Faulty, &rdev->flags);
printk (KERN_ALERT
@@ -4574,14 +4564,6 @@ static int raid5_remove_disk(mddev_t *mddev, int number)
err = -EBUSY;
goto abort;
}
- /* Only remove non-faulty devices if recovery
- * isn't possible.
- */
- if (!test_bit(Faulty, &rdev->flags) &&
- mddev->degraded <= conf->max_degraded) {
- err = -EBUSY;
- goto abort;
- }
p->rdev = NULL;
synchronize_rcu();
if (atomic_read(&rdev->nr_pending)) {
diff --git a/trunk/drivers/scsi/3w-9xxx.c b/trunk/drivers/scsi/3w-9xxx.c
index 867f6fd5c2c0..b31faeccb9cd 100644
--- a/trunk/drivers/scsi/3w-9xxx.c
+++ b/trunk/drivers/scsi/3w-9xxx.c
@@ -1278,7 +1278,7 @@ static irqreturn_t twa_interrupt(int irq, void *dev_instance)
error = 0;
/* Check for command packet errors */
if (full_command_packet->command.newcommand.status != 0) {
- if (tw_dev->srb[request_id] != NULL) {
+ if (tw_dev->srb[request_id] != 0) {
error = twa_fill_sense(tw_dev, request_id, 1, 1);
} else {
/* Skip ioctl error prints */
@@ -1290,7 +1290,7 @@ static irqreturn_t twa_interrupt(int irq, void *dev_instance)
/* Check for correct state */
if (tw_dev->state[request_id] != TW_S_POSTED) {
- if (tw_dev->srb[request_id] != NULL) {
+ if (tw_dev->srb[request_id] != 0) {
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x1a, "Received a request id that wasn't posted");
TW_CLEAR_ALL_INTERRUPTS(tw_dev);
goto twa_interrupt_bail;
@@ -1298,7 +1298,7 @@ static irqreturn_t twa_interrupt(int irq, void *dev_instance)
}
/* Check for internal command completion */
- if (tw_dev->srb[request_id] == NULL) {
+ if (tw_dev->srb[request_id] == 0) {
if (request_id != tw_dev->chrdev_request_id) {
if (twa_aen_complete(tw_dev, request_id))
TW_PRINTK(tw_dev->host, TW_DRIVER, 0x1b, "Error completing AEN during attention interrupt");
diff --git a/trunk/drivers/scsi/aha152x.c b/trunk/drivers/scsi/aha152x.c
index 0899cb61e3dd..1dca1775f4b1 100644
--- a/trunk/drivers/scsi/aha152x.c
+++ b/trunk/drivers/scsi/aha152x.c
@@ -3582,7 +3582,7 @@ static int checksetup(struct aha152x_setup *setup)
if (i == ARRAY_SIZE(ports))
return 0;
- if (!request_region(setup->io_port, IO_RANGE, "aha152x")) {
+ if ( request_region(setup->io_port, IO_RANGE, "aha152x")==0 ) {
printk(KERN_ERR "aha152x: io port 0x%x busy.\n", setup->io_port);
return 0;
}
@@ -3842,7 +3842,7 @@ static int __init aha152x_init(void)
if ((setup_count == 1) && (setup[0].io_port == ports[i]))
continue;
- if (!request_region(ports[i], IO_RANGE, "aha152x")) {
+ if ( request_region(ports[i], IO_RANGE, "aha152x")==0 ) {
printk(KERN_ERR "aha152x: io port 0x%x busy.\n", ports[i]);
continue;
}
diff --git a/trunk/drivers/scsi/atp870u.c b/trunk/drivers/scsi/atp870u.c
index 7d311541c76c..db6de5e6afb3 100644
--- a/trunk/drivers/scsi/atp870u.c
+++ b/trunk/drivers/scsi/atp870u.c
@@ -747,7 +747,7 @@ static void send_s870(struct atp_unit *dev,unsigned char c)
dev->quhd[c] = 0;
}
workreq = dev->quereq[c][dev->quhd[c]];
- if (dev->id[c][scmd_id(workreq)].curr_req == NULL) {
+ if (dev->id[c][scmd_id(workreq)].curr_req == 0) {
dev->id[c][scmd_id(workreq)].curr_req = workreq;
dev->last_cmd[c] = scmd_id(workreq);
goto cmd_subp;
diff --git a/trunk/drivers/scsi/hptiop.c b/trunk/drivers/scsi/hptiop.c
index da876d3924be..aaa48e0c8ed0 100644
--- a/trunk/drivers/scsi/hptiop.c
+++ b/trunk/drivers/scsi/hptiop.c
@@ -444,7 +444,7 @@ static void __iomem *hptiop_map_pci_bar(struct hptiop_hba *hba, int index)
if (!(pci_resource_flags(pcidev, index) & IORESOURCE_MEM)) {
printk(KERN_ERR "scsi%d: pci resource invalid\n",
hba->host->host_no);
- return NULL;
+ return 0;
}
mem_base_phy = pci_resource_start(pcidev, index);
@@ -454,7 +454,7 @@ static void __iomem *hptiop_map_pci_bar(struct hptiop_hba *hba, int index)
if (!mem_base_virt) {
printk(KERN_ERR "scsi%d: Fail to ioremap memory space\n",
hba->host->host_no);
- return NULL;
+ return 0;
}
return mem_base_virt;
}
@@ -476,11 +476,11 @@ static void hptiop_unmap_pci_bar_itl(struct hptiop_hba *hba)
static int hptiop_map_pci_bar_mv(struct hptiop_hba *hba)
{
hba->u.mv.regs = hptiop_map_pci_bar(hba, 0);
- if (hba->u.mv.regs == NULL)
+ if (hba->u.mv.regs == 0)
return -1;
hba->u.mv.mu = hptiop_map_pci_bar(hba, 2);
- if (hba->u.mv.mu == NULL) {
+ if (hba->u.mv.mu == 0) {
iounmap(hba->u.mv.regs);
return -1;
}
@@ -1210,8 +1210,8 @@ static void hptiop_remove(struct pci_dev *pcidev)
static struct hptiop_adapter_ops hptiop_itl_ops = {
.iop_wait_ready = iop_wait_ready_itl,
- .internal_memalloc = NULL,
- .internal_memfree = NULL,
+ .internal_memalloc = 0,
+ .internal_memfree = 0,
.map_pci_bar = hptiop_map_pci_bar_itl,
.unmap_pci_bar = hptiop_unmap_pci_bar_itl,
.enable_intr = hptiop_enable_intr_itl,
diff --git a/trunk/drivers/scsi/qla1280.c b/trunk/drivers/scsi/qla1280.c
index 3754ab87f89a..51e2f299dbbb 100644
--- a/trunk/drivers/scsi/qla1280.c
+++ b/trunk/drivers/scsi/qla1280.c
@@ -2811,7 +2811,7 @@ qla1280_64bit_start_scsi(struct scsi_qla_host *ha, struct srb * sp)
/* Check for room in outstanding command list. */
for (cnt = 0; cnt < MAX_OUTSTANDING_COMMANDS &&
- ha->outstanding_cmds[cnt] != NULL; cnt++);
+ ha->outstanding_cmds[cnt] != 0; cnt++);
if (cnt >= MAX_OUTSTANDING_COMMANDS) {
status = 1;
diff --git a/trunk/drivers/serial/8250_pci.c b/trunk/drivers/serial/8250_pci.c
index 788c3559522d..53fa19cf2f06 100644
--- a/trunk/drivers/serial/8250_pci.c
+++ b/trunk/drivers/serial/8250_pci.c
@@ -2602,12 +2602,7 @@ static struct pci_device_id serial_pci_tbl[] = {
{ PCI_VENDOR_ID_INTASHIELD, PCI_DEVICE_ID_INTASHIELD_IS200,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, /* 135a.0811 */
pbn_b2_2_115200 },
- /*
- * IntaShield IS-400
- */
- { PCI_VENDOR_ID_INTASHIELD, PCI_DEVICE_ID_INTASHIELD_IS400,
- PCI_ANY_ID, PCI_ANY_ID, 0, 0, /* 135a.0dc0 */
- pbn_b2_4_115200 },
+
/*
* Perle PCI-RAS cards
*/
diff --git a/trunk/drivers/serial/serial_core.c b/trunk/drivers/serial/serial_core.c
index 53b03c629aff..eab032733790 100644
--- a/trunk/drivers/serial/serial_core.c
+++ b/trunk/drivers/serial/serial_core.c
@@ -2054,8 +2054,6 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *port)
int uart_resume_port(struct uart_driver *drv, struct uart_port *port)
{
struct uart_state *state = drv->state + port->line;
- struct device *tty_dev;
- struct uart_match match = {port, drv};
mutex_lock(&state->mutex);
@@ -2065,8 +2063,7 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *port)
return 0;
}
- tty_dev = device_find_child(port->dev, &match, serial_match_port);
- if (!port->suspended && device_may_wakeup(tty_dev)) {
+ if (!port->suspended) {
disable_irq_wake(port->irq);
mutex_unlock(&state->mutex);
return 0;
diff --git a/trunk/drivers/spi/spidev.c b/trunk/drivers/spi/spidev.c
index 41620c0fb046..b3518ca9f04e 100644
--- a/trunk/drivers/spi/spidev.c
+++ b/trunk/drivers/spi/spidev.c
@@ -68,7 +68,6 @@ static unsigned long minors[N_SPI_MINORS / BITS_PER_LONG];
struct spidev_data {
struct device dev;
- spinlock_t spi_lock;
struct spi_device *spi;
struct list_head device_entry;
@@ -86,75 +85,12 @@ MODULE_PARM_DESC(bufsiz, "data bytes in biggest supported SPI message");
/*-------------------------------------------------------------------------*/
-/*
- * We can't use the standard synchronous wrappers for file I/O; we
- * need to protect against async removal of the underlying spi_device.
- */
-static void spidev_complete(void *arg)
-{
- complete(arg);
-}
-
-static ssize_t
-spidev_sync(struct spidev_data *spidev, struct spi_message *message)
-{
- DECLARE_COMPLETION_ONSTACK(done);
- int status;
-
- message->complete = spidev_complete;
- message->context = &done;
-
- spin_lock_irq(&spidev->spi_lock);
- if (spidev->spi == NULL)
- status = -ESHUTDOWN;
- else
- status = spi_async(spidev->spi, message);
- spin_unlock_irq(&spidev->spi_lock);
-
- if (status == 0) {
- wait_for_completion(&done);
- status = message->status;
- if (status == 0)
- status = message->actual_length;
- }
- return status;
-}
-
-static inline ssize_t
-spidev_sync_write(struct spidev_data *spidev, size_t len)
-{
- struct spi_transfer t = {
- .tx_buf = spidev->buffer,
- .len = len,
- };
- struct spi_message m;
-
- spi_message_init(&m);
- spi_message_add_tail(&t, &m);
- return spidev_sync(spidev, &m);
-}
-
-static inline ssize_t
-spidev_sync_read(struct spidev_data *spidev, size_t len)
-{
- struct spi_transfer t = {
- .rx_buf = spidev->buffer,
- .len = len,
- };
- struct spi_message m;
-
- spi_message_init(&m);
- spi_message_add_tail(&t, &m);
- return spidev_sync(spidev, &m);
-}
-
-/*-------------------------------------------------------------------------*/
-
/* Read-only message with current device setup */
static ssize_t
spidev_read(struct file *filp, char __user *buf, size_t count, loff_t *f_pos)
{
struct spidev_data *spidev;
+ struct spi_device *spi;
ssize_t status = 0;
/* chipselect only toggles at start or end of operation */
@@ -162,9 +98,10 @@ spidev_read(struct file *filp, char __user *buf, size_t count, loff_t *f_pos)
return -EMSGSIZE;
spidev = filp->private_data;
+ spi = spidev->spi;
mutex_lock(&spidev->buf_lock);
- status = spidev_sync_read(spidev, count);
+ status = spi_read(spi, spidev->buffer, count);
if (status == 0) {
unsigned long missing;
@@ -185,6 +122,7 @@ spidev_write(struct file *filp, const char __user *buf,
size_t count, loff_t *f_pos)
{
struct spidev_data *spidev;
+ struct spi_device *spi;
ssize_t status = 0;
unsigned long missing;
@@ -193,11 +131,12 @@ spidev_write(struct file *filp, const char __user *buf,
return -EMSGSIZE;
spidev = filp->private_data;
+ spi = spidev->spi;
mutex_lock(&spidev->buf_lock);
missing = copy_from_user(spidev->buffer, buf, count);
if (missing == 0) {
- status = spidev_sync_write(spidev, count);
+ status = spi_write(spi, spidev->buffer, count);
if (status == 0)
status = count;
} else
@@ -214,6 +153,7 @@ static int spidev_message(struct spidev_data *spidev,
struct spi_transfer *k_xfers;
struct spi_transfer *k_tmp;
struct spi_ioc_transfer *u_tmp;
+ struct spi_device *spi = spidev->spi;
unsigned n, total;
u8 *buf;
int status = -EFAULT;
@@ -275,7 +215,7 @@ static int spidev_message(struct spidev_data *spidev,
spi_message_add_tail(k_tmp, &msg);
}
- status = spidev_sync(spidev, &msg);
+ status = spi_sync(spi, &msg);
if (status < 0)
goto done;
@@ -329,16 +269,8 @@ spidev_ioctl(struct inode *inode, struct file *filp,
if (err)
return -EFAULT;
- /* guard against device removal before, or while,
- * we issue this ioctl.
- */
spidev = filp->private_data;
- spin_lock_irq(&spidev->spi_lock);
- spi = spi_dev_get(spidev->spi);
- spin_unlock_irq(&spidev->spi_lock);
-
- if (spi == NULL)
- return -ESHUTDOWN;
+ spi = spidev->spi;
switch (cmd) {
/* read requests */
@@ -424,10 +356,8 @@ spidev_ioctl(struct inode *inode, struct file *filp,
default:
/* segmented and/or full-duplex I/O request */
if (_IOC_NR(cmd) != _IOC_NR(SPI_IOC_MESSAGE(0))
- || _IOC_DIR(cmd) != _IOC_WRITE) {
- retval = -ENOTTY;
- break;
- }
+ || _IOC_DIR(cmd) != _IOC_WRITE)
+ return -ENOTTY;
tmp = _IOC_SIZE(cmd);
if ((tmp % sizeof(struct spi_ioc_transfer)) != 0) {
@@ -455,7 +385,6 @@ spidev_ioctl(struct inode *inode, struct file *filp,
kfree(ioc);
break;
}
- spi_dev_put(spi);
return retval;
}
@@ -559,7 +488,6 @@ static int spidev_probe(struct spi_device *spi)
/* Initialize the driver data */
spidev->spi = spi;
- spin_lock_init(&spidev->spi_lock);
mutex_init(&spidev->buf_lock);
INIT_LIST_HEAD(&spidev->device_entry);
@@ -598,17 +526,13 @@ static int spidev_remove(struct spi_device *spi)
{
struct spidev_data *spidev = dev_get_drvdata(&spi->dev);
- /* make sure ops on existing fds can abort cleanly */
- spin_lock_irq(&spidev->spi_lock);
- spidev->spi = NULL;
- spin_unlock_irq(&spidev->spi_lock);
-
- /* prevent new opens */
mutex_lock(&device_list_lock);
+
list_del(&spidev->device_entry);
dev_set_drvdata(&spi->dev, NULL);
clear_bit(MINOR(spidev->dev.devt), minors);
device_unregister(&spidev->dev);
+
mutex_unlock(&device_list_lock);
return 0;
diff --git a/trunk/drivers/video/aty/atyfb_base.c b/trunk/drivers/video/aty/atyfb_base.c
index bd4ac0bafecb..e4bcf5376a99 100644
--- a/trunk/drivers/video/aty/atyfb_base.c
+++ b/trunk/drivers/video/aty/atyfb_base.c
@@ -3356,7 +3356,7 @@ static int __devinit atyfb_setup_generic(struct pci_dev *pdev, struct fb_info *i
info->fix.mmio_start = raddr;
par->ati_regbase = ioremap(info->fix.mmio_start, 0x1000);
- if (par->ati_regbase == NULL)
+ if (par->ati_regbase == 0)
return -ENOMEM;
info->fix.mmio_start += par->aux_start ? 0x400 : 0xc00;
diff --git a/trunk/drivers/video/aty/radeon_base.c b/trunk/drivers/video/aty/radeon_base.c
index 400e9264e456..72cd0d2f14ec 100644
--- a/trunk/drivers/video/aty/radeon_base.c
+++ b/trunk/drivers/video/aty/radeon_base.c
@@ -2277,8 +2277,8 @@ static int __devinit radeonfb_pci_register (struct pci_dev *pdev,
do {
rinfo->fb_base = ioremap (rinfo->fb_base_phys,
rinfo->mapped_vram);
- } while (rinfo->fb_base == NULL &&
- ((rinfo->mapped_vram /= 2) >= MIN_MAPPED_VRAM));
+ } while ( rinfo->fb_base == 0 &&
+ ((rinfo->mapped_vram /=2) >= MIN_MAPPED_VRAM) );
if (rinfo->fb_base == NULL) {
printk (KERN_ERR "radeonfb (%s): cannot map FB\n",
diff --git a/trunk/drivers/video/matrox/matroxfb_base.h b/trunk/drivers/video/matrox/matroxfb_base.h
index 95883236c0cd..f3107ad7e545 100644
--- a/trunk/drivers/video/matrox/matroxfb_base.h
+++ b/trunk/drivers/video/matrox/matroxfb_base.h
@@ -200,7 +200,7 @@ static inline int mga_ioremap(unsigned long phys, unsigned long size, int flags,
virt->vaddr = ioremap_nocache(phys, size);
else
virt->vaddr = ioremap(phys, size);
- return (virt->vaddr == NULL); /* 0, !0... 0, error_code in future */
+ return (virt->vaddr == 0); /* 0, !0... 0, error_code in future */
}
static inline void mga_iounmap(vaddr_t va) {
diff --git a/trunk/drivers/video/pxafb.c b/trunk/drivers/video/pxafb.c
index 274bc93ab7d8..3ee314beacc1 100644
--- a/trunk/drivers/video/pxafb.c
+++ b/trunk/drivers/video/pxafb.c
@@ -1351,6 +1351,7 @@ static struct pxafb_info * __init pxafb_init_fbinfo(struct device *dev)
struct pxafb_info *fbi;
void *addr;
struct pxafb_mach_info *inf = dev->platform_data;
+ struct pxafb_mode_info *mode = inf->modes;
/* Alloc the pxafb_info and pseudo_palette in one step */
fbi = kmalloc(sizeof(struct pxafb_info) + sizeof(u32) * 16, GFP_KERNEL);
diff --git a/trunk/drivers/video/s3c2410fb.c b/trunk/drivers/video/s3c2410fb.c
index f0598961c6b0..13b38cbbe4cf 100644
--- a/trunk/drivers/video/s3c2410fb.c
+++ b/trunk/drivers/video/s3c2410fb.c
@@ -1,15 +1,75 @@
-/* linux/drivers/video/s3c2410fb.c
- * Copyright (c) 2004,2005 Arnaud Patard
- * Copyright (c) 2004-2008 Ben Dooks
- *
- * S3C2410 LCD Framebuffer Driver
+/*
+ * linux/drivers/video/s3c2410fb.c
+ * Copyright (c) Arnaud Patard, Ben Dooks
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file COPYING in the main directory of this archive for
* more details.
*
- * Driver based on skeletonfb.c, sa1100fb.c and others.
-*/
+ * S3C2410 LCD Controller Frame Buffer Driver
+ * based on skeletonfb.c, sa1100fb.c and others
+ *
+ * ChangeLog
+ * 2005-04-07: Arnaud Patard
+ * - u32 state -> pm_message_t state
+ * - S3C2410_{VA,SZ}_LCD -> S3C24XX
+ *
+ * 2005-03-15: Arnaud Patard
+ * - Removed the ioctl
+ * - use readl/writel instead of __raw_writel/__raw_readl
+ *
+ * 2004-12-04: Arnaud Patard
+ * - Added the possibility to set on or off the
+ * debugging messages
+ * - Replaced 0 and 1 by on or off when reading the
+ * /sys files
+ *
+ * 2005-03-23: Ben Dooks
+ * - added non 16bpp modes
+ * - updated platform information for range of x/y/bpp
+ * - add code to ensure palette is written correctly
+ * - add pixel clock divisor control
+ *
+ * 2004-11-11: Arnaud Patard
+ * - Removed the use of currcon as it no more exists
+ * - Added LCD power sysfs interface
+ *
+ * 2004-11-03: Ben Dooks
+ * - minor cleanups
+ * - add suspend/resume support
+ * - s3c2410fb_setcolreg() not valid in >8bpp modes
+ * - removed last CONFIG_FB_S3C2410_FIXED
+ * - ensure lcd controller stopped before cleanup
+ * - added sysfs interface for backlight power
+ * - added mask for gpio configuration
+ * - ensured IRQs disabled during GPIO configuration
+ * - disable TPAL before enabling video
+ *
+ * 2004-09-20: Arnaud Patard
+ * - Suppress command line options
+ *
+ * 2004-09-15: Arnaud Patard
+ * - code cleanup
+ *
+ * 2004-09-07: Arnaud Patard
+ * - Renamed from h1940fb.c to s3c2410fb.c
+ * - Add support for different devices
+ * - Backlight support
+ *
+ * 2004-09-05: Herbert Pötzl
+ * - added clock (de-)allocation code
+ * - added fixem fbmem option
+ *
+ * 2004-07-27: Arnaud Patard
+ * - code cleanup
+ * - added a forgotten return in h1940fb_init
+ *
+ * 2004-07-19: Herbert Pötzl
+ * - code cleanup and extended debugging
+ *
+ * 2004-07-15: Arnaud Patard
+ * - First version
+ */
#include
#include
@@ -520,27 +580,6 @@ static int s3c2410fb_setcolreg(unsigned regno,
return 0;
}
-/* s3c2410fb_lcd_enable
- *
- * shutdown the lcd controller
- */
-static void s3c2410fb_lcd_enable(struct s3c2410fb_info *fbi, int enable)
-{
- unsigned long flags;
-
- local_irq_save(flags);
-
- if (enable)
- fbi->regs.lcdcon1 |= S3C2410_LCDCON1_ENVID;
- else
- fbi->regs.lcdcon1 &= ~S3C2410_LCDCON1_ENVID;
-
- writel(fbi->regs.lcdcon1, fbi->io + S3C2410_LCDCON1);
-
- local_irq_restore(flags);
-}
-
-
/*
* s3c2410fb_blank
* @blank_mode: the blank mode we want.
@@ -550,6 +589,9 @@ static void s3c2410fb_lcd_enable(struct s3c2410fb_info *fbi, int enable)
* blanking succeeded, != 0 if un-/blanking failed due to e.g. a
* video mode which doesn't support it. Implements VESA suspend
* and powerdown modes on hardware that supports disabling hsync/vsync:
+ * blank_mode == 2: suspend vsync
+ * blank_mode == 3: suspend hsync
+ * blank_mode == 4: powerdown
*
* Returns negative errno on error, or zero on success.
*
@@ -563,12 +605,6 @@ static int s3c2410fb_blank(int blank_mode, struct fb_info *info)
tpal_reg += is_s3c2412(fbi) ? S3C2412_TPAL : S3C2410_TPAL;
- if (blank_mode == FB_BLANK_POWERDOWN) {
- s3c2410fb_lcd_enable(fbi, 0);
- } else {
- s3c2410fb_lcd_enable(fbi, 1);
- }
-
if (blank_mode == FB_BLANK_UNBLANK)
writel(0x0, tpal_reg);
else {
@@ -912,10 +948,7 @@ static int __init s3c24xxfb_probe(struct platform_device *pdev,
}
/* create device files */
- ret = device_create_file(&pdev->dev, &dev_attr_debug);
- if (ret) {
- printk(KERN_ERR "failed to add debug attribute\n");
- }
+ device_create_file(&pdev->dev, &dev_attr_debug);
printk(KERN_INFO "fb%d: %s frame buffer device\n",
fbinfo->node, fbinfo->fix.id);
@@ -950,6 +983,21 @@ static int __init s3c2412fb_probe(struct platform_device *pdev)
return s3c24xxfb_probe(pdev, DRV_S3C2412);
}
+/* s3c2410fb_stop_lcd
+ *
+ * shutdown the lcd controller
+ */
+static void s3c2410fb_stop_lcd(struct s3c2410fb_info *fbi)
+{
+ unsigned long flags;
+
+ local_irq_save(flags);
+
+ fbi->regs.lcdcon1 &= ~S3C2410_LCDCON1_ENVID;
+ writel(fbi->regs.lcdcon1, fbi->io + S3C2410_LCDCON1);
+
+ local_irq_restore(flags);
+}
/*
* Cleanup
@@ -962,7 +1010,7 @@ static int s3c2410fb_remove(struct platform_device *pdev)
unregister_framebuffer(fbinfo);
- s3c2410fb_lcd_enable(info, 0);
+ s3c2410fb_stop_lcd(info);
msleep(1);
s3c2410fb_unmap_video_memory(fbinfo);
@@ -995,7 +1043,7 @@ static int s3c2410fb_suspend(struct platform_device *dev, pm_message_t state)
struct fb_info *fbinfo = platform_get_drvdata(dev);
struct s3c2410fb_info *info = fbinfo->par;
- s3c2410fb_lcd_enable(info, 0);
+ s3c2410fb_stop_lcd(info);
/* sleep before disabling the clock, we need to ensure
* the LCD DMA engine is not going to get back on the bus
@@ -1070,5 +1118,3 @@ MODULE_AUTHOR("Arnaud Patard , "
"Ben Dooks ");
MODULE_DESCRIPTION("Framebuffer driver for the s3c2410");
MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:s3c2410-lcd");
-MODULE_ALIAS("platform:s3c2412-lcd");
diff --git a/trunk/drivers/video/s3c2410fb.h b/trunk/drivers/video/s3c2410fb.h
index 9a6ba3e9d1b8..dbb73b95e2ef 100644
--- a/trunk/drivers/video/s3c2410fb.h
+++ b/trunk/drivers/video/s3c2410fb.h
@@ -1,14 +1,26 @@
/*
* linux/drivers/video/s3c2410fb.h
- * Copyright (c) 2004 Arnaud Patard
- *
- * S3C2410 LCD Framebuffer Driver
+ * Copyright (c) Arnaud Patard
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file COPYING in the main directory of this archive for
* more details.
*
-*/
+ * S3C2410 LCD Controller Frame Buffer Driver
+ * based on skeletonfb.c, sa1100fb.h
+ *
+ * ChangeLog
+ *
+ * 2004-12-04: Arnaud Patard
+ * - Moved dprintk to s3c2410fb.c
+ *
+ * 2004-09-07: Arnaud Patard
+ * - Renamed from h1940fb.h to s3c2410fb.h
+ * - Changed h1940 to s3c2410
+ *
+ * 2004-07-15: Arnaud Patard
+ * - First version
+ */
#ifndef __S3C2410FB_H
#define __S3C2410FB_H
diff --git a/trunk/drivers/video/sis/sis_main.c b/trunk/drivers/video/sis/sis_main.c
index b9343844cd1f..73803624c131 100644
--- a/trunk/drivers/video/sis/sis_main.c
+++ b/trunk/drivers/video/sis/sis_main.c
@@ -5787,7 +5787,7 @@ sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
} else {
struct sis_video_info *countvideo = card_list;
ivideo->cardnumber = 1;
- while((countvideo = countvideo->next) != NULL)
+ while((countvideo = countvideo->next) != 0)
ivideo->cardnumber++;
}
diff --git a/trunk/drivers/video/sm501fb.c b/trunk/drivers/video/sm501fb.c
index 15d4a768b1f6..742b5c656d66 100644
--- a/trunk/drivers/video/sm501fb.c
+++ b/trunk/drivers/video/sm501fb.c
@@ -663,14 +663,14 @@ static void sm501fb_panel_power(struct sm501fb_info *fbi, int to)
sm501fb_sync_regs(fbi);
mdelay(10);
- if (!(pd->flags & SM501FB_FLAG_PANEL_NO_VBIASEN)) {
+ if (pd->flags & SM501FB_FLAG_PANEL_USE_VBIASEN) {
control |= SM501_DC_PANEL_CONTROL_BIAS; /* VBIASEN */
writel(control, ctrl_reg);
sm501fb_sync_regs(fbi);
mdelay(10);
}
- if (!(pd->flags & SM501FB_FLAG_PANEL_NO_FPEN)) {
+ if (pd->flags & SM501FB_FLAG_PANEL_USE_FPEN) {
control |= SM501_DC_PANEL_CONTROL_FPEN;
writel(control, ctrl_reg);
sm501fb_sync_regs(fbi);
@@ -678,14 +678,14 @@ static void sm501fb_panel_power(struct sm501fb_info *fbi, int to)
}
} else if (!to && (control & SM501_DC_PANEL_CONTROL_VDD) != 0) {
/* disable panel power */
- if (!(pd->flags & SM501FB_FLAG_PANEL_NO_FPEN)) {
+ if (pd->flags & SM501FB_FLAG_PANEL_USE_FPEN) {
control &= ~SM501_DC_PANEL_CONTROL_FPEN;
writel(control, ctrl_reg);
sm501fb_sync_regs(fbi);
mdelay(10);
}
- if (!(pd->flags & SM501FB_FLAG_PANEL_NO_VBIASEN)) {
+ if (pd->flags & SM501FB_FLAG_PANEL_USE_VBIASEN) {
control &= ~SM501_DC_PANEL_CONTROL_BIAS;
writel(control, ctrl_reg);
sm501fb_sync_regs(fbi);
diff --git a/trunk/fs/ecryptfs/crypto.c b/trunk/fs/ecryptfs/crypto.c
index e2832bc7869a..cd62d75b2cc0 100644
--- a/trunk/fs/ecryptfs/crypto.c
+++ b/trunk/fs/ecryptfs/crypto.c
@@ -1906,9 +1906,9 @@ int ecryptfs_get_tfm_and_mutex_for_cipher_name(struct crypto_blkcipher **tfm,
goto out;
}
}
+ mutex_unlock(&key_tfm_list_mutex);
(*tfm) = key_tfm->key_tfm;
(*tfm_mutex) = &key_tfm->key_tfm_mutex;
out:
- mutex_unlock(&key_tfm_list_mutex);
return rc;
}
diff --git a/trunk/fs/fuse/inode.c b/trunk/fs/fuse/inode.c
index 43e99513334a..fb77e0962132 100644
--- a/trunk/fs/fuse/inode.c
+++ b/trunk/fs/fuse/inode.c
@@ -488,12 +488,7 @@ static struct fuse_conn *new_conn(struct super_block *sb)
err = bdi_init(&fc->bdi);
if (err)
goto error_kfree;
- if (sb->s_bdev) {
- err = bdi_register(&fc->bdi, NULL, "%u:%u-fuseblk",
- MAJOR(fc->dev), MINOR(fc->dev));
- } else {
- err = bdi_register_dev(&fc->bdi, fc->dev);
- }
+ err = bdi_register_dev(&fc->bdi, fc->dev);
if (err)
goto error_bdi_destroy;
/*
diff --git a/trunk/fs/ntfs/upcase.c b/trunk/fs/ntfs/upcase.c
index e2f72ca98037..9101807dc81a 100644
--- a/trunk/fs/ntfs/upcase.c
+++ b/trunk/fs/ntfs/upcase.c
@@ -77,10 +77,11 @@ ntfschar *generate_default_upcase(void)
uc[i] = cpu_to_le16(i);
for (r = 0; uc_run_table[r][0]; r++)
for (i = uc_run_table[r][0]; i < uc_run_table[r][1]; i++)
- le16_add_cpu(&uc[i], uc_run_table[r][2]);
+ uc[i] = cpu_to_le16(le16_to_cpu(uc[i]) +
+ uc_run_table[r][2]);
for (r = 0; uc_dup_table[r][0]; r++)
for (i = uc_dup_table[r][0]; i < uc_dup_table[r][1]; i += 2)
- le16_add_cpu(&uc[i + 1], -1);
+ uc[i + 1] = cpu_to_le16(le16_to_cpu(uc[i + 1]) - 1);
for (r = 0; uc_word_table[r][0]; r++)
uc[uc_word_table[r][0]] = cpu_to_le16(uc_word_table[r][1]);
return uc;
diff --git a/trunk/fs/proc/inode.c b/trunk/fs/proc/inode.c
index b08d10017911..6f4e8dc97da1 100644
--- a/trunk/fs/proc/inode.c
+++ b/trunk/fs/proc/inode.c
@@ -425,8 +425,7 @@ struct inode *proc_get_inode(struct super_block *sb, unsigned int ino,
}
}
unlock_new_inode(inode);
- } else
- module_put(de->owner);
+ }
return inode;
out_ino:
diff --git a/trunk/fs/proc/proc_misc.c b/trunk/fs/proc/proc_misc.c
index 32dc14cd8900..74a323d2b850 100644
--- a/trunk/fs/proc/proc_misc.c
+++ b/trunk/fs/proc/proc_misc.c
@@ -139,7 +139,7 @@ static int meminfo_read_proc(char *page, char **start, off_t off,
#define K(x) ((x) << (PAGE_SHIFT - 10))
si_meminfo(&i);
si_swapinfo(&i);
- committed = atomic_long_read(&vm_committed_space);
+ committed = atomic_read(&vm_committed_space);
allowed = ((totalram_pages - hugetlb_total_pages())
* sysctl_overcommit_ratio / 100) + total_swap_pages;
diff --git a/trunk/fs/xfs/linux-2.6/xfs_buf.c b/trunk/fs/xfs/linux-2.6/xfs_buf.c
index 98e0e86093b4..5105015a75ad 100644
--- a/trunk/fs/xfs/linux-2.6/xfs_buf.c
+++ b/trunk/fs/xfs/linux-2.6/xfs_buf.c
@@ -387,8 +387,6 @@ _xfs_buf_lookup_pages(
if (unlikely(page == NULL)) {
if (flags & XBF_READ_AHEAD) {
bp->b_page_count = i;
- for (i = 0; i < bp->b_page_count; i++)
- unlock_page(bp->b_pages[i]);
return -ENOMEM;
}
@@ -418,24 +416,17 @@ _xfs_buf_lookup_pages(
ASSERT(!PagePrivate(page));
if (!PageUptodate(page)) {
page_count--;
- if (blocksize >= PAGE_CACHE_SIZE) {
- if (flags & XBF_READ)
- bp->b_flags |= _XBF_PAGE_LOCKED;
- } else if (!PagePrivate(page)) {
+ if (blocksize < PAGE_CACHE_SIZE && !PagePrivate(page)) {
if (test_page_region(page, offset, nbytes))
page_count++;
}
}
+ unlock_page(page);
bp->b_pages[i] = page;
offset = 0;
}
- if (!(bp->b_flags & _XBF_PAGE_LOCKED)) {
- for (i = 0; i < bp->b_page_count; i++)
- unlock_page(bp->b_pages[i]);
- }
-
if (page_count == bp->b_page_count)
bp->b_flags |= XBF_DONE;
@@ -755,7 +746,6 @@ xfs_buf_associate_memory(
bp->b_count_desired = len;
bp->b_buffer_length = buflen;
bp->b_flags |= XBF_MAPPED;
- bp->b_flags &= ~_XBF_PAGE_LOCKED;
return 0;
}
@@ -1103,10 +1093,8 @@ _xfs_buf_ioend(
xfs_buf_t *bp,
int schedule)
{
- if (atomic_dec_and_test(&bp->b_io_remaining) == 1) {
- bp->b_flags &= ~_XBF_PAGE_LOCKED;
+ if (atomic_dec_and_test(&bp->b_io_remaining) == 1)
xfs_buf_ioend(bp, schedule);
- }
}
STATIC void
@@ -1137,9 +1125,6 @@ xfs_buf_bio_end_io(
if (--bvec >= bio->bi_io_vec)
prefetchw(&bvec->bv_page->flags);
-
- if (bp->b_flags & _XBF_PAGE_LOCKED)
- unlock_page(page);
} while (bvec >= bio->bi_io_vec);
_xfs_buf_ioend(bp, 1);
@@ -1178,8 +1163,7 @@ _xfs_buf_ioapply(
* filesystem block size is not smaller than the page size.
*/
if ((bp->b_buffer_length < PAGE_CACHE_SIZE) &&
- ((bp->b_flags & (XBF_READ|_XBF_PAGE_LOCKED)) ==
- (XBF_READ|_XBF_PAGE_LOCKED)) &&
+ (bp->b_flags & XBF_READ) &&
(blocksize >= PAGE_CACHE_SIZE)) {
bio = bio_alloc(GFP_NOIO, 1);
diff --git a/trunk/fs/xfs/linux-2.6/xfs_buf.h b/trunk/fs/xfs/linux-2.6/xfs_buf.h
index f948ec7ba9a4..841d7883528d 100644
--- a/trunk/fs/xfs/linux-2.6/xfs_buf.h
+++ b/trunk/fs/xfs/linux-2.6/xfs_buf.h
@@ -66,25 +66,6 @@ typedef enum {
_XBF_PAGES = (1 << 18), /* backed by refcounted pages */
_XBF_RUN_QUEUES = (1 << 19),/* run block device task queue */
_XBF_DELWRI_Q = (1 << 21), /* buffer on delwri queue */
-
- /*
- * Special flag for supporting metadata blocks smaller than a FSB.
- *
- * In this case we can have multiple xfs_buf_t on a single page and
- * need to lock out concurrent xfs_buf_t readers as they only
- * serialise access to the buffer.
- *
- * If the FSB size >= PAGE_CACHE_SIZE case, we have no serialisation
- * between reads of the page. Hence we can have one thread read the
- * page and modify it, but then race with another thread that thinks
- * the page is not up-to-date and hence reads it again.
- *
- * The result is that the first modifcation to the page is lost.
- * This sort of AGF/AGI reading race can happen when unlinking inodes
- * that require truncation and results in the AGI unlinked list
- * modifications being lost.
- */
- _XBF_PAGE_LOCKED = (1 << 22),
} xfs_buf_flags_t;
typedef enum {
diff --git a/trunk/fs/xfs/linux-2.6/xfs_file.c b/trunk/fs/xfs/linux-2.6/xfs_file.c
index 5f60363b9343..65e78c13d4ae 100644
--- a/trunk/fs/xfs/linux-2.6/xfs_file.c
+++ b/trunk/fs/xfs/linux-2.6/xfs_file.c
@@ -184,24 +184,19 @@ xfs_file_release(
return -xfs_release(XFS_I(inode));
}
-/*
- * We ignore the datasync flag here because a datasync is effectively
- * identical to an fsync. That is, datasync implies that we need to write
- * only the metadata needed to be able to access the data that is written
- * if we crash after the call completes. Hence if we are writing beyond
- * EOF we have to log the inode size change as well, which makes it a
- * full fsync. If we don't write beyond EOF, the inode core will be
- * clean in memory and so we don't need to log the inode, just like
- * fsync.
- */
STATIC int
xfs_file_fsync(
struct file *filp,
struct dentry *dentry,
int datasync)
{
+ int flags = FSYNC_WAIT;
+
+ if (datasync)
+ flags |= FSYNC_DATA;
xfs_iflags_clear(XFS_I(dentry->d_inode), XFS_ITRUNCATED);
- return -xfs_fsync(XFS_I(dentry->d_inode));
+ return -xfs_fsync(XFS_I(dentry->d_inode), flags,
+ (xfs_off_t)0, (xfs_off_t)-1);
}
/*
diff --git a/trunk/fs/xfs/linux-2.6/xfs_vnode.h b/trunk/fs/xfs/linux-2.6/xfs_vnode.h
index 25eb2a9e8d9b..9d73cb5c0fc7 100644
--- a/trunk/fs/xfs/linux-2.6/xfs_vnode.h
+++ b/trunk/fs/xfs/linux-2.6/xfs_vnode.h
@@ -229,6 +229,14 @@ static inline void vn_atime_to_time_t(bhv_vnode_t *vp, time_t *tt)
#define ATTR_NOLOCK 0x200 /* Don't grab any conflicting locks */
#define ATTR_NOSIZETOK 0x400 /* Don't get the SIZE token */
+/*
+ * Flags to vop_fsync/reclaim.
+ */
+#define FSYNC_NOWAIT 0 /* asynchronous flush */
+#define FSYNC_WAIT 0x1 /* synchronous fsync or forced reclaim */
+#define FSYNC_INVAL 0x2 /* flush and invalidate cached data */
+#define FSYNC_DATA 0x4 /* synchronous fsync of data only */
+
/*
* Tracking vnode activity.
*/
diff --git a/trunk/fs/xfs/xfs_inode.c b/trunk/fs/xfs/xfs_inode.c
index e569bf5d6cf0..cf0bb9c1d621 100644
--- a/trunk/fs/xfs/xfs_inode.c
+++ b/trunk/fs/xfs/xfs_inode.c
@@ -2974,7 +2974,6 @@ xfs_iflush_cluster(
xfs_mount_t *mp = ip->i_mount;
xfs_perag_t *pag = xfs_get_perag(mp, ip->i_ino);
unsigned long first_index, mask;
- unsigned long inodes_per_cluster;
int ilist_size;
xfs_inode_t **ilist;
xfs_inode_t *iq;
@@ -2986,9 +2985,8 @@ xfs_iflush_cluster(
ASSERT(pag->pagi_inodeok);
ASSERT(pag->pag_ici_init);
- inodes_per_cluster = XFS_INODE_CLUSTER_SIZE(mp) >> mp->m_sb.sb_inodelog;
- ilist_size = inodes_per_cluster * sizeof(xfs_inode_t *);
- ilist = kmem_alloc(ilist_size, KM_MAYFAIL|KM_NOFS);
+ ilist_size = XFS_INODE_CLUSTER_SIZE(mp) * sizeof(xfs_inode_t *);
+ ilist = kmem_alloc(ilist_size, KM_MAYFAIL);
if (!ilist)
return 0;
@@ -2997,7 +2995,8 @@ xfs_iflush_cluster(
read_lock(&pag->pag_ici_lock);
/* really need a gang lookup range call here */
nr_found = radix_tree_gang_lookup(&pag->pag_ici_root, (void**)ilist,
- first_index, inodes_per_cluster);
+ first_index,
+ XFS_INODE_CLUSTER_SIZE(mp));
if (nr_found == 0)
goto out_free;
diff --git a/trunk/fs/xfs/xfs_vnodeops.c b/trunk/fs/xfs/xfs_vnodeops.c
index e475e3717eb3..70702a60b4bb 100644
--- a/trunk/fs/xfs/xfs_vnodeops.c
+++ b/trunk/fs/xfs/xfs_vnodeops.c
@@ -856,14 +856,18 @@ xfs_readlink(
/*
* xfs_fsync
*
- * This is called to sync the inode and its data out to disk. We need to hold
- * the I/O lock while flushing the data, and the inode lock while flushing the
- * inode. The inode lock CANNOT be held while flushing the data, so acquire
- * after we're done with that.
+ * This is called to sync the inode and its data out to disk.
+ * We need to hold the I/O lock while flushing the data, and
+ * the inode lock while flushing the inode. The inode lock CANNOT
+ * be held while flushing the data, so acquire after we're done
+ * with that.
*/
int
xfs_fsync(
- xfs_inode_t *ip)
+ xfs_inode_t *ip,
+ int flag,
+ xfs_off_t start,
+ xfs_off_t stop)
{
xfs_trans_t *tp;
int error;
@@ -871,79 +875,103 @@ xfs_fsync(
xfs_itrace_entry(ip);
+ ASSERT(start >= 0 && stop >= -1);
+
if (XFS_FORCED_SHUTDOWN(ip->i_mount))
return XFS_ERROR(EIO);
- /* capture size updates in I/O completion before writing the inode. */
- error = filemap_fdatawait(vn_to_inode(XFS_ITOV(ip))->i_mapping);
- if (error)
- return XFS_ERROR(error);
+ if (flag & FSYNC_DATA)
+ filemap_fdatawait(vn_to_inode(XFS_ITOV(ip))->i_mapping);
/*
- * We always need to make sure that the required inode state is safe on
- * disk. The vnode might be clean but we still might need to force the
- * log because of committed transactions that haven't hit the disk yet.
- * Likewise, there could be unflushed non-transactional changes to the
- * inode core that have to go to disk and this requires us to issue
- * a synchronous transaction to capture these changes correctly.
+ * We always need to make sure that the required inode state
+ * is safe on disk. The vnode might be clean but because
+ * of committed transactions that haven't hit the disk yet.
+ * Likewise, there could be unflushed non-transactional
+ * changes to the inode core that have to go to disk.
*
- * This code relies on the assumption that if the update_* fields
- * of the inode are clear and the inode is unpinned then it is clean
- * and no action is required.
+ * The following code depends on one assumption: that
+ * any transaction that changes an inode logs the core
+ * because it has to change some field in the inode core
+ * (typically nextents or nblocks). That assumption
+ * implies that any transactions against an inode will
+ * catch any non-transactional updates. If inode-altering
+ * transactions exist that violate this assumption, the
+ * code breaks. Right now, it figures that if the involved
+ * update_* field is clear and the inode is unpinned, the
+ * inode is clean. Either it's been flushed or it's been
+ * committed and the commit has hit the disk unpinning the inode.
+ * (Note that xfs_inode_item_format() called at commit clears
+ * the update_* fields.)
*/
xfs_ilock(ip, XFS_ILOCK_SHARED);
- if (!(ip->i_update_size || ip->i_update_core)) {
+ /* If we are flushing data then we care about update_size
+ * being set, otherwise we care about update_core
+ */
+ if ((flag & FSYNC_DATA) ?
+ (ip->i_update_size == 0) :
+ (ip->i_update_core == 0)) {
/*
- * Timestamps/size haven't changed since last inode flush or
- * inode transaction commit. That means either nothing got
- * written or a transaction committed which caught the updates.
- * If the latter happened and the transaction hasn't hit the
- * disk yet, the inode will be still be pinned. If it is,
- * force the log.
+ * Timestamps/size haven't changed since last inode
+ * flush or inode transaction commit. That means
+ * either nothing got written or a transaction
+ * committed which caught the updates. If the
+ * latter happened and the transaction hasn't
+ * hit the disk yet, the inode will be still
+ * be pinned. If it is, force the log.
*/
xfs_iunlock(ip, XFS_ILOCK_SHARED);
if (xfs_ipincount(ip)) {
- error = _xfs_log_force(ip->i_mount, (xfs_lsn_t)0,
- XFS_LOG_FORCE | XFS_LOG_SYNC,
+ _xfs_log_force(ip->i_mount, (xfs_lsn_t)0,
+ XFS_LOG_FORCE |
+ ((flag & FSYNC_WAIT)
+ ? XFS_LOG_SYNC : 0),
&log_flushed);
} else {
/*
- * If the inode is not pinned and nothing has changed
- * we don't need to flush the cache.
+ * If the inode is not pinned and nothing
+ * has changed we don't need to flush the
+ * cache.
*/
changed = 0;
}
+ error = 0;
} else {
/*
- * Kick off a transaction to log the inode core to get the
- * updates. The sync transaction will also force the log.
+ * Kick off a transaction to log the inode
+ * core to get the updates. Make it
+ * sync if FSYNC_WAIT is passed in (which
+ * is done by everybody but specfs). The
+ * sync transaction will also force the log.
*/
xfs_iunlock(ip, XFS_ILOCK_SHARED);
tp = xfs_trans_alloc(ip->i_mount, XFS_TRANS_FSYNC_TS);
- error = xfs_trans_reserve(tp, 0,
- XFS_FSYNC_TS_LOG_RES(ip->i_mount), 0, 0, 0);
- if (error) {
+ if ((error = xfs_trans_reserve(tp, 0,
+ XFS_FSYNC_TS_LOG_RES(ip->i_mount),
+ 0, 0, 0))) {
xfs_trans_cancel(tp, 0);
return error;
}
xfs_ilock(ip, XFS_ILOCK_EXCL);
/*
- * Note - it's possible that we might have pushed ourselves out
- * of the way during trans_reserve which would flush the inode.
- * But there's no guarantee that the inode buffer has actually
- * gone out yet (it's delwri). Plus the buffer could be pinned
- * anyway if it's part of an inode in another recent
- * transaction. So we play it safe and fire off the
- * transaction anyway.
+ * Note - it's possible that we might have pushed
+ * ourselves out of the way during trans_reserve
+ * which would flush the inode. But there's no
+ * guarantee that the inode buffer has actually
+ * gone out yet (it's delwri). Plus the buffer
+ * could be pinned anyway if it's part of an
+ * inode in another recent transaction. So we
+ * play it safe and fire off the transaction anyway.
*/
xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL);
xfs_trans_ihold(tp, ip);
xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
- xfs_trans_set_sync(tp);
+ if (flag & FSYNC_WAIT)
+ xfs_trans_set_sync(tp);
error = _xfs_trans_commit(tp, 0, &log_flushed);
xfs_iunlock(ip, XFS_ILOCK_EXCL);
diff --git a/trunk/fs/xfs/xfs_vnodeops.h b/trunk/fs/xfs/xfs_vnodeops.h
index 57335ba4ce53..8abe8f186e20 100644
--- a/trunk/fs/xfs/xfs_vnodeops.h
+++ b/trunk/fs/xfs/xfs_vnodeops.h
@@ -18,7 +18,8 @@ int xfs_open(struct xfs_inode *ip);
int xfs_setattr(struct xfs_inode *ip, struct bhv_vattr *vap, int flags,
struct cred *credp);
int xfs_readlink(struct xfs_inode *ip, char *link);
-int xfs_fsync(struct xfs_inode *ip);
+int xfs_fsync(struct xfs_inode *ip, int flag, xfs_off_t start,
+ xfs_off_t stop);
int xfs_release(struct xfs_inode *ip);
int xfs_inactive(struct xfs_inode *ip);
int xfs_lookup(struct xfs_inode *dp, struct xfs_name *name,
diff --git a/trunk/include/asm-arm/arch-omap/board-palmte.h b/trunk/include/asm-arm/arch-omap/board-palmte.h
index 6fac2c8935be..cd22035a7160 100644
--- a/trunk/include/asm-arm/arch-omap/board-palmte.h
+++ b/trunk/include/asm-arm/arch-omap/board-palmte.h
@@ -14,6 +14,8 @@
#ifndef __OMAP_BOARD_PALMTE_H
#define __OMAP_BOARD_PALMTE_H
+#include
+
#define PALMTE_USBDETECT_GPIO 0
#define PALMTE_USB_OR_DC_GPIO 1
#define PALMTE_TSC_GPIO 4
diff --git a/trunk/include/asm-arm/arch-omap/clock.h b/trunk/include/asm-arm/arch-omap/clock.h
index 12a5e4de9518..57523bdb642b 100644
--- a/trunk/include/asm-arm/arch-omap/clock.h
+++ b/trunk/include/asm-arm/arch-omap/clock.h
@@ -73,8 +73,6 @@ struct clk {
#endif
};
-struct cpufreq_frequency_table;
-
struct clk_functions {
int (*clk_enable)(struct clk *clk);
void (*clk_disable)(struct clk *clk);
@@ -85,9 +83,6 @@ struct clk_functions {
void (*clk_allow_idle)(struct clk *clk);
void (*clk_deny_idle)(struct clk *clk);
void (*clk_disable_unused)(struct clk *clk);
-#ifdef CONFIG_CPU_FREQ
- void (*clk_init_cpufreq_table)(struct cpufreq_frequency_table **);
-#endif
};
extern unsigned int mpurate;
diff --git a/trunk/include/asm-arm/arch-omap/entry-macro.S b/trunk/include/asm-arm/arch-omap/entry-macro.S
index 369093a45fcf..74cd57221c8e 100644
--- a/trunk/include/asm-arm/arch-omap/entry-macro.S
+++ b/trunk/include/asm-arm/arch-omap/entry-macro.S
@@ -8,7 +8,6 @@
* warranty of any kind, whether express or implied.
*/
#include
-#include
#include
#if defined(CONFIG_ARCH_OMAP1)
diff --git a/trunk/include/asm-arm/arch-omap/gpio.h b/trunk/include/asm-arm/arch-omap/gpio.h
index 5ee6a49864c3..86621a04cd8f 100644
--- a/trunk/include/asm-arm/arch-omap/gpio.h
+++ b/trunk/include/asm-arm/arch-omap/gpio.h
@@ -26,6 +26,7 @@
#ifndef __ASM_ARCH_OMAP_GPIO_H
#define __ASM_ARCH_OMAP_GPIO_H
+#include
#include
#include
diff --git a/trunk/include/asm-arm/arch-omap/hardware.h b/trunk/include/asm-arm/arch-omap/hardware.h
index 91d85b3417b7..da572092e255 100644
--- a/trunk/include/asm-arm/arch-omap/hardware.h
+++ b/trunk/include/asm-arm/arch-omap/hardware.h
@@ -41,6 +41,7 @@
#include
#include
#endif
+#include
#include
/*
diff --git a/trunk/include/asm-arm/arch-sa1100/collie.h b/trunk/include/asm-arm/arch-sa1100/collie.h
index 762eba535813..14a344aa3cc7 100644
--- a/trunk/include/asm-arm/arch-sa1100/collie.h
+++ b/trunk/include/asm-arm/arch-sa1100/collie.h
@@ -34,12 +34,9 @@
#define COLLIE_GPIO_ON_KEY GPIO_GPIO (0)
#define COLLIE_GPIO_AC_IN GPIO_GPIO (1)
-#define COLLIE_GPIO_SDIO_INT GPIO_GPIO (11)
#define COLLIE_GPIO_CF_IRQ GPIO_GPIO (14)
#define COLLIE_GPIO_nREMOCON_INT GPIO_GPIO (15)
#define COLLIE_GPIO_UCB1x00_RESET GPIO_GPIO (16)
-#define COLLIE_GPIO_nMIC_ON GPIO_GPIO (17)
-#define COLLIE_GPIO_nREMOCON_ON GPIO_GPIO (18)
#define COLLIE_GPIO_CO GPIO_GPIO (20)
#define COLLIE_GPIO_MCP_CLK GPIO_GPIO (21)
#define COLLIE_GPIO_CF_CD GPIO_GPIO (22)
@@ -52,7 +49,6 @@
#define COLLIE_IRQ_GPIO_ON_KEY IRQ_GPIO0
#define COLLIE_IRQ_GPIO_AC_IN IRQ_GPIO1
-#define COLLIE_IRQ_GPIO_SDIO_IRQ IRQ_GPIO11
#define COLLIE_IRQ_GPIO_CF_IRQ IRQ_GPIO14
#define COLLIE_IRQ_GPIO_nREMOCON_INT IRQ_GPIO15
#define COLLIE_IRQ_GPIO_CO IRQ_GPIO20
diff --git a/trunk/include/asm-arm/page.h b/trunk/include/asm-arm/page.h
index 8e05bdb5f12f..5c22b0112106 100644
--- a/trunk/include/asm-arm/page.h
+++ b/trunk/include/asm-arm/page.h
@@ -179,10 +179,10 @@ typedef unsigned long pgprot_t;
#endif /* STRICT_MM_TYPECHECKS */
-#endif /* CONFIG_MMU */
-
typedef struct page *pgtable_t;
+#endif /* CONFIG_MMU */
+
#include
#endif /* !__ASSEMBLY__ */
diff --git a/trunk/include/asm-arm/system.h b/trunk/include/asm-arm/system.h
index 514af792a598..6335de9a2bb3 100644
--- a/trunk/include/asm-arm/system.h
+++ b/trunk/include/asm-arm/system.h
@@ -48,6 +48,20 @@
#define CPUID_TCM 2
#define CPUID_TLBTYPE 3
+#ifdef CONFIG_CPU_CP15
+#define read_cpuid(reg) \
+ ({ \
+ unsigned int __val; \
+ asm("mrc p15, 0, %0, c0, c0, " __stringify(reg) \
+ : "=r" (__val) \
+ : \
+ : "cc"); \
+ __val; \
+ })
+#else
+#define read_cpuid(reg) (processor_id)
+#endif
+
/*
* This is used to ensure the compiler did actually allocate the register we
* asked it for some inline assembly sequences. Apparently we can't trust
@@ -64,21 +78,6 @@
#include
#include
-#ifdef CONFIG_CPU_CP15
-#define read_cpuid(reg) \
- ({ \
- unsigned int __val; \
- asm("mrc p15, 0, %0, c0, c0, " __stringify(reg) \
- : "=r" (__val) \
- : \
- : "cc"); \
- __val; \
- })
-#else
-extern unsigned int processor_id;
-#define read_cpuid(reg) (processor_id)
-#endif
-
/*
* The CPU ID never changes at run time, so we might as well tell the
* compiler that it's constant. Use this function to read the CPU ID
diff --git a/trunk/include/asm-generic/gpio.h b/trunk/include/asm-generic/gpio.h
index 6be061d09da9..ecf675a59d21 100644
--- a/trunk/include/asm-generic/gpio.h
+++ b/trunk/include/asm-generic/gpio.h
@@ -1,12 +1,8 @@
#ifndef _ASM_GENERIC_GPIO_H
#define _ASM_GENERIC_GPIO_H
-#include
-
#ifdef CONFIG_HAVE_GPIO_LIB
-#include
-
/* Platforms may implement their GPIO interface with library code,
* at a small performance cost for non-inlined operations and some
* extra memory (for code and for per-GPIO table entries).
@@ -78,7 +74,7 @@ struct gpio_chip {
extern const char *gpiochip_is_requested(struct gpio_chip *chip,
unsigned offset);
-extern int __must_check gpiochip_reserve(int start, int ngpio);
+extern int __init __must_check gpiochip_reserve(int start, int ngpio);
/* add/remove chips */
extern int gpiochip_add(struct gpio_chip *chip);
diff --git a/trunk/include/asm-mips/gic.h b/trunk/include/asm-mips/gic.h
index 3a492f225f00..01b2f92dc33d 100644
--- a/trunk/include/asm-mips/gic.h
+++ b/trunk/include/asm-mips/gic.h
@@ -330,7 +330,7 @@
#define GIC_SH_RMASK_OFS 0x0300
#define GIC_CLR_INTR_MASK(intr, val) \
- GICWRITE(GIC_REG_ADDR(SHARED, GIC_SH_RMASK_OFS + 4 + (((((intr) / 32) ^ 1) - 1) * 4)), ((val) << ((intr) % 32)))
+ GICWRITE(GIC_REG_ADDR(SHARED, GIC_SH_RMASK_OFS + 4 + (((((intr) / 32) ^ 1) - 1) * 4)), ((val) << ((intr) % 32))
/* Register Map for Local Section */
#define GIC_VPE_CTL_OFS 0x0000
diff --git a/trunk/include/asm-mips/mach-au1x00/au1000.h b/trunk/include/asm-mips/mach-au1x00/au1000.h
index 1b5064dac007..363a14ee0ae5 100644
--- a/trunk/include/asm-mips/mach-au1x00/au1000.h
+++ b/trunk/include/asm-mips/mach-au1x00/au1000.h
@@ -1036,7 +1036,7 @@ enum soc_au1200_ints {
#define USBD_INTSTAT 0xB020001C
# define USBDEV_INT_SOF (1 << 12)
# define USBDEV_INT_HF_BIT 6
-# define USBDEV_INT_HF_MASK (0x3f << USBDEV_INT_HF_BIT)
+# define USBDEV_INT_HF_MASK 0x3f << USBDEV_INT_HF_BIT)
# define USBDEV_INT_CMPLT_BIT 0
# define USBDEV_INT_CMPLT_MASK (0x3f << USBDEV_INT_CMPLT_BIT)
#define USBD_CONFIG 0xB0200020
diff --git a/trunk/include/asm-powerpc/mpic.h b/trunk/include/asm-powerpc/mpic.h
index a4d0f876b427..943c5a3fac8a 100644
--- a/trunk/include/asm-powerpc/mpic.h
+++ b/trunk/include/asm-powerpc/mpic.h
@@ -428,11 +428,12 @@ extern void mpic_init(struct mpic *mpic);
*/
-/* Change the priority of an interrupt. Default is 8 for irqs and
+/* Change/Read the priority of an interrupt. Default is 8 for irqs and
* 10 for IPIs. You can call this on both IPIs and IRQ numbers, but the
* IPI number is then the offset'ed (linux irq number mapped to the IPI)
*/
extern void mpic_irq_set_priority(unsigned int irq, unsigned int pri);
+extern unsigned int mpic_irq_get_priority(unsigned int irq);
/* Setup a non-boot CPU */
extern void mpic_setup_this_cpu(void);
diff --git a/trunk/include/asm-x86/tlbflush.h b/trunk/include/asm-x86/tlbflush.h
index 35c76ceb9f40..0c0674d94255 100644
--- a/trunk/include/asm-x86/tlbflush.h
+++ b/trunk/include/asm-x86/tlbflush.h
@@ -22,23 +22,12 @@ static inline void __native_flush_tlb(void)
static inline void __native_flush_tlb_global(void)
{
- unsigned long flags;
- unsigned long cr4;
+ unsigned long cr4 = read_cr4();
- /*
- * Read-modify-write to CR4 - protect it from preemption and
- * from interrupts. (Use the raw variant because this code can
- * be called from deep inside debugging code.)
- */
- raw_local_irq_save(flags);
-
- cr4 = read_cr4();
/* clear PGE */
write_cr4(cr4 & ~X86_CR4_PGE);
/* write old PGE again and flush TLBs */
write_cr4(cr4);
-
- raw_local_irq_restore(flags);
}
static inline void __native_flush_tlb_single(unsigned long addr)
diff --git a/trunk/include/linux/gpio.h b/trunk/include/linux/gpio.h
index 98be6c5762b9..4987a84078ef 100644
--- a/trunk/include/linux/gpio.h
+++ b/trunk/include/linux/gpio.h
@@ -8,9 +8,6 @@
#else
-#include
-#include
-
/*
* Some platforms don't support the GPIO programming interface.
*
diff --git a/trunk/include/linux/mman.h b/trunk/include/linux/mman.h
index dab8892e6ff1..87920a0852a3 100644
--- a/trunk/include/linux/mman.h
+++ b/trunk/include/linux/mman.h
@@ -17,14 +17,14 @@
extern int sysctl_overcommit_memory;
extern int sysctl_overcommit_ratio;
-extern atomic_long_t vm_committed_space;
+extern atomic_t vm_committed_space;
#ifdef CONFIG_SMP
extern void vm_acct_memory(long pages);
#else
static inline void vm_acct_memory(long pages)
{
- atomic_long_add(pages, &vm_committed_space);
+ atomic_add(pages, &vm_committed_space);
}
#endif
diff --git a/trunk/include/linux/mmzone.h b/trunk/include/linux/mmzone.h
index 443bc7cd8c62..c463cd8a15a4 100644
--- a/trunk/include/linux/mmzone.h
+++ b/trunk/include/linux/mmzone.h
@@ -703,7 +703,7 @@ extern struct pglist_data *next_online_pgdat(struct pglist_data *pgdat);
extern struct zone *next_zone(struct zone *zone);
/**
- * for_each_online_pgdat - helper macro to iterate over all online nodes
+ * for_each_pgdat - helper macro to iterate over all nodes
* @pgdat - pointer to a pg_data_t variable
*/
#define for_each_online_pgdat(pgdat) \
diff --git a/trunk/include/linux/pci_ids.h b/trunk/include/linux/pci_ids.h
index 9b940e644179..cf6dbd759395 100644
--- a/trunk/include/linux/pci_ids.h
+++ b/trunk/include/linux/pci_ids.h
@@ -1761,7 +1761,6 @@
#define PCI_VENDOR_ID_INTASHIELD 0x135a
#define PCI_DEVICE_ID_INTASHIELD_IS200 0x0d80
-#define PCI_DEVICE_ID_INTASHIELD_IS400 0x0dc0
#define PCI_VENDOR_ID_QUATECH 0x135C
#define PCI_DEVICE_ID_QUATECH_QSC100 0x0010
@@ -2384,9 +2383,6 @@
#define PCI_DEVICE_ID_INTEL_ICH10_4 0x3a30
#define PCI_DEVICE_ID_INTEL_ICH10_5 0x3a60
#define PCI_DEVICE_ID_INTEL_IOAT_SNB 0x402f
-#define PCI_DEVICE_ID_INTEL_5400_ERR 0x4030
-#define PCI_DEVICE_ID_INTEL_5400_FBD0 0x4035
-#define PCI_DEVICE_ID_INTEL_5400_FBD1 0x4036
#define PCI_DEVICE_ID_INTEL_IOAT_SCNB 0x65ff
#define PCI_DEVICE_ID_INTEL_TOLAPAI_0 0x5031
#define PCI_DEVICE_ID_INTEL_TOLAPAI_1 0x5032
diff --git a/trunk/include/linux/raid/bitmap.h b/trunk/include/linux/raid/bitmap.h
index 78bfdea24a8e..47fbcba11850 100644
--- a/trunk/include/linux/raid/bitmap.h
+++ b/trunk/include/linux/raid/bitmap.h
@@ -262,6 +262,7 @@ int bitmap_create(mddev_t *mddev);
void bitmap_flush(mddev_t *mddev);
void bitmap_destroy(mddev_t *mddev);
+char *file_path(struct file *file, char *buf, int count);
void bitmap_print_sb(struct bitmap *bitmap);
void bitmap_update_sb(struct bitmap *bitmap);
diff --git a/trunk/include/linux/raid/md.h b/trunk/include/linux/raid/md.h
index b7386ae9d288..81a1a02d4566 100644
--- a/trunk/include/linux/raid/md.h
+++ b/trunk/include/linux/raid/md.h
@@ -72,8 +72,6 @@
*/
#define MD_PATCHLEVEL_VERSION 3
-extern int mdp_major;
-
extern int register_md_personality (struct mdk_personality *p);
extern int unregister_md_personality (struct mdk_personality *p);
extern mdk_thread_t * md_register_thread (void (*run) (mddev_t *mddev),
diff --git a/trunk/include/linux/raid/md_k.h b/trunk/include/linux/raid/md_k.h
index 3dea9f545c8f..812ffa590cff 100644
--- a/trunk/include/linux/raid/md_k.h
+++ b/trunk/include/linux/raid/md_k.h
@@ -180,15 +180,13 @@ struct mddev_s
int sync_speed_min;
int sync_speed_max;
- /* resync even though the same disks are shared among md-devices */
- int parallel_resync;
-
int ok_start_degraded;
/* recovery/resync flags
* NEEDED: we might need to start a resync/recover
* RUNNING: a thread is running, or about to be started
* SYNC: actually doing a resync, not a recovery
- * INTR: resync needs to be aborted for some reason
+ * ERR: and IO error was detected - abort the resync/recovery
+ * INTR: someone requested a (clean) early abort.
* DONE: thread is done and is waiting to be reaped
* REQUEST: user-space has requested a sync (used with SYNC)
* CHECK: user-space request for for check-only, no repair
@@ -198,6 +196,7 @@ struct mddev_s
*/
#define MD_RECOVERY_RUNNING 0
#define MD_RECOVERY_SYNC 1
+#define MD_RECOVERY_ERR 2
#define MD_RECOVERY_INTR 3
#define MD_RECOVERY_DONE 4
#define MD_RECOVERY_NEEDED 5
diff --git a/trunk/include/linux/sm501.h b/trunk/include/linux/sm501.h
index 95c1c39ba445..bca134544700 100644
--- a/trunk/include/linux/sm501.h
+++ b/trunk/include/linux/sm501.h
@@ -71,8 +71,8 @@ extern unsigned long sm501_gpio_get(struct device *dev,
#define SM501FB_FLAG_DISABLE_AT_EXIT (1<<1)
#define SM501FB_FLAG_USE_HWCURSOR (1<<2)
#define SM501FB_FLAG_USE_HWACCEL (1<<3)
-#define SM501FB_FLAG_PANEL_NO_FPEN (1<<4)
-#define SM501FB_FLAG_PANEL_NO_VBIASEN (1<<5)
+#define SM501FB_FLAG_PANEL_USE_FPEN (1<<4)
+#define SM501FB_FLAG_PANEL_USE_VBIASEN (1<<5)
struct sm501_platdata_fbsub {
struct fb_videomode *def_mode;
diff --git a/trunk/include/linux/types.h b/trunk/include/linux/types.h
index d4a9ce6e2760..9dc2346627b4 100644
--- a/trunk/include/linux/types.h
+++ b/trunk/include/linux/types.h
@@ -197,6 +197,8 @@ typedef u64 resource_size_t;
typedef u32 resource_size_t;
#endif
+#endif /* __KERNEL__ */
+
struct ustat {
__kernel_daddr_t f_tfree;
__kernel_ino_t f_tinode;
@@ -204,6 +206,4 @@ struct ustat {
char f_fpack[6];
};
-#endif /* __KERNEL__ */
-
#endif /* _LINUX_TYPES_H */
diff --git a/trunk/init/do_mounts_md.c b/trunk/init/do_mounts_md.c
index 693d24694a6c..7473b0c59d4d 100644
--- a/trunk/init/do_mounts_md.c
+++ b/trunk/init/do_mounts_md.c
@@ -24,6 +24,7 @@ static struct {
static int md_setup_ents __initdata;
+extern int mdp_major;
/*
* Parse the command-line parameters given our kernel, but do not
* actually try to invoke the MD device now; that is handled by
diff --git a/trunk/kernel/cgroup.c b/trunk/kernel/cgroup.c
index 15ac0e1e4f4d..fbc6fc8949b4 100644
--- a/trunk/kernel/cgroup.c
+++ b/trunk/kernel/cgroup.c
@@ -2903,7 +2903,7 @@ int cgroup_clone(struct task_struct *tsk, struct cgroup_subsys *subsys)
cg = tsk->cgroups;
parent = task_cgroup(tsk, subsys->subsys_id);
- snprintf(nodename, MAX_CGROUP_TYPE_NAMELEN, "%d", tsk->pid);
+ snprintf(nodename, MAX_CGROUP_TYPE_NAMELEN, "node_%d", tsk->pid);
/* Pin the hierarchy */
atomic_inc(&parent->root->sb->s_active);
diff --git a/trunk/kernel/exit.c b/trunk/kernel/exit.c
index 8f6185e69b69..1510f78a0ffa 100644
--- a/trunk/kernel/exit.c
+++ b/trunk/kernel/exit.c
@@ -126,12 +126,6 @@ static void __exit_signal(struct task_struct *tsk)
__unhash_process(tsk);
- /*
- * Do this under ->siglock, we can race with another thread
- * doing sigqueue_free() if we have SIGQUEUE_PREALLOC signals.
- */
- flush_sigqueue(&tsk->pending);
-
tsk->signal = NULL;
tsk->sighand = NULL;
spin_unlock(&sighand->siglock);
@@ -139,6 +133,7 @@ static void __exit_signal(struct task_struct *tsk)
__cleanup_sighand(sighand);
clear_tsk_thread_flag(tsk,TIF_SIGPENDING);
+ flush_sigqueue(&tsk->pending);
if (sig) {
flush_sigqueue(&sig->shared_pending);
taskstats_tgid_free(sig);
diff --git a/trunk/kernel/module.c b/trunk/kernel/module.c
index 5f80478b746d..f5e9491ef7ac 100644
--- a/trunk/kernel/module.c
+++ b/trunk/kernel/module.c
@@ -1337,19 +1337,7 @@ int mod_sysfs_setup(struct module *mod,
kobject_put(&mod->mkobj.kobj);
return err;
}
-
-static void mod_sysfs_fini(struct module *mod)
-{
- kobject_put(&mod->mkobj.kobj);
-}
-
-#else /* CONFIG_SYSFS */
-
-static void mod_sysfs_fini(struct module *mod)
-{
-}
-
-#endif /* CONFIG_SYSFS */
+#endif
static void mod_kobject_remove(struct module *mod)
{
@@ -1357,7 +1345,7 @@ static void mod_kobject_remove(struct module *mod)
module_param_sysfs_remove(mod);
kobject_put(mod->mkobj.drivers_dir);
kobject_put(mod->holders_dir);
- mod_sysfs_fini(mod);
+ kobject_put(&mod->mkobj.kobj);
}
/*
@@ -1792,7 +1780,7 @@ static struct module *load_module(void __user *umod,
/* Sanity checks against insmoding binaries or wrong arch,
weird elf version */
- if (memcmp(hdr->e_ident, ELFMAG, SELFMAG) != 0
+ if (memcmp(hdr->e_ident, ELFMAG, 4) != 0
|| hdr->e_type != ET_REL
|| !elf_check_arch(hdr)
|| hdr->e_shentsize != sizeof(*sechdrs)) {
diff --git a/trunk/kernel/signal.c b/trunk/kernel/signal.c
index 12ffea7c201d..72bb4f51f963 100644
--- a/trunk/kernel/signal.c
+++ b/trunk/kernel/signal.c
@@ -1242,8 +1242,7 @@ void sigqueue_free(struct sigqueue *q)
/*
* If the signal is still pending remove it from the
* pending queue. We must hold ->siglock while testing
- * q->list to serialize with collect_signal() or with
- * __exit_signal()->flush_sigqueue().
+ * q->list to serialize with collect_signal().
*/
spin_lock_irqsave(lock, flags);
if (!list_empty(&q->list))
diff --git a/trunk/kernel/stop_machine.c b/trunk/kernel/stop_machine.c
index b7350bbfb076..0101aeef7ed7 100644
--- a/trunk/kernel/stop_machine.c
+++ b/trunk/kernel/stop_machine.c
@@ -62,7 +62,8 @@ static int stopmachine(void *cpu)
* help our sisters onto their CPUs. */
if (!prepared && !irqs_disabled)
yield();
- cpu_relax();
+ else
+ cpu_relax();
}
/* Ack: we are exiting. */
@@ -105,10 +106,8 @@ static int stop_machine(void)
}
/* Wait for them all to come to life. */
- while (atomic_read(&stopmachine_thread_ack) != stopmachine_num_threads) {
+ while (atomic_read(&stopmachine_thread_ack) != stopmachine_num_threads)
yield();
- cpu_relax();
- }
/* If some failed, kill them all. */
if (ret < 0) {
diff --git a/trunk/kernel/sys.c b/trunk/kernel/sys.c
index 14e97282eb6c..895d2d4c9493 100644
--- a/trunk/kernel/sys.c
+++ b/trunk/kernel/sys.c
@@ -1652,7 +1652,7 @@ asmlinkage long sys_umask(int mask)
asmlinkage long sys_prctl(int option, unsigned long arg2, unsigned long arg3,
unsigned long arg4, unsigned long arg5)
{
- long error = 0;
+ long uninitialized_var(error);
if (security_task_prctl(option, arg2, arg3, arg4, arg5, &error))
return error;
@@ -1701,7 +1701,9 @@ asmlinkage long sys_prctl(int option, unsigned long arg2, unsigned long arg3,
error = PR_TIMING_STATISTICAL;
break;
case PR_SET_TIMING:
- if (arg2 != PR_TIMING_STATISTICAL)
+ if (arg2 == PR_TIMING_STATISTICAL)
+ error = 0;
+ else
error = -EINVAL;
break;
diff --git a/trunk/mm/memory.c b/trunk/mm/memory.c
index 19e0ae9beecb..fb5608a120ed 100644
--- a/trunk/mm/memory.c
+++ b/trunk/mm/memory.c
@@ -2295,6 +2295,8 @@ static int __do_fault(struct mm_struct *mm, struct vm_area_struct *vma,
vmf.flags = flags;
vmf.page = NULL;
+ BUG_ON(vma->vm_flags & VM_PFNMAP);
+
ret = vma->vm_ops->fault(vma, &vmf);
if (unlikely(ret & (VM_FAULT_ERROR | VM_FAULT_NOPAGE)))
return ret;
diff --git a/trunk/mm/mmap.c b/trunk/mm/mmap.c
index 669499e7c2f5..fac66337da2a 100644
--- a/trunk/mm/mmap.c
+++ b/trunk/mm/mmap.c
@@ -80,7 +80,7 @@ EXPORT_SYMBOL(vm_get_page_prot);
int sysctl_overcommit_memory = OVERCOMMIT_GUESS; /* heuristic overcommit */
int sysctl_overcommit_ratio = 50; /* default is 50% */
int sysctl_max_map_count __read_mostly = DEFAULT_MAX_MAP_COUNT;
-atomic_long_t vm_committed_space = ATOMIC_LONG_INIT(0);
+atomic_t vm_committed_space = ATOMIC_INIT(0);
/*
* Check that a process has enough memory to allocate a new virtual
@@ -177,7 +177,7 @@ int __vm_enough_memory(struct mm_struct *mm, long pages, int cap_sys_admin)
* cast `allowed' as a signed long because vm_committed_space
* sometimes has a negative value
*/
- if (atomic_long_read(&vm_committed_space) < (long)allowed)
+ if (atomic_read(&vm_committed_space) < (long)allowed)
return 0;
error:
vm_unacct_memory(pages);
diff --git a/trunk/mm/nommu.c b/trunk/mm/nommu.c
index dca93fcb8b7a..ef8c62cec697 100644
--- a/trunk/mm/nommu.c
+++ b/trunk/mm/nommu.c
@@ -39,7 +39,7 @@ struct page *mem_map;
unsigned long max_mapnr;
unsigned long num_physpages;
unsigned long askedalloc, realalloc;
-atomic_long_t vm_committed_space = ATOMIC_LONG_INIT(0);
+atomic_t vm_committed_space = ATOMIC_INIT(0);
int sysctl_overcommit_memory = OVERCOMMIT_GUESS; /* heuristic overcommit */
int sysctl_overcommit_ratio = 50; /* default is 50% */
int sysctl_max_map_count = DEFAULT_MAX_MAP_COUNT;
@@ -1410,7 +1410,7 @@ int __vm_enough_memory(struct mm_struct *mm, long pages, int cap_sys_admin)
* cast `allowed' as a signed long because vm_committed_space
* sometimes has a negative value
*/
- if (atomic_long_read(&vm_committed_space) < (long)allowed)
+ if (atomic_read(&vm_committed_space) < (long)allowed)
return 0;
error:
vm_unacct_memory(pages);
diff --git a/trunk/mm/page_alloc.c b/trunk/mm/page_alloc.c
index 8e83f02cd2d3..63835579323a 100644
--- a/trunk/mm/page_alloc.c
+++ b/trunk/mm/page_alloc.c
@@ -1396,9 +1396,6 @@ get_page_from_freelist(gfp_t gfp_mask, nodemask_t *nodemask, unsigned int order,
(void)first_zones_zonelist(zonelist, high_zoneidx, nodemask,
&preferred_zone);
- if (!preferred_zone)
- return NULL;
-
classzone_idx = zone_idx(preferred_zone);
zonelist_scan:
@@ -2807,7 +2804,7 @@ int zone_wait_table_init(struct zone *zone, unsigned long zone_size_pages)
alloc_size = zone->wait_table_hash_nr_entries
* sizeof(wait_queue_head_t);
- if (!slab_is_available()) {
+ if (system_state == SYSTEM_BOOTING) {
zone->wait_table = (wait_queue_head_t *)
alloc_bootmem_node(pgdat, alloc_size);
} else {
@@ -3381,8 +3378,7 @@ static void __paginginit free_area_init_core(struct pglist_data *pgdat,
* is used by this zone for memmap. This affects the watermark
* and per-cpu initialisations
*/
- memmap_pages =
- PAGE_ALIGN(size * sizeof(struct page)) >> PAGE_SHIFT;
+ memmap_pages = (size * sizeof(struct page)) >> PAGE_SHIFT;
if (realsize >= memmap_pages) {
realsize -= memmap_pages;
printk(KERN_DEBUG
diff --git a/trunk/mm/swap.c b/trunk/mm/swap.c
index 45c9f25a8a3b..91e194445a5e 100644
--- a/trunk/mm/swap.c
+++ b/trunk/mm/swap.c
@@ -503,7 +503,7 @@ void vm_acct_memory(long pages)
local = &__get_cpu_var(committed_space);
*local += pages;
if (*local > ACCT_THRESHOLD || *local < -ACCT_THRESHOLD) {
- atomic_long_add(*local, &vm_committed_space);
+ atomic_add(*local, &vm_committed_space);
*local = 0;
}
preempt_enable();
@@ -520,7 +520,7 @@ static int cpu_swap_callback(struct notifier_block *nfb,
committed = &per_cpu(committed_space, (long)hcpu);
if (action == CPU_DEAD || action == CPU_DEAD_FROZEN) {
- atomic_long_add(*committed, &vm_committed_space);
+ atomic_add(*committed, &vm_committed_space);
*committed = 0;
drain_cpu_pagevecs((long)hcpu);
}
diff --git a/trunk/sound/pci/hda/patch_analog.c b/trunk/sound/pci/hda/patch_analog.c
index e0a605adde42..ff1b922c610b 100644
--- a/trunk/sound/pci/hda/patch_analog.c
+++ b/trunk/sound/pci/hda/patch_analog.c
@@ -2858,6 +2858,7 @@ static const char *ad1988_models[AD1988_MODEL_LAST] = {
static struct snd_pci_quirk ad1988_cfg_tbl[] = {
SND_PCI_QUIRK(0x1043, 0x81ec, "Asus P5B-DLX", AD1988_6STACK_DIG),
SND_PCI_QUIRK(0x1043, 0x81f6, "Asus M2N-SLI", AD1988_6STACK_DIG),
+ SND_PCI_QUIRK(0x1043, 0x8277, "Asus P5K-E/WIFI-AP", AD1988_6STACK_DIG),
{}
};