13 Jun, 2014

1 commit

  • Pull vfs updates from Al Viro:
    "This the bunch that sat in -next + lock_parent() fix. This is the
    minimal set; there's more pending stuff.

    In particular, I really hope to get acct.c fixes merged this cycle -
    we need that to deal sanely with delayed-mntput stuff. In the next
    pile, hopefully - that series is fairly short and localized
    (kernel/acct.c, fs/super.c and fs/namespace.c). In this pile: more
    iov_iter work. Most of prereqs for ->splice_write with sane locking
    order are there and Kent's dio rewrite would also fit nicely on top of
    this pile"

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (70 commits)
    lock_parent: don't step on stale ->d_parent of all-but-freed one
    kill generic_file_splice_write()
    ceph: switch to iter_file_splice_write()
    shmem: switch to iter_file_splice_write()
    nfs: switch to iter_splice_write_file()
    fs/splice.c: remove unneeded exports
    ocfs2: switch to iter_file_splice_write()
    ->splice_write() via ->write_iter()
    bio_vec-backed iov_iter
    optimize copy_page_{to,from}_iter()
    bury generic_file_aio_{read,write}
    lustre: get rid of messing with iovecs
    ceph: switch to ->write_iter()
    ceph_sync_direct_write: stop poking into iov_iter guts
    ceph_sync_read: stop poking into iov_iter guts
    new helper: copy_page_from_iter()
    fuse: switch to ->write_iter()
    btrfs: switch to ->write_iter()
    ocfs2: switch to ->write_iter()
    xfs: switch to ->write_iter()
    ...

    Linus Torvalds
     

12 Jun, 2014

2 commits

  • Backmerge of dcache.c changes from mainline. It's that, or complete
    rebase...

    Conflicts:
    fs/splice.c

    Signed-off-by: Al Viro

    Al Viro
     
  • Pull module updates from Rusty Russell:
    "Most of this is cleaning up various driver sysfs permissions so we can
    re-add the perm check (we unified the module param and sysfs checks,
    but the module ones were stronger so we weakened them temporarily).

    Param parsing gets documented, and also "--" now forces args to be
    handed to init (and ignored by the kernel).

    Module NX/RO protections get tightened: we now set them before calling
    parse_args()"

    * tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
    module: set nx before marking module MODULE_STATE_COMING.
    samples/kobject/: avoid world-writable sysfs files.
    drivers/hid/hid-picolcd_fb: avoid world-writable sysfs files.
    drivers/staging/speakup/: avoid world-writable sysfs files.
    drivers/regulator/virtual: avoid world-writable sysfs files.
    drivers/scsi/pm8001/pm8001_ctl.c: avoid world-writable sysfs files.
    drivers/hid/hid-lg4ff.c: avoid world-writable sysfs files.
    drivers/video/fbdev/sm501fb.c: avoid world-writable sysfs files.
    drivers/mtd/devices/docg3.c: avoid world-writable sysfs files.
    speakup: fix incorrect perms on speakup_acntsa.c
    cpumask.h: silence warning with -Wsign-compare
    Documentation: Update kernel-parameters.tx
    param: hand arguments after -- straight to init
    modpost: Fix resource leak in read_dump()

    Linus Torvalds
     

11 Jun, 2014

1 commit

  • Pull MTD updates from Brian Norris:
    - refactor m25p80.c driver for use as a general SPI NOR framework for
    other drivers which may speak to SPI NOR flash without providing full
    SPI support (i.e., not part of drivers/spi/)
    - new Freescale QuadSPI driver (utilizing new SPI NOR framework)
    - updates for the STMicro "FSM" SPI NOR driver
    - fix sync/flush behavior on mtd_blkdevs
    - fixup subpage write support on a few NAND drivers
    - correct the MTD OOB test for odd-sized OOB areas
    - add BCH-16 support for OMAP NAND
    - fix warnings and trivial refactoring
    - utilize new ECC DT bindings in pxa3xx NAND driver
    - new LPDDR NVM driver
    - address a few assorted bugs caught by Coverity
    - add new imx6sx support for GPMI NAND
    - use a bounce buffer for NAND when non-DMA-able buffers are used

    * tag 'for-linus-20140610' of git://git.infradead.org/linux-mtd: (77 commits)
    mtd: gpmi: add gpmi support for imx6sx
    mtd: maps: remove check for CONFIG_MTD_SUPERH_RESERVE
    mtd: bf5xx_nand: use the managed version of kzalloc
    mtd: pxa3xx_nand: make the driver work on big-endian systems
    mtd: nand: omap: fix omap_calculate_ecc_bch() for-loop error
    mtd: nand: r852: correct write_buf loop bounds
    mtd: nand_bbt: handle error case for nand_create_badblock_pattern()
    mtd: nand_bbt: remove unused variable
    mtd: maps: sc520cdp: fix warnings
    mtd: slram: fix unused variable warning
    mtd: pfow: remove unused variable
    mtd: lpddr: fix Kconfig dependency, for I/O accessors
    mtd: nand: pxa3xx: Add supported ECC strength and step size to the DT binding
    mtd: nand: pxa3xx: Use ECC strength and step size devicetree binding
    mtd: nand: pxa3xx: Clean pxa_ecc_init() error handling
    mtd: nand: Warn the user if the selected ECC strength is too weak
    mtd: nand: omap: Documentation: How to select correct ECC scheme for your device ?
    mtd: nand: omap: add support for BCH16_ECC - NAND driver updates
    mtd: nand: omap: add support for BCH16_ECC - ELM driver updates
    mtd: nand: omap: add support for BCH16_ECC - GPMC driver updates
    ...

    Linus Torvalds
     

10 Jun, 2014

1 commit

  • Pull UBIFS updates from Artem Bityutskiy:
    "This contains several UBIFS fixes. One of them fixes a race condition
    between the mmap page fault path and fsync. Another just removes a
    bogus assertion from the UBIFS memory shrinker.

    UBIFS also started honoring the MS_SILENT mount flag, so now it won't
    print many I/O errors when user-space just tries to probe for the FS.

    Rest of the changes are rather minor UBI/UBIFS fixes, improvements,
    and clean-ups"

    * tag 'upstream-3.16-rc1-v2' of git://git.infradead.org/linux-ubifs:
    UBIFS: Add an assertion for clean_zn_cnt
    UBIFS: respect MS_SILENT mount flag
    UBIFS: Remove incorrect assertion in shrink_tnc()
    UBIFS: fix debugging check
    UBIFS: add missing ui pointer in debugging code
    UBI: block: Fix error path on alloc_workqueue failure
    UBIFS: Fix dump messages in ubifs_dump_lprops
    UBI: fix rb_tree node comparison in add_map
    UBIFS: Remove unused variables in ubifs_budget_space
    UBI: weaken the 'exclusive' constraint when opening volumes to rename
    UBIFS: fix an mmap and fsync race condition

    Linus Torvalds
     

03 Jun, 2014

1 commit

  • Pull block core updates from Jens Axboe:
    "It's a big(ish) round this time, lots of development effort has gone
    into blk-mq in the last 3 months. Generally we're heading to where
    3.16 will be a feature complete and performant blk-mq. scsi-mq is
    progressing nicely and will hopefully be in 3.17. A nvme port is in
    progress, and the Micron pci-e flash driver, mtip32xx, is converted
    and will be sent in with the driver pull request for 3.16.

    This pull request contains:

    - Lots of prep and support patches for scsi-mq have been integrated.
    All from Christoph.

    - API and code cleanups for blk-mq from Christoph.

    - Lots of good corner case and error handling cleanup fixes for
    blk-mq from Ming Lei.

    - A flew of blk-mq updates from me:

    * Provide strict mappings so that the driver can rely on the CPU
    to queue mapping. This enables optimizations in the driver.

    * Provided a bitmap tagging instead of percpu_ida, which never
    really worked well for blk-mq. percpu_ida relies on the fact
    that we have a lot more tags available than we really need, it
    fails miserably for cases where we exhaust (or are close to
    exhausting) the tag space.

    * Provide sane support for shared tag maps, as utilized by scsi-mq

    * Various fixes for IO timeouts.

    * API cleanups, and lots of perf tweaks and optimizations.

    - Remove 'buffer' from struct request. This is ancient code, from
    when requests were always virtually mapped. Kill it, to reclaim
    some space in struct request. From me.

    - Remove 'magic' from blk_plug. Since we store these on the stack
    and since we've never caught any actual bugs with this, lets just
    get rid of it. From me.

    - Only call part_in_flight() once for IO completion, as includes two
    atomic reads. Hopefully we'll get a better implementation soon, as
    the part IO stats are now one of the more expensive parts of doing
    IO on blk-mq. From me.

    - File migration of block code from {mm,fs}/ to block/. This
    includes bio.c, bio-integrity.c, bounce.c, and ioprio.c. From me,
    from a discussion on lkml.

    That should describe the meat of the pull request. Also has various
    little fixes and cleanups from Dave Jones, Shaohua Li, Duan Jiong,
    Fengguang Wu, Fabian Frederick, Randy Dunlap, Robert Elliott, and Sam
    Bradshaw"

    * 'for-3.16/core' of git://git.kernel.dk/linux-block: (100 commits)
    blk-mq: push IPI or local end_io decision to __blk_mq_complete_request()
    blk-mq: remember to start timeout handler for direct queue
    block: ensure that the timer is always added
    blk-mq: blk_mq_unregister_hctx() can be static
    blk-mq: make the sysfs mq/ layout reflect current mappings
    blk-mq: blk_mq_tag_to_rq should handle flush request
    block: remove dead code in scsi_ioctl:blk_verify_command
    blk-mq: request initialization optimizations
    block: add queue flag for disabling SG merging
    block: remove 'magic' from struct blk_plug
    blk-mq: remove alloc_hctx and free_hctx methods
    blk-mq: add file comments and update copyright notices
    blk-mq: remove blk_mq_alloc_request_pinned
    blk-mq: do not use blk_mq_alloc_request_pinned in blk_mq_map_request
    blk-mq: remove blk_mq_wait_for_tags
    blk-mq: initialize request in __blk_mq_alloc_request
    blk-mq: merge blk_mq_alloc_reserved_request into blk_mq_alloc_request
    blk-mq: add helper to insert requests from irq context
    blk-mq: remove stale comment for blk_mq_complete_request()
    blk-mq: allow non-softirq completions
    ...

    Linus Torvalds
     

29 May, 2014

5 commits

  • The gpmi's IP for imx6sx is nearly the same as the gpmi's IP for imx6q,
    except the following two new features:

    (1) the new BCH contoller has 62-BIT correcting ECC strength
    (The BCH for imx6q only has 40-BIT ECC strength).

    (2) add the hardware Randomizer support.

    This patch does the follow changes:

    (1) add a new macro GPMI_IS_MX6SX to represent the imx6sx's gpmi.

    (2) add a new macro GPMI_IS_MX6.
    We use this macro to initialize the same registers for both
    imx6sx and imx6q, and so on.

    (3) add a new gpmi_devdata instance, the gpmi_devdata_imx6sx, for
    imx6sx.

    Signed-off-by: Huang Shijie
    Signed-off-by: Brian Norris

    Huang Shijie
     
  • Since (a few releases before) v2.6.0 there have been checks for
    CONFIG_MTD_SUPERH_RESERVE. One check is still present. But a Kconfig
    symbol MTD_SUPERH_RESERVE has never been added. So a few lines of dead
    code can be removed.

    Signed-off-by: Paul Bolle
    Signed-off-by: Brian Norris

    Paul Bolle
     
  • This patch moves data allocated using kzalloc to managed data allocated
    using devm_kzalloc and cleans now unnecessary kfrees in probe and remove
    functions. Also, the now unnecessary label out_err_hw_init is done away
    with and the label out_err_kzalloc is renamed to out_err.

    The following Coccinelle semantic patch was used for making the change:

    @platform@
    identifier p, probefn, removefn;
    @@
    struct platform_driver p = {
    .probe = probefn,
    .remove = removefn,
    };

    @prb@
    identifier platform.probefn, pdev;
    expression e, e1, e2;
    @@
    probefn(struct platform_device *pdev, ...) {
    dev, e1, e2)
    ...
    ?-kfree(e);
    ...+>
    }

    @rem depends on prb@
    identifier platform.removefn;
    expression e;
    @@
    removefn(...) {

    }

    Signed-off-by: Himangi Saraogi
    Signed-off-by: Brian Norris

    Himangi Saraogi
     
  • The pxa3xx_nand driver currently uses __raw_writel() and __raw_readl()
    to access I/O registers. However, those functions do not do any
    endianness swapping, which means that they won't work when the CPU
    runs in big-endian but the I/O registers are little endian, which is
    the common situation for ARM systems running big endian.

    Since __raw_writel() and __raw_readl() do not include any memory
    barriers and the pxa3xx_nand driver can only be compiled for ARM
    platforms, the closest I/o accessors functions that do endianess
    swapping are writel_relaxed() and readl_relaxed().

    This patch has been verified to work on Armada XP GP: without the
    patch, the NAND is not detected when the kernel runs big endian while
    it is properly detected when the kernel runs little endian. With the
    patch applied, the NAND is properly detected in both situations
    (little and big endian).

    Signed-off-by: Thomas Petazzoni
    Cc: # v3.13+
    Signed-off-by: Brian Norris

    Thomas Petazzoni
     
  • Fixes: 2c9f2365d1e1d0e318b068f683f18c99515b80f8
    mtd: nand: omap: ecc.calculate: merge omap3_calculate_ecc_bch4 in omap_calculate_ecc_bch

    Fixes: 7bcd1dca1d587ad29f9825ba4414620440e8c8da
    mtd: nand: omap: ecc.calculate: merge omap3_calculate_ecc_bch8 in omap_calculate_ecc_bch

    Cc: # 3.13.x+
    Signed-off-by: Ted Juan
    Acked-by: Pekon Gupta
    Signed-off-by: Brian Norris

    Ted Juan
     

28 May, 2014

5 commits

  • The two loops in r852_write_buf() are designed to handle 4-byte-aligned
    and then 1-byte-aligned portions, respectively. However, there are two
    issues:

    (1) The first loop will only terminate if 'len' is a multiple of 4
    (2) The second loop will never terminate if it runs at least once

    Rewrite these loops as they were probably intended. Compile tested only.

    Issues pointed out by Coverity Scan.

    Signed-off-by: Brian Norris
    Cc: Maxim Levitsky

    Brian Norris
     
  • Signed-off-by: Brian Norris

    Brian Norris
     
  • Set, but unused, variable.

    Signed-off-by: Brian Norris

    Brian Norris
     
  • On m86k, and maybe a few other architectures, we get this kind of
    warning, due to misuse of volatile:

    drivers/mtd/maps/sc520cdp.c: In function 'sc520cdp_setup_par':
    >> drivers/mtd/maps/sc520cdp.c:223:2: warning: passing argument 1 of 'iounmap' discards 'volatile' qualifier from pointer target type [enabled by default]
    arch/m68k/include/asm/raw_io.h:22:13: note: expected 'void *' but argument is of type 'volatile long unsigned int *'

    Rather than annotating the variable declaration, let's just use the
    proper accessors, which add the 'volatile' qualifier to the operation.

    Signed-off-by: Brian Norris

    Brian Norris
     
  • drivers/mtd/devices/slram.c: In function 'init_slram':
    drivers/mtd/devices/slram.c:283:6: warning: variable 'i' set but not used [-Wunused-but-set-variable]

    Signed-off-by: Brian Norris

    Brian Norris
     

27 May, 2014

2 commits


22 May, 2014

3 commits


21 May, 2014

16 commits

  • This patch add support for BCH16 ecc-scheme in OMAP NAND driver, by extending
    following functions:
    - omap_enable_hwecc (nand_chip->ecc.hwctl): configure GPMC controller
    - omap_calculate_ecc_bch (nand_chip->ecc.calculate): fetch ECC signature from GPMC controller
    - omap_elm_correct_data (nand_chip->ecc.correct): detect and correct ECC errors using ELM

    (a) BCH16 ecc-scheme can detect and correct 16 bit-flips per 512Bytes of data.
    (b) BCH16 ecc-scheme generates 26-bytes of ECC syndrome / 512B.
    Due to (b) this scheme can only be used with NAND devices which have enough
    OOB to satisfy the relation: "OOBsize per page >= 26 * (page-size / 512)"

    Signed-off-by: Pekon Gupta
    Signed-off-by: Brian Norris

    pekon gupta
     
  • ELM hardware engine is used to detect ECC errors for BCHx ecc-schemes
    (like BCH4/BCH8/BCH16). This patch extends configuration of ELM registers
    for adding support of BCH16_HW ecc-scheme.

    Signed-off-by: Pekon Gupta
    Signed-off-by: Brian Norris

    pekon gupta
     
  • Signed-off-by: Ron Lee
    Signed-off-by: Brian Norris

    Ron Lee
     
  • Signed-off-by: Vincenzo Aliberti
    Signed-off-by: Brian Norris

    Vincenzo Aliberti
     
  • Enhances the help for the CFI command set choices.

    Signed-off-by: Philippe De Muyter
    Signed-off-by: Brian Norris

    Philippe De Muyter
     
  • A workaround was already in place that set the WP bit in the
    IFC_CSPR0 register after a STATUS command, however it used an 8-bit
    write method. As a result, the WP bit was never set on 16-bit devices,
    and these devices would eventually be incorrectly marked as
    write-protected.

    This patch checks the chip options for a 16-bit device and uses the
    appropriate write method to set the WP bit after a STATUS command.

    Signed-off-by: Joe Schultz
    Signed-off-by: Aaron Sierra
    Signed-off-by: Brian Norris

    Joe Schultz
     
  • The IFC buffer is accessed via 8-bit and 16-bit accessors. Changing
    the 'addr' member of 'struct fsl_ifc_nand_ctrl' from 'u8 __iomem *' to
    'void __iomem *' eliminates the need for explicit casts when the
    16-bit accessors are used.

    Signed-off-by: Aaron Sierra
    Signed-off-by: Brian Norris

    Aaron Sierra
     
  • The break statements should be indented another tab.

    Signed-off-by: Dan Carpenter
    Reviewed-by: Jingoo Han
    Signed-off-by: Brian Norris

    Dan Carpenter
     
  • nand_base can be passed a kmap()'d buffers from highmem by
    filesystems like jffs2. This results in failure to map the
    physical address of the DMA buffer on various contoller
    driver on different platforms. This change adds a chip option
    to use preallocated databuf as bounce buffers used in
    nand_do_read_ops() and nand_do_write_ops().
    This allows for specific nand controller driver to set this
    option as needed.

    Signed-off-by: Kamal Dasu
    Signed-off-by: Brian Norris

    Kamal Dasu
     
  • As subpage write is enabled by default for all drivers, nand_write_subpage_hwecc
    causes a crash if the driver did not register ecc->hwctl or ecc->calculate.
    This behavior was introduced in
    commit 837a6ba4f3b6d23026674e6af6b6849a4634fff9
    "mtd: nand: subpage write support for hardware based ECC schemes".

    This fixes a crash by emulating subpage write support by padding sub-page data
    with 0xff on either sides to make it full page compatible.

    Reported-by: Helmut Schaa
    Tested-by: Helmut Schaa
    Signed-off-by: Pekon Gupta
    Reviewed-by: Scott Wood
    Cc: # 3.10.x+
    Signed-off-by: Brian Norris

    Pekon Gupta
     
  • The samsung onenand driver passes around a dma address token
    through a void pointer, which is incorrect and leads to
    warnings like this one:

    onenand/samsung.c:548:2: warning: passing argument 1 of '__fswab32' makes integer from pointer without a cast [enabled by default]
    writel(src, base + S5PC110_DMA_SRC_ADDR);
    ^

    This patch makes it use dma_addr_t here, which is more appropriate.

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

    Arnd Bergmann
     
  • Make of_device_id array const, because all OF functions
    handle it as const.

    Signed-off-by: Jingoo Han
    Acked-by: Andrew Lunn
    Signed-off-by: Brian Norris

    Jingoo Han
     
  • Make of_device_id array const, because all OF functions
    handle it as const.

    Signed-off-by: Jingoo Han
    Acked-by: Jason Cooper
    Acked-by: Ezequiel Garcia
    Signed-off-by: Brian Norris

    Jingoo Han
     
  • Make of_device_id array const, because all OF functions
    handle it as const.

    Signed-off-by: Jingoo Han
    Signed-off-by: Brian Norris

    Jingoo Han
     
  • On m68k, where access_ok() doesn't cast the address parameter:

    drivers/mtd/mtdchar.c: In function 'mtdchar_write_ioctl':
    drivers/mtd/mtdchar.c:575:4: warning: passing argument 2 of 'access_ok' makes pointer from integer without a cast [enabled by default]
    arch/m68k/include/asm/uaccess_mm.h:17:90: note: expected 'const void *' but argument is of type '__u64'
    drivers/mtd/mtdchar.c:576:4: warning: passing argument 2 of 'access_ok' makes pointer from integer without a cast [enabled by default]
    arch/m68k/include/asm/uaccess_mm.h:17:90: note: expected 'const void *' but argument is of type '__u64'

    The address parameter of access_ok() is really a userspace pointer.
    On most architectures, access_ok() is a macro that casts the address
    parameter, hiding issues in its users.

    Move around and use the existing usr_data and usr_oob temporary variables
    to kill the warnings. Add a few "consts", and make more use of the
    temporaries while we're at it.

    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Brian Norris

    Geert Uytterhoeven
     
  • fixes: commit 62116e5171e00f85a8d53f76e45b84423c89ff34
    mtd: nand: omap2: Support for hardware BCH error correction.

    In omap_elm_correct_data(), if bitflip_count in an erased-page is within the
    correctable limit (< ecc.strength), then it is not indicated back to the caller
    ecc->read_page().

    This mis-guides upper layers like MTD and UBIFS layer to assume erased-page as
    perfectly clean and use it for writing even if actual bitflip_count was
    dangerously high (bitflip_count > mtd->bitflip_threshold).

    This patch fixes this above issue, by returning 'stats' to caller
    ecc->read_page() under all scenarios.

    Reported-by: Brian Norris
    Signed-off-by: Pekon Gupta
    Cc: # 3.9.x+
    Signed-off-by: Brian Norris

    pekon gupta
     

14 May, 2014

1 commit


13 May, 2014

2 commits

  • The comparisons used in add_vol() shouldn't be identical. Pretty sure
    the following is correct but it is completely untested.

    Signed-off-by: Mike Snitzer
    Acked-by: Richard Weinberger
    Signed-off-by: Artem Bityutskiy

    Mike Snitzer
     
  • The UBI volume rename ioctl (UBI_IOCRNVOL) open the volumes in exclusive
    mode. The volumes are opened for two reasons: to build a volume rename list,
    and a volume remove list.

    However, the first open constraint is excessive and can be replaced by
    a 'read-write' open mode. The second open constraint is properly set as
    'exclusive' given the volume is opened for removal and we don't want any
    users around.

    By weakening the former 'exclusive' mode, we allow 'read-only' users to keep
    the volume open, while a rename is taking place. This is useful to perform
    an atomic rename, in a firmware upgrade scenario, while keeping the volume
    in read-only use (for instance, if a ubiblock is mounted as rootfs).

    It's worth mention this is not the case of UBIFS, which keeps the volume
    opened as 'read-write' despite mounted as read-write or read-only mode.

    This change was suggested at least twice by Artem:
    http://lists.infradead.org/pipermail/linux-mtd/2012-September/044175.html
    http://permalink.gmane.org/gmane.linux.drivers.mtd/39866

    Signed-off-by: Ezequiel Garcia
    Signed-off-by: Artem Bityutskiy

    Ezequiel Garcia