diff --git a/[refs] b/[refs]
index 11ccb4850b2b..1fcbe2f9cecf 100644
--- a/[refs]
+++ b/[refs]
@@ -1,2 +1,2 @@
---
-refs/heads/master: 2f2fde927243bde5fd106da692efef34be12f81c
+refs/heads/master: 9afc416517f36b3b0b109e6590d0b74468fd80f9
diff --git a/trunk/Documentation/DocBook/device-drivers.tmpl b/trunk/Documentation/DocBook/device-drivers.tmpl
index 9c27e5125dd2..2f7fd4360848 100644
--- a/trunk/Documentation/DocBook/device-drivers.tmpl
+++ b/trunk/Documentation/DocBook/device-drivers.tmpl
@@ -102,12 +102,9 @@ X!Iinclude/linux/kobject.h
!Iinclude/linux/device.h
Device Drivers Base
-!Idrivers/base/init.c
!Edrivers/base/driver.c
!Edrivers/base/core.c
-!Edrivers/base/syscore.c
!Edrivers/base/class.c
-!Idrivers/base/node.c
!Edrivers/base/firmware_class.c
!Edrivers/base/transport_class.c
-!Edrivers/base/dd.c
+!Edrivers/base/sys.c
!Iinclude/linux/platform_device.h
!Edrivers/base/platform.c
!Edrivers/base/bus.c
-
- Device Drivers DMA Management
-!Edrivers/base/dma-buf.c
-!Edrivers/base/dma-coherent.c
-!Edrivers/base/dma-mapping.c
Device Drivers Power Management
!Edrivers/base/power/main.c
@@ -227,7 +219,7 @@ X!Isound/sound_firmware.c
16x50 UART Driver
!Edrivers/tty/serial/serial_core.c
-!Edrivers/tty/serial/8250/8250.c
+!Edrivers/tty/serial/8250.c
diff --git a/trunk/Documentation/pinctrl.txt b/trunk/Documentation/pinctrl.txt
index 150fd3833d0b..6727b92bc2fb 100644
--- a/trunk/Documentation/pinctrl.txt
+++ b/trunk/Documentation/pinctrl.txt
@@ -857,41 +857,42 @@ case), we define a mapping like this:
...
{
- .name = "2bit"
+ .name "2bit"
.ctrl_dev_name = "pinctrl-foo",
.function = "mmc0",
.group = "mmc0_1_grp",
.dev_name = "foo-mmc.0",
},
{
- .name = "4bit"
+ .name "4bit"
.ctrl_dev_name = "pinctrl-foo",
.function = "mmc0",
.group = "mmc0_1_grp",
.dev_name = "foo-mmc.0",
},
{
- .name = "4bit"
+ .name "4bit"
.ctrl_dev_name = "pinctrl-foo",
.function = "mmc0",
.group = "mmc0_2_grp",
.dev_name = "foo-mmc.0",
},
{
- .name = "8bit"
+ .name "8bit"
.ctrl_dev_name = "pinctrl-foo",
+ .function = "mmc0",
.group = "mmc0_1_grp",
.dev_name = "foo-mmc.0",
},
{
- .name = "8bit"
+ .name "8bit"
.ctrl_dev_name = "pinctrl-foo",
.function = "mmc0",
.group = "mmc0_2_grp",
.dev_name = "foo-mmc.0",
},
{
- .name = "8bit"
+ .name "8bit"
.ctrl_dev_name = "pinctrl-foo",
.function = "mmc0",
.group = "mmc0_3_grp",
@@ -994,7 +995,7 @@ This is enabled by simply setting the .hog_on_boot field in the map to true,
like this:
{
- .name = "POWERMAP"
+ .name "POWERMAP"
.ctrl_dev_name = "pinctrl-foo",
.function = "power_func",
.hog_on_boot = true,
@@ -1024,7 +1025,7 @@ it, disables and releases it, and muxes it in on the pins defined by group B:
foo_switch()
{
- struct pinmux *pmx;
+ struct pinmux pmx;
/* Enable on position A */
pmx = pinmux_get(&device, "spi0-pos-A");
diff --git a/trunk/MAINTAINERS b/trunk/MAINTAINERS
index 252972b6c4a0..2bd630d9a103 100644
--- a/trunk/MAINTAINERS
+++ b/trunk/MAINTAINERS
@@ -159,7 +159,7 @@ S: Maintained
F: drivers/net/ethernet/realtek/r8169.c
8250/16?50 (AND CLONE UARTS) SERIAL DRIVER
-M: Greg Kroah-Hartman
+M: Greg Kroah-Hartman
L: linux-serial@vger.kernel.org
W: http://serial.sourceforge.net
S: Maintained
@@ -1783,9 +1783,9 @@ X: net/wireless/wext*
CHAR and MISC DRIVERS
M: Arnd Bergmann
-M: Greg Kroah-Hartman
+M: Greg Kroah-Hartman
T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
-S: Supported
+S: Maintained
F: drivers/char/*
F: drivers/misc/*
@@ -2320,7 +2320,7 @@ F: lib/lru_cache.c
F: Documentation/blockdev/drbd/
DRIVER CORE, KOBJECTS, DEBUGFS AND SYSFS
-M: Greg Kroah-Hartman
+M: Greg Kroah-Hartman
T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6.git
S: Supported
F: Documentation/kobject.txt
@@ -4140,7 +4140,6 @@ F: fs/partitions/ldm.*
LogFS
M: Joern Engel
-M: Prasad Joshi
L: logfs@logfs.org
W: logfs.org
S: Maintained
@@ -4282,6 +4281,13 @@ S: Orphan
F: drivers/video/matrox/matroxfb_*
F: include/linux/matroxfb.h
+MAX1668 TEMPERATURE SENSOR DRIVER
+M: "David George"
+L: lm-sensors@lm-sensors.org
+S: Maintained
+F: Documentation/hwmon/max1668
+F: drivers/hwmon/max1668.c
+
MAX6650 HARDWARE MONITOR AND FAN CONTROLLER DRIVER
M: "Hans J. Koch"
L: lm-sensors@lm-sensors.org
@@ -6276,15 +6282,15 @@ S: Maintained
F: arch/alpha/kernel/srm_env.c
STABLE BRANCH
-M: Greg Kroah-Hartman
+M: Greg Kroah-Hartman
L: stable@vger.kernel.org
-S: Supported
+S: Maintained
STAGING SUBSYSTEM
-M: Greg Kroah-Hartman
+M: Greg Kroah-Hartman
T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
L: devel@driverdev.osuosl.org
-S: Supported
+S: Maintained
F: drivers/staging/
STAGING - AGERE HERMES II and II.5 WIRELESS DRIVERS
@@ -6669,8 +6675,8 @@ S: Maintained
K: ^Subject:.*(?i)trivial
TTY LAYER
-M: Greg Kroah-Hartman
-S: Supported
+M: Greg Kroah-Hartman
+S: Maintained
T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6.git
F: drivers/tty/
F: drivers/tty/serial/serial_core.c
@@ -6958,7 +6964,7 @@ S: Maintained
F: drivers/usb/serial/digi_acceleport.c
USB SERIAL DRIVER
-M: Greg Kroah-Hartman
+M: Greg Kroah-Hartman
L: linux-usb@vger.kernel.org
S: Supported
F: Documentation/usb/usb-serial.txt
@@ -6973,8 +6979,9 @@ S: Maintained
F: drivers/usb/serial/empeg.c
USB SERIAL KEYSPAN DRIVER
-M: Greg Kroah-Hartman
+M: Greg Kroah-Hartman
L: linux-usb@vger.kernel.org
+W: http://www.kroah.com/linux/
S: Maintained
F: drivers/usb/serial/*keyspan*
@@ -7002,7 +7009,7 @@ F: Documentation/video4linux/sn9c102.txt
F: drivers/media/video/sn9c102/
USB SUBSYSTEM
-M: Greg Kroah-Hartman
+M: Greg Kroah-Hartman
L: linux-usb@vger.kernel.org
W: http://www.linux-usb.org
T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6.git
@@ -7089,7 +7096,7 @@ F: fs/hppfs/
USERSPACE I/O (UIO)
M: "Hans J. Koch"
-M: Greg Kroah-Hartman
+M: Greg Kroah-Hartman
S: Maintained
F: Documentation/DocBook/uio-howto.tmpl
F: drivers/uio/
@@ -7364,7 +7371,6 @@ S: Supported
F: Documentation/hwmon/wm83??
F: arch/arm/mach-s3c64xx/mach-crag6410*
F: drivers/leds/leds-wm83*.c
-F: drivers/hwmon/wm83??-hwmon.c
F: drivers/input/misc/wm831x-on.c
F: drivers/input/touchscreen/wm831x-ts.c
F: drivers/input/touchscreen/wm97*.c
diff --git a/trunk/Makefile b/trunk/Makefile
index e3b23e864a53..71e6ed21dd15 100644
--- a/trunk/Makefile
+++ b/trunk/Makefile
@@ -1,7 +1,7 @@
VERSION = 3
PATCHLEVEL = 3
SUBLEVEL = 0
-EXTRAVERSION = -rc2
+EXTRAVERSION = -rc1
NAME = Saber-toothed Squirrel
# *DOCUMENTATION*
diff --git a/trunk/arch/microblaze/kernel/setup.c b/trunk/arch/microblaze/kernel/setup.c
index d4fc1a971779..604cd9dd1333 100644
--- a/trunk/arch/microblaze/kernel/setup.c
+++ b/trunk/arch/microblaze/kernel/setup.c
@@ -26,7 +26,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -227,23 +226,5 @@ static int __init setup_bus_notifier(void)
return 0;
}
-arch_initcall(setup_bus_notifier);
-
-static DEFINE_PER_CPU(struct cpu, cpu_devices);
-
-static int __init topology_init(void)
-{
- int i, ret;
-
- for_each_present_cpu(i) {
- struct cpu *c = &per_cpu(cpu_devices, i);
- ret = register_cpu(c, i);
- if (ret)
- printk(KERN_WARNING "topology_init: register_cpu %d "
- "failed (%d)\n", i, ret);
- }
-
- return 0;
-}
-subsys_initcall(topology_init);
+arch_initcall(setup_bus_notifier);
diff --git a/trunk/arch/sparc/Kconfig b/trunk/arch/sparc/Kconfig
index ca5580e4d813..96657992a72e 100644
--- a/trunk/arch/sparc/Kconfig
+++ b/trunk/arch/sparc/Kconfig
@@ -33,7 +33,6 @@ config SPARC
config SPARC32
def_bool !64BIT
select GENERIC_ATOMIC64
- select CLZ_TAB
config SPARC64
def_bool 64BIT
diff --git a/trunk/arch/sparc/lib/divdi3.S b/trunk/arch/sparc/lib/divdi3.S
index d74bc0925f2d..681b3683da9e 100644
--- a/trunk/arch/sparc/lib/divdi3.S
+++ b/trunk/arch/sparc/lib/divdi3.S
@@ -17,9 +17,23 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+ .data
+ .align 8
+ .globl __clz_tab
+__clz_tab:
+ .byte 0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5
+ .byte 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6
+ .byte 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7
+ .byte 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7
+ .byte 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8
+ .byte 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8
+ .byte 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8
+ .byte 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8
+ .size __clz_tab,256
+ .global .udiv
+
.text
.align 4
- .global .udiv
.globl __divdi3
__divdi3:
save %sp,-104,%sp
diff --git a/trunk/arch/x86/include/asm/cmpxchg.h b/trunk/arch/x86/include/asm/cmpxchg.h
index b3b733262909..0c9fa2745f13 100644
--- a/trunk/arch/x86/include/asm/cmpxchg.h
+++ b/trunk/arch/x86/include/asm/cmpxchg.h
@@ -145,13 +145,13 @@ extern void __add_wrong_size(void)
#ifdef __HAVE_ARCH_CMPXCHG
#define cmpxchg(ptr, old, new) \
- __cmpxchg(ptr, old, new, sizeof(*(ptr)))
+ __cmpxchg((ptr), (old), (new), sizeof(*ptr))
#define sync_cmpxchg(ptr, old, new) \
- __sync_cmpxchg(ptr, old, new, sizeof(*(ptr)))
+ __sync_cmpxchg((ptr), (old), (new), sizeof(*ptr))
#define cmpxchg_local(ptr, old, new) \
- __cmpxchg_local(ptr, old, new, sizeof(*(ptr)))
+ __cmpxchg_local((ptr), (old), (new), sizeof(*ptr))
#endif
/*
diff --git a/trunk/arch/x86/kernel/dumpstack.c b/trunk/arch/x86/kernel/dumpstack.c
index 4025fe4f928f..1aae78f775fc 100644
--- a/trunk/arch/x86/kernel/dumpstack.c
+++ b/trunk/arch/x86/kernel/dumpstack.c
@@ -252,8 +252,7 @@ int __kprobes __die(const char *str, struct pt_regs *regs, long err)
unsigned short ss;
unsigned long sp;
#endif
- printk(KERN_DEFAULT
- "%s: %04lx [#%d] ", str, err & 0xffff, ++die_counter);
+ printk(KERN_EMERG "%s: %04lx [#%d] ", str, err & 0xffff, ++die_counter);
#ifdef CONFIG_PREEMPT
printk("PREEMPT ");
#endif
diff --git a/trunk/arch/x86/kernel/dumpstack_64.c b/trunk/arch/x86/kernel/dumpstack_64.c
index 17107bd6e1f0..6d728d9284bd 100644
--- a/trunk/arch/x86/kernel/dumpstack_64.c
+++ b/trunk/arch/x86/kernel/dumpstack_64.c
@@ -129,7 +129,7 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,
if (!stack) {
if (regs)
stack = (unsigned long *)regs->sp;
- else if (task != current)
+ else if (task && task != current)
stack = (unsigned long *)task->thread.sp;
else
stack = &dummy;
@@ -269,11 +269,11 @@ void show_registers(struct pt_regs *regs)
unsigned char c;
u8 *ip;
- printk(KERN_DEFAULT "Stack:\n");
+ printk(KERN_EMERG "Stack:\n");
show_stack_log_lvl(NULL, regs, (unsigned long *)sp,
- 0, KERN_DEFAULT);
+ 0, KERN_EMERG);
- printk(KERN_DEFAULT "Code: ");
+ printk(KERN_EMERG "Code: ");
ip = (u8 *)regs->ip - code_prologue;
if (ip < (u8 *)PAGE_OFFSET || probe_kernel_address(ip, c)) {
diff --git a/trunk/arch/x86/kernel/reboot.c b/trunk/arch/x86/kernel/reboot.c
index d840e69a853c..37a458b521a6 100644
--- a/trunk/arch/x86/kernel/reboot.c
+++ b/trunk/arch/x86/kernel/reboot.c
@@ -39,14 +39,6 @@ static int reboot_mode;
enum reboot_type reboot_type = BOOT_ACPI;
int reboot_force;
-/* This variable is used privately to keep track of whether or not
- * reboot_type is still set to its default value (i.e., reboot= hasn't
- * been set on the command line). This is needed so that we can
- * suppress DMI scanning for reboot quirks. Without it, it's
- * impossible to override a faulty reboot quirk without recompiling.
- */
-static int reboot_default = 1;
-
#if defined(CONFIG_X86_32) && defined(CONFIG_SMP)
static int reboot_cpu = -1;
#endif
@@ -75,12 +67,6 @@ bool port_cf9_safe = false;
static int __init reboot_setup(char *str)
{
for (;;) {
- /* Having anything passed on the command line via
- * reboot= will cause us to disable DMI checking
- * below.
- */
- reboot_default = 0;
-
switch (*str) {
case 'w':
reboot_mode = 0x1234;
@@ -309,6 +295,14 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = {
DMI_MATCH(DMI_BOARD_NAME, "P4S800"),
},
},
+ { /* Handle problems with rebooting on VersaLogic Menlow boards */
+ .callback = set_bios_reboot,
+ .ident = "VersaLogic Menlow based board",
+ .matches = {
+ DMI_MATCH(DMI_BOARD_VENDOR, "VersaLogic Corporation"),
+ DMI_MATCH(DMI_BOARD_NAME, "VersaLogic Menlow board"),
+ },
+ },
{ /* Handle reboot issue on Acer Aspire one */
.callback = set_kbd_reboot,
.ident = "Acer Aspire One A110",
@@ -322,12 +316,7 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = {
static int __init reboot_init(void)
{
- /* Only do the DMI check if reboot_type hasn't been overridden
- * on the command line
- */
- if (reboot_default) {
- dmi_check_system(reboot_dmi_table);
- }
+ dmi_check_system(reboot_dmi_table);
return 0;
}
core_initcall(reboot_init);
@@ -476,12 +465,7 @@ static struct dmi_system_id __initdata pci_reboot_dmi_table[] = {
static int __init pci_reboot_init(void)
{
- /* Only do the DMI check if reboot_type hasn't been overridden
- * on the command line
- */
- if (reboot_default) {
- dmi_check_system(pci_reboot_dmi_table);
- }
+ dmi_check_system(pci_reboot_dmi_table);
return 0;
}
core_initcall(pci_reboot_init);
diff --git a/trunk/arch/x86/mm/fault.c b/trunk/arch/x86/mm/fault.c
index f0b4caf85c1a..9d74824a708d 100644
--- a/trunk/arch/x86/mm/fault.c
+++ b/trunk/arch/x86/mm/fault.c
@@ -673,7 +673,7 @@ no_context(struct pt_regs *regs, unsigned long error_code,
stackend = end_of_stack(tsk);
if (tsk != &init_task && *stackend != STACK_END_MAGIC)
- printk(KERN_EMERG "Thread overran stack, or stack corrupted\n");
+ printk(KERN_ALERT "Thread overran stack, or stack corrupted\n");
tsk->thread.cr2 = address;
tsk->thread.trap_no = 14;
@@ -684,7 +684,7 @@ no_context(struct pt_regs *regs, unsigned long error_code,
sig = 0;
/* Executive summary in case the body of the oops scrolled away */
- printk(KERN_DEFAULT "CR2: %016lx\n", address);
+ printk(KERN_EMERG "CR2: %016lx\n", address);
oops_end(flags, regs, sig);
}
diff --git a/trunk/drivers/firewire/ohci.c b/trunk/drivers/firewire/ohci.c
index 7f5f0da726da..6628feaa7622 100644
--- a/trunk/drivers/firewire/ohci.c
+++ b/trunk/drivers/firewire/ohci.c
@@ -263,7 +263,6 @@ static inline struct fw_ohci *fw_ohci(struct fw_card *card)
static char ohci_driver_name[] = KBUILD_MODNAME;
#define PCI_DEVICE_ID_AGERE_FW643 0x5901
-#define PCI_DEVICE_ID_CREATIVE_SB1394 0x4001
#define PCI_DEVICE_ID_JMICRON_JMB38X_FW 0x2380
#define PCI_DEVICE_ID_TI_TSB12LV22 0x8009
#define PCI_DEVICE_ID_TI_TSB12LV26 0x8020
@@ -290,9 +289,6 @@ static const struct {
{PCI_VENDOR_ID_ATT, PCI_DEVICE_ID_AGERE_FW643, 6,
QUIRK_NO_MSI},
- {PCI_VENDOR_ID_CREATIVE, PCI_DEVICE_ID_CREATIVE_SB1394, PCI_ANY_ID,
- QUIRK_RESET_PACKET},
-
{PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB38X_FW, PCI_ANY_ID,
QUIRK_NO_MSI},
@@ -303,7 +299,7 @@ static const struct {
QUIRK_NO_MSI},
{PCI_VENDOR_ID_RICOH, PCI_ANY_ID, PCI_ANY_ID,
- QUIRK_CYCLE_TIMER | QUIRK_NO_MSI},
+ QUIRK_CYCLE_TIMER},
{PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_TSB12LV22, PCI_ANY_ID,
QUIRK_CYCLE_TIMER | QUIRK_RESET_PACKET | QUIRK_NO_1394A},
diff --git a/trunk/drivers/hwmon/f71805f.c b/trunk/drivers/hwmon/f71805f.c
index 6dbfd3e516e4..92f949767ece 100644
--- a/trunk/drivers/hwmon/f71805f.c
+++ b/trunk/drivers/hwmon/f71805f.c
@@ -283,11 +283,11 @@ static inline long temp_from_reg(u8 reg)
static inline u8 temp_to_reg(long val)
{
- if (val <= 0)
- return 0;
- if (val >= 1000 * 0xff)
- return 0xff;
- return (val + 500) / 1000;
+ if (val < 0)
+ val = 0;
+ else if (val > 1000 * 0xff)
+ val = 0xff;
+ return ((val + 500) / 1000);
}
/*
diff --git a/trunk/drivers/hwmon/sht15.c b/trunk/drivers/hwmon/sht15.c
index 91fdd1fe18b0..6ddeae049058 100644
--- a/trunk/drivers/hwmon/sht15.c
+++ b/trunk/drivers/hwmon/sht15.c
@@ -883,7 +883,7 @@ static int sht15_invalidate_voltage(struct notifier_block *nb,
static int __devinit sht15_probe(struct platform_device *pdev)
{
- int ret;
+ int ret = 0;
struct sht15_data *data = kzalloc(sizeof(*data), GFP_KERNEL);
u8 status = 0;
@@ -901,7 +901,6 @@ static int __devinit sht15_probe(struct platform_device *pdev)
init_waitqueue_head(&data->wait_queue);
if (pdev->dev.platform_data == NULL) {
- ret = -EINVAL;
dev_err(&pdev->dev, "no platform data supplied\n");
goto err_free_data;
}
diff --git a/trunk/drivers/hwmon/w83627ehf.c b/trunk/drivers/hwmon/w83627ehf.c
index 2dfae7d7cc5b..0e0af0445222 100644
--- a/trunk/drivers/hwmon/w83627ehf.c
+++ b/trunk/drivers/hwmon/w83627ehf.c
@@ -1319,7 +1319,6 @@ store_pwm_mode(struct device *dev, struct device_attribute *attr,
{
struct w83627ehf_data *data = dev_get_drvdata(dev);
struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
- struct w83627ehf_sio_data *sio_data = dev->platform_data;
int nr = sensor_attr->index;
unsigned long val;
int err;
@@ -1331,11 +1330,6 @@ store_pwm_mode(struct device *dev, struct device_attribute *attr,
if (val > 1)
return -EINVAL;
-
- /* On NCT67766F, DC mode is only supported for pwm1 */
- if (sio_data->kind == nct6776 && nr && val != 1)
- return -EINVAL;
-
mutex_lock(&data->update_lock);
reg = w83627ehf_read_value(data, W83627EHF_REG_PWM_ENABLE[nr]);
data->pwm_mode[nr] = val;
diff --git a/trunk/drivers/infiniband/core/ucma.c b/trunk/drivers/infiniband/core/ucma.c
index 5034a87cc72d..b37b0c02a7b9 100644
--- a/trunk/drivers/infiniband/core/ucma.c
+++ b/trunk/drivers/infiniband/core/ucma.c
@@ -808,12 +808,9 @@ static ssize_t ucma_accept(struct ucma_file *file, const char __user *inbuf,
return PTR_ERR(ctx);
if (cmd.conn_param.valid) {
+ ctx->uid = cmd.uid;
ucma_copy_conn_param(&conn_param, &cmd.conn_param);
- mutex_lock(&file->mut);
ret = rdma_accept(ctx->cm_id, &conn_param);
- if (!ret)
- ctx->uid = cmd.uid;
- mutex_unlock(&file->mut);
} else
ret = rdma_accept(ctx->cm_id, NULL);
diff --git a/trunk/drivers/infiniband/core/uverbs_cmd.c b/trunk/drivers/infiniband/core/uverbs_cmd.c
index 4d27e4c3fe34..b930da4c0c63 100644
--- a/trunk/drivers/infiniband/core/uverbs_cmd.c
+++ b/trunk/drivers/infiniband/core/uverbs_cmd.c
@@ -1485,7 +1485,6 @@ ssize_t ib_uverbs_create_qp(struct ib_uverbs_file *file,
qp->event_handler = attr.event_handler;
qp->qp_context = attr.qp_context;
qp->qp_type = attr.qp_type;
- atomic_set(&qp->usecnt, 0);
atomic_inc(&pd->usecnt);
atomic_inc(&attr.send_cq->usecnt);
if (attr.recv_cq)
diff --git a/trunk/drivers/infiniband/core/verbs.c b/trunk/drivers/infiniband/core/verbs.c
index 575b78045aaf..602b1bd723a9 100644
--- a/trunk/drivers/infiniband/core/verbs.c
+++ b/trunk/drivers/infiniband/core/verbs.c
@@ -421,7 +421,6 @@ struct ib_qp *ib_create_qp(struct ib_pd *pd,
qp->uobject = NULL;
qp->qp_type = qp_init_attr->qp_type;
- atomic_set(&qp->usecnt, 0);
if (qp_init_attr->qp_type == IB_QPT_XRC_TGT) {
qp->event_handler = __ib_shared_qp_event_handler;
qp->qp_context = qp;
@@ -431,6 +430,7 @@ struct ib_qp *ib_create_qp(struct ib_pd *pd,
qp->xrcd = qp_init_attr->xrcd;
atomic_inc(&qp_init_attr->xrcd->usecnt);
INIT_LIST_HEAD(&qp->open_list);
+ atomic_set(&qp->usecnt, 0);
real_qp = qp;
qp = __ib_open_qp(real_qp, qp_init_attr->event_handler,
diff --git a/trunk/drivers/infiniband/hw/ipath/ipath_fs.c b/trunk/drivers/infiniband/hw/ipath/ipath_fs.c
index a4de9d58e9b4..b7d4216db3c3 100644
--- a/trunk/drivers/infiniband/hw/ipath/ipath_fs.c
+++ b/trunk/drivers/infiniband/hw/ipath/ipath_fs.c
@@ -89,7 +89,7 @@ static int create_file(const char *name, umode_t mode,
error = ipathfs_mknod(parent->d_inode, *dentry,
mode, fops, data);
else
- error = PTR_ERR(*dentry);
+ error = PTR_ERR(dentry);
mutex_unlock(&parent->d_inode->i_mutex);
return error;
diff --git a/trunk/drivers/infiniband/hw/mlx4/mad.c b/trunk/drivers/infiniband/hw/mlx4/mad.c
index 259b0670b51c..95c94d8f0254 100644
--- a/trunk/drivers/infiniband/hw/mlx4/mad.c
+++ b/trunk/drivers/infiniband/hw/mlx4/mad.c
@@ -257,9 +257,12 @@ static int ib_process_mad(struct ib_device *ibdev, int mad_flags, u8 port_num,
return IB_MAD_RESULT_SUCCESS;
/*
- * Don't process SMInfo queries -- the SMA can't handle them.
+ * Don't process SMInfo queries or vendor-specific
+ * MADs -- the SMA can't handle them.
*/
- if (in_mad->mad_hdr.attr_id == IB_SMP_ATTR_SM_INFO)
+ if (in_mad->mad_hdr.attr_id == IB_SMP_ATTR_SM_INFO ||
+ ((in_mad->mad_hdr.attr_id & IB_SMP_ATTR_VENDOR_MASK) ==
+ IB_SMP_ATTR_VENDOR_MASK))
return IB_MAD_RESULT_SUCCESS;
} else if (in_mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_PERF_MGMT ||
in_mad->mad_hdr.mgmt_class == MLX4_IB_VENDOR_CLASS1 ||
diff --git a/trunk/drivers/infiniband/hw/nes/nes.c b/trunk/drivers/infiniband/hw/nes/nes.c
index 7140199f562e..7013da5e9eda 100644
--- a/trunk/drivers/infiniband/hw/nes/nes.c
+++ b/trunk/drivers/infiniband/hw/nes/nes.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006 - 2011 Intel Corporation. All rights reserved.
+ * Copyright (c) 2006 - 2009 Intel Corporation. All rights reserved.
* Copyright (c) 2005 Open Grid Computing, Inc. All rights reserved.
*
* This software is available to you under a choice of one of two
diff --git a/trunk/drivers/infiniband/hw/nes/nes.h b/trunk/drivers/infiniband/hw/nes/nes.h
index c438e4691b3c..568b4f11380a 100644
--- a/trunk/drivers/infiniband/hw/nes/nes.h
+++ b/trunk/drivers/infiniband/hw/nes/nes.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006 - 2011 Intel Corporation. All rights reserved.
+ * Copyright (c) 2006 - 2009 Intel Corporation. All rights reserved.
* Copyright (c) 2005 Open Grid Computing, Inc. All rights reserved.
*
* This software is available to you under a choice of one of two
diff --git a/trunk/drivers/infiniband/hw/nes/nes_cm.c b/trunk/drivers/infiniband/hw/nes/nes_cm.c
index a4972abedef1..425065b36b8c 100644
--- a/trunk/drivers/infiniband/hw/nes/nes_cm.c
+++ b/trunk/drivers/infiniband/hw/nes/nes_cm.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006 - 2011 Intel Corporation. All rights reserved.
+ * Copyright (c) 2006 - 2009 Intel Corporation. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
@@ -233,7 +233,6 @@ static int send_mpa_reject(struct nes_cm_node *cm_node)
u8 *start_ptr = &start_addr;
u8 **start_buff = &start_ptr;
u16 buff_len = 0;
- struct ietf_mpa_v1 *mpa_frame;
skb = dev_alloc_skb(MAX_CM_BUFFER);
if (!skb) {
@@ -243,8 +242,6 @@ static int send_mpa_reject(struct nes_cm_node *cm_node)
/* send an MPA reject frame */
cm_build_mpa_frame(cm_node, start_buff, &buff_len, NULL, MPA_KEY_REPLY);
- mpa_frame = (struct ietf_mpa_v1 *)*start_buff;
- mpa_frame->flags |= IETF_MPA_FLAGS_REJECT;
form_cm_frame(skb, cm_node, NULL, 0, *start_buff, buff_len, SET_ACK | SET_FIN);
cm_node->state = NES_CM_STATE_FIN_WAIT1;
@@ -1363,7 +1360,8 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip, int arpi
if (!memcmp(nesadapter->arp_table[arpindex].mac_addr,
neigh->ha, ETH_ALEN)) {
/* Mac address same as in nes_arp_table */
- goto out;
+ ip_rt_put(rt);
+ return rc;
}
nes_manage_arp_cache(nesvnic->netdev,
@@ -1379,8 +1377,6 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip, int arpi
neigh_event_send(neigh, NULL);
}
}
-
-out:
rcu_read_unlock();
ip_rt_put(rt);
return rc;
diff --git a/trunk/drivers/infiniband/hw/nes/nes_cm.h b/trunk/drivers/infiniband/hw/nes/nes_cm.h
index 4646e6666087..bdfa1fbb35fc 100644
--- a/trunk/drivers/infiniband/hw/nes/nes_cm.h
+++ b/trunk/drivers/infiniband/hw/nes/nes_cm.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006 - 2011 Intel Corporation. All rights reserved.
+ * Copyright (c) 2006 - 2009 Intel Corporation. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
diff --git a/trunk/drivers/infiniband/hw/nes/nes_context.h b/trunk/drivers/infiniband/hw/nes/nes_context.h
index a69eef16d72d..b4393a16099d 100644
--- a/trunk/drivers/infiniband/hw/nes/nes_context.h
+++ b/trunk/drivers/infiniband/hw/nes/nes_context.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006 - 2011 Intel Corporation. All rights reserved.
+ * Copyright (c) 2006 - 2009 Intel Corporation. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
diff --git a/trunk/drivers/infiniband/hw/nes/nes_hw.c b/trunk/drivers/infiniband/hw/nes/nes_hw.c
index d42c9f435b1b..055f4b545df0 100644
--- a/trunk/drivers/infiniband/hw/nes/nes_hw.c
+++ b/trunk/drivers/infiniband/hw/nes/nes_hw.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006 - 2011 Intel Corporation. All rights reserved.
+ * Copyright (c) 2006 - 2009 Intel Corporation. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
diff --git a/trunk/drivers/infiniband/hw/nes/nes_hw.h b/trunk/drivers/infiniband/hw/nes/nes_hw.h
index d748e4b31b8d..0b590e152c6a 100644
--- a/trunk/drivers/infiniband/hw/nes/nes_hw.h
+++ b/trunk/drivers/infiniband/hw/nes/nes_hw.h
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2006 - 2011 Intel Corporation. All rights reserved.
+* Copyright (c) 2006 - 2009 Intel Corporation. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
diff --git a/trunk/drivers/infiniband/hw/nes/nes_mgt.c b/trunk/drivers/infiniband/hw/nes/nes_mgt.c
index 3ba7be369452..b3b2a240c6e9 100644
--- a/trunk/drivers/infiniband/hw/nes/nes_mgt.c
+++ b/trunk/drivers/infiniband/hw/nes/nes_mgt.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006 - 2011 Intel-NE, Inc. All rights reserved.
+ * Copyright (c) 2006 - 2009 Intel-NE, Inc. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
diff --git a/trunk/drivers/infiniband/hw/nes/nes_mgt.h b/trunk/drivers/infiniband/hw/nes/nes_mgt.h
index 4f7f701c4a81..8c8af254555a 100644
--- a/trunk/drivers/infiniband/hw/nes/nes_mgt.h
+++ b/trunk/drivers/infiniband/hw/nes/nes_mgt.h
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2006 - 2011 Intel-NE, Inc. All rights reserved.
+* Copyright (c) 2010 Intel-NE, Inc. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
diff --git a/trunk/drivers/infiniband/hw/nes/nes_nic.c b/trunk/drivers/infiniband/hw/nes/nes_nic.c
index f3a3ecf8d09e..4b3fa711a247 100644
--- a/trunk/drivers/infiniband/hw/nes/nes_nic.c
+++ b/trunk/drivers/infiniband/hw/nes/nes_nic.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006 - 2011 Intel Corporation. All rights reserved.
+ * Copyright (c) 2006 - 2009 Intel Corporation. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
diff --git a/trunk/drivers/infiniband/hw/nes/nes_user.h b/trunk/drivers/infiniband/hw/nes/nes_user.h
index 4926de744488..71e133ab209b 100644
--- a/trunk/drivers/infiniband/hw/nes/nes_user.h
+++ b/trunk/drivers/infiniband/hw/nes/nes_user.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006 - 2011 Intel Corporation. All rights reserved.
+ * Copyright (c) 2006 - 2009 Intel Corporation. All rights reserved.
* Copyright (c) 2005 Topspin Communications. All rights reserved.
* Copyright (c) 2005 Cisco Systems. All rights reserved.
* Copyright (c) 2005 Open Grid Computing, Inc. All rights reserved.
diff --git a/trunk/drivers/infiniband/hw/nes/nes_utils.c b/trunk/drivers/infiniband/hw/nes/nes_utils.c
index e98f4fc0b768..8b4c2ff54888 100644
--- a/trunk/drivers/infiniband/hw/nes/nes_utils.c
+++ b/trunk/drivers/infiniband/hw/nes/nes_utils.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006 - 2011 Intel Corporation. All rights reserved.
+ * Copyright (c) 2006 - 2009 Intel Corporation. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
diff --git a/trunk/drivers/infiniband/hw/nes/nes_verbs.c b/trunk/drivers/infiniband/hw/nes/nes_verbs.c
index 0927b5cc65d3..5095bc41c6cc 100644
--- a/trunk/drivers/infiniband/hw/nes/nes_verbs.c
+++ b/trunk/drivers/infiniband/hw/nes/nes_verbs.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006 - 2011 Intel Corporation. All rights reserved.
+ * Copyright (c) 2006 - 2009 Intel Corporation. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
@@ -3427,8 +3427,6 @@ static int nes_post_send(struct ib_qp *ibqp, struct ib_send_wr *ib_wr,
set_wqe_32bit_value(wqe->wqe_words,
NES_IWARP_SQ_FMR_WQE_LENGTH_LOW_IDX,
ib_wr->wr.fast_reg.length);
- set_wqe_32bit_value(wqe->wqe_words,
- NES_IWARP_SQ_FMR_WQE_LENGTH_HIGH_IDX, 0);
set_wqe_32bit_value(wqe->wqe_words,
NES_IWARP_SQ_FMR_WQE_MR_STAG_IDX,
ib_wr->wr.fast_reg.rkey);
@@ -3726,7 +3724,7 @@ static int nes_poll_cq(struct ib_cq *ibcq, int num_entries, struct ib_wc *entry)
entry->opcode = IB_WC_SEND;
break;
case NES_IWARP_SQ_OP_LOCINV:
- entry->opcode = IB_WC_LOCAL_INV;
+ entry->opcode = IB_WR_LOCAL_INV;
break;
case NES_IWARP_SQ_OP_FAST_REG:
entry->opcode = IB_WC_FAST_REG_MR;
diff --git a/trunk/drivers/infiniband/hw/nes/nes_verbs.h b/trunk/drivers/infiniband/hw/nes/nes_verbs.h
index 0eff7c44d76b..fe6b6e92fa90 100644
--- a/trunk/drivers/infiniband/hw/nes/nes_verbs.h
+++ b/trunk/drivers/infiniband/hw/nes/nes_verbs.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006 - 2011 Intel Corporation. All rights reserved.
+ * Copyright (c) 2006 - 2009 Intel Corporation. All rights reserved.
* Copyright (c) 2005 Open Grid Computing, Inc. All rights reserved.
*
* This software is available to you under a choice of one of two
diff --git a/trunk/drivers/infiniband/hw/qib/qib_iba6120.c b/trunk/drivers/infiniband/hw/qib/qib_iba6120.c
index d0c64d514813..4f18e2d332df 100644
--- a/trunk/drivers/infiniband/hw/qib/qib_iba6120.c
+++ b/trunk/drivers/infiniband/hw/qib/qib_iba6120.c
@@ -2105,7 +2105,7 @@ static void alloc_dummy_hdrq(struct qib_devdata *dd)
dd->cspec->dummy_hdrq = dma_alloc_coherent(&dd->pcidev->dev,
dd->rcd[0]->rcvhdrq_size,
&dd->cspec->dummy_hdrq_phys,
- GFP_ATOMIC | __GFP_COMP);
+ GFP_KERNEL | __GFP_COMP);
if (!dd->cspec->dummy_hdrq) {
qib_devinfo(dd->pcidev, "Couldn't allocate dummy hdrq\n");
/* fallback to just 0'ing */
diff --git a/trunk/drivers/infiniband/hw/qib/qib_pcie.c b/trunk/drivers/infiniband/hw/qib/qib_pcie.c
index 0fde788e1100..f695061d688e 100644
--- a/trunk/drivers/infiniband/hw/qib/qib_pcie.c
+++ b/trunk/drivers/infiniband/hw/qib/qib_pcie.c
@@ -560,7 +560,7 @@ static int qib_tune_pcie_coalesce(struct qib_devdata *dd)
* BIOS may not set PCIe bus-utilization parameters for best performance.
* Check and optionally adjust them to maximize our throughput.
*/
-static int qib_pcie_caps;
+static int qib_pcie_caps = 0x51;
module_param_named(pcie_caps, qib_pcie_caps, int, S_IRUGO);
MODULE_PARM_DESC(pcie_caps, "Max PCIe tuning: Payload (0..3), ReadReq (4..7)");
diff --git a/trunk/drivers/pinctrl/core.c b/trunk/drivers/pinctrl/core.c
index 8fe15cf15ac8..569bdb3ef104 100644
--- a/trunk/drivers/pinctrl/core.c
+++ b/trunk/drivers/pinctrl/core.c
@@ -510,12 +510,10 @@ static struct dentry *debugfs_root;
static void pinctrl_init_device_debugfs(struct pinctrl_dev *pctldev)
{
- struct dentry *device_root;
+ static struct dentry *device_root;
device_root = debugfs_create_dir(dev_name(pctldev->dev),
debugfs_root);
- pctldev->device_root = device_root;
-
if (IS_ERR(device_root) || !device_root) {
pr_warn("failed to create debugfs directory for %s\n",
dev_name(pctldev->dev));
@@ -531,11 +529,6 @@ static void pinctrl_init_device_debugfs(struct pinctrl_dev *pctldev)
pinconf_init_device_debugfs(device_root, pctldev);
}
-static void pinctrl_remove_device_debugfs(struct pinctrl_dev *pctldev)
-{
- debugfs_remove_recursive(pctldev->device_root);
-}
-
static void pinctrl_init_debugfs(void)
{
debugfs_root = debugfs_create_dir("pinctrl", NULL);
@@ -560,10 +553,6 @@ static void pinctrl_init_debugfs(void)
{
}
-static void pinctrl_remove_device_debugfs(struct pinctrl_dev *pctldev)
-{
-}
-
#endif
/**
@@ -583,40 +572,40 @@ struct pinctrl_dev *pinctrl_register(struct pinctrl_desc *pctldesc,
if (pctldesc->name == NULL)
return NULL;
- pctldev = kzalloc(sizeof(struct pinctrl_dev), GFP_KERNEL);
- if (pctldev == NULL)
- return NULL;
-
- /* Initialize pin control device struct */
- pctldev->owner = pctldesc->owner;
- pctldev->desc = pctldesc;
- pctldev->driver_data = driver_data;
- INIT_RADIX_TREE(&pctldev->pin_desc_tree, GFP_KERNEL);
- spin_lock_init(&pctldev->pin_desc_tree_lock);
- INIT_LIST_HEAD(&pctldev->gpio_ranges);
- mutex_init(&pctldev->gpio_ranges_lock);
- pctldev->dev = dev;
-
/* If we're implementing pinmuxing, check the ops for sanity */
if (pctldesc->pmxops) {
- ret = pinmux_check_ops(pctldev);
+ ret = pinmux_check_ops(pctldesc->pmxops);
if (ret) {
pr_err("%s pinmux ops lacks necessary functions\n",
pctldesc->name);
- goto out_err;
+ return NULL;
}
}
/* If we're implementing pinconfig, check the ops for sanity */
if (pctldesc->confops) {
- ret = pinconf_check_ops(pctldev);
+ ret = pinconf_check_ops(pctldesc->confops);
if (ret) {
pr_err("%s pin config ops lacks necessary functions\n",
pctldesc->name);
- goto out_err;
+ return NULL;
}
}
+ pctldev = kzalloc(sizeof(struct pinctrl_dev), GFP_KERNEL);
+ if (pctldev == NULL)
+ return NULL;
+
+ /* Initialize pin control device struct */
+ pctldev->owner = pctldesc->owner;
+ pctldev->desc = pctldesc;
+ pctldev->driver_data = driver_data;
+ INIT_RADIX_TREE(&pctldev->pin_desc_tree, GFP_KERNEL);
+ spin_lock_init(&pctldev->pin_desc_tree_lock);
+ INIT_LIST_HEAD(&pctldev->gpio_ranges);
+ mutex_init(&pctldev->gpio_ranges_lock);
+ pctldev->dev = dev;
+
/* Register all the pins */
pr_debug("try to register %d pins on %s...\n",
pctldesc->npins, pctldesc->name);
@@ -652,7 +641,6 @@ void pinctrl_unregister(struct pinctrl_dev *pctldev)
if (pctldev == NULL)
return;
- pinctrl_remove_device_debugfs(pctldev);
pinmux_unhog_maps(pctldev);
/* TODO: check that no pinmuxes are still active? */
mutex_lock(&pinctrldev_list_mutex);
diff --git a/trunk/drivers/pinctrl/core.h b/trunk/drivers/pinctrl/core.h
index cfa86da6b4b1..177a3310547f 100644
--- a/trunk/drivers/pinctrl/core.h
+++ b/trunk/drivers/pinctrl/core.h
@@ -41,9 +41,6 @@ struct pinctrl_dev {
struct device *dev;
struct module *owner;
void *driver_data;
-#ifdef CONFIG_DEBUG_FS
- struct dentry *device_root;
-#endif
#ifdef CONFIG_PINMUX
struct mutex pinmux_hogs_lock;
struct list_head pinmux_hogs;
diff --git a/trunk/drivers/pinctrl/pinconf.c b/trunk/drivers/pinctrl/pinconf.c
index 9fb75456824c..1259872b0a1d 100644
--- a/trunk/drivers/pinctrl/pinconf.c
+++ b/trunk/drivers/pinctrl/pinconf.c
@@ -205,10 +205,8 @@ int pin_config_group_set(const char *dev_name, const char *pin_group,
}
EXPORT_SYMBOL(pin_config_group_set);
-int pinconf_check_ops(struct pinctrl_dev *pctldev)
+int pinconf_check_ops(const struct pinconf_ops *ops)
{
- const struct pinconf_ops *ops = pctldev->desc->confops;
-
/* We must be able to read out pin status */
if (!ops->pin_config_get && !ops->pin_config_group_get)
return -EINVAL;
@@ -238,7 +236,7 @@ static int pinconf_pins_show(struct seq_file *s, void *what)
seq_puts(s, "Format: pin (name): pinmux setting array\n");
/* The pin number can be retrived from the pin controller descriptor */
- for (i = 0; i < pctldev->desc->npins; i++) {
+ for (i = 0; pin < pctldev->desc->npins; i++) {
struct pin_desc *desc;
pin = pctldev->desc->pins[i].number;
diff --git a/trunk/drivers/pinctrl/pinconf.h b/trunk/drivers/pinctrl/pinconf.h
index 006b77fa737e..e7dc6165032a 100644
--- a/trunk/drivers/pinctrl/pinconf.h
+++ b/trunk/drivers/pinctrl/pinconf.h
@@ -13,7 +13,7 @@
#ifdef CONFIG_PINCONF
-int pinconf_check_ops(struct pinctrl_dev *pctldev);
+int pinconf_check_ops(const struct pinconf_ops *ops);
void pinconf_init_device_debugfs(struct dentry *devroot,
struct pinctrl_dev *pctldev);
int pin_config_get_for_pin(struct pinctrl_dev *pctldev, unsigned pin,
@@ -23,7 +23,7 @@ int pin_config_set_for_pin(struct pinctrl_dev *pctldev, unsigned pin,
#else
-static inline int pinconf_check_ops(struct pinctrl_dev *pctldev)
+static inline int pinconf_check_ops(const struct pinconf_ops *ops)
{
return 0;
}
diff --git a/trunk/drivers/pinctrl/pinmux.c b/trunk/drivers/pinctrl/pinmux.c
index 7c3193f7a044..a76a348321bb 100644
--- a/trunk/drivers/pinctrl/pinmux.c
+++ b/trunk/drivers/pinctrl/pinmux.c
@@ -53,6 +53,11 @@ struct pinmux_group {
* @dev: the device using this pinmux
* @usecount: the number of active users of this mux setting, used to keep
* track of nested use cases
+ * @pins: an array of discrete physical pins used in this mapping, taken
+ * from the global pin enumeration space (copied from pinmux map)
+ * @num_pins: the number of pins in this mapping array, i.e. the number of
+ * elements in .pins so we can iterate over that array (copied from
+ * pinmux map)
* @pctldev: pin control device handling this pinmux
* @func_selector: the function selector for the pinmux device handling
* this pinmux
@@ -147,7 +152,8 @@ static int pin_request(struct pinctrl_dev *pctldev,
status = 0;
if (status)
- dev_err(pctldev->dev, "->request on device %s failed for pin %d\n",
+ dev_err(pctldev->dev, "->request on device %s failed "
+ "for pin %d\n",
pctldev->desc->name, pin);
out_free_pin:
if (status) {
@@ -349,20 +355,21 @@ int __init pinmux_register_mappings(struct pinmux_map const *maps,
/* First sanity check the new mapping */
for (i = 0; i < num_maps; i++) {
if (!maps[i].name) {
- pr_err("failed to register map %d: no map name given\n",
- i);
+ pr_err("failed to register map %d: "
+ "no map name given\n", i);
return -EINVAL;
}
if (!maps[i].ctrl_dev && !maps[i].ctrl_dev_name) {
- pr_err("failed to register map %s (%d): no pin control device given\n",
+ pr_err("failed to register map %s (%d): "
+ "no pin control device given\n",
maps[i].name, i);
return -EINVAL;
}
if (!maps[i].function) {
- pr_err("failed to register map %s (%d): no function ID given\n",
- maps[i].name, i);
+ pr_err("failed to register map %s (%d): "
+ "no function ID given\n", maps[i].name, i);
return -EINVAL;
}
@@ -404,7 +411,7 @@ int __init pinmux_register_mappings(struct pinmux_map const *maps,
}
/**
- * acquire_pins() - acquire all the pins for a certain function on a pinmux
+ * acquire_pins() - acquire all the pins for a certain funcion on a pinmux
* @pctldev: the device to take the pins on
* @func_selector: the function selector to acquire the pins for
* @group_selector: the group selector containing the pins to acquire
@@ -435,7 +442,8 @@ static int acquire_pins(struct pinctrl_dev *pctldev,
ret = pin_request(pctldev, pins[i], func, NULL);
if (ret) {
dev_err(pctldev->dev,
- "could not get pin %d for function %s on device %s - conflicting mux mappings?\n",
+ "could not get pin %d for function %s "
+ "on device %s - conflicting mux mappings?\n",
pins[i], func ? : "(undefined)",
pinctrl_dev_get_name(pctldev));
/* On error release all taken pins */
@@ -450,7 +458,7 @@ static int acquire_pins(struct pinctrl_dev *pctldev,
/**
* release_pins() - release pins taken by earlier acquirement
- * @pctldev: the device to free the pins on
+ * @pctldev: the device to free the pinx on
* @group_selector: the group selector containing the pins to free
*/
static void release_pins(struct pinctrl_dev *pctldev,
@@ -465,7 +473,8 @@ static void release_pins(struct pinctrl_dev *pctldev,
ret = pctlops->get_group_pins(pctldev, group_selector,
&pins, &num_pins);
if (ret) {
- dev_err(pctldev->dev, "could not get pins to release for group selector %d\n",
+ dev_err(pctldev->dev, "could not get pins to release for "
+ "group selector %d\n",
group_selector);
return;
}
@@ -517,7 +526,8 @@ static int pinmux_check_pin_group(struct pinctrl_dev *pctldev,
ret = pinctrl_get_group_selector(pctldev, groups[0]);
if (ret < 0) {
dev_err(pctldev->dev,
- "function %s wants group %s but the pin controller does not seem to have that group\n",
+ "function %s wants group %s but the pin "
+ "controller does not seem to have that group\n",
pmxops->get_function_name(pctldev, func_selector),
groups[0]);
return ret;
@@ -525,7 +535,8 @@ static int pinmux_check_pin_group(struct pinctrl_dev *pctldev,
if (num_groups > 1)
dev_dbg(pctldev->dev,
- "function %s support more than one group, default-selecting first group %s (%d)\n",
+ "function %s support more than one group, "
+ "default-selecting first group %s (%d)\n",
pmxops->get_function_name(pctldev, func_selector),
groups[0],
ret);
@@ -617,8 +628,10 @@ static int pinmux_enable_muxmap(struct pinctrl_dev *pctldev,
if (pmx->pctldev && pmx->pctldev != pctldev) {
dev_err(pctldev->dev,
- "different pin control devices given for device %s, function %s\n",
- devname, map->function);
+ "different pin control devices given for device %s, "
+ "function %s\n",
+ devname,
+ map->function);
return -EINVAL;
}
pmx->dev = dev;
@@ -682,6 +695,7 @@ static void pinmux_free_groups(struct pinmux *pmx)
*/
struct pinmux *pinmux_get(struct device *dev, const char *name)
{
+
struct pinmux_map const *map = NULL;
struct pinctrl_dev *pctldev = NULL;
const char *devname = NULL;
@@ -731,7 +745,8 @@ struct pinmux *pinmux_get(struct device *dev, const char *name)
else if (map->ctrl_dev_name)
devname = map->ctrl_dev_name;
- pr_warning("could not find a pinctrl device for pinmux function %s, fishy, they shall all have one\n",
+ pr_warning("could not find a pinctrl device for pinmux "
+ "function %s, fishy, they shall all have one\n",
map->function);
pr_warning("given pinctrl device name: %s",
devname ? devname : "UNDEFINED");
@@ -889,11 +904,8 @@ void pinmux_disable(struct pinmux *pmx)
}
EXPORT_SYMBOL_GPL(pinmux_disable);
-int pinmux_check_ops(struct pinctrl_dev *pctldev)
+int pinmux_check_ops(const struct pinmux_ops *ops)
{
- const struct pinmux_ops *ops = pctldev->desc->pmxops;
- unsigned selector = 0;
-
/* Check that we implement required operations */
if (!ops->list_functions ||
!ops->get_function_name ||
@@ -902,18 +914,6 @@ int pinmux_check_ops(struct pinctrl_dev *pctldev)
!ops->disable)
return -EINVAL;
- /* Check that all functions registered have names */
- while (ops->list_functions(pctldev, selector) >= 0) {
- const char *fname = ops->get_function_name(pctldev,
- selector);
- if (!fname) {
- pr_err("pinmux ops has no name for function%u\n",
- selector);
- return -EINVAL;
- }
- selector++;
- }
-
return 0;
}
@@ -932,8 +932,8 @@ static int pinmux_hog_map(struct pinctrl_dev *pctldev,
* without any problems, so then we can hog pinmuxes for
* all devices that just want a static pin mux at this point.
*/
- dev_err(pctldev->dev, "map %s wants to hog a non-system pinmux, this is not going to work\n",
- map->name);
+ dev_err(pctldev->dev, "map %s wants to hog a non-system "
+ "pinmux, this is not going to work\n", map->name);
return -EINVAL;
}
@@ -993,12 +993,9 @@ int pinmux_hog_maps(struct pinctrl_dev *pctldev)
for (i = 0; i < pinmux_maps_num; i++) {
struct pinmux_map const *map = &pinmux_maps[i];
- if (!map->hog_on_boot)
- continue;
-
- if ((map->ctrl_dev == dev) ||
- (map->ctrl_dev_name &&
- !strcmp(map->ctrl_dev_name, devname))) {
+ if (((map->ctrl_dev == dev) ||
+ !strcmp(map->ctrl_dev_name, devname)) &&
+ map->hog_on_boot) {
/* OK time to hog! */
ret = pinmux_hog_map(pctldev, map);
if (ret)
@@ -1125,15 +1122,13 @@ static int pinmux_show(struct seq_file *s, void *what)
seq_printf(s, "device: %s function: %s (%u),",
pinctrl_dev_get_name(pmx->pctldev),
- pmxops->get_function_name(pctldev,
- pmx->func_selector),
+ pmxops->get_function_name(pctldev, pmx->func_selector),
pmx->func_selector);
seq_printf(s, " groups: [");
list_for_each_entry(grp, &pmx->groups, node) {
seq_printf(s, " %s (%u)",
- pctlops->get_group_name(pctldev,
- grp->group_selector),
+ pctlops->get_group_name(pctldev, grp->group_selector),
grp->group_selector);
}
seq_printf(s, " ]");
diff --git a/trunk/drivers/pinctrl/pinmux.h b/trunk/drivers/pinctrl/pinmux.h
index 97f52223fbc2..844500b3331b 100644
--- a/trunk/drivers/pinctrl/pinmux.h
+++ b/trunk/drivers/pinctrl/pinmux.h
@@ -12,7 +12,7 @@
*/
#ifdef CONFIG_PINMUX
-int pinmux_check_ops(struct pinctrl_dev *pctldev);
+int pinmux_check_ops(const struct pinmux_ops *ops);
void pinmux_init_device_debugfs(struct dentry *devroot,
struct pinctrl_dev *pctldev);
void pinmux_init_debugfs(struct dentry *subsys_root);
@@ -21,7 +21,7 @@ void pinmux_unhog_maps(struct pinctrl_dev *pctldev);
#else
-static inline int pinmux_check_ops(struct pinctrl_dev *pctldev)
+static inline int pinmux_check_ops(const struct pinmux_ops *ops)
{
return 0;
}
diff --git a/trunk/drivers/staging/media/go7007/go7007-usb.c b/trunk/drivers/staging/media/go7007/go7007-usb.c
index 5443e25086e9..70e006b50f29 100644
--- a/trunk/drivers/staging/media/go7007/go7007-usb.c
+++ b/trunk/drivers/staging/media/go7007/go7007-usb.c
@@ -1279,4 +1279,3 @@ static struct usb_driver go7007_usb_driver = {
};
module_usb_driver(go7007_usb_driver);
-MODULE_LICENSE("GPL v2");
diff --git a/trunk/fs/logfs/dev_mtd.c b/trunk/fs/logfs/dev_mtd.c
index 9c501449450d..e97404d611e0 100644
--- a/trunk/fs/logfs/dev_mtd.c
+++ b/trunk/fs/logfs/dev_mtd.c
@@ -152,6 +152,9 @@ static struct page *logfs_mtd_find_first_sb(struct super_block *sb, u64 *ofs)
filler_t *filler = logfs_mtd_readpage;
struct mtd_info *mtd = super->s_mtd;
+ if (!mtd_can_have_bb(mtd))
+ return NULL;
+
*ofs = 0;
while (mtd_block_isbad(mtd, *ofs)) {
*ofs += mtd->erasesize;
@@ -169,6 +172,9 @@ static struct page *logfs_mtd_find_last_sb(struct super_block *sb, u64 *ofs)
filler_t *filler = logfs_mtd_readpage;
struct mtd_info *mtd = super->s_mtd;
+ if (!mtd_can_have_bb(mtd))
+ return NULL;
+
*ofs = mtd->size - mtd->erasesize;
while (mtd_block_isbad(mtd, *ofs)) {
*ofs -= mtd->erasesize;
diff --git a/trunk/fs/logfs/dir.c b/trunk/fs/logfs/dir.c
index 3de7a32cadbe..501043e8966c 100644
--- a/trunk/fs/logfs/dir.c
+++ b/trunk/fs/logfs/dir.c
@@ -71,7 +71,7 @@ static int write_dir(struct inode *dir, struct logfs_disk_dentry *dd,
static int write_inode(struct inode *inode)
{
- return __logfs_write_inode(inode, NULL, WF_LOCK);
+ return __logfs_write_inode(inode, WF_LOCK);
}
static s64 dir_seek_data(struct inode *inode, s64 pos)
diff --git a/trunk/fs/logfs/file.c b/trunk/fs/logfs/file.c
index 3886cded283c..b548c87a86f1 100644
--- a/trunk/fs/logfs/file.c
+++ b/trunk/fs/logfs/file.c
@@ -230,9 +230,7 @@ int logfs_fsync(struct file *file, loff_t start, loff_t end, int datasync)
return ret;
mutex_lock(&inode->i_mutex);
- logfs_get_wblocks(sb, NULL, WF_LOCK);
logfs_write_anchor(sb);
- logfs_put_wblocks(sb, NULL, WF_LOCK);
mutex_unlock(&inode->i_mutex);
return 0;
diff --git a/trunk/fs/logfs/gc.c b/trunk/fs/logfs/gc.c
index d4efb061bdc5..caa4419285dc 100644
--- a/trunk/fs/logfs/gc.c
+++ b/trunk/fs/logfs/gc.c
@@ -367,7 +367,7 @@ static struct gc_candidate *get_candidate(struct super_block *sb)
int i, max_dist;
struct gc_candidate *cand = NULL, *this;
- max_dist = min(no_free_segments(sb), LOGFS_NO_AREAS - 1);
+ max_dist = min(no_free_segments(sb), LOGFS_NO_AREAS);
for (i = max_dist; i >= 0; i--) {
this = first_in_list(&super->s_low_list[i]);
diff --git a/trunk/fs/logfs/inode.c b/trunk/fs/logfs/inode.c
index a422f42238b2..388df1aa35e5 100644
--- a/trunk/fs/logfs/inode.c
+++ b/trunk/fs/logfs/inode.c
@@ -286,7 +286,7 @@ static int logfs_write_inode(struct inode *inode, struct writeback_control *wbc)
if (logfs_inode(inode)->li_flags & LOGFS_IF_STILLBORN)
return 0;
- ret = __logfs_write_inode(inode, NULL, flags);
+ ret = __logfs_write_inode(inode, flags);
LOGFS_BUG_ON(ret, inode->i_sb);
return ret;
}
@@ -363,9 +363,7 @@ static void logfs_init_once(void *_li)
static int logfs_sync_fs(struct super_block *sb, int wait)
{
- logfs_get_wblocks(sb, NULL, WF_LOCK);
logfs_write_anchor(sb);
- logfs_put_wblocks(sb, NULL, WF_LOCK);
return 0;
}
diff --git a/trunk/fs/logfs/journal.c b/trunk/fs/logfs/journal.c
index 1e1c369df22b..9da29706f91c 100644
--- a/trunk/fs/logfs/journal.c
+++ b/trunk/fs/logfs/journal.c
@@ -612,6 +612,7 @@ static size_t __logfs_write_je(struct super_block *sb, void *buf, u16 type,
if (len == 0)
return logfs_write_header(super, header, 0, type);
+ BUG_ON(len > sb->s_blocksize);
compr_len = logfs_compress(buf, data, len, sb->s_blocksize);
if (compr_len < 0 || type == JE_ANCHOR) {
memcpy(data, buf, len);
diff --git a/trunk/fs/logfs/logfs.h b/trunk/fs/logfs/logfs.h
index 5f0937609465..926373866a55 100644
--- a/trunk/fs/logfs/logfs.h
+++ b/trunk/fs/logfs/logfs.h
@@ -528,7 +528,7 @@ void logfs_destroy_inode_cache(void);
void logfs_set_blocks(struct inode *inode, u64 no);
/* these logically belong into inode.c but actually reside in readwrite.c */
int logfs_read_inode(struct inode *inode);
-int __logfs_write_inode(struct inode *inode, struct page *, long flags);
+int __logfs_write_inode(struct inode *inode, long flags);
void logfs_evict_inode(struct inode *inode);
/* journal.c */
@@ -577,8 +577,6 @@ void initialize_block_counters(struct page *page, struct logfs_block *block,
__be64 *array, int page_is_empty);
int logfs_exist_block(struct inode *inode, u64 bix);
int get_page_reserve(struct inode *inode, struct page *page);
-void logfs_get_wblocks(struct super_block *sb, struct page *page, int lock);
-void logfs_put_wblocks(struct super_block *sb, struct page *page, int lock);
extern struct logfs_block_ops indirect_block_ops;
/* segment.c */
@@ -596,7 +594,6 @@ int logfs_init_mapping(struct super_block *sb);
void logfs_sync_area(struct logfs_area *area);
void logfs_sync_segments(struct super_block *sb);
void freeseg(struct super_block *sb, u32 segno);
-void free_areas(struct super_block *sb);
/* area handling */
int logfs_init_areas(struct super_block *sb);
diff --git a/trunk/fs/logfs/readwrite.c b/trunk/fs/logfs/readwrite.c
index 4153e65b0148..2ac4217b7901 100644
--- a/trunk/fs/logfs/readwrite.c
+++ b/trunk/fs/logfs/readwrite.c
@@ -244,7 +244,8 @@ static void preunlock_page(struct super_block *sb, struct page *page, int lock)
* is waiting for s_write_mutex. We annotate this fact by setting PG_pre_locked
* in addition to PG_locked.
*/
-void logfs_get_wblocks(struct super_block *sb, struct page *page, int lock)
+static void logfs_get_wblocks(struct super_block *sb, struct page *page,
+ int lock)
{
struct logfs_super *super = logfs_super(sb);
@@ -259,7 +260,8 @@ void logfs_get_wblocks(struct super_block *sb, struct page *page, int lock)
}
}
-void logfs_put_wblocks(struct super_block *sb, struct page *page, int lock)
+static void logfs_put_wblocks(struct super_block *sb, struct page *page,
+ int lock)
{
struct logfs_super *super = logfs_super(sb);
@@ -422,7 +424,7 @@ static void inode_write_block(struct logfs_block *block)
if (inode->i_ino == LOGFS_INO_MASTER)
logfs_write_anchor(inode->i_sb);
else {
- ret = __logfs_write_inode(inode, NULL, 0);
+ ret = __logfs_write_inode(inode, 0);
/* see indirect_write_block comment */
BUG_ON(ret);
}
@@ -558,13 +560,8 @@ static void inode_free_block(struct super_block *sb, struct logfs_block *block)
static void indirect_free_block(struct super_block *sb,
struct logfs_block *block)
{
- struct page *page = block->page;
-
- if (PagePrivate(page)) {
- ClearPagePrivate(page);
- page_cache_release(page);
- set_page_private(page, 0);
- }
+ ClearPagePrivate(block->page);
+ block->page->private = 0;
__free_block(sb, block);
}
@@ -653,11 +650,8 @@ static void alloc_data_block(struct inode *inode, struct page *page)
logfs_unpack_index(page->index, &bix, &level);
block = __alloc_block(inode->i_sb, inode->i_ino, bix, level);
block->page = page;
-
SetPagePrivate(page);
- page_cache_get(page);
- set_page_private(page, (unsigned long) block);
-
+ page->private = (unsigned long)block;
block->ops = &indirect_block_ops;
}
@@ -1576,15 +1570,11 @@ int logfs_write_buf(struct inode *inode, struct page *page, long flags)
static int __logfs_delete(struct inode *inode, struct page *page)
{
long flags = WF_DELETE;
- int err;
inode->i_ctime = inode->i_mtime = CURRENT_TIME;
if (page->index < I0_BLOCKS)
return logfs_write_direct(inode, page, flags);
- err = grow_inode(inode, page->index, 0);
- if (err)
- return err;
return logfs_write_rec(inode, page, page->index, 0, flags);
}
@@ -1633,7 +1623,7 @@ int logfs_rewrite_block(struct inode *inode, u64 bix, u64 ofs,
if (inode->i_ino == LOGFS_INO_MASTER)
logfs_write_anchor(inode->i_sb);
else {
- err = __logfs_write_inode(inode, page, flags);
+ err = __logfs_write_inode(inode, flags);
}
}
}
@@ -1883,7 +1873,7 @@ int logfs_truncate(struct inode *inode, u64 target)
logfs_get_wblocks(sb, NULL, 1);
err = __logfs_truncate(inode, size);
if (!err)
- err = __logfs_write_inode(inode, NULL, 0);
+ err = __logfs_write_inode(inode, 0);
logfs_put_wblocks(sb, NULL, 1);
}
@@ -1911,11 +1901,8 @@ static void move_page_to_inode(struct inode *inode, struct page *page)
li->li_block = block;
block->page = NULL;
- if (PagePrivate(page)) {
- ClearPagePrivate(page);
- page_cache_release(page);
- set_page_private(page, 0);
- }
+ page->private = 0;
+ ClearPagePrivate(page);
}
static void move_inode_to_page(struct page *page, struct inode *inode)
@@ -1931,12 +1918,8 @@ static void move_inode_to_page(struct page *page, struct inode *inode)
BUG_ON(PagePrivate(page));
block->ops = &indirect_block_ops;
block->page = page;
-
- if (!PagePrivate(page)) {
- SetPagePrivate(page);
- page_cache_get(page);
- set_page_private(page, (unsigned long) block);
- }
+ page->private = (unsigned long)block;
+ SetPagePrivate(page);
block->inode = NULL;
li->li_block = NULL;
@@ -2123,14 +2106,14 @@ void logfs_set_segment_unreserved(struct super_block *sb, u32 segno, u32 ec)
ec_level);
}
-int __logfs_write_inode(struct inode *inode, struct page *page, long flags)
+int __logfs_write_inode(struct inode *inode, long flags)
{
struct super_block *sb = inode->i_sb;
int ret;
- logfs_get_wblocks(sb, page, flags & WF_LOCK);
+ logfs_get_wblocks(sb, NULL, flags & WF_LOCK);
ret = do_write_inode(inode);
- logfs_put_wblocks(sb, page, flags & WF_LOCK);
+ logfs_put_wblocks(sb, NULL, flags & WF_LOCK);
return ret;
}
diff --git a/trunk/fs/logfs/segment.c b/trunk/fs/logfs/segment.c
index ab798ed1cc88..9d5187353255 100644
--- a/trunk/fs/logfs/segment.c
+++ b/trunk/fs/logfs/segment.c
@@ -86,11 +86,7 @@ int __logfs_buf_write(struct logfs_area *area, u64 ofs, void *buf, size_t len,
BUG_ON(!page); /* FIXME: reserve a pool */
SetPageUptodate(page);
memcpy(page_address(page) + offset, buf, copylen);
-
- if (!PagePrivate(page)) {
- SetPagePrivate(page);
- page_cache_get(page);
- }
+ SetPagePrivate(page);
page_cache_release(page);
buf += copylen;
@@ -114,10 +110,7 @@ static void pad_partial_page(struct logfs_area *area)
page = get_mapping_page(sb, index, 0);
BUG_ON(!page); /* FIXME: reserve a pool */
memset(page_address(page) + offset, 0xff, len);
- if (!PagePrivate(page)) {
- SetPagePrivate(page);
- page_cache_get(page);
- }
+ SetPagePrivate(page);
page_cache_release(page);
}
}
@@ -137,10 +130,7 @@ static void pad_full_pages(struct logfs_area *area)
BUG_ON(!page); /* FIXME: reserve a pool */
SetPageUptodate(page);
memset(page_address(page), 0xff, PAGE_CACHE_SIZE);
- if (!PagePrivate(page)) {
- SetPagePrivate(page);
- page_cache_get(page);
- }
+ SetPagePrivate(page);
page_cache_release(page);
index++;
no_indizes--;
@@ -495,12 +485,8 @@ static void move_btree_to_page(struct inode *inode, struct page *page,
mempool_free(item, super->s_alias_pool);
}
block->page = page;
-
- if (!PagePrivate(page)) {
- SetPagePrivate(page);
- page_cache_get(page);
- set_page_private(page, (unsigned long) block);
- }
+ SetPagePrivate(page);
+ page->private = (unsigned long)block;
block->ops = &indirect_block_ops;
initialize_block_counters(page, block, data, 0);
}
@@ -550,12 +536,8 @@ void move_page_to_btree(struct page *page)
list_add(&item->list, &block->item_list);
}
block->page = NULL;
-
- if (PagePrivate(page)) {
- ClearPagePrivate(page);
- page_cache_release(page);
- set_page_private(page, 0);
- }
+ ClearPagePrivate(page);
+ page->private = 0;
block->ops = &btree_block_ops;
err = alias_tree_insert(block->sb, block->ino, block->bix, block->level,
block);
@@ -720,10 +702,7 @@ void freeseg(struct super_block *sb, u32 segno)
page = find_get_page(mapping, ofs >> PAGE_SHIFT);
if (!page)
continue;
- if (PagePrivate(page)) {
- ClearPagePrivate(page);
- page_cache_release(page);
- }
+ ClearPagePrivate(page);
page_cache_release(page);
}
}
@@ -862,16 +841,6 @@ static void free_area(struct logfs_area *area)
kfree(area);
}
-void free_areas(struct super_block *sb)
-{
- struct logfs_super *super = logfs_super(sb);
- int i;
-
- for_each_area(i)
- free_area(super->s_area[i]);
- free_area(super->s_journal_area);
-}
-
static struct logfs_area *alloc_area(struct super_block *sb)
{
struct logfs_area *area;
@@ -954,6 +923,10 @@ int logfs_init_areas(struct super_block *sb)
void logfs_cleanup_areas(struct super_block *sb)
{
struct logfs_super *super = logfs_super(sb);
+ int i;
btree_grim_visitor128(&super->s_object_alias_tree, 0, kill_alias);
+ for_each_area(i)
+ free_area(super->s_area[i]);
+ free_area(super->s_journal_area);
}
diff --git a/trunk/fs/logfs/super.c b/trunk/fs/logfs/super.c
index c9ee7f5d1caf..e795c234ea33 100644
--- a/trunk/fs/logfs/super.c
+++ b/trunk/fs/logfs/super.c
@@ -486,15 +486,14 @@ static void logfs_kill_sb(struct super_block *sb)
/* Alias entries slow down mount, so evict as many as possible */
sync_filesystem(sb);
logfs_write_anchor(sb);
- free_areas(sb);
/*
* From this point on alias entries are simply dropped - and any
* writes to the object store are considered bugs.
*/
+ super->s_flags |= LOGFS_SB_FLAG_SHUTDOWN;
log_super("LogFS: Now in shutdown\n");
generic_shutdown_super(sb);
- super->s_flags |= LOGFS_SB_FLAG_SHUTDOWN;
BUG_ON(super->s_dirty_used_bytes || super->s_dirty_free_bytes);
diff --git a/trunk/fs/proc/base.c b/trunk/fs/proc/base.c
index d9512bd03e6c..9cde9edf9c4d 100644
--- a/trunk/fs/proc/base.c
+++ b/trunk/fs/proc/base.c
@@ -711,13 +711,6 @@ static int mem_open(struct inode* inode, struct file* file)
if (IS_ERR(mm))
return PTR_ERR(mm);
- if (mm) {
- /* ensure this mm_struct can't be freed */
- atomic_inc(&mm->mm_count);
- /* but do not pin its memory */
- mmput(mm);
- }
-
/* OK to pass negative loff_t, we can catch out-of-range */
file->f_mode |= FMODE_UNSIGNED_OFFSET;
file->private_data = mm;
@@ -725,13 +718,13 @@ static int mem_open(struct inode* inode, struct file* file)
return 0;
}
-static ssize_t mem_rw(struct file *file, char __user *buf,
- size_t count, loff_t *ppos, int write)
+static ssize_t mem_read(struct file * file, char __user * buf,
+ size_t count, loff_t *ppos)
{
- struct mm_struct *mm = file->private_data;
- unsigned long addr = *ppos;
- ssize_t copied;
+ int ret;
char *page;
+ unsigned long src = *ppos;
+ struct mm_struct *mm = file->private_data;
if (!mm)
return 0;
@@ -740,55 +733,76 @@ static ssize_t mem_rw(struct file *file, char __user *buf,
if (!page)
return -ENOMEM;
- copied = 0;
- if (!atomic_inc_not_zero(&mm->mm_users))
- goto free;
-
+ ret = 0;
+
while (count > 0) {
- int this_len = min_t(int, count, PAGE_SIZE);
+ int this_len, retval;
- if (write && copy_from_user(page, buf, this_len)) {
- copied = -EFAULT;
+ this_len = (count > PAGE_SIZE) ? PAGE_SIZE : count;
+ retval = access_remote_vm(mm, src, page, this_len, 0);
+ if (!retval) {
+ if (!ret)
+ ret = -EIO;
break;
}
- this_len = access_remote_vm(mm, addr, page, this_len, write);
- if (!this_len) {
- if (!copied)
- copied = -EIO;
+ if (copy_to_user(buf, page, retval)) {
+ ret = -EFAULT;
break;
}
+
+ ret += retval;
+ src += retval;
+ buf += retval;
+ count -= retval;
+ }
+ *ppos = src;
+
+ free_page((unsigned long) page);
+ return ret;
+}
+
+static ssize_t mem_write(struct file * file, const char __user *buf,
+ size_t count, loff_t *ppos)
+{
+ int copied;
+ char *page;
+ unsigned long dst = *ppos;
+ struct mm_struct *mm = file->private_data;
+
+ if (!mm)
+ return 0;
+
+ page = (char *)__get_free_page(GFP_TEMPORARY);
+ if (!page)
+ return -ENOMEM;
+
+ copied = 0;
+ while (count > 0) {
+ int this_len, retval;
- if (!write && copy_to_user(buf, page, this_len)) {
+ this_len = (count > PAGE_SIZE) ? PAGE_SIZE : count;
+ if (copy_from_user(page, buf, this_len)) {
copied = -EFAULT;
break;
}
-
- buf += this_len;
- addr += this_len;
- copied += this_len;
- count -= this_len;
+ retval = access_remote_vm(mm, dst, page, this_len, 1);
+ if (!retval) {
+ if (!copied)
+ copied = -EIO;
+ break;
+ }
+ copied += retval;
+ buf += retval;
+ dst += retval;
+ count -= retval;
}
- *ppos = addr;
+ *ppos = dst;
- mmput(mm);
-free:
free_page((unsigned long) page);
return copied;
}
-static ssize_t mem_read(struct file *file, char __user *buf,
- size_t count, loff_t *ppos)
-{
- return mem_rw(file, buf, count, ppos, 0);
-}
-
-static ssize_t mem_write(struct file *file, const char __user *buf,
- size_t count, loff_t *ppos)
-{
- return mem_rw(file, (char __user*)buf, count, ppos, 1);
-}
-
loff_t mem_lseek(struct file *file, loff_t offset, int orig)
{
switch (orig) {
@@ -808,8 +822,8 @@ loff_t mem_lseek(struct file *file, loff_t offset, int orig)
static int mem_release(struct inode *inode, struct file *file)
{
struct mm_struct *mm = file->private_data;
- if (mm)
- mmdrop(mm);
+
+ mmput(mm);
return 0;
}
diff --git a/trunk/include/linux/mpi.h b/trunk/include/linux/mpi.h
index d02cca6cc8ce..06f88994ccaa 100644
--- a/trunk/include/linux/mpi.h
+++ b/trunk/include/linux/mpi.h
@@ -57,6 +57,8 @@ struct gcry_mpi {
typedef struct gcry_mpi *MPI;
+#define MPI_NULL NULL
+
#define mpi_get_nlimbs(a) ((a)->nlimbs)
#define mpi_is_neg(a) ((a)->sign)
diff --git a/trunk/include/linux/mtd/mtd.h b/trunk/include/linux/mtd/mtd.h
index 887ebe318c75..1a81fde8f333 100644
--- a/trunk/include/linux/mtd/mtd.h
+++ b/trunk/include/linux/mtd/mtd.h
@@ -441,7 +441,7 @@ static inline void mtd_resume(struct mtd_info *mtd)
static inline int mtd_block_isbad(struct mtd_info *mtd, loff_t ofs)
{
if (!mtd->block_isbad)
- return 0;
+ return -EOPNOTSUPP;
return mtd->block_isbad(mtd, ofs);
}
diff --git a/trunk/include/linux/perf_event.h b/trunk/include/linux/perf_event.h
index abb2776be1ba..08855613ceb3 100644
--- a/trunk/include/linux/perf_event.h
+++ b/trunk/include/linux/perf_event.h
@@ -587,7 +587,6 @@ struct hw_perf_event {
u64 sample_period;
u64 last_period;
local64_t period_left;
- u64 interrupts_seq;
u64 interrupts;
u64 freq_time_stamp;
diff --git a/trunk/kernel/events/core.c b/trunk/kernel/events/core.c
index ba36013cfb21..32b48c889711 100644
--- a/trunk/kernel/events/core.c
+++ b/trunk/kernel/events/core.c
@@ -2300,9 +2300,6 @@ do { \
return div64_u64(dividend, divisor);
}
-static DEFINE_PER_CPU(int, perf_throttled_count);
-static DEFINE_PER_CPU(u64, perf_throttled_seq);
-
static void perf_adjust_period(struct perf_event *event, u64 nsec, u64 count)
{
struct hw_perf_event *hwc = &event->hw;
@@ -2328,29 +2325,16 @@ static void perf_adjust_period(struct perf_event *event, u64 nsec, u64 count)
}
}
-/*
- * combine freq adjustment with unthrottling to avoid two passes over the
- * events. At the same time, make sure, having freq events does not change
- * the rate of unthrottling as that would introduce bias.
- */
-static void perf_adjust_freq_unthr_context(struct perf_event_context *ctx,
- int needs_unthr)
+static void perf_ctx_adjust_freq(struct perf_event_context *ctx, u64 period)
{
struct perf_event *event;
struct hw_perf_event *hwc;
- u64 now, period = TICK_NSEC;
+ u64 interrupts, now;
s64 delta;
- /*
- * only need to iterate over all events iff:
- * - context have events in frequency mode (needs freq adjust)
- * - there are events to unthrottle on this cpu
- */
- if (!(ctx->nr_freq || needs_unthr))
+ if (!ctx->nr_freq)
return;
- raw_spin_lock(&ctx->lock);
-
list_for_each_entry_rcu(event, &ctx->event_list, event_entry) {
if (event->state != PERF_EVENT_STATE_ACTIVE)
continue;
@@ -2360,8 +2344,13 @@ static void perf_adjust_freq_unthr_context(struct perf_event_context *ctx,
hwc = &event->hw;
- if (needs_unthr && hwc->interrupts == MAX_INTERRUPTS) {
- hwc->interrupts = 0;
+ interrupts = hwc->interrupts;
+ hwc->interrupts = 0;
+
+ /*
+ * unthrottle events on the tick
+ */
+ if (interrupts == MAX_INTERRUPTS) {
perf_log_throttle(event, 1);
event->pmu->start(event, 0);
}
@@ -2369,26 +2358,14 @@ static void perf_adjust_freq_unthr_context(struct perf_event_context *ctx,
if (!event->attr.freq || !event->attr.sample_freq)
continue;
- /*
- * stop the event and update event->count
- */
- event->pmu->stop(event, PERF_EF_UPDATE);
-
+ event->pmu->read(event);
now = local64_read(&event->count);
delta = now - hwc->freq_count_stamp;
hwc->freq_count_stamp = now;
- /*
- * restart the event
- * reload only if value has changed
- */
if (delta > 0)
perf_adjust_period(event, period, delta);
-
- event->pmu->start(event, delta > 0 ? PERF_EF_RELOAD : 0);
}
-
- raw_spin_unlock(&ctx->lock);
}
/*
@@ -2411,13 +2388,16 @@ static void rotate_ctx(struct perf_event_context *ctx)
*/
static void perf_rotate_context(struct perf_cpu_context *cpuctx)
{
+ u64 interval = (u64)cpuctx->jiffies_interval * TICK_NSEC;
struct perf_event_context *ctx = NULL;
- int rotate = 0, remove = 1;
+ int rotate = 0, remove = 1, freq = 0;
if (cpuctx->ctx.nr_events) {
remove = 0;
if (cpuctx->ctx.nr_events != cpuctx->ctx.nr_active)
rotate = 1;
+ if (cpuctx->ctx.nr_freq)
+ freq = 1;
}
ctx = cpuctx->task_ctx;
@@ -2425,26 +2405,37 @@ static void perf_rotate_context(struct perf_cpu_context *cpuctx)
remove = 0;
if (ctx->nr_events != ctx->nr_active)
rotate = 1;
+ if (ctx->nr_freq)
+ freq = 1;
}
- if (!rotate)
+ if (!rotate && !freq)
goto done;
perf_ctx_lock(cpuctx, cpuctx->task_ctx);
perf_pmu_disable(cpuctx->ctx.pmu);
- cpu_ctx_sched_out(cpuctx, EVENT_FLEXIBLE);
- if (ctx)
- ctx_sched_out(ctx, cpuctx, EVENT_FLEXIBLE);
+ if (freq) {
+ perf_ctx_adjust_freq(&cpuctx->ctx, interval);
+ if (ctx)
+ perf_ctx_adjust_freq(ctx, interval);
+ }
- rotate_ctx(&cpuctx->ctx);
- if (ctx)
- rotate_ctx(ctx);
+ if (rotate) {
+ cpu_ctx_sched_out(cpuctx, EVENT_FLEXIBLE);
+ if (ctx)
+ ctx_sched_out(ctx, cpuctx, EVENT_FLEXIBLE);
- perf_event_sched_in(cpuctx, ctx, current);
+ rotate_ctx(&cpuctx->ctx);
+ if (ctx)
+ rotate_ctx(ctx);
+
+ perf_event_sched_in(cpuctx, ctx, current);
+ }
perf_pmu_enable(cpuctx->ctx.pmu);
perf_ctx_unlock(cpuctx, cpuctx->task_ctx);
+
done:
if (remove)
list_del_init(&cpuctx->rotation_list);
@@ -2454,22 +2445,10 @@ void perf_event_task_tick(void)
{
struct list_head *head = &__get_cpu_var(rotation_list);
struct perf_cpu_context *cpuctx, *tmp;
- struct perf_event_context *ctx;
- int throttled;
WARN_ON(!irqs_disabled());
- __this_cpu_inc(perf_throttled_seq);
- throttled = __this_cpu_xchg(perf_throttled_count, 0);
-
list_for_each_entry_safe(cpuctx, tmp, head, rotation_list) {
- ctx = &cpuctx->ctx;
- perf_adjust_freq_unthr_context(ctx, throttled);
-
- ctx = cpuctx->task_ctx;
- if (ctx)
- perf_adjust_freq_unthr_context(ctx, throttled);
-
if (cpuctx->jiffies_interval == 1 ||
!(jiffies % cpuctx->jiffies_interval))
perf_rotate_context(cpuctx);
@@ -4530,7 +4509,6 @@ static int __perf_event_overflow(struct perf_event *event,
{
int events = atomic_read(&event->event_limit);
struct hw_perf_event *hwc = &event->hw;
- u64 seq;
int ret = 0;
/*
@@ -4540,20 +4518,14 @@ static int __perf_event_overflow(struct perf_event *event,
if (unlikely(!is_sampling_event(event)))
return 0;
- seq = __this_cpu_read(perf_throttled_seq);
- if (seq != hwc->interrupts_seq) {
- hwc->interrupts_seq = seq;
- hwc->interrupts = 1;
- } else {
- hwc->interrupts++;
- if (unlikely(throttle
- && hwc->interrupts >= max_samples_per_tick)) {
- __this_cpu_inc(perf_throttled_count);
+ if (unlikely(hwc->interrupts >= max_samples_per_tick)) {
+ if (throttle) {
hwc->interrupts = MAX_INTERRUPTS;
perf_log_throttle(event, 0);
ret = 1;
}
- }
+ } else
+ hwc->interrupts++;
if (event->attr.freq) {
u64 now = perf_clock();
diff --git a/trunk/kernel/exit.c b/trunk/kernel/exit.c
index 4b4042f9bc6a..294b1709170d 100644
--- a/trunk/kernel/exit.c
+++ b/trunk/kernel/exit.c
@@ -1038,22 +1038,6 @@ void do_exit(long code)
if (tsk->nr_dirtied)
__this_cpu_add(dirty_throttle_leaks, tsk->nr_dirtied);
exit_rcu();
-
- /*
- * The setting of TASK_RUNNING by try_to_wake_up() may be delayed
- * when the following two conditions become true.
- * - There is race condition of mmap_sem (It is acquired by
- * exit_mm()), and
- * - SMI occurs before setting TASK_RUNINNG.
- * (or hypervisor of virtual machine switches to other guest)
- * As a result, we may become TASK_RUNNING after becoming TASK_DEAD
- *
- * To avoid it, we have to wait for releasing tsk->pi_lock which
- * is held by try_to_wake_up()
- */
- smp_mb();
- raw_spin_unlock_wait(&tsk->pi_lock);
-
/* causes final put_task_struct in finish_task_switch(). */
tsk->state = TASK_DEAD;
tsk->flags |= PF_NOFREEZE; /* tell freezer to ignore us */
diff --git a/trunk/kernel/sched/core.c b/trunk/kernel/sched/core.c
index 5255c9d2e053..df00cb09263e 100644
--- a/trunk/kernel/sched/core.c
+++ b/trunk/kernel/sched/core.c
@@ -74,7 +74,6 @@
#include
#include
-#include
#ifdef CONFIG_PARAVIRT
#include
#endif
@@ -724,6 +723,9 @@ static void dequeue_task(struct rq *rq, struct task_struct *p, int flags)
p->sched_class->dequeue_task(rq, p, flags);
}
+/*
+ * activate_task - move a task to the runqueue.
+ */
void activate_task(struct rq *rq, struct task_struct *p, int flags)
{
if (task_contributes_to_load(p))
@@ -732,6 +734,9 @@ void activate_task(struct rq *rq, struct task_struct *p, int flags)
enqueue_task(rq, p, flags);
}
+/*
+ * deactivate_task - remove a task from the runqueue.
+ */
void deactivate_task(struct rq *rq, struct task_struct *p, int flags)
{
if (task_contributes_to_load(p))
@@ -4129,7 +4134,7 @@ static int __sched_setscheduler(struct task_struct *p, int policy,
on_rq = p->on_rq;
running = task_current(rq, p);
if (on_rq)
- dequeue_task(rq, p, 0);
+ deactivate_task(rq, p, 0);
if (running)
p->sched_class->put_prev_task(rq, p);
@@ -4142,7 +4147,7 @@ static int __sched_setscheduler(struct task_struct *p, int policy,
if (running)
p->sched_class->set_curr_task(rq);
if (on_rq)
- enqueue_task(rq, p, 0);
+ activate_task(rq, p, 0);
check_class_changed(rq, p, prev_class, oldprio);
task_rq_unlock(rq, p, &flags);
@@ -4993,9 +4998,9 @@ static int __migrate_task(struct task_struct *p, int src_cpu, int dest_cpu)
* placed properly.
*/
if (p->on_rq) {
- dequeue_task(rq_src, p, 0);
+ deactivate_task(rq_src, p, 0);
set_task_cpu(p, dest_cpu);
- enqueue_task(rq_dest, p, 0);
+ activate_task(rq_dest, p, 0);
check_preempt_curr(rq_dest, p, 0);
}
done:
@@ -7027,10 +7032,10 @@ static void normalize_task(struct rq *rq, struct task_struct *p)
on_rq = p->on_rq;
if (on_rq)
- dequeue_task(rq, p, 0);
+ deactivate_task(rq, p, 0);
__setscheduler(rq, p, SCHED_NORMAL, 0);
if (on_rq) {
- enqueue_task(rq, p, 0);
+ activate_task(rq, p, 0);
resched_task(rq->curr);
}
diff --git a/trunk/kernel/sched/fair.c b/trunk/kernel/sched/fair.c
index 7c6414fc669d..84adb2d66cbd 100644
--- a/trunk/kernel/sched/fair.c
+++ b/trunk/kernel/sched/fair.c
@@ -4866,15 +4866,6 @@ static void nohz_balancer_kick(int cpu)
return;
}
-static inline void clear_nohz_tick_stopped(int cpu)
-{
- if (unlikely(test_bit(NOHZ_TICK_STOPPED, nohz_flags(cpu)))) {
- cpumask_clear_cpu(cpu, nohz.idle_cpus_mask);
- atomic_dec(&nohz.nr_cpus);
- clear_bit(NOHZ_TICK_STOPPED, nohz_flags(cpu));
- }
-}
-
static inline void set_cpu_sd_state_busy(void)
{
struct sched_domain *sd;
@@ -4913,12 +4904,6 @@ void select_nohz_load_balancer(int stop_tick)
{
int cpu = smp_processor_id();
- /*
- * If this cpu is going down, then nothing needs to be done.
- */
- if (!cpu_active(cpu))
- return;
-
if (stop_tick) {
if (test_bit(NOHZ_TICK_STOPPED, nohz_flags(cpu)))
return;
@@ -4929,18 +4914,6 @@ void select_nohz_load_balancer(int stop_tick)
}
return;
}
-
-static int __cpuinit sched_ilb_notifier(struct notifier_block *nfb,
- unsigned long action, void *hcpu)
-{
- switch (action & ~CPU_TASKS_FROZEN) {
- case CPU_DYING:
- clear_nohz_tick_stopped(smp_processor_id());
- return NOTIFY_OK;
- default:
- return NOTIFY_DONE;
- }
-}
#endif
static DEFINE_SPINLOCK(balancing);
@@ -5097,7 +5070,11 @@ static inline int nohz_kick_needed(struct rq *rq, int cpu)
* busy tick after returning from idle, we will update the busy stats.
*/
set_cpu_sd_state_busy();
- clear_nohz_tick_stopped(cpu);
+ if (unlikely(test_bit(NOHZ_TICK_STOPPED, nohz_flags(cpu)))) {
+ clear_bit(NOHZ_TICK_STOPPED, nohz_flags(cpu));
+ cpumask_clear_cpu(cpu, nohz.idle_cpus_mask);
+ atomic_dec(&nohz.nr_cpus);
+ }
/*
* None are in tickless mode and hence no need for NOHZ idle load
@@ -5613,7 +5590,6 @@ __init void init_sched_fair_class(void)
#ifdef CONFIG_NO_HZ
zalloc_cpumask_var(&nohz.idle_cpus_mask, GFP_NOWAIT);
- cpu_notifier(sched_ilb_notifier, 0);
#endif
#endif /* SMP */
diff --git a/trunk/kernel/sched/rt.c b/trunk/kernel/sched/rt.c
index f42ae7fb5ec5..3640ebbb466b 100644
--- a/trunk/kernel/sched/rt.c
+++ b/trunk/kernel/sched/rt.c
@@ -1587,11 +1587,6 @@ static int push_rt_task(struct rq *rq)
if (!next_task)
return 0;
-#ifdef __ARCH_WANT_INTERRUPTS_ON_CTXSW
- if (unlikely(task_running(rq, next_task)))
- return 0;
-#endif
-
retry:
if (unlikely(next_task == rq->curr)) {
WARN_ON(1);
diff --git a/trunk/kernel/watchdog.c b/trunk/kernel/watchdog.c
index d117262deba3..1d7bca7f4f52 100644
--- a/trunk/kernel/watchdog.c
+++ b/trunk/kernel/watchdog.c
@@ -296,7 +296,7 @@ static enum hrtimer_restart watchdog_timer_fn(struct hrtimer *hrtimer)
if (__this_cpu_read(soft_watchdog_warn) == true)
return HRTIMER_RESTART;
- printk(KERN_EMERG "BUG: soft lockup - CPU#%d stuck for %us! [%s:%d]\n",
+ printk(KERN_ERR "BUG: soft lockup - CPU#%d stuck for %us! [%s:%d]\n",
smp_processor_id(), duration,
current->comm, task_pid_nr(current));
print_modules();
diff --git a/trunk/lib/Kconfig b/trunk/lib/Kconfig
index d69d321a0997..169eb7c598e5 100644
--- a/trunk/lib/Kconfig
+++ b/trunk/lib/Kconfig
@@ -279,9 +279,6 @@ config AVERAGE
If unsure, say N.
-config CLZ_TAB
- bool
-
config CORDIC
tristate "CORDIC algorithm"
help
@@ -290,7 +287,6 @@ config CORDIC
config MPILIB
tristate
- select CLZ_TAB
help
Multiprecision maths library from GnuPG.
It is used to implement RSA digital signature verification,
diff --git a/trunk/lib/Makefile b/trunk/lib/Makefile
index 18515f0267c4..d71aae1b01b3 100644
--- a/trunk/lib/Makefile
+++ b/trunk/lib/Makefile
@@ -121,8 +121,6 @@ obj-$(CONFIG_DQL) += dynamic_queue_limits.o
obj-$(CONFIG_MPILIB) += mpi/
obj-$(CONFIG_SIGNATURE) += digsig.o
-obj-$(CONFIG_CLZ_TAB) += clz_tab.o
-
hostprogs-y := gen_crc32table
clean-files := crc32table.h
diff --git a/trunk/lib/bug.c b/trunk/lib/bug.c
index a28c1415357c..19552096d16b 100644
--- a/trunk/lib/bug.c
+++ b/trunk/lib/bug.c
@@ -169,7 +169,7 @@ enum bug_trap_type report_bug(unsigned long bugaddr, struct pt_regs *regs)
return BUG_TRAP_TYPE_WARN;
}
- printk(KERN_DEFAULT "------------[ cut here ]------------\n");
+ printk(KERN_EMERG "------------[ cut here ]------------\n");
if (file)
printk(KERN_CRIT "kernel BUG at %s:%u!\n",
diff --git a/trunk/lib/clz_tab.c b/trunk/lib/clz_tab.c
deleted file mode 100644
index 7287b4a991a7..000000000000
--- a/trunk/lib/clz_tab.c
+++ /dev/null
@@ -1,18 +0,0 @@
-const unsigned char __clz_tab[] = {
- 0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8,
-};
diff --git a/trunk/lib/digsig.c b/trunk/lib/digsig.c
index 286d558033e2..fd2402f67f89 100644
--- a/trunk/lib/digsig.c
+++ b/trunk/lib/digsig.c
@@ -34,9 +34,14 @@ static int pkcs_1_v1_5_decode_emsa(const unsigned char *msg,
unsigned long msglen,
unsigned long modulus_bitlen,
unsigned char *out,
- unsigned long *outlen)
+ unsigned long *outlen,
+ int *is_valid)
{
unsigned long modulus_len, ps_len, i;
+ int result;
+
+ /* default to invalid packet */
+ *is_valid = 0;
modulus_len = (modulus_bitlen >> 3) + (modulus_bitlen & 7 ? 1 : 0);
@@ -45,30 +50,39 @@ static int pkcs_1_v1_5_decode_emsa(const unsigned char *msg,
return -EINVAL;
/* separate encoded message */
- if ((msg[0] != 0x00) || (msg[1] != (unsigned char)1))
- return -EINVAL;
+ if ((msg[0] != 0x00) || (msg[1] != (unsigned char)1)) {
+ result = -EINVAL;
+ goto bail;
+ }
for (i = 2; i < modulus_len - 1; i++)
if (msg[i] != 0xFF)
break;
/* separator check */
- if (msg[i] != 0)
+ if (msg[i] != 0) {
/* There was no octet with hexadecimal value 0x00
to separate ps from m. */
- return -EINVAL;
+ result = -EINVAL;
+ goto bail;
+ }
ps_len = i - 2;
if (*outlen < (msglen - (2 + ps_len + 1))) {
*outlen = msglen - (2 + ps_len + 1);
- return -EOVERFLOW;
+ result = -EOVERFLOW;
+ goto bail;
}
*outlen = (msglen - (2 + ps_len + 1));
memcpy(out, &msg[2 + ps_len + 1], *outlen);
- return 0;
+ /* valid packet */
+ *is_valid = 1;
+ result = 0;
+bail:
+ return result;
}
/*
@@ -82,7 +96,7 @@ static int digsig_verify_rsa(struct key *key,
unsigned long len;
unsigned long mlen, mblen;
unsigned nret, l;
- int head, i;
+ int valid, head, i;
unsigned char *out1 = NULL, *out2 = NULL;
MPI in = NULL, res = NULL, pkey[2];
uint8_t *p, *datap, *endp;
@@ -91,10 +105,6 @@ static int digsig_verify_rsa(struct key *key,
down_read(&key->sem);
ukp = key->payload.data;
-
- if (ukp->datalen < sizeof(*pkh))
- goto err1;
-
pkh = (struct pubkey_hdr *)ukp->data;
if (pkh->version != 1)
@@ -107,23 +117,18 @@ static int digsig_verify_rsa(struct key *key,
goto err1;
datap = pkh->mpi;
- endp = ukp->data + ukp->datalen;
-
- err = -ENOMEM;
+ endp = datap + ukp->datalen;
for (i = 0; i < pkh->nmpi; i++) {
unsigned int remaining = endp - datap;
pkey[i] = mpi_read_from_buffer(datap, &remaining);
- if (!pkey[i])
- goto err;
datap += remaining;
}
mblen = mpi_get_nbits(pkey[0]);
mlen = (mblen + 7)/8;
- if (mlen == 0)
- goto err;
+ err = -ENOMEM;
out1 = kzalloc(mlen, GFP_KERNEL);
if (!out1)
@@ -162,9 +167,10 @@ static int digsig_verify_rsa(struct key *key,
memset(out1, 0, head);
memcpy(out1 + head, p, l);
- err = pkcs_1_v1_5_decode_emsa(out1, len, mblen, out2, &len);
+ err = -EINVAL;
+ pkcs_1_v1_5_decode_emsa(out1, len, mblen, out2, &len, &valid);
- if (!err && len == hlen)
+ if (valid && len == hlen)
err = memcmp(out2, h, hlen);
err:
@@ -172,8 +178,8 @@ static int digsig_verify_rsa(struct key *key,
mpi_free(res);
kfree(out1);
kfree(out2);
- while (--i >= 0)
- mpi_free(pkey[i]);
+ mpi_free(pkey[0]);
+ mpi_free(pkey[1]);
err1:
up_read(&key->sem);
diff --git a/trunk/lib/mpi/longlong.h b/trunk/lib/mpi/longlong.h
index 29f98624ef93..b87487b40a8b 100644
--- a/trunk/lib/mpi/longlong.h
+++ b/trunk/lib/mpi/longlong.h
@@ -1200,40 +1200,18 @@ do { \
"r" ((USItype)(v)) \
: "%g1", "%g2" __AND_CLOBBER_CC)
#define UMUL_TIME 39 /* 39 instructions */
-/* It's quite necessary to add this much assembler for the sparc.
- The default udiv_qrnnd (in C) is more than 10 times slower! */
-#define udiv_qrnnd(q, r, n1, n0, d) \
- __asm__ ("! Inlined udiv_qrnnd\n\t" \
- "mov 32,%%g1\n\t" \
- "subcc %1,%2,%%g0\n\t" \
- "1: bcs 5f\n\t" \
- "addxcc %0,%0,%0 ! shift n1n0 and a q-bit in lsb\n\t" \
- "sub %1,%2,%1 ! this kills msb of n\n\t" \
- "addx %1,%1,%1 ! so this can't give carry\n\t" \
- "subcc %%g1,1,%%g1\n\t" \
- "2: bne 1b\n\t" \
- "subcc %1,%2,%%g0\n\t" \
- "bcs 3f\n\t" \
- "addxcc %0,%0,%0 ! shift n1n0 and a q-bit in lsb\n\t" \
- "b 3f\n\t" \
- "sub %1,%2,%1 ! this kills msb of n\n\t" \
- "4: sub %1,%2,%1\n\t" \
- "5: addxcc %1,%1,%1\n\t" \
- "bcc 2b\n\t" \
- "subcc %%g1,1,%%g1\n\t" \
- "! Got carry from n. Subtract next step to cancel this carry.\n\t" \
- "bne 4b\n\t" \
- "addcc %0,%0,%0 ! shift n1n0 and a 0-bit in lsb\n\t" \
- "sub %1,%2,%1\n\t" \
- "3: xnor %0,0,%0\n\t" \
- "! End of inline udiv_qrnnd\n" \
- : "=&r" ((USItype)(q)), \
- "=&r" ((USItype)(r)) \
- : "r" ((USItype)(d)), \
- "1" ((USItype)(n1)), \
- "0" ((USItype)(n0)) : "%g1", "cc")
-#define UDIV_TIME (3+7*32) /* 7 instructions/iteration. 32 iterations. */
#endif
+#ifndef udiv_qrnnd
+#ifndef LONGLONG_STANDALONE
+#define udiv_qrnnd(q, r, n1, n0, d) \
+do { USItype __r; \
+ (q) = __udiv_qrnnd(&__r, (n1), (n0), (d)); \
+ (r) = __r; \
+} while (0)
+ extern USItype __udiv_qrnnd();
+#define UDIV_TIME 140
+#endif /* LONGLONG_STANDALONE */
+#endif /* udiv_qrnnd */
#endif /* __sparc__ */
/***************************************
diff --git a/trunk/lib/mpi/mpi-bit.c b/trunk/lib/mpi/mpi-bit.c
index 2f526627e4f5..854c9c6da025 100644
--- a/trunk/lib/mpi/mpi-bit.c
+++ b/trunk/lib/mpi/mpi-bit.c
@@ -21,6 +21,25 @@
#include "mpi-internal.h"
#include "longlong.h"
+const unsigned char __clz_tab[] = {
+ 0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7,
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+ 8, 8, 8, 8, 8, 8, 8, 8,
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+ 8, 8, 8, 8, 8, 8, 8, 8,
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+ 8, 8, 8, 8, 8, 8, 8, 8,
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+ 8, 8, 8, 8, 8, 8, 8, 8,
+};
+
#define A_LIMB_1 ((mpi_limb_t) 1)
/****************
diff --git a/trunk/lib/mpi/mpi-div.c b/trunk/lib/mpi/mpi-div.c
index f68cbbb4d4a4..c3087d1390ce 100644
--- a/trunk/lib/mpi/mpi-div.c
+++ b/trunk/lib/mpi/mpi-div.c
@@ -149,9 +149,6 @@ int mpi_tdiv_qr(MPI quot, MPI rem, MPI num, MPI den)
mpi_ptr_t marker[5];
int markidx = 0;
- if (!dsize)
- return -EINVAL;
-
memset(marker, 0, sizeof(marker));
/* Ensure space is enough for quotient and remainder.
@@ -210,8 +207,6 @@ int mpi_tdiv_qr(MPI quot, MPI rem, MPI num, MPI den)
* numerator would be gradually overwritten by the quotient limbs. */
if (qp == np) { /* Copy NP object to temporary space. */
np = marker[markidx++] = mpi_alloc_limb_space(nsize);
- if (!np)
- goto nomem;
MPN_COPY(np, qp, nsize);
}
} else /* Put quotient at top of remainder. */
diff --git a/trunk/lib/mpi/mpi-pow.c b/trunk/lib/mpi/mpi-pow.c
index 67f3e79af914..b04a3cf80080 100644
--- a/trunk/lib/mpi/mpi-pow.c
+++ b/trunk/lib/mpi/mpi-pow.c
@@ -59,7 +59,7 @@ int mpi_powm(MPI res, MPI base, MPI exp, MPI mod)
ep = exp->d;
if (!msize)
- return -EINVAL;
+ msize = 1 / msize; /* provoke a signal */
if (!esize) {
/* Exponent is zero, result is 1 mod MOD, i.e., 1 or 0
diff --git a/trunk/lib/mpi/mpicoder.c b/trunk/lib/mpi/mpicoder.c
index f26b41fcb48c..716802b774ea 100644
--- a/trunk/lib/mpi/mpicoder.c
+++ b/trunk/lib/mpi/mpicoder.c
@@ -20,15 +20,78 @@
#include "mpi-internal.h"
+#define DIM(v) (sizeof(v)/sizeof((v)[0]))
#define MAX_EXTERN_MPI_BITS 16384
+static uint8_t asn[15] = /* Object ID is 1.3.14.3.2.26 */
+{ 0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 0x2b, 0x0e, 0x03,
+ 0x02, 0x1a, 0x05, 0x00, 0x04, 0x14
+};
+
+MPI do_encode_md(const void *sha_buffer, unsigned nbits)
+{
+ int nframe = (nbits + 7) / 8;
+ uint8_t *frame, *fr_pt;
+ int i = 0, n;
+ size_t asnlen = DIM(asn);
+ MPI a = MPI_NULL;
+
+ if (SHA1_DIGEST_LENGTH + asnlen + 4 > nframe)
+ pr_info("MPI: can't encode a %d bit MD into a %d bits frame\n",
+ (int)(SHA1_DIGEST_LENGTH * 8), (int)nbits);
+
+ /* We encode the MD in this way:
+ *
+ * 0 A PAD(n bytes) 0 ASN(asnlen bytes) MD(len bytes)
+ *
+ * PAD consists of FF bytes.
+ */
+ frame = kmalloc(nframe, GFP_KERNEL);
+ if (!frame)
+ return MPI_NULL;
+ n = 0;
+ frame[n++] = 0;
+ frame[n++] = 1; /* block type */
+ i = nframe - SHA1_DIGEST_LENGTH - asnlen - 3;
+
+ if (i <= 1) {
+ pr_info("MPI: message digest encoding failed\n");
+ kfree(frame);
+ return a;
+ }
+
+ memset(frame + n, 0xff, i);
+ n += i;
+ frame[n++] = 0;
+ memcpy(frame + n, &asn, asnlen);
+ n += asnlen;
+ memcpy(frame + n, sha_buffer, SHA1_DIGEST_LENGTH);
+ n += SHA1_DIGEST_LENGTH;
+
+ i = nframe;
+ fr_pt = frame;
+
+ if (n != nframe) {
+ printk
+ ("MPI: message digest encoding failed, frame length is wrong\n");
+ kfree(frame);
+ return a;
+ }
+
+ a = mpi_alloc((nframe + BYTES_PER_MPI_LIMB - 1) / BYTES_PER_MPI_LIMB);
+ mpi_set_buffer(a, frame, nframe, 0);
+ kfree(frame);
+
+ return a;
+}
+
MPI mpi_read_from_buffer(const void *xbuffer, unsigned *ret_nread)
{
const uint8_t *buffer = xbuffer;
int i, j;
unsigned nbits, nbytes, nlimbs, nread = 0;
mpi_limb_t a;
- MPI val = NULL;
+ MPI val = MPI_NULL;
if (*ret_nread < 2)
goto leave;
@@ -45,7 +108,7 @@ MPI mpi_read_from_buffer(const void *xbuffer, unsigned *ret_nread)
nlimbs = (nbytes + BYTES_PER_MPI_LIMB - 1) / BYTES_PER_MPI_LIMB;
val = mpi_alloc(nlimbs);
if (!val)
- return NULL;
+ return MPI_NULL;
i = BYTES_PER_MPI_LIMB - nbytes % BYTES_PER_MPI_LIMB;
i %= BYTES_PER_MPI_LIMB;
val->nbits = nbits;
@@ -148,6 +211,30 @@ int mpi_fromstr(MPI val, const char *str)
}
EXPORT_SYMBOL_GPL(mpi_fromstr);
+/****************
+ * Special function to get the low 8 bytes from an mpi.
+ * This can be used as a keyid; KEYID is an 2 element array.
+ * Return the low 4 bytes.
+ */
+u32 mpi_get_keyid(const MPI a, u32 *keyid)
+{
+#if BYTES_PER_MPI_LIMB == 4
+ if (keyid) {
+ keyid[0] = a->nlimbs >= 2 ? a->d[1] : 0;
+ keyid[1] = a->nlimbs >= 1 ? a->d[0] : 0;
+ }
+ return a->nlimbs >= 1 ? a->d[0] : 0;
+#elif BYTES_PER_MPI_LIMB == 8
+ if (keyid) {
+ keyid[0] = a->nlimbs ? (u32) (a->d[0] >> 32) : 0;
+ keyid[1] = a->nlimbs ? (u32) (a->d[0] & 0xffffffff) : 0;
+ }
+ return a->nlimbs ? (u32) (a->d[0] & 0xffffffff) : 0;
+#else
+#error Make this function work with other LIMB sizes
+#endif
+}
+
/****************
* Return an allocated buffer with the MPI (msb first).
* NBYTES receives the length of this buffer. Caller must free the
diff --git a/trunk/lib/mpi/mpih-div.c b/trunk/lib/mpi/mpih-div.c
index cde1aaec18da..87ede162dfab 100644
--- a/trunk/lib/mpi/mpih-div.c
+++ b/trunk/lib/mpi/mpih-div.c
@@ -217,10 +217,6 @@ mpihelp_divrem(mpi_ptr_t qp, mpi_size_t qextra_limbs,
case 0:
/* We are asked to divide by zero, so go ahead and do it! (To make
the compiler not remove this statement, return the value.) */
- /*
- * existing clients of this function have been modified
- * not to call it with dsize == 0, so this should not happen
- */
return 1 / dsize;
case 1:
diff --git a/trunk/lib/mpi/mpiutil.c b/trunk/lib/mpi/mpiutil.c
index 26e4ed31e256..eefc55d6b7f5 100644
--- a/trunk/lib/mpi/mpiutil.c
+++ b/trunk/lib/mpi/mpiutil.c
@@ -58,9 +58,6 @@ mpi_ptr_t mpi_alloc_limb_space(unsigned nlimbs)
{
size_t len = nlimbs * sizeof(mpi_limb_t);
- if (!len)
- return NULL;
-
return kmalloc(len, GFP_KERNEL);
}
@@ -138,7 +135,7 @@ int mpi_copy(MPI *copied, const MPI a)
size_t i;
MPI b;
- *copied = NULL;
+ *copied = MPI_NULL;
if (a) {
b = mpi_alloc(a->nlimbs);
diff --git a/trunk/tools/perf/Makefile b/trunk/tools/perf/Makefile
index 7c12650165ae..ac86d67b636e 100644
--- a/trunk/tools/perf/Makefile
+++ b/trunk/tools/perf/Makefile
@@ -104,7 +104,7 @@ endif
CFLAGS = -fno-omit-frame-pointer -ggdb3 -Wall -Wextra -std=gnu99 $(CFLAGS_WERROR) $(CFLAGS_OPTIMIZE) -D_FORTIFY_SOURCE=2 $(EXTRA_WARNINGS) $(EXTRA_CFLAGS)
EXTLIBS = -lpthread -lrt -lelf -lm
-ALL_CFLAGS = $(CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
+ALL_CFLAGS = $(CFLAGS) -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
ALL_LDFLAGS = $(LDFLAGS)
STRIP ?= strip
@@ -168,7 +168,10 @@ endif
### --- END CONFIGURATION SECTION ---
-BASIC_CFLAGS = -Iutil/include -Iarch/$(ARCH)/include -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
+# Those must not be GNU-specific; they are shared with perl/ which may
+# be built by a different compiler. (Note that this is an artifact now
+# but it still might be nice to keep that distinction.)
+BASIC_CFLAGS = -Iutil/include -Iarch/$(ARCH)/include
BASIC_LDFLAGS =
# Guard against environment variables
diff --git a/trunk/tools/perf/builtin-probe.c b/trunk/tools/perf/builtin-probe.c
index fb8566181f27..59d43abfbfec 100644
--- a/trunk/tools/perf/builtin-probe.c
+++ b/trunk/tools/perf/builtin-probe.c
@@ -20,6 +20,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
+#define _GNU_SOURCE
#include
#include
#include
@@ -30,6 +31,7 @@
#include
#include
+#undef _GNU_SOURCE
#include "perf.h"
#include "builtin.h"
#include "util/util.h"
diff --git a/trunk/tools/perf/builtin-top.c b/trunk/tools/perf/builtin-top.c
index dd162aa24baa..8f80df896038 100644
--- a/trunk/tools/perf/builtin-top.c
+++ b/trunk/tools/perf/builtin-top.c
@@ -89,6 +89,8 @@ void get_term_dimensions(struct winsize *ws)
static void perf_top__update_print_entries(struct perf_top *top)
{
+ top->print_entries = top->winsize.ws_row;
+
if (top->print_entries > 9)
top->print_entries -= 9;
}
@@ -98,13 +100,6 @@ static void perf_top__sig_winch(int sig __used, siginfo_t *info __used, void *ar
struct perf_top *top = arg;
get_term_dimensions(&top->winsize);
- if (!top->print_entries
- || (top->print_entries+4) > top->winsize.ws_row) {
- top->print_entries = top->winsize.ws_row;
- } else {
- top->print_entries += 4;
- top->winsize.ws_row = top->print_entries;
- }
perf_top__update_print_entries(top);
}
@@ -458,10 +453,8 @@ static void perf_top__handle_keypress(struct perf_top *top, int c)
};
perf_top__sig_winch(SIGWINCH, NULL, top);
sigaction(SIGWINCH, &act, NULL);
- } else {
- perf_top__sig_winch(SIGWINCH, NULL, top);
+ } else
signal(SIGWINCH, SIG_DFL);
- }
break;
case 'E':
if (top->evlist->nr_entries > 1) {
diff --git a/trunk/tools/perf/util/header.c b/trunk/tools/perf/util/header.c
index ecd7f4dd7eea..3e7e0b09c12c 100644
--- a/trunk/tools/perf/util/header.c
+++ b/trunk/tools/perf/util/header.c
@@ -2105,7 +2105,7 @@ int perf_event__synthesize_event_type(struct perf_tool *tool,
strncpy(ev.event_type.event_type.name, name, MAX_EVENT_NAME - 1);
ev.event_type.header.type = PERF_RECORD_HEADER_EVENT_TYPE;
- size = strlen(ev.event_type.event_type.name);
+ size = strlen(name);
size = ALIGN(size, sizeof(u64));
ev.event_type.header.size = sizeof(ev.event_type) -
(sizeof(ev.event_type.event_type.name) - size);
diff --git a/trunk/tools/perf/util/probe-event.c b/trunk/tools/perf/util/probe-event.c
index 29cb65459811..eb25900e2211 100644
--- a/trunk/tools/perf/util/probe-event.c
+++ b/trunk/tools/perf/util/probe-event.c
@@ -19,6 +19,7 @@
*
*/
+#define _GNU_SOURCE
#include
#include
#include
@@ -32,6 +33,7 @@
#include
#include
+#undef _GNU_SOURCE
#include "util.h"
#include "event.h"
#include "string.h"
diff --git a/trunk/tools/perf/util/symbol.c b/trunk/tools/perf/util/symbol.c
index 0975438c3e72..215d50f2042e 100644
--- a/trunk/tools/perf/util/symbol.c
+++ b/trunk/tools/perf/util/symbol.c
@@ -1,3 +1,4 @@
+#define _GNU_SOURCE
#include
#include
#include
diff --git a/trunk/tools/perf/util/trace-event-parse.c b/trunk/tools/perf/util/trace-event-parse.c
index 1a8d4dc4f386..6c164dc9ee95 100644
--- a/trunk/tools/perf/util/trace-event-parse.c
+++ b/trunk/tools/perf/util/trace-event-parse.c
@@ -21,13 +21,14 @@
* The parts for function graph printing was taken and modified from the
* Linux Kernel that were written by Frederic Weisbecker.
*/
-
+#define _GNU_SOURCE
#include
#include
#include
#include
#include
+#undef _GNU_SOURCE
#include "../perf.h"
#include "util.h"
#include "trace-event.h"
diff --git a/trunk/tools/perf/util/ui/browsers/hists.c b/trunk/tools/perf/util/ui/browsers/hists.c
index e81aef1f2569..1212a386a033 100644
--- a/trunk/tools/perf/util/ui/browsers/hists.c
+++ b/trunk/tools/perf/util/ui/browsers/hists.c
@@ -1,4 +1,6 @@
+#define _GNU_SOURCE
#include
+#undef _GNU_SOURCE
#include "../libslang.h"
#include
#include
diff --git a/trunk/tools/perf/util/ui/helpline.c b/trunk/tools/perf/util/ui/helpline.c
index 4f48f5901b30..6ef3c5691762 100644
--- a/trunk/tools/perf/util/ui/helpline.c
+++ b/trunk/tools/perf/util/ui/helpline.c
@@ -1,3 +1,4 @@
+#define _GNU_SOURCE
#include
#include
#include
diff --git a/trunk/tools/perf/util/util.h b/trunk/tools/perf/util/util.h
index ecf9898169c8..b9c530cce79a 100644
--- a/trunk/tools/perf/util/util.h
+++ b/trunk/tools/perf/util/util.h
@@ -40,6 +40,7 @@
#define decimal_length(x) ((int)(sizeof(x) * 2.56 + 0.5) + 1)
#define _ALL_SOURCE 1
+#define _GNU_SOURCE 1
#define _BSD_SOURCE 1
#define HAS_BOOL