30 Oct, 2010

2 commits

  • * 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

    Linus Torvalds
     
  • 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
     

29 Oct, 2010

1 commit


25 Oct, 2010

4 commits

  • Add support for mtd repartition based on the block
    device BLKPG interface:
    BLKPG_ADD_PARTITION - for partition creation;
    BLKPG_DEL_PARTITION - for partition delete

    The usage is based on BLKPG ioctl called with
    struct blkpg_ioctl_arg argument which includes the
    reference to struct blkpg_partition discribing the
    partition offset and length.

    Disadvantage: there is no implementation for mtd
    flags control. The flags are always borrowed from
    the master device.

    Signed-off-by: Roman Tereshonkov
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Roman Tereshonkov
     
  • If "ur_idx" is wrong we could go past the end of the array. The
    "ur_idx" comes from root so it's not a huge deal, but adding a sanity
    check makes the code more robust.

    Signed-off-by: Dan Carpenter
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Dan Carpenter
     
  • There were some improvements and additions necessary in the
    comments explaining of the expansion of nand_ecclayout, the
    introduction of nand_ecclayout_user, and the deprecation of the
    ioctl ECCGETLAYOUT.

    Also, I found a better placement for the macro MTD_MAX_ECCPOS_ENTRIES;
    next to the definition of MTD_MAX_OOBFREE_ENTRIES in mtd-abi.h. The macro
    is really only important for the ioctl code (found in drivers/mtd/mtdchar.c)
    but since there are small edits being made to the user-space header, I
    figured this is a better location.

    Signed-off-by: Brian Norris
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Brian Norris
     
  • struct nand_ecclayout is too small for many new chips; OOB regions can be as
    large as 448 bytes and may increase more in the future. Thus, copying that
    struct to user-space with the ECCGETLAYOUT ioctl is not a good idea; the ioctl
    would have to be updated every time there's a change to the current largest
    size.

    Instead, the old nand_ecclayout is renamed to nand_ecclayout_user and a
    new struct nand_ecclayout is created that can accomodate larger sizes and
    expand without affecting the user-space. struct nand_ecclayout can still
    be used in board drivers without modification -- at least for now.

    A new function is provided to convert from the new to the old in order to
    allow the deprecated ioctl to continue to work with truncated data. Perhaps
    the ioctl, the conversion process, and the struct nand_ecclayout_user can be
    removed altogether in the future.

    Note: There are comments in nand/davinci_nand.c::nand_davinci_probe()
    regarding this issue; this driver (and maybe others) can be updated to
    account for extra space. All kernel drivers can use the expanded
    nand_ecclayout as a drop-in replacement and ignore its benefits.

    Signed-off-by: Brian Norris
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Brian Norris
     

16 Sep, 2010

1 commit

  • All these files use the big kernel lock in a trivial
    way to serialize their private file operations,
    typically resulting from an earlier semi-automatic
    pushdown from VFS.

    None of these drivers appears to want to lock against
    other code, and they all use the BKL as the top-level
    lock in their file operations, meaning that there
    is no lock-order inversion problem.

    Consequently, we can remove the BKL completely,
    replacing it with a per-file mutex in every case.
    Using a scripted approach means we can avoid
    typos.

    file=$1
    name=$2
    if grep -q lock_kernel ${file} ; then
    if grep -q 'include.*linux.mutex.h' ${file} ; then
    sed -i '/include.*/d' ${file}
    else
    sed -i 's/include.*.*$/include /g' ${file}
    fi
    sed -i ${file} \
    -e "/^#include.*linux.mutex.h/,$ {
    1,/^\(static\|int\|long\)/ {
    /^\(static\|int\|long\)/istatic DEFINE_MUTEX(${name}_mutex);

    } }" \
    -e "s/\(un\)*lock_kernel\>[ ]*()/mutex_\1lock(\&${name}_mutex)/g" \
    -e '/[ ]*cycle_kernel_lock();/d'
    else
    sed -i -e '/include.*\/d' ${file} \
    -e '/cycle_kernel_lock()/d'
    fi

    Signed-off-by: Arnd Bergmann
    Cc: David Woodhouse
    Cc: linux-mtd@lists.infradead.org

    Arnd Bergmann
     

11 Aug, 2010

1 commit

  • * git://git.infradead.org/mtd-2.6: (79 commits)
    mtd: Remove obsolete include
    mtd: Update copyright notices
    jffs2: Update copyright notices
    mtd-physmap: add support users can assign the probe type in board files
    mtd: remove redwood map driver
    mxc_nand: Add v3 (i.MX51) Support
    mxc_nand: support 8bit ecc
    mxc_nand: fix correct_data function
    mxc_nand: add V1_V2 namespace to registers
    mxc_nand: factor out a check_int function
    mxc_nand: make some internally used functions overwriteable
    mxc_nand: rework get_dev_status
    mxc_nand: remove 0xe00 offset from registers
    mtd: denali: Add multi connected NAND support
    mtd: denali: Remove set_ecc_config function
    mtd: denali: Remove unuseful code in get_xx_nand_para functions
    mtd: denali: Remove device_info_tag structure
    mtd: m25p80: add support for the Winbond W25Q32 SPI flash chip
    mtd: m25p80: add support for the Intel/Numonyx {16,32,64}0S33B SPI flash chips
    mtd: m25p80: add support for the EON EN25P{32, 64} SPI flash chips
    ...

    Fix up trivial conflicts in drivers/mtd/maps/{Kconfig,redwood.c} due to
    redwood driver removal.

    Linus Torvalds
     

09 Aug, 2010

2 commits


04 Aug, 2010

1 commit

  • For no-mmu systems mmap() on RAM/ROM devices already works
    but for systems with mmu it probably was not tested and
    doesn't work.

    This patch allows using mmap() on MTD RAM/ROM devices on systems
    with MMU. It has been tested on mpc5121e based platform with
    MR0A16A MRAM device attached over LocalBus.

    Signed-off-by: Anatolij Gustschin
    Acked-by: Mike Frysinger
    Signed-off-by: David Woodhouse

    Anatolij Gustschin
     

02 Aug, 2010

1 commit


08 Jun, 2010

1 commit

  • * git://git.infradead.org/~dwmw2/mtd-2.6.35:
    jffs2: update ctime when changing the file's permission by setfacl
    jffs2: Fix NFS race by using insert_inode_locked()
    jffs2: Fix in-core inode leaks on error paths
    mtd: Fix NAND submenu
    mtd/r852: update card detect early.
    mtd/r852: Fixes in case of DMA timeout
    mtd/r852: register IRQ as last step
    drivers/mtd: Use memdup_user
    docbook: make mtd nand module init static

    Linus Torvalds
     

24 May, 2010

1 commit

  • * 'bkl/ioctl' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing:
    uml: Pushdown the bkl from harddog_kern ioctl
    sunrpc: Pushdown the bkl from sunrpc cache ioctl
    sunrpc: Pushdown the bkl from ioctl
    autofs4: Pushdown the bkl from ioctl
    uml: Convert to unlocked_ioctls to remove implicit BKL
    ncpfs: BKL ioctl pushdown
    coda: Clean-up whitespace problems in pioctl.c
    coda: BKL ioctl pushdown
    drivers: Push down BKL into various drivers
    isdn: Push down BKL into ioctl functions
    scsi: Push down BKL into ioctl functions
    dvb: Push down BKL into ioctl functions
    smbfs: Push down BKL into ioctl function
    coda/psdev: Remove BKL from ioctl function
    um/mmapper: Remove BKL usage
    sn_hwperf: Kill BKL usage
    hfsplus: Push down BKL into ioctl function

    Linus Torvalds
     

22 May, 2010

1 commit

  • Use memdup_user when user data is immediately copied into the
    allocated region.

    The semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @@
    expression from,to,size,flag;
    position p;
    identifier l1,l2;
    @@

    - to = \(kmalloc@p\|kzalloc@p\)(size,flag);
    + to = memdup_user(from,size);
    if (
    - to==NULL
    + IS_ERR(to)
    || ...) {

    }
    - if (copy_from_user(to, from, size) != 0) {
    -
    - }
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: David Woodhouse

    Julia Lawall
     

18 May, 2010

1 commit

  • We cannot modify file->f_mapping->backing_dev_info, because it will corrupt
    backing device of device node inode, since file->f_mapping is equal to
    inode->i_mapping (see __dentry_open() in fs/open.c).

    Let's introduce separate inode for MTD device with appropriate backing
    device.

    [dwmw2: Refactor to keep it all entirely within mtdchar.c; use iget_locked()]

    Signed-off-by: Kirill A. Shutemov
    Acked-by: Jan Kara
    Signed-off-by: David Woodhouse

    Kirill A. Shutemov
     

17 May, 2010

1 commit

  • These are the last remaining device drivers using
    the ->ioctl file operation in the drivers directory
    (except from v4l drivers).

    [fweisbec: drop i8k pushdown as it has been done from
    procfs pushdown branch already]

    Signed-off-by: Arnd Bergmann
    Signed-off-by: Frederic Weisbecker

    Arnd Bergmann
     

25 Feb, 2010

4 commits


29 May, 2009

5 commits


04 Apr, 2009

1 commit

  • Update driver model support in the MTD framework, so it fits
    better into the current udev-based hotplug framework:

    - Each mtd_info now has a device node. MTD drivers should set
    the dev.parent field to point to the physical device, before
    setting up partitions or otherwise declaring MTDs.

    - Those device nodes always map to /sys/class/mtdX device nodes,
    which no longer depend on MTD_CHARDEV.

    - Those mtdX sysfs nodes have a "starter set" of attributes;
    it's not yet sufficient to replace /proc/mtd.

    - Enabling MTD_CHARDEV provides /sys/class/mtdXro/ nodes and the
    /sys/class/mtd*/dev attributes (for udev, mdev, etc).

    - Include a MODULE_ALIAS_CHARDEV_MAJOR macro. It'll work with
    udev creating the /dev/mtd* nodes, not just a static rootfs.

    So the sysfs structure is pretty much what you'd expect, except
    that readonly chardev nodes are a bit quirky.

    Signed-off-by: David Brownell
    Signed-off-by: David Woodhouse

    David Brownell
     

24 Mar, 2009

1 commit


21 Mar, 2009

1 commit


10 Dec, 2008

1 commit

  • MTD internal API presently uses 32-bit values to represent
    device size. This patch updates them to 64-bits but leaves
    the external API unchanged. Extending the external API
    is a separate issue for several reasons. First, no one
    needs it at the moment. Secondly, whether the implementation
    is done with IOCTLs, sysfs or both is still debated. Thirdly
    external API changes require the internal API to be accepted
    first.

    Note that although the MTD API will be able to support 64-bit
    device sizes, existing drivers do not and are not required
    to do so, although NAND base has been updated.

    In general, changing from 32-bit to 64-bit values cause little
    or no changes to the majority of the code with the following
    exceptions:
    - printk message formats
    - division and modulus of 64-bit values
    - NAND base support
    - 32-bit local variables used by mtdpart and mtdconcat
    - naughtily assuming one structure maps to another
    in MEMERASE ioctl

    Signed-off-by: Adrian Hunter
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Adrian Hunter
     

21 Oct, 2008

2 commits

  • Signed-off-by: Al Viro

    Al Viro
     
  • * git://git.infradead.org/mtd-2.6: (69 commits)
    Revert "[MTD] m25p80.c code cleanup"
    [MTD] [NAND] GPIO driver depends on ARM... for now.
    [MTD] [NAND] sh_flctl: fix compile error
    [MTD] [NOR] AT49BV6416 has swapped erase regions
    [MTD] [NAND] GPIO NAND flash driver
    [MTD] cmdlineparts documentation change - explain where mtd-id comes from
    [MTD] cfi_cmdset_0002.c: Add Macronix CFI V1.0 TopBottom detection
    [MTD] [NAND] Fix compilation warnings in drivers/mtd/nand/cs553x_nand.c
    [JFFS2] Write buffer offset adjustment for NOR-ECC (Sibley) flash
    [MTD] mtdoops: Fix a bug where block may not be erased
    [MTD] mtdoops: Add a magic number to logged kernel oops
    [MTD] mtdoops: Fix an off by one error
    [JFFS2] Correct parameter names of jffs2_compress() in comments
    [MTD] [NAND] sh_flctl: add support for Renesas SuperH FLCTL
    [MTD] [NAND] Bug on atmel_nand HW ECC : OOB info not correctly written
    [MTD] [MAPS] Remove unused variable after ROM API cleanup.
    [MTD] m25p80.c extended jedec support (v2)
    [MTD] remove unused mtd parameter in of_mtd_parse_partitions()
    [MTD] [NAND] remove dead Kconfig associated with !CONFIG_PPC_MERGE
    [MTD] [NAND] driver extension to support NAND on TQM85xx modules
    ...

    Linus Torvalds
     

17 Oct, 2008

1 commit


02 Sep, 2008

1 commit

  • The MEMGETREGIONINFO ioctl() in mtdchar.c was clobbering user memory by
    overwriting more than intended, due the size of struct mtd_erase_region_info
    changing in commit 0ecbc81adfcb9f15f86b05ff576b342ce81bbef8 ('Support
    for auto locking flash on power up').

    Fix avoids this by copying struct members one by one with put_user(), as there
    is no longer a convenient struct to use the size of as the length argument to
    copy_to_user().

    Signed-off-by: Zev Weiss
    Signed-off-by: David Woodhouse

    Zev Weiss
     

02 Aug, 2008

1 commit

  • Now that we can tell when we have one of the newer DataFlash chips,
    optionally expose the 128 bytes of OTP memory they provide. Tested
    on at45db642 revision B and D chips.

    Switch mtdchar over to a generic HAVE_MTD_OTP flag instead of adding
    another #ifdef for each type of chip whose driver has OTP support.

    Signed-off-by: David Brownell
    Cc: Bryan Wu
    Cc: Michael Hennerich
    Signed-off-by: Andrew Morton
    Signed-off-by: David Woodhouse

    David Brownell
     

25 Jul, 2008

1 commit


22 Jul, 2008

1 commit


11 Jul, 2008

2 commits

  • Use einfo, oinfo for the inner erase_info and otp_info structs used in
    individual case statements.

    drivers/mtd/mtdchar.c:582:26: warning: symbol 'info' shadows an earlier one
    drivers/mtd/mtdchar.c:380:23: originally declared here
    drivers/mtd/mtdchar.c:596:26: warning: symbol 'info' shadows an earlier one
    drivers/mtd/mtdchar.c:380:23: originally declared here
    drivers/mtd/mtdchar.c:704:19: warning: symbol 'info' shadows an earlier one
    drivers/mtd/mtdchar.c:380:23: originally declared here

    Signed-off-by: Harvey Harrison
    Signed-off-by: Andrew Morton
    Signed-off-by: David Woodhouse

    Harvey Harrison
     
  • The copy_to_user was casting away the address space to get the offset of
    the length member. Use offsetof() instead and add it to the void __user
    *argp.

    drivers/mtd/mtdchar.c:527:23: warning: cast removes address space of expression
    drivers/mtd/mtdchar.c:527:23: warning: incorrect type in argument 1 (different address spaces)
    drivers/mtd/mtdchar.c:527:23: expected void [noderef] *to
    drivers/mtd/mtdchar.c:527:23: got unsigned int *

    Signed-off-by: Harvey Harrison
    Signed-off-by: Andrew Morton
    Signed-off-by: David Woodhouse

    Harvey Harrison