From 02a7553d1996d94033abee323644ed3c16078225 Mon Sep 17 00:00:00 2001 From: Vasiliy Kulikov Date: Sat, 19 Feb 2011 14:18:08 +0100 Subject: [PATCH] --- yaml --- r: 233755 b: refs/heads/master c: 2949ad50711cc161721cf788711722eeeca33764 h: refs/heads/master i: 233753: fa9192d26e248a9ebe0b4f6c373c6744579ccb85 233751: fda8212b56e0ccddfaeb5e360ab8948511d2ef2a v: v3 --- [refs] | 2 +- trunk/MAINTAINERS | 11 +- trunk/Makefile | 2 +- trunk/arch/arm/mach-omap2/clkt_dpll.c | 2 +- trunk/arch/arm/mach-omap2/mailbox.c | 2 +- trunk/arch/arm/mach-omap2/mux.c | 2 +- trunk/arch/arm/mach-omap2/pm-debug.c | 8 +- trunk/arch/arm/mach-omap2/prcm_mpu44xx.h | 4 +- trunk/arch/arm/mach-omap2/smartreflex.c | 4 +- trunk/arch/arm/mach-omap2/timer-gp.c | 13 -- trunk/arch/arm/plat-omap/mailbox.c | 11 +- trunk/arch/x86/include/asm/acpi.h | 1 - trunk/arch/x86/include/asm/smpboot_hooks.h | 2 +- trunk/arch/x86/kernel/acpi/boot.c | 14 +- trunk/arch/x86/kernel/apb_timer.c | 2 +- trunk/arch/x86/kernel/early-quirks.c | 16 +- trunk/arch/x86/kernel/reboot.c | 8 - trunk/arch/x86/kvm/svm.c | 2 - trunk/block/genhd.c | 2 +- trunk/block/ioctl.c | 8 +- trunk/drivers/acpi/debugfs.c | 20 ++- trunk/drivers/block/floppy.c | 2 +- trunk/drivers/char/agp/intel-agp.h | 1 - trunk/drivers/char/agp/intel-gtt.c | 56 ++++--- trunk/drivers/char/tpm/tpm.c | 10 +- trunk/drivers/gpu/drm/drm_irq.c | 3 +- trunk/drivers/gpu/drm/i915/i915_gem_tiling.c | 16 +- trunk/drivers/gpu/drm/i915/i915_irq.c | 6 +- trunk/drivers/gpu/drm/i915/intel_display.c | 95 +----------- trunk/drivers/gpu/drm/nouveau/nouveau_bo.c | 5 +- trunk/drivers/hwmon/ad7414.c | 1 - trunk/drivers/hwmon/adt7411.c | 1 - trunk/drivers/md/linear.c | 1 + trunk/drivers/md/md.c | 31 +--- trunk/drivers/md/md.h | 2 - trunk/drivers/md/multipath.c | 1 + trunk/drivers/md/raid0.c | 2 +- trunk/drivers/md/raid1.c | 6 +- trunk/drivers/md/raid10.c | 7 +- trunk/drivers/md/raid5.c | 1 + trunk/drivers/nfc/Kconfig | 2 +- trunk/drivers/nfc/pn544.c | 4 +- trunk/drivers/pps/kapi.c | 2 +- trunk/drivers/rapidio/rio-sysfs.c | 12 +- .../regulator/mc13xxx-regulator-core.c | 2 +- trunk/drivers/regulator/wm831x-dcdc.c | 1 - trunk/drivers/rtc/rtc-at91sam9.c | 2 +- trunk/drivers/rtc/rtc-ds3232.c | 14 +- trunk/drivers/thermal/Kconfig | 1 + trunk/drivers/thermal/thermal_sys.c | 40 +++-- trunk/drivers/usb/core/hub.c | 18 ++- trunk/drivers/usb/host/xhci-dbg.c | 9 +- trunk/drivers/usb/host/xhci-mem.c | 10 +- trunk/drivers/usb/host/xhci-ring.c | 40 +++-- trunk/drivers/usb/host/xhci.c | 14 +- trunk/drivers/usb/host/xhci.h | 2 +- trunk/drivers/usb/musb/musb_core.c | 1 - trunk/fs/afs/write.c | 1 - trunk/fs/aio.c | 52 ++----- trunk/fs/block_dev.c | 19 +-- trunk/fs/btrfs/ctree.h | 3 - trunk/fs/btrfs/extent-tree.c | 9 +- trunk/fs/btrfs/extent_io.c | 138 +++++------------- trunk/fs/btrfs/extent_io.h | 2 +- trunk/fs/btrfs/inode.c | 126 +--------------- trunk/fs/btrfs/ioctl.c | 7 +- trunk/fs/btrfs/lzo.c | 21 +-- trunk/fs/btrfs/relocation.c | 13 +- trunk/fs/btrfs/super.c | 7 +- trunk/fs/btrfs/volumes.c | 13 +- trunk/fs/eventpoll.c | 95 ------------ trunk/fs/fuse/dir.c | 7 +- trunk/fs/fuse/file.c | 52 +------ trunk/fs/fuse/fuse_i.h | 6 +- trunk/fs/inode.c | 9 +- trunk/fs/internal.h | 2 +- trunk/fs/namespace.c | 2 +- trunk/fs/ocfs2/journal.h | 6 +- trunk/fs/ocfs2/refcounttree.c | 7 +- trunk/fs/ocfs2/super.c | 28 +--- trunk/fs/partitions/ldm.c | 5 - trunk/include/asm-generic/pgtable.h | 2 - trunk/include/drm/drmP.h | 2 +- trunk/include/linux/fs.h | 2 +- trunk/include/linux/pm.h | 2 - trunk/include/linux/pm_wakeup.h | 25 ++-- trunk/include/linux/rio_regs.h | 4 +- trunk/include/linux/thermal.h | 8 - trunk/kernel/time/tick-broadcast.c | 10 -- trunk/kernel/time/tick-common.c | 6 +- trunk/kernel/time/tick-internal.h | 3 - trunk/lib/swiotlb.c | 6 +- trunk/mm/mempolicy.c | 2 +- trunk/mm/migrate.c | 6 +- trunk/mm/mremap.c | 4 +- trunk/mm/page_alloc.c | 5 +- trunk/mm/swapfile.c | 2 +- trunk/mm/truncate.c | 2 - trunk/mm/vmscan.c | 32 ++-- trunk/net/rxrpc/ar-key.c | 8 +- trunk/sound/core/jack.c | 1 - trunk/sound/pci/hda/patch_conexant.c | 5 - trunk/sound/pci/hda/patch_sigmatel.c | 15 +- trunk/sound/pci/hda/patch_via.c | 2 +- trunk/sound/soc/codecs/wm8903.h | 2 +- trunk/sound/soc/codecs/wm8994.c | 5 +- trunk/sound/soc/codecs/wm_hubs.c | 3 - trunk/sound/soc/imx/eukrea-tlv320.c | 2 +- trunk/sound/soc/pxa/e740_wm9705.c | 4 +- trunk/sound/soc/pxa/e750_wm9705.c | 4 +- trunk/sound/soc/pxa/e800_wm9712.c | 4 +- trunk/sound/soc/pxa/em-x270.c | 4 +- trunk/sound/soc/pxa/mioa701_wm9713.c | 4 +- trunk/sound/soc/pxa/palm27x.c | 4 +- trunk/sound/soc/pxa/tosa.c | 4 +- trunk/sound/soc/pxa/zylonite.c | 4 +- trunk/sound/usb/card.c | 4 - trunk/sound/usb/pcm.c | 7 +- trunk/sound/usb/usbaudio.h | 1 - trunk/tools/perf/builtin-timechart.c | 6 +- trunk/tools/perf/util/hist.c | 7 +- trunk/tools/perf/util/svghelper.c | 6 +- 122 files changed, 379 insertions(+), 1037 deletions(-) diff --git a/[refs] b/[refs] index cd3a39832529..b490d7e58b18 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: dd9c1549edef02290edced639f67b54a25abbe0e +refs/heads/master: 2949ad50711cc161721cf788711722eeeca33764 diff --git a/trunk/MAINTAINERS b/trunk/MAINTAINERS index 8afba6321e24..6f99e1260db8 100644 --- a/trunk/MAINTAINERS +++ b/trunk/MAINTAINERS @@ -1692,13 +1692,6 @@ M: Andy Whitcroft S: Supported F: scripts/checkpatch.pl -CHINESE DOCUMENTATION -M: Harry Wei -L: xiyoulinuxkernelgroup@googlegroups.com -L: linux-kernel@zh-kernel.org (moderated for non-subscribers) -S: Maintained -F: Documentation/zh_CN/ - CISCO VIC ETHERNET NIC DRIVER M: Vasanthy Kolluri M: Roopa Prabhu @@ -5273,7 +5266,7 @@ S: Maintained F: drivers/net/wireless/rtl818x/rtl8180/ RTL8187 WIRELESS DRIVER -M: Herton Ronaldo Krzesinski +M: Herton Ronaldo Krzesinski M: Hin-Tak Leung M: Larry Finger L: linux-wireless@vger.kernel.org @@ -6111,7 +6104,7 @@ S: Maintained F: security/tomoyo/ TOPSTAR LAPTOP EXTRAS DRIVER -M: Herton Ronaldo Krzesinski +M: Herton Ronaldo Krzesinski L: platform-driver-x86@vger.kernel.org S: Maintained F: drivers/platform/x86/topstar-laptop.c diff --git a/trunk/Makefile b/trunk/Makefile index 2f7d92255b57..26d7d824db51 100644 --- a/trunk/Makefile +++ b/trunk/Makefile @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 6 SUBLEVEL = 38 -EXTRAVERSION = -rc7 +EXTRAVERSION = -rc6 NAME = Flesh-Eating Bats with Fangs # *DOCUMENTATION* diff --git a/trunk/arch/arm/mach-omap2/clkt_dpll.c b/trunk/arch/arm/mach-omap2/clkt_dpll.c index acb7ae5b0a25..337392c3f549 100644 --- a/trunk/arch/arm/mach-omap2/clkt_dpll.c +++ b/trunk/arch/arm/mach-omap2/clkt_dpll.c @@ -77,7 +77,7 @@ static int _dpll_test_fint(struct clk *clk, u8 n) dd = clk->dpll_data; /* DPLL divider must result in a valid jitter correction val */ - fint = clk->parent->rate / n; + fint = clk->parent->rate / (n + 1); if (fint < DPLL_FINT_BAND1_MIN) { pr_debug("rejecting n=%d due to Fint failure, " diff --git a/trunk/arch/arm/mach-omap2/mailbox.c b/trunk/arch/arm/mach-omap2/mailbox.c index 0a585dfa9874..394413dc7deb 100644 --- a/trunk/arch/arm/mach-omap2/mailbox.c +++ b/trunk/arch/arm/mach-omap2/mailbox.c @@ -334,7 +334,7 @@ static struct omap_mbox mbox_iva_info = { .priv = &omap2_mbox_iva_priv, }; -struct omap_mbox *omap2_mboxes[] = { &mbox_dsp_info, &mbox_iva_info, NULL }; +struct omap_mbox *omap2_mboxes[] = { &mbox_iva_info, &mbox_dsp_info, NULL }; #endif #if defined(CONFIG_ARCH_OMAP4) diff --git a/trunk/arch/arm/mach-omap2/mux.c b/trunk/arch/arm/mach-omap2/mux.c index 6c84659cf846..98148b6c36e9 100644 --- a/trunk/arch/arm/mach-omap2/mux.c +++ b/trunk/arch/arm/mach-omap2/mux.c @@ -605,7 +605,7 @@ static void __init omap_mux_dbg_create_entry( list_for_each_entry(e, &partition->muxmodes, node) { struct omap_mux *m = &e->mux; - (void)debugfs_create_file(m->muxnames[0], S_IWUSR, mux_dbg_dir, + (void)debugfs_create_file(m->muxnames[0], S_IWUGO, mux_dbg_dir, m, &omap_mux_dbg_signal_fops); } } diff --git a/trunk/arch/arm/mach-omap2/pm-debug.c b/trunk/arch/arm/mach-omap2/pm-debug.c index a5a83b358ddd..125f56591fb5 100644 --- a/trunk/arch/arm/mach-omap2/pm-debug.c +++ b/trunk/arch/arm/mach-omap2/pm-debug.c @@ -637,14 +637,14 @@ static int __init pm_dbg_init(void) } - (void) debugfs_create_file("enable_off_mode", S_IRUGO | S_IWUSR, d, + (void) debugfs_create_file("enable_off_mode", S_IRUGO | S_IWUGO, d, &enable_off_mode, &pm_dbg_option_fops); - (void) debugfs_create_file("sleep_while_idle", S_IRUGO | S_IWUSR, d, + (void) debugfs_create_file("sleep_while_idle", S_IRUGO | S_IWUGO, d, &sleep_while_idle, &pm_dbg_option_fops); - (void) debugfs_create_file("wakeup_timer_seconds", S_IRUGO | S_IWUSR, d, + (void) debugfs_create_file("wakeup_timer_seconds", S_IRUGO | S_IWUGO, d, &wakeup_timer_seconds, &pm_dbg_option_fops); (void) debugfs_create_file("wakeup_timer_milliseconds", - S_IRUGO | S_IWUSR, d, &wakeup_timer_milliseconds, + S_IRUGO | S_IWUGO, d, &wakeup_timer_milliseconds, &pm_dbg_option_fops); pm_dbg_init_done = 1; diff --git a/trunk/arch/arm/mach-omap2/prcm_mpu44xx.h b/trunk/arch/arm/mach-omap2/prcm_mpu44xx.h index 3300ff6e3cfe..729a644ce852 100644 --- a/trunk/arch/arm/mach-omap2/prcm_mpu44xx.h +++ b/trunk/arch/arm/mach-omap2/prcm_mpu44xx.h @@ -38,8 +38,8 @@ #define OMAP4430_PRCM_MPU_CPU1_INST 0x0800 /* PRCM_MPU clockdomain register offsets (from instance start) */ -#define OMAP4430_PRCM_MPU_CPU0_MPU_CDOFFS 0x0018 -#define OMAP4430_PRCM_MPU_CPU1_MPU_CDOFFS 0x0018 +#define OMAP4430_PRCM_MPU_CPU0_MPU_CDOFFS 0x0000 +#define OMAP4430_PRCM_MPU_CPU1_MPU_CDOFFS 0x0000 /* diff --git a/trunk/arch/arm/mach-omap2/smartreflex.c b/trunk/arch/arm/mach-omap2/smartreflex.c index 95ac336fe3f7..c37e823266d3 100644 --- a/trunk/arch/arm/mach-omap2/smartreflex.c +++ b/trunk/arch/arm/mach-omap2/smartreflex.c @@ -900,7 +900,7 @@ static int __init omap_sr_probe(struct platform_device *pdev) return PTR_ERR(dbg_dir); } - (void) debugfs_create_file("autocomp", S_IRUGO | S_IWUSR, dbg_dir, + (void) debugfs_create_file("autocomp", S_IRUGO | S_IWUGO, dbg_dir, (void *)sr_info, &pm_sr_fops); (void) debugfs_create_x32("errweight", S_IRUGO, dbg_dir, &sr_info->err_weight); @@ -939,7 +939,7 @@ static int __init omap_sr_probe(struct platform_device *pdev) strcpy(name, "volt_"); sprintf(volt_name, "%d", volt_data[i].volt_nominal); strcat(name, volt_name); - (void) debugfs_create_x32(name, S_IRUGO | S_IWUSR, nvalue_dir, + (void) debugfs_create_x32(name, S_IRUGO | S_IWUGO, nvalue_dir, &(sr_info->nvalue_table[i].nvalue)); } diff --git a/trunk/arch/arm/mach-omap2/timer-gp.c b/trunk/arch/arm/mach-omap2/timer-gp.c index 0fc550e7e482..7b7c2683ae7b 100644 --- a/trunk/arch/arm/mach-omap2/timer-gp.c +++ b/trunk/arch/arm/mach-omap2/timer-gp.c @@ -39,7 +39,6 @@ #include #include #include -#include #include "timer-gp.h" @@ -191,7 +190,6 @@ static void __init omap2_gp_clocksource_init(void) /* * clocksource */ -static DEFINE_CLOCK_DATA(cd); static struct omap_dm_timer *gpt_clocksource; static cycle_t clocksource_read_cycles(struct clocksource *cs) { @@ -206,15 +204,6 @@ static struct clocksource clocksource_gpt = { .flags = CLOCK_SOURCE_IS_CONTINUOUS, }; -static void notrace dmtimer_update_sched_clock(void) -{ - u32 cyc; - - cyc = omap_dm_timer_read_counter(gpt_clocksource); - - update_sched_clock(&cd, cyc, (u32)~0); -} - /* Setup free-running counter for clocksource */ static void __init omap2_gp_clocksource_init(void) { @@ -235,8 +224,6 @@ static void __init omap2_gp_clocksource_init(void) omap_dm_timer_set_load_start(gpt, 1, 0); - init_sched_clock(&cd, dmtimer_update_sched_clock, 32, tick_rate); - if (clocksource_register_hz(&clocksource_gpt, tick_rate)) printk(err2, clocksource_gpt.name); } diff --git a/trunk/arch/arm/plat-omap/mailbox.c b/trunk/arch/arm/plat-omap/mailbox.c index 49d3208793e5..459b319a9fad 100644 --- a/trunk/arch/arm/plat-omap/mailbox.c +++ b/trunk/arch/arm/plat-omap/mailbox.c @@ -322,18 +322,15 @@ static void omap_mbox_fini(struct omap_mbox *mbox) struct omap_mbox *omap_mbox_get(const char *name, struct notifier_block *nb) { - struct omap_mbox *_mbox, *mbox = NULL; - int i, ret; + struct omap_mbox *mbox; + int ret; if (!mboxes) return ERR_PTR(-EINVAL); - for (i = 0; (_mbox = mboxes[i]); i++) { - if (!strcmp(_mbox->name, name)) { - mbox = _mbox; + for (mbox = *mboxes; mbox; mbox++) + if (!strcmp(mbox->name, name)) break; - } - } if (!mbox) return ERR_PTR(-ENOENT); diff --git a/trunk/arch/x86/include/asm/acpi.h b/trunk/arch/x86/include/asm/acpi.h index 4ea15ca89b2b..211ca3f7fd16 100644 --- a/trunk/arch/x86/include/asm/acpi.h +++ b/trunk/arch/x86/include/asm/acpi.h @@ -88,7 +88,6 @@ extern int acpi_disabled; extern int acpi_pci_disabled; extern int acpi_skip_timer_override; extern int acpi_use_timer_override; -extern int acpi_fix_pin2_polarity; extern u8 acpi_sci_flags; extern int acpi_sci_override_gsi; diff --git a/trunk/arch/x86/include/asm/smpboot_hooks.h b/trunk/arch/x86/include/asm/smpboot_hooks.h index 725b77831993..6c22bf353f26 100644 --- a/trunk/arch/x86/include/asm/smpboot_hooks.h +++ b/trunk/arch/x86/include/asm/smpboot_hooks.h @@ -34,7 +34,7 @@ static inline void smpboot_restore_warm_reset_vector(void) */ CMOS_WRITE(0, 0xf); - *((volatile u32 *)phys_to_virt(apic->trampoline_phys_low)) = 0; + *((volatile long *)phys_to_virt(apic->trampoline_phys_low)) = 0; } static inline void __init smpboot_setup_io_apic(void) diff --git a/trunk/arch/x86/kernel/acpi/boot.c b/trunk/arch/x86/kernel/acpi/boot.c index 3e6e2d68f761..b3a71137983a 100644 --- a/trunk/arch/x86/kernel/acpi/boot.c +++ b/trunk/arch/x86/kernel/acpi/boot.c @@ -72,7 +72,6 @@ u8 acpi_sci_flags __initdata; int acpi_sci_override_gsi __initdata; int acpi_skip_timer_override __initdata; int acpi_use_timer_override __initdata; -int acpi_fix_pin2_polarity __initdata; #ifdef CONFIG_X86_LOCAL_APIC static u64 acpi_lapic_addr __initdata = APIC_DEFAULT_PHYS_BASE; @@ -416,15 +415,10 @@ acpi_parse_int_src_ovr(struct acpi_subtable_header * header, return 0; } - if (intsrc->source_irq == 0 && intsrc->global_irq == 2) { - if (acpi_skip_timer_override) { - printk(PREFIX "BIOS IRQ0 pin2 override ignored.\n"); - return 0; - } - if (acpi_fix_pin2_polarity && (intsrc->inti_flags & ACPI_MADT_POLARITY_MASK)) { - intsrc->inti_flags &= ~ACPI_MADT_POLARITY_MASK; - printk(PREFIX "BIOS IRQ0 pin2 override: forcing polarity to high active.\n"); - } + if (acpi_skip_timer_override && + intsrc->source_irq == 0 && intsrc->global_irq == 2) { + printk(PREFIX "BIOS IRQ0 pin2 override ignored.\n"); + return 0; } mp_override_legacy_irq(intsrc->source_irq, diff --git a/trunk/arch/x86/kernel/apb_timer.c b/trunk/arch/x86/kernel/apb_timer.c index 51d4e1663066..51ef31a89be9 100644 --- a/trunk/arch/x86/kernel/apb_timer.c +++ b/trunk/arch/x86/kernel/apb_timer.c @@ -284,7 +284,7 @@ static int __init apbt_clockevent_register(void) memcpy(&adev->evt, &apbt_clockevent, sizeof(struct clock_event_device)); if (mrst_timer_options == MRST_TIMER_LAPIC_APBT) { - adev->evt.rating = APBT_CLOCKEVENT_RATING - 100; + apbt_clockevent.rating = APBT_CLOCKEVENT_RATING - 100; global_clock_event = &adev->evt; printk(KERN_DEBUG "%s clockevent registered as global\n", global_clock_event->name); diff --git a/trunk/arch/x86/kernel/early-quirks.c b/trunk/arch/x86/kernel/early-quirks.c index 9efbdcc56425..76b8cd953dee 100644 --- a/trunk/arch/x86/kernel/early-quirks.c +++ b/trunk/arch/x86/kernel/early-quirks.c @@ -143,10 +143,15 @@ static void __init ati_bugs(int num, int slot, int func) static u32 __init ati_sbx00_rev(int num, int slot, int func) { - u32 d; + u32 old, d; + d = read_pci_config(num, slot, func, 0x70); + old = d; + d &= ~(1<<8); + write_pci_config(num, slot, func, 0x70, d); d = read_pci_config(num, slot, func, 0x8); d &= 0xff; + write_pci_config(num, slot, func, 0x70, old); return d; } @@ -155,14 +160,11 @@ static void __init ati_bugs_contd(int num, int slot, int func) { u32 d, rev; - rev = ati_sbx00_rev(num, slot, func); - if (rev >= 0x40) - acpi_fix_pin2_polarity = 1; - - if (rev > 0x13) + if (acpi_use_timer_override) return; - if (acpi_use_timer_override) + rev = ati_sbx00_rev(num, slot, func); + if (rev > 0x13) return; /* check for IRQ0 interrupt swap */ diff --git a/trunk/arch/x86/kernel/reboot.c b/trunk/arch/x86/kernel/reboot.c index 715037caeb43..fc7aae1e2bc7 100644 --- a/trunk/arch/x86/kernel/reboot.c +++ b/trunk/arch/x86/kernel/reboot.c @@ -285,14 +285,6 @@ 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"), - }, - }, { } }; diff --git a/trunk/arch/x86/kvm/svm.c b/trunk/arch/x86/kvm/svm.c index 63fec1531e89..54ce246a383e 100644 --- a/trunk/arch/x86/kvm/svm.c +++ b/trunk/arch/x86/kvm/svm.c @@ -2777,8 +2777,6 @@ static int dr_interception(struct vcpu_svm *svm) kvm_register_write(&svm->vcpu, reg, val); } - skip_emulated_instruction(&svm->vcpu); - return 1; } diff --git a/trunk/block/genhd.c b/trunk/block/genhd.c index cbf1112a885c..6a5b772aa201 100644 --- a/trunk/block/genhd.c +++ b/trunk/block/genhd.c @@ -1355,7 +1355,7 @@ int invalidate_partition(struct gendisk *disk, int partno) struct block_device *bdev = bdget_disk(disk, partno); if (bdev) { fsync_bdev(bdev); - res = __invalidate_device(bdev, true); + res = __invalidate_device(bdev); bdput(bdev); } return res; diff --git a/trunk/block/ioctl.c b/trunk/block/ioctl.c index 1124cd297263..9049d460fa89 100644 --- a/trunk/block/ioctl.c +++ b/trunk/block/ioctl.c @@ -294,11 +294,9 @@ int blkdev_ioctl(struct block_device *bdev, fmode_t mode, unsigned cmd, return -EINVAL; if (get_user(n, (int __user *) arg)) return -EFAULT; - if (!(mode & FMODE_EXCL)) { - bdgrab(bdev); - if (blkdev_get(bdev, mode | FMODE_EXCL, &bdev) < 0) - return -EBUSY; - } + if (!(mode & FMODE_EXCL) && + blkdev_get(bdev, mode | FMODE_EXCL, &bdev) < 0) + return -EBUSY; ret = set_blocksize(bdev, n); if (!(mode & FMODE_EXCL)) blkdev_put(bdev, mode | FMODE_EXCL); diff --git a/trunk/drivers/acpi/debugfs.c b/trunk/drivers/acpi/debugfs.c index 5df67f1d6c61..384f7abcff77 100644 --- a/trunk/drivers/acpi/debugfs.c +++ b/trunk/drivers/acpi/debugfs.c @@ -26,7 +26,9 @@ static ssize_t cm_write(struct file *file, const char __user * user_buf, size_t count, loff_t *ppos) { static char *buf; - static int uncopied_bytes; + static u32 max_size; + static u32 uncopied_bytes; + struct acpi_table_header table; acpi_status status; @@ -37,19 +39,24 @@ static ssize_t cm_write(struct file *file, const char __user * user_buf, if (copy_from_user(&table, user_buf, sizeof(struct acpi_table_header))) return -EFAULT; - uncopied_bytes = table.length; - buf = kzalloc(uncopied_bytes, GFP_KERNEL); + uncopied_bytes = max_size = table.length; + buf = kzalloc(max_size, GFP_KERNEL); if (!buf) return -ENOMEM; } - if (uncopied_bytes < count) { - kfree(buf); + if (buf == NULL) + return -EINVAL; + + if ((*ppos > max_size) || + (*ppos + count > max_size) || + (*ppos + count < count) || + (count > uncopied_bytes)) return -EINVAL; - } if (copy_from_user(buf + (*ppos), user_buf, count)) { kfree(buf); + buf = NULL; return -EFAULT; } @@ -59,6 +66,7 @@ static ssize_t cm_write(struct file *file, const char __user * user_buf, if (!uncopied_bytes) { status = acpi_install_method(buf); kfree(buf); + buf = NULL; if (ACPI_FAILURE(status)) return -EINVAL; add_taint(TAINT_OVERRIDDEN_ACPI_TABLE); diff --git a/trunk/drivers/block/floppy.c b/trunk/drivers/block/floppy.c index 77fc76f8aea9..b9ba04fc2b34 100644 --- a/trunk/drivers/block/floppy.c +++ b/trunk/drivers/block/floppy.c @@ -3281,7 +3281,7 @@ static int set_geometry(unsigned int cmd, struct floppy_struct *g, struct block_device *bdev = opened_bdev[cnt]; if (!bdev || ITYPE(drive_state[cnt].fd_device) != type) continue; - __invalidate_device(bdev, true); + __invalidate_device(bdev); } mutex_unlock(&open_lock); } else { diff --git a/trunk/drivers/char/agp/intel-agp.h b/trunk/drivers/char/agp/intel-agp.h index 5feebe2800e9..c195bfeade11 100644 --- a/trunk/drivers/char/agp/intel-agp.h +++ b/trunk/drivers/char/agp/intel-agp.h @@ -130,7 +130,6 @@ #define INTEL_GMCH_GMS_STOLEN_352M (0xd << 4) #define I915_IFPADDR 0x60 -#define I830_HIC 0x70 /* Intel 965G registers */ #define I965_MSAC 0x62 diff --git a/trunk/drivers/char/agp/intel-gtt.c b/trunk/drivers/char/agp/intel-gtt.c index 0d09b537bb9a..fab3d3265adb 100644 --- a/trunk/drivers/char/agp/intel-gtt.c +++ b/trunk/drivers/char/agp/intel-gtt.c @@ -21,7 +21,6 @@ #include #include #include -#include #include #include "agp.h" #include "intel-agp.h" @@ -71,8 +70,12 @@ static struct _intel_private { u32 __iomem *gtt; /* I915G */ bool clear_fake_agp; /* on first access via agp, fill with scratch */ int num_dcache_entries; - void __iomem *i9xx_flush_page; + union { + void __iomem *i9xx_flush_page; + void *i8xx_flush_page; + }; char *i81x_gtt_table; + struct page *i8xx_page; struct resource ifp_resource; int resource_valid; struct page *scratch_page; @@ -719,6 +722,28 @@ static int intel_fake_agp_fetch_size(void) static void i830_cleanup(void) { + if (intel_private.i8xx_flush_page) { + kunmap(intel_private.i8xx_flush_page); + intel_private.i8xx_flush_page = NULL; + } + + __free_page(intel_private.i8xx_page); + intel_private.i8xx_page = NULL; +} + +static void intel_i830_setup_flush(void) +{ + /* return if we've already set the flush mechanism up */ + if (intel_private.i8xx_page) + return; + + intel_private.i8xx_page = alloc_page(GFP_KERNEL); + if (!intel_private.i8xx_page) + return; + + intel_private.i8xx_flush_page = kmap(intel_private.i8xx_page); + if (!intel_private.i8xx_flush_page) + i830_cleanup(); } /* The chipset_flush interface needs to get data that has already been @@ -733,27 +758,14 @@ static void i830_cleanup(void) */ static void i830_chipset_flush(void) { - unsigned long timeout = jiffies + msecs_to_jiffies(1000); - - /* Forcibly evict everything from the CPU write buffers. - * clflush appears to be insufficient. - */ - wbinvd_on_all_cpus(); - - /* Now we've only seen documents for this magic bit on 855GM, - * we hope it exists for the other gen2 chipsets... - * - * Also works as advertised on my 845G. - */ - writel(readl(intel_private.registers+I830_HIC) | (1<<31), - intel_private.registers+I830_HIC); + unsigned int *pg = intel_private.i8xx_flush_page; - while (readl(intel_private.registers+I830_HIC) & (1<<31)) { - if (time_after(jiffies, timeout)) - break; + memset(pg, 0, 1024); - udelay(50); - } + if (cpu_has_clflush) + clflush_cache_range(pg, 1024); + else if (wbinvd_on_all_cpus() != 0) + printk(KERN_ERR "Timed out waiting for cache flush.\n"); } static void i830_write_entry(dma_addr_t addr, unsigned int entry, @@ -837,6 +849,8 @@ static int i830_setup(void) intel_private.gtt_bus_addr = reg_addr + I810_PTE_BASE; + intel_i830_setup_flush(); + return 0; } diff --git a/trunk/drivers/char/tpm/tpm.c b/trunk/drivers/char/tpm/tpm.c index 1f46f1cd9225..36e0fa161c2b 100644 --- a/trunk/drivers/char/tpm/tpm.c +++ b/trunk/drivers/char/tpm/tpm.c @@ -364,12 +364,14 @@ unsigned long tpm_calc_ordinal_duration(struct tpm_chip *chip, tpm_protected_ordinal_duration[ordinal & TPM_PROTECTED_ORDINAL_MASK]; - if (duration_idx != TPM_UNDEFINED) + if (duration_idx != TPM_UNDEFINED) { duration = chip->vendor.duration[duration_idx]; - if (duration <= 0) + /* if duration is 0, it's because chip->vendor.duration wasn't */ + /* filled yet, so we set the lowest timeout just to give enough */ + /* time for tpm_get_timeouts() to succeed */ + return (duration <= 0 ? HZ : duration); + } else return 2 * 60 * HZ; - else - return duration; } EXPORT_SYMBOL_GPL(tpm_calc_ordinal_duration); diff --git a/trunk/drivers/gpu/drm/drm_irq.c b/trunk/drivers/gpu/drm/drm_irq.c index 28d1d3c24d65..53120a72a48c 100644 --- a/trunk/drivers/gpu/drm/drm_irq.c +++ b/trunk/drivers/gpu/drm/drm_irq.c @@ -1012,8 +1012,7 @@ int drm_modeset_ctl(struct drm_device *dev, void *data, struct drm_file *file_priv) { struct drm_modeset_ctl *modeset = data; - int ret = 0; - unsigned int crtc; + int crtc, ret = 0; /* If drm_vblank_init() hasn't been called yet, just no-op */ if (!dev->num_crtcs) diff --git a/trunk/drivers/gpu/drm/i915/i915_gem_tiling.c b/trunk/drivers/gpu/drm/i915/i915_gem_tiling.c index 79a04fde69b5..22a32b9932c5 100644 --- a/trunk/drivers/gpu/drm/i915/i915_gem_tiling.c +++ b/trunk/drivers/gpu/drm/i915/i915_gem_tiling.c @@ -184,7 +184,7 @@ i915_gem_detect_bit_6_swizzle(struct drm_device *dev) static bool i915_tiling_ok(struct drm_device *dev, int stride, int size, int tiling_mode) { - int tile_width, tile_height; + int tile_width; /* Linear is always fine */ if (tiling_mode == I915_TILING_NONE) @@ -215,20 +215,6 @@ i915_tiling_ok(struct drm_device *dev, int stride, int size, int tiling_mode) } } - if (IS_GEN2(dev) || - (tiling_mode == I915_TILING_Y && HAS_128_BYTE_Y_TILING(dev))) - tile_height = 32; - else - tile_height = 8; - /* i8xx is strange: It has 2 interleaved rows of tiles, so needs an even - * number of tile rows. */ - if (IS_GEN2(dev)) - tile_height *= 2; - - /* Size needs to be aligned to a full tile row */ - if (size & (tile_height * stride - 1)) - return false; - /* 965+ just needs multiples of tile width */ if (INTEL_INFO(dev)->gen >= 4) { if (stride & (tile_width - 1)) diff --git a/trunk/drivers/gpu/drm/i915/i915_irq.c b/trunk/drivers/gpu/drm/i915/i915_irq.c index 8a9e08bf1cf7..97f946dcc1aa 100644 --- a/trunk/drivers/gpu/drm/i915/i915_irq.c +++ b/trunk/drivers/gpu/drm/i915/i915_irq.c @@ -316,8 +316,6 @@ static void i915_hotplug_work_func(struct work_struct *work) struct drm_mode_config *mode_config = &dev->mode_config; struct intel_encoder *encoder; - DRM_DEBUG_KMS("running encoder hotplug functions\n"); - list_for_each_entry(encoder, &mode_config->encoder_list, base.head) if (encoder->hot_plug) encoder->hot_plug(encoder); @@ -1651,7 +1649,9 @@ static int ironlake_irq_postinstall(struct drm_device *dev) } else { hotplug_mask = SDE_CRT_HOTPLUG | SDE_PORTB_HOTPLUG | SDE_PORTC_HOTPLUG | SDE_PORTD_HOTPLUG; - hotplug_mask |= SDE_AUX_MASK; + hotplug_mask |= SDE_AUX_MASK | SDE_FDI_MASK | SDE_TRANS_MASK; + I915_WRITE(FDI_RXA_IMR, 0); + I915_WRITE(FDI_RXB_IMR, 0); } dev_priv->pch_irq_mask = ~hotplug_mask; diff --git a/trunk/drivers/gpu/drm/i915/intel_display.c b/trunk/drivers/gpu/drm/i915/intel_display.c index e79b25bbee6c..3b006536b3d2 100644 --- a/trunk/drivers/gpu/drm/i915/intel_display.c +++ b/trunk/drivers/gpu/drm/i915/intel_display.c @@ -1630,19 +1630,19 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y, struct drm_i915_gem_object *obj = to_intel_framebuffer(old_fb)->obj; wait_event(dev_priv->pending_flip_queue, - atomic_read(&dev_priv->mm.wedged) || atomic_read(&obj->pending_flip) == 0); /* Big Hammer, we also need to ensure that any pending * MI_WAIT_FOR_EVENT inside a user batch buffer on the * current scanout is retired before unpinning the old * framebuffer. - * - * This should only fail upon a hung GPU, in which case we - * can safely continue. */ ret = i915_gem_object_flush_gpu(obj, false); - (void) ret; + if (ret) { + i915_gem_object_unpin(to_intel_framebuffer(crtc->fb)->obj); + mutex_unlock(&dev->struct_mutex); + return ret; + } } ret = intel_pipe_set_base_atomic(crtc, crtc->fb, x, y, @@ -2045,31 +2045,6 @@ static void intel_crtc_wait_for_pending_flips(struct drm_crtc *crtc) atomic_read(&obj->pending_flip) == 0); } -static bool intel_crtc_driving_pch(struct drm_crtc *crtc) -{ - struct drm_device *dev = crtc->dev; - struct drm_mode_config *mode_config = &dev->mode_config; - struct intel_encoder *encoder; - - /* - * If there's a non-PCH eDP on this crtc, it must be DP_A, and that - * must be driven by its own crtc; no sharing is possible. - */ - list_for_each_entry(encoder, &mode_config->encoder_list, base.head) { - if (encoder->base.crtc != crtc) - continue; - - switch (encoder->type) { - case INTEL_OUTPUT_EDP: - if (!intel_encoder_is_pch_edp(&encoder->base)) - return false; - continue; - } - } - - return true; -} - static void ironlake_crtc_enable(struct drm_crtc *crtc) { struct drm_device *dev = crtc->dev; @@ -2078,7 +2053,6 @@ static void ironlake_crtc_enable(struct drm_crtc *crtc) int pipe = intel_crtc->pipe; int plane = intel_crtc->plane; u32 reg, temp; - bool is_pch_port = false; if (intel_crtc->active) return; @@ -2092,56 +2066,7 @@ static void ironlake_crtc_enable(struct drm_crtc *crtc) I915_WRITE(PCH_LVDS, temp | LVDS_PORT_EN); } - is_pch_port = intel_crtc_driving_pch(crtc); - - if (is_pch_port) - ironlake_fdi_enable(crtc); - else { - /* disable CPU FDI tx and PCH FDI rx */ - reg = FDI_TX_CTL(pipe); - temp = I915_READ(reg); - I915_WRITE(reg, temp & ~FDI_TX_ENABLE); - POSTING_READ(reg); - - reg = FDI_RX_CTL(pipe); - temp = I915_READ(reg); - temp &= ~(0x7 << 16); - temp |= (I915_READ(PIPECONF(pipe)) & PIPE_BPC_MASK) << 11; - I915_WRITE(reg, temp & ~FDI_RX_ENABLE); - - POSTING_READ(reg); - udelay(100); - - /* Ironlake workaround, disable clock pointer after downing FDI */ - if (HAS_PCH_IBX(dev)) - I915_WRITE(FDI_RX_CHICKEN(pipe), - I915_READ(FDI_RX_CHICKEN(pipe) & - ~FDI_RX_PHASE_SYNC_POINTER_ENABLE)); - - /* still set train pattern 1 */ - reg = FDI_TX_CTL(pipe); - temp = I915_READ(reg); - temp &= ~FDI_LINK_TRAIN_NONE; - temp |= FDI_LINK_TRAIN_PATTERN_1; - I915_WRITE(reg, temp); - - reg = FDI_RX_CTL(pipe); - temp = I915_READ(reg); - if (HAS_PCH_CPT(dev)) { - temp &= ~FDI_LINK_TRAIN_PATTERN_MASK_CPT; - temp |= FDI_LINK_TRAIN_PATTERN_1_CPT; - } else { - temp &= ~FDI_LINK_TRAIN_NONE; - temp |= FDI_LINK_TRAIN_PATTERN_1; - } - /* BPC in FDI rx is consistent with that in PIPECONF */ - temp &= ~(0x07 << 16); - temp |= (I915_READ(PIPECONF(pipe)) & PIPE_BPC_MASK) << 11; - I915_WRITE(reg, temp); - - POSTING_READ(reg); - udelay(100); - } + ironlake_fdi_enable(crtc); /* Enable panel fitting for LVDS */ if (dev_priv->pch_pf_size && @@ -2175,10 +2100,6 @@ static void ironlake_crtc_enable(struct drm_crtc *crtc) intel_flush_display_plane(dev, plane); } - /* Skip the PCH stuff if possible */ - if (!is_pch_port) - goto done; - /* For PCH output, training FDI link */ if (IS_GEN6(dev)) gen6_fdi_link_train(crtc); @@ -2263,7 +2184,7 @@ static void ironlake_crtc_enable(struct drm_crtc *crtc) I915_WRITE(reg, temp | TRANS_ENABLE); if (wait_for(I915_READ(reg) & TRANS_STATE_ENABLE, 100)) DRM_ERROR("failed to enable transcoder %d\n", pipe); -done: + intel_crtc_load_lut(crtc); intel_update_fbc(dev); intel_crtc_update_cursor(crtc, true); @@ -6575,7 +6496,7 @@ static void ironlake_disable_rc6(struct drm_device *dev) POSTING_READ(RSTDBYCTL); } - ironlake_teardown_rc6(dev); + ironlake_disable_rc6(dev); } static int ironlake_setup_rc6(struct drm_device *dev) diff --git a/trunk/drivers/gpu/drm/nouveau/nouveau_bo.c b/trunk/drivers/gpu/drm/nouveau/nouveau_bo.c index a52184007f5f..d38a4d9f9b0b 100644 --- a/trunk/drivers/gpu/drm/nouveau/nouveau_bo.c +++ b/trunk/drivers/gpu/drm/nouveau/nouveau_bo.c @@ -49,10 +49,7 @@ nouveau_bo_del_ttm(struct ttm_buffer_object *bo) DRM_ERROR("bo %p still attached to GEM object\n", bo); nv10_mem_put_tile_region(dev, nvbo->tile, NULL); - if (nvbo->vma.node) { - nouveau_vm_unmap(&nvbo->vma); - nouveau_vm_put(&nvbo->vma); - } + nouveau_vm_put(&nvbo->vma); kfree(nvbo); } diff --git a/trunk/drivers/hwmon/ad7414.c b/trunk/drivers/hwmon/ad7414.c index d46c0c758ddf..86d822aa9bbf 100644 --- a/trunk/drivers/hwmon/ad7414.c +++ b/trunk/drivers/hwmon/ad7414.c @@ -242,7 +242,6 @@ static const struct i2c_device_id ad7414_id[] = { { "ad7414", 0 }, {} }; -MODULE_DEVICE_TABLE(i2c, ad7414_id); static struct i2c_driver ad7414_driver = { .driver = { diff --git a/trunk/drivers/hwmon/adt7411.c b/trunk/drivers/hwmon/adt7411.c index 5cc3e3784b42..f13c843a2964 100644 --- a/trunk/drivers/hwmon/adt7411.c +++ b/trunk/drivers/hwmon/adt7411.c @@ -334,7 +334,6 @@ static const struct i2c_device_id adt7411_id[] = { { "adt7411", 0 }, { } }; -MODULE_DEVICE_TABLE(i2c, adt7411_id); static struct i2c_driver adt7411_driver = { .driver = { diff --git a/trunk/drivers/md/linear.c b/trunk/drivers/md/linear.c index 0ed7f6bc2a7f..8a2f767f26d8 100644 --- a/trunk/drivers/md/linear.c +++ b/trunk/drivers/md/linear.c @@ -216,6 +216,7 @@ static int linear_run (mddev_t *mddev) if (md_check_no_bitmap(mddev)) return -EINVAL; + mddev->queue->queue_lock = &mddev->queue->__queue_lock; conf = linear_conf(mddev, mddev->raid_disks); if (!conf) diff --git a/trunk/drivers/md/md.c b/trunk/drivers/md/md.c index 818313e277e7..0cc30ecda4c1 100644 --- a/trunk/drivers/md/md.c +++ b/trunk/drivers/md/md.c @@ -553,9 +553,6 @@ static mddev_t * mddev_find(dev_t unit) { mddev_t *mddev, *new = NULL; - if (unit && MAJOR(unit) != MD_MAJOR) - unit &= ~((1<array_sectors = sectors; - if (mddev->pers) { - set_capacity(mddev->gendisk, mddev->array_sectors); + set_capacity(mddev->gendisk, mddev->array_sectors); + if (mddev->pers) revalidate_disk(mddev->gendisk); - } + return len; } @@ -4627,7 +4624,6 @@ static int do_md_run(mddev_t *mddev) } set_capacity(mddev->gendisk, mddev->array_sectors); revalidate_disk(mddev->gendisk); - mddev->changed = 1; kobject_uevent(&disk_to_dev(mddev->gendisk)->kobj, KOBJ_CHANGE); out: return err; @@ -4716,7 +4712,6 @@ static void md_clean(mddev_t *mddev) mddev->sync_speed_min = mddev->sync_speed_max = 0; mddev->recovery = 0; mddev->in_sync = 0; - mddev->changed = 0; mddev->degraded = 0; mddev->safemode = 0; mddev->bitmap_info.offset = 0; @@ -4832,7 +4827,6 @@ static int do_md_stop(mddev_t * mddev, int mode, int is_open) set_capacity(disk, 0); mutex_unlock(&mddev->open_mutex); - mddev->changed = 1; revalidate_disk(disk); if (mddev->ro) @@ -6017,7 +6011,7 @@ static int md_open(struct block_device *bdev, fmode_t mode) atomic_inc(&mddev->openers); mutex_unlock(&mddev->open_mutex); - check_disk_change(bdev); + check_disk_size_change(mddev->gendisk, bdev); out: return err; } @@ -6032,21 +6026,6 @@ static int md_release(struct gendisk *disk, fmode_t mode) return 0; } - -static int md_media_changed(struct gendisk *disk) -{ - mddev_t *mddev = disk->private_data; - - return mddev->changed; -} - -static int md_revalidate(struct gendisk *disk) -{ - mddev_t *mddev = disk->private_data; - - mddev->changed = 0; - return 0; -} static const struct block_device_operations md_fops = { .owner = THIS_MODULE, @@ -6057,8 +6036,6 @@ static const struct block_device_operations md_fops = .compat_ioctl = md_compat_ioctl, #endif .getgeo = md_getgeo, - .media_changed = md_media_changed, - .revalidate_disk= md_revalidate, }; static int md_thread(void * arg) diff --git a/trunk/drivers/md/md.h b/trunk/drivers/md/md.h index 12215d437fcc..7e90b8593b2a 100644 --- a/trunk/drivers/md/md.h +++ b/trunk/drivers/md/md.h @@ -274,8 +274,6 @@ struct mddev_s atomic_t active; /* general refcount */ atomic_t openers; /* number of active opens */ - int changed; /* True if we might need to - * reread partition info */ int degraded; /* whether md should consider * adding a spare */ diff --git a/trunk/drivers/md/multipath.c b/trunk/drivers/md/multipath.c index 3a62d440e27b..6d7ddf32ef2e 100644 --- a/trunk/drivers/md/multipath.c +++ b/trunk/drivers/md/multipath.c @@ -435,6 +435,7 @@ static int multipath_run (mddev_t *mddev) * bookkeeping area. [whatever we allocate in multipath_run(), * should be freed in multipath_stop()] */ + mddev->queue->queue_lock = &mddev->queue->__queue_lock; conf = kzalloc(sizeof(multipath_conf_t), GFP_KERNEL); mddev->private = conf; diff --git a/trunk/drivers/md/raid0.c b/trunk/drivers/md/raid0.c index c0ac457f1218..637a96855edb 100644 --- a/trunk/drivers/md/raid0.c +++ b/trunk/drivers/md/raid0.c @@ -361,6 +361,7 @@ static int raid0_run(mddev_t *mddev) if (md_check_no_bitmap(mddev)) return -EINVAL; blk_queue_max_hw_sectors(mddev->queue, mddev->chunk_sectors); + mddev->queue->queue_lock = &mddev->queue->__queue_lock; /* if private is not null, we are here after takeover */ if (mddev->private == NULL) { @@ -669,7 +670,6 @@ static void *raid0_takeover_raid1(mddev_t *mddev) mddev->new_layout = 0; mddev->new_chunk_sectors = 128; /* by default set chunk size to 64k */ mddev->delta_disks = 1 - mddev->raid_disks; - mddev->raid_disks = 1; /* make sure it will be not marked as dirty */ mddev->recovery_cp = MaxSector; diff --git a/trunk/drivers/md/raid1.c b/trunk/drivers/md/raid1.c index 06cd712807d0..a23ffa397ba9 100644 --- a/trunk/drivers/md/raid1.c +++ b/trunk/drivers/md/raid1.c @@ -593,10 +593,7 @@ static int flush_pending_writes(conf_t *conf) if (conf->pending_bio_list.head) { struct bio *bio; bio = bio_list_get(&conf->pending_bio_list); - /* Only take the spinlock to quiet a warning */ - spin_lock(conf->mddev->queue->queue_lock); blk_remove_plug(conf->mddev->queue); - spin_unlock(conf->mddev->queue->queue_lock); spin_unlock_irq(&conf->device_lock); /* flush any pending bitmap writes to * disk before proceeding w/ I/O */ @@ -962,7 +959,7 @@ static int make_request(mddev_t *mddev, struct bio * bio) atomic_inc(&r1_bio->remaining); spin_lock_irqsave(&conf->device_lock, flags); bio_list_add(&conf->pending_bio_list, mbio); - blk_plug_device_unlocked(mddev->queue); + blk_plug_device(mddev->queue); spin_unlock_irqrestore(&conf->device_lock, flags); } r1_bio_write_done(r1_bio, bio->bi_vcnt, behind_pages, behind_pages != NULL); @@ -2024,6 +2021,7 @@ static int run(mddev_t *mddev) if (IS_ERR(conf)) return PTR_ERR(conf); + mddev->queue->queue_lock = &conf->device_lock; list_for_each_entry(rdev, &mddev->disks, same_set) { disk_stack_limits(mddev->gendisk, rdev->bdev, rdev->data_offset << 9); diff --git a/trunk/drivers/md/raid10.c b/trunk/drivers/md/raid10.c index 747d061d8e05..3b607b28741b 100644 --- a/trunk/drivers/md/raid10.c +++ b/trunk/drivers/md/raid10.c @@ -662,10 +662,7 @@ static int flush_pending_writes(conf_t *conf) if (conf->pending_bio_list.head) { struct bio *bio; bio = bio_list_get(&conf->pending_bio_list); - /* Spinlock only taken to quiet a warning */ - spin_lock(conf->mddev->queue->queue_lock); blk_remove_plug(conf->mddev->queue); - spin_unlock(conf->mddev->queue->queue_lock); spin_unlock_irq(&conf->device_lock); /* flush any pending bitmap writes to disk * before proceeding w/ I/O */ @@ -974,7 +971,7 @@ static int make_request(mddev_t *mddev, struct bio * bio) atomic_inc(&r10_bio->remaining); spin_lock_irqsave(&conf->device_lock, flags); bio_list_add(&conf->pending_bio_list, mbio); - blk_plug_device_unlocked(mddev->queue); + blk_plug_device(mddev->queue); spin_unlock_irqrestore(&conf->device_lock, flags); } @@ -2307,6 +2304,8 @@ static int run(mddev_t *mddev) if (!conf) goto out; + mddev->queue->queue_lock = &conf->device_lock; + mddev->thread = conf->thread; conf->thread = NULL; diff --git a/trunk/drivers/md/raid5.c b/trunk/drivers/md/raid5.c index 78536fdbd87f..702812824195 100644 --- a/trunk/drivers/md/raid5.c +++ b/trunk/drivers/md/raid5.c @@ -5204,6 +5204,7 @@ static int run(mddev_t *mddev) mddev->queue->backing_dev_info.congested_data = mddev; mddev->queue->backing_dev_info.congested_fn = raid5_congested; + mddev->queue->queue_lock = &conf->device_lock; mddev->queue->unplug_fn = raid5_unplug_queue; chunk_size = mddev->chunk_sectors << 9; diff --git a/trunk/drivers/nfc/Kconfig b/trunk/drivers/nfc/Kconfig index ea1580085347..ffedfd492754 100644 --- a/trunk/drivers/nfc/Kconfig +++ b/trunk/drivers/nfc/Kconfig @@ -3,7 +3,7 @@ # menuconfig NFC_DEVICES - bool "Near Field Communication (NFC) devices" + bool "NFC devices" default n ---help--- You'll have to say Y if your computer contains an NFC device that diff --git a/trunk/drivers/nfc/pn544.c b/trunk/drivers/nfc/pn544.c index 724f65d8f9e4..bae647264dd6 100644 --- a/trunk/drivers/nfc/pn544.c +++ b/trunk/drivers/nfc/pn544.c @@ -60,7 +60,7 @@ enum pn544_irq { struct pn544_info { struct miscdevice miscdev; struct i2c_client *i2c_dev; - struct regulator_bulk_data regs[3]; + struct regulator_bulk_data regs[2]; enum pn544_state state; wait_queue_head_t read_wait; @@ -74,7 +74,6 @@ struct pn544_info { static const char reg_vdd_io[] = "Vdd_IO"; static const char reg_vbat[] = "VBat"; -static const char reg_vsim[] = "VSim"; /* sysfs interface */ static ssize_t pn544_test(struct device *dev, @@ -741,7 +740,6 @@ static int __devinit pn544_probe(struct i2c_client *client, info->regs[0].supply = reg_vdd_io; info->regs[1].supply = reg_vbat; - info->regs[2].supply = reg_vsim; r = regulator_bulk_get(&client->dev, ARRAY_SIZE(info->regs), info->regs); if (r < 0) diff --git a/trunk/drivers/pps/kapi.c b/trunk/drivers/pps/kapi.c index a4e8eb9fece6..cba1b43f7519 100644 --- a/trunk/drivers/pps/kapi.c +++ b/trunk/drivers/pps/kapi.c @@ -168,7 +168,7 @@ void pps_event(struct pps_device *pps, struct pps_event_time *ts, int event, { unsigned long flags; int captured = 0; - struct pps_ktime ts_real = { .sec = 0, .nsec = 0, .flags = 0 }; + struct pps_ktime ts_real; /* check event type */ BUG_ON((event & (PPS_CAPTUREASSERT | PPS_CAPTURECLEAR)) == 0); diff --git a/trunk/drivers/rapidio/rio-sysfs.c b/trunk/drivers/rapidio/rio-sysfs.c index 1269fbd2deca..76b41853a877 100644 --- a/trunk/drivers/rapidio/rio-sysfs.c +++ b/trunk/drivers/rapidio/rio-sysfs.c @@ -77,9 +77,9 @@ rio_read_config(struct file *filp, struct kobject *kobj, /* Several chips lock up trying to read undefined config space */ if (capable(CAP_SYS_ADMIN)) - size = RIO_MAINT_SPACE_SZ; + size = 0x200000; - if (off >= size) + if (off > size) return 0; if (off + count > size) { size -= off; @@ -147,10 +147,10 @@ rio_write_config(struct file *filp, struct kobject *kobj, loff_t init_off = off; u8 *data = (u8 *) buf; - if (off >= RIO_MAINT_SPACE_SZ) + if (off > 0x200000) return 0; - if (off + count > RIO_MAINT_SPACE_SZ) { - size = RIO_MAINT_SPACE_SZ - off; + if (off + count > 0x200000) { + size = 0x200000 - off; count = size; } @@ -200,7 +200,7 @@ static struct bin_attribute rio_config_attr = { .name = "config", .mode = S_IRUGO | S_IWUSR, }, - .size = RIO_MAINT_SPACE_SZ, + .size = 0x200000, .read = rio_read_config, .write = rio_write_config, }; diff --git a/trunk/drivers/regulator/mc13xxx-regulator-core.c b/trunk/drivers/regulator/mc13xxx-regulator-core.c index 2bb5de1f2421..f53d31b950d4 100644 --- a/trunk/drivers/regulator/mc13xxx-regulator-core.c +++ b/trunk/drivers/regulator/mc13xxx-regulator-core.c @@ -174,7 +174,7 @@ static int mc13xxx_regulator_get_voltage(struct regulator_dev *rdev) dev_dbg(rdev_get_dev(rdev), "%s id: %d val: %d\n", __func__, id, val); - BUG_ON(val > mc13xxx_regulators[id].desc.n_voltages); + BUG_ON(val < 0 || val > mc13xxx_regulators[id].desc.n_voltages); return mc13xxx_regulators[id].voltages[val]; } diff --git a/trunk/drivers/regulator/wm831x-dcdc.c b/trunk/drivers/regulator/wm831x-dcdc.c index 06df898842c0..8b0d2c4bde91 100644 --- a/trunk/drivers/regulator/wm831x-dcdc.c +++ b/trunk/drivers/regulator/wm831x-dcdc.c @@ -120,7 +120,6 @@ static unsigned int wm831x_dcdc_get_mode(struct regulator_dev *rdev) return REGULATOR_MODE_IDLE; default: BUG(); - return -EINVAL; } } diff --git a/trunk/drivers/rtc/rtc-at91sam9.c b/trunk/drivers/rtc/rtc-at91sam9.c index 5469c52cba3d..c36749e4c926 100644 --- a/trunk/drivers/rtc/rtc-at91sam9.c +++ b/trunk/drivers/rtc/rtc-at91sam9.c @@ -309,7 +309,7 @@ static const struct rtc_class_ops at91_rtc_ops = { .read_alarm = at91_rtc_readalarm, .set_alarm = at91_rtc_setalarm, .proc = at91_rtc_proc, - .alarm_irq_enable = at91_rtc_alarm_irq_enable, + .alarm_irq_enabled = at91_rtc_alarm_irq_enable, }; /* diff --git a/trunk/drivers/rtc/rtc-ds3232.c b/trunk/drivers/rtc/rtc-ds3232.c index 950735415a7c..23a9ee19764c 100644 --- a/trunk/drivers/rtc/rtc-ds3232.c +++ b/trunk/drivers/rtc/rtc-ds3232.c @@ -1,7 +1,7 @@ /* * RTC client/driver for the Maxim/Dallas DS3232 Real-Time Clock over I2C * - * Copyright (C) 2009-2011 Freescale Semiconductor. + * Copyright (C) 2009-2010 Freescale Semiconductor. * Author: Jack Lan * * This program is free software; you can redistribute it and/or modify it @@ -141,11 +141,9 @@ static int ds3232_read_time(struct device *dev, struct rtc_time *time) time->tm_hour = bcd2bin(hour); } - /* Day of the week in linux range is 0~6 while 1~7 in RTC chip */ - time->tm_wday = bcd2bin(week) - 1; + time->tm_wday = bcd2bin(week); time->tm_mday = bcd2bin(day); - /* linux tm_mon range:0~11, while month range is 1~12 in RTC chip */ - time->tm_mon = bcd2bin(month & 0x7F) - 1; + time->tm_mon = bcd2bin(month & 0x7F); if (century) add_century = 100; @@ -164,11 +162,9 @@ static int ds3232_set_time(struct device *dev, struct rtc_time *time) buf[0] = bin2bcd(time->tm_sec); buf[1] = bin2bcd(time->tm_min); buf[2] = bin2bcd(time->tm_hour); - /* Day of the week in linux range is 0~6 while 1~7 in RTC chip */ - buf[3] = bin2bcd(time->tm_wday + 1); + buf[3] = bin2bcd(time->tm_wday); /* Day of the week */ buf[4] = bin2bcd(time->tm_mday); /* Date */ - /* linux tm_mon range:0~11, while month range is 1~12 in RTC chip */ - buf[5] = bin2bcd(time->tm_mon + 1); + buf[5] = bin2bcd(time->tm_mon); if (time->tm_year >= 100) { buf[5] |= 0x80; buf[6] = bin2bcd(time->tm_year - 100); diff --git a/trunk/drivers/thermal/Kconfig b/trunk/drivers/thermal/Kconfig index bf7c687519ef..f7a5dba3ca23 100644 --- a/trunk/drivers/thermal/Kconfig +++ b/trunk/drivers/thermal/Kconfig @@ -4,6 +4,7 @@ menuconfig THERMAL tristate "Generic Thermal sysfs driver" + depends on NET help Generic Thermal Sysfs driver offers a generic mechanism for thermal management. Usually it's made up of one or more thermal diff --git a/trunk/drivers/thermal/thermal_sys.c b/trunk/drivers/thermal/thermal_sys.c index 713b7ea4a607..7d0e63c79280 100644 --- a/trunk/drivers/thermal/thermal_sys.c +++ b/trunk/drivers/thermal/thermal_sys.c @@ -62,6 +62,20 @@ static DEFINE_MUTEX(thermal_list_lock); static unsigned int thermal_event_seqnum; +static struct genl_family thermal_event_genl_family = { + .id = GENL_ID_GENERATE, + .name = THERMAL_GENL_FAMILY_NAME, + .version = THERMAL_GENL_VERSION, + .maxattr = THERMAL_GENL_ATTR_MAX, +}; + +static struct genl_multicast_group thermal_event_mcgrp = { + .name = THERMAL_GENL_MCAST_GROUP_NAME, +}; + +static int genetlink_init(void); +static void genetlink_exit(void); + static int get_idr(struct idr *idr, struct mutex *lock, int *id) { int err; @@ -1211,18 +1225,6 @@ void thermal_zone_device_unregister(struct thermal_zone_device *tz) EXPORT_SYMBOL(thermal_zone_device_unregister); -#ifdef CONFIG_NET -static struct genl_family thermal_event_genl_family = { - .id = GENL_ID_GENERATE, - .name = THERMAL_GENL_FAMILY_NAME, - .version = THERMAL_GENL_VERSION, - .maxattr = THERMAL_GENL_ATTR_MAX, -}; - -static struct genl_multicast_group thermal_event_mcgrp = { - .name = THERMAL_GENL_MCAST_GROUP_NAME, -}; - int generate_netlink_event(u32 orig, enum events event) { struct sk_buff *skb; @@ -1299,15 +1301,6 @@ static int genetlink_init(void) return result; } -static void genetlink_exit(void) -{ - genl_unregister_family(&thermal_event_genl_family); -} -#else /* !CONFIG_NET */ -static inline int genetlink_init(void) { return 0; } -static inline void genetlink_exit(void) {} -#endif /* !CONFIG_NET */ - static int __init thermal_init(void) { int result = 0; @@ -1323,6 +1316,11 @@ static int __init thermal_init(void) return result; } +static void genetlink_exit(void) +{ + genl_unregister_family(&thermal_event_genl_family); +} + static void __exit thermal_exit(void) { class_unregister(&thermal_class); diff --git a/trunk/drivers/usb/core/hub.c b/trunk/drivers/usb/core/hub.c index 0f299b7aad60..d041c6826e43 100644 --- a/trunk/drivers/usb/core/hub.c +++ b/trunk/drivers/usb/core/hub.c @@ -2681,13 +2681,17 @@ hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1, mutex_lock(&usb_address0_mutex); - /* Reset the device; full speed may morph to high speed */ - /* FIXME a USB 2.0 device may morph into SuperSpeed on reset. */ - retval = hub_port_reset(hub, port1, udev, delay); - if (retval < 0) /* error or disconnect */ - goto fail; - /* success, speed is known */ - + if (!udev->config && oldspeed == USB_SPEED_SUPER) { + /* Don't reset USB 3.0 devices during an initial setup */ + usb_set_device_state(udev, USB_STATE_DEFAULT); + } else { + /* Reset the device; full speed may morph to high speed */ + /* FIXME a USB 2.0 device may morph into SuperSpeed on reset. */ + retval = hub_port_reset(hub, port1, udev, delay); + if (retval < 0) /* error or disconnect */ + goto fail; + /* success, speed is known */ + } retval = -ENODEV; if (oldspeed != USB_SPEED_UNKNOWN && oldspeed != udev->speed) { diff --git a/trunk/drivers/usb/host/xhci-dbg.c b/trunk/drivers/usb/host/xhci-dbg.c index 0231814a97a5..fcbf4abbf381 100644 --- a/trunk/drivers/usb/host/xhci-dbg.c +++ b/trunk/drivers/usb/host/xhci-dbg.c @@ -169,10 +169,9 @@ static void xhci_print_ports(struct xhci_hcd *xhci) } } -void xhci_print_ir_set(struct xhci_hcd *xhci, int set_num) +void xhci_print_ir_set(struct xhci_hcd *xhci, struct xhci_intr_reg *ir_set, int set_num) { - struct xhci_intr_reg __iomem *ir_set = &xhci->run_regs->ir_set[set_num]; - void __iomem *addr; + void *addr; u32 temp; u64 temp_64; @@ -450,7 +449,7 @@ char *xhci_get_slot_state(struct xhci_hcd *xhci, } } -static void xhci_dbg_slot_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx) +void xhci_dbg_slot_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx) { /* Fields are 32 bits wide, DMA addresses are in bytes */ int field_size = 32 / 8; @@ -489,7 +488,7 @@ static void xhci_dbg_slot_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx * dbg_rsvd64(xhci, (u64 *)slot_ctx, dma); } -static void xhci_dbg_ep_ctx(struct xhci_hcd *xhci, +void xhci_dbg_ep_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx, unsigned int last_ep) { diff --git a/trunk/drivers/usb/host/xhci-mem.c b/trunk/drivers/usb/host/xhci-mem.c index a9534396e85b..1d0f45f0e7a6 100644 --- a/trunk/drivers/usb/host/xhci-mem.c +++ b/trunk/drivers/usb/host/xhci-mem.c @@ -307,7 +307,7 @@ struct xhci_ep_ctx *xhci_get_ep_ctx(struct xhci_hcd *xhci, /***************** Streams structures manipulation *************************/ -static void xhci_free_stream_ctx(struct xhci_hcd *xhci, +void xhci_free_stream_ctx(struct xhci_hcd *xhci, unsigned int num_stream_ctxs, struct xhci_stream_ctx *stream_ctx, dma_addr_t dma) { @@ -335,7 +335,7 @@ static void xhci_free_stream_ctx(struct xhci_hcd *xhci, * The stream context array must be a power of 2, and can be as small as * 64 bytes or as large as 1MB. */ -static struct xhci_stream_ctx *xhci_alloc_stream_ctx(struct xhci_hcd *xhci, +struct xhci_stream_ctx *xhci_alloc_stream_ctx(struct xhci_hcd *xhci, unsigned int num_stream_ctxs, dma_addr_t *dma, gfp_t mem_flags) { @@ -1900,11 +1900,11 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags) val &= DBOFF_MASK; xhci_dbg(xhci, "// Doorbell array is located at offset 0x%x" " from cap regs base addr\n", val); - xhci->dba = (void __iomem *) xhci->cap_regs + val; + xhci->dba = (void *) xhci->cap_regs + val; xhci_dbg_regs(xhci); xhci_print_run_regs(xhci); /* Set ir_set to interrupt register set 0 */ - xhci->ir_set = &xhci->run_regs->ir_set[0]; + xhci->ir_set = (void *) xhci->run_regs->ir_set; /* * Event ring setup: Allocate a normal ring, but also setup @@ -1961,7 +1961,7 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags) /* Set the event ring dequeue address */ xhci_set_hc_event_deq(xhci); xhci_dbg(xhci, "Wrote ERST address to ir_set 0.\n"); - xhci_print_ir_set(xhci, 0); + xhci_print_ir_set(xhci, xhci->ir_set, 0); /* * XXX: Might need to set the Interrupter Moderation Register to diff --git a/trunk/drivers/usb/host/xhci-ring.c b/trunk/drivers/usb/host/xhci-ring.c index 3289bf4832c9..3e8211c1ce5a 100644 --- a/trunk/drivers/usb/host/xhci-ring.c +++ b/trunk/drivers/usb/host/xhci-ring.c @@ -474,11 +474,8 @@ void xhci_find_new_dequeue_state(struct xhci_hcd *xhci, state->new_deq_seg = find_trb_seg(cur_td->start_seg, dev->eps[ep_index].stopped_trb, &state->new_cycle_state); - if (!state->new_deq_seg) { - WARN_ON(1); - return; - } - + if (!state->new_deq_seg) + BUG(); /* Dig out the cycle state saved by the xHC during the stop ep cmd */ xhci_dbg(xhci, "Finding endpoint context\n"); ep_ctx = xhci_get_ep_ctx(xhci, dev->out_ctx, ep_index); @@ -489,10 +486,8 @@ void xhci_find_new_dequeue_state(struct xhci_hcd *xhci, state->new_deq_seg = find_trb_seg(state->new_deq_seg, state->new_deq_ptr, &state->new_cycle_state); - if (!state->new_deq_seg) { - WARN_ON(1); - return; - } + if (!state->new_deq_seg) + BUG(); trb = &state->new_deq_ptr->generic; if ((trb->field[3] & TRB_TYPE_BITMASK) == TRB_TYPE(TRB_LINK) && @@ -2368,13 +2363,12 @@ static unsigned int count_sg_trbs_needed(struct xhci_hcd *xhci, struct urb *urb) /* Scatter gather list entries may cross 64KB boundaries */ running_total = TRB_MAX_BUFF_SIZE - - (sg_dma_address(sg) & (TRB_MAX_BUFF_SIZE - 1)); - running_total &= TRB_MAX_BUFF_SIZE - 1; + (sg_dma_address(sg) & ((1 << TRB_MAX_BUFF_SHIFT) - 1)); if (running_total != 0) num_trbs++; /* How many more 64KB chunks to transfer, how many more TRBs? */ - while (running_total < sg_dma_len(sg) && running_total < temp) { + while (running_total < sg_dma_len(sg)) { num_trbs++; running_total += TRB_MAX_BUFF_SIZE; } @@ -2400,11 +2394,11 @@ static unsigned int count_sg_trbs_needed(struct xhci_hcd *xhci, struct urb *urb) static void check_trb_math(struct urb *urb, int num_trbs, int running_total) { if (num_trbs != 0) - dev_err(&urb->dev->dev, "%s - ep %#x - Miscalculated number of " + dev_dbg(&urb->dev->dev, "%s - ep %#x - Miscalculated number of " "TRBs, %d left\n", __func__, urb->ep->desc.bEndpointAddress, num_trbs); if (running_total != urb->transfer_buffer_length) - dev_err(&urb->dev->dev, "%s - ep %#x - Miscalculated tx length, " + dev_dbg(&urb->dev->dev, "%s - ep %#x - Miscalculated tx length, " "queued %#x (%d), asked for %#x (%d)\n", __func__, urb->ep->desc.bEndpointAddress, @@ -2539,7 +2533,8 @@ static int queue_bulk_sg_tx(struct xhci_hcd *xhci, gfp_t mem_flags, sg = urb->sg; addr = (u64) sg_dma_address(sg); this_sg_len = sg_dma_len(sg); - trb_buff_len = TRB_MAX_BUFF_SIZE - (addr & (TRB_MAX_BUFF_SIZE - 1)); + trb_buff_len = TRB_MAX_BUFF_SIZE - + (addr & ((1 << TRB_MAX_BUFF_SHIFT) - 1)); trb_buff_len = min_t(int, trb_buff_len, this_sg_len); if (trb_buff_len > urb->transfer_buffer_length) trb_buff_len = urb->transfer_buffer_length; @@ -2577,7 +2572,7 @@ static int queue_bulk_sg_tx(struct xhci_hcd *xhci, gfp_t mem_flags, (unsigned int) (addr + TRB_MAX_BUFF_SIZE) & ~(TRB_MAX_BUFF_SIZE - 1), (unsigned int) addr + trb_buff_len); if (TRB_MAX_BUFF_SIZE - - (addr & (TRB_MAX_BUFF_SIZE - 1)) < trb_buff_len) { + (addr & ((1 << TRB_MAX_BUFF_SHIFT) - 1)) < trb_buff_len) { xhci_warn(xhci, "WARN: sg dma xfer crosses 64KB boundaries!\n"); xhci_dbg(xhci, "Next boundary at %#x, end dma = %#x\n", (unsigned int) (addr + TRB_MAX_BUFF_SIZE) & ~(TRB_MAX_BUFF_SIZE - 1), @@ -2621,7 +2616,7 @@ static int queue_bulk_sg_tx(struct xhci_hcd *xhci, gfp_t mem_flags, } trb_buff_len = TRB_MAX_BUFF_SIZE - - (addr & (TRB_MAX_BUFF_SIZE - 1)); + (addr & ((1 << TRB_MAX_BUFF_SHIFT) - 1)); trb_buff_len = min_t(int, trb_buff_len, this_sg_len); if (running_total + trb_buff_len > urb->transfer_buffer_length) trb_buff_len = @@ -2661,8 +2656,7 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags, num_trbs = 0; /* How much data is (potentially) left before the 64KB boundary? */ running_total = TRB_MAX_BUFF_SIZE - - (urb->transfer_dma & (TRB_MAX_BUFF_SIZE - 1)); - running_total &= TRB_MAX_BUFF_SIZE - 1; + (urb->transfer_dma & ((1 << TRB_MAX_BUFF_SHIFT) - 1)); /* If there's some data on this 64KB chunk, or we have to send a * zero-length transfer, we need at least one TRB @@ -2706,8 +2700,8 @@ int xhci_queue_bulk_tx(struct xhci_hcd *xhci, gfp_t mem_flags, /* How much data is in the first TRB? */ addr = (u64) urb->transfer_dma; trb_buff_len = TRB_MAX_BUFF_SIZE - - (urb->transfer_dma & (TRB_MAX_BUFF_SIZE - 1)); - if (trb_buff_len > urb->transfer_buffer_length) + (urb->transfer_dma & ((1 << TRB_MAX_BUFF_SHIFT) - 1)); + if (urb->transfer_buffer_length < trb_buff_len) trb_buff_len = urb->transfer_buffer_length; first_trb = true; @@ -2885,8 +2879,8 @@ static int count_isoc_trbs_needed(struct xhci_hcd *xhci, addr = (u64) (urb->transfer_dma + urb->iso_frame_desc[i].offset); td_len = urb->iso_frame_desc[i].length; - running_total = TRB_MAX_BUFF_SIZE - (addr & (TRB_MAX_BUFF_SIZE - 1)); - running_total &= TRB_MAX_BUFF_SIZE - 1; + running_total = TRB_MAX_BUFF_SIZE - + (addr & ((1 << TRB_MAX_BUFF_SHIFT) - 1)); if (running_total != 0) num_trbs++; diff --git a/trunk/drivers/usb/host/xhci.c b/trunk/drivers/usb/host/xhci.c index 2083fc2179b2..34cf4e165877 100644 --- a/trunk/drivers/usb/host/xhci.c +++ b/trunk/drivers/usb/host/xhci.c @@ -109,7 +109,7 @@ int xhci_halt(struct xhci_hcd *xhci) /* * Set the run bit and wait for the host to be running. */ -static int xhci_start(struct xhci_hcd *xhci) +int xhci_start(struct xhci_hcd *xhci) { u32 temp; int ret; @@ -329,7 +329,7 @@ int xhci_init(struct usb_hcd *hcd) #ifdef CONFIG_USB_XHCI_HCD_DEBUGGING -static void xhci_event_ring_work(unsigned long arg) +void xhci_event_ring_work(unsigned long arg) { unsigned long flags; int temp; @@ -473,7 +473,7 @@ int xhci_run(struct usb_hcd *hcd) xhci->ir_set, (unsigned int) ER_IRQ_ENABLE(temp)); xhci_writel(xhci, ER_IRQ_ENABLE(temp), &xhci->ir_set->irq_pending); - xhci_print_ir_set(xhci, 0); + xhci_print_ir_set(xhci, xhci->ir_set, 0); if (NUM_TEST_NOOPS > 0) doorbell = xhci_setup_one_noop(xhci); @@ -528,7 +528,7 @@ void xhci_stop(struct usb_hcd *hcd) temp = xhci_readl(xhci, &xhci->ir_set->irq_pending); xhci_writel(xhci, ER_IRQ_DISABLE(temp), &xhci->ir_set->irq_pending); - xhci_print_ir_set(xhci, 0); + xhci_print_ir_set(xhci, xhci->ir_set, 0); xhci_dbg(xhci, "cleaning up memory\n"); xhci_mem_cleanup(xhci); @@ -755,7 +755,7 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) temp = xhci_readl(xhci, &xhci->ir_set->irq_pending); xhci_writel(xhci, ER_IRQ_DISABLE(temp), &xhci->ir_set->irq_pending); - xhci_print_ir_set(xhci, 0); + xhci_print_ir_set(xhci, xhci->ir_set, 0); xhci_dbg(xhci, "cleaning up memory\n"); xhci_mem_cleanup(xhci); @@ -857,7 +857,7 @@ unsigned int xhci_last_valid_endpoint(u32 added_ctxs) /* Returns 1 if the arguments are OK; * returns 0 this is a root hub; returns -EINVAL for NULL pointers. */ -static int xhci_check_args(struct usb_hcd *hcd, struct usb_device *udev, +int xhci_check_args(struct usb_hcd *hcd, struct usb_device *udev, struct usb_host_endpoint *ep, int check_ep, bool check_virt_dev, const char *func) { struct xhci_hcd *xhci; @@ -1693,7 +1693,7 @@ static void xhci_setup_input_ctx_for_config_ep(struct xhci_hcd *xhci, xhci_dbg_ctx(xhci, in_ctx, xhci_last_valid_endpoint(add_flags)); } -static void xhci_setup_input_ctx_for_quirk(struct xhci_hcd *xhci, +void xhci_setup_input_ctx_for_quirk(struct xhci_hcd *xhci, unsigned int slot_id, unsigned int ep_index, struct xhci_dequeue_state *deq_state) { diff --git a/trunk/drivers/usb/host/xhci.h b/trunk/drivers/usb/host/xhci.h index 7f127df6dd55..7f236fd22015 100644 --- a/trunk/drivers/usb/host/xhci.h +++ b/trunk/drivers/usb/host/xhci.h @@ -1348,7 +1348,7 @@ static inline int xhci_link_trb_quirk(struct xhci_hcd *xhci) } /* xHCI debugging */ -void xhci_print_ir_set(struct xhci_hcd *xhci, int set_num); +void xhci_print_ir_set(struct xhci_hcd *xhci, struct xhci_intr_reg *ir_set, int set_num); void xhci_print_registers(struct xhci_hcd *xhci); void xhci_dbg_regs(struct xhci_hcd *xhci); void xhci_print_run_regs(struct xhci_hcd *xhci); diff --git a/trunk/drivers/usb/musb/musb_core.c b/trunk/drivers/usb/musb/musb_core.c index c292d5c499e7..54a8bd1047d6 100644 --- a/trunk/drivers/usb/musb/musb_core.c +++ b/trunk/drivers/usb/musb/musb_core.c @@ -1864,7 +1864,6 @@ allocate_instance(struct device *dev, INIT_LIST_HEAD(&musb->out_bulk); hcd->uses_new_polling = 1; - hcd->has_tt = 1; musb->vbuserr_retry = VBUSERR_RETRY_COUNT; musb->a_wait_bcon = OTG_TIME_A_WAIT_BCON; diff --git a/trunk/fs/afs/write.c b/trunk/fs/afs/write.c index 789b3afb3423..15690bb1d3b5 100644 --- a/trunk/fs/afs/write.c +++ b/trunk/fs/afs/write.c @@ -140,7 +140,6 @@ int afs_write_begin(struct file *file, struct address_space *mapping, candidate->first = candidate->last = index; candidate->offset_first = from; candidate->to_last = to; - INIT_LIST_HEAD(&candidate->link); candidate->usage = 1; candidate->state = AFS_WBACK_PENDING; init_waitqueue_head(&candidate->waitq); diff --git a/trunk/fs/aio.c b/trunk/fs/aio.c index 26869cde3953..fc557a3be0a9 100644 --- a/trunk/fs/aio.c +++ b/trunk/fs/aio.c @@ -239,23 +239,15 @@ static void __put_ioctx(struct kioctx *ctx) call_rcu(&ctx->rcu_head, ctx_rcu_free); } -static inline void get_ioctx(struct kioctx *kioctx) -{ - BUG_ON(atomic_read(&kioctx->users) <= 0); - atomic_inc(&kioctx->users); -} - -static inline int try_get_ioctx(struct kioctx *kioctx) -{ - return atomic_inc_not_zero(&kioctx->users); -} - -static inline void put_ioctx(struct kioctx *kioctx) -{ - BUG_ON(atomic_read(&kioctx->users) <= 0); - if (unlikely(atomic_dec_and_test(&kioctx->users))) - __put_ioctx(kioctx); -} +#define get_ioctx(kioctx) do { \ + BUG_ON(atomic_read(&(kioctx)->users) <= 0); \ + atomic_inc(&(kioctx)->users); \ +} while (0) +#define put_ioctx(kioctx) do { \ + BUG_ON(atomic_read(&(kioctx)->users) <= 0); \ + if (unlikely(atomic_dec_and_test(&(kioctx)->users))) \ + __put_ioctx(kioctx); \ +} while (0) /* ioctx_alloc * Allocates and initializes an ioctx. Returns an ERR_PTR if it failed. @@ -609,13 +601,8 @@ static struct kioctx *lookup_ioctx(unsigned long ctx_id) rcu_read_lock(); hlist_for_each_entry_rcu(ctx, n, &mm->ioctx_list, list) { - /* - * RCU protects us against accessing freed memory but - * we have to be careful not to get a reference when the - * reference count already dropped to 0 (ctx->dead test - * is unreliable because of races). - */ - if (ctx->user_id == ctx_id && !ctx->dead && try_get_ioctx(ctx)){ + if (ctx->user_id == ctx_id && !ctx->dead) { + get_ioctx(ctx); ret = ctx; break; } @@ -1642,23 +1629,6 @@ static int io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb, goto out_put_req; spin_lock_irq(&ctx->ctx_lock); - /* - * We could have raced with io_destroy() and are currently holding a - * reference to ctx which should be destroyed. We cannot submit IO - * since ctx gets freed as soon as io_submit() puts its reference. The - * check here is reliable: io_destroy() sets ctx->dead before waiting - * for outstanding IO and the barrier between these two is realized by - * unlock of mm->ioctx_lock and lock of ctx->ctx_lock. Analogously we - * increment ctx->reqs_active before checking for ctx->dead and the - * barrier is realized by unlock and lock of ctx->ctx_lock. Thus if we - * don't see ctx->dead set here, io_destroy() waits for our IO to - * finish. - */ - if (ctx->dead) { - spin_unlock_irq(&ctx->ctx_lock); - ret = -EINVAL; - goto out_put_req; - } aio_run_iocb(req); if (!list_empty(&ctx->run_list)) { /* drain the run list */ diff --git a/trunk/fs/block_dev.c b/trunk/fs/block_dev.c index 889287019599..4fb8a3431531 100644 --- a/trunk/fs/block_dev.c +++ b/trunk/fs/block_dev.c @@ -873,11 +873,6 @@ int bd_link_disk_holder(struct block_device *bdev, struct gendisk *disk) ret = add_symlink(bdev->bd_part->holder_dir, &disk_to_dev(disk)->kobj); if (ret) goto out_del; - /* - * bdev could be deleted beneath us which would implicitly destroy - * the holder directory. Hold on to it. - */ - kobject_get(bdev->bd_part->holder_dir); list_add(&holder->list, &bdev->bd_holder_disks); goto out_unlock; @@ -914,7 +909,6 @@ void bd_unlink_disk_holder(struct block_device *bdev, struct gendisk *disk) del_symlink(disk->slave_dir, &part_to_dev(bdev->bd_part)->kobj); del_symlink(bdev->bd_part->holder_dir, &disk_to_dev(disk)->kobj); - kobject_put(bdev->bd_part->holder_dir); list_del_init(&holder->list); kfree(holder); } @@ -928,15 +922,14 @@ EXPORT_SYMBOL_GPL(bd_unlink_disk_holder); * flush_disk - invalidates all buffer-cache entries on a disk * * @bdev: struct block device to be flushed - * @kill_dirty: flag to guide handling of dirty inodes * * Invalidates all buffer-cache entries on a disk. It should be called * when a disk has been changed -- either by a media change or online * resize. */ -static void flush_disk(struct block_device *bdev, bool kill_dirty) +static void flush_disk(struct block_device *bdev) { - if (__invalidate_device(bdev, kill_dirty)) { + if (__invalidate_device(bdev)) { char name[BDEVNAME_SIZE] = ""; if (bdev->bd_disk) @@ -973,7 +966,7 @@ void check_disk_size_change(struct gendisk *disk, struct block_device *bdev) "%s: detected capacity change from %lld to %lld\n", name, bdev_size, disk_size); i_size_write(bdev->bd_inode, disk_size); - flush_disk(bdev, false); + flush_disk(bdev); } } EXPORT_SYMBOL(check_disk_size_change); @@ -1026,7 +1019,7 @@ int check_disk_change(struct block_device *bdev) if (!(events & DISK_EVENT_MEDIA_CHANGE)) return 0; - flush_disk(bdev, true); + flush_disk(bdev); if (bdops->revalidate_disk) bdops->revalidate_disk(bdev->bd_disk); return 1; @@ -1607,7 +1600,7 @@ struct block_device *lookup_bdev(const char *pathname) } EXPORT_SYMBOL(lookup_bdev); -int __invalidate_device(struct block_device *bdev, bool kill_dirty) +int __invalidate_device(struct block_device *bdev) { struct super_block *sb = get_super(bdev); int res = 0; @@ -1620,7 +1613,7 @@ int __invalidate_device(struct block_device *bdev, bool kill_dirty) * hold). */ shrink_dcache_sb(sb); - res = invalidate_inodes(sb, kill_dirty); + res = invalidate_inodes(sb); drop_super(sb); } invalidate_bdev(bdev); diff --git a/trunk/fs/btrfs/ctree.h b/trunk/fs/btrfs/ctree.h index 6f820fa23df4..2c98b3af6052 100644 --- a/trunk/fs/btrfs/ctree.h +++ b/trunk/fs/btrfs/ctree.h @@ -1254,7 +1254,6 @@ struct btrfs_root { #define BTRFS_MOUNT_SPACE_CACHE (1 << 12) #define BTRFS_MOUNT_CLEAR_CACHE (1 << 13) #define BTRFS_MOUNT_USER_SUBVOL_RM_ALLOWED (1 << 14) -#define BTRFS_MOUNT_ENOSPC_DEBUG (1 << 15) #define btrfs_clear_opt(o, opt) ((o) &= ~BTRFS_MOUNT_##opt) #define btrfs_set_opt(o, opt) ((o) |= BTRFS_MOUNT_##opt) @@ -2219,8 +2218,6 @@ int btrfs_error_unpin_extent_range(struct btrfs_root *root, u64 start, u64 end); int btrfs_error_discard_extent(struct btrfs_root *root, u64 bytenr, u64 num_bytes); -int btrfs_force_chunk_alloc(struct btrfs_trans_handle *trans, - struct btrfs_root *root, u64 type); /* ctree.c */ int btrfs_bin_search(struct extent_buffer *eb, struct btrfs_key *key, diff --git a/trunk/fs/btrfs/extent-tree.c b/trunk/fs/btrfs/extent-tree.c index 588ff9849873..f3c96fc01439 100644 --- a/trunk/fs/btrfs/extent-tree.c +++ b/trunk/fs/btrfs/extent-tree.c @@ -5376,7 +5376,7 @@ int btrfs_reserve_extent(struct btrfs_trans_handle *trans, num_bytes, data, 1); goto again; } - if (ret == -ENOSPC && btrfs_test_opt(root, ENOSPC_DEBUG)) { + if (ret == -ENOSPC) { struct btrfs_space_info *sinfo; sinfo = __find_space_info(root->fs_info, data); @@ -8065,13 +8065,6 @@ int btrfs_set_block_group_ro(struct btrfs_root *root, return ret; } -int btrfs_force_chunk_alloc(struct btrfs_trans_handle *trans, - struct btrfs_root *root, u64 type) -{ - u64 alloc_flags = get_alloc_profile(root, type); - return do_chunk_alloc(trans, root, 2 * 1024 * 1024, alloc_flags, 1); -} - /* * helper to account the unused space of all the readonly block group in the * list. takes mirrors into account. diff --git a/trunk/fs/btrfs/extent_io.c b/trunk/fs/btrfs/extent_io.c index fd3f172e94e6..92ac5192c518 100644 --- a/trunk/fs/btrfs/extent_io.c +++ b/trunk/fs/btrfs/extent_io.c @@ -1433,13 +1433,12 @@ int extent_clear_unlock_delalloc(struct inode *inode, */ u64 count_range_bits(struct extent_io_tree *tree, u64 *start, u64 search_end, u64 max_bytes, - unsigned long bits, int contig) + unsigned long bits) { struct rb_node *node; struct extent_state *state; u64 cur_start = *start; u64 total_bytes = 0; - u64 last = 0; int found = 0; if (search_end <= cur_start) { @@ -1464,9 +1463,7 @@ u64 count_range_bits(struct extent_io_tree *tree, state = rb_entry(node, struct extent_state, rb_node); if (state->start > search_end) break; - if (contig && found && state->start > last + 1) - break; - if (state->end >= cur_start && (state->state & bits) == bits) { + if (state->end >= cur_start && (state->state & bits)) { total_bytes += min(search_end, state->end) + 1 - max(cur_start, state->start); if (total_bytes >= max_bytes) @@ -1475,9 +1472,6 @@ u64 count_range_bits(struct extent_io_tree *tree, *start = state->start; found = 1; } - last = state->end; - } else if (contig && found) { - break; } node = rb_next(node); if (!node) @@ -2918,46 +2912,6 @@ sector_t extent_bmap(struct address_space *mapping, sector_t iblock, return sector; } -/* - * helper function for fiemap, which doesn't want to see any holes. - * This maps until we find something past 'last' - */ -static struct extent_map *get_extent_skip_holes(struct inode *inode, - u64 offset, - u64 last, - get_extent_t *get_extent) -{ - u64 sectorsize = BTRFS_I(inode)->root->sectorsize; - struct extent_map *em; - u64 len; - - if (offset >= last) - return NULL; - - while(1) { - len = last - offset; - if (len == 0) - break; - len = (len + sectorsize - 1) & ~(sectorsize - 1); - em = get_extent(inode, NULL, 0, offset, len, 0); - if (!em || IS_ERR(em)) - return em; - - /* if this isn't a hole return it */ - if (!test_bit(EXTENT_FLAG_VACANCY, &em->flags) && - em->block_start != EXTENT_MAP_HOLE) { - return em; - } - - /* this is a hole, advance to the next extent */ - offset = extent_map_end(em); - free_extent_map(em); - if (offset >= last) - break; - } - return NULL; -} - int extent_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, __u64 start, __u64 len, get_extent_t *get_extent) { @@ -2967,19 +2921,16 @@ int extent_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, u32 flags = 0; u32 found_type; u64 last; - u64 last_for_get_extent = 0; u64 disko = 0; - u64 isize = i_size_read(inode); struct btrfs_key found_key; struct extent_map *em = NULL; struct extent_state *cached_state = NULL; struct btrfs_path *path; struct btrfs_file_extent_item *item; int end = 0; - u64 em_start = 0; - u64 em_len = 0; - u64 em_end = 0; + u64 em_start = 0, em_len = 0; unsigned long emflags; + int hole = 0; if (len == 0) return -EINVAL; @@ -2989,10 +2940,6 @@ int extent_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, return -ENOMEM; path->leave_spinning = 1; - /* - * lookup the last file extent. We're not using i_size here - * because there might be preallocation past i_size - */ ret = btrfs_lookup_file_extent(NULL, BTRFS_I(inode)->root, path, inode->i_ino, -1, 0); if (ret < 0) { @@ -3006,38 +2953,18 @@ int extent_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, btrfs_item_key_to_cpu(path->nodes[0], &found_key, path->slots[0]); found_type = btrfs_key_type(&found_key); - /* No extents, but there might be delalloc bits */ + /* No extents, just return */ if (found_key.objectid != inode->i_ino || found_type != BTRFS_EXTENT_DATA_KEY) { - /* have to trust i_size as the end */ - last = (u64)-1; - last_for_get_extent = isize; - } else { - /* - * remember the start of the last extent. There are a - * bunch of different factors that go into the length of the - * extent, so its much less complex to remember where it started - */ - last = found_key.offset; - last_for_get_extent = last + 1; + btrfs_free_path(path); + return 0; } + last = found_key.offset; btrfs_free_path(path); - /* - * we might have some extents allocated but more delalloc past those - * extents. so, we trust isize unless the start of the last extent is - * beyond isize - */ - if (last < isize) { - last = (u64)-1; - last_for_get_extent = isize; - } - lock_extent_bits(&BTRFS_I(inode)->io_tree, start, start + len, 0, &cached_state, GFP_NOFS); - - em = get_extent_skip_holes(inode, off, last_for_get_extent, - get_extent); + em = get_extent(inode, NULL, 0, off, max - off, 0); if (!em) goto out; if (IS_ERR(em)) { @@ -3046,14 +2973,19 @@ int extent_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, } while (!end) { - off = extent_map_end(em); + hole = 0; + off = em->start + em->len; if (off >= max) end = 1; + if (em->block_start == EXTENT_MAP_HOLE) { + hole = 1; + goto next; + } + em_start = em->start; em_len = em->len; - em_end = extent_map_end(em); - emflags = em->flags; + disko = 0; flags = 0; @@ -3072,29 +3004,37 @@ int extent_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, if (test_bit(EXTENT_FLAG_COMPRESSED, &em->flags)) flags |= FIEMAP_EXTENT_ENCODED; +next: + emflags = em->flags; free_extent_map(em); em = NULL; - if ((em_start >= last) || em_len == (u64)-1 || - (last == (u64)-1 && isize <= em_end)) { + if (!end) { + em = get_extent(inode, NULL, 0, off, max - off, 0); + if (!em) + goto out; + if (IS_ERR(em)) { + ret = PTR_ERR(em); + goto out; + } + emflags = em->flags; + } + + if (test_bit(EXTENT_FLAG_VACANCY, &emflags)) { flags |= FIEMAP_EXTENT_LAST; end = 1; } - /* now scan forward to see if this is really the last extent. */ - em = get_extent_skip_holes(inode, off, last_for_get_extent, - get_extent); - if (IS_ERR(em)) { - ret = PTR_ERR(em); - goto out; - } - if (!em) { + if (em_start == last) { flags |= FIEMAP_EXTENT_LAST; end = 1; } - ret = fiemap_fill_next_extent(fieinfo, em_start, disko, - em_len, flags); - if (ret) - goto out_free; + + if (!hole) { + ret = fiemap_fill_next_extent(fieinfo, em_start, disko, + em_len, flags); + if (ret) + goto out_free; + } } out_free: free_extent_map(em); diff --git a/trunk/fs/btrfs/extent_io.h b/trunk/fs/btrfs/extent_io.h index 9318dfefd59c..7083cfafd061 100644 --- a/trunk/fs/btrfs/extent_io.h +++ b/trunk/fs/btrfs/extent_io.h @@ -191,7 +191,7 @@ void extent_io_exit(void); u64 count_range_bits(struct extent_io_tree *tree, u64 *start, u64 search_end, - u64 max_bytes, unsigned long bits, int contig); + u64 max_bytes, unsigned long bits); void free_extent_state(struct extent_state *state); int test_range_bit(struct extent_io_tree *tree, u64 start, u64 end, diff --git a/trunk/fs/btrfs/inode.c b/trunk/fs/btrfs/inode.c index 0efdb65953c5..fb9bd7832b6d 100644 --- a/trunk/fs/btrfs/inode.c +++ b/trunk/fs/btrfs/inode.c @@ -1913,7 +1913,7 @@ static int btrfs_clean_io_failures(struct inode *inode, u64 start) private = 0; if (count_range_bits(&BTRFS_I(inode)->io_failure_tree, &private, - (u64)-1, 1, EXTENT_DIRTY, 0)) { + (u64)-1, 1, EXTENT_DIRTY)) { ret = get_state_private(&BTRFS_I(inode)->io_failure_tree, start, &private_failure); if (ret == 0) { @@ -5280,128 +5280,6 @@ struct extent_map *btrfs_get_extent(struct inode *inode, struct page *page, return em; } -struct extent_map *btrfs_get_extent_fiemap(struct inode *inode, struct page *page, - size_t pg_offset, u64 start, u64 len, - int create) -{ - struct extent_map *em; - struct extent_map *hole_em = NULL; - u64 range_start = start; - u64 end; - u64 found; - u64 found_end; - int err = 0; - - em = btrfs_get_extent(inode, page, pg_offset, start, len, create); - if (IS_ERR(em)) - return em; - if (em) { - /* - * if our em maps to a hole, there might - * actually be delalloc bytes behind it - */ - if (em->block_start != EXTENT_MAP_HOLE) - return em; - else - hole_em = em; - } - - /* check to see if we've wrapped (len == -1 or similar) */ - end = start + len; - if (end < start) - end = (u64)-1; - else - end -= 1; - - em = NULL; - - /* ok, we didn't find anything, lets look for delalloc */ - found = count_range_bits(&BTRFS_I(inode)->io_tree, &range_start, - end, len, EXTENT_DELALLOC, 1); - found_end = range_start + found; - if (found_end < range_start) - found_end = (u64)-1; - - /* - * we didn't find anything useful, return - * the original results from get_extent() - */ - if (range_start > end || found_end <= start) { - em = hole_em; - hole_em = NULL; - goto out; - } - - /* adjust the range_start to make sure it doesn't - * go backwards from the start they passed in - */ - range_start = max(start,range_start); - found = found_end - range_start; - - if (found > 0) { - u64 hole_start = start; - u64 hole_len = len; - - em = alloc_extent_map(GFP_NOFS); - if (!em) { - err = -ENOMEM; - goto out; - } - /* - * when btrfs_get_extent can't find anything it - * returns one huge hole - * - * make sure what it found really fits our range, and - * adjust to make sure it is based on the start from - * the caller - */ - if (hole_em) { - u64 calc_end = extent_map_end(hole_em); - - if (calc_end <= start || (hole_em->start > end)) { - free_extent_map(hole_em); - hole_em = NULL; - } else { - hole_start = max(hole_em->start, start); - hole_len = calc_end - hole_start; - } - } - em->bdev = NULL; - if (hole_em && range_start > hole_start) { - /* our hole starts before our delalloc, so we - * have to return just the parts of the hole - * that go until the delalloc starts - */ - em->len = min(hole_len, - range_start - hole_start); - em->start = hole_start; - em->orig_start = hole_start; - /* - * don't adjust block start at all, - * it is fixed at EXTENT_MAP_HOLE - */ - em->block_start = hole_em->block_start; - em->block_len = hole_len; - } else { - em->start = range_start; - em->len = found; - em->orig_start = range_start; - em->block_start = EXTENT_MAP_DELALLOC; - em->block_len = found; - } - } else if (hole_em) { - return hole_em; - } -out: - - free_extent_map(hole_em); - if (err) { - free_extent_map(em); - return ERR_PTR(err); - } - return em; -} - static struct extent_map *btrfs_new_extent_direct(struct inode *inode, u64 start, u64 len) { @@ -6224,7 +6102,7 @@ static ssize_t btrfs_direct_IO(int rw, struct kiocb *iocb, static int btrfs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, __u64 start, __u64 len) { - return extent_fiemap(inode, fieinfo, start, len, btrfs_get_extent_fiemap); + return extent_fiemap(inode, fieinfo, start, len, btrfs_get_extent); } int btrfs_readpage(struct file *file, struct page *page) diff --git a/trunk/fs/btrfs/ioctl.c b/trunk/fs/btrfs/ioctl.c index 5fdb2abc4fa7..be2d4f6aaa5e 100644 --- a/trunk/fs/btrfs/ioctl.c +++ b/trunk/fs/btrfs/ioctl.c @@ -1071,15 +1071,12 @@ static noinline int btrfs_ioctl_subvol_setflags(struct file *file, if (copy_from_user(&flags, arg, sizeof(flags))) return -EFAULT; - if (flags & BTRFS_SUBVOL_CREATE_ASYNC) + if (flags & ~BTRFS_SUBVOL_CREATE_ASYNC) return -EINVAL; if (flags & ~BTRFS_SUBVOL_RDONLY) return -EOPNOTSUPP; - if (!is_owner_or_cap(inode)) - return -EACCES; - down_write(&root->fs_info->subvol_sem); /* nothing to do */ @@ -1100,7 +1097,7 @@ static noinline int btrfs_ioctl_subvol_setflags(struct file *file, goto out_reset; } - ret = btrfs_update_root(trans, root->fs_info->tree_root, + ret = btrfs_update_root(trans, root, &root->root_key, &root->root_item); btrfs_commit_transaction(trans, root); diff --git a/trunk/fs/btrfs/lzo.c b/trunk/fs/btrfs/lzo.c index a178f5ebea78..cc9b450399df 100644 --- a/trunk/fs/btrfs/lzo.c +++ b/trunk/fs/btrfs/lzo.c @@ -280,7 +280,6 @@ static int lzo_decompress_biovec(struct list_head *ws, unsigned long tot_out; unsigned long tot_len; char *buf; - bool may_late_unmap, need_unmap; data_in = kmap(pages_in[0]); tot_len = read_compress_length(data_in); @@ -301,13 +300,11 @@ static int lzo_decompress_biovec(struct list_head *ws, tot_in += in_len; working_bytes = in_len; - may_late_unmap = need_unmap = false; /* fast path: avoid using the working buffer */ if (in_page_bytes_left >= in_len) { buf = data_in + in_offset; bytes = in_len; - may_late_unmap = true; goto cont; } @@ -332,17 +329,14 @@ static int lzo_decompress_biovec(struct list_head *ws, if (working_bytes == 0 && tot_in >= tot_len) break; - if (page_in_index + 1 >= total_pages_in) { + kunmap(pages_in[page_in_index]); + page_in_index++; + if (page_in_index >= total_pages_in) { ret = -1; + data_in = NULL; goto done; } - - if (may_late_unmap) - need_unmap = true; - else - kunmap(pages_in[page_in_index]); - - data_in = kmap(pages_in[++page_in_index]); + data_in = kmap(pages_in[page_in_index]); in_page_bytes_left = PAGE_CACHE_SIZE; in_offset = 0; @@ -352,8 +346,6 @@ static int lzo_decompress_biovec(struct list_head *ws, out_len = lzo1x_worst_compress(PAGE_CACHE_SIZE); ret = lzo1x_decompress_safe(buf, in_len, workspace->buf, &out_len); - if (need_unmap) - kunmap(pages_in[page_in_index - 1]); if (ret != LZO_E_OK) { printk(KERN_WARNING "btrfs decompress failed\n"); ret = -1; @@ -371,7 +363,8 @@ static int lzo_decompress_biovec(struct list_head *ws, break; } done: - kunmap(pages_in[page_in_index]); + if (data_in) + kunmap(pages_in[page_in_index]); return ret; } diff --git a/trunk/fs/btrfs/relocation.c b/trunk/fs/btrfs/relocation.c index 31ade5802ae8..0825e4ed9447 100644 --- a/trunk/fs/btrfs/relocation.c +++ b/trunk/fs/btrfs/relocation.c @@ -3654,7 +3654,6 @@ static noinline_for_stack int relocate_block_group(struct reloc_control *rc) u32 item_size; int ret; int err = 0; - int progress = 0; path = btrfs_alloc_path(); if (!path) @@ -3667,10 +3666,9 @@ static noinline_for_stack int relocate_block_group(struct reloc_control *rc) } while (1) { - progress++; trans = btrfs_start_transaction(rc->extent_root, 0); BUG_ON(IS_ERR(trans)); -restart: + if (update_backref_cache(trans, &rc->backref_cache)) { btrfs_end_transaction(trans, rc->extent_root); continue; @@ -3783,15 +3781,6 @@ static noinline_for_stack int relocate_block_group(struct reloc_control *rc) } } } - if (trans && progress && err == -ENOSPC) { - ret = btrfs_force_chunk_alloc(trans, rc->extent_root, - rc->block_group->flags); - if (ret == 0) { - err = 0; - progress = 0; - goto restart; - } - } btrfs_release_path(rc->extent_root, path); clear_extent_bits(&rc->processed_blocks, 0, (u64)-1, EXTENT_DIRTY, diff --git a/trunk/fs/btrfs/super.c b/trunk/fs/btrfs/super.c index d39a9895d932..a004008f7d28 100644 --- a/trunk/fs/btrfs/super.c +++ b/trunk/fs/btrfs/super.c @@ -155,8 +155,7 @@ enum { Opt_nossd, Opt_ssd_spread, Opt_thread_pool, Opt_noacl, Opt_compress, Opt_compress_type, Opt_compress_force, Opt_compress_force_type, Opt_notreelog, Opt_ratio, Opt_flushoncommit, Opt_discard, - Opt_space_cache, Opt_clear_cache, Opt_user_subvol_rm_allowed, - Opt_enospc_debug, Opt_err, + Opt_space_cache, Opt_clear_cache, Opt_user_subvol_rm_allowed, Opt_err, }; static match_table_t tokens = { @@ -185,7 +184,6 @@ static match_table_t tokens = { {Opt_space_cache, "space_cache"}, {Opt_clear_cache, "clear_cache"}, {Opt_user_subvol_rm_allowed, "user_subvol_rm_allowed"}, - {Opt_enospc_debug, "enospc_debug"}, {Opt_err, NULL}, }; @@ -360,9 +358,6 @@ int btrfs_parse_options(struct btrfs_root *root, char *options) case Opt_user_subvol_rm_allowed: btrfs_set_opt(info->mount_opt, USER_SUBVOL_RM_ALLOWED); break; - case Opt_enospc_debug: - btrfs_set_opt(info->mount_opt, ENOSPC_DEBUG); - break; case Opt_err: printk(KERN_INFO "btrfs: unrecognized mount option " "'%s'\n", p); diff --git a/trunk/fs/btrfs/volumes.c b/trunk/fs/btrfs/volumes.c index dd13eb81ee40..af7dbca15276 100644 --- a/trunk/fs/btrfs/volumes.c +++ b/trunk/fs/btrfs/volumes.c @@ -1338,11 +1338,11 @@ int btrfs_rm_device(struct btrfs_root *root, char *device_path) ret = btrfs_shrink_device(device, 0); if (ret) - goto error_undo; + goto error_brelse; ret = btrfs_rm_dev_item(root->fs_info->chunk_root, device); if (ret) - goto error_undo; + goto error_brelse; device->in_fs_metadata = 0; @@ -1416,13 +1416,6 @@ int btrfs_rm_device(struct btrfs_root *root, char *device_path) mutex_unlock(&root->fs_info->volume_mutex); mutex_unlock(&uuid_mutex); return ret; -error_undo: - if (device->writeable) { - list_add(&device->dev_alloc_list, - &root->fs_info->fs_devices->alloc_list); - root->fs_info->fs_devices->rw_devices++; - } - goto error_brelse; } /* @@ -1640,7 +1633,7 @@ int btrfs_init_new_device(struct btrfs_root *root, char *device_path) device->dev_root = root->fs_info->dev_root; device->bdev = bdev; device->in_fs_metadata = 1; - device->mode = FMODE_EXCL; + device->mode = 0; set_blocksize(device->bdev, 4096); if (seeding_dev) { diff --git a/trunk/fs/eventpoll.c b/trunk/fs/eventpoll.c index 4a09af9e9a63..267d0ada4541 100644 --- a/trunk/fs/eventpoll.c +++ b/trunk/fs/eventpoll.c @@ -63,13 +63,6 @@ * cleanup path and it is also acquired by eventpoll_release_file() * if a file has been pushed inside an epoll set and it is then * close()d without a previous call toepoll_ctl(EPOLL_CTL_DEL). - * It is also acquired when inserting an epoll fd onto another epoll - * fd. We do this so that we walk the epoll tree and ensure that this - * insertion does not create a cycle of epoll file descriptors, which - * could lead to deadlock. We need a global mutex to prevent two - * simultaneous inserts (A into B and B into A) from racing and - * constructing a cycle without either insert observing that it is - * going to. * It is possible to drop the "ep->mtx" and to use the global * mutex "epmutex" (together with "ep->lock") to have it working, * but having "ep->mtx" will make the interface more scalable. @@ -231,9 +224,6 @@ static long max_user_watches __read_mostly; */ static DEFINE_MUTEX(epmutex); -/* Used to check for epoll file descriptor inclusion loops */ -static struct nested_calls poll_loop_ncalls; - /* Used for safe wake up implementation */ static struct nested_calls poll_safewake_ncalls; @@ -1208,62 +1198,6 @@ static int ep_poll(struct eventpoll *ep, struct epoll_event __user *events, return res; } -/** - * ep_loop_check_proc - Callback function to be passed to the @ep_call_nested() - * API, to verify that adding an epoll file inside another - * epoll structure, does not violate the constraints, in - * terms of closed loops, or too deep chains (which can - * result in excessive stack usage). - * - * @priv: Pointer to the epoll file to be currently checked. - * @cookie: Original cookie for this call. This is the top-of-the-chain epoll - * data structure pointer. - * @call_nests: Current dept of the @ep_call_nested() call stack. - * - * Returns: Returns zero if adding the epoll @file inside current epoll - * structure @ep does not violate the constraints, or -1 otherwise. - */ -static int ep_loop_check_proc(void *priv, void *cookie, int call_nests) -{ - int error = 0; - struct file *file = priv; - struct eventpoll *ep = file->private_data; - struct rb_node *rbp; - struct epitem *epi; - - mutex_lock(&ep->mtx); - for (rbp = rb_first(&ep->rbr); rbp; rbp = rb_next(rbp)) { - epi = rb_entry(rbp, struct epitem, rbn); - if (unlikely(is_file_epoll(epi->ffd.file))) { - error = ep_call_nested(&poll_loop_ncalls, EP_MAX_NESTS, - ep_loop_check_proc, epi->ffd.file, - epi->ffd.file->private_data, current); - if (error != 0) - break; - } - } - mutex_unlock(&ep->mtx); - - return error; -} - -/** - * ep_loop_check - Performs a check to verify that adding an epoll file (@file) - * another epoll file (represented by @ep) does not create - * closed loops or too deep chains. - * - * @ep: Pointer to the epoll private data structure. - * @file: Pointer to the epoll file to be checked. - * - * Returns: Returns zero if adding the epoll @file inside current epoll - * structure @ep does not violate the constraints, or -1 otherwise. - */ -static int ep_loop_check(struct eventpoll *ep, struct file *file) -{ - return ep_call_nested(&poll_loop_ncalls, EP_MAX_NESTS, - ep_loop_check_proc, file, ep, current); -} - /* * Open an eventpoll file descriptor. */ @@ -1312,7 +1246,6 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd, struct epoll_event __user *, event) { int error; - int did_lock_epmutex = 0; struct file *file, *tfile; struct eventpoll *ep; struct epitem *epi; @@ -1354,25 +1287,6 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd, */ ep = file->private_data; - /* - * When we insert an epoll file descriptor, inside another epoll file - * descriptor, there is the change of creating closed loops, which are - * better be handled here, than in more critical paths. - * - * We hold epmutex across the loop check and the insert in this case, in - * order to prevent two separate inserts from racing and each doing the - * insert "at the same time" such that ep_loop_check passes on both - * before either one does the insert, thereby creating a cycle. - */ - if (unlikely(is_file_epoll(tfile) && op == EPOLL_CTL_ADD)) { - mutex_lock(&epmutex); - did_lock_epmutex = 1; - error = -ELOOP; - if (ep_loop_check(ep, tfile) != 0) - goto error_tgt_fput; - } - - mutex_lock(&ep->mtx); /* @@ -1408,9 +1322,6 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd, mutex_unlock(&ep->mtx); error_tgt_fput: - if (unlikely(did_lock_epmutex)) - mutex_unlock(&epmutex); - fput(tfile); error_fput: fput(file); @@ -1530,12 +1441,6 @@ static int __init eventpoll_init(void) EP_ITEM_COST; BUG_ON(max_user_watches < 0); - /* - * Initialize the structure used to perform epoll file descriptor - * inclusion loops checks. - */ - ep_nested_calls_init(&poll_loop_ncalls); - /* Initialize the structure used to perform safe poll wait head wake ups */ ep_nested_calls_init(&poll_safewake_ncalls); diff --git a/trunk/fs/fuse/dir.c b/trunk/fs/fuse/dir.c index 83543b5ff941..bfed8447ed80 100644 --- a/trunk/fs/fuse/dir.c +++ b/trunk/fs/fuse/dir.c @@ -1283,11 +1283,8 @@ static int fuse_do_setattr(struct dentry *entry, struct iattr *attr, if (err) return err; - if (attr->ia_valid & ATTR_OPEN) { - if (fc->atomic_o_trunc) - return 0; - file = NULL; - } + if ((attr->ia_valid & ATTR_OPEN) && fc->atomic_o_trunc) + return 0; if (attr->ia_valid & ATTR_SIZE) is_truncate = true; diff --git a/trunk/fs/fuse/file.c b/trunk/fs/fuse/file.c index 9e0832dbb1e3..95da1bc1c826 100644 --- a/trunk/fs/fuse/file.c +++ b/trunk/fs/fuse/file.c @@ -86,52 +86,18 @@ struct fuse_file *fuse_file_get(struct fuse_file *ff) return ff; } -static void fuse_release_async(struct work_struct *work) -{ - struct fuse_req *req; - struct fuse_conn *fc; - struct path path; - - req = container_of(work, struct fuse_req, misc.release.work); - path = req->misc.release.path; - fc = get_fuse_conn(path.dentry->d_inode); - - fuse_put_request(fc, req); - path_put(&path); -} - static void fuse_release_end(struct fuse_conn *fc, struct fuse_req *req) { - if (fc->destroy_req) { - /* - * If this is a fuseblk mount, then it's possible that - * releasing the path will result in releasing the - * super block and sending the DESTROY request. If - * the server is single threaded, this would hang. - * For this reason do the path_put() in a separate - * thread. - */ - atomic_inc(&req->count); - INIT_WORK(&req->misc.release.work, fuse_release_async); - schedule_work(&req->misc.release.work); - } else { - path_put(&req->misc.release.path); - } + path_put(&req->misc.release.path); } -static void fuse_file_put(struct fuse_file *ff, bool sync) +static void fuse_file_put(struct fuse_file *ff) { if (atomic_dec_and_test(&ff->count)) { struct fuse_req *req = ff->reserved_req; - if (sync) { - fuse_request_send(ff->fc, req); - path_put(&req->misc.release.path); - fuse_put_request(ff->fc, req); - } else { - req->end = fuse_release_end; - fuse_request_send_background(ff->fc, req); - } + req->end = fuse_release_end; + fuse_request_send_background(ff->fc, req); kfree(ff); } } @@ -253,12 +219,8 @@ void fuse_release_common(struct file *file, int opcode) * Normally this will send the RELEASE request, however if * some asynchronous READ or WRITE requests are outstanding, * the sending will be delayed. - * - * Make the release synchronous if this is a fuseblk mount, - * synchronous RELEASE is allowed (and desirable) in this case - * because the server can be trusted not to screw up. */ - fuse_file_put(ff, ff->fc->destroy_req != NULL); + fuse_file_put(ff); } static int fuse_open(struct inode *inode, struct file *file) @@ -596,7 +558,7 @@ static void fuse_readpages_end(struct fuse_conn *fc, struct fuse_req *req) page_cache_release(page); } if (req->ff) - fuse_file_put(req->ff, false); + fuse_file_put(req->ff); } static void fuse_send_readpages(struct fuse_req *req, struct file *file) @@ -1175,7 +1137,7 @@ static ssize_t fuse_direct_write(struct file *file, const char __user *buf, static void fuse_writepage_free(struct fuse_conn *fc, struct fuse_req *req) { __free_page(req->pages[0]); - fuse_file_put(req->ff, false); + fuse_file_put(req->ff); } static void fuse_writepage_finish(struct fuse_conn *fc, struct fuse_req *req) diff --git a/trunk/fs/fuse/fuse_i.h b/trunk/fs/fuse/fuse_i.h index d4286947bc2c..ae5744a2f9e9 100644 --- a/trunk/fs/fuse/fuse_i.h +++ b/trunk/fs/fuse/fuse_i.h @@ -21,7 +21,6 @@ #include #include #include -#include /** Max number of pages that can be used in a single read request */ #define FUSE_MAX_PAGES_PER_REQ 32 @@ -263,10 +262,7 @@ struct fuse_req { /** Data for asynchronous requests */ union { struct { - union { - struct fuse_release_in in; - struct work_struct work; - }; + struct fuse_release_in in; struct path path; } release; struct fuse_init_in init_in; diff --git a/trunk/fs/inode.c b/trunk/fs/inode.c index 0647d80accf6..9c2b795ccc93 100644 --- a/trunk/fs/inode.c +++ b/trunk/fs/inode.c @@ -548,14 +548,11 @@ void evict_inodes(struct super_block *sb) /** * invalidate_inodes - attempt to free all inodes on a superblock * @sb: superblock to operate on - * @kill_dirty: flag to guide handling of dirty inodes * * Attempts to free all inodes for a given superblock. If there were any * busy inodes return a non-zero value, else zero. - * If @kill_dirty is set, discard dirty inodes too, otherwise treat - * them as busy. */ -int invalidate_inodes(struct super_block *sb, bool kill_dirty) +int invalidate_inodes(struct super_block *sb) { int busy = 0; struct inode *inode, *next; @@ -567,10 +564,6 @@ int invalidate_inodes(struct super_block *sb, bool kill_dirty) list_for_each_entry_safe(inode, next, &sb->s_inodes, i_sb_list) { if (inode->i_state & (I_NEW | I_FREEING | I_WILL_FREE)) continue; - if (inode->i_state & I_DIRTY && !kill_dirty) { - busy = 1; - continue; - } if (atomic_read(&inode->i_count)) { busy = 1; continue; diff --git a/trunk/fs/internal.h b/trunk/fs/internal.h index 9b976b57d7fe..0663568b1247 100644 --- a/trunk/fs/internal.h +++ b/trunk/fs/internal.h @@ -112,4 +112,4 @@ extern void release_open_intent(struct nameidata *); */ extern int get_nr_dirty_inodes(void); extern void evict_inodes(struct super_block *); -extern int invalidate_inodes(struct super_block *, bool); +extern int invalidate_inodes(struct super_block *); diff --git a/trunk/fs/namespace.c b/trunk/fs/namespace.c index d1edf26025dc..7b0b95371696 100644 --- a/trunk/fs/namespace.c +++ b/trunk/fs/namespace.c @@ -1244,7 +1244,7 @@ static int do_umount(struct vfsmount *mnt, int flags) */ br_write_lock(vfsmount_lock); if (mnt_get_count(mnt) != 2) { - br_write_unlock(vfsmount_lock); + br_write_lock(vfsmount_lock); return -EBUSY; } br_write_unlock(vfsmount_lock); diff --git a/trunk/fs/ocfs2/journal.h b/trunk/fs/ocfs2/journal.h index 6180da1e37e6..43e56b97f9c0 100644 --- a/trunk/fs/ocfs2/journal.h +++ b/trunk/fs/ocfs2/journal.h @@ -405,9 +405,9 @@ static inline int ocfs2_remove_extent_credits(struct super_block *sb) ocfs2_quota_trans_credits(sb); } -/* data block for new dir/symlink, allocation of directory block, dx_root - * update for free list */ -#define OCFS2_DIR_LINK_ADDITIONAL_CREDITS (1 + OCFS2_SUBALLOC_ALLOC + 1) +/* data block for new dir/symlink, 2 for bitmap updates (bitmap fe + + * bitmap block for the new bit) dx_root update for free list */ +#define OCFS2_DIR_LINK_ADDITIONAL_CREDITS (1 + 2 + 1) static inline int ocfs2_add_dir_index_credits(struct super_block *sb) { diff --git a/trunk/fs/ocfs2/refcounttree.c b/trunk/fs/ocfs2/refcounttree.c index 19ebc5aad391..b5f9160e93e9 100644 --- a/trunk/fs/ocfs2/refcounttree.c +++ b/trunk/fs/ocfs2/refcounttree.c @@ -3228,7 +3228,7 @@ static int ocfs2_make_clusters_writable(struct super_block *sb, u32 num_clusters, unsigned int e_flags) { int ret, delete, index, credits = 0; - u32 new_bit, new_len, orig_num_clusters; + u32 new_bit, new_len; unsigned int set_len; struct ocfs2_super *osb = OCFS2_SB(sb); handle_t *handle; @@ -3261,8 +3261,6 @@ static int ocfs2_make_clusters_writable(struct super_block *sb, goto out; } - orig_num_clusters = num_clusters; - while (num_clusters) { ret = ocfs2_get_refcount_rec(ref_ci, context->ref_root_bh, p_cluster, num_clusters, @@ -3350,8 +3348,7 @@ static int ocfs2_make_clusters_writable(struct super_block *sb, * in write-back mode. */ if (context->get_clusters == ocfs2_di_get_clusters) { - ret = ocfs2_cow_sync_writeback(sb, context, cpos, - orig_num_clusters); + ret = ocfs2_cow_sync_writeback(sb, context, cpos, num_clusters); if (ret) mlog_errno(ret); } diff --git a/trunk/fs/ocfs2/super.c b/trunk/fs/ocfs2/super.c index 36c423fb0635..38f986d2447e 100644 --- a/trunk/fs/ocfs2/super.c +++ b/trunk/fs/ocfs2/super.c @@ -1316,7 +1316,7 @@ static int ocfs2_parse_options(struct super_block *sb, struct mount_options *mopt, int is_remount) { - int status, user_stack = 0; + int status; char *p; u32 tmp; @@ -1459,15 +1459,6 @@ static int ocfs2_parse_options(struct super_block *sb, memcpy(mopt->cluster_stack, args[0].from, OCFS2_STACK_LABEL_LEN); mopt->cluster_stack[OCFS2_STACK_LABEL_LEN] = '\0'; - /* - * Open code the memcmp here as we don't have - * an osb to pass to - * ocfs2_userspace_stack(). - */ - if (memcmp(mopt->cluster_stack, - OCFS2_CLASSIC_CLUSTER_STACK, - OCFS2_STACK_LABEL_LEN)) - user_stack = 1; break; case Opt_inode64: mopt->mount_opt |= OCFS2_MOUNT_INODE64; @@ -1523,16 +1514,13 @@ static int ocfs2_parse_options(struct super_block *sb, } } - if (user_stack == 0) { - /* Ensure only one heartbeat mode */ - tmp = mopt->mount_opt & (OCFS2_MOUNT_HB_LOCAL | - OCFS2_MOUNT_HB_GLOBAL | - OCFS2_MOUNT_HB_NONE); - if (hweight32(tmp) != 1) { - mlog(ML_ERROR, "Invalid heartbeat mount options\n"); - status = 0; - goto bail; - } + /* Ensure only one heartbeat mode */ + tmp = mopt->mount_opt & (OCFS2_MOUNT_HB_LOCAL | OCFS2_MOUNT_HB_GLOBAL | + OCFS2_MOUNT_HB_NONE); + if (hweight32(tmp) != 1) { + mlog(ML_ERROR, "Invalid heartbeat mount options\n"); + status = 0; + goto bail; } status = 1; diff --git a/trunk/fs/partitions/ldm.c b/trunk/fs/partitions/ldm.c index b10e3540d5b7..789c625c7aa5 100644 --- a/trunk/fs/partitions/ldm.c +++ b/trunk/fs/partitions/ldm.c @@ -251,11 +251,6 @@ static bool ldm_parse_vmdb (const u8 *data, struct vmdb *vm) } vm->vblk_size = get_unaligned_be32(data + 0x08); - if (vm->vblk_size == 0) { - ldm_error ("Illegal VBLK size"); - return false; - } - vm->vblk_offset = get_unaligned_be32(data + 0x0C); vm->last_vblk_seq = get_unaligned_be32(data + 0x04); diff --git a/trunk/include/asm-generic/pgtable.h b/trunk/include/asm-generic/pgtable.h index b4bfe338ea0e..31b6188df221 100644 --- a/trunk/include/asm-generic/pgtable.h +++ b/trunk/include/asm-generic/pgtable.h @@ -4,8 +4,6 @@ #ifndef __ASSEMBLY__ #ifdef CONFIG_MMU -#include - #ifndef __HAVE_ARCH_PTEP_SET_ACCESS_FLAGS extern int ptep_set_access_flags(struct vm_area_struct *vma, unsigned long address, pte_t *ptep, diff --git a/trunk/include/drm/drmP.h b/trunk/include/drm/drmP.h index 348843b80150..fe29aadb129d 100644 --- a/trunk/include/drm/drmP.h +++ b/trunk/include/drm/drmP.h @@ -1101,7 +1101,7 @@ struct drm_device { struct platform_device *platformdev; /**< Platform device struture */ struct drm_sg_mem *sg; /**< Scatter gather memory */ - unsigned int num_crtcs; /**< Number of CRTCs on this device */ + int num_crtcs; /**< Number of CRTCs on this device */ void *dev_private; /**< device private data */ void *mm_private; struct address_space *dev_mapping; diff --git a/trunk/include/linux/fs.h b/trunk/include/linux/fs.h index e38b50a4b9d2..97d08d8a7de8 100644 --- a/trunk/include/linux/fs.h +++ b/trunk/include/linux/fs.h @@ -2140,7 +2140,7 @@ extern void check_disk_size_change(struct gendisk *disk, struct block_device *bdev); extern int revalidate_disk(struct gendisk *); extern int check_disk_change(struct block_device *); -extern int __invalidate_device(struct block_device *, bool); +extern int __invalidate_device(struct block_device *); extern int invalidate_partition(struct gendisk *, int); #endif unsigned long invalidate_mapping_pages(struct address_space *mapping, diff --git a/trunk/include/linux/pm.h b/trunk/include/linux/pm.h index 21415cc91cbb..dd9c7ab38270 100644 --- a/trunk/include/linux/pm.h +++ b/trunk/include/linux/pm.h @@ -431,8 +431,6 @@ struct dev_pm_info { struct list_head entry; struct completion completion; struct wakeup_source *wakeup; -#else - unsigned int should_wakeup:1; #endif #ifdef CONFIG_PM_RUNTIME struct timer_list suspend_timer; diff --git a/trunk/include/linux/pm_wakeup.h b/trunk/include/linux/pm_wakeup.h index 03a67db03d01..9cff00dd6b63 100644 --- a/trunk/include/linux/pm_wakeup.h +++ b/trunk/include/linux/pm_wakeup.h @@ -109,6 +109,11 @@ static inline bool device_can_wakeup(struct device *dev) return dev->power.can_wakeup; } +static inline bool device_may_wakeup(struct device *dev) +{ + return false; +} + static inline struct wakeup_source *wakeup_source_create(const char *name) { return NULL; @@ -129,32 +134,24 @@ static inline void wakeup_source_unregister(struct wakeup_source *ws) {} static inline int device_wakeup_enable(struct device *dev) { - dev->power.should_wakeup = true; - return 0; + return -EINVAL; } static inline int device_wakeup_disable(struct device *dev) { - dev->power.should_wakeup = false; - return 0; -} - -static inline int device_set_wakeup_enable(struct device *dev, bool enable) -{ - dev->power.should_wakeup = enable; return 0; } static inline int device_init_wakeup(struct device *dev, bool val) { - device_set_wakeup_capable(dev, val); - device_set_wakeup_enable(dev, val); - return 0; + dev->power.can_wakeup = val; + return val ? -EINVAL : 0; } -static inline bool device_may_wakeup(struct device *dev) + +static inline int device_set_wakeup_enable(struct device *dev, bool enable) { - return dev->power.can_wakeup && dev->power.should_wakeup; + return -EINVAL; } static inline void __pm_stay_awake(struct wakeup_source *ws) {} diff --git a/trunk/include/linux/rio_regs.h b/trunk/include/linux/rio_regs.h index 9026b30238f3..d63dcbaea169 100644 --- a/trunk/include/linux/rio_regs.h +++ b/trunk/include/linux/rio_regs.h @@ -14,12 +14,10 @@ #define LINUX_RIO_REGS_H /* - * In RapidIO, each device has a 16MB configuration space that is + * In RapidIO, each device has a 2MB configuration space that is * accessed via maintenance transactions. Portions of configuration * space are standardized and/or reserved. */ -#define RIO_MAINT_SPACE_SZ 0x1000000 /* 16MB of RapidIO mainenance space */ - #define RIO_DEV_ID_CAR 0x00 /* [I] Device Identity CAR */ #define RIO_DEV_INFO_CAR 0x04 /* [I] Device Information CAR */ #define RIO_ASM_ID_CAR 0x08 /* [I] Assembly Identity CAR */ diff --git a/trunk/include/linux/thermal.h b/trunk/include/linux/thermal.h index d3ec89fb4122..8651556dbd52 100644 --- a/trunk/include/linux/thermal.h +++ b/trunk/include/linux/thermal.h @@ -172,14 +172,6 @@ void thermal_zone_device_update(struct thermal_zone_device *); struct thermal_cooling_device *thermal_cooling_device_register(char *, void *, const struct thermal_cooling_device_ops *); void thermal_cooling_device_unregister(struct thermal_cooling_device *); - -#ifdef CONFIG_NET extern int generate_netlink_event(u32 orig, enum events event); -#else -static inline int generate_netlink_event(u32 orig, enum events event) -{ - return 0; -} -#endif #endif /* __THERMAL_H__ */ diff --git a/trunk/kernel/time/tick-broadcast.c b/trunk/kernel/time/tick-broadcast.c index a3b5aff62606..48b2761b5668 100644 --- a/trunk/kernel/time/tick-broadcast.c +++ b/trunk/kernel/time/tick-broadcast.c @@ -600,14 +600,4 @@ int tick_broadcast_oneshot_active(void) return tick_broadcast_device.mode == TICKDEV_MODE_ONESHOT; } -/* - * Check whether the broadcast device supports oneshot. - */ -bool tick_broadcast_oneshot_available(void) -{ - struct clock_event_device *bc = tick_broadcast_device.evtdev; - - return bc ? bc->features & CLOCK_EVT_FEAT_ONESHOT : false; -} - #endif diff --git a/trunk/kernel/time/tick-common.c b/trunk/kernel/time/tick-common.c index ed228ef6f6b8..051bc80a0c43 100644 --- a/trunk/kernel/time/tick-common.c +++ b/trunk/kernel/time/tick-common.c @@ -51,11 +51,7 @@ int tick_is_oneshot_available(void) { struct clock_event_device *dev = __this_cpu_read(tick_cpu_device.evtdev); - if (!dev || !(dev->features & CLOCK_EVT_FEAT_ONESHOT)) - return 0; - if (!(dev->features & CLOCK_EVT_FEAT_C3STOP)) - return 1; - return tick_broadcast_oneshot_available(); + return dev && (dev->features & CLOCK_EVT_FEAT_ONESHOT); } /* diff --git a/trunk/kernel/time/tick-internal.h b/trunk/kernel/time/tick-internal.h index f65d3a723a64..290eefbc1f60 100644 --- a/trunk/kernel/time/tick-internal.h +++ b/trunk/kernel/time/tick-internal.h @@ -36,7 +36,6 @@ extern void tick_shutdown_broadcast_oneshot(unsigned int *cpup); extern int tick_resume_broadcast_oneshot(struct clock_event_device *bc); extern int tick_broadcast_oneshot_active(void); extern void tick_check_oneshot_broadcast(int cpu); -bool tick_broadcast_oneshot_available(void); # else /* BROADCAST */ static inline void tick_broadcast_setup_oneshot(struct clock_event_device *bc) { @@ -47,7 +46,6 @@ static inline void tick_broadcast_switch_to_oneshot(void) { } static inline void tick_shutdown_broadcast_oneshot(unsigned int *cpup) { } static inline int tick_broadcast_oneshot_active(void) { return 0; } static inline void tick_check_oneshot_broadcast(int cpu) { } -static inline bool tick_broadcast_oneshot_available(void) { return true; } # endif /* !BROADCAST */ #else /* !ONESHOT */ @@ -78,7 +76,6 @@ static inline int tick_resume_broadcast_oneshot(struct clock_event_device *bc) return 0; } static inline int tick_broadcast_oneshot_active(void) { return 0; } -static inline bool tick_broadcast_oneshot_available(void) { return false; } #endif /* !TICK_ONESHOT */ /* diff --git a/trunk/lib/swiotlb.c b/trunk/lib/swiotlb.c index 93ca08b8a451..c47bbe11b804 100644 --- a/trunk/lib/swiotlb.c +++ b/trunk/lib/swiotlb.c @@ -686,10 +686,8 @@ dma_addr_t swiotlb_map_page(struct device *dev, struct page *page, /* * Ensure that the address returned is DMA'ble */ - if (!dma_capable(dev, dev_addr, size)) { - swiotlb_tbl_unmap_single(dev, map, size, dir); - dev_addr = swiotlb_virt_to_bus(dev, io_tlb_overflow_buffer); - } + if (!dma_capable(dev, dev_addr, size)) + panic("map_single: bounce buffer is not DMA'ble"); return dev_addr; } diff --git a/trunk/mm/mempolicy.c b/trunk/mm/mempolicy.c index 49355a970be2..368fc9d23610 100644 --- a/trunk/mm/mempolicy.c +++ b/trunk/mm/mempolicy.c @@ -1830,7 +1830,7 @@ alloc_pages_vma(gfp_t gfp, int order, struct vm_area_struct *vma, if (unlikely(pol->mode == MPOL_INTERLEAVE)) { unsigned nid; - nid = interleave_nid(pol, vma, addr, PAGE_SHIFT + order); + nid = interleave_nid(pol, vma, addr, PAGE_SHIFT); mpol_cond_put(pol); page = alloc_page_interleave(gfp, order, nid); put_mems_allowed(); diff --git a/trunk/mm/migrate.c b/trunk/mm/migrate.c index 352de555626c..766115253807 100644 --- a/trunk/mm/migrate.c +++ b/trunk/mm/migrate.c @@ -1287,14 +1287,14 @@ SYSCALL_DEFINE6(move_pages, pid_t, pid, unsigned long, nr_pages, return -EPERM; /* Find the mm_struct */ - rcu_read_lock(); + read_lock(&tasklist_lock); task = pid ? find_task_by_vpid(pid) : current; if (!task) { - rcu_read_unlock(); + read_unlock(&tasklist_lock); return -ESRCH; } mm = get_task_mm(task); - rcu_read_unlock(); + read_unlock(&tasklist_lock); if (!mm) return -EINVAL; diff --git a/trunk/mm/mremap.c b/trunk/mm/mremap.c index 1de98d492ddc..9925b6391b80 100644 --- a/trunk/mm/mremap.c +++ b/trunk/mm/mremap.c @@ -94,7 +94,9 @@ static void move_ptes(struct vm_area_struct *vma, pmd_t *old_pmd, */ mapping = vma->vm_file->f_mapping; spin_lock(&mapping->i_mmap_lock); - new_vma->vm_truncate_count = 0; + if (new_vma->vm_truncate_count && + new_vma->vm_truncate_count != vma->vm_truncate_count) + new_vma->vm_truncate_count = 0; } /* diff --git a/trunk/mm/page_alloc.c b/trunk/mm/page_alloc.c index cdef1d4b4e47..a873e61e312e 100644 --- a/trunk/mm/page_alloc.c +++ b/trunk/mm/page_alloc.c @@ -5376,9 +5376,10 @@ __count_immobile_pages(struct zone *zone, struct page *page, int count) for (found = 0, iter = 0; iter < pageblock_nr_pages; iter++) { unsigned long check = pfn + iter; - if (!pfn_valid_within(check)) + if (!pfn_valid_within(check)) { + iter++; continue; - + } page = pfn_to_page(check); if (!page_count(page)) { if (PageBuddy(page)) diff --git a/trunk/mm/swapfile.c b/trunk/mm/swapfile.c index 0341c5700e34..07a458d72fa8 100644 --- a/trunk/mm/swapfile.c +++ b/trunk/mm/swapfile.c @@ -1940,7 +1940,7 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags) error = -EINVAL; if (S_ISBLK(inode->i_mode)) { - bdev = bdgrab(I_BDEV(inode)); + bdev = I_BDEV(inode); error = blkdev_get(bdev, FMODE_READ | FMODE_WRITE | FMODE_EXCL, sys_swapon); if (error < 0) { diff --git a/trunk/mm/truncate.c b/trunk/mm/truncate.c index d64296be00d3..49feb46e77b8 100644 --- a/trunk/mm/truncate.c +++ b/trunk/mm/truncate.c @@ -225,7 +225,6 @@ void truncate_inode_pages_range(struct address_space *mapping, next = start; while (next <= end && pagevec_lookup(&pvec, mapping, next, PAGEVEC_SIZE)) { - mem_cgroup_uncharge_start(); for (i = 0; i < pagevec_count(&pvec); i++) { struct page *page = pvec.pages[i]; pgoff_t page_index = page->index; @@ -248,7 +247,6 @@ void truncate_inode_pages_range(struct address_space *mapping, unlock_page(page); } pagevec_release(&pvec); - mem_cgroup_uncharge_end(); cond_resched(); } diff --git a/trunk/mm/vmscan.c b/trunk/mm/vmscan.c index 6771ea70bfe7..17497d0cd8b9 100644 --- a/trunk/mm/vmscan.c +++ b/trunk/mm/vmscan.c @@ -1841,28 +1841,16 @@ static inline bool should_continue_reclaim(struct zone *zone, if (!(sc->reclaim_mode & RECLAIM_MODE_COMPACTION)) return false; - /* Consider stopping depending on scan and reclaim activity */ - if (sc->gfp_mask & __GFP_REPEAT) { - /* - * For __GFP_REPEAT allocations, stop reclaiming if the - * full LRU list has been scanned and we are still failing - * to reclaim pages. This full LRU scan is potentially - * expensive but a __GFP_REPEAT caller really wants to succeed - */ - if (!nr_reclaimed && !nr_scanned) - return false; - } else { - /* - * For non-__GFP_REPEAT allocations which can presumably - * fail without consequence, stop if we failed to reclaim - * any pages from the last SWAP_CLUSTER_MAX number of - * pages that were scanned. This will return to the - * caller faster at the risk reclaim/compaction and - * the resulting allocation attempt fails - */ - if (!nr_reclaimed) - return false; - } + /* + * If we failed to reclaim and have scanned the full list, stop. + * NOTE: Checking just nr_reclaimed would exit reclaim/compaction far + * faster but obviously would be less likely to succeed + * allocation. If this is desirable, use GFP_REPEAT to decide + * if both reclaimed and scanned should be checked or just + * reclaimed + */ + if (!nr_reclaimed && !nr_scanned) + return false; /* * If we have not reclaimed enough pages for compaction and the diff --git a/trunk/net/rxrpc/ar-key.c b/trunk/net/rxrpc/ar-key.c index d763793d39de..5ee16f0353fe 100644 --- a/trunk/net/rxrpc/ar-key.c +++ b/trunk/net/rxrpc/ar-key.c @@ -89,11 +89,11 @@ static int rxrpc_instantiate_xdr_rxkad(struct key *key, const __be32 *xdr, return ret; plen -= sizeof(*token); - token = kzalloc(sizeof(*token), GFP_KERNEL); + token = kmalloc(sizeof(*token), GFP_KERNEL); if (!token) return -ENOMEM; - token->kad = kzalloc(plen, GFP_KERNEL); + token->kad = kmalloc(plen, GFP_KERNEL); if (!token->kad) { kfree(token); return -ENOMEM; @@ -731,10 +731,10 @@ static int rxrpc_instantiate(struct key *key, const void *data, size_t datalen) goto error; ret = -ENOMEM; - token = kzalloc(sizeof(*token), GFP_KERNEL); + token = kmalloc(sizeof(*token), GFP_KERNEL); if (!token) goto error; - token->kad = kzalloc(plen, GFP_KERNEL); + token->kad = kmalloc(plen, GFP_KERNEL); if (!token->kad) goto error_free; diff --git a/trunk/sound/core/jack.c b/trunk/sound/core/jack.c index 53b53e97c896..4902ae568730 100644 --- a/trunk/sound/core/jack.c +++ b/trunk/sound/core/jack.c @@ -141,7 +141,6 @@ int snd_jack_new(struct snd_card *card, const char *id, int type, fail_input: input_free_device(jack->input_dev); - kfree(jack->id); kfree(jack); return err; } diff --git a/trunk/sound/pci/hda/patch_conexant.c b/trunk/sound/pci/hda/patch_conexant.c index 4d5004e693f0..dd7c5c12225d 100644 --- a/trunk/sound/pci/hda/patch_conexant.c +++ b/trunk/sound/pci/hda/patch_conexant.c @@ -3114,8 +3114,6 @@ static struct snd_pci_quirk cxt5066_cfg_tbl[] = { SND_PCI_QUIRK(0x1028, 0x0401, "Dell Vostro 1014", CXT5066_DELL_VOSTRO), SND_PCI_QUIRK(0x1028, 0x0402, "Dell Vostro", CXT5066_DELL_VOSTRO), SND_PCI_QUIRK(0x1028, 0x0408, "Dell Inspiron One 19T", CXT5066_IDEAPAD), - SND_PCI_QUIRK(0x1028, 0x050f, "Dell Inspiron", CXT5066_IDEAPAD), - SND_PCI_QUIRK(0x1028, 0x0510, "Dell Vostro", CXT5066_IDEAPAD), SND_PCI_QUIRK(0x103c, 0x360b, "HP G60", CXT5066_HP_LAPTOP), SND_PCI_QUIRK(0x1043, 0x13f3, "Asus A52J", CXT5066_ASUS), SND_PCI_QUIRK(0x1043, 0x1643, "Asus K52JU", CXT5066_ASUS), @@ -3939,8 +3937,6 @@ static struct hda_codec_preset snd_hda_preset_conexant[] = { .patch = patch_cxt5066 }, { .id = 0x14f15069, .name = "CX20585", .patch = patch_cxt5066 }, - { .id = 0x14f1506e, .name = "CX20590", - .patch = patch_cxt5066 }, { .id = 0x14f15097, .name = "CX20631", .patch = patch_conexant_auto }, { .id = 0x14f15098, .name = "CX20632", @@ -3967,7 +3963,6 @@ MODULE_ALIAS("snd-hda-codec-id:14f15066"); MODULE_ALIAS("snd-hda-codec-id:14f15067"); MODULE_ALIAS("snd-hda-codec-id:14f15068"); MODULE_ALIAS("snd-hda-codec-id:14f15069"); -MODULE_ALIAS("snd-hda-codec-id:14f1506e"); MODULE_ALIAS("snd-hda-codec-id:14f15097"); MODULE_ALIAS("snd-hda-codec-id:14f15098"); MODULE_ALIAS("snd-hda-codec-id:14f150a1"); diff --git a/trunk/sound/pci/hda/patch_sigmatel.c b/trunk/sound/pci/hda/patch_sigmatel.c index bd7b123f6440..9ea48b425d0b 100644 --- a/trunk/sound/pci/hda/patch_sigmatel.c +++ b/trunk/sound/pci/hda/patch_sigmatel.c @@ -586,12 +586,7 @@ static hda_nid_t stac92hd83xxx_pin_nids[10] = { 0x0f, 0x10, 0x11, 0x1f, 0x20, }; -static hda_nid_t stac92hd87xxx_pin_nids[6] = { - 0x0a, 0x0b, 0x0c, 0x0d, - 0x0f, 0x11, -}; - -static hda_nid_t stac92hd88xxx_pin_nids[8] = { +static hda_nid_t stac92hd88xxx_pin_nids[10] = { 0x0a, 0x0b, 0x0c, 0x0d, 0x0f, 0x11, 0x1f, 0x20, }; @@ -5435,13 +5430,12 @@ static int patch_stac92hd83xxx(struct hda_codec *codec) switch (codec->vendor_id) { case 0x111d76d1: case 0x111d76d9: - case 0x111d76e5: spec->dmic_nids = stac92hd87b_dmic_nids; spec->num_dmics = stac92xx_connected_ports(codec, stac92hd87b_dmic_nids, STAC92HD87B_NUM_DMICS); - spec->num_pins = ARRAY_SIZE(stac92hd87xxx_pin_nids); - spec->pin_nids = stac92hd87xxx_pin_nids; + spec->num_pins = ARRAY_SIZE(stac92hd88xxx_pin_nids); + spec->pin_nids = stac92hd88xxx_pin_nids; spec->mono_nid = 0; spec->num_pwrs = 0; break; @@ -5449,7 +5443,6 @@ static int patch_stac92hd83xxx(struct hda_codec *codec) case 0x111d7667: case 0x111d7668: case 0x111d7669: - case 0x111d76e3: spec->num_dmics = stac92xx_connected_ports(codec, stac92hd88xxx_dmic_nids, STAC92HD88XXX_NUM_DMICS); @@ -6394,8 +6387,6 @@ static struct hda_codec_preset snd_hda_preset_sigmatel[] = { { .id = 0x111d76cd, .name = "92HD89F2", .patch = patch_stac92hd73xx }, { .id = 0x111d76ce, .name = "92HD89F1", .patch = patch_stac92hd73xx }, { .id = 0x111d76e0, .name = "92HD91BXX", .patch = patch_stac92hd83xxx}, - { .id = 0x111d76e3, .name = "92HD98BXX", .patch = patch_stac92hd83xxx}, - { .id = 0x111d76e5, .name = "92HD99BXX", .patch = patch_stac92hd83xxx}, { .id = 0x111d76e7, .name = "92HD90BXX", .patch = patch_stac92hd83xxx}, {} /* terminator */ }; diff --git a/trunk/sound/pci/hda/patch_via.c b/trunk/sound/pci/hda/patch_via.c index 63b0054200a8..a76c3260d941 100644 --- a/trunk/sound/pci/hda/patch_via.c +++ b/trunk/sound/pci/hda/patch_via.c @@ -567,7 +567,7 @@ static void via_auto_init_analog_input(struct hda_codec *codec) hda_nid_t nid = cfg->inputs[i].pin; if (spec->smart51_enabled && is_smart51_pins(spec, nid)) ctl = PIN_OUT; - else if (cfg->inputs[i].type == AUTO_PIN_MIC) + else if (i == AUTO_PIN_MIC) ctl = PIN_VREF50; else ctl = PIN_IN; diff --git a/trunk/sound/soc/codecs/wm8903.h b/trunk/sound/soc/codecs/wm8903.h index e3ec2433b215..e8490f3edd03 100644 --- a/trunk/sound/soc/codecs/wm8903.h +++ b/trunk/sound/soc/codecs/wm8903.h @@ -165,7 +165,7 @@ extern int wm8903_mic_detect(struct snd_soc_codec *codec, #define WM8903_VMID_RES_50K 2 #define WM8903_VMID_RES_250K 3 -#define WM8903_VMID_RES_5K 6 +#define WM8903_VMID_RES_5K 4 /* * R8 (0x08) - Analogue DAC 0 diff --git a/trunk/sound/soc/codecs/wm8994.c b/trunk/sound/soc/codecs/wm8994.c index ebaee5ca7434..a60b5dbf0154 100644 --- a/trunk/sound/soc/codecs/wm8994.c +++ b/trunk/sound/soc/codecs/wm8994.c @@ -3000,10 +3000,11 @@ static void wm8958_default_micdet(u16 status, void *data) report |= SND_JACK_BTN_5; done: - snd_soc_jack_report(wm8994->micdet[0].jack, report, + snd_soc_jack_report(wm8994->micdet[0].jack, SND_JACK_BTN_0 | SND_JACK_BTN_1 | SND_JACK_BTN_2 | SND_JACK_BTN_3 | SND_JACK_BTN_4 | SND_JACK_BTN_5 | - SND_JACK_MICROPHONE | SND_JACK_VIDEOOUT); + SND_JACK_MICROPHONE | SND_JACK_VIDEOOUT, + report); } /** diff --git a/trunk/sound/soc/codecs/wm_hubs.c b/trunk/sound/soc/codecs/wm_hubs.c index 516892706063..613df5db0b32 100644 --- a/trunk/sound/soc/codecs/wm_hubs.c +++ b/trunk/sound/soc/codecs/wm_hubs.c @@ -674,9 +674,6 @@ SND_SOC_DAPM_OUTPUT("LINEOUT2N"), }; static const struct snd_soc_dapm_route analogue_routes[] = { - { "MICBIAS1", NULL, "CLK_SYS" }, - { "MICBIAS2", NULL, "CLK_SYS" }, - { "IN1L PGA", "IN1LP Switch", "IN1LP" }, { "IN1L PGA", "IN1LN Switch", "IN1LN" }, diff --git a/trunk/sound/soc/imx/eukrea-tlv320.c b/trunk/sound/soc/imx/eukrea-tlv320.c index 1e9bccae4e80..e20c9e1457c0 100644 --- a/trunk/sound/soc/imx/eukrea-tlv320.c +++ b/trunk/sound/soc/imx/eukrea-tlv320.c @@ -79,7 +79,7 @@ static struct snd_soc_dai_link eukrea_tlv320_dai = { .name = "tlv320aic23", .stream_name = "TLV320AIC23", .codec_dai_name = "tlv320aic23-hifi", - .platform_name = "imx-fiq-pcm-audio.0", + .platform_name = "imx-pcm-audio.0", .codec_name = "tlv320aic23-codec.0-001a", .cpu_dai_name = "imx-ssi.0", .ops = &eukrea_tlv320_snd_ops, diff --git a/trunk/sound/soc/pxa/e740_wm9705.c b/trunk/sound/soc/pxa/e740_wm9705.c index dc65650a6fa1..28333e7d9c50 100644 --- a/trunk/sound/soc/pxa/e740_wm9705.c +++ b/trunk/sound/soc/pxa/e740_wm9705.c @@ -117,7 +117,7 @@ static struct snd_soc_dai_link e740_dai[] = { { .name = "AC97", .stream_name = "AC97 HiFi", - .cpu_dai_name = "pxa2xx-ac97", + .cpu_dai_name = "pxa-ac97.0", .codec_dai_name = "wm9705-hifi", .platform_name = "pxa-pcm-audio", .codec_name = "wm9705-codec", @@ -126,7 +126,7 @@ static struct snd_soc_dai_link e740_dai[] = { { .name = "AC97 Aux", .stream_name = "AC97 Aux", - .cpu_dai_name = "pxa2xx-ac97-aux", + .cpu_dai_name = "pxa-ac97.1", .codec_dai_name = "wm9705-aux", .platform_name = "pxa-pcm-audio", .codec_name = "wm9705-codec", diff --git a/trunk/sound/soc/pxa/e750_wm9705.c b/trunk/sound/soc/pxa/e750_wm9705.c index 51897fcd911b..01bf31675c55 100644 --- a/trunk/sound/soc/pxa/e750_wm9705.c +++ b/trunk/sound/soc/pxa/e750_wm9705.c @@ -99,7 +99,7 @@ static struct snd_soc_dai_link e750_dai[] = { { .name = "AC97", .stream_name = "AC97 HiFi", - .cpu_dai_name = "pxa2xx-ac97", + .cpu_dai_name = "pxa-ac97.0", .codec_dai_name = "wm9705-hifi", .platform_name = "pxa-pcm-audio", .codec_name = "wm9705-codec", @@ -109,7 +109,7 @@ static struct snd_soc_dai_link e750_dai[] = { { .name = "AC97 Aux", .stream_name = "AC97 Aux", - .cpu_dai_name = "pxa2xx-ac97-aux", + .cpu_dai_name = "pxa-ac97.1", .codec_dai_name ="wm9705-aux", .platform_name = "pxa-pcm-audio", .codec_name = "wm9705-codec", diff --git a/trunk/sound/soc/pxa/e800_wm9712.c b/trunk/sound/soc/pxa/e800_wm9712.c index 053ed208e59f..c6a37c6ef23b 100644 --- a/trunk/sound/soc/pxa/e800_wm9712.c +++ b/trunk/sound/soc/pxa/e800_wm9712.c @@ -89,7 +89,7 @@ static struct snd_soc_dai_link e800_dai[] = { { .name = "AC97", .stream_name = "AC97 HiFi", - .cpu_dai_name = "pxa2xx-ac97", + .cpu_dai_name = "pxa-ac97.0", .codec_dai_name = "wm9712-hifi", .platform_name = "pxa-pcm-audio", .codec_name = "wm9712-codec", @@ -98,7 +98,7 @@ static struct snd_soc_dai_link e800_dai[] = { { .name = "AC97 Aux", .stream_name = "AC97 Aux", - .cpu_dai_name = "pxa2xx-ac97-aux", + .cpu_dai_name = "pxa-ac97.1", .codec_dai_name ="wm9712-aux", .platform_name = "pxa-pcm-audio", .codec_name = "wm9712-codec", diff --git a/trunk/sound/soc/pxa/em-x270.c b/trunk/sound/soc/pxa/em-x270.c index b13a4252812d..fc22e6eefc98 100644 --- a/trunk/sound/soc/pxa/em-x270.c +++ b/trunk/sound/soc/pxa/em-x270.c @@ -37,7 +37,7 @@ static struct snd_soc_dai_link em_x270_dai[] = { { .name = "AC97", .stream_name = "AC97 HiFi", - .cpu_dai_name = "pxa2xx-ac97", + .cpu_dai_name = "pxa-ac97.0", .codec_dai_name = "wm9712-hifi", .platform_name = "pxa-pcm-audio", .codec_name = "wm9712-codec", @@ -45,7 +45,7 @@ static struct snd_soc_dai_link em_x270_dai[] = { { .name = "AC97 Aux", .stream_name = "AC97 Aux", - .cpu_dai_name = "pxa2xx-ac97-aux", + .cpu_dai_name = "pxa-ac97.1", .codec_dai_name ="wm9712-aux", .platform_name = "pxa-pcm-audio", .codec_name = "wm9712-codec", diff --git a/trunk/sound/soc/pxa/mioa701_wm9713.c b/trunk/sound/soc/pxa/mioa701_wm9713.c index 38ca6759907e..0d70fc8c12bd 100644 --- a/trunk/sound/soc/pxa/mioa701_wm9713.c +++ b/trunk/sound/soc/pxa/mioa701_wm9713.c @@ -162,7 +162,7 @@ static struct snd_soc_dai_link mioa701_dai[] = { { .name = "AC97", .stream_name = "AC97 HiFi", - .cpu_dai_name = "pxa2xx-ac97", + .cpu_dai_name = "pxa-ac97.0", .codec_dai_name = "wm9713-hifi", .codec_name = "wm9713-codec", .init = mioa701_wm9713_init, @@ -172,7 +172,7 @@ static struct snd_soc_dai_link mioa701_dai[] = { { .name = "AC97 Aux", .stream_name = "AC97 Aux", - .cpu_dai_name = "pxa2xx-ac97-aux", + .cpu_dai_name = "pxa-ac97.1", .codec_dai_name ="wm9713-aux", .codec_name = "wm9713-codec", .platform_name = "pxa-pcm-audio", diff --git a/trunk/sound/soc/pxa/palm27x.c b/trunk/sound/soc/pxa/palm27x.c index 504e4004f004..857db96d4a4f 100644 --- a/trunk/sound/soc/pxa/palm27x.c +++ b/trunk/sound/soc/pxa/palm27x.c @@ -132,7 +132,7 @@ static struct snd_soc_dai_link palm27x_dai[] = { { .name = "AC97 HiFi", .stream_name = "AC97 HiFi", - .cpu_dai_name = "pxa2xx-ac97", + .cpu_dai_name = "pxa-ac97.0", .codec_dai_name = "wm9712-hifi", .codec_name = "wm9712-codec", .platform_name = "pxa-pcm-audio", @@ -141,7 +141,7 @@ static struct snd_soc_dai_link palm27x_dai[] = { { .name = "AC97 Aux", .stream_name = "AC97 Aux", - .cpu_dai_name = "pxa2xx-ac97-aux", + .cpu_dai_name = "pxa-ac97.1", .codec_dai_name = "wm9712-aux", .codec_name = "wm9712-codec", .platform_name = "pxa-pcm-audio", diff --git a/trunk/sound/soc/pxa/tosa.c b/trunk/sound/soc/pxa/tosa.c index 4b6e5d608b42..f75804ef0897 100644 --- a/trunk/sound/soc/pxa/tosa.c +++ b/trunk/sound/soc/pxa/tosa.c @@ -219,7 +219,7 @@ static struct snd_soc_dai_link tosa_dai[] = { { .name = "AC97", .stream_name = "AC97 HiFi", - .cpu_dai_name = "pxa2xx-ac97", + .cpu_dai_name = "pxa-ac97.0", .codec_dai_name = "wm9712-hifi", .platform_name = "pxa-pcm-audio", .codec_name = "wm9712-codec", @@ -229,7 +229,7 @@ static struct snd_soc_dai_link tosa_dai[] = { { .name = "AC97 Aux", .stream_name = "AC97 Aux", - .cpu_dai_name = "pxa2xx-ac97-aux", + .cpu_dai_name = "pxa-ac97.1", .codec_dai_name = "wm9712-aux", .platform_name = "pxa-pcm-audio", .codec_name = "wm9712-codec", diff --git a/trunk/sound/soc/pxa/zylonite.c b/trunk/sound/soc/pxa/zylonite.c index 25bba108fea3..b222a7d72027 100644 --- a/trunk/sound/soc/pxa/zylonite.c +++ b/trunk/sound/soc/pxa/zylonite.c @@ -166,7 +166,7 @@ static struct snd_soc_dai_link zylonite_dai[] = { .stream_name = "AC97 HiFi", .codec_name = "wm9713-codec", .platform_name = "pxa-pcm-audio", - .cpu_dai_name = "pxa2xx-ac97", + .cpu_dai_name = "pxa-ac97.0", .codec_name = "wm9713-hifi", .init = zylonite_wm9713_init, }, @@ -175,7 +175,7 @@ static struct snd_soc_dai_link zylonite_dai[] = { .stream_name = "AC97 Aux", .codec_name = "wm9713-codec", .platform_name = "pxa-pcm-audio", - .cpu_dai_name = "pxa2xx-ac97-aux", + .cpu_dai_name = "pxa-ac97.1", .codec_name = "wm9713-aux", }, { diff --git a/trunk/sound/usb/card.c b/trunk/sound/usb/card.c index c0f8270bc199..800f7cb4f251 100644 --- a/trunk/sound/usb/card.c +++ b/trunk/sound/usb/card.c @@ -323,7 +323,6 @@ static int snd_usb_audio_create(struct usb_device *dev, int idx, return -ENOMEM; } - mutex_init(&chip->shutdown_mutex); chip->index = idx; chip->dev = dev; chip->card = card; @@ -532,7 +531,6 @@ static void snd_usb_audio_disconnect(struct usb_device *dev, void *ptr) chip = ptr; card = chip->card; mutex_lock(®ister_mutex); - mutex_lock(&chip->shutdown_mutex); chip->shutdown = 1; chip->num_interfaces--; if (chip->num_interfaces <= 0) { @@ -550,11 +548,9 @@ static void snd_usb_audio_disconnect(struct usb_device *dev, void *ptr) snd_usb_mixer_disconnect(p); } usb_chip[chip->index] = NULL; - mutex_unlock(&chip->shutdown_mutex); mutex_unlock(®ister_mutex); snd_card_free_when_closed(card); } else { - mutex_unlock(&chip->shutdown_mutex); mutex_unlock(®ister_mutex); } } diff --git a/trunk/sound/usb/pcm.c b/trunk/sound/usb/pcm.c index e3f680526cb5..4132522ac90f 100644 --- a/trunk/sound/usb/pcm.c +++ b/trunk/sound/usb/pcm.c @@ -361,7 +361,6 @@ static int snd_usb_hw_params(struct snd_pcm_substream *substream, } if (changed) { - mutex_lock(&subs->stream->chip->shutdown_mutex); /* format changed */ snd_usb_release_substream_urbs(subs, 0); /* influenced: period_bytes, channels, rate, format, */ @@ -369,7 +368,6 @@ static int snd_usb_hw_params(struct snd_pcm_substream *substream, params_rate(hw_params), snd_pcm_format_physical_width(params_format(hw_params)) * params_channels(hw_params)); - mutex_unlock(&subs->stream->chip->shutdown_mutex); } return ret; @@ -387,9 +385,8 @@ static int snd_usb_hw_free(struct snd_pcm_substream *substream) subs->cur_audiofmt = NULL; subs->cur_rate = 0; subs->period_bytes = 0; - mutex_lock(&subs->stream->chip->shutdown_mutex); - snd_usb_release_substream_urbs(subs, 0); - mutex_unlock(&subs->stream->chip->shutdown_mutex); + if (!subs->stream->chip->shutdown) + snd_usb_release_substream_urbs(subs, 0); return snd_pcm_lib_free_vmalloc_buffer(substream); } diff --git a/trunk/sound/usb/usbaudio.h b/trunk/sound/usb/usbaudio.h index 6e66fffe87f5..db3eb21627ee 100644 --- a/trunk/sound/usb/usbaudio.h +++ b/trunk/sound/usb/usbaudio.h @@ -36,7 +36,6 @@ struct snd_usb_audio { struct snd_card *card; u32 usb_id; int shutdown; - struct mutex shutdown_mutex; unsigned int txfr_quirk:1; /* Subframe boundaries on transfers */ int num_interfaces; int num_suspended_intf; diff --git a/trunk/tools/perf/builtin-timechart.c b/trunk/tools/perf/builtin-timechart.c index 0ace786e83e0..746cf03cb05d 100644 --- a/trunk/tools/perf/builtin-timechart.c +++ b/trunk/tools/perf/builtin-timechart.c @@ -264,6 +264,9 @@ pid_put_sample(int pid, int type, unsigned int cpu, u64 start, u64 end) c->start_time = start; if (p->start_time == 0 || p->start_time > start) p->start_time = start; + + if (cpu > numcpus) + numcpus = cpu; } #define MAX_CPUS 4096 @@ -508,9 +511,6 @@ static int process_sample_event(event_t *event __used, if (!event_str) return 0; - if (sample->cpu > numcpus) - numcpus = sample->cpu; - if (strcmp(event_str, "power:cpu_idle") == 0) { struct power_processor_entry *ppe = (void *)te; if (ppe->state == (u32)PWR_EVENT_EXIT) diff --git a/trunk/tools/perf/util/hist.c b/trunk/tools/perf/util/hist.c index df51560f16f7..32f4f1f2f6e4 100644 --- a/trunk/tools/perf/util/hist.c +++ b/trunk/tools/perf/util/hist.c @@ -585,7 +585,6 @@ int hist_entry__snprintf(struct hist_entry *self, char *s, size_t size, { struct sort_entry *se; u64 period, total, period_sys, period_us, period_guest_sys, period_guest_us; - u64 nr_events; const char *sep = symbol_conf.field_sep; int ret; @@ -594,7 +593,6 @@ int hist_entry__snprintf(struct hist_entry *self, char *s, size_t size, if (pair_hists) { period = self->pair ? self->pair->period : 0; - nr_events = self->pair ? self->pair->nr_events : 0; total = pair_hists->stats.total_period; period_sys = self->pair ? self->pair->period_sys : 0; period_us = self->pair ? self->pair->period_us : 0; @@ -602,7 +600,6 @@ int hist_entry__snprintf(struct hist_entry *self, char *s, size_t size, period_guest_us = self->pair ? self->pair->period_guest_us : 0; } else { period = self->period; - nr_events = self->nr_events; total = session_total; period_sys = self->period_sys; period_us = self->period_us; @@ -643,9 +640,9 @@ int hist_entry__snprintf(struct hist_entry *self, char *s, size_t size, if (symbol_conf.show_nr_samples) { if (sep) - ret += snprintf(s + ret, size - ret, "%c%" PRIu64, *sep, nr_events); + ret += snprintf(s + ret, size - ret, "%c%" PRIu64, *sep, period); else - ret += snprintf(s + ret, size - ret, "%11" PRIu64, nr_events); + ret += snprintf(s + ret, size - ret, "%11" PRIu64, period); } if (pair_hists) { diff --git a/trunk/tools/perf/util/svghelper.c b/trunk/tools/perf/util/svghelper.c index 96c866045d60..fb737fe9be91 100644 --- a/trunk/tools/perf/util/svghelper.c +++ b/trunk/tools/perf/util/svghelper.c @@ -456,9 +456,9 @@ void svg_legenda(void) return; svg_legenda_box(0, "Running", "sample"); - svg_legenda_box(100, "Idle","c1"); - svg_legenda_box(200, "Deeper Idle", "c3"); - svg_legenda_box(350, "Deepest Idle", "c6"); + svg_legenda_box(100, "Idle","rect.c1"); + svg_legenda_box(200, "Deeper Idle", "rect.c3"); + svg_legenda_box(350, "Deepest Idle", "rect.c6"); svg_legenda_box(550, "Sleeping", "process2"); svg_legenda_box(650, "Waiting for cpu", "waiting"); svg_legenda_box(800, "Blocked on IO", "blocked");