aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2012-01-10Merge branch 'stable/for-linus-fixes-3.3' of ↵Linus Torvalds1-1/+1
git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen * 'stable/for-linus-fixes-3.3' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen: xen/mmu: Fix compile errors introduced by x86/memblock mismerge.
2012-01-10block_dev: Suppress bdev_cache_init() kmemleak warninigSergey Senozhatsky1-8/+2
Kmemleak reports the following warning in bdev_cache_init() [ 0.003738] kmemleak: Object 0xffff880153035200 (size 256): [ 0.003823] kmemleak: comm "swapper/0", pid 0, jiffies 4294667299 [ 0.003909] kmemleak: min_count = 1 [ 0.003988] kmemleak: count = 0 [ 0.004066] kmemleak: flags = 0x1 [ 0.004144] kmemleak: checksum = 0 [ 0.004224] kmemleak: backtrace: [ 0.004303] [<ffffffff814755ac>] kmemleak_alloc+0x21/0x3e [ 0.004446] [<ffffffff811100ba>] kmem_cache_alloc+0xca/0x1dc [ 0.004592] [<ffffffff811371b1>] alloc_vfsmnt+0x1f/0x198 [ 0.004736] [<ffffffff811375c5>] vfs_kern_mount+0x36/0xd2 [ 0.004879] [<ffffffff8113929a>] kern_mount_data+0x18/0x32 [ 0.005025] [<ffffffff81ab9075>] bdev_cache_init+0x51/0x81 [ 0.005169] [<ffffffff81ab8abf>] vfs_caches_init+0x101/0x10d [ 0.005313] [<ffffffff81a9bae3>] start_kernel+0x344/0x383 [ 0.005456] [<ffffffff81a9b2a7>] x86_64_start_reservations+0xae/0xb2 [ 0.005602] [<ffffffff81a9b3ad>] x86_64_start_kernel+0x102/0x111 [ 0.005747] [<ffffffffffffffff>] 0xffffffffffffffff [ 0.008653] kmemleak: Trying to color unknown object at 0xffff880153035220 as Grey [ 0.008754] Pid: 0, comm: swapper/0 Not tainted 3.3.0-rc0-dbg-04200-g8180888-dirty #888 [ 0.008856] Call Trace: [ 0.008934] [<ffffffff81118704>] ? find_and_get_object+0x44/0x118 [ 0.009023] [<ffffffff81118fe6>] paint_ptr+0x57/0x8f [ 0.009109] [<ffffffff81475935>] kmemleak_not_leak+0x23/0x42 [ 0.009195] [<ffffffff81ab9096>] bdev_cache_init+0x72/0x81 [ 0.009282] [<ffffffff81ab8abf>] vfs_caches_init+0x101/0x10d [ 0.009368] [<ffffffff81a9bae3>] start_kernel+0x344/0x383 [ 0.009466] [<ffffffff81a9b2a7>] x86_64_start_reservations+0xae/0xb2 [ 0.009555] [<ffffffff81a9b140>] ? early_idt_handlers+0x140/0x140 [ 0.009643] [<ffffffff81a9b3ad>] x86_64_start_kernel+0x102/0x111 due to attempt to mark pointer to `struct vfsmount' as a gray object, which is embedded into `struct mount' returned from alloc_vfsmnt(). Make `bd_mnt' static, avoiding need to tell kmemleak to mark it gray, as suggested by Al Viro. Signed-off-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-01-10fix shrink_dcache_parent() livelockMiklos Szeredi2-4/+12
Two (or more) concurrent calls of shrink_dcache_parent() on the same dentry may cause shrink_dcache_parent() to loop forever. Here's what appears to happen: 1 - CPU0: select_parent(P) finds C and puts it on dispose list, returns 1 2 - CPU1: select_parent(P) locks P->d_lock 3 - CPU0: shrink_dentry_list() locks C->d_lock dentry_kill(C) tries to lock P->d_lock but fails, unlocks C->d_lock 4 - CPU1: select_parent(P) locks C->d_lock, moves C from dispose list being processed on CPU0 to the new dispose list, returns 1 5 - CPU0: shrink_dentry_list() finds dispose list empty, returns 6 - Goto 2 with CPU0 and CPU1 switched Basically select_parent() steals the dentry from shrink_dentry_list() and thinks it found a new one, causing shrink_dentry_list() to think it's making progress and loop over and over. One way to trigger this is to make udev calls stat() on the sysfs file while it is going away. Having a file in /lib/udev/rules.d/ with only this one rule seems to the trick: ATTR{vendor}=="0x8086", ATTR{device}=="0x10ca", ENV{PCI_SLOT_NAME}="%k", ENV{MATCHADDR}="$attr{address}", RUN+="/bin/true" Then execute the following loop: while true; do echo -bond0 > /sys/class/net/bonding_masters echo +bond0 > /sys/class/net/bonding_masters echo -bond1 > /sys/class/net/bonding_masters echo +bond1 > /sys/class/net/bonding_masters done One fix would be to check all callers and prevent concurrent calls to shrink_dcache_parent(). But I think a better solution is to stop the stealing behavior. This patch adds a new dentry flag that is set when the dentry is added to the dispose list. The flag is cleared in dentry_lru_del() in case the dentry gets a new reference just before being pruned. If the dentry has this flag, select_parent() will skip it and let shrink_dentry_list() retry pruning it. With select_parent() skipping those dentries there will not be the appearance of progress (new dentries found) when there is none, hence shrink_dcache_parent() will not loop forever. Set the flag is also set in prune_dcache_sb() for consistency as suggested by Linus. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> CC: stable@vger.kernel.org Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-01-10Merge branch 'kvm-updates/3.3' of git://git.kernel.org/pub/scm/virt/kvm/kvmLinus Torvalds37-1752/+2372
* 'kvm-updates/3.3' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (74 commits) KVM: PPC: Whitespace fix for kvm.h KVM: Fix whitespace in kvm_para.h KVM: PPC: annotate kvm_rma_init as __init KVM: x86 emulator: implement RDPMC (0F 33) KVM: x86 emulator: fix RDPMC privilege check KVM: Expose the architectural performance monitoring CPUID leaf KVM: VMX: Intercept RDPMC KVM: SVM: Intercept RDPMC KVM: Add generic RDPMC support KVM: Expose a version 2 architectural PMU to a guests KVM: Expose kvm_lapic_local_deliver() KVM: x86 emulator: Use opcode::execute for Group 9 instruction KVM: x86 emulator: Use opcode::execute for Group 4/5 instructions KVM: x86 emulator: Use opcode::execute for Group 1A instruction KVM: ensure that debugfs entries have been created KVM: drop bsp_vcpu pointer from kvm struct KVM: x86: Consolidate PIT legacy test KVM: x86: Do not rely on implicit inclusions KVM: Make KVM_INTEL depend on CPU_SUP_INTEL KVM: Use memdup_user instead of kmalloc/copy_from_user ...
2012-01-10Merge git://git.infradead.org/users/cbou/battery-urgentAnton Vorontsov452-3320/+3848
2012-01-10Merge branch 'for_linus' into for_linus_mergedTheodore Ts'o16-463/+1079
Conflicts: fs/ext4/ioctl.c
2012-01-10ext4: fix undefined behavior in ext4_fill_flex_info()Xi Wang1-4/+3
Commit 503358ae01b70ce6909d19dd01287093f6b6271c ("ext4: avoid divide by zero when trying to mount a corrupted file system") fixes CVE-2009-4307 by performing a sanity check on s_log_groups_per_flex, since it can be set to a bogus value by an attacker. sbi->s_log_groups_per_flex = sbi->s_es->s_log_groups_per_flex; groups_per_flex = 1 << sbi->s_log_groups_per_flex; if (groups_per_flex < 2) { ... } This patch fixes two potential issues in the previous commit. 1) The sanity check might only work on architectures like PowerPC. On x86, 5 bits are used for the shifting amount. That means, given a large s_log_groups_per_flex value like 36, groups_per_flex = 1 << 36 is essentially 1 << 4 = 16, rather than 0. This will bypass the check, leaving s_log_groups_per_flex and groups_per_flex inconsistent. 2) The sanity check relies on undefined behavior, i.e., oversized shift. A standard-confirming C compiler could rewrite the check in unexpected ways. Consider the following equivalent form, assuming groups_per_flex is unsigned for simplicity. groups_per_flex = 1 << sbi->s_log_groups_per_flex; if (groups_per_flex == 0 || groups_per_flex == 1) { We compile the code snippet using Clang 3.0 and GCC 4.6. Clang will completely optimize away the check groups_per_flex == 0, leaving the patched code as vulnerable as the original. GCC keeps the check, but there is no guarantee that future versions will do the same. Signed-off-by: Xi Wang <xi.wang@gmail.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Cc: stable@vger.kernel.org
2012-01-10coda: switch coda_cnode_make() to sane API as well, clean coda_lookup()Al Viro4-31/+27
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-01-10coda: deal correctly with allocation failure from coda_cnode_makectl()Al Viro3-15/+12
lookup should fail with ENOMEM, not silently make dentry negative. Switched to saner calling conventions, while we are at it. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-01-10securityfs: fix object creation racesAl Viro1-141/+50
inode needs to be fully set up before we feed it to d_instantiate(). securityfs_create_file() does *not* do so; it sets ->i_fop and ->i_private only after we'd exposed the inode. Unfortunately, that's done fairly deep in call chain, so the amount of churn is considerable. Helper functions killed by substituting into their solitary call sites, dead code removed. We finally can bury default_file_ops, now that the final value of ->i_fop is available (and assigned) at the point where inode is allocated. Reviewed-by: James Morris <jmorris@namei.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-01-10drm/nouveau/pm: fix build with HWMON offDave Airlie1-1/+1
Reported-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-10gma500: silence gcc warnings in mid_get_vbt_data()Dan Carpenter1-3/+3
Add a cast here to silence a Gcc warning. drivers/gpu/drm/gma500/mid_bios.c:214:28: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-10drm/ttm: fix condition (and vs or)Dan Carpenter1-5/+3
The "if (!p && !p->dev)" condition isn't right because || was intended instead of &&. But actually, "p" is the list cursor and so it's always non-NULL and we can just remove that bit. We can remove the another similar check as well. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Jerome Glisse <jglisse@redhat.com> Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-10rtc-puv3: solve section mismatch in rtc-puv3.cGuan Xuetao1-2/+2
The patch renames puv3_rtcdrv to puv3_rtc_driver, so that modpost will know that this is simply a list of pointers to driver functions, in which case the section mismatch is OK. (Thanks Michal Marek) Cc: Axel Lin <axel.lin@gmail.com> Cc: Michal Marek <mmarek@suse.cz> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: rtc-linux@googlegroups.com Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn> -- Section mismatch warning information: WARNING: drivers/rtc/built-in.o(.data+0x90): Section mismatch in reference from the variable puv3_rtcdrv to the function .devinit.text:puv3_rtc_probe() The variable puv3_rtcdrv references the function __devinit puv3_rtc_probe() If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console WARNING: drivers/rtc/built-in.o(.data+0x94): Section mismatch in reference from the variable puv3_rtcdrv to the function .devexit.text:puv3_rtc_remove() The variable puv3_rtcdrv references the function __devexit puv3_rtc_remove() If the reference is valid then annotate the variable with __exit* (see linux/init.h) or name the variable: *driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console WARNING: drivers/built-in.o(.data+0x6c04): Section mismatch in reference from the variable puv3_rtcdrv to the function .devinit.text:puv3_rtc_probe() The variable puv3_rtcdrv references the function __devinit puv3_rtc_probe() If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console WARNING: drivers/built-in.o(.data+0x6c08): Section mismatch in reference from the variable puv3_rtcdrv to the function .devexit.text:puv3_rtc_remove() The variable puv3_rtcdrv references the function __devexit puv3_rtc_remove() If the reference is valid then annotate the variable with __exit* (see linux/init.h) or name the variable: *driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console WARNING: vmlinux.o(.data+0x1126c): Section mismatch in reference from the variable puv3_rtcdrv to the function .devinit.text:puv3_rtc_probe() The variable puv3_rtcdrv references the function __devinit puv3_rtc_probe() If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console WARNING: vmlinux.o(.data+0x11270): Section mismatch in reference from the variable puv3_rtcdrv to the function .devexit.text:puv3_rtc_remove() The variable puv3_rtcdrv references the function __devexit puv3_rtc_remove() If the reference is valid then annotate the variable with __exit* (see linux/init.h) or name the variable: *driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
2012-01-10rtc-puv3: using module_platform_driver()Guan Xuetao1-15/+1
This patch converts the driver to use the module_platform_driver() macro which makes the code smaller and a bit simpler. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn>
2012-01-10i2c-puv3: using module_platform_driver()Guan Xuetao1-14/+2
This patch converts the driver to use the module_platform_driver() macro which makes the code smaller and a bit simpler. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn>
2012-01-10rtc-puv3: irq: remove IRQF_DISABLEDGuan Xuetao1-2/+2
This flag is deprecated, so is removed now. Signed-off-by: Yong Zhang <yong.zhang@gmail.com> Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn>
2012-01-10unicore32: Remove IRQF_DISABLEDYong Zhang2-3/+3
This flag is a NOOP and can be removed now. Signed-off-by: Yong Zhang <yong.zhang0@gmail.com>
2012-01-10unicore32: Use set_current_blocked()Matt Fleming1-10/+5
As described in e6fa16ab ("signal: sigprocmask() should do retarget_shared_pending()") the modification of current->blocked is incorrect as we need to check whether the signal we're about to block is pending in the shared queue. Cc: Oleg Nesterov <oleg@redhat.com> Cc: Guan Xuetao <gxt@mprc.pku.edu.cn> Signed-off-by: Matt Fleming <matt.fleming@intel.com> Cc: Arnd Bergmann <arnd@arndb.de> Acked-by: Guan Xuetao <gxt@mprc.pku.edu.cn>
2012-01-10unicore32: add ioremap_nocache definitionGuan Xuetao1-0/+1
Bugfix for following error messages: lib/iomap.c: In function 'pci_iomap': lib/iomap.c:274: error: implicit declaration of function 'ioremap_nocache' lib/iomap.c:274: warning: return makes pointer from integer without a cast Also see commit <f1ecc69838a2d7c8a3e1909f637d4083c071777d> it will hide the ioremap_nocache function for systems with an MMU Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Jonas Bonn <jonas@southpole.se>
2012-01-10unicore32: delete specified xlate_dev_mem_ptrGuan Xuetao1-7/+0
For the commit <f1ecc69838a2d7c8a3e1909f637d4083c071777d> has changed xlate_dev_mem_ptr definition in asm-generic/io.h for the systems with an MMU, so delete it from unicore32 specified io.h. Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Jonas Bonn <jonas@southpole.se>
2012-01-10of: add include asm/setup.h in drivers/of/fdt.cYu Yue1-0/+1
In the file drivers/of/fdt.c, it uses the COMMAND_LINE_SIZE which is stated in asm/setup.h, so asm/setup.h should be included in drivers/of/fdt.c. Signed-off-by: Yu Yue <yuyue@mprc.pku.edu.cn> Signed-off-by: Guan Xuetao <guanxuetao@mprc.pku.edu.cn> Cc: Grant Likerly <grant.likely@secretlab.ca> Cc: devicetree-discuss@lists.ozlabs.org Cc: Arnd Bergmann <arnd@arndb.de>
2012-01-10unicore32: standardize /proc/iomem "Kernel code" nameKees Cook1-1/+1
All other ports use "Kernel code" to identify the Kernel text segment in /proc/iomem. Change the unicore32 resources to do the same. Signed-off-by: Kees Cook <keescook@chromium.org> Acked-by: Arnd Bergmann <arnd@arndb.de>
2012-01-09Merge branch 'for-linus' of ↵Linus Torvalds5-53/+63
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: vfs: new helper - d_make_root() dcache: use a dispose list in select_parent ceph: d_alloc_root() may fail ext4: fix failure exits isofs: inode leak on mount failure
2012-01-10power_supply: Mark da9052 driver as brokenAnton Vorontsov1-0/+1
There are some problems with MFD part of this driver, so the driver fails to build: drivers/power/da9052-battery.c: In function 'da9052_bat_read_volt': drivers/power/da9052-battery.c:293:2: error: implicit declaration of function 'da9052_adc_manual_read' [-Werror=implicit-function-declaration] drivers/power/da9052-battery.c: In function 'da9052_bat_check_presence': drivers/power/da9052-battery.c:306:2: error: implicit declaration of function 'da9052_adc_read_temp' [-Werror=implicit-function-declaration] drivers/power/da9052-battery.c: In function 'da9052_determine_vc_tbl_index': drivers/power/da9052-battery.c:348:1: warning: control reaches end of non-void function [-Wreturn-type] cc1: some warnings being treated as errors The fix for MFD part will probably go post -rc1 (or in the next merge window), so let's disable the driver for now. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2012-01-09vfs: new helper - d_make_root()Al Viro2-0/+18
d_alloc_root() with iput() in case of allocation failure... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-01-09dcache: use a dispose list in select_parentDave Chinner1-42/+21
select_parent currently abuses the dentry cache LRU to provide cleanup features for child dentries that need to be freed. It moves them to the tail of the LRU, then tells shrink_dcache_parent() to calls __shrink_dcache_sb to unconditionally move them to a dispose list (as DCACHE_REFERENCED is ignored). __shrink_dcache_sb() has to relock the dentries to move them off the LRU onto the dispose list, but otherwise does not touch the dentries that select_parent() moved to the tail of the LRU. It then passses the dispose list to shrink_dentry_list() which tries to free the dentries. IOWs, the use of __shrink_dcache_sb() is superfluous - we can build exactly the same list of dentries for disposal directly in select_parent() and call shrink_dentry_list() instead of calling __shrink_dcache_sb() to do that. This means that we avoid long holds on the lru lock walking the LRU moving dentries to the dispose list We also avoid the need to relock each dentry just to move it off the LRU, reducing the numebr of times we lock each dentry to dispose of them in shrink_dcache_parent() from 3 to 2 times. Further, we remove one of the two callers of __shrink_dcache_sb(). This also means that __shrink_dcache_sb can be moved into back into prune_dcache_sb() and we no longer have to handle referenced dentries conditionally, simplifying the code. Signed-off-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-01-09Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-nextLinus Torvalds8-347/+8
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next: sparc32: remove unused file: include/asm/pgtsun4.h sparc32: fix PAGE_SIZE definition sparc32: enable different preemptions models sparc32: support atomic64_t apbuart: fix section mismatch warning sparc32: drop useless preprocessor conditional in atomic_32.h sparc32: drop unused atomic24 support
2012-01-09Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netLinus Torvalds19-32/+57
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: igmp: Avoid zero delay when receiving odd mixture of IGMP queries netdev: make net_device_ops const bcm63xx: make ethtool_ops const usbnet: make ethtool_ops const net: Fix build with INET disabled. net: introduce netif_addr_lock_nested() and call if when appropriate net: correct lock name in dev_[uc/mc]_sync documentations. net: sk_update_clone is only used in net/core/sock.c 8139cp: fix missing napi_gro_flush. pktgen: set correct max and min in pktgen_setup_inject() smsc911x: Unconditionally include linux/smscphy.h in smsc911x.h asix: fix infinite loop in rx_fixup() net: Default UDP and UNIX diag to 'n'. r6040: fix typo in use of MCR0 register bits net: fix sock_clone reference mismatch with tcp memcontrol
2012-01-09Merge tag 'clk' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-socLinus Torvalds17-58/+97
clock management changes for i.MX Another simple series related to clock management, this time only for imx. * tag 'clk' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: ARM: mxs: select HAVE_CLK_PREPARE for clock clk: add config option HAVE_CLK_PREPARE into Kconfig ASoC: mxs-saif: convert to clk_prepare/clk_unprepare video: mxsfb: convert to clk_prepare/clk_unprepare serial: mxs-auart: convert to clk_prepare/clk_unprepare net: flexcan: convert to clk_prepare/clk_unprepare mtd: gpmi-lib: convert to clk_prepare/clk_unprepare mmc: mxs-mmc: convert to clk_prepare/clk_unprepare dma: mxs-dma: convert to clk_prepare/clk_unprepare net: fec: add clk_prepare/clk_unprepare ARM: mxs: convert platform code to clk_prepare/clk_unprepare clk: add helper functions clk_prepare_enable and clk_disable_unprepare Fix up trivial conflicts in drivers/net/ethernet/freescale/fec.c due to commit 0ebafefcaa7a ("net: fec: add clk_prepare/clk_unprepare") clashing trivially with commit e163cc97f9ac ("net/fec: fix the .remove code").
2012-01-09Merge tag 'timer' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-socLinus Torvalds1-223/+124
timer changes for msm A very simple series. We used to have more churn in the timer area, so this is kept separate. Will probably put this into the drivers series next time. * tag 'timer' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: msm: timer: Use clockevents_config_and_register() msm: timer: Setup interrupt after registering clockevent msm: timer: Remove SoC specific #ifdefs msm: timer: Remove msm_clocks[] and simplify code msm: timer: Fix ONESHOT mode interrupts msm: timer: Use GPT for clockevents and DGT for clocksource msm: timer: Cleanup #includes and #defines msm: timer: Tighten #ifdef for local timer support
2012-01-09Merge tag 'pm' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-socLinus Torvalds59-1180/+3871
power management changes for omap and imx A significant part of the changes for these two platforms went into power management, so they are split out into a separate branch. * tag 'pm' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (65 commits) ARM: imx6: remove __CPUINIT annotation from v7_invalidate_l1 ARM: imx6: fix v7_invalidate_l1 by adding I-Cache invalidation ARM: imx6q: resume PL310 only when CACHE_L2X0 defined ARM: imx6q: build pm code only when CONFIG_PM selected ARM: mx5: use generic irq chip pm interface for pm functions on ARM: omap: pass minimal SoC/board data for UART from dt arm/dts: Add minimal device tree support for omap2420 and omap2430 omap-serial: Add minimal device tree support omap-serial: Use default clock speed (48Mhz) if not specified omap-serial: Get rid of all pdev->id usage ARM: OMAP2+: hwmod: Add a new flag to handle hwmods left enabled at init ARM: OMAP4: PRM: use PRCM interrupt handler ARM: OMAP3: pm: use prcm chain handler ARM: OMAP: hwmod: add support for selecting mpu_irq for each wakeup pad ARM: OMAP2+: mux: add support for PAD wakeup interrupts ARM: OMAP: PRCM: add suspend prepare / finish support ARM: OMAP: PRCM: add support for chain interrupt handler ARM: OMAP3/4: PRM: add functions to read pending IRQs, PRM barrier ARM: OMAP2+: hwmod: Add API to enable IO ring wakeup ARM: OMAP2+: mux: add wakeup-capable hwmod mux entries to dynamic list ...
2012-01-09Merge tag 'drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-socLinus Torvalds169-1631/+3010
Driver specific changes Again, a lot of platforms have changes in here: pxa, samsung, omap, at91, imx, ... * tag 'drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (54 commits) ARM: sa1100: clean up of the clock support ARM: pxa: add dummy clock for sa1100-rtc RTC: sa1100: support sa1100, pxa and mmp soc families RTC: sa1100: remove redundant code of setting alarm RTC: sa1100: Clean out ost register Input: zylonite-wm97xx - replace IRQ_GPIO() with gpio_to_irq() pcmcia: pxa: replace IRQ_GPIO() with gpio_to_irq() ARM: EXYNOS: Modified files for SPI consolidation work ARM: S5P64X0: Enable SDHCI support ARM: S5P64X0: Add lookup of sdhci-s3c clocks using generic names ARM: S5P64X0: Add HSMMC setup for host Controller ARM: EXYNOS: Add USB OHCI support to ORIGEN board USB: Add Samsung Exynos OHCI diver ARM: EXYNOS: Add USB OHCI support to SMDKV310 board ARM: EXYNOS: Add USB OHCI device net: macb: fix build break with !CONFIG_OF i2c: tegra: Support DVC controller in device tree i2c: tegra: Add __devinit/exit to probe/remove net/at91_ether: use gpio_is_valid for phy IRQ line ARM: at91/net: add macb ethernet controller in 9g45/9g20 DT ...
2012-01-09Merge tag 'devel' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-socLinus Torvalds75-961/+1430
New feature development This adds support for new features, and contains stuff from most platforms. A number of these patches could have fit into other branches, too, but were small enough not to cause too much confusion here. * tag 'devel' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (28 commits) mfd/db8500-prcmu: remove support for early silicon revisions ARM: ux500: fix the smp_twd clock calculation ARM: ux500: remove support for early silicon revisions ARM: ux500: update register files ARM: ux500: register DB5500 PMU dynamically ARM: ux500: update ASIC detection for U5500 ARM: ux500: support DB8520 ARM: picoxcell: implement watchdog restart ARM: OMAP3+: hwmod data: Add the default clockactivity for I2C ARM: OMAP3: hwmod data: disable multiblock reads on MMC1/2 on OMAP34xx/35xx <= ES2.1 ARM: OMAP: USB: EHCI and OHCI hwmod structures for OMAP4 ARM: OMAP: USB: EHCI and OHCI hwmod structures for OMAP3 ARM: OMAP: hwmod data: Add support for AM35xx UART4/ttyO3 ARM: Orion: Remove address map info from all platform data structures ARM: Orion: Get address map from plat-orion instead of via platform_data ARM: Orion: mbus_dram_info consolidation ARM: Orion: Consolidate the address map setup ARM: Kirkwood: Add configuration for MPP12 as GPIO ARM: Kirkwood: Recognize A1 revision of 6282 chip ARM: ux500: update the MOP500 GPIO assignments ...
2012-01-09Merge tag 'boards' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-socLinus Torvalds52-282/+872
Board-level changes This adds and extends support for specific boards on a number of ARM platforms: omap, imx, samsung, tegra, ... * tag 'boards' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (49 commits) Enable 32 bit flash support for iMX21ADS board ARM: mx31pdk: Add MC13783 RTC support iomux-mx25: configuration to support CSPI3 on CSI pins MX1:apf9328: Add i2c support mioa701: add newly available DoC G3 chip arm/tegra: remove __initdata annotation from pinmux tables arm/tegra: Use bus notifiers to trigger pinmux setup arm/tegra: Refactor board-*-pinmux.c to share code arm/tegra: Fix mistake in Trimslice's pinmux arm/tegra: Rework Seaboard-vs-Ventana pinmux table arm/tegra: Remove useless entries from ventana_pinmux[] arm/tegra: PCIe: Remove include of mach/pinmux.h arm/tegra: Harmony PCIe: Don't touch pinmux arm/tegra: Add AUXDATA for tegra-pinmux and tegra-gpio arm/tegra: Split Seaboard GPIO table to allow for Ventana ARM: imx6q: generate imx6q dtb files arm/imx6q: Rename Sabreauto to Armadillo2 arm/imx6q-sabrelite: add enet phy ksz9021rn fixup arm/imx6: add imx6q sabrelite board support dts/imx: rename uart labels to consistent with hw spec ...
2012-01-09Merge tag 'soc' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-socLinus Torvalds54-250/+1399
SoC-level changes for tegra and omap This adds support for the new tegra30 SoC, as well as small changes to support minor variations of existing omap SoCs. * tag 'soc' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (26 commits) arm/tegra: Compile tegra_dt_init_irq only when CONFIG_OF arm/tegra: Make MACH_TEGRA_DT depend on ARCH_TEGRA_2x_SOC arm/tegra: Delete tegra_init_clock() arm/tegra: Fix section mismatch errors in tegra30 pinmux arm/tegra: Fix section mismatch errors in tegra20 pinmux arm/tegra: refresh defconfig for tegra30 arm/tegra: add support for tegra30 based board cardhu arm/tegra: implement support for tegra30 arm/tegra: pinmux tables and definitions for tegra30 arm/tegra: add new fields to struct tegra_pingroup_desc arm/tegra: prepare pinmux code for multiple tegra variants arm/tegra: rename tegra20 pinmux files arm/tegra: generalize L2 cache initialization arm/tegra: use PMC reset arm/tegra: rename board-dt.c to board-dt-tegra20.c arm/tegra: prepare early init for multiple tegra variants arm/tegra: don't export clk_measure_input_freq arm/tegra: prepare clock code for multiple tegra variants arm/tegra: cleanup tegra20 support arm/tegra: clk_get should not be fatal ... Fix up trivial conflict in arch/arm/mach-tegra/board-dt-tegra20.c
2012-01-09Merge tag 'cleanup2' of ↵Linus Torvalds50-1438/+1000
git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc Cleanups for the Samsung platforms Various cleanup changes that the device driver changes are built upon. Since the samsung cleanups depend on the device tree series, which depends on the first set of cleanups for tegra. * tag 'cleanup2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: ARM: EXYNOS: Use gpio_request_one ARM: S5PV210: Use gpio_request_one ARM: S3C64XX: Modified according to SPI consolidation work ARM: S5PV210: Modified files for SPI consolidation work ARM: S5P64X0: Modified files for SPI consolidation work ARM: S5PC100: Modified files for SPI consolidation work ARM: S3C64XX: Modified files for SPI consolidation work ARM: SAMSUNG: Consolidation of SPI platform devices to plat-samsung ARM: SAMSUNG: Remove SPI bus clocks from platform data ARM: S5PV210: Add SPI clkdev support ARM: S5P64X0: Add SPI clkdev support ARM: S5PC100: Add SPI clkdev support ARM: S3C64XX: Add SPI clkdev support spi/s3c64xx: Use bus clocks created using clkdev mmc: sdhci-s3c: Use generic clock names for sdhci bus clock options ARM: SAMSUNG: Add lookup of sdhci-s3c clocks using generic names ARM: SAMSUNG: Remove SDHCI bus clocks from platform data ARM: SAMSUNG: Use kmemdup rather than duplicating its implementation ARM: EXYNOS: remove exynos4_scu_enable()
2012-01-09Merge tag 'dt' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-socLinus Torvalds74-2247/+3015
Device tree conversions for samsung and tegra Both platforms had some initial device tree support, but this adds much more to actually make it usable. * tag 'dt' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (45 commits) ARM: dts: Add intial dts file for EXYNOS4210 SoC, SMDKV310 and ORIGEN ARM: EXYNOS: Add Exynos4 device tree enabled board file rtc: rtc-s3c: Add device tree support input: samsung-keypad: Add device tree support ARM: S5PV210: Modify platform data for pl330 driver ARM: S5PC100: Modify platform data for pl330 driver ARM: S5P64x0: Modify platform data for pl330 driver ARM: EXYNOS: Add a alias for pdma clocks ARM: EXYNOS: Limit usage of pl330 device instance to non-dt build ARM: SAMSUNG: Add device tree support for pl330 dma engine wrappers DMA: PL330: Add device tree support ARM: EXYNOS: Modify platform data for pl330 driver DMA: PL330: Infer transfer direction from transfer request instead of platform data DMA: PL330: move filter function into driver serial: samsung: Fix build for non-Exynos4210 devices serial: samsung: add device tree support serial: samsung: merge probe() function from all SoC specific extensions serial: samsung: merge all SoC specific port reset functions ARM: SAMSUNG: register uart clocks to clock lookup list serial: samsung: remove all uses of get_clksrc and set_clksrc ... Fix up fairly trivial conflicts in arch/arm/mach-s3c2440/clock.c and drivers/tty/serial/Kconfig both due to just adding code close to changes.
2012-01-09Merge tag 'cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-socLinus Torvalds136-1500/+1643
Cleanups on various subarchitectures Cleanup patches for various ARM platforms and some of their associated drivers, the bulk of these is for mach-91. Arnd ended up pulling in the restart branch from Russell in order to fix up some simple but annoying merge conflicts. * tag 'cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (44 commits) arm/at91: fix build of stamp9g20 ARM: u300: delete memory.h MAINTAINERS: add maintainer entry for Picochip picoxcell ARM: picoxcell: move io mappings to common.c ARM: picoxcell: don't reserve irq_descs ARM: picoxcell: remove mach/memory.h ARM: at91: delete the pcontrol_g20_defconfig arm/tegra: Remove code that's ifndef CONFIG_ARM_GIC arm/tegra: remove unused defines arm/tegra: fix variable formatting in makefile ARM: davinci: vpif: move code to driver core header from platform ARM: at91/gpio: fix display of number of irq setuped ARM: at91/gpio: drop PIN_BASE ARM: at91/udc: use gpio_is_valid to check the gpio ARM: at91/ohci: use gpio_is_valid to check the gpio ARM: at91/nand: use gpio_is_valid to check the gpio ARM: at91/mmc: use gpio_is_valid to check the gpio ARM: at91/ide: use gpio_is_valid to check the gpio ARM: at91/pata: use gpio_is_valid to check the gpio ARM: at91/soc: use gpio_is_valid to check the gpio ...
2012-01-09Merge tag 'fixes-non-critical' of ↵Linus Torvalds7-72/+134
git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc Non-critical bug fixes Simple bug fixes that were not considered important enough for inclusion into 3.2. * tag 'fixes-non-critical' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: MAINTAINERS: update pxa and mmp ARM: pxa: Include linux/export.h in balloon3.c ARM: OMAP4: clock: Add CPU local timer clock node ARM: OMAP4: hwmod: Don't wait for the idle status if modulemode is not supported ARM: OMAP: AM3517/3505: fix crash on boot due to incorrect voltagedomain data ARM: OMAP: hwmod data: fix the panic on Nokia RM-680 during boot ARM: OMAP2+: DMA: Workaround for invalid destination position ARM: OMAP2+: DMA: Workaround for invalid source position
2012-01-09tracing/mm: Move include of trace/events/kmem.h out of header into slab.cSteven Rostedt2-2/+2
Including trace/events/*.h TRACE_EVENT() macro headers in other headers can cause strange side effects if another trace/event/*.h header includes that header. Having trace/events/kmem.h inside slab_def.h caused a compile error in sparc64 when changes were done to some header files. Moving the kmem.h trace header out of slab.h and into slab.c fixes the problem. Note, both slub.c and slob.c already include the trace/events/kmem.h file. Only slab.c had it missing. Link: http://lkml.kernel.org/r/20120105190405.1e3191fb5a43b2a0f1655e1f@canb.auug.org.au Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-01-09igmp: Avoid zero delay when receiving odd mixture of IGMP queriesBen Hutchings1-0/+2
Commit 5b7c84066733c5dfb0e4016d939757b38de189e4 ('ipv4: correct IGMP behavior on v3 query during v2-compatibility mode') added yet another case for query parsing, which can result in max_delay = 0. Substitute a value of 1, as in the usual v3 case. Reported-by: Simon McVittie <smcv@debian.org> References: http://bugs.debian.org/654876 Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-01-09netdev: make net_device_ops conststephen hemminger2-3/+2
More drivers where net_device_ops should be const. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-01-09bcm63xx: make ethtool_ops conststephen hemminger1-1/+1
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-01-09usbnet: make ethtool_ops conststephen hemminger4-5/+5
The ethtool_ops table of function pointers should be const. Fix all the usb network drivers. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-01-09net: Fix build with INET disabled.David S. Miller2-2/+1
> net/core/sock.c: In function 'sk_update_clone': > net/core/sock.c:1278:3: error: implicit declaration of function 'sock_update_memcg' Reported-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-01-09ceph: d_alloc_root() may failAl Viro1-4/+11
... and ceph_init_dentry(NULL) will oops Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-01-09Merge branch 'for-3.3' of ↵Linus Torvalds9-236/+62
git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu * 'for-3.3' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu: percpu: Remove irqsafe_cpu_xxx variants Fix up conflict in arch/x86/include/asm/percpu.h due to clash with cebef5beed3d ("x86: Fix and improve percpu_cmpxchg{8,16}b_double()") which edited the (now removed) irqsafe_cpu_cmpxchg*_double code.
2012-01-09Merge branch 'for-3.3' of ↵Linus Torvalds15-349/+470
git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup * 'for-3.3' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup: (21 commits) cgroup: fix to allow mounting a hierarchy by name cgroup: move assignement out of condition in cgroup_attach_proc() cgroup: Remove task_lock() from cgroup_post_fork() cgroup: add sparse annotation to cgroup_iter_start() and cgroup_iter_end() cgroup: mark cgroup_rmdir_waitq and cgroup_attach_proc() as static cgroup: only need to check oldcgrp==newgrp once cgroup: remove redundant get/put of task struct cgroup: remove redundant get/put of old css_set from migrate cgroup: Remove unnecessary task_lock before fetching css_set on migration cgroup: Drop task_lock(parent) on cgroup_fork() cgroups: remove redundant get/put of css_set from css_set_check_fetched() resource cgroups: remove bogus cast cgroup: kill subsys->can_attach_task(), pre_attach() and attach_task() cgroup, cpuset: don't use ss->pre_attach() cgroup: don't use subsys->can_attach_task() or ->attach_task() cgroup: introduce cgroup_taskset and use it in subsys->can_attach(), cancel_attach() and attach() cgroup: improve old cgroup handling in cgroup_attach_proc() cgroup: always lock threadgroup during migration threadgroup: extend threadgroup_lock() to cover exit and exec threadgroup: rename signal->threadgroup_fork_lock to ->group_rwsem ... Fix up conflict in kernel/cgroup.c due to commit e0197aae59e5: "cgroups: fix a css_set not found bug in cgroup_attach_proc" that already mentioned that the bug is fixed (differently) in Tejun's cgroup patchset. This one, in other words.
2012-01-09ext4: fix failure exitsAl Viro1-5/+8
a) leaking root dentry is bad b) in case of failed ext4_mb_init() we don't want to do ext4_mb_release() c) OTOH, in the same case we *do* want ext4_ext_release() Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-01-09Merge branch 'for_linus' of ↵Linus Torvalds35-111/+201
git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: ext2/3/4: delete unneeded includes of module.h ext{3,4}: Fix potential race when setversion ioctl updates inode udf: Mark LVID buffer as uptodate before marking it dirty ext3: Don't warn from writepage when readonly inode is spotted after error jbd: Remove j_barrier mutex reiserfs: Force inode evictions before umount to avoid crash reiserfs: Fix quota mount option parsing udf: Treat symlink component of type 2 as / udf: Fix deadlock when converting file from in-ICB one to normal one udf: Cleanup calling convention of inode_getblk() ext2: Fix error handling on inode bitmap corruption ext3: Fix error handling on inode bitmap corruption ext3: replace ll_rw_block with other functions ext3: NULL dereference in ext3_evict_inode() jbd: clear revoked flag on buffers before a new transaction started ext3: call ext3_mark_recovery_complete() when recovery is really needed
2012-01-09Merge branch 'for-linus' of git://git.open-osd.org/linux-open-osdLinus Torvalds5-28/+83
* 'for-linus' of git://git.open-osd.org/linux-open-osd: ore: Must support none-PAGE-aligned IO ore: fix BUG_ON, too few sgs when reading ore: Fix crash in case of an IO error. ore: FIX breakage when MISC_FILESYSTEMS is not set
2012-01-09Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfsLinus Torvalds1-2/+2
* 'for-linus' of git://oss.sgi.com/xfs/xfs: xfs: fix endian conversion issue in discard code
2012-01-09net: introduce netif_addr_lock_nested() and call if when appropriateJiri Pirko2-6/+11
dev_uc_sync() and dev_mc_sync() are acquiring netif_addr_lock for destination device of synchronization. Since netif_addr_lock is already held at the time for source device, this triggers lockdep deadlock warning. There's no way this deadlock can happen so use spin_lock_nested() to silence the warning. Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-01-09net: correct lock name in dev_[uc/mc]_sync documentations.Jiri Pirko1-2/+2
Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-01-09Merge branch 'staging-next' of ↵Linus Torvalds462-36047/+24350
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging * 'staging-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (466 commits) net/hyperv: Add support for jumbo frame up to 64KB net/hyperv: Add NETVSP protocol version negotiation net/hyperv: Remove unnecessary kmap_atomic in netvsc driver staging/rtl8192e: Register against lib80211 staging/rtl8192e: Convert to lib80211_crypt_info staging/rtl8192e: Convert to lib80211_crypt_data and lib80211_crypt_ops staging/rtl8192e: Add lib80211.h to rtllib.h staging/mei: add watchdog device registration wrappers drm/omap: GEM, deal with cache staging: vt6656: int.c, int.h: Change return of function to void staging: usbip: removed unused definitions from header staging: usbip: removed dead code from receive function staging:iio: Drop {mark,unmark}_in_use callbacks staging:iio: Drop buffer mark_param_change callback staging:iio: Drop the unused buffer enable() and is_enabled() callbacks staging:iio: Drop buffer busy flag staging:iio: Make sure a device is only opened once at a time staging:iio: Disallow modifying buffer size when buffer is enabled staging:iio: Disallow changing scan elements in all buffered modes staging:iio: Use iio_buffer_enabled instead of open coding it ... Fix up conflict in drivers/staging/iio/adc/ad799x_core.c (removal of module_init due to using module_i2c_driver() helper, next to removal of MODULE_ALIAS due to using MODULE_DEVICE_TABLE instead).
2012-01-09Merge branch 'usb-next' of ↵Linus Torvalds203-3798/+4979
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb * 'usb-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (232 commits) USB: Add USB-ID for Multiplex RC serial adapter to cp210x.c xhci: Clean up 32-bit build warnings. USB: update documentation for usbmon usb: usb-storage doesn't support dynamic id currently, the patch disables the feature to fix an oops drivers/usb/class/cdc-acm.c: clear dangling pointer drivers/usb/dwc3/dwc3-pci.c: introduce missing kfree drivers/usb/host/isp1760-if.c: introduce missing kfree usb: option: add ZD Incorporated HSPA modem usb: ch9: fix up MaxStreams helper USB: usb-skeleton.c: cleanup open_count USB: usb-skeleton.c: fix open/disconnect race xhci: Properly handle COMP_2ND_BW_ERR USB: remove dead code from suspend/resume path USB: add quirk for another camera drivers: usb: wusbcore: Fix dependency for USB_WUSB xhci: Better debugging for critical host errors. xhci: Be less verbose during URB cancellation. xhci: Remove debugging about ring structure allocation. xhci: Remove debugging about toggling cycle bits. xhci: Remove debugging for individual transfers. ...
2012-01-09Merge branch 'tty-next' of ↵Linus Torvalds45-658/+1989
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty * 'tty-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (65 commits) tty: serial: imx: move del_timer_sync() to avoid potential deadlock imx: add polled io uart methods imx: Add save/restore functions for UART control regs serial/imx: let probing fail for the dt case without a valid alias serial/imx: propagate error from of_alias_get_id instead of using -ENODEV tty: serial: imx: Allow UART to be a source for wakeup serial: driver for m32 arch should not have DEC alpha errata serial/documentation: fix documented name of DCD cpp symbol atmel_serial: fix spinlock lockup in RS485 code tty: Fix memory leak in virtual console when enable unicode translation serial: use DIV_ROUND_CLOSEST instead of open coding it serial: add support for 400 and 800 v3 series Titan cards serial: bfin-uart: Remove ASYNC_CTS_FLOW flag for hardware automatic CTS. serial: bfin-uart: Enable hardware automatic CTS only when CTS pin is available. serial: make FSL errata depend on 8250_CONSOLE, not just 8250 serial: add irq handler for Freescale 16550 errata. serial: manually inline serial8250_handle_port serial: make 8250 timeout use the specified IRQ handler serial: export the key functions for an 8250 IRQ handler serial: clean up parameter passing for 8250 Rx IRQ handling ...
2012-01-09Merge branch 'char-misc-next' of ↵Linus Torvalds10-126/+126
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc * 'char-misc-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: isl29020: Remove a redundant semi-colon from return statement BMP085: Remove redundant semi-colon from return statement drivers:misc: ti-st: DEBUG uart, baud rate mods drivers:misc: ti-st: flush UART upon fw failure drivers:misc: ti-st: protect registrations char_dev.c: fix up some whitespace errors s390: tape_class.h: remove kobj_map.h inclusion misc: ad525x_dpot: Add support for SPI module device table matching
2012-01-09NFSv4: Change the default setting of the nfs4_disable_idmapping parameterTrond Myklebust2-7/+12
Now that the use of numeric uids/gids is officially sanctioned in RFC3530bis, it is time to change the default here to 'enabled'. By doing so, we ensure that NFSv4 copies the behaviour of NFSv3 when we're using the default AUTH_SYS authentication (i.e. when the client uses the numeric uids/gids as authentication tokens), so that when new files are created, they will appear to have the correct user/group. It also fixes a number of backward compatibility issues when migrating from NFSv3 to NFSv4 on a platform where the server uses different uid/gid mappings than the client. Note also that this setting has been successfully tested against servers that do not support numeric uids/gids at several Connectathon/Bakeathon events at this point, and the fall back to using string names/groups has been shown to work well in all those test cases. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2012-01-09mtd: Fix dependency for MTD_DOC200xFabio Estevam1-0/+3
Fix the following build warning: warning: (MTD_DOC2000 && MTD_DOC2001 && MTD_DOC2001PLUS) selects MTD_NAND_IDS which has unmet direct dependencies (MTD && MTD_NAND) Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: do not use mtd->block_markbad directlyArtem Bityutskiy6-10/+6
Instead, use the new 'mtd_can_have_bb()', or just rely on 'mtd_block_markbad()' return code, which will be -EOPNOTSUPP if bad blocks are not supported. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09logfs: do not use 'mtd->block_isbad' directlyArtem Bityutskiy1-2/+2
Instead, use the new 'mtd_can_have_bb()' helper. Cc: Jörn Engel <joern@logfs.org> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: introduce mtd_can_have_bb helperArtem Bityutskiy12-20/+21
This patch introduces new 'mtd_can_have_bb()' helper function which checks whether the flash can have bad eraseblocks. Then it changes all the direct 'mtd->block_isbad' use cases with 'mtd_can_have_bb()'. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: do not use mtd->suspend and mtd->resume directlyArtem Bityutskiy4-11/+9
Just call the 'mtd_suspend()' and 'mtd_resume()' - they will do nothing if the operation is not defined. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: do not use mtd->lock, unlock and is_locked directlyArtem Bityutskiy5-29/+19
Instead, call the corresponding MTD API function which will return '-EOPNOTSUPP' if the operation is not supported. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: do not use mtd->sync directlyArtem Bityutskiy9-21/+11
This patch teaches 'mtd_sync()' to do nothing when the MTD driver does not have the '->sync()' method, which allows us to remove all direct 'mtd->sync' accesses. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: harmonize mtd_writev usageArtem Bityutskiy4-23/+27
This patch makes the 'mtd_writev()' function more usable and logical. We first teach it to fall-back to the 'default_mtd_writev()' function if the MTD driver does not define its own '->writev()' method. Then we make block2mtd and JFFS2 just 'mtd_writev()' instead of 'default_mtd_writev()' function. This means we can now stop exporting 'default_mtd_writev()' and instead, export 'mtd_writev()'. This is much cleaner and more logical, as well as allows us to get read of another direct 'mtd->writev' access in JFFS2. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: do not use mtd->lock_user_prot_reg directlyArtem Bityutskiy2-2/+2
Instead, check the -EOPNOTSUPP return code of 'mtd_lock_user_prot_reg()'. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: mtd->write_user_prot_reg directlyArtem Bityutskiy2-4/+2
Instead, just call 'mtd_write_user_prot_reg()' and check the '-EOPNOTSUPP' return code. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: do not use mtd->read_*_prot_reg directlyArtem Bityutskiy2-8/+14
Instead, call 'mtd_read_*_prot_info()' and check for -EOPNOTSUPP. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: do not use mtd->get_*_prot_info directlyArtem Bityutskiy2-5/+7
Instead, call 'mtd_get_*_prot_info()' and check for '-EOPNOTSUPP'. While on it, fix the return code from '-EOPNOTSUPP' to '-EINVAL' for the case when the mode parameter is invalid. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: do not use mtd->read_oob directlyArtem Bityutskiy2-7/+6
Instead of checking whether 'mtd->read_oob' is defined, just call 'mtd_read_oob()' and handle the '-EOPNOTSUPP' error which will be returned if the function is undefined. Additionally, make 'mtd_write_oob()' return '-EOPNOTSUPP' if the function is undefined. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: mtdoops: do not use mtd->panic_write directlyArtem Bityutskiy2-9/+10
Instead of checking if 'mtd->panic_write' is defined, call 'mtd_panic_write()' and check the error code - '-EOPNOTSUPP' will be returned if the function is not defined. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09romfs: do not use mtd->get_unmapped_area directlyArtem Bityutskiy1-15/+13
Remove direct usage of mtd->get_unmapped_area. Instead, just call 'mtd_get_unmapped_area()' which will return -EOPNOTSUPP if the function is not implemented, and then test for this code. We also translate -EOPNOTSUPP to -ENOSYS because this return code is probably part of the kernel ABI which we do not want to break. Cc: linux-fsdevel@vger.kernel.org Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: do not use mtd->get_unmapped_area directlyArtem Bityutskiy3-20/+14
Remove direct usage of mtd->get_unmapped_area. Instead, just call 'mtd_get_unmapped_area()' which will return -EOPNOTSUPP if the function is not implemented and test for this error code. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: do use mtd->point directlyArtem Bityutskiy4-16/+15
Remove direct usage of the "mtd->point" function pointer. Instead, test the mtd_point() return code for '-EOPNOTSUPP'. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: introduce mtd_has_oob helperArtem Bityutskiy3-3/+8
We are working in the direction of making sure that MTD clients to not use 'mtd->func' pointers directly. In some places we want to know if OOB operations are supported by an MTD device. Introduce 'mtd_has_oob()' helper for these purposes. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: mtdcore: export symbols cleanupArtem Bityutskiy1-15/+9
The mtdcore.c file is a bit inconsistent - some EXPORT_SYMBOL_GPL declarations follow the corresponding functions, some are placed at the end. This patch harmonizes the file so that EXPORT_SYMBOL_GPL declarations follow the corresponding function. It also removes few extra newlines and trailing white-spaces. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: clean-up the default_mtd_writev functionArtem Bityutskiy2-19/+24
1. Teach 'mtd_write()' function to return '-EROFS' if the write method is undefined, and remove the corresponding check from 'default_mtd_writev()'. 2. Do not test 'retlen' for NULL - it cannot be NULL. 3. Few minor coding stile clean-ups. 4. Add a kerneldoc comment Additionally, minor fixes to the kerneldoc comments of the neighbor function. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09jffs: remove custom mtd_fake_writev functionArtem Bityutskiy1-26/+1
Instead, use 'default_mtd_writev()' function which MTD provides. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: remove unused default_mtd_readv prototypeArtem Bityutskiy1-3/+0
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: sst25l: kill unused variableArtem Bityutskiy1-1/+1
Fix the following gcc warning: drivers/mtd/devices/sst25l.c: In function ‘sst25l_probe’: drivers/mtd/devices/sst25l.c:381:11: warning: unused variable ‘i’ [-Wunused-variable] Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: onenand: kill unused variableArtem Bityutskiy1-1/+0
Fix this gcc warning: drivers/mtd/onenand/onenand_base.c: In function ‘onenand_block_markbad’: drivers/mtd/onenand/onenand_base.c:2636:23: warning: unused variable ‘this’ [-Wunused-variable] Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: kill dev_to_mtd helperArtem Bityutskiy2-17/+13
... since it is not needed because the generic 'dev_get_drvdata()' can be used instead. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Acked-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: remove extra retlen assignmentArtem Bityutskiy7-33/+22
MTD functions always assign the 'retlen' argument to 0 at the very beginning - the callers do not have to do this. I used the following semantic patch to find these places: @@ identifier retlen; expression a, b, c, d, e; constant C; type T; @@ ( - retlen = C; | T -retlen = C + retlen ; ) ... when != retlen when exists ( mtd_read(a, b, c, &retlen, d) | mtd_write(a, b, c, &retlen, d) | mtd_panic_write(a, b, c, &retlen, d) | mtd_point(a, b, c, &retlen, d, e) | mtd_read_fact_prot_reg(a, b, c, &retlen, d) | mtd_write_user_prot_reg(a, b, c, &retlen, d) | mtd_read_user_prot_reg(a, b, c, &retlen, d) | mtd_writev(a, b, c, d, &retlen) ) I ran it twice, because there were cases of double zero assigments in mtd tests. Then I went through the patch to verify that spatch did not find any false positives. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: always initialize retlen to zeroArtem Bityutskiy1-0/+9
Make sure that the retlen is set to 0 in case of error. This harmonizes drivers - some set it to 0 in some error cases and do not write anything in other error cases. Now we can do this consistently for all drivers. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: doc: do not initialize mtd_info fields to 0 or NULLArtem Bityutskiy4-29/+0
The 'struct mtd_info' object is allocated with 'kzalloc()', so it contains only zeroes - no need to initialize various fields to 0 or NULL. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: docprobe: use kzalloc insteadArtem Bityutskiy1-6/+1
Instead of calling 'kmalloc()' and them 'memeset(0)', use 'kzalloc()'. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: move mtd->{get,put}_device functions upArtem Bityutskiy1-7/+6
Move the 'get_device()' and 'put_device()' functions up within 'struct mtd_info' to make them be close to other functions. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: introduce mtd_block_markbad interfaceArtem Bityutskiy12-14/+17
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: introduce mtd_block_isbad interfaceArtem Bityutskiy21-30/+34
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: introduce mtd_resume interfaceArtem Bityutskiy10-12/+15
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: introduce mtd_suspend interfaceArtem Bityutskiy10-10/+15
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: introduce mtd_is_locked interfaceArtem Bityutskiy3-4/+8
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: introduce mtd_unlock interfaceArtem Bityutskiy5-5/+10
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: introduce mtd_lock interfaceArtem Bityutskiy5-6/+11
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: introduce mtd_sync interfaceArtem Bityutskiy11-14/+17
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: introduce mtd_writev interfaceArtem Bityutskiy4-11/+18
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: introduce mtd_lock_user_prot_reg interfaceArtem Bityutskiy3-4/+10
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: introduce mtd_write_user_prot_reg interfaceArtem Bityutskiy3-4/+12
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: introduce mtd_read_user_prot_reg interfaceArtem Bityutskiy3-4/+12
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: introduce mtd_get_user_prot_info interfaceArtem Bityutskiy3-3/+11
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: introduce mtd_read_fact_prot_reg interfaceArtem Bityutskiy3-4/+12
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: introduce mtd_get_fact_prot_info interfaceArtem Bityutskiy3-8/+15
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: introduce mtd_write_oob interfaceArtem Bityutskiy13-27/+31
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: introduce mtd_read_oob interfaceArtem Bityutskiy14-31/+37
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: introduce mtd_panic_write interfaceArtem Bityutskiy3-14/+19
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: introduce mtd_write interfaceArtem Bityutskiy22-73/+84
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: introduce mtd_read interfaceArtem Bityutskiy35-135/+152
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: introduce mtd_get_unmapped_area interfaceArtem Bityutskiy5-11/+18
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: introduce mtd_unpoint interfaceArtem Bityutskiy5-10/+14
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: introduce mtd_point interfaceArtem Bityutskiy5-12/+18
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: introduce mtd_erase interfaceArtem Bityutskiy22-28/+37
This patch is part of a patch-set which changes the MTD interface from 'mtd->func()' form to 'mtd_func()' form. We need this because we want to add common code to to all drivers in the mtd core level, which is impossible with the current interface when MTD clients call driver functions like 'read()' or 'write()' directly. At this point we just introduce a new inline wrapper function, but later some of them are expected to gain more code. E.g., the input parameters check should be moved to the wrappers rather than be duplicated at many drivers. This particular patch introduced the 'mtd_erase()' interface. The following patches add all the other interfaces one by one. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: mtdchar: rename functionsArtem Bityutskiy1-37/+39
We are going to re-work the MTD interface and change 'mtd->write()' to 'mtd_write()', 'mtd->read()' to 'mtd_read()' and so forth for all functions in the 'struct mtd_info' structure. However, mtdchar.c has its own 'mtd_read()', 'mtd_write()', etc functions which collide with our changes. This patch renames these functions to 'mtdchar_read()', 'mtdchar_write()', etc. Additionally, to make the 'mtdchar.c' file look consistent, rename similarly all the other functions starting with 'mtd_'. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09logfs: rename functions starting with mtd_Artem Bityutskiy1-29/+32
We are going to re-work the MTD interface and change 'mtd->write()' to 'mtd_write()', 'mtd->read()' to 'mtd_read()' and so forth for all functions in the 'struct mtd_info' structure. However, logfs has its own 'mtd_read()', 'mtd_write()', etc functions which collide with our changes. This patch renames these logfs functions to 'logfs_mtd_read()', 'logfs_mtd_write()', etc. Additionally, to make the 'fs/logfs/dev_mtd.c' file look consistent, rename similarly all the other functions starting with 'mtd_'. Cc: Jörn Engel <joern@logfs.org> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: lpddr: drop unnecessary zeroingArtem Bityutskiy1-7/+0
We allocate the "mtd" structure using kzalloc which means we do not have to initialize unused MTD function pointers to NULL, since it is safe to assume in Linux that NULL contains all zeroes. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: map.h: fix arm cross-build failureArtem Bityutskiy1-1/+1
This patch fixes the following build failure: In file included from include/linux/mtd/qinfo.h:4:0, from include/linux/mtd/pfow.h:7, from drivers/mtd/lpddr/lpddr_cmds.c:27: include/linux/mtd/map.h: In function 'inline_map_read': include/linux/mtd/map.h:409:3: error: implicit declaration of function 'BUILD_BUG_ON' [-Werror=implicit-function-declaration] Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: txx9ndfmc: use devm_request_and_ioremapJulia Lawall1-5/+1
Reimplement a call to devm_request_mem_region followed by a call to ioremap or ioremap_nocache by a call to devm_request_and_ioremap. The semantic patch that makes this transformation is as follows: (http://coccinelle.lip6.fr/) // <smpl> @nm@ expression myname; identifier i; @@ struct platform_driver i = { .driver = { .name = myname } }; @@ expression dev,res,size; expression nm.myname; @@ -if (!devm_request_mem_region(dev, res->start, size, - \(res->name\|dev_name(dev)\|myname\))) { - ... - return ...; -} ... when != res->start ( -devm_ioremap(dev,res->start,size) +devm_request_and_ioremap(dev,res) | -devm_ioremap_nocache(dev,res->start,size) +devm_request_and_ioremap(dev,res) ) ... when any when != res->start // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: lantiq-flash: drop iounmap for devm_ allocated dataJulia Lawall1-5/+1
Data allocated with devm_ioremap or devm_ioremap_nocache should not be freed using iounmap, because doing so causes a dangling pointer, and a subsequent double free. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r@ expression x; @@ ( x = devm_ioremap(...) | x = devm_ioremap_nocache(...) ) @@ expression r.x; @@ * iounmap(x) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: gpio-nand: add device tree bindingsJamie Iles2-7/+152
Add device tree bindings so that the gpio-nand driver may be instantiated from the device tree. This also allows the partitions to be specified in the device tree. v7: - restore runtime device tree/non device tree detection v6: - convert to mtd_device_parse_register() v5: - fold dt config helpers into a single gpio_nand_of_get_config() v4: - get io sync address from gpio-control-nand,io-sync-reg property rather than a resource - clarified a few details in the binding v3: - remove redundant cast and a couple of whitespace/naming changes v2: - add CONFIG_OF guards for non-dt platforms - compatible becomes gpio-control-nand - clarify some binding details Signed-off-by: Jamie Iles <jamie@jamieiles.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: bcm63xxpart: check the image tag's crc32Jonas Gorski1-16/+29
Only use the values from the image tag if it is valid. Always create the CFE, NVRAM and linux partitions, to allow flashing a new image even if the old is invalid without overwriting CFE or NVRAM. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09MIPS: BCM63XX: bcm963xx_tag.h: make crc fields integersJonas Gorski1-6/+5
All CRC32 fields are 32 bit integers, so define them as such to prevent unnecessary casts if we want to use them. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: bcm63xxpart: don't assume NVRAM is always the fourth partitionJonas Gorski1-2/+2
Instead of referencing the sizes of fixed partitions, use the precomputed CFE/NVRAM lengths. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: bcm63xxpart: make sure CFE and NVRAM partitions are at least 64KiBJonas Gorski1-7/+15
The CFE boot loader on BCM63XX platforms assumes itself and the NVRAM partition to be 64 KiB (or erase block sized, if larger). Ensure this assumption is also met when creating the partitions to prevent accidential erasure of CFE or NVRAM. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: bcm63xxpart: check version marker string for newer CFEsJonas Gorski1-5/+17
Recent CFEs do not contain the CFE1CFE1 magic anymore, so check for the "cfe-v" version marker string instead. As very old CFEs do not have this string, leave the CFE1CFE1 magic as a fallback for detection. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: sm_ftl: fix module parameterRusty Russell1-1/+1
You didn't mean this to be a bool. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: docg3: remove unused functionRobert Jarzmik1-0/+2
As the MTD api has no use for the number of erase cycles each block has endured, remove the function which calculated that value. If one day MTD api finds it usefull for wear levelling algorithms to have this information, the function should be put back in place. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: nand: Add ONFI support for FSL NAND controllerShengzhou Liu1-8/+10
- fix NAND_CMD_READID command for ONFI detect. - add NAND_CMD_PARAM command to read the ONFI parameter page. Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: nand: fixup for fmr initialization of Freescale NAND controllerShengzhou Liu1-5/+5
There was a bug for fmr initialization, which lead to fmr was always 0x100 in fsl_elbc_chip_init() and caused FCM command timeout before calling fsl_elbc_chip_init_tail(), now we initialize CWTO to maximum timeout value and not relying on the setting of bootloader. Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: document that MEMWRITE ioctl is NAND-specificArtem Bityutskiy1-1/+2
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: fsl_elbc_nand: set Nand flash page address to FBAR and FPAR correctlyLiu Shuo1-3/+10
If we use the Nand flash chip whose number of pages in a block is greater than 64(for large page), we must treat the low bit of FBAR as being the high bit of the page address due to the limitation of FCM, it simply uses the low 6-bits (for large page) of the combined block/page address as the FPAR component, rather than considering the actual block size. Signed-off-by: Liu Shuo <b35362@freescale.com> Signed-off-by: Jerry Huang <Chang-Ming.Huang@freescale.com> Signed-off-by: Tang Yuantian <b29983@freescale.com> Signed-off-by: Li Yang <leoli@freescale.com> Acked-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtdoops: fix the oops_page_used array sizeRoman Tereshonkov1-1/+1
The array of unsigned long pointed by oops_page_used is allocated by vmalloc which requires the size to be in bytes. BITS_PER_LONG is equal to 32. If we want to allocate memory for 32 pages with one bit per page then 32 / BITS_PER_LONG is equal to 1 byte that is 8 bits. To fix it we need to multiply the result by sizeof(unsigned long) equal to 4. Cc: stable@kernel.org Signed-off-by: Roman Tereshonkov <roman.tereshonkov@nokia.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09jffs2: fix up error handling for insert_inode_lockedEric Sandeen1-1/+0
after 250df6ed274d767da844a5d9f05720b804240197 (fs: protect inode->i_state with inode->i_lock), insert_inode_locked() no longer returns the inode with I_NEW set on failure. However, the error handler still calls unlock_new_inode() on failure, which does a WARN_ON if I_NEW is not set, so any failure spews a lot of warnings. We can just drop the unlock_new_inode() if insert_inode_locked() fails here. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: maps: remove the now unused bcm963xx-flashJonas Gorski3-130/+0
bcm963xx-flash does nothing meaningful anymore. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> Acked-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09MIPS: BCM63XX: use the new bcm63xxpart parserJonas Gorski1-0/+3
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> Acked-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: maps: physmap: allow partition parsers for physmap_flash_dataJonas Gorski2-1/+5
Arch setup code might want to use their own partition parsers, but still use the generic physmap flash driver. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> Acked-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: maps: bcm963xx-flash: make CFE partition parsing an mtd parserJonas Gorski5-150/+202
Recent BCM63XX devices support a variety of flash types (parallel, SPI, NAND) and share the partition layout. To prevent code duplication make the CFE partition parsing code a stand alone mtd parser to allow SPI or NAND flash drivers to use it. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> Acked-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: maps: bcm963xx-flash: clean up printk usageJonas Gorski1-10/+10
Replace raw printk's with their pr_XXX equivalent and unify broken up strings so they become grepable. Also replace the PFX definition with a pr_fmt(). Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> Acked-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: maps: bcm963xx-flash: remove superfluous semicolonsJonas Gorski1-5/+5
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> Acked-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: maps: bcm963xx-flash: fix word order for spare partitionJonas Gorski1-1/+1
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> Acked-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: davinci: if no amif timing is passed, don; t setup cscfg registerHeiko Schocher1-1/+3
Signed-off-by: Heiko Schocher <hs@denx.de> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: nand: set correct length to FBCR for a non-full-page writeLiu Shuo1-1/+2
When we do a non-full-page write, the length be set to FBCR should not be 'elbc_fcm_ctrl->index', it should be 'elbc_fcm_ctrl->index - elbc_fcm_ctrl->column'. Signed-off-by: Liu Shuo <b35362@freescale.com> Signed-off-by: Li Yang <leoli@freescale.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: nand: use elbc_fcm_ctrl->oob to set FPAR_MS bit of FPARLiu Shuo1-7/+11
On both of large-page chip and small-page chip, we always should use 'elbc_fcm_ctrl->oob' to set the FPAR_LP_MS/FPAR_SP_MS bit of FPAR, don't use a overflowed 'column' to set it. Signed-off-by: Liu Shuo <b35362@freescale.com> Signed-off-by: Li Yang <leoli@freescale.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: docg3: fixes and cleanupsRobert Jarzmik2-14/+15
This patch takes into account checkpatch, sparse and ECC comments. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: mtdoops: skip reading initially bad blocksRoman Tereshonkov1-0/+3
Use block_isbad to check and skip the bad blocks reading. This will allow to get rid of the read errors if bad blocks are present initially. Cc: stable@kernel.org Signed-off-by: Roman Tereshonkov <roman.tereshonkov@nokia.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: tests: stresstest: bail out if device has not enough eraseblocksWolfram Sang1-0/+7
stresstest needs at least two eraseblocks. Bail out gracefully if that condition is not met. Fixes the following 'division by zero' OOPS: [ 619.100000] mtd_stresstest: MTD device size 131072, eraseblock size 131072, page size 2048, count of eraseblocks 1, pages per eraseblock 64, OOB size 64 [ 619.120000] mtd_stresstest: scanning for bad eraseblocks [ 619.120000] mtd_stresstest: scanned 1 eraseblocks, 0 are bad [ 619.130000] mtd_stresstest: doing operations [ 619.130000] mtd_stresstest: 0 operations done [ 619.140000] Division by zero in kernel. ... caused by /* Read or write up 2 eraseblocks at a time - hence 'ebcnt - 1' */ eb %= (ebcnt - 1); Cc: stable@kernel.org Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: convert drivers/mtd/* to use module_platform_driver()Axel Lin29-345/+30
This patch converts the drivers in drivers/mtd/* to use the module_platform_driver() macro which makes the code smaller and a bit simpler. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked by: Haojian Zhuang <haojian.zhuang@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09Documentation: add sysfs entries for mtd docg3 chipsRobert Jarzmik1-0/+34
Add documentation for MSystems disk-on-chip docg3 chips sysfs entries, which enable and disable protection areas, giving or disabling access to the chip's memory. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: docg3: dereferencing an ERR_PTR() in docg3_probe()Dan Carpenter1-9/+12
If doc_probe_device() returned an ERR_PTR, then we accidentally saved that to docg3_floors[floor] = mtd; which gets derefenced in the error handling when we call doc_release_device(). I've reworked the error handling to take care of that and hopefully make it a little simpler. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: Remove redundant spi driver bus initializationLars-Peter Clausen3-3/+0
In ancient times it was necessary to manually initialize the bus field of an spi_driver to spi_bus_type. These days this is done in spi_driver_register(), so we can drop the manual assignment. The patch was generated using the following coccinelle semantic patch: // <smpl> @@ identifier _driver; @@ struct spi_driver _driver = { .driver = { - .bus = &spi_bus_type, }, }; // </smpl> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: docg3: add protection areas sysfs accessRobert Jarzmik2-0/+134
As each docg3 chip has 2 protection areas (DPS0 and DPS1), and because theses areas can prevent user access to the chip data, add for each floor the sysfs entries which insert the protection key into the right DPS. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Reviewed-by: Ivan Djelic <ivan.djelic@parrot.com> Reviewed-by: Mike Dunn <mikedunn@newsguy.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: docg3: add fast modeRobert Jarzmik2-20/+75
Docg3 chips can work in 3 modes : normal MLC mode, fast mode and reliable mode. Normally, as docg3 is a MLC chip, it should be configured to work in normal mode. In both normal mode, each page is distinct. This means that writing to page 12 of blocks 14,15 writes only to that page, and reading from page 12 of blocks 14,15 reads only from that page. In reliable and fast modes, pages are coupled by pairs, and are clones one of each other. This means that the available capacity of the chip is halved. Pages are coupled in each block, and page of index 2*n contains the same data as page 2*n+1 of the same block. In fast mode, the reads occur a bit faster, but are a bit less reliable that in normal mode. When reading from page 2*n, the chip reads bytes from both page 2*n and page 2*n+1, makes a logical and for each byte, and returns the result. As programming a page means "clearing bits", even if a bit was not cleared on one page because the flash is worn out, the other page has the bit cleared, and the result of the "AND" gives a correct result. When writing to page 2*n, the chip writes data to both page 2*n and page 2*n+1. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Reviewed-by: Ivan Djelic <ivan.djelic@parrot.com> Reviewed-by: Mike Dunn <mikedunn@newsguy.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: docg3: add suspend and resumeRobert Jarzmik2-1/+80
Add functions to powerdown and powerup from suspend, in order to save power. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Reviewed-by: Ivan Djelic <ivan.djelic@parrot.com> Reviewed-by: Mike Dunn <mikedunn@newsguy.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: docg3: add ECC correction codeRobert Jarzmik3-23/+113
Credit for discovering the BCH algorith parameters, and bit reversing algorithm is to be give to Mike Dunn and Ivan Djelic. The BCH correction code relied upon the BCH library, where all data and ECC is bit-reversed. The BCH library works correctly when each input byte is bit-reversed, and accordingly ECC output is also bit-reversed. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Reviewed-by: Ivan Djelic <ivan.djelic@parrot.com> Reviewed-by: Mike Dunn <mikedunn@newsguy.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: docg3: map erase and write functionsRobert Jarzmik1-10/+4
Map the developped write and erase functions into the mtd structure. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Reviewed-by: Ivan Djelic <ivan.djelic@parrot.com> Reviewed-by: Mike Dunn <mikedunn@newsguy.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: docg3: add erase functionsRobert Jarzmik1-0/+90
Add erase capability to the docg3 driver. The erase block is made of 2 physical blocks, as both share all 64 pages. That makes an erase block of at least 64 kBytes. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Reviewed-by: Ivan Djelic <ivan.djelic@parrot.com> Reviewed-by: Mike Dunn <mikedunn@newsguy.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: docg3: add write functionsRobert Jarzmik1-12/+541
Add write capability to the docg3 driver. The writes are possible on a single page (512 bytes + 16 bytes), even if that page is split on 2 physical pages on 2 blocks (each on one plane). Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Reviewed-by: Ivan Djelic <ivan.djelic@parrot.com> Reviewed-by: Mike Dunn <mikedunn@newsguy.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: docg3: add OOB buffer to device structureRobert Jarzmik1-0/+8
Add OOB buffer area to store the OOB data until the actual page is written, so that it can be completed by hardware ECC generator. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Reviewed-by: Ivan Djelic <ivan.djelic@parrot.com> Reviewed-by: Mike Dunn <mikedunn@newsguy.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: docg3: add registers for erasing and writingRobert Jarzmik1-1/+13
Add the required registers and commands to erase and write flash pages / blocks. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Reviewed-by: Ivan Djelic <ivan.djelic@parrot.com> Reviewed-by: Mike Dunn <mikedunn@newsguy.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: docg3: add OOB layout to mtdinfoRobert Jarzmik1-0/+15
Add OOB layout description for docg3, so that userspace can use this information to setup the data for write_oob(). Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Reviewed-by: Ivan Djelic <ivan.djelic@parrot.com> Reviewed-by: Mike Dunn <mikedunn@newsguy.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: docg3: add multiple floor supportRobert Jarzmik2-56/+126
Add support for multiple floors, ie. cascaded docg3 chips. There might be 4 docg3 chips cascaded, sharing the same address space, and providing up to 4 times the storage capacity of a unique chip. Each floor will be seen as an independant mtd device. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Reviewed-by: Ivan Djelic <ivan.djelic@parrot.com> Reviewed-by: Mike Dunn <mikedunn@newsguy.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: docg3: fix reading oob+data without correctionRobert Jarzmik1-99/+95
Fix the docg3 reads to be able to cope with all possible data buffer / oob buffer / file mode combinations from docg3_read_oob(). This especially ensures that raw reads do not use ECC corrections, and AUTOOOB and PLACEOOB do use ECC correction. The approach is to empty docg3_read() and make it a wrapper to docg3_read_oob(). As docg3_read_oob() handles all the funny cases (no data buffer but oob buffer, data buffer but no oob buffer, ...), docg3_read() is just a special use of docg3_read_oob(). Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Reviewed-by: Ivan Djelic <ivan.djelic@parrot.com> Reviewed-by: Mike Dunn <mikedunn@newsguy.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: docg3: fix BCH registersRobert Jarzmik1-1/+1
BCH registers are contiguous, not on every byte. Fix the register definitions. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Reviewed-by: Ivan Djelic <ivan.djelic@parrot.com> Reviewed-by: Mike Dunn <mikedunn@newsguy.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: docg3: fix protection areas readingRobert Jarzmik1-7/+9
The protection areas boundaries were on 16bit registers, not 8bit. This is consistent with block numbers, which can extend up to 4096 on bigger chips (and is 2048 on the docg3). Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Reviewed-by: Ivan Djelic <ivan.djelic@parrot.com> Reviewed-by: Mike Dunn <mikedunn@newsguy.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: docg3: fix tracing of IO in writebRobert Jarzmik1-1/+1
Writeb was incorrectly traced as a 16 bits write, instead of a 8 bits write. Fix it by tracing the correct width. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Reviewed-by: Ivan Djelic <ivan.djelic@parrot.com> Reviewed-by: Mike Dunn <mikedunn@newsguy.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: docg3: fix debug log verbosityRobert Jarzmik1-1/+1
Change the NOP debug log verbosity to very verbose to unburden log analysis. Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr> Reviewed-by: Ivan Djelic <ivan.djelic@parrot.com> Reviewed-by: Mike Dunn <mikedunn@newsguy.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: nand: Making MTD_NAND_OMAP2 depend on ARCH_OMAP2PLUSShubhrajyoti D1-1/+1
Making MTD_NAND_OMAP2 depend on ARCH_OMAP2PLUS instead of oring with ARCH2/3/4. Reported-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: cfi: Allow per-mapping CFI device endiannessAaron Sierra4-57/+41
This patch allows each CFI device map to use its own endianness. The globally defined CFI endianness (CONFIG_MTD_CFI_NOSWAP, CONFIG_MTD_CFI_BE_BYTE_SWAP or CONFIG_MTD_CFI_LE_BYTE_SWAP) becomes the default value which can be overridden by a driver for a particular device. Signed-off-by: Aaron Sierra <asierra@xes-inc.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: mtd_blkdevs: don't increase 'open' count on error pathBrian Norris1-1/+2
Some error paths in mtd_blkdevs were fixed in the following commit: commit 94735ec4044a6d318b83ad3c5794e931ed168d10 mtd: mtd_blkdevs: fix error path in blktrans_open But on these error paths, the block device's `dev->open' count is already incremented before we check for errors. This meant that, while the error path was handled correctly on the first time through blktrans_open(), the device is erroneously considered already open on the second time through. This problem can be seen, for instance, when a UBI volume is simultaneously mounted as a UBIFS partition and read through its corresponding gluebi mtdblockX device. This results in blktrans_open() passing its error checks (with `dev->open > 0') without actually having a handle on the device. Here's a summarized log of the actions and results with nandsim: # modprobe nandsim # modprobe mtdblock # modprobe gluebi # modprobe ubifs # ubiattach /dev/ubi_ctrl -m 0 ... # ubimkvol /dev/ubi0 -N test -s 16MiB ... # mount -t ubifs ubi0:test /mnt # ls /dev/mtdblock* /dev/mtdblock0 /dev/mtdblock1 # cat /dev/mtdblock1 > /dev/null cat: can't open '/dev/mtdblock4': Device or resource busy # cat /dev/mtdblock1 > /dev/null CPU 0 Unable to handle kernel paging request at virtual address fffffff0, epc == 8031536c, ra == 8031f280 Oops[#1]: ... Call Trace: [<8031536c>] ubi_leb_read+0x14/0x164 [<8031f280>] gluebi_read+0xf0/0x148 [<802edba8>] mtdblock_readsect+0x64/0x198 [<802ecfe4>] mtd_blktrans_thread+0x330/0x3f4 [<8005be98>] kthread+0x88/0x90 [<8000bc04>] kernel_thread_helper+0x10/0x18 Cc: stable@kernel.org [3.0+] Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: nand: scan 1st and 2nd page for Macronix SLCBrian Norris1-3/+4
Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: nand: add 512 Mbit device code (Macronix)Brian Norris1-1/+2
Macronix MX30LF1208AA is a 512 Mbit NAND with device code 0xF0. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09mtd: nand: add Macronix manufacturerBrian Norris2-0/+2
Macronix is produing SLC NAND MX30LF1208AA, so add their manufacturer code to the manufacturer lists. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09Merge branch 'samsung/cleanup' into next/boardsArnd Bergmann1104-12914/+12816
Conflicts: arch/arm/mach-imx/mach-imx6q.c arch/arm/mach-omap2/board-ti8168evm.c arch/arm/mach-s3c64xx/Kconfig arch/arm/mach-tegra/Makefile arch/arm/mach-tegra/board-dt-tegra20.c arch/arm/mach-tegra/common.c Lots of relatively simple conflicts between the board changes and stuff from the arm tree. This pulls in the resolution from the samsung/cleanup tree, so we don't get conflicting merges. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2012-01-09xen/mmu: Fix compile errors introduced by x86/memblock mismerge.Konrad Rzeszutek Wilk1-1/+1
The git commit d4bbf7e7759afc172e2bfbc5c416324590049cdd "Merge branch 'master' into x86/memblock" mismerged the 32-bit section causing: arch/x86/xen/mmu.c: In function ‘xen_setup_kernel_pagetable’: arch/x86/xen/mmu.c:1855: error: expected ‘;’ before ‘)’ token arch/x86/xen/mmu.c:1855: error: expected statement before ‘)’ token Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2012-01-09Merge branch 'for-linus' of ↵Linus Torvalds6-40/+27
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: ext[34]: avoid i_nlink warnings triggered by drop_nlink/inc_nlink kludge in symlink() exofs: oops after late failure in mount devpts: fix double-free on mount failure ... and the same for gadgetfs functionfs: unfuck failure exits on mount
2012-01-09Merge branch 'samsung/driver' into next/driversArnd Bergmann1271-12763/+12353
Conflicts: arch/arm/mach-mxs/include/mach/common.h Pull in previous samsung conflict merges and do a trivial merge of an mxs double-add conflict. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2012-01-09Merge branch 'samsung/cleanup' into samsung/driverArnd Bergmann1283-12937/+12509
Conflicts: arch/arm/mach-s5p64x0/cpu.c -> common.c More changes to a file that got moved into common.c, see previous conflict resolutions. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2012-01-09Merge branch 'for-linus' of ↵Linus Torvalds49-2019/+1986
git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: (31 commits) [S390] disassembler: mark exception causing instructions [S390] Enable exception traces by default [S390] return address of compat signals [S390] sysctl: get rid of dead declaration [S390] dasd: fix fixpoint divide exception in define_extent [S390] dasd: add sanity check to detect path connection error [S390] qdio: fix kernel panic for zfcp 31-bit [S390] Add s390x description to Documentation/kdump/kdump.txt [S390] Add VMCOREINFO_SYMBOL(high_memory) to vmcoreinfo [S390] dasd: fix expiration handling for recovery requests [S390] outstanding interrupts vs. smp_send_stop [S390] ipc: call generic sys_ipc demultiplexer [S390] zcrypt: Fix error return codes. [S390] zcrypt: Rework length parameter checking. [S390] cleanup trap handling [S390] Remove Kerntypes leftovers [S390] topology: increase poll frequency if change is anticipated [S390] entry[64].S improvements [S390] make arch/s390 subdirectories depend on config option [S390] kvm: move cmf host id constant out of lowcore ... Fix up conflicts in arch/s390/kernel/{smp.c,topology.c} due to the sysdev removal clashing with "topology: get rid of ifdefs" which moved some of that code around.
2012-01-09Merge branch 'samsung/cleanup' into next/cleanup2Arnd Bergmann1281-12874/+12485
2012-01-09Merge branch 'samsung/dt' into samsung/cleanupArnd Bergmann1281-12874/+12485
Conflicts: arch/arm/mach-s3c64xx/Makefile arch/arm/mach-s5pc100/Makefile arch/arm/mach-s5pv210/Makefile Pull in previously resolved conflicts: The Makefiles were reorganized in the "rmk/restart" series and modified in the "samsung/cleanup series". This also pulls in the other conflict resolutions from the restart series against the samsung/dt series. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2012-01-09isofs: inode leak on mount failureAl Viro1-2/+5
d_alloc_root() failure leaves root inode leaked... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-01-09xen/pciback: Expand the warning message to include domain id.Konrad Rzeszutek Wilk1-2/+2
When a PCI device is transferred to another domain and it is still in usage (from the internal perspective), mention which other domain is using it to aid in debugging. [v2: Truncate the verbose message per Jan Beulich suggestion] [v3: Suggestions from Ian Campbell on the wording] Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Acked-by: Jan Beulich <jbeulich@suse.com>
2012-01-09ext2/3/4: delete unneeded includes of module.hPaul Gortmaker19-22/+3
Delete any instances of include module.h that were not strictly required. In the case of ext2, the declaration of MODULE_LICENSE etc. were in inode.c but the module_init/exit were in super.c, so relocate the MODULE_LICENCE/AUTHOR block to super.c which makes it consistent with ext3 and ext4 at the same time. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Jan Kara <jack@suse.cz>
2012-01-09ext{3,4}: Fix potential race when setversion ioctl updates inodeDjalal Harouni2-2/+10
The EXT{3,4}_IOC_SETVERSION ioctl() updates i_ctime and i_generation without i_mutex. This can lead to a race with the other operations that update i_ctime. This is not a big issue but let's make the ioctl consistent with how we handle e.g. other timestamp updates and use i_mutex to protect inode changes. Signed-off-by: Djalal Harouni <tixxdz@opendz.org> Signed-off-by: Jan Kara <jack@suse.cz>
2012-01-09udf: Mark LVID buffer as uptodate before marking it dirtyJan Kara1-0/+6
When we hit EIO while writing LVID, the buffer uptodate bit is cleared. This then results in an anoying warning from mark_buffer_dirty() when we write the buffer again. So just set uptodate flag unconditionally. Reviewed-by: Namjae Jeon <linkinjeon@gmail.com> Signed-off-by: Jan Kara <jack@suse.cz>
2012-01-09ext3: Don't warn from writepage when readonly inode is spotted after errorJan Kara1-3/+21
WARN_ON_ONCE(IS_RDONLY(inode)) tends to trip when filesystem hits error and is remounted read-only. This unnecessarily scares users (well, they should be scared because of filesystem error, but the stack trace distracts them from the right source of their fear ;-). We could as well just remove the WARN_ON but it's not hard to fix it to not trip on filesystem with errors and not use more cycles in the common case so that's what we do. CC: stable@kernel.org Signed-off-by: Jan Kara <jack@suse.cz>
2012-01-09jbd: Remove j_barrier mutexJan Kara3-21/+22
j_barrier mutex is used for serializing different journal lock operations. The problem with it is that e.g. FIFREEZE ioctl results in process leaving kernel with j_barrier mutex held which makes lockdep freak out. Also hibernation code wants to freeze filesystem but it cannot do so because it then cannot hibernate the system because of mutex being locked. So we remove j_barrier mutex and use direct wait on j_barrier_count instead. Since locking journal is a rare operation we don't have to care about fairness or such things. CC: Andrew Morton <akpm@linux-foundation.org> Acked-by: Joel Becker <jlbec@evilplan.org> Signed-off-by: Jan Kara <jack@suse.cz>
2012-01-09reiserfs: Force inode evictions before umount to avoid crashJeff Mahoney1-10/+14
This patch fixes a crash in reiserfs_delete_xattrs during umount. When shrink_dcache_for_umount clears the dcache from generic_shutdown_super, delayed evictions are forced to disk. If an evicted inode has extended attributes associated with it, it will need to walk the xattr tree to locate and remove them. But since shrink_dcache_for_umount will BUG if it encounters active dentries, the xattr tree must be released before it's called or it will crash during every umount. This patch forces the evictions to occur before generic_shutdown_super by calling shrink_dcache_sb first. The additional evictions caused by the removal of each associated xattr file and dir will be automatically handled as they're added to the LRU list. CC: reiserfs-devel@vger.kernel.org CC: stable@kernel.org Signed-off-by: Jeff Mahoney <jeffm@suse.com> Signed-off-by: Jan Kara <jack@suse.cz>
2012-01-09reiserfs: Fix quota mount option parsingJan Kara1-1/+2
When jqfmt mount option is not specified on remount, we mistakenly clear s_jquota_fmt value stored in superblock. Fix the problem. CC: stable@kernel.org CC: reiserfs-devel@vger.kernel.org Signed-off-by: Jan Kara <jack@suse.cz>
2012-01-09udf: Treat symlink component of type 2 as /Jan Kara1-4/+10
Currently, we ignore symlink component of type 2. But mkisofs and other OS' seem to treat it as / so do the same for compatibility. Reported-by: "Gábor S." <otnaccess@hotmail.com> Signed-off-by: Jan Kara <jack@suse.cz>
2012-01-09udf: Fix deadlock when converting file from in-ICB one to normal oneJan Kara2-6/+21
During BKL removal in 2.6.38, conversion of files from in-ICB format to normal format got broken. We call ->writepage with i_data_sem held but udf_get_block() also acquires i_data_sem thus creating A-A deadlock. We fix the problem by dropping i_data_sem before calling ->writepage() which is safe since i_mutex still protects us against any changes in the file. Also fix pagelock - i_data_sem lock inversion in udf_expand_file_adinicb() by dropping i_data_sem before calling find_or_create_page(). CC: stable@kernel.org Reported-by: Matthias Matiak <netzpython@mail-on.us> Tested-by: Matthias Matiak <netzpython@mail-on.us> Reviewed-by: Namjae Jeon <linkinjeon@gmail.com> Signed-off-by: Jan Kara <jack@suse.cz>
2012-01-09udf: Cleanup calling convention of inode_getblk()Jan Kara1-21/+15
inode_getblk() always returned NULL and passed results in its parameters. Make the function return something useful - found block number. Signed-off-by: Jan Kara <jack@suse.cz>
2012-01-09ext2: Fix error handling on inode bitmap corruptionJan Kara1-2/+5
When insert_inode_locked() fails in ext2_new_inode() it most likely means inode bitmap got corrupted and we allocated again inode which is already in use. Also doing unlock_new_inode() during error recovery is wrong since the inode does not have I_NEW set. Fix the problem by informing about filesystem error and jumping to fail: (instead of fail_drop:) which doesn't call unlock_new_inode(). Reviewed-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Jan Kara <jack@suse.cz>
2012-01-09ext3: Fix error handling on inode bitmap corruptionJan Kara1-2/+6
When insert_inode_locked() fails in ext3_new_inode() it most likely means inode bitmap got corrupted and we allocated again inode which is already in use. Also doing unlock_new_inode() during error recovery is wrong since inode does not have I_NEW set. Fix the problem by jumping to fail: (instead of fail_drop:) which declares filesystem error and does not call unlock_new_inode(). Reviewed-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Jan Kara <jack@suse.cz>
2012-01-09ext3: replace ll_rw_block with other functionsZheng Liu3-15/+18
ll_rw_block() is deprecated. Thus we replace it with other functions. CC: Jan Kara <jack@suse.cz> Signed-off-by: Zheng Liu <wenqing.lz@taobao.com> Signed-off-by: Jan Kara <jack@suse.cz>
2012-01-09drm/radeon: double lock typo in radeon_vm_bo_rmv()Dan Carpenter1-1/+1
The second lock should be an unlock or it causes a deadlock. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-09drm/radeon: use after free in radeon_vm_bo_add()Dan Carpenter1-1/+1
"bo_va" is dereferenced in the error message. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-09drm/sis|via: don't return stack garbage from free_mem ioctlDaniel Vetter2-4/+2
Fallout from my "kill drm_sman" refactor. Unfortunately gcc seems to have failed me and not warned about this. Tested-by: Jakob Bornecrantz <wallbraker@gmail.com> (on via) Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-01-09drm/radeon/kms: remove pointless CS flags priority structAlex Deucher1-3/+0
Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: Christian König <deathsimple@vodafone.de> Signed-off-by: Dave Airlie <airlied@redhat.com>