aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd (follow)
AgeCommit message (Collapse)AuthorFilesLines
2010-12-03mtd: fix nand kernel-doc warningsRandy Dunlap1-1/+2
Warning(include/linux/mtd/nand.h:543): No description found for parameter 'badblockbits' Warning(drivers/mtd/nand/nand_bbt.c:1101): No description found for parameter 'mtd' Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Cc: David Woodhouse <dwmw2@infradead.org> Cc: linux-mtd@lists.infradead.org Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-12-03mtd: cfi_fixup: remove unused 'param' parameterGuillaume LECERF4-76/+76
The 'param' parameter has never been used since its introduction, so simply remove it. Signed-off-by: Guillaume LECERF <glecerf@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-12-03mtd: nand: Use printf extension %pR for struct resourceJoe Perches1-1/+1
Using %pR standardizes the struct resource output. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-12-03mtd: maps: Use printf extension %pR for struct resourceJoe Perches6-28/+13
Using %pR standardizes the struct resource output. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-12-03mtd: NAND: jz4740: Remove custom {read,write}_page handlersLars-Peter Clausen1-55/+0
Now that the mtd core supports more then 64 ecc bytes we can use it instead of some a custom hack in the jz4740 nand driver. This patch removes the custom {read,write}_page handlers from the jz4740 nand driver. Thus the driver will now fallback to the default handlers from the nand core. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-12-03mtd: NAND: jz4740: Make 'struct platform_driver jz_nand_driver' staticLars-Peter Clausen1-1/+1
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-12-03mtd: remove unnecessary casts of void ptr returning alloc function return valuesJesper Juhl1-1/+1
The [vk][cmz]alloc(_node) family of functions return void pointers which it's completely unnecessary/pointless to cast to other pointer types since that happens implicitly. This patch removes such casts from drivers/mtd/ Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-12-03mtd: mtdchar: fix information leak to userlandVasiliy Kulikov1-1/+1
Structure mtd_info_user is copied to userland with padding byted between "type" and "flags" fields uninitialized. It leads to leaking of contents of kernel stack memory. Signed-off-by: Vasiliy Kulikov <segooon@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-12-03mtd: onenand: implement cache program feature for 4KiB page onenandRoman Tereshonkov1-3/+19
Implement cache program feature for 4KiB page onenand. This feature improves the write data performance. The observed 128KiB data program speed change is from 8827KiB/s to 14156 KiB/s when the feature is enabled. Signed-off-by: Roman Tereshonkov <roman.tereshonkov@nokia.com> Acked-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-12-03mtd: onenand: fix omap2 code to handle cache program featureRoman Tereshonkov1-3/+9
Some fixes are introduced into omap2 code to handle errors when cache program feature is used. Signed-off-by: Roman Tereshonkov <roman.tereshonkov@nokia.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-12-03mtd: use vzallocJoe Perches2-6/+3
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-12-03mtd: OneNAND: Fix page offset handling at 2KiB pagesizeKyungmin Park1-2/+5
When use the 2KiB pagesize, it should be set the correct page offset. Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-12-03mtd: nandsim: spell fixes in commentssrimugunthan1-18/+18
Signed-off-by: srimugunthan <srimugunthan.dhandapani@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-12-03mtd: m25p80: Add support for Macronix MX25L25655EKevin Cernekee1-0/+1
Untested, but expected to be compatible with MX25L25635E which I did test. Signed-off-by: Kevin Cernekee <cernekee@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-12-03mtd: m25p80: Add support for Macronix MX25L25635EKevin Cernekee1-3/+28
This is a 256Mbit (32MiB) part so minor changes were made to support 4-byte addressing. Signed-off-by: Kevin Cernekee <cernekee@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-12-03mtd: m25p80: Reinstate error print on unrecognized flashKevin Cernekee1-0/+1
Commit b34bc037b26e621e5fc13466767e4da110a7b3d3 removed the "unrecognized JEDEC id" error message, causing the probe function to silently abort if the flash ID is unrecognized. It is desirable to produce diagnostic output in this situation so that the user has some idea what went wrong. Signed-off-by: Kevin Cernekee <cernekee@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-12-03mtd: Fix MTD_OF_PARTS for all arch and minor tidy of MTD_PARTITIONSGrant Likely2-9/+12
MTD_OF_PARTS should be possible on all architectures, not just powerpc and microblaze, and it probably should not be a user selectable option. Neither does it need to be in a separate module. Also, rework MTD Kconfig to group options dependant on MTD_PARTITIONS into a if/endif block. Do the same for MTD_REDBOOT_PARTS. Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-12-03mtd: bcm963xx-flash: try JEDEC probe if CFI failsGuillaume LECERF1-0/+5
Signed-off-by: Guillaume LECERF <glecerf@gmail.com> Acked-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-12-03UBI: fix corrupted PEB detection for NOR flashArtem Bityutskiy2-12/+29
My new shiny code for corrupted PEB detection has NOR specific bug. We tread PEB as corrupted and preserve it, if 1. EC header is OK. 2. VID header is corrupted. 3. data area is not "all 0xFFs" In case of NOR we have 'nor_erase_prepare()' quirk, which invalidates the headers before erasing the PEB. And we invalidate first the VID header, and then the EC header. So if a power cut happens after we have invalidated the VID header, but before we have invalidated the EC header, we end up with a PEB which satisfies the above 3 conditions, and the scanning code will treat it as corrupted, and will print scary warnings, wrongly. This patch fixes the issue by firt invalidating the EC header, then invalidating the VID header. In case of power cut inbetween, we still just lose the EC header, and UBI can deal with this situation gracefully. Thanks to Anatolij Gustschin <agust@denx.de> for tracking this down. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Reported-by: Anatolij Gustschin <agust@denx.de> Tested-by: Anatolij Gustschin <agust@denx.de>
2010-11-30ARM: pxa: fix pxa2xx-flash section mismatchMarek Vasut1-1/+1
Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com> Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
2010-11-19UBI: release locks in check_corruptionDan Carpenter1-7/+9
Commit 45aafd32996e27 "UBI: tighten the corrupted PEB criteria" introduced some return paths that didn't release the ubi->buf_mutex Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-11-13block: clean up blkdev_get() wrappers and their usersTejun Heo1-2/+2
After recent blkdev_get() modifications, open_by_devnum() and open_bdev_exclusive() are simple wrappers around blkdev_get(). Replace them with blkdev_get_by_dev() and blkdev_get_by_path(). blkdev_get_by_dev() is identical to open_by_devnum(). blkdev_get_by_path() is slightly different in that it doesn't automatically add %FMODE_EXCL to @mode. All users are converted. Most conversions are mechanical and don't introduce any behavior difference. There are several exceptions. * btrfs now sets FMODE_EXCL in btrfs_device->mode, so there's no reason to OR it explicitly on blkdev_put(). * gfs2, nilfs2 and the generic mount_bdev() now set FMODE_EXCL in sb->s_mode. * With the above changes, sb->s_mode now always should contain FMODE_EXCL. WARN_ON_ONCE() added to kill_block_super() to detect errors. The new blkdev_get_*() functions are with proper docbook comments. While at it, add function description to blkdev_get() too. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Philipp Reisner <philipp.reisner@linbit.com> Cc: Neil Brown <neilb@suse.de> Cc: Mike Snitzer <snitzer@redhat.com> Cc: Joern Engel <joern@lazybastard.org> Cc: Chris Mason <chris.mason@oracle.com> Cc: Jan Kara <jack@suse.cz> Cc: "Theodore Ts'o" <tytso@mit.edu> Cc: KONISHI Ryusuke <konishi.ryusuke@lab.ntt.co.jp> Cc: reiserfs-devel@vger.kernel.org Cc: xfs-masters@oss.sgi.com Cc: Alexander Viro <viro@zeniv.linux.org.uk>
2010-11-13block: make blkdev_get/put() handle exclusive accessTejun Heo1-13/+4
Over time, block layer has accumulated a set of APIs dealing with bdev open, close, claim and release. * blkdev_get/put() are the primary open and close functions. * bd_claim/release() deal with exclusive open. * open/close_bdev_exclusive() are combination of open and claim and the other way around, respectively. * bd_link/unlink_disk_holder() to create and remove holder/slave symlinks. * open_by_devnum() wraps bdget() + blkdev_get(). The interface is a bit confusing and the decoupling of open and claim makes it impossible to properly guarantee exclusive access as in-kernel open + claim sequence can disturb the existing exclusive open even before the block layer knows the current open if for another exclusive access. Reorganize the interface such that, * blkdev_get() is extended to include exclusive access management. @holder argument is added and, if is @FMODE_EXCL specified, it will gain exclusive access atomically w.r.t. other exclusive accesses. * blkdev_put() is similarly extended. It now takes @mode argument and if @FMODE_EXCL is set, it releases an exclusive access. Also, when the last exclusive claim is released, the holder/slave symlinks are removed automatically. * bd_claim/release() and close_bdev_exclusive() are no longer necessary and either made static or removed. * bd_link_disk_holder() remains the same but bd_unlink_disk_holder() is no longer necessary and removed. * open_bdev_exclusive() becomes a simple wrapper around lookup_bdev() and blkdev_get(). It also has an unexpected extra bdev_read_only() test which probably should be moved into blkdev_get(). * open_by_devnum() is modified to take @holder argument and pass it to blkdev_get(). Most of bdev open/close operations are unified into blkdev_get/put() and most exclusive accesses are tested atomically at the open time (as it should). This cleans up code and removes some, both valid and invalid, but unnecessary all the same, corner cases. open_bdev_exclusive() and open_by_devnum() can use further cleanup - rename to blkdev_get_by_path() and blkdev_get_by_devt() and drop special features. Well, let's leave them for another day. Most conversions are straight-forward. drbd conversion is a bit more involved as there was some reordering, but the logic should stay the same. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Neil Brown <neilb@suse.de> Acked-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> Acked-by: Mike Snitzer <snitzer@redhat.com> Acked-by: Philipp Reisner <philipp.reisner@linbit.com> Cc: Peter Osterlund <petero2@telia.com> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: Jan Kara <jack@suse.cz> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Andreas Dilger <adilger.kernel@dilger.ca> Cc: "Theodore Ts'o" <tytso@mit.edu> Cc: Mark Fasheh <mfasheh@suse.com> Cc: Joel Becker <joel.becker@oracle.com> Cc: Alex Elder <aelder@sgi.com> Cc: Christoph Hellwig <hch@infradead.org> Cc: dm-devel@redhat.com Cc: drbd-dev@lists.linbit.com Cc: Leo Chen <leochen@broadcom.com> Cc: Scott Branden <sbranden@broadcom.com> Cc: Chris Mason <chris.mason@oracle.com> Cc: Steven Whitehouse <swhiteho@redhat.com> Cc: Dave Kleikamp <shaggy@linux.vnet.ibm.com> Cc: Joern Engel <joern@logfs.org> Cc: reiserfs-devel@vger.kernel.org Cc: Alexander Viro <viro@zeniv.linux.org.uk>
2010-11-13mtd: fix bdev exclusive open bugs in block2mtd::add_device()Tejun Heo1-2/+11
There are two bdev exclusive open bugs. * open_bdev_exclusive() must not be called with NULL holder. Use dev as the holder. * open_by_devnum() doesn't open the bdev exclusively but block2mtd_free_device() always assumes it. Explicitly claim the bdev. The latter is rather clumsy but will be simplified with future blkdev_get/put() cleanups. - Updated to use local variable @mode to cache FMODE_* masks as suggested by Artem Bityutskiy. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: linux-mtd@lists.infradead.org Cc: Artem Bityutskiy <dedekind1@gmail.com>
2010-11-01tree-wide: fix comment/printk typosUwe Kleine-König1-1/+1
"gadget", "through", "command", "maintain", "maintain", "controller", "address", "between", "initiali[zs]e", "instead", "function", "select", "already", "equal", "access", "management", "hierarchy", "registration", "interest", "relative", "memory", "offset", "already", Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-10-30Merge git://git.infradead.org/mtd-2.6Linus Torvalds39-885/+2468
* git://git.infradead.org/mtd-2.6: (82 commits) mtd: fix build error in m25p80.c mtd: Remove redundant mutex from mtd_blkdevs.c MTD: Fix wrong check register_blkdev return value Revert "mtd: cleanup Kconfig dependencies" mtd: cfi_cmdset_0002: make sector erase command variable mtd: cfi_cmdset_0002: add CFI detection for SST 38VF640x chips mtd: cfi_util: add support for switching SST 39VF640xB chips into QRY mode mtd: cfi_cmdset_0001: use defined value of P_ID_INTEL_PERFORMANCE instead of hardcoded one block2mtd: dubious assignment P4080/mtd: Fix the freescale lbc issue with 36bit mode P4080/eLBC: Make Freescale elbc interrupt common to elbc devices mtd: phram: use KBUILD_MODNAME mtd: OneNAND: S5PC110: Fix double call suspend & resume function mtd: nand: fix MTD_MODE_RAW writes jffs2: use kmemdup mtd: sm_ftl: cosmetic, use bool when possible mtd: r852: remove useless pci powerup/down from suspend/resume routines mtd: blktrans: fix a race vs kthread_stop mtd: blktrans: kill BKL mtd: allow to unload the mtdtrans module if its block devices aren't open ... Fix up trivial whitespace-introduced conflict in drivers/mtd/mtdchar.c
2010-10-30mtd: fix build error in m25p80.cAndres Salomon1-1/+1
While building an x86 distro kernel, I hit the following: Kernel: arch/x86/boot/bzImage is ready (#7) ERROR: "of_mtd_parse_partitions" [drivers/mtd/devices/m25p80.ko] undefined! of_mtd_parse_partitions is defined with MTD_OF_PARTS, and that's only built on PPC and microblaze. The code in question should be wrapped w/ a stricter #ifdef. Signed-off-by: Andres Salomon <dilinger@queued.net> Acked-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-30mtd: Remove redundant mutex from mtd_blkdevs.cDavid Woodhouse1-7/+0
In commit 2a48fc0ab24241755dc93bfd4f01d68efab47f5a ('block: autoconvert trivial BKL users to private mutex'), Arnd replaced the BKL usage with a mutex. However, Maxim has already provided a better fix in commit 480792b7bf188c29b8d4b10fee65c3a06ec5dbf7 ('mtd: blktrans: kill BKL'), which was simply to remove the BKL without replacing it — since he'd already made it do all necessary locking for itself. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-30Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.gitDavid Woodhouse25-378/+568
Conflicts: drivers/mtd/mtd_blkdevs.c Merge Grant's device-tree bits so that we can apply the subsequent fixes. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-30MTD: Fix wrong check register_blkdev return valueFrank Li1-1/+4
register_blkdev return 1..255 when major = 0. if (ret ) { printk(KERN_WARNING "Unable to register %s block device on major %d: %d\n", tr->name, tr->major, ret); mutex_unlock(&mtd_table_mutex); return ret; } Above code will return fail when register_blkdev return allocated major number. Signed-off-by: Frank Li <Frank.Li@freescale.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-29convert get_sb_pseudo() usersAl Viro1-6/+4
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-10-29convert get_sb_mtd() users to ->mount()Al Viro1-32/+22
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2010-10-26Revert "mtd: cleanup Kconfig dependencies"David Woodhouse1-22/+24
This reverts commit 432dc821c90114f9b0e00f6752a700e937516ade. The individual CFI geometry options were carefully set up to get sane default values if the CFI_ADV_OPTIONS wasn't set, and it wasn't appropriate to move them into an if/endif block. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-26mtd: cfi_cmdset_0002: make sector erase command variableGuillaume LECERF2-4/+8
Some old SST chips use 0x50 as sector erase command, instead of 0x30. Make this value variable to handle such chips. Signed-off-by: Guillaume LECERF <glecerf@gmail.com> Acked-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-26mtd: cfi_cmdset_0002: add CFI detection for SST 38VF640x chipsGuillaume LECERF1-0/+26
Add support for SST38VF640x chips in CFI mode. Signed-off-by: Guillaume LECERF <glecerf@gmail.com> Signed-off-by: yidong zhang <zhangyd6@gmail.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-26mtd: cfi_util: add support for switching SST 39VF640xB chips into QRY modeGuillaume LECERF1-0/+7
Signed-off-by: Guillaume LECERF <glecerf@gmail.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-26mtd: cfi_cmdset_0001: use defined value of P_ID_INTEL_PERFORMANCE instead of hardcoded oneGuillaume LECERF1-2/+2
Signed-off-by: Guillaume LECERF <glecerf@gmail.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-26block2mtd: dubious assignmentNicolas Kaiser1-1/+0
When block2mtd_erase fails, a duplicated assignment instantly changes instr->state from MTD_ERASE_FAILED to MTD_ERASE_DONE. It looks to me like this might not be intended, or is it? Signed-off-by: Nicolas Kaiser <nikai@nikai.net> Acked-By: Joern Engel <joern@logfs.org> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-25Merge branch 'davinci-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-davinciLinus Torvalds1-38/+23
* 'davinci-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-davinci: (50 commits) davinci: fix remaining board support after io_pgoffst removal davinci: mityomapl138: make file local data static arm/davinci: remove duplicated include davinci: Initial support for Omapl138-Hawkboard davinci: MityDSP-L138/MityARM-1808 read MAC address from I2C Prom davinci: add tnetv107x touchscreen platform device input: add driver for tnetv107x touchscreen controller davinci: add keypad config for tnetv107x evm board davinci: add tnetv107x keypad platform device input: add driver for tnetv107x on-chip keypad controller net: davinci_emac: cleanup unused cpdma code net: davinci_emac: switch to new cpdma layer net: davinci_emac: separate out cpdma code net: davinci_emac: cleanup unused mdio emac code omap: cleanup unused davinci mdio arch code davinci: cleanup mdio arch code and switch to phy_id net: davinci_emac: switch to new mdio omap: add mdio platform devices davinci: add mdio platform devices net: davinci_emac: separate out davinci mdio ... Fix up trivial conflict in drivers/input/keyboard/Kconfig (two entries added next to each other - one from the davinci merge, one from the input merge)
2010-10-25Merge branch 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6Linus Torvalds3-3/+10
* 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6: mtd/m25p80: add support to parse the partitions by OF node of/irq: of_irq.c needs to include linux/irq.h of/mips: Cleanup some include directives/files. of/mips: Add device tree support to MIPS of/flattree: Eliminate need to provide early_init_dt_scan_chosen_arch of/device: Rework to use common platform_device_alloc() for allocating devices of/xsysace: Fix OF probing on little-endian systems of: use __be32 types for big-endian device tree data of/irq: remove references to NO_IRQ in drivers/of/platform.c of/promtree: add package-to-path support to pdt of/promtree: add of_pdt namespace to pdt code of/promtree: no longer call prom_ functions directly; use an ops structure of/promtree: make drivers/of/pdt.c no longer sparc-only sparc: break out some PROM device-tree building code out into drivers/of of/sparc: convert various prom_* functions to use phandle sparc: stop exporting openprom.h header powerpc, of_serial: Endianness issues setting up the serial ports of: MTD: Fix OF probing on little-endian systems of: GPIO: Fix OF probing on little-endian systems
2010-10-25P4080/mtd: Fix the freescale lbc issue with 36bit modeLan Chunhe-B258061-1/+1
When system uses 36bit physical address, res.start is 36bit physical address. But the function of in_be32 returns 32bit physical address. Then both of them compared each other is wrong. So by converting the address of res.start into the right format fixes this issue. Signed-off-by: Lan Chunhe-B25806 <b25806@freescale.com> Signed-off-by: Roy Zang <tie-fei.zang@freescale.com> Reviewed-by: Anton Vorontsov <cbouatmailru@gmail.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-25P4080/eLBC: Make Freescale elbc interrupt common to elbc devicesRoy Zang2-285/+198
Move Freescale elbc interrupt from nand driver to elbc driver. Then all elbc devices can use the interrupt instead of ONLY nand. For former nand driver, it had the two functions: 1. detecting nand flash partitions; 2. registering elbc interrupt. Now, second function is removed to fsl_lbc.c. Signed-off-by: Lan Chunhe-B25806 <b25806@freescale.com> Signed-off-by: Roy Zang <tie-fei.zang@freescale.com> Reviewed-by: Anton Vorontsov <cbouatmailru@gmail.com> Cc: Wood Scott-B07421 <B07421@freescale.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-25mtd: phram: use KBUILD_MODNAMEJoe Perches1-1/+1
Use the more standard #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt No change in output strings. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-25mtd: OneNAND: S5PC110: Fix double call suspend & resume functionKyungmin Park1-2/+1
The suspend & resume called from mtd core. So no need to call at driver. Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-25mtd: nand: fix MTD_MODE_RAW writesJon Povey1-1/+1
RAW writes were broken by 782ce79a45b3b850b108896fcf7da26754061c8f which introduced a check of ops->ooboffs in nand_do_write_ops(). When writing in RAW mode this is called with an ops struct on the stack of mtdchar.c:mtd_write() which does not initialise ops->ooboffs, so it is garbage and fails this test. This test does not make sense if ops->oobbuf is NULL, which it is in the RAW write path, so include that in the test. Signed-off-by: Jon Povey <jon.povey@racelogic.co.uk> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-25mtd: sm_ftl: cosmetic, use bool when possibleMaxim Levitsky1-4/+4
I didn't know that kernel allows use of that typedef. Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-25mtd: r852: remove useless pci powerup/down from suspend/resume routinesMaxim Levitsky2-31/+1
It turns out that pci core now handles these, so this code is redundant and can even cause bugs Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-25mtd: blktrans: fix a race vs kthread_stopMaxim Levitsky1-0/+4
There is small race window that could make kthread_stop hang forever. I found that while hacking the IR subsystem. Signed-off-by: Maxim Levitsky <maximlevisky@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-25mtd: blktrans: kill BKLMaxim Levitsky1-6/+0
It not needed, because I already added locking for all fops methods. Signed-off-by: Maxim Levitsky <maximlevisky@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2010-10-25mtd: allow to unload the mtdtrans module if its block devices aren't openMaxim Levitsky1-28/+24
Now it once again possible to remove mtdtrans module. You still need to ensure that block devices of that module aren't mounted. This is due to the fact that as long as a block device is open, it still exists, therefore if we were to allow module removal, this block device might became used again. This time in addition to code review, I also made the code pass some torture tests like module reload in a loop + read in a loop + card insert/removal all at same time. The blktrans_open/blktrans_release don't take the mtd table lock because: While device is added (that includes execution of add_mtd_blktrans_dev) the lock is already taken Now suppose the device will never be removed. In this case even if we have changes in mtd table, the entry that we need will stay exactly the same. (Note that we don't look at table at all, just following private pointer of block device). Now suppose that someone tries to remove the mtd device. This will be propagated to trans driver which _ought_ to call del_mtd_blktrans_dev which will take the per device lock, release the mtd device and set trans->mtd = NULL. >From this point on, following opens won't even be able to know anything about that mtd device (which at that point is likely not to exist) Also the same care is taken not to trip over NULL mtd pointer in blktrans_dev_release. Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com> Tested-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>