From 56b0474d86b182025b00b4cfc2dd897532c40508 Mon Sep 17 00:00:00 2001 From: Mark Rutland Date: Tue, 30 Aug 2011 17:45:10 +0100 Subject: [PATCH] --- yaml --- r: 263709 b: refs/heads/master c: fb492c9160f3d40d09456a79cc669fba74d7d9cc h: refs/heads/master i: 263707: ef77cf5e27eda9355ae16744702cec864eed346d v: v3 --- [refs] | 2 +- .../feature-removal-schedule.txt | 8 - trunk/Documentation/hwmon/max16065 | 7 - trunk/Makefile | 2 +- trunk/arch/arm/mm/init.c | 2 +- trunk/arch/powerpc/boot/dts/p1023rds.dts | 2 +- .../powerpc/configs/85xx/p1023rds_defconfig | 1 - .../powerpc/configs/corenet32_smp_defconfig | 1 - .../powerpc/configs/corenet64_smp_defconfig | 5 +- trunk/arch/powerpc/configs/mpc85xx_defconfig | 1 - .../powerpc/configs/mpc85xx_smp_defconfig | 1 - trunk/arch/x86/include/asm/pvclock.h | 2 +- trunk/arch/x86/kernel/cpu/perf_event.c | 3 - trunk/arch/x86/pci/acpi.c | 9 +- trunk/arch/x86/xen/setup.c | 19 --- trunk/arch/x86/xen/smp.c | 10 -- trunk/arch/x86/xen/xen-asm_32.S | 8 +- trunk/drivers/base/regmap/regmap.c | 5 +- trunk/drivers/dma/ste_dma40.c | 42 ++---- trunk/drivers/gpu/drm/radeon/evergreen.c | 27 ---- trunk/drivers/gpu/drm/radeon/ni.c | 3 - trunk/drivers/gpu/drm/radeon/radeon_clocks.c | 3 - trunk/drivers/hid/hid-ids.h | 1 - trunk/drivers/hid/hid-magicmouse.c | 66 ++------- trunk/drivers/hid/hid-wacom.c | 22 +-- trunk/drivers/hid/usbhid/hid-quirks.c | 1 - trunk/drivers/hwmon/max16065.c | 2 +- trunk/drivers/hwmon/pmbus/ucd9000.c | 6 +- trunk/drivers/hwmon/pmbus/ucd9200.c | 6 +- trunk/drivers/i2c/busses/i2c-pxa-pci.c | 5 +- trunk/drivers/i2c/busses/i2c-tegra.c | 60 ++------ trunk/drivers/iommu/amd_iommu.c | 18 +-- trunk/drivers/md/linear.h | 2 +- trunk/drivers/md/md.c | 28 +--- trunk/drivers/md/raid1.c | 14 +- trunk/drivers/md/raid10.c | 47 +++--- trunk/drivers/md/raid5.c | 2 +- trunk/drivers/mmc/core/core.c | 35 +---- trunk/drivers/mmc/core/host.c | 12 +- trunk/drivers/mmc/core/host.h | 8 +- trunk/drivers/mmc/core/sd.c | 81 ++++------ trunk/drivers/mmc/host/sdhci-esdhc-imx.c | 1 - trunk/drivers/mmc/host/sdhci-s3c.c | 2 - trunk/drivers/mmc/host/sh_mobile_sdhi.c | 4 +- trunk/drivers/mtd/ubi/debug.h | 2 +- trunk/drivers/pci/hotplug/pcihp_slot.c | 4 +- trunk/drivers/pci/pci.c | 2 +- trunk/drivers/pci/probe.c | 44 +++--- trunk/drivers/rtc/rtc-ep93xx.c | 16 +- trunk/drivers/rtc/rtc-lib.c | 2 - trunk/drivers/rtc/rtc-twl.c | 60 +++++--- trunk/drivers/video/backlight/backlight.c | 2 +- trunk/fs/9p/v9fs_vfs.h | 6 +- trunk/fs/9p/vfs_file.c | 36 +---- trunk/fs/9p/vfs_inode.c | 139 +++++++----------- trunk/fs/9p/vfs_inode_dotl.c | 86 ++--------- trunk/fs/9p/vfs_super.c | 2 +- trunk/fs/block_dev.c | 7 +- trunk/fs/ceph/mds_client.c | 2 +- trunk/fs/ceph/super.c | 4 +- trunk/fs/ext4/ext4.h | 1 - trunk/fs/ext4/inode.c | 3 + trunk/fs/ext4/page-io.c | 18 +-- trunk/fs/namei.c | 33 +++-- trunk/fs/ubifs/debug.h | 6 +- trunk/fs/xfs/xfs_iops.c | 14 +- trunk/fs/xfs/xfs_super.c | 36 +++-- trunk/include/linux/perf_event.h | 24 ++- trunk/include/linux/regulator/consumer.h | 2 +- trunk/include/net/9p/9p.h | 29 ---- trunk/include/net/cfg80211.h | 2 - trunk/kernel/events/core.c | 67 ++------- trunk/kernel/sched.c | 43 ++---- trunk/kernel/time/alarmtimer.c | 18 +-- trunk/net/9p/trans_virtio.c | 17 +-- trunk/net/ceph/msgpool.c | 40 ++--- trunk/net/ceph/osd_client.c | 22 +-- 77 files changed, 431 insertions(+), 944 deletions(-) diff --git a/[refs] b/[refs] index 21de1ddc03ff..8843f0a54411 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: c338bfb5ecf6c36b2112479691d69db4c2b5a78a +refs/heads/master: fb492c9160f3d40d09456a79cc669fba74d7d9cc diff --git a/trunk/Documentation/feature-removal-schedule.txt b/trunk/Documentation/feature-removal-schedule.txt index 4dc465477665..c4a6e148732a 100644 --- a/trunk/Documentation/feature-removal-schedule.txt +++ b/trunk/Documentation/feature-removal-schedule.txt @@ -592,11 +592,3 @@ Why: In 3.0, we can now autodetect internal 3G device and already have interface that was used by acer-wmi driver. It will replaced by information log when acer-wmi initial. Who: Lee, Chun-Yi - ----------------------------- -What: The XFS nodelaylog mount option -When: 3.3 -Why: The delaylog mode that has been the default since 2.6.39 has proven - stable, and the old code is in the way of additional improvements in - the log code. -Who: Christoph Hellwig diff --git a/trunk/Documentation/hwmon/max16065 b/trunk/Documentation/hwmon/max16065 index c11f64a1f2ad..44b4f61e04f9 100644 --- a/trunk/Documentation/hwmon/max16065 +++ b/trunk/Documentation/hwmon/max16065 @@ -62,13 +62,6 @@ can be safely used to identify the chip. You will have to instantiate the devices explicitly. Please see Documentation/i2c/instantiating-devices for details. -WARNING: Do not access chip registers using the i2cdump command, and do not use -any of the i2ctools commands on a command register (0xa5 to 0xac). The chips -supported by this driver interpret any access to a command register (including -read commands) as request to execute the command in question. This may result in -power loss, board resets, and/or Flash corruption. Worst case, your board may -turn into a brick. - Sysfs entries ------------- diff --git a/trunk/Makefile b/trunk/Makefile index 03d97aa8c73e..c3e90c530a65 100644 --- a/trunk/Makefile +++ b/trunk/Makefile @@ -1,7 +1,7 @@ VERSION = 3 PATCHLEVEL = 1 SUBLEVEL = 0 -EXTRAVERSION = -rc5 +EXTRAVERSION = -rc4 NAME = "Divemaster Edition" # *DOCUMENTATION* diff --git a/trunk/arch/arm/mm/init.c b/trunk/arch/arm/mm/init.c index 91bca355cd31..cc7e2d8be9aa 100644 --- a/trunk/arch/arm/mm/init.c +++ b/trunk/arch/arm/mm/init.c @@ -298,7 +298,7 @@ static void __init arm_bootmem_free(unsigned long min, unsigned long max_low, #ifdef CONFIG_HAVE_ARCH_PFN_VALID int pfn_valid(unsigned long pfn) { - return memblock_is_memory(pfn << PAGE_SHIFT); + return memblock_is_memory(__pfn_to_phys(pfn)); } EXPORT_SYMBOL(pfn_valid); #endif diff --git a/trunk/arch/powerpc/boot/dts/p1023rds.dts b/trunk/arch/powerpc/boot/dts/p1023rds.dts index d9b776740a67..bfa96aa8f2ca 100644 --- a/trunk/arch/powerpc/boot/dts/p1023rds.dts +++ b/trunk/arch/powerpc/boot/dts/p1023rds.dts @@ -387,7 +387,7 @@ #size-cells = <1>; compatible = "cfi-flash"; reg = <0x0 0x0 0x02000000>; - bank-width = <2>; + bank-width = <1>; device-width = <1>; partition@0 { label = "ramdisk"; diff --git a/trunk/arch/powerpc/configs/85xx/p1023rds_defconfig b/trunk/arch/powerpc/configs/85xx/p1023rds_defconfig index 3ff5a81c709f..980ff8f61fd4 100644 --- a/trunk/arch/powerpc/configs/85xx/p1023rds_defconfig +++ b/trunk/arch/powerpc/configs/85xx/p1023rds_defconfig @@ -171,4 +171,3 @@ CONFIG_CRYPTO_SHA256=y CONFIG_CRYPTO_SHA512=y CONFIG_CRYPTO_AES=y # CONFIG_CRYPTO_ANSI_CPRNG is not set -CONFIG_CRYPTO_DEV_FSL_CAAM=y diff --git a/trunk/arch/powerpc/configs/corenet32_smp_defconfig b/trunk/arch/powerpc/configs/corenet32_smp_defconfig index 4311d02a3bfd..10562a5c65b9 100644 --- a/trunk/arch/powerpc/configs/corenet32_smp_defconfig +++ b/trunk/arch/powerpc/configs/corenet32_smp_defconfig @@ -185,4 +185,3 @@ CONFIG_CRYPTO_SHA256=y CONFIG_CRYPTO_SHA512=y CONFIG_CRYPTO_AES=y # CONFIG_CRYPTO_ANSI_CPRNG is not set -CONFIG_CRYPTO_DEV_FSL_CAAM=y diff --git a/trunk/arch/powerpc/configs/corenet64_smp_defconfig b/trunk/arch/powerpc/configs/corenet64_smp_defconfig index c92c204a204b..d32283555b53 100644 --- a/trunk/arch/powerpc/configs/corenet64_smp_defconfig +++ b/trunk/arch/powerpc/configs/corenet64_smp_defconfig @@ -100,8 +100,5 @@ CONFIG_DEBUG_INFO=y CONFIG_SYSCTL_SYSCALL_CHECK=y CONFIG_VIRQ_DEBUG=y CONFIG_CRYPTO_PCBC=m -CONFIG_CRYPTO_SHA256=y -CONFIG_CRYPTO_SHA512=y -CONFIG_CRYPTO_AES=y # CONFIG_CRYPTO_ANSI_CPRNG is not set -CONFIG_CRYPTO_DEV_FSL_CAAM=y +CONFIG_CRYPTO_DEV_TALITOS=y diff --git a/trunk/arch/powerpc/configs/mpc85xx_defconfig b/trunk/arch/powerpc/configs/mpc85xx_defconfig index a3467bfb7671..fcd85d2c72dc 100644 --- a/trunk/arch/powerpc/configs/mpc85xx_defconfig +++ b/trunk/arch/powerpc/configs/mpc85xx_defconfig @@ -139,7 +139,6 @@ CONFIG_SND=y CONFIG_SND_INTEL8X0=y # CONFIG_SND_PPC is not set # CONFIG_SND_USB is not set -CONFIG_SND_SOC=y CONFIG_HID_A4TECH=y CONFIG_HID_APPLE=y CONFIG_HID_BELKIN=y diff --git a/trunk/arch/powerpc/configs/mpc85xx_smp_defconfig b/trunk/arch/powerpc/configs/mpc85xx_smp_defconfig index 9693f6ed3da0..908c941fc24c 100644 --- a/trunk/arch/powerpc/configs/mpc85xx_smp_defconfig +++ b/trunk/arch/powerpc/configs/mpc85xx_smp_defconfig @@ -140,7 +140,6 @@ CONFIG_SND=y CONFIG_SND_INTEL8X0=y # CONFIG_SND_PPC is not set # CONFIG_SND_USB is not set -CONFIG_SND_SOC=y CONFIG_HID_A4TECH=y CONFIG_HID_APPLE=y CONFIG_HID_BELKIN=y diff --git a/trunk/arch/x86/include/asm/pvclock.h b/trunk/arch/x86/include/asm/pvclock.h index c59cc97fe6c1..a518c0a45044 100644 --- a/trunk/arch/x86/include/asm/pvclock.h +++ b/trunk/arch/x86/include/asm/pvclock.h @@ -44,7 +44,7 @@ static inline u64 pvclock_scale_delta(u64 delta, u32 mul_frac, int shift) : "a" ((u32)delta), "1" ((u32)(delta >> 32)), "2" (mul_frac) ); #elif defined(__x86_64__) __asm__ ( - "mulq %[mul_frac] ; shrd $32, %[hi], %[lo]" + "mul %[mul_frac] ; shrd $32, %[hi], %[lo]" : [lo]"=a"(product), [hi]"=d"(tmp) : "0"(delta), diff --git a/trunk/arch/x86/kernel/cpu/perf_event.c b/trunk/arch/x86/kernel/cpu/perf_event.c index cfa62ec090ec..4ee3abf20ed6 100644 --- a/trunk/arch/x86/kernel/cpu/perf_event.c +++ b/trunk/arch/x86/kernel/cpu/perf_event.c @@ -1900,9 +1900,6 @@ perf_callchain_user(struct perf_callchain_entry *entry, struct pt_regs *regs) perf_callchain_store(entry, regs->ip); - if (!current->mm) - return; - if (perf_callchain_user32(regs, entry)) return; diff --git a/trunk/arch/x86/pci/acpi.c b/trunk/arch/x86/pci/acpi.c index 039d91315bc5..c95330267f08 100644 --- a/trunk/arch/x86/pci/acpi.c +++ b/trunk/arch/x86/pci/acpi.c @@ -365,13 +365,8 @@ struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_pci_root *root) */ if (bus) { struct pci_bus *child; - list_for_each_entry(child, &bus->children, node) { - struct pci_dev *self = child->self; - if (!self) - continue; - - pcie_bus_configure_settings(child, self->pcie_mpss); - } + list_for_each_entry(child, &bus->children, node) + pcie_bus_configure_settings(child, child->self->pcie_mpss); } if (!bus) diff --git a/trunk/arch/x86/xen/setup.c b/trunk/arch/x86/xen/setup.c index c3b8d440873c..df118a825f39 100644 --- a/trunk/arch/x86/xen/setup.c +++ b/trunk/arch/x86/xen/setup.c @@ -184,19 +184,6 @@ static unsigned long __init xen_set_identity(const struct e820entry *list, PFN_UP(start_pci), PFN_DOWN(last)); return identity; } - -static unsigned long __init xen_get_max_pages(void) -{ - unsigned long max_pages = MAX_DOMAIN_PAGES; - domid_t domid = DOMID_SELF; - int ret; - - ret = HYPERVISOR_memory_op(XENMEM_maximum_reservation, &domid); - if (ret > 0) - max_pages = ret; - return min(max_pages, MAX_DOMAIN_PAGES); -} - /** * machine_specific_memory_setup - Hook for machine specific memory setup. **/ @@ -305,12 +292,6 @@ char * __init xen_memory_setup(void) sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map); - extra_limit = xen_get_max_pages(); - if (extra_limit >= max_pfn) - extra_pages = extra_limit - max_pfn; - else - extra_pages = 0; - extra_pages += xen_return_unused_memory(xen_start_info->nr_pages, &e820); /* diff --git a/trunk/arch/x86/xen/smp.c b/trunk/arch/x86/xen/smp.c index d4fc6d454f8d..e79dbb95482b 100644 --- a/trunk/arch/x86/xen/smp.c +++ b/trunk/arch/x86/xen/smp.c @@ -32,7 +32,6 @@ #include #include -#include #include "xen-ops.h" #include "mmu.h" @@ -208,15 +207,6 @@ static void __init xen_smp_prepare_cpus(unsigned int max_cpus) unsigned cpu; unsigned int i; - if (skip_ioapic_setup) { - char *m = (max_cpus == 0) ? - "The nosmp parameter is incompatible with Xen; " \ - "use Xen dom0_max_vcpus=1 parameter" : - "The noapic parameter is incompatible with Xen"; - - xen_raw_printk(m); - panic(m); - } xen_init_lock_cpu(0); smp_store_cpu_info(0); diff --git a/trunk/arch/x86/xen/xen-asm_32.S b/trunk/arch/x86/xen/xen-asm_32.S index b040b0e518ca..22a2093b5862 100644 --- a/trunk/arch/x86/xen/xen-asm_32.S +++ b/trunk/arch/x86/xen/xen-asm_32.S @@ -113,13 +113,11 @@ xen_iret_start_crit: /* * If there's something pending, mask events again so we can - * jump back into xen_hypervisor_callback. Otherwise do not - * touch XEN_vcpu_info_mask. + * jump back into xen_hypervisor_callback */ - jne 1f - movb $1, XEN_vcpu_info_mask(%eax) + sete XEN_vcpu_info_mask(%eax) -1: popl %eax + popl %eax /* * From this point on the registers are restored and the stack diff --git a/trunk/drivers/base/regmap/regmap.c b/trunk/drivers/base/regmap/regmap.c index 20663f8dae45..0eef4da1ac61 100644 --- a/trunk/drivers/base/regmap/regmap.c +++ b/trunk/drivers/base/regmap/regmap.c @@ -168,11 +168,13 @@ struct regmap *regmap_init(struct device *dev, map->work_buf = kmalloc(map->format.buf_size, GFP_KERNEL); if (map->work_buf == NULL) { ret = -ENOMEM; - goto err_map; + goto err_bus; } return map; +err_bus: + module_put(map->bus->owner); err_map: kfree(map); err: @@ -186,6 +188,7 @@ EXPORT_SYMBOL_GPL(regmap_init); void regmap_exit(struct regmap *map) { kfree(map->work_buf); + module_put(map->bus->owner); kfree(map); } EXPORT_SYMBOL_GPL(regmap_exit); diff --git a/trunk/drivers/dma/ste_dma40.c b/trunk/drivers/dma/ste_dma40.c index 467e4dcb20a0..cd3a7c726bf8 100644 --- a/trunk/drivers/dma/ste_dma40.c +++ b/trunk/drivers/dma/ste_dma40.c @@ -174,10 +174,8 @@ struct d40_base; * @tasklet: Tasklet that gets scheduled from interrupt context to complete a * transfer and call client callback. * @client: Cliented owned descriptor list. - * @pending_queue: Submitted jobs, to be issued by issue_pending() * @active: Active descriptor. * @queue: Queued jobs. - * @prepare_queue: Prepared jobs. * @dma_cfg: The client configuration of this dma channel. * @configured: whether the dma_cfg configuration is valid * @base: Pointer to the device instance struct. @@ -205,7 +203,6 @@ struct d40_chan { struct list_head pending_queue; struct list_head active; struct list_head queue; - struct list_head prepare_queue; struct stedma40_chan_cfg dma_cfg; bool configured; struct d40_base *base; @@ -480,6 +477,7 @@ static struct d40_desc *d40_desc_get(struct d40_chan *d40c) list_for_each_entry_safe(d, _d, &d40c->client, node) if (async_tx_test_ack(&d->txd)) { + d40_pool_lli_free(d40c, d); d40_desc_remove(d); desc = d; memset(desc, 0, sizeof(*desc)); @@ -646,11 +644,8 @@ static struct d40_desc *d40_first_active_get(struct d40_chan *d40c) return d; } -/* remove desc from current queue and add it to the pending_queue */ static void d40_desc_queue(struct d40_chan *d40c, struct d40_desc *desc) { - d40_desc_remove(desc); - desc->is_in_client_list = false; list_add_tail(&desc->node, &d40c->pending_queue); } @@ -808,7 +803,6 @@ static int d40_channel_execute_command(struct d40_chan *d40c, static void d40_term_all(struct d40_chan *d40c) { struct d40_desc *d40d; - struct d40_desc *_d; /* Release active descriptors */ while ((d40d = d40_first_active_get(d40c))) { @@ -828,21 +822,6 @@ static void d40_term_all(struct d40_chan *d40c) d40_desc_free(d40c, d40d); } - /* Release client owned descriptors */ - if (!list_empty(&d40c->client)) - list_for_each_entry_safe(d40d, _d, &d40c->client, node) { - d40_desc_remove(d40d); - d40_desc_free(d40c, d40d); - } - - /* Release descriptors in prepare queue */ - if (!list_empty(&d40c->prepare_queue)) - list_for_each_entry_safe(d40d, _d, - &d40c->prepare_queue, node) { - d40_desc_remove(d40d); - d40_desc_free(d40c, d40d); - } - d40c->pending_tx = 0; d40c->busy = false; } @@ -1229,6 +1208,7 @@ static void dma_tasklet(unsigned long data) if (!d40d->cyclic) { if (async_tx_test_ack(&d40d->txd)) { + d40_pool_lli_free(d40c, d40d); d40_desc_remove(d40d); d40_desc_free(d40c, d40d); } else { @@ -1615,10 +1595,21 @@ static int d40_free_dma(struct d40_chan *d40c) u32 event; struct d40_phy_res *phy = d40c->phy_chan; bool is_src; + struct d40_desc *d; + struct d40_desc *_d; + /* Terminate all queued and active transfers */ d40_term_all(d40c); + /* Release client owned descriptors */ + if (!list_empty(&d40c->client)) + list_for_each_entry_safe(d, _d, &d40c->client, node) { + d40_pool_lli_free(d40c, d); + d40_desc_remove(d); + d40_desc_free(d40c, d); + } + if (phy == NULL) { chan_err(d40c, "phy == null\n"); return -EINVAL; @@ -1920,12 +1911,6 @@ d40_prep_sg(struct dma_chan *dchan, struct scatterlist *sg_src, goto err; } - /* - * add descriptor to the prepare queue in order to be able - * to free them later in terminate_all - */ - list_add_tail(&desc->node, &chan->prepare_queue); - spin_unlock_irqrestore(&chan->lock, flags); return &desc->txd; @@ -2415,7 +2400,6 @@ static void __init d40_chan_init(struct d40_base *base, struct dma_device *dma, INIT_LIST_HEAD(&d40c->queue); INIT_LIST_HEAD(&d40c->pending_queue); INIT_LIST_HEAD(&d40c->client); - INIT_LIST_HEAD(&d40c->prepare_queue); tasklet_init(&d40c->tasklet, dma_tasklet, (unsigned long) d40c); diff --git a/trunk/drivers/gpu/drm/radeon/evergreen.c b/trunk/drivers/gpu/drm/radeon/evergreen.c index dc0a5b56c81a..d8d71a399f52 100644 --- a/trunk/drivers/gpu/drm/radeon/evergreen.c +++ b/trunk/drivers/gpu/drm/radeon/evergreen.c @@ -41,31 +41,6 @@ static void evergreen_gpu_init(struct radeon_device *rdev); void evergreen_fini(struct radeon_device *rdev); static void evergreen_pcie_gen2_enable(struct radeon_device *rdev); -void evergreen_fix_pci_max_read_req_size(struct radeon_device *rdev) -{ - u16 ctl, v; - int cap, err; - - cap = pci_pcie_cap(rdev->pdev); - if (!cap) - return; - - err = pci_read_config_word(rdev->pdev, cap + PCI_EXP_DEVCTL, &ctl); - if (err) - return; - - v = (ctl & PCI_EXP_DEVCTL_READRQ) >> 12; - - /* if bios or OS sets MAX_READ_REQUEST_SIZE to an invalid value, fix it - * to avoid hangs or perfomance issues - */ - if ((v == 0) || (v == 6) || (v == 7)) { - ctl &= ~PCI_EXP_DEVCTL_READRQ; - ctl |= (2 << 12); - pci_write_config_word(rdev->pdev, cap + PCI_EXP_DEVCTL, ctl); - } -} - void evergreen_pre_page_flip(struct radeon_device *rdev, int crtc) { /* enable the pflip int */ @@ -1888,8 +1863,6 @@ static void evergreen_gpu_init(struct radeon_device *rdev) WREG32(GRBM_CNTL, GRBM_READ_TIMEOUT(0xff)); - evergreen_fix_pci_max_read_req_size(rdev); - cc_gc_shader_pipe_config = RREG32(CC_GC_SHADER_PIPE_CONFIG) & ~2; cc_gc_shader_pipe_config |= diff --git a/trunk/drivers/gpu/drm/radeon/ni.c b/trunk/drivers/gpu/drm/radeon/ni.c index cbf57d75d925..a2e00fa9c618 100644 --- a/trunk/drivers/gpu/drm/radeon/ni.c +++ b/trunk/drivers/gpu/drm/radeon/ni.c @@ -39,7 +39,6 @@ extern int evergreen_mc_wait_for_idle(struct radeon_device *rdev); extern void evergreen_mc_program(struct radeon_device *rdev); extern void evergreen_irq_suspend(struct radeon_device *rdev); extern int evergreen_mc_init(struct radeon_device *rdev); -extern void evergreen_fix_pci_max_read_req_size(struct radeon_device *rdev); #define EVERGREEN_PFP_UCODE_SIZE 1120 #define EVERGREEN_PM4_UCODE_SIZE 1376 @@ -670,8 +669,6 @@ static void cayman_gpu_init(struct radeon_device *rdev) WREG32(GRBM_CNTL, GRBM_READ_TIMEOUT(0xff)); - evergreen_fix_pci_max_read_req_size(rdev); - mc_shared_chmap = RREG32(MC_SHARED_CHMAP); mc_arb_ramcfg = RREG32(MC_ARB_RAMCFG); diff --git a/trunk/drivers/gpu/drm/radeon/radeon_clocks.c b/trunk/drivers/gpu/drm/radeon/radeon_clocks.c index b6e18c8db9f5..dcd0863e31ae 100644 --- a/trunk/drivers/gpu/drm/radeon/radeon_clocks.c +++ b/trunk/drivers/gpu/drm/radeon/radeon_clocks.c @@ -219,9 +219,6 @@ void radeon_get_clock_info(struct drm_device *dev) } else { DRM_INFO("Using generic clock info\n"); - /* may need to be per card */ - rdev->clock.max_pixel_clock = 35000; - if (rdev->flags & RADEON_IS_IGP) { p1pll->reference_freq = 1432; p2pll->reference_freq = 1432; diff --git a/trunk/drivers/hid/hid-ids.h b/trunk/drivers/hid/hid-ids.h index 7484e1b67249..7d27d2b0445a 100644 --- a/trunk/drivers/hid/hid-ids.h +++ b/trunk/drivers/hid/hid-ids.h @@ -277,7 +277,6 @@ #define USB_DEVICE_ID_PENPOWER 0x00f4 #define USB_VENDOR_ID_GREENASIA 0x0e8f -#define USB_DEVICE_ID_GREENASIA_DUAL_USB_JOYPAD 0x3013 #define USB_VENDOR_ID_GRETAGMACBETH 0x0971 #define USB_DEVICE_ID_GRETAGMACBETH_HUEY 0x2005 diff --git a/trunk/drivers/hid/hid-magicmouse.c b/trunk/drivers/hid/hid-magicmouse.c index f0fbd7bd239e..0ec91c18a421 100644 --- a/trunk/drivers/hid/hid-magicmouse.c +++ b/trunk/drivers/hid/hid-magicmouse.c @@ -81,28 +81,6 @@ MODULE_PARM_DESC(report_undeciphered, "Report undeciphered multi-touch state fie #define NO_TOUCHES -1 #define SINGLE_TOUCH_UP -2 -/* Touch surface information. Dimension is in hundredths of a mm, min and max - * are in units. */ -#define MOUSE_DIMENSION_X (float)9056 -#define MOUSE_MIN_X -1100 -#define MOUSE_MAX_X 1258 -#define MOUSE_RES_X ((MOUSE_MAX_X - MOUSE_MIN_X) / (MOUSE_DIMENSION_X / 100)) -#define MOUSE_DIMENSION_Y (float)5152 -#define MOUSE_MIN_Y -1589 -#define MOUSE_MAX_Y 2047 -#define MOUSE_RES_Y ((MOUSE_MAX_Y - MOUSE_MIN_Y) / (MOUSE_DIMENSION_Y / 100)) - -#define TRACKPAD_DIMENSION_X (float)13000 -#define TRACKPAD_MIN_X -2909 -#define TRACKPAD_MAX_X 3167 -#define TRACKPAD_RES_X \ - ((TRACKPAD_MAX_X - TRACKPAD_MIN_X) / (TRACKPAD_DIMENSION_X / 100)) -#define TRACKPAD_DIMENSION_Y (float)11000 -#define TRACKPAD_MIN_Y -2456 -#define TRACKPAD_MAX_Y 2565 -#define TRACKPAD_RES_Y \ - ((TRACKPAD_MAX_Y - TRACKPAD_MIN_Y) / (TRACKPAD_DIMENSION_Y / 100)) - /** * struct magicmouse_sc - Tracks Magic Mouse-specific data. * @input: Input device through which we report events. @@ -428,31 +406,17 @@ static void magicmouse_setup_input(struct input_dev *input, struct hid_device *h * inverse of the reported Y. */ if (input->id.product == USB_DEVICE_ID_APPLE_MAGICMOUSE) { - input_set_abs_params(input, ABS_MT_POSITION_X, - MOUSE_MIN_X, MOUSE_MAX_X, 4, 0); - input_set_abs_params(input, ABS_MT_POSITION_Y, - MOUSE_MIN_Y, MOUSE_MAX_Y, 4, 0); - - input_abs_set_res(input, ABS_MT_POSITION_X, - MOUSE_RES_X); - input_abs_set_res(input, ABS_MT_POSITION_Y, - MOUSE_RES_Y); + input_set_abs_params(input, ABS_MT_POSITION_X, -1100, + 1358, 4, 0); + input_set_abs_params(input, ABS_MT_POSITION_Y, -1589, + 2047, 4, 0); } else { /* USB_DEVICE_ID_APPLE_MAGICTRACKPAD */ - input_set_abs_params(input, ABS_X, TRACKPAD_MIN_X, - TRACKPAD_MAX_X, 4, 0); - input_set_abs_params(input, ABS_Y, TRACKPAD_MIN_Y, - TRACKPAD_MAX_Y, 4, 0); - input_set_abs_params(input, ABS_MT_POSITION_X, - TRACKPAD_MIN_X, TRACKPAD_MAX_X, 4, 0); - input_set_abs_params(input, ABS_MT_POSITION_Y, - TRACKPAD_MIN_Y, TRACKPAD_MAX_Y, 4, 0); - - input_abs_set_res(input, ABS_X, TRACKPAD_RES_X); - input_abs_set_res(input, ABS_Y, TRACKPAD_RES_Y); - input_abs_set_res(input, ABS_MT_POSITION_X, - TRACKPAD_RES_X); - input_abs_set_res(input, ABS_MT_POSITION_Y, - TRACKPAD_RES_Y); + input_set_abs_params(input, ABS_X, -2909, 3167, 4, 0); + input_set_abs_params(input, ABS_Y, -2456, 2565, 4, 0); + input_set_abs_params(input, ABS_MT_POSITION_X, -2909, + 3167, 4, 0); + input_set_abs_params(input, ABS_MT_POSITION_Y, -2456, + 2565, 4, 0); } input_set_events_per_packet(input, 60); @@ -537,17 +501,9 @@ static int magicmouse_probe(struct hid_device *hdev, } report->size = 6; - /* - * Some devices repond with 'invalid report id' when feature - * report switching it into multitouch mode is sent to it. - * - * This results in -EIO from the _raw low-level transport callback, - * but there seems to be no other way of switching the mode. - * Thus the super-ugly hacky success check below. - */ ret = hdev->hid_output_raw_report(hdev, feature, sizeof(feature), HID_FEATURE_REPORT); - if (ret != -EIO && ret != sizeof(feature)) { + if (ret != sizeof(feature)) { hid_err(hdev, "unable to request touch data (%d)\n", ret); goto err_stop_hw; } diff --git a/trunk/drivers/hid/hid-wacom.c b/trunk/drivers/hid/hid-wacom.c index a597039d0755..06888323828c 100644 --- a/trunk/drivers/hid/hid-wacom.c +++ b/trunk/drivers/hid/hid-wacom.c @@ -353,7 +353,11 @@ static int wacom_probe(struct hid_device *hdev, if (ret) { hid_warn(hdev, "can't create sysfs battery attribute, err: %d\n", ret); - goto err_battery; + /* + * battery attribute is not critical for the tablet, but if it + * failed then there is no need to create ac attribute + */ + goto move_on; } wdata->ac.properties = wacom_ac_props; @@ -367,8 +371,14 @@ static int wacom_probe(struct hid_device *hdev, if (ret) { hid_warn(hdev, "can't create ac battery attribute, err: %d\n", ret); - goto err_ac; + /* + * ac attribute is not critical for the tablet, but if it + * failed then we don't want to battery attribute to exist + */ + power_supply_unregister(&wdata->battery); } + +move_on: #endif hidinput = list_entry(hdev->inputs.next, struct hid_input, list); input = hidinput->input; @@ -406,13 +416,6 @@ static int wacom_probe(struct hid_device *hdev, return 0; -#ifdef CONFIG_HID_WACOM_POWER_SUPPLY -err_ac: - power_supply_unregister(&wdata->battery); -err_battery: - device_remove_file(&hdev->dev, &dev_attr_speed); - hid_hw_stop(hdev); -#endif err_free: kfree(wdata); return ret; @@ -423,7 +426,6 @@ static void wacom_remove(struct hid_device *hdev) #ifdef CONFIG_HID_WACOM_POWER_SUPPLY struct wacom_data *wdata = hid_get_drvdata(hdev); #endif - device_remove_file(&hdev->dev, &dev_attr_speed); hid_hw_stop(hdev); #ifdef CONFIG_HID_WACOM_POWER_SUPPLY diff --git a/trunk/drivers/hid/usbhid/hid-quirks.c b/trunk/drivers/hid/usbhid/hid-quirks.c index 3146fdcda272..4bdb5d46c52c 100644 --- a/trunk/drivers/hid/usbhid/hid-quirks.c +++ b/trunk/drivers/hid/usbhid/hid-quirks.c @@ -47,7 +47,6 @@ static const struct hid_blacklist { { USB_VENDOR_ID_AFATECH, USB_DEVICE_ID_AFATECH_AF9016, HID_QUIRK_FULLSPEED_INTERVAL }, { USB_VENDOR_ID_ETURBOTOUCH, USB_DEVICE_ID_ETURBOTOUCH, HID_QUIRK_MULTI_INPUT }, - { USB_VENDOR_ID_GREENASIA, USB_DEVICE_ID_GREENASIA_DUAL_USB_JOYPAD, HID_QUIRK_MULTI_INPUT }, { USB_VENDOR_ID_PANTHERLORD, USB_DEVICE_ID_PANTHERLORD_TWIN_USB_JOYSTICK, HID_QUIRK_MULTI_INPUT | HID_QUIRK_SKIP_OUTPUT_REPORTS }, { USB_VENDOR_ID_PLAYDOTCOM, USB_DEVICE_ID_PLAYDOTCOM_EMS_USBII, HID_QUIRK_MULTI_INPUT }, { USB_VENDOR_ID_TOUCHPACK, USB_DEVICE_ID_TOUCHPACK_RTS, HID_QUIRK_MULTI_INPUT }, diff --git a/trunk/drivers/hwmon/max16065.c b/trunk/drivers/hwmon/max16065.c index dd2d7b9620c2..d94a24fdf4ba 100644 --- a/trunk/drivers/hwmon/max16065.c +++ b/trunk/drivers/hwmon/max16065.c @@ -124,7 +124,7 @@ static inline int MV_TO_LIMIT(int mv, int range) static inline int ADC_TO_CURR(int adc, int gain) { - return adc * 1400000 / (gain * 255); + return adc * 1400000 / gain * 255; } /* diff --git a/trunk/drivers/hwmon/pmbus/ucd9000.c b/trunk/drivers/hwmon/pmbus/ucd9000.c index d0ddb60155c9..ace1c7319734 100644 --- a/trunk/drivers/hwmon/pmbus/ucd9000.c +++ b/trunk/drivers/hwmon/pmbus/ucd9000.c @@ -141,11 +141,13 @@ static int ucd9000_probe(struct i2c_client *client, block_buffer[ret] = '\0'; dev_info(&client->dev, "Device ID %s\n", block_buffer); - for (mid = ucd9000_id; mid->name[0]; mid++) { + mid = NULL; + for (i = 0; i < ARRAY_SIZE(ucd9000_id); i++) { + mid = &ucd9000_id[i]; if (!strncasecmp(mid->name, block_buffer, strlen(mid->name))) break; } - if (!mid->name[0]) { + if (!mid || !strlen(mid->name)) { dev_err(&client->dev, "Unsupported device\n"); return -ENODEV; } diff --git a/trunk/drivers/hwmon/pmbus/ucd9200.c b/trunk/drivers/hwmon/pmbus/ucd9200.c index c65e9da707cc..ffcc1cf3609d 100644 --- a/trunk/drivers/hwmon/pmbus/ucd9200.c +++ b/trunk/drivers/hwmon/pmbus/ucd9200.c @@ -68,11 +68,13 @@ static int ucd9200_probe(struct i2c_client *client, block_buffer[ret] = '\0'; dev_info(&client->dev, "Device ID %s\n", block_buffer); - for (mid = ucd9200_id; mid->name[0]; mid++) { + mid = NULL; + for (i = 0; i < ARRAY_SIZE(ucd9200_id); i++) { + mid = &ucd9200_id[i]; if (!strncasecmp(mid->name, block_buffer, strlen(mid->name))) break; } - if (!mid->name[0]) { + if (!mid || !strlen(mid->name)) { dev_err(&client->dev, "Unsupported device\n"); return -ENODEV; } diff --git a/trunk/drivers/i2c/busses/i2c-pxa-pci.c b/trunk/drivers/i2c/busses/i2c-pxa-pci.c index b73da6cd6f91..6659d269b841 100644 --- a/trunk/drivers/i2c/busses/i2c-pxa-pci.c +++ b/trunk/drivers/i2c/busses/i2c-pxa-pci.c @@ -109,15 +109,12 @@ static int __devinit ce4100_i2c_probe(struct pci_dev *dev, return -EINVAL; } sds = kzalloc(sizeof(*sds), GFP_KERNEL); - if (!sds) { - ret = -ENOMEM; + if (!sds) goto err_mem; - } for (i = 0; i < ARRAY_SIZE(sds->pdev); i++) { sds->pdev[i] = add_i2c_device(dev, i); if (IS_ERR(sds->pdev[i])) { - ret = PTR_ERR(sds->pdev[i]); while (--i >= 0) platform_device_unregister(sds->pdev[i]); goto err_dev_add; diff --git a/trunk/drivers/i2c/busses/i2c-tegra.c b/trunk/drivers/i2c/busses/i2c-tegra.c index 3c94c4a81a55..2440b7411978 100644 --- a/trunk/drivers/i2c/busses/i2c-tegra.c +++ b/trunk/drivers/i2c/busses/i2c-tegra.c @@ -270,30 +270,14 @@ static int tegra_i2c_fill_tx_fifo(struct tegra_i2c_dev *i2c_dev) /* Rounds down to not include partial word at the end of buf */ words_to_transfer = buf_remaining / BYTES_PER_FIFO_WORD; + if (words_to_transfer > tx_fifo_avail) + words_to_transfer = tx_fifo_avail; - /* It's very common to have < 4 bytes, so optimize that case. */ - if (words_to_transfer) { - if (words_to_transfer > tx_fifo_avail) - words_to_transfer = tx_fifo_avail; - - /* - * Update state before writing to FIFO. If this casues us - * to finish writing all bytes (AKA buf_remaining goes to 0) we - * have a potential for an interrupt (PACKET_XFER_COMPLETE is - * not maskable). We need to make sure that the isr sees - * buf_remaining as 0 and doesn't call us back re-entrantly. - */ - buf_remaining -= words_to_transfer * BYTES_PER_FIFO_WORD; - tx_fifo_avail -= words_to_transfer; - i2c_dev->msg_buf_remaining = buf_remaining; - i2c_dev->msg_buf = buf + - words_to_transfer * BYTES_PER_FIFO_WORD; - barrier(); - - i2c_writesl(i2c_dev, buf, I2C_TX_FIFO, words_to_transfer); - - buf += words_to_transfer * BYTES_PER_FIFO_WORD; - } + i2c_writesl(i2c_dev, buf, I2C_TX_FIFO, words_to_transfer); + + buf += words_to_transfer * BYTES_PER_FIFO_WORD; + buf_remaining -= words_to_transfer * BYTES_PER_FIFO_WORD; + tx_fifo_avail -= words_to_transfer; /* * If there is a partial word at the end of buf, handle it manually to @@ -303,15 +287,14 @@ static int tegra_i2c_fill_tx_fifo(struct tegra_i2c_dev *i2c_dev) if (tx_fifo_avail > 0 && buf_remaining > 0) { BUG_ON(buf_remaining > 3); memcpy(&val, buf, buf_remaining); - - /* Again update before writing to FIFO to make sure isr sees. */ - i2c_dev->msg_buf_remaining = 0; - i2c_dev->msg_buf = NULL; - barrier(); - i2c_writel(i2c_dev, val, I2C_TX_FIFO); + buf_remaining = 0; + tx_fifo_avail--; } + BUG_ON(tx_fifo_avail > 0 && buf_remaining > 0); + i2c_dev->msg_buf_remaining = buf_remaining; + i2c_dev->msg_buf = buf; return 0; } @@ -428,10 +411,9 @@ static irqreturn_t tegra_i2c_isr(int irq, void *dev_id) tegra_i2c_mask_irq(i2c_dev, I2C_INT_TX_FIFO_DATA_REQ); } - if (status & I2C_INT_PACKET_XFER_COMPLETE) { - BUG_ON(i2c_dev->msg_buf_remaining); + if ((status & I2C_INT_PACKET_XFER_COMPLETE) && + !i2c_dev->msg_buf_remaining) complete(&i2c_dev->msg_complete); - } i2c_writel(i2c_dev, status, I2C_INT_STATUS); if (i2c_dev->is_dvc) @@ -549,7 +531,7 @@ static int tegra_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], static u32 tegra_i2c_func(struct i2c_adapter *adap) { - return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL; + return I2C_FUNC_I2C; } static const struct i2c_algorithm tegra_i2c_algo = { @@ -737,17 +719,6 @@ static int tegra_i2c_resume(struct platform_device *pdev) } #endif -#if defined(CONFIG_OF) -/* Match table for of_platform binding */ -static const struct of_device_id tegra_i2c_of_match[] __devinitconst = { - { .compatible = "nvidia,tegra20-i2c", }, - {}, -}; -MODULE_DEVICE_TABLE(of, tegra_i2c_of_match); -#else -#define tegra_i2c_of_match NULL -#endif - static struct platform_driver tegra_i2c_driver = { .probe = tegra_i2c_probe, .remove = tegra_i2c_remove, @@ -758,7 +729,6 @@ static struct platform_driver tegra_i2c_driver = { .driver = { .name = "tegra-i2c", .owner = THIS_MODULE, - .of_match_table = tegra_i2c_of_match, }, }; diff --git a/trunk/drivers/iommu/amd_iommu.c b/trunk/drivers/iommu/amd_iommu.c index 0e4227f457af..a14f8dc23462 100644 --- a/trunk/drivers/iommu/amd_iommu.c +++ b/trunk/drivers/iommu/amd_iommu.c @@ -605,9 +605,7 @@ static void build_inv_all(struct iommu_cmd *cmd) * Writes the command to the IOMMUs command buffer and informs the * hardware about the new command. */ -static int iommu_queue_command_sync(struct amd_iommu *iommu, - struct iommu_cmd *cmd, - bool sync) +static int iommu_queue_command(struct amd_iommu *iommu, struct iommu_cmd *cmd) { u32 left, tail, head, next_tail; unsigned long flags; @@ -641,18 +639,13 @@ static int iommu_queue_command_sync(struct amd_iommu *iommu, copy_cmd_to_buffer(iommu, cmd, tail); /* We need to sync now to make sure all commands are processed */ - iommu->need_sync = sync; + iommu->need_sync = true; spin_unlock_irqrestore(&iommu->lock, flags); return 0; } -static int iommu_queue_command(struct amd_iommu *iommu, struct iommu_cmd *cmd) -{ - return iommu_queue_command_sync(iommu, cmd, true); -} - /* * This function queues a completion wait command into the command * buffer of an IOMMU @@ -668,7 +661,7 @@ static int iommu_completion_wait(struct amd_iommu *iommu) build_completion_wait(&cmd, (u64)&sem); - ret = iommu_queue_command_sync(iommu, &cmd, false); + ret = iommu_queue_command(iommu, &cmd); if (ret) return ret; @@ -847,9 +840,14 @@ static void domain_flush_complete(struct protection_domain *domain) static void domain_flush_devices(struct protection_domain *domain) { struct iommu_dev_data *dev_data; + unsigned long flags; + + spin_lock_irqsave(&domain->lock, flags); list_for_each_entry(dev_data, &domain->dev_list, list) device_flush_dte(dev_data); + + spin_unlock_irqrestore(&domain->lock, flags); } /**************************************************************************** diff --git a/trunk/drivers/md/linear.h b/trunk/drivers/md/linear.h index 2f2da05b2ce9..0ce29b61605a 100644 --- a/trunk/drivers/md/linear.h +++ b/trunk/drivers/md/linear.h @@ -10,9 +10,9 @@ typedef struct dev_info dev_info_t; struct linear_private_data { - struct rcu_head rcu; sector_t array_sectors; dev_info_t disks[0]; + struct rcu_head rcu; }; diff --git a/trunk/drivers/md/md.c b/trunk/drivers/md/md.c index 5404b2295820..8e221a20f5d9 100644 --- a/trunk/drivers/md/md.c +++ b/trunk/drivers/md/md.c @@ -848,7 +848,7 @@ void md_super_write(mddev_t *mddev, mdk_rdev_t *rdev, bio->bi_end_io = super_written; atomic_inc(&mddev->pending_writes); - submit_bio(WRITE_FLUSH_FUA, bio); + submit_bio(REQ_WRITE | REQ_SYNC | REQ_FLUSH | REQ_FUA, bio); } void md_super_wait(mddev_t *mddev) @@ -1138,11 +1138,8 @@ static int super_90_load(mdk_rdev_t *rdev, mdk_rdev_t *refdev, int minor_version ret = 0; } rdev->sectors = rdev->sb_start; - /* Limit to 4TB as metadata cannot record more than that */ - if (rdev->sectors >= (2ULL << 32)) - rdev->sectors = (2ULL << 32) - 2; - if (rdev->sectors < ((sector_t)sb->size) * 2 && sb->level >= 1) + if (rdev->sectors < sb->size * 2 && sb->level > 1) /* "this cannot possibly happen" ... */ ret = -EINVAL; @@ -1176,7 +1173,7 @@ static int super_90_validate(mddev_t *mddev, mdk_rdev_t *rdev) mddev->clevel[0] = 0; mddev->layout = sb->layout; mddev->raid_disks = sb->raid_disks; - mddev->dev_sectors = ((sector_t)sb->size) * 2; + mddev->dev_sectors = sb->size * 2; mddev->events = ev1; mddev->bitmap_info.offset = 0; mddev->bitmap_info.default_offset = MD_SB_BYTES >> 9; @@ -1418,11 +1415,6 @@ super_90_rdev_size_change(mdk_rdev_t *rdev, sector_t num_sectors) rdev->sb_start = calc_dev_sboffset(rdev); if (!num_sectors || num_sectors > rdev->sb_start) num_sectors = rdev->sb_start; - /* Limit to 4TB as metadata cannot record more than that. - * 4TB == 2^32 KB, or 2*2^32 sectors. - */ - if (num_sectors >= (2ULL << 32)) - num_sectors = (2ULL << 32) - 2; md_super_write(rdev->mddev, rdev, rdev->sb_start, rdev->sb_size, rdev->sb_page); md_super_wait(rdev->mddev); @@ -1746,11 +1738,6 @@ static void super_1_sync(mddev_t *mddev, mdk_rdev_t *rdev) sb->level = cpu_to_le32(mddev->level); sb->layout = cpu_to_le32(mddev->layout); - if (test_bit(WriteMostly, &rdev->flags)) - sb->devflags |= WriteMostly1; - else - sb->devflags &= ~WriteMostly1; - if (mddev->bitmap && mddev->bitmap_info.file == NULL) { sb->bitmap_offset = cpu_to_le32((__u32)mddev->bitmap_info.offset); sb->feature_map = cpu_to_le32(MD_FEATURE_BITMAP_OFFSET); @@ -2574,10 +2561,7 @@ state_store(mdk_rdev_t *rdev, const char *buf, size_t len) int err = -EINVAL; if (cmd_match(buf, "faulty") && rdev->mddev->pers) { md_error(rdev->mddev, rdev); - if (test_bit(Faulty, &rdev->flags)) - err = 0; - else - err = -EBUSY; + err = 0; } else if (cmd_match(buf, "remove")) { if (rdev->raid_disk >= 0) err = -EBUSY; @@ -2600,7 +2584,7 @@ state_store(mdk_rdev_t *rdev, const char *buf, size_t len) err = 0; } else if (cmd_match(buf, "-blocked")) { if (!test_bit(Faulty, &rdev->flags) && - rdev->badblocks.unacked_exist) { + test_bit(BlockedBadBlocks, &rdev->flags)) { /* metadata handler doesn't understand badblocks, * so we need to fail the device */ @@ -5999,8 +5983,6 @@ static int set_disk_faulty(mddev_t *mddev, dev_t dev) return -ENODEV; md_error(mddev, rdev); - if (!test_bit(Faulty, &rdev->flags)) - return -EBUSY; return 0; } diff --git a/trunk/drivers/md/raid1.c b/trunk/drivers/md/raid1.c index f4622dd8fc59..32323f0afd89 100644 --- a/trunk/drivers/md/raid1.c +++ b/trunk/drivers/md/raid1.c @@ -1099,11 +1099,12 @@ static int make_request(mddev_t *mddev, struct bio * bio) bio_list_add(&conf->pending_bio_list, mbio); spin_unlock_irqrestore(&conf->device_lock, flags); } - /* Mustn't call r1_bio_write_done before this next test, - * as it could result in the bio being freed. - */ + r1_bio_write_done(r1_bio); + + /* In case raid1d snuck in to freeze_array */ + wake_up(&conf->wait_barrier); + if (sectors_handled < (bio->bi_size >> 9)) { - r1_bio_write_done(r1_bio); /* We need another r1_bio. It has already been counted * in bio->bi_phys_segments */ @@ -1116,11 +1117,6 @@ static int make_request(mddev_t *mddev, struct bio * bio) goto retry_write; } - r1_bio_write_done(r1_bio); - - /* In case raid1d snuck in to freeze_array */ - wake_up(&conf->wait_barrier); - if (do_sync || !bitmap || !plugged) md_wakeup_thread(mddev->thread); diff --git a/trunk/drivers/md/raid10.c b/trunk/drivers/md/raid10.c index d7a8468ddeab..8b29cd4f01c8 100644 --- a/trunk/drivers/md/raid10.c +++ b/trunk/drivers/md/raid10.c @@ -337,21 +337,6 @@ static void close_write(r10bio_t *r10_bio) md_write_end(r10_bio->mddev); } -static void one_write_done(r10bio_t *r10_bio) -{ - if (atomic_dec_and_test(&r10_bio->remaining)) { - if (test_bit(R10BIO_WriteError, &r10_bio->state)) - reschedule_retry(r10_bio); - else { - close_write(r10_bio); - if (test_bit(R10BIO_MadeGood, &r10_bio->state)) - reschedule_retry(r10_bio); - else - raid_end_bio_io(r10_bio); - } - } -} - static void raid10_end_write_request(struct bio *bio, int error) { int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); @@ -402,7 +387,17 @@ static void raid10_end_write_request(struct bio *bio, int error) * Let's see if all mirrored write operations have finished * already. */ - one_write_done(r10_bio); + if (atomic_dec_and_test(&r10_bio->remaining)) { + if (test_bit(R10BIO_WriteError, &r10_bio->state)) + reschedule_retry(r10_bio); + else { + close_write(r10_bio); + if (test_bit(R10BIO_MadeGood, &r10_bio->state)) + reschedule_retry(r10_bio); + else + raid_end_bio_io(r10_bio); + } + } if (dec_rdev) rdev_dec_pending(conf->mirrors[dev].rdev, conf->mddev); } @@ -1132,12 +1127,20 @@ static int make_request(mddev_t *mddev, struct bio * bio) spin_unlock_irqrestore(&conf->device_lock, flags); } - /* Don't remove the bias on 'remaining' (one_write_done) until - * after checking if we need to go around again. - */ + if (atomic_dec_and_test(&r10_bio->remaining)) { + /* This matches the end of raid10_end_write_request() */ + bitmap_endwrite(r10_bio->mddev->bitmap, r10_bio->sector, + r10_bio->sectors, + !test_bit(R10BIO_Degraded, &r10_bio->state), + 0); + md_write_end(mddev); + raid_end_bio_io(r10_bio); + } + + /* In case raid10d snuck in to freeze_array */ + wake_up(&conf->wait_barrier); if (sectors_handled < (bio->bi_size >> 9)) { - one_write_done(r10_bio); /* We need another r10_bio. It has already been counted * in bio->bi_phys_segments. */ @@ -1151,10 +1154,6 @@ static int make_request(mddev_t *mddev, struct bio * bio) r10_bio->state = 0; goto retry_write; } - one_write_done(r10_bio); - - /* In case raid10d snuck in to freeze_array */ - wake_up(&conf->wait_barrier); if (do_sync || !mddev->bitmap || !plugged) md_wakeup_thread(mddev->thread); diff --git a/trunk/drivers/md/raid5.c b/trunk/drivers/md/raid5.c index 43709fa6b6df..dbae459fb02d 100644 --- a/trunk/drivers/md/raid5.c +++ b/trunk/drivers/md/raid5.c @@ -3336,7 +3336,7 @@ static void handle_stripe(struct stripe_head *sh) finish: /* wait for this device to become unblocked */ - if (conf->mddev->external && unlikely(s.blocked_rdev)) + if (unlikely(s.blocked_rdev)) md_wait_for_blocked_rdev(s.blocked_rdev, conf->mddev); if (s.handle_bad_blocks) diff --git a/trunk/drivers/mmc/core/core.c b/trunk/drivers/mmc/core/core.c index b27b94078c21..91a0a7460ebb 100644 --- a/trunk/drivers/mmc/core/core.c +++ b/trunk/drivers/mmc/core/core.c @@ -133,7 +133,7 @@ void mmc_request_done(struct mmc_host *host, struct mmc_request *mrq) if (mrq->done) mrq->done(mrq); - mmc_host_clk_release(host); + mmc_host_clk_gate(host); } } @@ -192,7 +192,7 @@ mmc_start_request(struct mmc_host *host, struct mmc_request *mrq) mrq->stop->mrq = mrq; } } - mmc_host_clk_hold(host); + mmc_host_clk_ungate(host); led_trigger_event(host->led, LED_FULL); host->ops->request(host, mrq); } @@ -728,17 +728,15 @@ static inline void mmc_set_ios(struct mmc_host *host) */ void mmc_set_chip_select(struct mmc_host *host, int mode) { - mmc_host_clk_hold(host); host->ios.chip_select = mode; mmc_set_ios(host); - mmc_host_clk_release(host); } /* * Sets the host clock to the highest possible frequency that * is below "hz". */ -static void __mmc_set_clock(struct mmc_host *host, unsigned int hz) +void mmc_set_clock(struct mmc_host *host, unsigned int hz) { WARN_ON(hz < host->f_min); @@ -749,13 +747,6 @@ static void __mmc_set_clock(struct mmc_host *host, unsigned int hz) mmc_set_ios(host); } -void mmc_set_clock(struct mmc_host *host, unsigned int hz) -{ - mmc_host_clk_hold(host); - __mmc_set_clock(host, hz); - mmc_host_clk_release(host); -} - #ifdef CONFIG_MMC_CLKGATE /* * This gates the clock by setting it to 0 Hz. @@ -788,7 +779,7 @@ void mmc_ungate_clock(struct mmc_host *host) if (host->clk_old) { BUG_ON(host->ios.clock); /* This call will also set host->clk_gated to false */ - __mmc_set_clock(host, host->clk_old); + mmc_set_clock(host, host->clk_old); } } @@ -816,10 +807,8 @@ void mmc_set_ungated(struct mmc_host *host) */ void mmc_set_bus_mode(struct mmc_host *host, unsigned int mode) { - mmc_host_clk_hold(host); host->ios.bus_mode = mode; mmc_set_ios(host); - mmc_host_clk_release(host); } /* @@ -827,10 +816,8 @@ void mmc_set_bus_mode(struct mmc_host *host, unsigned int mode) */ void mmc_set_bus_width(struct mmc_host *host, unsigned int width) { - mmc_host_clk_hold(host); host->ios.bus_width = width; mmc_set_ios(host); - mmc_host_clk_release(host); } /** @@ -1028,10 +1015,8 @@ u32 mmc_select_voltage(struct mmc_host *host, u32 ocr) ocr &= 3 << bit; - mmc_host_clk_hold(host); host->ios.vdd = bit; mmc_set_ios(host); - mmc_host_clk_release(host); } else { pr_warning("%s: host doesn't support card's voltages\n", mmc_hostname(host)); @@ -1078,10 +1063,8 @@ int mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage, bool cmd11 */ void mmc_set_timing(struct mmc_host *host, unsigned int timing) { - mmc_host_clk_hold(host); host->ios.timing = timing; mmc_set_ios(host); - mmc_host_clk_release(host); } /* @@ -1089,10 +1072,8 @@ void mmc_set_timing(struct mmc_host *host, unsigned int timing) */ void mmc_set_driver_type(struct mmc_host *host, unsigned int drv_type) { - mmc_host_clk_hold(host); host->ios.drv_type = drv_type; mmc_set_ios(host); - mmc_host_clk_release(host); } /* @@ -1110,8 +1091,6 @@ static void mmc_power_up(struct mmc_host *host) { int bit; - mmc_host_clk_hold(host); - /* If ocr is set, we use it */ if (host->ocr) bit = ffs(host->ocr) - 1; @@ -1147,14 +1126,10 @@ static void mmc_power_up(struct mmc_host *host) * time required to reach a stable voltage. */ mmc_delay(10); - - mmc_host_clk_release(host); } static void mmc_power_off(struct mmc_host *host) { - mmc_host_clk_hold(host); - host->ios.clock = 0; host->ios.vdd = 0; @@ -1172,8 +1147,6 @@ static void mmc_power_off(struct mmc_host *host) host->ios.bus_width = MMC_BUS_WIDTH_1; host->ios.timing = MMC_TIMING_LEGACY; mmc_set_ios(host); - - mmc_host_clk_release(host); } /* diff --git a/trunk/drivers/mmc/core/host.c b/trunk/drivers/mmc/core/host.c index 793d0a0dad8d..b29d3e8fd3a2 100644 --- a/trunk/drivers/mmc/core/host.c +++ b/trunk/drivers/mmc/core/host.c @@ -119,14 +119,14 @@ static void mmc_host_clk_gate_work(struct work_struct *work) } /** - * mmc_host_clk_hold - ungate hardware MCI clocks + * mmc_host_clk_ungate - ungate hardware MCI clocks * @host: host to ungate. * * Makes sure the host ios.clock is restored to a non-zero value * past this call. Increase clock reference count and ungate clock * if we're the first user. */ -void mmc_host_clk_hold(struct mmc_host *host) +void mmc_host_clk_ungate(struct mmc_host *host) { unsigned long flags; @@ -164,14 +164,14 @@ static bool mmc_host_may_gate_card(struct mmc_card *card) } /** - * mmc_host_clk_release - gate off hardware MCI clocks + * mmc_host_clk_gate - gate off hardware MCI clocks * @host: host to gate. * * Calls the host driver with ios.clock set to zero as often as possible * in order to gate off hardware MCI clocks. Decrease clock reference * count and schedule disabling of clock. */ -void mmc_host_clk_release(struct mmc_host *host) +void mmc_host_clk_gate(struct mmc_host *host) { unsigned long flags; @@ -179,7 +179,7 @@ void mmc_host_clk_release(struct mmc_host *host) host->clk_requests--; if (mmc_host_may_gate_card(host->card) && !host->clk_requests) - queue_work(system_nrt_wq, &host->clk_gate_work); + schedule_work(&host->clk_gate_work); spin_unlock_irqrestore(&host->clk_lock, flags); } @@ -231,7 +231,7 @@ static inline void mmc_host_clk_exit(struct mmc_host *host) if (cancel_work_sync(&host->clk_gate_work)) mmc_host_clk_gate_delayed(host); if (host->clk_gated) - mmc_host_clk_hold(host); + mmc_host_clk_ungate(host); /* There should be only one user now */ WARN_ON(host->clk_requests > 1); } diff --git a/trunk/drivers/mmc/core/host.h b/trunk/drivers/mmc/core/host.h index fb8a5cd2e4a1..de199f911928 100644 --- a/trunk/drivers/mmc/core/host.h +++ b/trunk/drivers/mmc/core/host.h @@ -16,16 +16,16 @@ int mmc_register_host_class(void); void mmc_unregister_host_class(void); #ifdef CONFIG_MMC_CLKGATE -void mmc_host_clk_hold(struct mmc_host *host); -void mmc_host_clk_release(struct mmc_host *host); +void mmc_host_clk_ungate(struct mmc_host *host); +void mmc_host_clk_gate(struct mmc_host *host); unsigned int mmc_host_clk_rate(struct mmc_host *host); #else -static inline void mmc_host_clk_hold(struct mmc_host *host) +static inline void mmc_host_clk_ungate(struct mmc_host *host) { } -static inline void mmc_host_clk_release(struct mmc_host *host) +static inline void mmc_host_clk_gate(struct mmc_host *host) { } diff --git a/trunk/drivers/mmc/core/sd.c b/trunk/drivers/mmc/core/sd.c index 0370e03e3142..633975ff2bb3 100644 --- a/trunk/drivers/mmc/core/sd.c +++ b/trunk/drivers/mmc/core/sd.c @@ -469,75 +469,56 @@ static int sd_select_driver_type(struct mmc_card *card, u8 *status) return 0; } -static void sd_update_bus_speed_mode(struct mmc_card *card) +static int sd_set_bus_speed_mode(struct mmc_card *card, u8 *status) { + unsigned int bus_speed = 0, timing = 0; + int err; + /* * If the host doesn't support any of the UHS-I modes, fallback on * default speed. */ if (!(card->host->caps & (MMC_CAP_UHS_SDR12 | MMC_CAP_UHS_SDR25 | - MMC_CAP_UHS_SDR50 | MMC_CAP_UHS_SDR104 | MMC_CAP_UHS_DDR50))) { - card->sd_bus_speed = 0; - return; - } + MMC_CAP_UHS_SDR50 | MMC_CAP_UHS_SDR104 | MMC_CAP_UHS_DDR50))) + return 0; if ((card->host->caps & MMC_CAP_UHS_SDR104) && (card->sw_caps.sd3_bus_mode & SD_MODE_UHS_SDR104)) { - card->sd_bus_speed = UHS_SDR104_BUS_SPEED; + bus_speed = UHS_SDR104_BUS_SPEED; + timing = MMC_TIMING_UHS_SDR104; + card->sw_caps.uhs_max_dtr = UHS_SDR104_MAX_DTR; } else if ((card->host->caps & MMC_CAP_UHS_DDR50) && (card->sw_caps.sd3_bus_mode & SD_MODE_UHS_DDR50)) { - card->sd_bus_speed = UHS_DDR50_BUS_SPEED; + bus_speed = UHS_DDR50_BUS_SPEED; + timing = MMC_TIMING_UHS_DDR50; + card->sw_caps.uhs_max_dtr = UHS_DDR50_MAX_DTR; } else if ((card->host->caps & (MMC_CAP_UHS_SDR104 | MMC_CAP_UHS_SDR50)) && (card->sw_caps.sd3_bus_mode & SD_MODE_UHS_SDR50)) { - card->sd_bus_speed = UHS_SDR50_BUS_SPEED; + bus_speed = UHS_SDR50_BUS_SPEED; + timing = MMC_TIMING_UHS_SDR50; + card->sw_caps.uhs_max_dtr = UHS_SDR50_MAX_DTR; } else if ((card->host->caps & (MMC_CAP_UHS_SDR104 | MMC_CAP_UHS_SDR50 | MMC_CAP_UHS_SDR25)) && (card->sw_caps.sd3_bus_mode & SD_MODE_UHS_SDR25)) { - card->sd_bus_speed = UHS_SDR25_BUS_SPEED; + bus_speed = UHS_SDR25_BUS_SPEED; + timing = MMC_TIMING_UHS_SDR25; + card->sw_caps.uhs_max_dtr = UHS_SDR25_MAX_DTR; } else if ((card->host->caps & (MMC_CAP_UHS_SDR104 | MMC_CAP_UHS_SDR50 | MMC_CAP_UHS_SDR25 | MMC_CAP_UHS_SDR12)) && (card->sw_caps.sd3_bus_mode & SD_MODE_UHS_SDR12)) { - card->sd_bus_speed = UHS_SDR12_BUS_SPEED; - } -} - -static int sd_set_bus_speed_mode(struct mmc_card *card, u8 *status) -{ - int err; - unsigned int timing = 0; - - switch (card->sd_bus_speed) { - case UHS_SDR104_BUS_SPEED: - timing = MMC_TIMING_UHS_SDR104; - card->sw_caps.uhs_max_dtr = UHS_SDR104_MAX_DTR; - break; - case UHS_DDR50_BUS_SPEED: - timing = MMC_TIMING_UHS_DDR50; - card->sw_caps.uhs_max_dtr = UHS_DDR50_MAX_DTR; - break; - case UHS_SDR50_BUS_SPEED: - timing = MMC_TIMING_UHS_SDR50; - card->sw_caps.uhs_max_dtr = UHS_SDR50_MAX_DTR; - break; - case UHS_SDR25_BUS_SPEED: - timing = MMC_TIMING_UHS_SDR25; - card->sw_caps.uhs_max_dtr = UHS_SDR25_MAX_DTR; - break; - case UHS_SDR12_BUS_SPEED: - timing = MMC_TIMING_UHS_SDR12; - card->sw_caps.uhs_max_dtr = UHS_SDR12_MAX_DTR; - break; - default: - return 0; + bus_speed = UHS_SDR12_BUS_SPEED; + timing = MMC_TIMING_UHS_SDR12; + card->sw_caps.uhs_max_dtr = UHS_SDR12_MAX_DTR; } - err = mmc_sd_switch(card, 1, 0, card->sd_bus_speed, status); + card->sd_bus_speed = bus_speed; + err = mmc_sd_switch(card, 1, 0, bus_speed, status); if (err) return err; - if ((status[16] & 0xF) != card->sd_bus_speed) + if ((status[16] & 0xF) != bus_speed) printk(KERN_WARNING "%s: Problem setting bus speed mode!\n", mmc_hostname(card->host)); else { @@ -637,24 +618,18 @@ static int mmc_sd_init_uhs_card(struct mmc_card *card) mmc_set_bus_width(card->host, MMC_BUS_WIDTH_4); } - /* - * Select the bus speed mode depending on host - * and card capability. - */ - sd_update_bus_speed_mode(card); - /* Set the driver strength for the card */ err = sd_select_driver_type(card, status); if (err) goto out; - /* Set current limit for the card */ - err = sd_set_current_limit(card, status); + /* Set bus speed mode of the card */ + err = sd_set_bus_speed_mode(card, status); if (err) goto out; - /* Set bus speed mode of the card */ - err = sd_set_bus_speed_mode(card, status); + /* Set current limit for the card */ + err = sd_set_current_limit(card, status); if (err) goto out; diff --git a/trunk/drivers/mmc/host/sdhci-esdhc-imx.c b/trunk/drivers/mmc/host/sdhci-esdhc-imx.c index 4dc0028086a3..0e9780f5a4a9 100644 --- a/trunk/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/trunk/drivers/mmc/host/sdhci-esdhc-imx.c @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include diff --git a/trunk/drivers/mmc/host/sdhci-s3c.c b/trunk/drivers/mmc/host/sdhci-s3c.c index fe886d6c474a..2bd7bf4fece7 100644 --- a/trunk/drivers/mmc/host/sdhci-s3c.c +++ b/trunk/drivers/mmc/host/sdhci-s3c.c @@ -302,8 +302,6 @@ static int sdhci_s3c_platform_8bit_width(struct sdhci_host *host, int width) ctrl &= ~SDHCI_CTRL_8BITBUS; break; default: - ctrl &= ~SDHCI_CTRL_4BITBUS; - ctrl &= ~SDHCI_CTRL_8BITBUS; break; } diff --git a/trunk/drivers/mmc/host/sh_mobile_sdhi.c b/trunk/drivers/mmc/host/sh_mobile_sdhi.c index 0c4a672f5db6..774f6439d7ce 100644 --- a/trunk/drivers/mmc/host/sh_mobile_sdhi.c +++ b/trunk/drivers/mmc/host/sh_mobile_sdhi.c @@ -120,11 +120,11 @@ static int __devinit sh_mobile_sdhi_probe(struct platform_device *pdev) mmc_data->hclk = clk_get_rate(priv->clk); mmc_data->set_pwr = sh_mobile_sdhi_set_pwr; mmc_data->get_cd = sh_mobile_sdhi_get_cd; + if (mmc_data->flags & TMIO_MMC_HAS_IDLE_WAIT) + mmc_data->write16_hook = sh_mobile_sdhi_write16_hook; mmc_data->capabilities = MMC_CAP_MMC_HIGHSPEED; if (p) { mmc_data->flags = p->tmio_flags; - if (mmc_data->flags & TMIO_MMC_HAS_IDLE_WAIT) - mmc_data->write16_hook = sh_mobile_sdhi_write16_hook; mmc_data->ocr_mask = p->tmio_ocr_mask; mmc_data->capabilities |= p->tmio_caps; diff --git a/trunk/drivers/mtd/ubi/debug.h b/trunk/drivers/mtd/ubi/debug.h index 64fbb0021825..65b5b76cc379 100644 --- a/trunk/drivers/mtd/ubi/debug.h +++ b/trunk/drivers/mtd/ubi/debug.h @@ -181,7 +181,7 @@ static inline int ubi_dbg_is_erase_failure(const struct ubi_device *ubi) #define ubi_dbg_msg(fmt, ...) do { \ if (0) \ - printk(KERN_DEBUG fmt "\n", ##__VA_ARGS__); \ + pr_debug(fmt "\n", ##__VA_ARGS__); \ } while (0) #define dbg_msg(fmt, ...) ubi_dbg_msg(fmt, ##__VA_ARGS__) diff --git a/trunk/drivers/pci/hotplug/pcihp_slot.c b/trunk/drivers/pci/hotplug/pcihp_slot.c index 3ffd9c1acc0a..753b21aaea61 100644 --- a/trunk/drivers/pci/hotplug/pcihp_slot.c +++ b/trunk/drivers/pci/hotplug/pcihp_slot.c @@ -169,9 +169,7 @@ void pci_configure_slot(struct pci_dev *dev) (dev->class >> 8) == PCI_CLASS_BRIDGE_PCI))) return; - if (dev->bus && dev->bus->self) - pcie_bus_configure_settings(dev->bus, - dev->bus->self->pcie_mpss); + pcie_bus_configure_settings(dev->bus, dev->bus->self->pcie_mpss); memset(&hpp, 0, sizeof(hpp)); ret = pci_get_hp_params(dev, &hpp); diff --git a/trunk/drivers/pci/pci.c b/trunk/drivers/pci/pci.c index 4e84fd4a4312..0ce67423a0a3 100644 --- a/trunk/drivers/pci/pci.c +++ b/trunk/drivers/pci/pci.c @@ -77,7 +77,7 @@ unsigned long pci_cardbus_mem_size = DEFAULT_CARDBUS_MEM_SIZE; unsigned long pci_hotplug_io_size = DEFAULT_HOTPLUG_IO_SIZE; unsigned long pci_hotplug_mem_size = DEFAULT_HOTPLUG_MEM_SIZE; -enum pcie_bus_config_types pcie_bus_config = PCIE_BUS_SAFE; +enum pcie_bus_config_types pcie_bus_config = PCIE_BUS_PERFORMANCE; /* * The default CLS is used if arch didn't set CLS explicitly and not diff --git a/trunk/drivers/pci/probe.c b/trunk/drivers/pci/probe.c index b1187ff31d89..8473727b29fa 100644 --- a/trunk/drivers/pci/probe.c +++ b/trunk/drivers/pci/probe.c @@ -1396,37 +1396,34 @@ static void pcie_write_mps(struct pci_dev *dev, int mps) static void pcie_write_mrrs(struct pci_dev *dev, int mps) { - int rc, mrrs, dev_mpss; + int rc, mrrs; - /* In the "safe" case, do not configure the MRRS. There appear to be - * issues with setting MRRS to 0 on a number of devices. - */ - - if (pcie_bus_config != PCIE_BUS_PERFORMANCE) - return; + if (pcie_bus_config == PCIE_BUS_PERFORMANCE) { + int dev_mpss = 128 << dev->pcie_mpss; - dev_mpss = 128 << dev->pcie_mpss; + /* For Max performance, the MRRS must be set to the largest + * supported value. However, it cannot be configured larger + * than the MPS the device or the bus can support. This assumes + * that the largest MRRS available on the device cannot be + * smaller than the device MPSS. + */ + mrrs = mps < dev_mpss ? mps : dev_mpss; + } else + /* In the "safe" case, configure the MRRS for fairness on the + * bus by making all devices have the same size + */ + mrrs = mps; - /* For Max performance, the MRRS must be set to the largest supported - * value. However, it cannot be configured larger than the MPS the - * device or the bus can support. This assumes that the largest MRRS - * available on the device cannot be smaller than the device MPSS. - */ - mrrs = min(mps, dev_mpss); /* MRRS is a R/W register. Invalid values can be written, but a - * subsequent read will verify if the value is acceptable or not. + * subsiquent read will verify if the value is acceptable or not. * If the MRRS value provided is not acceptable (e.g., too large), * shrink the value until it is acceptable to the HW. */ while (mrrs != pcie_get_readrq(dev) && mrrs >= 128) { - dev_warn(&dev->dev, "Attempting to modify the PCI-E MRRS value" - " to %d. If any issues are encountered, please try " - "running with pci=pcie_bus_safe\n", mrrs); rc = pcie_set_readrq(dev, mrrs); if (rc) - dev_err(&dev->dev, - "Failed attempting to set the MRRS\n"); + dev_err(&dev->dev, "Failed attempting to set the MRRS\n"); mrrs /= 2; } @@ -1439,13 +1436,13 @@ static int pcie_bus_configure_set(struct pci_dev *dev, void *data) if (!pci_is_pcie(dev)) return 0; - dev_dbg(&dev->dev, "Dev MPS %d MPSS %d MRRS %d\n", + dev_info(&dev->dev, "Dev MPS %d MPSS %d MRRS %d\n", pcie_get_mps(dev), 128<pcie_mpss, pcie_get_readrq(dev)); pcie_write_mps(dev, mps); pcie_write_mrrs(dev, mps); - dev_dbg(&dev->dev, "Dev MPS %d MPSS %d MRRS %d\n", + dev_info(&dev->dev, "Dev MPS %d MPSS %d MRRS %d\n", pcie_get_mps(dev), 128<pcie_mpss, pcie_get_readrq(dev)); return 0; @@ -1459,6 +1456,9 @@ void pcie_bus_configure_settings(struct pci_bus *bus, u8 mpss) { u8 smpss = mpss; + if (!bus->self) + return; + if (!pci_is_pcie(bus->self)) return; diff --git a/trunk/drivers/rtc/rtc-ep93xx.c b/trunk/drivers/rtc/rtc-ep93xx.c index 14a42a1edc66..335551d333b2 100644 --- a/trunk/drivers/rtc/rtc-ep93xx.c +++ b/trunk/drivers/rtc/rtc-ep93xx.c @@ -36,7 +36,6 @@ */ struct ep93xx_rtc { void __iomem *mmio_base; - struct rtc_device *rtc; }; static int ep93xx_rtc_get_swcomp(struct device *dev, unsigned short *preload, @@ -131,6 +130,7 @@ static int __init ep93xx_rtc_probe(struct platform_device *pdev) { struct ep93xx_rtc *ep93xx_rtc; struct resource *res; + struct rtc_device *rtc; int err; ep93xx_rtc = devm_kzalloc(&pdev->dev, sizeof(*ep93xx_rtc), GFP_KERNEL); @@ -151,12 +151,12 @@ static int __init ep93xx_rtc_probe(struct platform_device *pdev) return -ENXIO; pdev->dev.platform_data = ep93xx_rtc; - platform_set_drvdata(pdev, ep93xx_rtc); + platform_set_drvdata(pdev, rtc); - ep93xx_rtc->rtc = rtc_device_register(pdev->name, + rtc = rtc_device_register(pdev->name, &pdev->dev, &ep93xx_rtc_ops, THIS_MODULE); - if (IS_ERR(ep93xx_rtc->rtc)) { - err = PTR_ERR(ep93xx_rtc->rtc); + if (IS_ERR(rtc)) { + err = PTR_ERR(rtc); goto exit; } @@ -167,7 +167,7 @@ static int __init ep93xx_rtc_probe(struct platform_device *pdev) return 0; fail: - rtc_device_unregister(ep93xx_rtc->rtc); + rtc_device_unregister(rtc); exit: platform_set_drvdata(pdev, NULL); pdev->dev.platform_data = NULL; @@ -176,11 +176,11 @@ static int __init ep93xx_rtc_probe(struct platform_device *pdev) static int __exit ep93xx_rtc_remove(struct platform_device *pdev) { - struct ep93xx_rtc *ep93xx_rtc = platform_get_drvdata(pdev); + struct rtc_device *rtc = platform_get_drvdata(pdev); sysfs_remove_group(&pdev->dev.kobj, &ep93xx_rtc_sysfs_files); platform_set_drvdata(pdev, NULL); - rtc_device_unregister(ep93xx_rtc->rtc); + rtc_device_unregister(rtc); pdev->dev.platform_data = NULL; return 0; diff --git a/trunk/drivers/rtc/rtc-lib.c b/trunk/drivers/rtc/rtc-lib.c index c4cf05731118..075f1708deae 100644 --- a/trunk/drivers/rtc/rtc-lib.c +++ b/trunk/drivers/rtc/rtc-lib.c @@ -85,8 +85,6 @@ void rtc_time_to_tm(unsigned long time, struct rtc_time *tm) time -= tm->tm_hour * 3600; tm->tm_min = time / 60; tm->tm_sec = time - tm->tm_min * 60; - - tm->tm_isdst = 0; } EXPORT_SYMBOL(rtc_time_to_tm); diff --git a/trunk/drivers/rtc/rtc-twl.c b/trunk/drivers/rtc/rtc-twl.c index 20687d55e7a7..9a81f778d6b2 100644 --- a/trunk/drivers/rtc/rtc-twl.c +++ b/trunk/drivers/rtc/rtc-twl.c @@ -362,6 +362,14 @@ static irqreturn_t twl_rtc_interrupt(int irq, void *rtc) int res; u8 rd_reg; +#ifdef CONFIG_LOCKDEP + /* WORKAROUND for lockdep forcing IRQF_DISABLED on us, which + * we don't want and can't tolerate. Although it might be + * friendlier not to borrow this thread context... + */ + local_irq_enable(); +#endif + res = twl_rtc_read_u8(&rd_reg, REG_RTC_STATUS_REG); if (res) goto out; @@ -420,12 +428,24 @@ static struct rtc_class_ops twl_rtc_ops = { static int __devinit twl_rtc_probe(struct platform_device *pdev) { struct rtc_device *rtc; - int ret = -EINVAL; + int ret = 0; int irq = platform_get_irq(pdev, 0); u8 rd_reg; if (irq <= 0) - goto out1; + return -EINVAL; + + rtc = rtc_device_register(pdev->name, + &pdev->dev, &twl_rtc_ops, THIS_MODULE); + if (IS_ERR(rtc)) { + ret = PTR_ERR(rtc); + dev_err(&pdev->dev, "can't register RTC device, err %ld\n", + PTR_ERR(rtc)); + goto out0; + + } + + platform_set_drvdata(pdev, rtc); ret = twl_rtc_read_u8(&rd_reg, REG_RTC_STATUS_REG); if (ret < 0) @@ -442,6 +462,14 @@ static int __devinit twl_rtc_probe(struct platform_device *pdev) if (ret < 0) goto out1; + ret = request_irq(irq, twl_rtc_interrupt, + IRQF_TRIGGER_RISING, + dev_name(&rtc->dev), rtc); + if (ret < 0) { + dev_err(&pdev->dev, "IRQ is not free.\n"); + goto out1; + } + if (twl_class_is_6030()) { twl6030_interrupt_unmask(TWL6030_RTC_INT_MASK, REG_INT_MSK_LINE_A); @@ -452,44 +480,28 @@ static int __devinit twl_rtc_probe(struct platform_device *pdev) /* Check RTC module status, Enable if it is off */ ret = twl_rtc_read_u8(&rd_reg, REG_RTC_CTRL_REG); if (ret < 0) - goto out1; + goto out2; if (!(rd_reg & BIT_RTC_CTRL_REG_STOP_RTC_M)) { dev_info(&pdev->dev, "Enabling TWL-RTC.\n"); rd_reg = BIT_RTC_CTRL_REG_STOP_RTC_M; ret = twl_rtc_write_u8(rd_reg, REG_RTC_CTRL_REG); if (ret < 0) - goto out1; + goto out2; } /* init cached IRQ enable bits */ ret = twl_rtc_read_u8(&rtc_irq_bits, REG_RTC_INTERRUPTS_REG); if (ret < 0) - goto out1; - - rtc = rtc_device_register(pdev->name, - &pdev->dev, &twl_rtc_ops, THIS_MODULE); - if (IS_ERR(rtc)) { - ret = PTR_ERR(rtc); - dev_err(&pdev->dev, "can't register RTC device, err %ld\n", - PTR_ERR(rtc)); - goto out1; - } - - ret = request_threaded_irq(irq, NULL, twl_rtc_interrupt, - IRQF_TRIGGER_RISING, - dev_name(&rtc->dev), rtc); - if (ret < 0) { - dev_err(&pdev->dev, "IRQ is not free.\n"); goto out2; - } - platform_set_drvdata(pdev, rtc); - return 0; + return ret; out2: - rtc_device_unregister(rtc); + free_irq(irq, rtc); out1: + rtc_device_unregister(rtc); +out0: return ret; } diff --git a/trunk/drivers/video/backlight/backlight.c b/trunk/drivers/video/backlight/backlight.c index 7363c1b169e8..80d292fb92d8 100644 --- a/trunk/drivers/video/backlight/backlight.c +++ b/trunk/drivers/video/backlight/backlight.c @@ -19,7 +19,7 @@ #include #endif -static const char *const backlight_types[] = { +static const char const *backlight_types[] = { [BACKLIGHT_RAW] = "raw", [BACKLIGHT_PLATFORM] = "platform", [BACKLIGHT_FIRMWARE] = "firmware", diff --git a/trunk/fs/9p/v9fs_vfs.h b/trunk/fs/9p/v9fs_vfs.h index 410ffd6ceb5f..46ce357ca1ab 100644 --- a/trunk/fs/9p/v9fs_vfs.h +++ b/trunk/fs/9p/v9fs_vfs.h @@ -54,9 +54,9 @@ extern struct kmem_cache *v9fs_inode_cache; struct inode *v9fs_alloc_inode(struct super_block *sb); void v9fs_destroy_inode(struct inode *inode); -struct inode *v9fs_get_inode(struct super_block *sb, int mode, dev_t); +struct inode *v9fs_get_inode(struct super_block *sb, int mode); int v9fs_init_inode(struct v9fs_session_info *v9ses, - struct inode *inode, int mode, dev_t); + struct inode *inode, int mode); void v9fs_evict_inode(struct inode *inode); ino_t v9fs_qid2ino(struct p9_qid *qid); void v9fs_stat2inode(struct p9_wstat *, struct inode *, struct super_block *); @@ -83,6 +83,4 @@ static inline void v9fs_invalidate_inode_attr(struct inode *inode) v9inode->cache_validity |= V9FS_INO_INVALID_ATTR; return; } - -int v9fs_open_to_dotl_flags(int flags); #endif diff --git a/trunk/fs/9p/vfs_file.c b/trunk/fs/9p/vfs_file.c index 62857a810a79..3c173fcc2c5a 100644 --- a/trunk/fs/9p/vfs_file.c +++ b/trunk/fs/9p/vfs_file.c @@ -65,7 +65,7 @@ int v9fs_file_open(struct inode *inode, struct file *file) v9inode = V9FS_I(inode); v9ses = v9fs_inode2v9ses(inode); if (v9fs_proto_dotl(v9ses)) - omode = v9fs_open_to_dotl_flags(file->f_flags); + omode = file->f_flags; else omode = v9fs_uflags2omode(file->f_flags, v9fs_proto_dotu(v9ses)); @@ -169,18 +169,7 @@ static int v9fs_file_do_lock(struct file *filp, int cmd, struct file_lock *fl) /* convert posix lock to p9 tlock args */ memset(&flock, 0, sizeof(flock)); - /* map the lock type */ - switch (fl->fl_type) { - case F_RDLCK: - flock.type = P9_LOCK_TYPE_RDLCK; - break; - case F_WRLCK: - flock.type = P9_LOCK_TYPE_WRLCK; - break; - case F_UNLCK: - flock.type = P9_LOCK_TYPE_UNLCK; - break; - } + flock.type = fl->fl_type; flock.start = fl->fl_start; if (fl->fl_end == OFFSET_MAX) flock.length = 0; @@ -256,7 +245,7 @@ static int v9fs_file_getlock(struct file *filp, struct file_lock *fl) /* convert posix lock to p9 tgetlock args */ memset(&glock, 0, sizeof(glock)); - glock.type = P9_LOCK_TYPE_UNLCK; + glock.type = fl->fl_type; glock.start = fl->fl_start; if (fl->fl_end == OFFSET_MAX) glock.length = 0; @@ -268,26 +257,17 @@ static int v9fs_file_getlock(struct file *filp, struct file_lock *fl) res = p9_client_getlock_dotl(fid, &glock); if (res < 0) return res; - /* map 9p lock type to os lock type */ - switch (glock.type) { - case P9_LOCK_TYPE_RDLCK: - fl->fl_type = F_RDLCK; - break; - case P9_LOCK_TYPE_WRLCK: - fl->fl_type = F_WRLCK; - break; - case P9_LOCK_TYPE_UNLCK: - fl->fl_type = F_UNLCK; - break; - } - if (glock.type != P9_LOCK_TYPE_UNLCK) { + if (glock.type != F_UNLCK) { + fl->fl_type = glock.type; fl->fl_start = glock.start; if (glock.length == 0) fl->fl_end = OFFSET_MAX; else fl->fl_end = glock.start + glock.length - 1; fl->fl_pid = glock.proc_id; - } + } else + fl->fl_type = F_UNLCK; + return res; } diff --git a/trunk/fs/9p/vfs_inode.c b/trunk/fs/9p/vfs_inode.c index e3c03db3c788..8bb5507e822f 100644 --- a/trunk/fs/9p/vfs_inode.c +++ b/trunk/fs/9p/vfs_inode.c @@ -95,18 +95,15 @@ static int unixmode2p9mode(struct v9fs_session_info *v9ses, int mode) /** * p9mode2unixmode- convert plan9 mode bits to unix mode bits * @v9ses: v9fs session information - * @stat: p9_wstat from which mode need to be derived - * @rdev: major number, minor number in case of device files. + * @mode: mode to convert * */ -static int p9mode2unixmode(struct v9fs_session_info *v9ses, - struct p9_wstat *stat, dev_t *rdev) + +static int p9mode2unixmode(struct v9fs_session_info *v9ses, int mode) { int res; - int mode = stat->mode; - res = mode & S_IALLUGO; - *rdev = 0; + res = mode & 0777; if ((mode & P9_DMDIR) == P9_DMDIR) res |= S_IFDIR; @@ -119,26 +116,9 @@ static int p9mode2unixmode(struct v9fs_session_info *v9ses, && (v9ses->nodev == 0)) res |= S_IFIFO; else if ((mode & P9_DMDEVICE) && (v9fs_proto_dotu(v9ses)) - && (v9ses->nodev == 0)) { - char type = 0, ext[32]; - int major = -1, minor = -1; - - strncpy(ext, stat->extension, sizeof(ext)); - sscanf(ext, "%c %u %u", &type, &major, &minor); - switch (type) { - case 'c': - res |= S_IFCHR; - break; - case 'b': - res |= S_IFBLK; - break; - default: - P9_DPRINTK(P9_DEBUG_ERROR, - "Unknown special type %c %s\n", type, - stat->extension); - }; - *rdev = MKDEV(major, minor); - } else + && (v9ses->nodev == 0)) + res |= S_IFBLK; + else res |= S_IFREG; if (v9fs_proto_dotu(v9ses)) { @@ -151,6 +131,7 @@ static int p9mode2unixmode(struct v9fs_session_info *v9ses, if ((mode & P9_DMSETVTX) == P9_DMSETVTX) res |= S_ISVTX; } + return res; } @@ -261,13 +242,13 @@ void v9fs_destroy_inode(struct inode *inode) } int v9fs_init_inode(struct v9fs_session_info *v9ses, - struct inode *inode, int mode, dev_t rdev) + struct inode *inode, int mode) { int err = 0; inode_init_owner(inode, NULL, mode); inode->i_blocks = 0; - inode->i_rdev = rdev; + inode->i_rdev = 0; inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; inode->i_mapping->a_ops = &v9fs_addr_operations; @@ -354,7 +335,7 @@ int v9fs_init_inode(struct v9fs_session_info *v9ses, * */ -struct inode *v9fs_get_inode(struct super_block *sb, int mode, dev_t rdev) +struct inode *v9fs_get_inode(struct super_block *sb, int mode) { int err; struct inode *inode; @@ -367,7 +348,7 @@ struct inode *v9fs_get_inode(struct super_block *sb, int mode, dev_t rdev) P9_EPRINTK(KERN_WARNING, "Problem allocating inode\n"); return ERR_PTR(-ENOMEM); } - err = v9fs_init_inode(v9ses, inode, mode, rdev); + err = v9fs_init_inode(v9ses, inode, mode); if (err) { iput(inode); return ERR_PTR(err); @@ -454,12 +435,11 @@ void v9fs_evict_inode(struct inode *inode) static int v9fs_test_inode(struct inode *inode, void *data) { int umode; - dev_t rdev; struct v9fs_inode *v9inode = V9FS_I(inode); struct p9_wstat *st = (struct p9_wstat *)data; struct v9fs_session_info *v9ses = v9fs_inode2v9ses(inode); - umode = p9mode2unixmode(v9ses, st, &rdev); + umode = p9mode2unixmode(v9ses, st->mode); /* don't match inode of different type */ if ((inode->i_mode & S_IFMT) != (umode & S_IFMT)) return 0; @@ -493,7 +473,6 @@ static struct inode *v9fs_qid_iget(struct super_block *sb, struct p9_wstat *st, int new) { - dev_t rdev; int retval, umode; unsigned long i_ino; struct inode *inode; @@ -517,8 +496,8 @@ static struct inode *v9fs_qid_iget(struct super_block *sb, * later. */ inode->i_ino = i_ino; - umode = p9mode2unixmode(v9ses, st, &rdev); - retval = v9fs_init_inode(v9ses, inode, umode, rdev); + umode = p9mode2unixmode(v9ses, st->mode); + retval = v9fs_init_inode(v9ses, inode, umode); if (retval) goto error; @@ -552,19 +531,6 @@ v9fs_inode_from_fid(struct v9fs_session_info *v9ses, struct p9_fid *fid, return inode; } -/** - * v9fs_at_to_dotl_flags- convert Linux specific AT flags to - * plan 9 AT flag. - * @flags: flags to convert - */ -static int v9fs_at_to_dotl_flags(int flags) -{ - int rflags = 0; - if (flags & AT_REMOVEDIR) - rflags |= P9_DOTL_AT_REMOVEDIR; - return rflags; -} - /** * v9fs_remove - helper function to remove files and directories * @dir: directory inode that is being deleted @@ -592,8 +558,7 @@ static int v9fs_remove(struct inode *dir, struct dentry *dentry, int flags) return retval; } if (v9fs_proto_dotl(v9ses)) - retval = p9_client_unlinkat(dfid, dentry->d_name.name, - v9fs_at_to_dotl_flags(flags)); + retval = p9_client_unlinkat(dfid, dentry->d_name.name, flags); if (retval == -EOPNOTSUPP) { /* Try the one based on path */ v9fid = v9fs_fid_clone(dentry); @@ -680,11 +645,13 @@ v9fs_create(struct v9fs_session_info *v9ses, struct inode *dir, P9_DPRINTK(P9_DEBUG_VFS, "inode creation failed %d\n", err); goto error; } + d_instantiate(dentry, inode); err = v9fs_fid_add(dentry, fid); if (err < 0) goto error; - d_instantiate(dentry, inode); + return ofid; + error: if (ofid) p9_client_clunk(ofid); @@ -825,7 +792,6 @@ static int v9fs_vfs_mkdir(struct inode *dir, struct dentry *dentry, int mode) struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nameidata) { - struct dentry *res; struct super_block *sb; struct v9fs_session_info *v9ses; struct p9_fid *dfid, *fid; @@ -857,35 +823,22 @@ struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry, return ERR_PTR(result); } - /* - * Make sure we don't use a wrong inode due to parallel - * unlink. For cached mode create calls request for new - * inode. But with cache disabled, lookup should do this. - */ - if (v9ses->cache) - inode = v9fs_get_inode_from_fid(v9ses, fid, dir->i_sb); - else - inode = v9fs_get_new_inode_from_fid(v9ses, fid, dir->i_sb); + + inode = v9fs_get_inode_from_fid(v9ses, fid, dir->i_sb); if (IS_ERR(inode)) { result = PTR_ERR(inode); inode = NULL; goto error; } + result = v9fs_fid_add(dentry, fid); if (result < 0) goto error_iput; + inst_out: - /* - * If we had a rename on the server and a parallel lookup - * for the new name, then make sure we instantiate with - * the new name. ie look up for a/b, while on server somebody - * moved b under k and client parallely did a lookup for - * k/b. - */ - res = d_materialise_unique(dentry, inode); - if (!IS_ERR(res)) - return res; - result = PTR_ERR(res); + d_add(dentry, inode); + return NULL; + error_iput: iput(inode); error: @@ -1049,7 +1002,7 @@ v9fs_vfs_getattr(struct vfsmount *mnt, struct dentry *dentry, return PTR_ERR(st); v9fs_stat2inode(st, dentry->d_inode, dentry->d_inode->i_sb); - generic_fillattr(dentry->d_inode, stat); + generic_fillattr(dentry->d_inode, stat); p9stat_free(st); kfree(st); @@ -1133,7 +1086,6 @@ void v9fs_stat2inode(struct p9_wstat *stat, struct inode *inode, struct super_block *sb) { - mode_t mode; char ext[32]; char tag_name[14]; unsigned int i_nlink; @@ -1169,9 +1121,31 @@ v9fs_stat2inode(struct p9_wstat *stat, struct inode *inode, inode->i_nlink = i_nlink; } } - mode = stat->mode & S_IALLUGO; - mode |= inode->i_mode & ~S_IALLUGO; - inode->i_mode = mode; + inode->i_mode = p9mode2unixmode(v9ses, stat->mode); + if ((S_ISBLK(inode->i_mode)) || (S_ISCHR(inode->i_mode))) { + char type = 0; + int major = -1; + int minor = -1; + + strncpy(ext, stat->extension, sizeof(ext)); + sscanf(ext, "%c %u %u", &type, &major, &minor); + switch (type) { + case 'c': + inode->i_mode &= ~S_IFBLK; + inode->i_mode |= S_IFCHR; + break; + case 'b': + break; + default: + P9_DPRINTK(P9_DEBUG_ERROR, + "Unknown special type %c %s\n", type, + stat->extension); + }; + inode->i_rdev = MKDEV(major, minor); + init_special_inode(inode, inode->i_mode, inode->i_rdev); + } else + inode->i_rdev = 0; + i_size_write(inode, stat->length); /* not real number of blocks, but 512 byte ones ... */ @@ -1437,8 +1411,6 @@ v9fs_vfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t rdev) int v9fs_refresh_inode(struct p9_fid *fid, struct inode *inode) { - int umode; - dev_t rdev; loff_t i_size; struct p9_wstat *st; struct v9fs_session_info *v9ses; @@ -1447,12 +1419,6 @@ int v9fs_refresh_inode(struct p9_fid *fid, struct inode *inode) st = p9_client_stat(fid); if (IS_ERR(st)) return PTR_ERR(st); - /* - * Don't update inode if the file type is different - */ - umode = p9mode2unixmode(v9ses, st, &rdev); - if ((inode->i_mode & S_IFMT) != (umode & S_IFMT)) - goto out; spin_lock(&inode->i_lock); /* @@ -1464,7 +1430,6 @@ int v9fs_refresh_inode(struct p9_fid *fid, struct inode *inode) if (v9ses->cache) inode->i_size = i_size; spin_unlock(&inode->i_lock); -out: p9stat_free(st); kfree(st); return 0; diff --git a/trunk/fs/9p/vfs_inode_dotl.c b/trunk/fs/9p/vfs_inode_dotl.c index aded79fcd5cf..b6c8ed205192 100644 --- a/trunk/fs/9p/vfs_inode_dotl.c +++ b/trunk/fs/9p/vfs_inode_dotl.c @@ -153,8 +153,7 @@ static struct inode *v9fs_qid_iget_dotl(struct super_block *sb, * later. */ inode->i_ino = i_ino; - retval = v9fs_init_inode(v9ses, inode, - st->st_mode, new_decode_dev(st->st_rdev)); + retval = v9fs_init_inode(v9ses, inode, st->st_mode); if (retval) goto error; @@ -191,58 +190,6 @@ v9fs_inode_from_fid_dotl(struct v9fs_session_info *v9ses, struct p9_fid *fid, return inode; } -struct dotl_openflag_map { - int open_flag; - int dotl_flag; -}; - -static int v9fs_mapped_dotl_flags(int flags) -{ - int i; - int rflags = 0; - struct dotl_openflag_map dotl_oflag_map[] = { - { O_CREAT, P9_DOTL_CREATE }, - { O_EXCL, P9_DOTL_EXCL }, - { O_NOCTTY, P9_DOTL_NOCTTY }, - { O_TRUNC, P9_DOTL_TRUNC }, - { O_APPEND, P9_DOTL_APPEND }, - { O_NONBLOCK, P9_DOTL_NONBLOCK }, - { O_DSYNC, P9_DOTL_DSYNC }, - { FASYNC, P9_DOTL_FASYNC }, - { O_DIRECT, P9_DOTL_DIRECT }, - { O_LARGEFILE, P9_DOTL_LARGEFILE }, - { O_DIRECTORY, P9_DOTL_DIRECTORY }, - { O_NOFOLLOW, P9_DOTL_NOFOLLOW }, - { O_NOATIME, P9_DOTL_NOATIME }, - { O_CLOEXEC, P9_DOTL_CLOEXEC }, - { O_SYNC, P9_DOTL_SYNC}, - }; - for (i = 0; i < ARRAY_SIZE(dotl_oflag_map); i++) { - if (flags & dotl_oflag_map[i].open_flag) - rflags |= dotl_oflag_map[i].dotl_flag; - } - return rflags; -} - -/** - * v9fs_open_to_dotl_flags- convert Linux specific open flags to - * plan 9 open flag. - * @flags: flags to convert - */ -int v9fs_open_to_dotl_flags(int flags) -{ - int rflags = 0; - - /* - * We have same bits for P9_DOTL_READONLY, P9_DOTL_WRONLY - * and P9_DOTL_NOACCESS - */ - rflags |= flags & O_ACCMODE; - rflags |= v9fs_mapped_dotl_flags(flags); - - return rflags; -} - /** * v9fs_vfs_create_dotl - VFS hook to create files for 9P2000.L protocol. * @dir: directory inode that is being created @@ -311,8 +258,7 @@ v9fs_vfs_create_dotl(struct inode *dir, struct dentry *dentry, int omode, "Failed to get acl values in creat %d\n", err); goto error; } - err = p9_client_create_dotl(ofid, name, v9fs_open_to_dotl_flags(flags), - mode, gid, &qid); + err = p9_client_create_dotl(ofid, name, flags, mode, gid, &qid); if (err < 0) { P9_DPRINTK(P9_DEBUG_VFS, "p9_client_open_dotl failed in creat %d\n", @@ -335,10 +281,10 @@ v9fs_vfs_create_dotl(struct inode *dir, struct dentry *dentry, int omode, P9_DPRINTK(P9_DEBUG_VFS, "inode creation failed %d\n", err); goto error; } + d_instantiate(dentry, inode); err = v9fs_fid_add(dentry, fid); if (err < 0) goto error; - d_instantiate(dentry, inode); /* Now set the ACL based on the default value */ v9fs_set_create_acl(dentry, &dacl, &pacl); @@ -457,10 +403,10 @@ static int v9fs_vfs_mkdir_dotl(struct inode *dir, err); goto error; } + d_instantiate(dentry, inode); err = v9fs_fid_add(dentry, fid); if (err < 0) goto error; - d_instantiate(dentry, inode); fid = NULL; } else { /* @@ -468,7 +414,7 @@ static int v9fs_vfs_mkdir_dotl(struct inode *dir, * inode with stat. We need to get an inode * so that we can set the acl with dentry */ - inode = v9fs_get_inode(dir->i_sb, mode, 0); + inode = v9fs_get_inode(dir->i_sb, mode); if (IS_ERR(inode)) { err = PTR_ERR(inode); goto error; @@ -594,7 +540,6 @@ int v9fs_vfs_setattr_dotl(struct dentry *dentry, struct iattr *iattr) void v9fs_stat2inode_dotl(struct p9_stat_dotl *stat, struct inode *inode) { - mode_t mode; struct v9fs_inode *v9inode = V9FS_I(inode); if ((stat->st_result_mask & P9_STATS_BASIC) == P9_STATS_BASIC) { @@ -607,10 +552,11 @@ v9fs_stat2inode_dotl(struct p9_stat_dotl *stat, struct inode *inode) inode->i_uid = stat->st_uid; inode->i_gid = stat->st_gid; inode->i_nlink = stat->st_nlink; + inode->i_mode = stat->st_mode; + inode->i_rdev = new_decode_dev(stat->st_rdev); - mode = stat->st_mode & S_IALLUGO; - mode |= inode->i_mode & ~S_IALLUGO; - inode->i_mode = mode; + if ((S_ISBLK(inode->i_mode)) || (S_ISCHR(inode->i_mode))) + init_special_inode(inode, inode->i_mode, inode->i_rdev); i_size_write(inode, stat->st_size); inode->i_blocks = stat->st_blocks; @@ -711,14 +657,14 @@ v9fs_vfs_symlink_dotl(struct inode *dir, struct dentry *dentry, err); goto error; } + d_instantiate(dentry, inode); err = v9fs_fid_add(dentry, fid); if (err < 0) goto error; - d_instantiate(dentry, inode); fid = NULL; } else { /* Not in cached mode. No need to populate inode with stat */ - inode = v9fs_get_inode(dir->i_sb, S_IFLNK, 0); + inode = v9fs_get_inode(dir->i_sb, S_IFLNK); if (IS_ERR(inode)) { err = PTR_ERR(inode); goto error; @@ -864,17 +810,17 @@ v9fs_vfs_mknod_dotl(struct inode *dir, struct dentry *dentry, int omode, err); goto error; } + d_instantiate(dentry, inode); err = v9fs_fid_add(dentry, fid); if (err < 0) goto error; - d_instantiate(dentry, inode); fid = NULL; } else { /* * Not in cached mode. No need to populate inode with stat. * socket syscall returns a fd, so we need instantiate */ - inode = v9fs_get_inode(dir->i_sb, mode, rdev); + inode = v9fs_get_inode(dir->i_sb, mode); if (IS_ERR(inode)) { err = PTR_ERR(inode); goto error; @@ -940,11 +886,6 @@ int v9fs_refresh_inode_dotl(struct p9_fid *fid, struct inode *inode) st = p9_client_getattr_dotl(fid, P9_STATS_ALL); if (IS_ERR(st)) return PTR_ERR(st); - /* - * Don't update inode if the file type is different - */ - if ((inode->i_mode & S_IFMT) != (st->st_mode & S_IFMT)) - goto out; spin_lock(&inode->i_lock); /* @@ -956,7 +897,6 @@ int v9fs_refresh_inode_dotl(struct p9_fid *fid, struct inode *inode) if (v9ses->cache) inode->i_size = i_size; spin_unlock(&inode->i_lock); -out: kfree(st); return 0; } diff --git a/trunk/fs/9p/vfs_super.c b/trunk/fs/9p/vfs_super.c index c70251d47ed1..feef6cdc1fd2 100644 --- a/trunk/fs/9p/vfs_super.c +++ b/trunk/fs/9p/vfs_super.c @@ -149,7 +149,7 @@ static struct dentry *v9fs_mount(struct file_system_type *fs_type, int flags, else sb->s_d_op = &v9fs_dentry_operations; - inode = v9fs_get_inode(sb, S_IFDIR | mode, 0); + inode = v9fs_get_inode(sb, S_IFDIR | mode); if (IS_ERR(inode)) { retval = PTR_ERR(inode); goto release_sb; diff --git a/trunk/fs/block_dev.c b/trunk/fs/block_dev.c index 95f786ec7f08..ff77262e887c 100644 --- a/trunk/fs/block_dev.c +++ b/trunk/fs/block_dev.c @@ -1429,11 +1429,6 @@ static int __blkdev_put(struct block_device *bdev, fmode_t mode, int for_part) WARN_ON_ONCE(bdev->bd_holders); sync_blockdev(bdev); kill_bdev(bdev); - /* ->release can cause the old bdi to disappear, - * so must switch it out first - */ - bdev_inode_switch_bdi(bdev->bd_inode, - &default_backing_dev_info); } if (bdev->bd_contains == bdev) { if (disk->fops->release) @@ -1447,6 +1442,8 @@ static int __blkdev_put(struct block_device *bdev, fmode_t mode, int for_part) disk_put_part(bdev->bd_part); bdev->bd_part = NULL; bdev->bd_disk = NULL; + bdev_inode_switch_bdi(bdev->bd_inode, + &default_backing_dev_info); if (bdev != bdev->bd_contains) victim = bdev->bd_contains; bdev->bd_contains = NULL; diff --git a/trunk/fs/ceph/mds_client.c b/trunk/fs/ceph/mds_client.c index 86c59e16ba74..fee028b5332e 100644 --- a/trunk/fs/ceph/mds_client.c +++ b/trunk/fs/ceph/mds_client.c @@ -1595,7 +1595,7 @@ static int set_request_path_attr(struct inode *rinode, struct dentry *rdentry, r = build_dentry_path(rdentry, ppath, pathlen, ino, freepath); dout(" dentry %p %llx/%.*s\n", rdentry, *ino, *pathlen, *ppath); - } else if (rpath || rino) { + } else if (rpath) { *ino = rino; *ppath = rpath; *pathlen = strlen(rpath); diff --git a/trunk/fs/ceph/super.c b/trunk/fs/ceph/super.c index 88bacaf385d9..d47c5ec7fb1f 100644 --- a/trunk/fs/ceph/super.c +++ b/trunk/fs/ceph/super.c @@ -813,8 +813,8 @@ static struct dentry *ceph_mount(struct file_system_type *fs_type, fsc = create_fs_client(fsopt, opt); if (IS_ERR(fsc)) { res = ERR_CAST(fsc); - destroy_mount_options(fsopt); - ceph_destroy_options(opt); + kfree(fsopt); + kfree(opt); goto out_final; } diff --git a/trunk/fs/ext4/ext4.h b/trunk/fs/ext4/ext4.h index b7d7bd0f066e..e717dfd2f2b4 100644 --- a/trunk/fs/ext4/ext4.h +++ b/trunk/fs/ext4/ext4.h @@ -175,7 +175,6 @@ struct mpage_da_data { */ #define EXT4_IO_END_UNWRITTEN 0x0001 #define EXT4_IO_END_ERROR 0x0002 -#define EXT4_IO_END_QUEUED 0x0004 struct ext4_io_page { struct page *p_page; diff --git a/trunk/fs/ext4/inode.c b/trunk/fs/ext4/inode.c index 18d2558b7624..c4da98a959ae 100644 --- a/trunk/fs/ext4/inode.c +++ b/trunk/fs/ext4/inode.c @@ -121,6 +121,9 @@ void ext4_evict_inode(struct inode *inode) trace_ext4_evict_inode(inode); + mutex_lock(&inode->i_mutex); + ext4_flush_completed_IO(inode); + mutex_unlock(&inode->i_mutex); ext4_ioend_wait(inode); if (inode->i_nlink) { diff --git a/trunk/fs/ext4/page-io.c b/trunk/fs/ext4/page-io.c index 92f38ee13f8a..78839af7ce29 100644 --- a/trunk/fs/ext4/page-io.c +++ b/trunk/fs/ext4/page-io.c @@ -142,23 +142,7 @@ static void ext4_end_io_work(struct work_struct *work) unsigned long flags; int ret; - if (!mutex_trylock(&inode->i_mutex)) { - /* - * Requeue the work instead of waiting so that the work - * items queued after this can be processed. - */ - queue_work(EXT4_SB(inode->i_sb)->dio_unwritten_wq, &io->work); - /* - * To prevent the ext4-dio-unwritten thread from keeping - * requeueing end_io requests and occupying cpu for too long, - * yield the cpu if it sees an end_io request that has already - * been requeued. - */ - if (io->flag & EXT4_IO_END_QUEUED) - yield(); - io->flag |= EXT4_IO_END_QUEUED; - return; - } + mutex_lock(&inode->i_mutex); ret = ext4_end_io_nolock(io); if (ret < 0) { mutex_unlock(&inode->i_mutex); diff --git a/trunk/fs/namei.c b/trunk/fs/namei.c index b52bc685465f..2826db35dc25 100644 --- a/trunk/fs/namei.c +++ b/trunk/fs/namei.c @@ -727,22 +727,25 @@ static int follow_automount(struct path *path, unsigned flags, if ((flags & LOOKUP_NO_AUTOMOUNT) && !(flags & LOOKUP_PARENT)) return -EISDIR; /* we actually want to stop here */ - /* We don't want to mount if someone's just doing a stat - - * unless they're stat'ing a directory and appended a '/' to - * the name. - * - * We do, however, want to mount if someone wants to open or - * create a file of any type under the mountpoint, wants to - * traverse through the mountpoint or wants to open the - * mounted directory. Also, autofs may mark negative dentries - * as being automount points. These will need the attentions - * of the daemon to instantiate them before they can be used. + /* + * We don't want to mount if someone's just doing a stat and they've + * set AT_SYMLINK_NOFOLLOW - unless they're stat'ing a directory and + * appended a '/' to the name. */ - if (!(flags & (LOOKUP_PARENT | LOOKUP_DIRECTORY | - LOOKUP_OPEN | LOOKUP_CREATE)) && - path->dentry->d_inode) - return -EISDIR; - + if (!(flags & LOOKUP_FOLLOW)) { + /* We do, however, want to mount if someone wants to open or + * create a file of any type under the mountpoint, wants to + * traverse through the mountpoint or wants to open the mounted + * directory. + * Also, autofs may mark negative dentries as being automount + * points. These will need the attentions of the daemon to + * instantiate them before they can be used. + */ + if (!(flags & (LOOKUP_PARENT | LOOKUP_DIRECTORY | + LOOKUP_OPEN | LOOKUP_CREATE)) && + path->dentry->d_inode) + return -EISDIR; + } current->total_link_count++; if (current->total_link_count >= 40) return -ELOOP; diff --git a/trunk/fs/ubifs/debug.h b/trunk/fs/ubifs/debug.h index feb361e252ac..45174b534377 100644 --- a/trunk/fs/ubifs/debug.h +++ b/trunk/fs/ubifs/debug.h @@ -335,9 +335,9 @@ void dbg_debugfs_exit_fs(struct ubifs_info *c); #define DBGKEY(key) ((char *)(key)) #define DBGKEY1(key) ((char *)(key)) -#define ubifs_dbg_msg(fmt, ...) do { \ - if (0) \ - printk(KERN_DEBUG fmt "\n", ##__VA_ARGS__); \ +#define ubifs_dbg_msg(fmt, ...) do { \ + if (0) \ + pr_debug(fmt "\n", ##__VA_ARGS__); \ } while (0) #define dbg_dump_stack() diff --git a/trunk/fs/xfs/xfs_iops.c b/trunk/fs/xfs/xfs_iops.c index 673704fab748..b9c172b3fbbe 100644 --- a/trunk/fs/xfs/xfs_iops.c +++ b/trunk/fs/xfs/xfs_iops.c @@ -70,8 +70,9 @@ xfs_synchronize_times( } /* - * If the linux inode is valid, mark it dirty, else mark the dirty state - * in the XFS inode to make sure we pick it up when reclaiming the inode. + * If the linux inode is valid, mark it dirty. + * Used when committing a dirty inode into a transaction so that + * the inode will get written back by the linux code */ void xfs_mark_inode_dirty_sync( @@ -81,10 +82,6 @@ xfs_mark_inode_dirty_sync( if (!(inode->i_state & (I_WILL_FREE|I_FREEING))) mark_inode_dirty_sync(inode); - else { - barrier(); - ip->i_update_core = 1; - } } void @@ -95,11 +92,6 @@ xfs_mark_inode_dirty( if (!(inode->i_state & (I_WILL_FREE|I_FREEING))) mark_inode_dirty(inode); - else { - barrier(); - ip->i_update_core = 1; - } - } /* diff --git a/trunk/fs/xfs/xfs_super.c b/trunk/fs/xfs/xfs_super.c index 2366c54cc4fa..9a72dda58bd0 100644 --- a/trunk/fs/xfs/xfs_super.c +++ b/trunk/fs/xfs/xfs_super.c @@ -356,8 +356,6 @@ xfs_parseargs( mp->m_flags |= XFS_MOUNT_DELAYLOG; } else if (!strcmp(this_char, MNTOPT_NODELAYLOG)) { mp->m_flags &= ~XFS_MOUNT_DELAYLOG; - xfs_warn(mp, - "nodelaylog is deprecated and will be removed in Linux 3.3"); } else if (!strcmp(this_char, MNTOPT_DISCARD)) { mp->m_flags |= XFS_MOUNT_DISCARD; } else if (!strcmp(this_char, MNTOPT_NODISCARD)) { @@ -879,17 +877,33 @@ xfs_log_inode( struct xfs_trans *tp; int error; + xfs_iunlock(ip, XFS_ILOCK_SHARED); tp = xfs_trans_alloc(mp, XFS_TRANS_FSYNC_TS); error = xfs_trans_reserve(tp, 0, XFS_FSYNC_TS_LOG_RES(mp), 0, 0, 0); + if (error) { xfs_trans_cancel(tp, 0); + /* we need to return with the lock hold shared */ + xfs_ilock(ip, XFS_ILOCK_SHARED); return error; } xfs_ilock(ip, XFS_ILOCK_EXCL); - xfs_trans_ijoin_ref(tp, ip, XFS_ILOCK_EXCL); + + /* + * Note - it's possible that we might have pushed ourselves out of the + * way during trans_reserve which would flush the inode. But there's + * no guarantee that the inode buffer has actually gone out yet (it's + * delwri). Plus the buffer could be pinned anyway if it's part of + * an inode in another recent transaction. So we play it safe and + * fire off the transaction anyway. + */ + xfs_trans_ijoin(tp, ip); xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); - return xfs_trans_commit(tp, 0); + error = xfs_trans_commit(tp, 0); + xfs_ilock_demote(ip, XFS_ILOCK_EXCL); + + return error; } STATIC int @@ -904,9 +918,7 @@ xfs_fs_write_inode( trace_xfs_write_inode(ip); if (XFS_FORCED_SHUTDOWN(mp)) - return -XFS_ERROR(EIO); - if (!ip->i_update_core) - return 0; + return XFS_ERROR(EIO); if (wbc->sync_mode == WB_SYNC_ALL) { /* @@ -917,10 +929,12 @@ xfs_fs_write_inode( * of synchronous log foces dramatically. */ xfs_ioend_wait(ip); - error = xfs_log_inode(ip); - if (error) - goto out; - return 0; + xfs_ilock(ip, XFS_ILOCK_SHARED); + if (ip->i_update_core) { + error = xfs_log_inode(ip); + if (error) + goto out_unlock; + } } else { /* * We make this non-blocking if the inode is contended, return diff --git a/trunk/include/linux/perf_event.h b/trunk/include/linux/perf_event.h index c816075c01ce..245bafdafd5e 100644 --- a/trunk/include/linux/perf_event.h +++ b/trunk/include/linux/perf_event.h @@ -944,10 +944,8 @@ extern void perf_pmu_unregister(struct pmu *pmu); extern int perf_num_counters(void); extern const char *perf_pmu_name(void); -extern void __perf_event_task_sched_in(struct task_struct *prev, - struct task_struct *task); -extern void __perf_event_task_sched_out(struct task_struct *prev, - struct task_struct *next); +extern void __perf_event_task_sched_in(struct task_struct *task); +extern void __perf_event_task_sched_out(struct task_struct *task, struct task_struct *next); extern int perf_event_init_task(struct task_struct *child); extern void perf_event_exit_task(struct task_struct *child); extern void perf_event_free_task(struct task_struct *task); @@ -1061,20 +1059,17 @@ perf_sw_event(u32 event_id, u64 nr, struct pt_regs *regs, u64 addr) extern struct jump_label_key perf_sched_events; -static inline void perf_event_task_sched_in(struct task_struct *prev, - struct task_struct *task) +static inline void perf_event_task_sched_in(struct task_struct *task) { if (static_branch(&perf_sched_events)) - __perf_event_task_sched_in(prev, task); + __perf_event_task_sched_in(task); } -static inline void perf_event_task_sched_out(struct task_struct *prev, - struct task_struct *next) +static inline void perf_event_task_sched_out(struct task_struct *task, struct task_struct *next) { perf_sw_event(PERF_COUNT_SW_CONTEXT_SWITCHES, 1, NULL, 0); - if (static_branch(&perf_sched_events)) - __perf_event_task_sched_out(prev, next); + __perf_event_task_sched_out(task, next); } extern void perf_event_mmap(struct vm_area_struct *vma); @@ -1144,11 +1139,10 @@ extern void perf_event_disable(struct perf_event *event); extern void perf_event_task_tick(void); #else static inline void -perf_event_task_sched_in(struct task_struct *prev, - struct task_struct *task) { } +perf_event_task_sched_in(struct task_struct *task) { } static inline void -perf_event_task_sched_out(struct task_struct *prev, - struct task_struct *next) { } +perf_event_task_sched_out(struct task_struct *task, + struct task_struct *next) { } static inline int perf_event_init_task(struct task_struct *child) { return 0; } static inline void perf_event_exit_task(struct task_struct *child) { } static inline void perf_event_free_task(struct task_struct *task) { } diff --git a/trunk/include/linux/regulator/consumer.h b/trunk/include/linux/regulator/consumer.h index b47771aa5718..26f6ea4444e3 100644 --- a/trunk/include/linux/regulator/consumer.h +++ b/trunk/include/linux/regulator/consumer.h @@ -123,7 +123,7 @@ struct regulator_bulk_data { const char *supply; struct regulator *consumer; - /* private: Internal use */ + /* Internal use */ int ret; }; diff --git a/trunk/include/net/9p/9p.h b/trunk/include/net/9p/9p.h index a6326ef8ade6..342dcf13d039 100644 --- a/trunk/include/net/9p/9p.h +++ b/trunk/include/net/9p/9p.h @@ -288,35 +288,6 @@ enum p9_perm_t { P9_DMSETVTX = 0x00010000, }; -/* 9p2000.L open flags */ -#define P9_DOTL_RDONLY 00000000 -#define P9_DOTL_WRONLY 00000001 -#define P9_DOTL_RDWR 00000002 -#define P9_DOTL_NOACCESS 00000003 -#define P9_DOTL_CREATE 00000100 -#define P9_DOTL_EXCL 00000200 -#define P9_DOTL_NOCTTY 00000400 -#define P9_DOTL_TRUNC 00001000 -#define P9_DOTL_APPEND 00002000 -#define P9_DOTL_NONBLOCK 00004000 -#define P9_DOTL_DSYNC 00010000 -#define P9_DOTL_FASYNC 00020000 -#define P9_DOTL_DIRECT 00040000 -#define P9_DOTL_LARGEFILE 00100000 -#define P9_DOTL_DIRECTORY 00200000 -#define P9_DOTL_NOFOLLOW 00400000 -#define P9_DOTL_NOATIME 01000000 -#define P9_DOTL_CLOEXEC 02000000 -#define P9_DOTL_SYNC 04000000 - -/* 9p2000.L at flags */ -#define P9_DOTL_AT_REMOVEDIR 0x200 - -/* 9p2000.L lock type */ -#define P9_LOCK_TYPE_RDLCK 0 -#define P9_LOCK_TYPE_WRLCK 1 -#define P9_LOCK_TYPE_UNLCK 2 - /** * enum p9_qid_t - QID types * @P9_QTDIR: directory diff --git a/trunk/include/net/cfg80211.h b/trunk/include/net/cfg80211.h index 401d73bd151f..408ae4882d22 100644 --- a/trunk/include/net/cfg80211.h +++ b/trunk/include/net/cfg80211.h @@ -1744,8 +1744,6 @@ struct wiphy_wowlan_support { * by default for perm_addr. In this case, the mask should be set to * all-zeroes. In this case it is assumed that the device can handle * the same number of arbitrary MAC addresses. - * @registered: protects ->resume and ->suspend sysfs callbacks against - * unregister hardware * @debugfsdir: debugfs directory used for this wiphy, will be renamed * automatically on wiphy renames * @dev: (virtual) struct device for this wiphy diff --git a/trunk/kernel/events/core.c b/trunk/kernel/events/core.c index 0f857782d06f..b8785e26ee1c 100644 --- a/trunk/kernel/events/core.c +++ b/trunk/kernel/events/core.c @@ -399,54 +399,14 @@ void perf_cgroup_switch(struct task_struct *task, int mode) local_irq_restore(flags); } -static inline void perf_cgroup_sched_out(struct task_struct *task, - struct task_struct *next) +static inline void perf_cgroup_sched_out(struct task_struct *task) { - struct perf_cgroup *cgrp1; - struct perf_cgroup *cgrp2 = NULL; - - /* - * we come here when we know perf_cgroup_events > 0 - */ - cgrp1 = perf_cgroup_from_task(task); - - /* - * next is NULL when called from perf_event_enable_on_exec() - * that will systematically cause a cgroup_switch() - */ - if (next) - cgrp2 = perf_cgroup_from_task(next); - - /* - * only schedule out current cgroup events if we know - * that we are switching to a different cgroup. Otherwise, - * do no touch the cgroup events. - */ - if (cgrp1 != cgrp2) - perf_cgroup_switch(task, PERF_CGROUP_SWOUT); + perf_cgroup_switch(task, PERF_CGROUP_SWOUT); } -static inline void perf_cgroup_sched_in(struct task_struct *prev, - struct task_struct *task) +static inline void perf_cgroup_sched_in(struct task_struct *task) { - struct perf_cgroup *cgrp1; - struct perf_cgroup *cgrp2 = NULL; - - /* - * we come here when we know perf_cgroup_events > 0 - */ - cgrp1 = perf_cgroup_from_task(task); - - /* prev can never be NULL */ - cgrp2 = perf_cgroup_from_task(prev); - - /* - * only need to schedule in cgroup events if we are changing - * cgroup during ctxsw. Cgroup events were not scheduled - * out of ctxsw out if that was not the case. - */ - if (cgrp1 != cgrp2) - perf_cgroup_switch(task, PERF_CGROUP_SWIN); + perf_cgroup_switch(task, PERF_CGROUP_SWIN); } static inline int perf_cgroup_connect(int fd, struct perf_event *event, @@ -558,13 +518,11 @@ static inline void update_cgrp_time_from_cpuctx(struct perf_cpu_context *cpuctx) { } -static inline void perf_cgroup_sched_out(struct task_struct *task, - struct task_struct *next) +static inline void perf_cgroup_sched_out(struct task_struct *task) { } -static inline void perf_cgroup_sched_in(struct task_struct *prev, - struct task_struct *task) +static inline void perf_cgroup_sched_in(struct task_struct *task) { } @@ -2030,7 +1988,7 @@ void __perf_event_task_sched_out(struct task_struct *task, * cgroup event are system-wide mode only */ if (atomic_read(&__get_cpu_var(perf_cgroup_events))) - perf_cgroup_sched_out(task, next); + perf_cgroup_sched_out(task); } static void task_ctx_sched_out(struct perf_event_context *ctx) @@ -2195,8 +2153,7 @@ static void perf_event_context_sched_in(struct perf_event_context *ctx, * accessing the event control register. If a NMI hits, then it will * keep the event running. */ -void __perf_event_task_sched_in(struct task_struct *prev, - struct task_struct *task) +void __perf_event_task_sched_in(struct task_struct *task) { struct perf_event_context *ctx; int ctxn; @@ -2214,7 +2171,7 @@ void __perf_event_task_sched_in(struct task_struct *prev, * cgroup event are system-wide mode only */ if (atomic_read(&__get_cpu_var(perf_cgroup_events))) - perf_cgroup_sched_in(prev, task); + perf_cgroup_sched_in(task); } static u64 perf_calculate_period(struct perf_event *event, u64 nsec, u64 count) @@ -2470,7 +2427,7 @@ static void perf_event_enable_on_exec(struct perf_event_context *ctx) * ctxswin cgroup events which are already scheduled * in. */ - perf_cgroup_sched_out(current, NULL); + perf_cgroup_sched_out(current); raw_spin_lock(&ctx->lock); task_ctx_sched_out(ctx); @@ -3396,8 +3353,8 @@ static int perf_event_index(struct perf_event *event) } static void calc_timer_values(struct perf_event *event, - u64 *enabled, - u64 *running) + u64 *running, + u64 *enabled) { u64 now, ctx_time; diff --git a/trunk/kernel/sched.c b/trunk/kernel/sched.c index ec5f472bc5b9..ccacdbdecf45 100644 --- a/trunk/kernel/sched.c +++ b/trunk/kernel/sched.c @@ -3065,7 +3065,7 @@ static void finish_task_switch(struct rq *rq, struct task_struct *prev) #ifdef __ARCH_WANT_INTERRUPTS_ON_CTXSW local_irq_disable(); #endif /* __ARCH_WANT_INTERRUPTS_ON_CTXSW */ - perf_event_task_sched_in(prev, current); + perf_event_task_sched_in(current); #ifdef __ARCH_WANT_INTERRUPTS_ON_CTXSW local_irq_enable(); #endif /* __ARCH_WANT_INTERRUPTS_ON_CTXSW */ @@ -4279,9 +4279,9 @@ pick_next_task(struct rq *rq) } /* - * __schedule() is the main scheduler function. + * schedule() is the main scheduler function. */ -static void __sched __schedule(void) +asmlinkage void __sched schedule(void) { struct task_struct *prev, *next; unsigned long *switch_count; @@ -4322,6 +4322,16 @@ static void __sched __schedule(void) if (to_wakeup) try_to_wake_up_local(to_wakeup); } + + /* + * If we are going to sleep and we have plugged IO + * queued, make sure to submit it to avoid deadlocks. + */ + if (blk_needs_flush_plug(prev)) { + raw_spin_unlock(&rq->lock); + blk_schedule_flush_plug(prev); + raw_spin_lock(&rq->lock); + } } switch_count = &prev->nvcsw; } @@ -4359,26 +4369,6 @@ static void __sched __schedule(void) if (need_resched()) goto need_resched; } - -static inline void sched_submit_work(struct task_struct *tsk) -{ - if (!tsk->state) - return; - /* - * If we are going to sleep and we have plugged IO queued, - * make sure to submit it to avoid deadlocks. - */ - if (blk_needs_flush_plug(tsk)) - blk_schedule_flush_plug(tsk); -} - -asmlinkage void schedule(void) -{ - struct task_struct *tsk = current; - - sched_submit_work(tsk); - __schedule(); -} EXPORT_SYMBOL(schedule); #ifdef CONFIG_MUTEX_SPIN_ON_OWNER @@ -4445,7 +4435,7 @@ asmlinkage void __sched notrace preempt_schedule(void) do { add_preempt_count_notrace(PREEMPT_ACTIVE); - __schedule(); + schedule(); sub_preempt_count_notrace(PREEMPT_ACTIVE); /* @@ -4473,7 +4463,7 @@ asmlinkage void __sched preempt_schedule_irq(void) do { add_preempt_count(PREEMPT_ACTIVE); local_irq_enable(); - __schedule(); + schedule(); local_irq_disable(); sub_preempt_count(PREEMPT_ACTIVE); @@ -5598,7 +5588,7 @@ static inline int should_resched(void) static void __cond_resched(void) { add_preempt_count(PREEMPT_ACTIVE); - __schedule(); + schedule(); sub_preempt_count(PREEMPT_ACTIVE); } @@ -7453,7 +7443,6 @@ static void __sdt_free(const struct cpumask *cpu_map) struct sched_domain *sd = *per_cpu_ptr(sdd->sd, j); if (sd && (sd->flags & SD_OVERLAP)) free_sched_groups(sd->groups, 0); - kfree(*per_cpu_ptr(sdd->sd, j)); kfree(*per_cpu_ptr(sdd->sg, j)); kfree(*per_cpu_ptr(sdd->sgp, j)); } diff --git a/trunk/kernel/time/alarmtimer.c b/trunk/kernel/time/alarmtimer.c index ea5e1a928d5b..59f369f98a04 100644 --- a/trunk/kernel/time/alarmtimer.c +++ b/trunk/kernel/time/alarmtimer.c @@ -441,8 +441,6 @@ static int alarm_timer_create(struct k_itimer *new_timer) static void alarm_timer_get(struct k_itimer *timr, struct itimerspec *cur_setting) { - memset(cur_setting, 0, sizeof(struct itimerspec)); - cur_setting->it_interval = ktime_to_timespec(timr->it.alarmtimer.period); cur_setting->it_value = @@ -481,17 +479,11 @@ static int alarm_timer_set(struct k_itimer *timr, int flags, if (!rtcdev) return -ENOTSUPP; - /* - * XXX HACK! Currently we can DOS a system if the interval - * period on alarmtimers is too small. Cap the interval here - * to 100us and solve this properly in a future patch! -jstultz - */ - if ((new_setting->it_interval.tv_sec == 0) && - (new_setting->it_interval.tv_nsec < 100000)) - new_setting->it_interval.tv_nsec = 100000; - - if (old_setting) - alarm_timer_get(timr, old_setting); + /* Save old values */ + old_setting->it_interval = + ktime_to_timespec(timr->it.alarmtimer.period); + old_setting->it_value = + ktime_to_timespec(timr->it.alarmtimer.node.expires); /* If the timer was already set, cancel it */ alarm_cancel(&timr->it.alarmtimer); diff --git a/trunk/net/9p/trans_virtio.c b/trunk/net/9p/trans_virtio.c index e317583fcc73..175b5135bdcf 100644 --- a/trunk/net/9p/trans_virtio.c +++ b/trunk/net/9p/trans_virtio.c @@ -263,6 +263,7 @@ p9_virtio_request(struct p9_client *client, struct p9_req_t *req) { int in, out, inp, outp; struct virtio_chan *chan = client->trans; + char *rdata = (char *)req->rc+sizeof(struct p9_fcall); unsigned long flags; size_t pdata_off = 0; struct trans_rpage_info *rpinfo = NULL; @@ -345,8 +346,7 @@ p9_virtio_request(struct p9_client *client, struct p9_req_t *req) * Arrange in such a way that server places header in the * alloced memory and payload onto the user buffer. */ - inp = pack_sg_list(chan->sg, out, - VIRTQUEUE_NUM, req->rc->sdata, 11); + inp = pack_sg_list(chan->sg, out, VIRTQUEUE_NUM, rdata, 11); /* * Running executables in the filesystem may result in * a read request with kernel buffer as opposed to user buffer. @@ -366,8 +366,8 @@ p9_virtio_request(struct p9_client *client, struct p9_req_t *req) } in += inp; } else { - in = pack_sg_list(chan->sg, out, VIRTQUEUE_NUM, - req->rc->sdata, req->rc->capacity); + in = pack_sg_list(chan->sg, out, VIRTQUEUE_NUM, rdata, + req->rc->capacity); } err = virtqueue_add_buf(chan->vq, chan->sg, out, in, req->tc); @@ -592,14 +592,7 @@ static struct p9_trans_module p9_virtio_trans = { .close = p9_virtio_close, .request = p9_virtio_request, .cancel = p9_virtio_cancel, - - /* - * We leave one entry for input and one entry for response - * headers. We also skip one more entry to accomodate, address - * that are not at page boundary, that can result in an extra - * page in zero copy. - */ - .maxsize = PAGE_SIZE * (VIRTQUEUE_NUM - 3), + .maxsize = PAGE_SIZE*VIRTQUEUE_NUM, .pref = P9_TRANS_PREF_PAYLOAD_SEP, .def = 0, .owner = THIS_MODULE, diff --git a/trunk/net/ceph/msgpool.c b/trunk/net/ceph/msgpool.c index 1f4cb30a42c5..d5f2d97ac05c 100644 --- a/trunk/net/ceph/msgpool.c +++ b/trunk/net/ceph/msgpool.c @@ -7,37 +7,27 @@ #include -static void *msgpool_alloc(gfp_t gfp_mask, void *arg) +static void *alloc_fn(gfp_t gfp_mask, void *arg) { struct ceph_msgpool *pool = arg; - struct ceph_msg *msg; + void *p; - msg = ceph_msg_new(0, pool->front_len, gfp_mask); - if (!msg) { - dout("msgpool_alloc %s failed\n", pool->name); - } else { - dout("msgpool_alloc %s %p\n", pool->name, msg); - msg->pool = pool; - } - return msg; + p = ceph_msg_new(0, pool->front_len, gfp_mask); + if (!p) + pr_err("msgpool %s alloc failed\n", pool->name); + return p; } -static void msgpool_free(void *element, void *arg) +static void free_fn(void *element, void *arg) { - struct ceph_msgpool *pool = arg; - struct ceph_msg *msg = element; - - dout("msgpool_release %s %p\n", pool->name, msg); - msg->pool = NULL; - ceph_msg_put(msg); + ceph_msg_put(element); } int ceph_msgpool_init(struct ceph_msgpool *pool, int front_len, int size, bool blocking, const char *name) { - dout("msgpool %s init\n", name); pool->front_len = front_len; - pool->pool = mempool_create(size, msgpool_alloc, msgpool_free, pool); + pool->pool = mempool_create(size, alloc_fn, free_fn, pool); if (!pool->pool) return -ENOMEM; pool->name = name; @@ -46,17 +36,14 @@ int ceph_msgpool_init(struct ceph_msgpool *pool, void ceph_msgpool_destroy(struct ceph_msgpool *pool) { - dout("msgpool %s destroy\n", pool->name); mempool_destroy(pool->pool); } struct ceph_msg *ceph_msgpool_get(struct ceph_msgpool *pool, int front_len) { - struct ceph_msg *msg; - if (front_len > pool->front_len) { - dout("msgpool_get %s need front %d, pool size is %d\n", + pr_err("msgpool_get pool %s need front %d, pool size is %d\n", pool->name, front_len, pool->front_len); WARN_ON(1); @@ -64,19 +51,14 @@ struct ceph_msg *ceph_msgpool_get(struct ceph_msgpool *pool, return ceph_msg_new(0, front_len, GFP_NOFS); } - msg = mempool_alloc(pool->pool, GFP_NOFS); - dout("msgpool_get %s %p\n", pool->name, msg); - return msg; + return mempool_alloc(pool->pool, GFP_NOFS); } void ceph_msgpool_put(struct ceph_msgpool *pool, struct ceph_msg *msg) { - dout("msgpool_put %s %p\n", pool->name, msg); - /* reset msg front_len; user may have changed it */ msg->front.iov_len = pool->front_len; msg->hdr.front_len = cpu_to_le32(pool->front_len); kref_init(&msg->kref); /* retake single ref */ - mempool_free(msg, pool->pool); } diff --git a/trunk/net/ceph/osd_client.c b/trunk/net/ceph/osd_client.c index 16836a7df7a6..ce310eee708d 100644 --- a/trunk/net/ceph/osd_client.c +++ b/trunk/net/ceph/osd_client.c @@ -685,18 +685,6 @@ static void __remove_osd(struct ceph_osd_client *osdc, struct ceph_osd *osd) put_osd(osd); } -static void remove_all_osds(struct ceph_osd_client *osdc) -{ - dout("__remove_old_osds %p\n", osdc); - mutex_lock(&osdc->request_mutex); - while (!RB_EMPTY_ROOT(&osdc->osds)) { - struct ceph_osd *osd = rb_entry(rb_first(&osdc->osds), - struct ceph_osd, o_node); - __remove_osd(osdc, osd); - } - mutex_unlock(&osdc->request_mutex); -} - static void __move_osd_to_lru(struct ceph_osd_client *osdc, struct ceph_osd *osd) { @@ -713,14 +701,14 @@ static void __remove_osd_from_lru(struct ceph_osd *osd) list_del_init(&osd->o_osd_lru); } -static void remove_old_osds(struct ceph_osd_client *osdc) +static void remove_old_osds(struct ceph_osd_client *osdc, int remove_all) { struct ceph_osd *osd, *nosd; dout("__remove_old_osds %p\n", osdc); mutex_lock(&osdc->request_mutex); list_for_each_entry_safe(osd, nosd, &osdc->osd_lru, o_osd_lru) { - if (time_before(jiffies, osd->lru_ttl)) + if (!remove_all && time_before(jiffies, osd->lru_ttl)) break; __remove_osd(osdc, osd); } @@ -763,7 +751,6 @@ static void __insert_osd(struct ceph_osd_client *osdc, struct ceph_osd *new) struct rb_node *parent = NULL; struct ceph_osd *osd = NULL; - dout("__insert_osd %p osd%d\n", new, new->o_osd); while (*p) { parent = *p; osd = rb_entry(parent, struct ceph_osd, o_node); @@ -1157,7 +1144,7 @@ static void handle_osds_timeout(struct work_struct *work) dout("osds timeout\n"); down_read(&osdc->map_sem); - remove_old_osds(osdc); + remove_old_osds(osdc, 0); up_read(&osdc->map_sem); schedule_delayed_work(&osdc->osds_timeout_work, @@ -1875,7 +1862,8 @@ void ceph_osdc_stop(struct ceph_osd_client *osdc) ceph_osdmap_destroy(osdc->osdmap); osdc->osdmap = NULL; } - remove_all_osds(osdc); + remove_old_osds(osdc, 1); + WARN_ON(!RB_EMPTY_ROOT(&osdc->osds)); mempool_destroy(osdc->req_mempool); ceph_msgpool_destroy(&osdc->msgpool_op); ceph_msgpool_destroy(&osdc->msgpool_op_reply);