summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/devices
Commit message (Collapse)AuthorAgeFilesLines
* mtd: m25p80: add support for M25PX64Yoshihiro Shimoda2011-03-111-0/+2
| | | | | Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* mtd: phram: fix memory leakMathias Krause2011-03-111-0/+3
| | | | | | | | | | Commit 4f678a58 (mtd: fix memory leaks in phram_setup) missed two cases where the memory allocated for name would be leaked. This commit frees the memory when register_device() fails and on unregister_devices(). Signed-off-by: Mathias Krause <minipli@googlemail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* mtd: mtdram: initialize writebufsize fieldArtem Bityutskiy2011-03-111-0/+1
| | | | | | | Set the 'mtd->writebufsize' field to 64 to mimic modern CFI flashes. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* mtd: m25p80: add support for the EON EN25F32 chipGabor Juhos2011-03-111-1/+2
| | | | | Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* Merge git://git.infradead.org/mtd-2.6Linus Torvalds2011-01-172-6/+37
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * git://git.infradead.org/mtd-2.6: (59 commits) mtd: mtdpart: disallow reading OOB past the end of the partition mtd: pxa3xx_nand: NULL dereference in pxa3xx_nand_probe UBI: use mtd->writebufsize to set minimal I/O unit size mtd: initialize writebufsize in the MTD object of a partition mtd: onenand: add mtd->writebufsize initialization mtd: nand: add mtd->writebufsize initialization mtd: cfi: add writebufsize initialization mtd: add writebufsize field to mtd_info struct mtd: OneNAND: OMAP2/3: prevent regulator sleeping while OneNAND is in use mtd: OneNAND: add enable / disable methods to onenand_chip mtd: m25p80: Fix JEDEC ID for AT26DF321 mtd: txx9ndfmc: limit transfer bytes to 512 (ECC provides 6 bytes max) mtd: cfi_cmdset_0002: add support for Samsung K8D3x16UxC NOR chips mtd: cfi_cmdset_0002: add support for Samsung K8D6x16UxM NOR chips mtd: nand: ams-delta: drop omap_read/write, use ioremap mtd: m25p80: add debugging trace in sst_write mtd: nand: ams-delta: select for built-in by default mtd: OneNAND: lighten scary initial bad block messages mtd: OneNAND: OMAP2/3: add support for command line partitioning mtd: nand: rearrange ONFI revision checking, add ONFI 2.3 ... Fix up trivial conflict in drivers/mtd/Kconfig as per DavidW.
| * mtd: m25p80: Fix JEDEC ID for AT26DF321Aleksandr Koltsoff2011-01-061-1/+1
| | | | | | | | | | | | | | | | | | The last byte of the ID should be zero for this chip. Was added in commit d0e8c47c58575b9131e786edb488fd029eba443e . Reported by Tomi Varjo. Signed-off-by: Aleksandr Koltsoff <aleksandr.koltsoff@ebts.fi> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * mtd: m25p80: add debugging trace in sst_writeNicolas Ferre2011-01-061-0/+4
| | | | | | | | | | | | | | | | Add a DEBUG(MTD_DEBUG_LEVEL2, ..) trace at beginning of sst_write() function as it is done in m25p80_write() function. Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * mtd: fix section mismatch on sst25lFabio Estevam2010-12-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Building the kernel with 'make CONFIG_DEBUG_SECTION_MISMATCH=y´ resulted in: WARNING: vmlinux.o(.data+0x15938): Section mismatch in reference from the variable sst25l_driver to the function .init.text:sst25l_probe() The variable sst25l_driver references the function __init sst25l_probe() If the reference is valid then annotate the variable with __init* or __refdata (see linux/init.h) or name the variable: *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console, Fix the section mismatch. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * mtd: m25p80: Add support for Macronix MX25L25655EKevin Cernekee2010-12-031-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>
| * mtd: m25p80: Add support for Macronix MX25L25635EKevin Cernekee2010-12-031-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>
| * mtd: m25p80: Reinstate error print on unrecognized flashKevin Cernekee2010-12-031-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>
* | block: clean up blkdev_get() wrappers and their usersTejun Heo2010-11-131-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>
* | block: make blkdev_get/put() handle exclusive accessTejun Heo2010-11-131-13/+4Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | mtd: fix bdev exclusive open bugs in block2mtd::add_device()Tejun Heo2010-11-131-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>
* mtd: fix build error in m25p80.cAndres Salomon2010-10-301-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>
* Merge branch 'master' of ↵David Woodhouse2010-10-302-1/+8
|\ | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git 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>
| * Merge branch 'next-devicetree' of git://git.secretlab.ca/git/linux-2.6Linus Torvalds2010-10-251-0/+7
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * '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
| | * mtd/m25p80: add support to parse the partitions by OF nodeMingkai Hu2010-10-221-0/+7
| | | | | | | | | | | | | | | | | | Signed-off-by: Mingkai Hu <Mingkai.hu@freescale.com> [grant.likely@secretlab.ca: wrap hunk with #ifdef CONFIG_OF] Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
| * | Merge branch 'for-next' of ↵Linus Torvalds2010-10-241-1/+1
| |\ \ | | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (39 commits) Update broken web addresses in arch directory. Update broken web addresses in the kernel. Revert "drivers/usb: Remove unnecessary return's from void functions" for musb gadget Revert "Fix typo: configuation => configuration" partially ida: document IDA_BITMAP_LONGS calculation ext2: fix a typo on comment in ext2/inode.c drivers/scsi: Remove unnecessary casts of private_data drivers/s390: Remove unnecessary casts of private_data net/sunrpc/rpc_pipe.c: Remove unnecessary casts of private_data drivers/infiniband: Remove unnecessary casts of private_data drivers/gpu/drm: Remove unnecessary casts of private_data kernel/pm_qos_params.c: Remove unnecessary casts of private_data fs/ecryptfs: Remove unnecessary casts of private_data fs/seq_file.c: Remove unnecessary casts of private_data arm: uengine.c: remove C99 comments arm: scoop.c: remove C99 comments Fix typo configue => configure in comments Fix typo: configuation => configuration Fix typo interrest[ing|ed] => interest[ing|ed] Fix various typos of valid in comments ... Fix up trivial conflicts in: drivers/char/ipmi/ipmi_si_intf.c drivers/usb/gadget/rndis.c net/irda/irnet/irnet_ppp.c
| | * Update broken web addresses in the kernel.Justin P. Mattock2010-10-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The patch below updates broken web addresses in the kernel Signed-off-by: Justin P. Mattock <justinmattock@gmail.com> Cc: Maciej W. Rozycki <macro@linux-mips.org> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Finn Thain <fthain@telegraphics.com.au> Cc: Randy Dunlap <rdunlap@xenotime.net> Cc: Matt Turner <mattst88@gmail.com> Cc: Dimitry Torokhov <dmitry.torokhov@gmail.com> Cc: Mike Frysinger <vapier.adi@gmail.com> Acked-by: Ben Pfaff <blp@cs.stanford.edu> Acked-by: Hans J. Koch <hjk@linutronix.de> Reviewed-by: Finn Thain <fthain@telegraphics.com.au> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | | block2mtd: dubious assignmentNicolas Kaiser2010-10-261-1/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | mtd: phram: use KBUILD_MODNAMEJoe Perches2010-10-251-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>
* | | mtd: m25p80.c: Add support for S25FL032P spi-nor flash devices.David Jander2010-10-251-0/+1
| | | | | | | | | | | | | | | | | | Signed-off-by: David Jander <david@protonic.nl> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* | | mtd: m25p80: Add support for the Winbond W25Q64Thierry Reding2010-10-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for the Winbond W25Q64 serial flash. Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* | | mtd: m25p80: Add support for two new Spansion SPI devices (S25FL-K)Gernot Hoyler2010-10-251-0/+2
|/ / | | | | | | | | | | | | | | | | This patch adds support for Spansion S25FL016K and S25FL064K SPI flash. It has been tested with physical devices. Note that both parts exhibit a Winbond manufacturer ID so they might also be added to that section. Signed-off-by: Gernot Hoyler <Gernot.Hoyler@spansion.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* | mtd/m25p80: fix test for end of loopDan Carpenter2010-08-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | "plat_id" is always non-NULL here. There is a zero element on the end of the m25p_ids[] array and if we hit the end of the loop then plat_id points to that. This would lead to a NULL pointer dereference later on in the function. Signed-off-by: Dan Carpenter <error27@gmail.com> Acked-by: Anton Vorontsov <cbouatmailru@gmail.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* | mtd/m25p80: retlen is never NULLDan Carpenter2010-08-121-8/+4Star
|/ | | | | | | | | | | | | | | | This is just a cleanup, it doesn't fix any bugs. These functions all check retlen inconsistently and it generates a warning in Smatch (http://smatch.sf.net). If retlen were ever NULL it would cause an oops and the code has been this way since 2006 so someone would have complained. Also I looked at other places that implemented the mtd read and write functions and they dereference retlen without checking. I removed the checks. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* mtd: Remove obsolete <mtd/compatmac.h> includeDavid Woodhouse2010-08-084-4/+0Star
| | | | Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* mtd: m25p80: add support for the Winbond W25Q32 SPI flash chipGabor Juhos2010-08-061-0/+1
| | | | | Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
* mtd: m25p80: add support for the Intel/Numonyx {16,32,64}0S33B SPI flash chipsGabor Juhos2010-08-061-1/+7
| | | | | | Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* mtd: m25p80: add support for the EON EN25P{32, 64} SPI flash chipsGabor Juhos2010-08-061-0/+4
| | | | | | Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* mtd: m25p80: Make jedec_probe() return proper errno valuesAnton Vorontsov2010-08-041-12/+6Star
| | | | | | | | | | | | | | spi_write_then_read() may return its own return codes (e.g. -EIO), so let's propagate the value down to the probe(). Also, remove jedec == 0 check, it isn't needed as nowadays we use dedicated SPI device IDs for non-JEDEC flashes. Suggested-by: Barry Song <21cnbao@gmail.com> Signed-off-by: Anton Vorontsov <avorontsov@mvista.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>
* mtd: m25p80: Fix false-positive probingAnton Vorontsov2010-08-041-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | Since commit 18c6182bae0acca220ed6611f741034d563cd19f ("Rework probing/JEDEC code"), m25p80 driver successfully registers chips even if JEDEC probing fails. This was needed to support non-JEDEC flashes. Though, it appears that some platforms (e.g. blackfin bf533 stamp[1]) used the old behavior to detect if there's any flash connected, so the driver have to fail on JEDEC probing errors. This patch restores the old behavior for JEDEC flashes, and adds "-nonjedec" SPI device IDs for M25Pxx flashes, so that the kernel still supports non-JEDEC flashes. [1] http://blackfin.uclinux.org/gf/project/uclinux-dist/tracker/?action=TrackerItemEdit&tracker_item_id=5975 Reported-by: Mingquan Pan Reported-by: Barry Song <21cnbao@gmail.com> Signed-off-by: Anton Vorontsov <avorontsov@mvista.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>
* mtd: dataflash: remove casts from voidKulikov Vasiliy2010-08-021-6/+6
| | | | | | | | Remove unnesessary casts from void*. Signed-off-by: Kulikov Vasiliy <segooon@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* mtd: m25p80: Add support for Macronix 25L8005Martin Michlmayr2010-08-021-0/+1
| | | | | | | | Add support for Macronix 25L8005. Tested on a HP t5325 Thin Client. Signed-off-by: Martin Michlmayr <tbm@cyrius.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* mtd: sst25l: check for null consistentlyDan Carpenter2010-08-021-1/+1
| | | | | | | | | | The rest of the function assumes that "data" can be null. I don't know the code well enough to say whether it can actually be null, but there is no harm in checking here. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* mtd: sst25l: fix multi-part messages with broken spi mastersH Hartley Sweeten2010-05-141-24/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Some SPI masters (ep93xx) have limitations when using the SFRMOUT signal for the spi device chip select. The SFRMOUT signal is only asserted as long as the spi transmit fifo contains data. As soon as the last bit is clocked into the receive fifo it gets deasserted. The functions sst25l_status and sst25l_match_device use the API function spi_write_then_read to write a command to the flash then read the response back. This API function creates a two part spi message for the write then read. When this message is transferred the SFRMOUT signal ends up getting deasserted after the command phase. This causes the command to get aborted by the device so the read phase returns invalid data. By changing sst25l_status and sst25l_match_device to use a single transfer synchronous message, the SFRMOUT signal stays asserted during the entire message so the correct data always gets returned. This change will have no effect on SPI masters which use a chip select mechanism (GPIO's, etc.) which does stay asserted correctly. As a bonus, the single transfer synchronous messages complete faster than multi-part messages. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* Merge branch 'master' of ↵David Woodhouse2010-05-103-0/+3
|\ | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 Conflicts: drivers/mtd/mtdcore.c Pull in the bdi fixes and ARM platform changes that other outstanding patches depend on.
| * include cleanup: Update gfp.h and slab.h includes to prepare for breaking ↵Tejun Heo2010-03-303-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | implicit slab.h inclusion from percpu.h percpu.h is included by sched.h and module.h and thus ends up being included when building most .c files. percpu.h includes slab.h which in turn includes gfp.h making everything defined by the two files universally available and complicating inclusion dependencies. percpu.h -> slab.h dependency is about to be removed. Prepare for this change by updating users of gfp and slab facilities include those headers directly instead of assuming availability. As this conversion needs to touch large number of source files, the following script is used as the basis of conversion. http://userweb.kernel.org/~tj/misc/slabh-sweep.py The script does the followings. * Scan files for gfp and slab usages and update includes such that only the necessary includes are there. ie. if only gfp is used, gfp.h, if slab is used, slab.h. * When the script inserts a new include, it looks at the include blocks and try to put the new include such that its order conforms to its surrounding. It's put in the include block which contains core kernel includes, in the same order that the rest are ordered - alphabetical, Christmas tree, rev-Xmas-tree or at the end if there doesn't seem to be any matching order. * If the script can't find a place to put a new include (mostly because the file doesn't have fitting include block), it prints out an error message indicating which .h file needs to be added to the file. The conversion was done in the following steps. 1. The initial automatic conversion of all .c files updated slightly over 4000 files, deleting around 700 includes and adding ~480 gfp.h and ~3000 slab.h inclusions. The script emitted errors for ~400 files. 2. Each error was manually checked. Some didn't need the inclusion, some needed manual addition while adding it to implementation .h or embedding .c file was more appropriate for others. This step added inclusions to around 150 files. 3. The script was run again and the output was compared to the edits from #2 to make sure no file was left behind. 4. Several build tests were done and a couple of problems were fixed. e.g. lib/decompress_*.c used malloc/free() wrappers around slab APIs requiring slab.h to be added manually. 5. The script was run on all .h files but without automatically editing them as sprinkling gfp.h and slab.h inclusions around .h files could easily lead to inclusion dependency hell. Most gfp.h inclusion directives were ignored as stuff from gfp.h was usually wildly available and often used in preprocessor macros. Each slab.h inclusion directive was examined and added manually as necessary. 6. percpu.h was updated not to include slab.h. 7. Build test were done on the following configurations and failures were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my distributed build env didn't work with gcov compiles) and a few more options had to be turned off depending on archs to make things build (like ipr on powerpc/64 which failed due to missing writeq). * x86 and x86_64 UP and SMP allmodconfig and a custom test config. * powerpc and powerpc64 SMP allmodconfig * sparc and sparc64 SMP allmodconfig * ia64 SMP allmodconfig * s390 SMP allmodconfig * alpha SMP allmodconfig * um on x86_64 SMP allmodconfig 8. percpu.h modifications were reverted so that it could be applied as a separate patch and serve as bisection point. Given the fact that I had only a couple of failures from tests on step 6, I'm fairly confident about the coverage of this conversion patch. If there is a breakage, it's likely to be something in one of the arch headers which should be easily discoverable easily on most builds of the specific arch. Signed-off-by: Tejun Heo <tj@kernel.org> Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
* | mtd: sst25l: remove unnecessary MTD_DEBUG_LEVEL2 messagesH Hartley Sweeten2010-05-101-11/+0Star
| | | | | | | | | | | | | | | | | | | | All the SST25L series flash parts have uniform erase sectors. Remove the extra MTD_DEBUG_LEVEL2 messages showing the eraseregions info since they could never be shown. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* | mtd: block2mtd: Use kasprintfJulia Lawall2010-03-181-3/+1Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | kasprintf combines kmalloc and sprintf, and takes care of the size calculation itself. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression a,flag; expression list args; statement S; @@ a = - \(kmalloc\|kzalloc\)(...,flag) + kasprintf(flag,args) <... when != a if (a == NULL || ...) S ...> - sprintf(a,args); // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* | mtd: small typo in MakefileMatteo Croce2010-03-181-1/+1
| | | | | | | | | | | | | | Cosmetic fix: the path in the Makefile is wrong Signed-off-by: Matteo Croce <matteo@teknoraver.net> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* | mtd: Remove unnecessary comparisons with MAX_MTD_DEVICESBen Hutchings2010-02-251-2/+2
|/ | | | | | | | MAX_MTD_DEVICES is about to be removed. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
* Merge git://git.infradead.org/mtd-2.6Linus Torvalds2009-12-162-141/+212
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * git://git.infradead.org/mtd-2.6: (90 commits) jffs2: Fix long-standing bug with symlink garbage collection. mtd: OneNAND: Fix test of unsigned in onenand_otp_walk() mtd: cfi_cmdset_0002, fix lock imbalance Revert "mtd: move mxcnd_remove to .exit.text" mtd: m25p80: add support for Macronix MX25L4005A kmsg_dump: fix build for CONFIG_PRINTK=n mtd: nandsim: add support for 4KiB pages mtd: mtdoops: refactor as a kmsg_dumper mtd: mtdoops: make record size configurable mtd: mtdoops: limit the maximum mtd partition size mtd: mtdoops: keep track of used/unused pages in an array mtd: mtdoops: several minor cleanups core: Add kernel message dumper to call on oopses and panics mtd: add ARM pismo support mtd: pxa3xx_nand: Fix PIO data transfer mtd: nand: fix multi-chip suspend problem mtd: add support for switching old SST chips into QRY mode mtd: fix M29W800D dev_id and uaddr mtd: don't use PF_MEMALLOC mtd: Add bad block table overrides to Davinci NAND driver ... Fixed up conflicts (mostly trivial) in drivers/mtd/devices/m25p80.c drivers/mtd/maps/pcmciamtd.c drivers/mtd/nand/pxa3xx_nand.c kernel/printk.c
| * mtd: m25p80: add support for Macronix MX25L4005ASimon Guinot2009-12-051-0/+1
| | | | | | | | | | Signed-off-by: Simon Guinot <sguinot@lacie.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * mtd: m25p80: Add support for CAT25xxx serial EEPROMsAnton Vorontsov2009-11-301-45/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CAT25 chips (as manufactured by On Semiconductor, previously Catalyst Semiconductor) are similar to the original M25Px0 chips, except: - Address width can vary (1-2 bytes, in contrast to 3 bytes in M25P chips). So, implement convenient m25p_addr2cmd() and m25p_cmdsz() calls, and place address width information into flash_info struct; - Page size can vary, therefore we shouldn't hardcode it, so get rid of FLASH_PAGESIZE definition, and place the page size information into flash_info struct; - CAT25 EEPROMs don't need to be erased, so add NO_ERASE flag, and propagate it to the mtd subsystem. [dwmw2: Fix up for conflicts with DMA safety patch] Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * mtd: m25p80: Rework probing/JEDEC codeAnton Vorontsov2009-11-301-29/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previosly the driver always tried JEDEC probing, assuming that non-JEDEC chips will return '0'. But truly non-JEDEC chips (like CAT25) won't do that, their behaviour on RDID command is undefined, so the driver should not call jedec_probe() for these chips. Also, be less strict on error conditions, don't fail to probe if JEDEC found a chip that is different from what platform code told, instead just print some warnings and use an information obtained via JEDEC. In that case we should not trust partitions any longer, but they might be still useful (i.e. they could protect some parts of the chip). Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * mtd: m25p80: Convert to device table matchingAnton Vorontsov2009-11-301-75/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch converts the m25p80 driver so that now it uses .id_table for device matching, making it properly detect devices on OpenFirmware platforms (prior to this patch the driver misdetected non-JEDEC chips, seeing all chips as "m25p80"). Also, now jedec_probe() only does jedec probing, nothing else. If it is not able to detect a chip, NULL is returned and the driver fall backs to the information specified by the platform (platform_data, or exact ID). Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * mtd: m25p80: make command buffer DMA-safeJohannes Stezenbach2009-11-301-2/+9
| | | | | | | | | | | | | | | | | | spi_write() requires the buffer to be DMA-safe, kmalloc() it seperately to ensure this. Signed-off-by: Johannes Stezenbach <js@sig21.net> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
| * mtd: fix memory leak in mtd_dataflashH Hartley Sweeten2009-10-171-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a potential memory leak in mtd_dataflash driver. The private data that is allocated when registering a DataFlash device with the MTD subsystem is not released if an error occurs when add_mtd_partitions() or add_mtd_device() is called. Fix this by adding an error path. The memory is already released during a remove. Also, add a dev_set_drvdata(&spi->dev, NULL) before the kfree() so that the spi device does not reference invalid data. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>