02 May, 2017

1 commit

  • Pull block layer updates from Jens Axboe:

    - Add BFQ IO scheduler under the new blk-mq scheduling framework. BFQ
    was initially a fork of CFQ, but subsequently changed to implement
    fairness based on B-WF2Q+, a modified variant of WF2Q. BFQ is meant
    to be used on desktop type single drives, providing good fairness.
    From Paolo.

    - Add Kyber IO scheduler. This is a full multiqueue aware scheduler,
    using a scalable token based algorithm that throttles IO based on
    live completion IO stats, similary to blk-wbt. From Omar.

    - A series from Jan, moving users to separately allocated backing
    devices. This continues the work of separating backing device life
    times, solving various problems with hot removal.

    - A series of updates for lightnvm, mostly from Javier. Includes a
    'pblk' target that exposes an open channel SSD as a physical block
    device.

    - A series of fixes and improvements for nbd from Josef.

    - A series from Omar, removing queue sharing between devices on mostly
    legacy drivers. This helps us clean up other bits, if we know that a
    queue only has a single device backing. This has been overdue for
    more than a decade.

    - Fixes for the blk-stats, and improvements to unify the stats and user
    windows. This both improves blk-wbt, and enables other users to
    register a need to receive IO stats for a device. From Omar.

    - blk-throttle improvements from Shaohua. This provides a scalable
    framework for implementing scalable priotization - particularly for
    blk-mq, but applicable to any type of block device. The interface is
    marked experimental for now.

    - Bucketized IO stats for IO polling from Stephen Bates. This improves
    efficiency of polled workloads in the presence of mixed block size
    IO.

    - A few fixes for opal, from Scott.

    - A few pulls for NVMe, including a lot of fixes for NVMe-over-fabrics.
    From a variety of folks, mostly Sagi and James Smart.

    - A series from Bart, improving our exposed info and capabilities from
    the blk-mq debugfs support.

    - A series from Christoph, cleaning up how handle WRITE_ZEROES.

    - A series from Christoph, cleaning up the block layer handling of how
    we track errors in a request. On top of being a nice cleanup, it also
    shrinks the size of struct request a bit.

    - Removal of mg_disk and hd (sorry Linus) by Christoph. The former was
    never used by platforms, and the latter has outlived it's usefulness.

    - Various little bug fixes and cleanups from a wide variety of folks.

    * 'for-4.12/block' of git://git.kernel.dk/linux-block: (329 commits)
    block: hide badblocks attribute by default
    blk-mq: unify hctx delay_work and run_work
    block: add kblock_mod_delayed_work_on()
    blk-mq: unify hctx delayed_run_work and run_work
    nbd: fix use after free on module unload
    MAINTAINERS: bfq: Add Paolo as maintainer for the BFQ I/O scheduler
    blk-mq-sched: alloate reserved tags out of normal pool
    mtip32xx: use runtime tag to initialize command header
    scsi: Implement blk_mq_ops.show_rq()
    blk-mq: Add blk_mq_ops.show_rq()
    blk-mq: Show operation, cmd_flags and rq_flags names
    blk-mq: Make blk_flags_show() callers append a newline character
    blk-mq: Move the "state" debugfs attribute one level down
    blk-mq: Unregister debugfs attributes earlier
    blk-mq: Only unregister hctxs for which registration succeeded
    blk-mq-debugfs: Rename functions for registering and unregistering the mq directory
    blk-mq: Let blk_mq_debugfs_register() look up the queue name
    blk-mq: Register /queue/mq after having registered /queue
    ide-pm: always pass 0 error to ide_complete_rq in ide_do_devset
    ide-pm: always pass 0 error to __blk_end_request_all
    ..

    Linus Torvalds
     

21 Apr, 2017

3 commits

  • Drop 'parent' argument of bdi_register() and bdi_register_va(). It is
    always NULL.

    Reviewed-by: Christoph Hellwig
    Signed-off-by: Jan Kara
    Signed-off-by: Jens Axboe

    Jan Kara
     
  • Now that all bdi structures filesystems use are properly refcounted, we
    can remove the SB_I_DYNBDI flag.

    Reviewed-by: Christoph Hellwig
    Signed-off-by: Jan Kara
    Signed-off-by: Jens Axboe

    Jan Kara
     
  • MTD already allocates backing_dev_info dynamically. Convert it to use
    generic infrastructure for this including proper refcounting. We drop
    mtd->backing_dev_info as its only use was to pass mtd_bdi pointer from
    one file into another and if we wanted to keep that in a clean way, we'd
    have to make mtd hold and drop bdi reference as needed which seems
    pointless for passing one global pointer...

    CC: David Woodhouse
    CC: Brian Norris
    CC: linux-mtd@lists.infradead.org
    Reviewed-by: Christoph Hellwig
    Signed-off-by: Jan Kara
    Signed-off-by: Jens Axboe

    Jan Kara
     

31 Mar, 2017

1 commit


30 Mar, 2017

1 commit

  • In commit 6afaf8a484cb ("UBI: flush wl before clearing update marker") I
    managed to trigger and fix a similar bug. Now here is another version of
    which I assumed it wouldn't matter back then but it turns out UBI has a
    check for it and will error out like this:

    |ubi0 warning: validate_vid_hdr: inconsistent used_ebs
    |ubi0 error: validate_vid_hdr: inconsistent VID header at PEB 592

    All you need to trigger this is? "ubiupdatevol /dev/ubi0_0 file" + a
    powercut in the middle of the operation.
    ubi_start_update() sets the update-marker and puts all EBs on the erase
    list. After that userland can proceed to write new data while the old EB
    aren't erased completely. A powercut at this point is usually not that
    much of a tragedy. UBI won't give read access to the static volume
    because it has the update marker. It will most likely set the corrupted
    flag because it misses some EBs.
    So we are all good. Unless the size of the image that has been written
    differs from the old image in the magnitude of at least one EB. In that
    case UBI will find two different values for `used_ebs' and refuse to
    attach the image with the error message mentioned above.

    So in order not to get in the situation, the patch will ensure that we
    wait until everything is removed before it tries to write any data.
    The alternative would be to detect such a case and remove all EBs at the
    attached time after we processed the volume-table and see the
    update-marker set. The patch looks bigger and I doubt it is worth it
    since usually the write() will wait from time to time for a new EB since
    usually there not that many spare EB that can be used.

    Cc: stable@vger.kernel.org
    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Richard Weinberger

    Sebastian Siewior
     

10 Mar, 2017

1 commit

  • Fix typos and add the following to the scripts/spelling.txt:

    disble||disable
    disbled||disabled

    I kept the TSL2563_INT_DISBLED in /drivers/iio/light/tsl2563.c
    untouched. The macro is not referenced at all, but this commit is
    touching only comment blocks just in case.

    Link: http://lkml.kernel.org/r/1481573103-11329-20-git-send-email-yamada.masahiro@socionext.com
    Signed-off-by: Masahiro Yamada
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Masahiro Yamada
     

04 Mar, 2017

1 commit

  • Pull vfs 'statx()' update from Al Viro.

    This adds the new extended stat() interface that internally subsumes our
    previous stat interfaces, and allows user mode to specify in more detail
    what kind of information it wants.

    It also allows for some explicit synchronization information to be
    passed to the filesystem, which can be relevant for network filesystems:
    is the cached value ok, or do you need open/close consistency, or what?

    From David Howells.

    Andreas Dilger points out that the first version of the extended statx
    interface was posted June 29, 2010:

    https://www.spinics.net/lists/linux-fsdevel/msg33831.html

    * 'rebased-statx' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    statx: Add a system call to make enhanced file info available

    Linus Torvalds
     

03 Mar, 2017

1 commit

  • Add a system call to make extended file information available, including
    file creation and some attribute flags where available through the
    underlying filesystem.

    The getattr inode operation is altered to take two additional arguments: a
    u32 request_mask and an unsigned int flags that indicate the
    synchronisation mode. This change is propagated to the vfs_getattr*()
    function.

    Functions like vfs_stat() are now inline wrappers around new functions
    vfs_statx() and vfs_statx_fd() to reduce stack usage.

    ========
    OVERVIEW
    ========

    The idea was initially proposed as a set of xattrs that could be retrieved
    with getxattr(), but the general preference proved to be for a new syscall
    with an extended stat structure.

    A number of requests were gathered for features to be included. The
    following have been included:

    (1) Make the fields a consistent size on all arches and make them large.

    (2) Spare space, request flags and information flags are provided for
    future expansion.

    (3) Better support for the y2038 problem [Arnd Bergmann] (tv_sec is an
    __s64).

    (4) Creation time: The SMB protocol carries the creation time, which could
    be exported by Samba, which will in turn help CIFS make use of
    FS-Cache as that can be used for coherency data (stx_btime).

    This is also specified in NFSv4 as a recommended attribute and could
    be exported by NFSD [Steve French].

    (5) Lightweight stat: Ask for just those details of interest, and allow a
    netfs (such as NFS) to approximate anything not of interest, possibly
    without going to the server [Trond Myklebust, Ulrich Drepper, Andreas
    Dilger] (AT_STATX_DONT_SYNC).

    (6) Heavyweight stat: Force a netfs to go to the server, even if it thinks
    its cached attributes are up to date [Trond Myklebust]
    (AT_STATX_FORCE_SYNC).

    And the following have been left out for future extension:

    (7) Data version number: Could be used by userspace NFS servers [Aneesh
    Kumar].

    Can also be used to modify fill_post_wcc() in NFSD which retrieves
    i_version directly, but has just called vfs_getattr(). It could get
    it from the kstat struct if it used vfs_xgetattr() instead.

    (There's disagreement on the exact semantics of a single field, since
    not all filesystems do this the same way).

    (8) BSD stat compatibility: Including more fields from the BSD stat such
    as creation time (st_btime) and inode generation number (st_gen)
    [Jeremy Allison, Bernd Schubert].

    (9) Inode generation number: Useful for FUSE and userspace NFS servers
    [Bernd Schubert].

    (This was asked for but later deemed unnecessary with the
    open-by-handle capability available and caused disagreement as to
    whether it's a security hole or not).

    (10) Extra coherency data may be useful in making backups [Andreas Dilger].

    (No particular data were offered, but things like last backup
    timestamp, the data version number and the DOS archive bit would come
    into this category).

    (11) Allow the filesystem to indicate what it can/cannot provide: A
    filesystem can now say it doesn't support a standard stat feature if
    that isn't available, so if, for instance, inode numbers or UIDs don't
    exist or are fabricated locally...

    (This requires a separate system call - I have an fsinfo() call idea
    for this).

    (12) Store a 16-byte volume ID in the superblock that can be returned in
    struct xstat [Steve French].

    (Deferred to fsinfo).

    (13) Include granularity fields in the time data to indicate the
    granularity of each of the times (NFSv4 time_delta) [Steve French].

    (Deferred to fsinfo).

    (14) FS_IOC_GETFLAGS value. These could be translated to BSD's st_flags.
    Note that the Linux IOC flags are a mess and filesystems such as Ext4
    define flags that aren't in linux/fs.h, so translation in the kernel
    may be a necessity (or, possibly, we provide the filesystem type too).

    (Some attributes are made available in stx_attributes, but the general
    feeling was that the IOC flags were to ext[234]-specific and shouldn't
    be exposed through statx this way).

    (15) Mask of features available on file (eg: ACLs, seclabel) [Brad Boyer,
    Michael Kerrisk].

    (Deferred, probably to fsinfo. Finding out if there's an ACL or
    seclabal might require extra filesystem operations).

    (16) Femtosecond-resolution timestamps [Dave Chinner].

    (A __reserved field has been left in the statx_timestamp struct for
    this - if there proves to be a need).

    (17) A set multiple attributes syscall to go with this.

    ===============
    NEW SYSTEM CALL
    ===============

    The new system call is:

    int ret = statx(int dfd,
    const char *filename,
    unsigned int flags,
    unsigned int mask,
    struct statx *buffer);

    The dfd, filename and flags parameters indicate the file to query, in a
    similar way to fstatat(). There is no equivalent of lstat() as that can be
    emulated with statx() by passing AT_SYMLINK_NOFOLLOW in flags. There is
    also no equivalent of fstat() as that can be emulated by passing a NULL
    filename to statx() with the fd of interest in dfd.

    Whether or not statx() synchronises the attributes with the backing store
    can be controlled by OR'ing a value into the flags argument (this typically
    only affects network filesystems):

    (1) AT_STATX_SYNC_AS_STAT tells statx() to behave as stat() does in this
    respect.

    (2) AT_STATX_FORCE_SYNC will require a network filesystem to synchronise
    its attributes with the server - which might require data writeback to
    occur to get the timestamps correct.

    (3) AT_STATX_DONT_SYNC will suppress synchronisation with the server in a
    network filesystem. The resulting values should be considered
    approximate.

    mask is a bitmask indicating the fields in struct statx that are of
    interest to the caller. The user should set this to STATX_BASIC_STATS to
    get the basic set returned by stat(). It should be noted that asking for
    more information may entail extra I/O operations.

    buffer points to the destination for the data. This must be 256 bytes in
    size.

    ======================
    MAIN ATTRIBUTES RECORD
    ======================

    The following structures are defined in which to return the main attribute
    set:

    struct statx_timestamp {
    __s64 tv_sec;
    __s32 tv_nsec;
    __s32 __reserved;
    };

    struct statx {
    __u32 stx_mask;
    __u32 stx_blksize;
    __u64 stx_attributes;
    __u32 stx_nlink;
    __u32 stx_uid;
    __u32 stx_gid;
    __u16 stx_mode;
    __u16 __spare0[1];
    __u64 stx_ino;
    __u64 stx_size;
    __u64 stx_blocks;
    __u64 __spare1[1];
    struct statx_timestamp stx_atime;
    struct statx_timestamp stx_btime;
    struct statx_timestamp stx_ctime;
    struct statx_timestamp stx_mtime;
    __u32 stx_rdev_major;
    __u32 stx_rdev_minor;
    __u32 stx_dev_major;
    __u32 stx_dev_minor;
    __u64 __spare2[14];
    };

    The defined bits in request_mask and stx_mask are:

    STATX_TYPE Want/got stx_mode & S_IFMT
    STATX_MODE Want/got stx_mode & ~S_IFMT
    STATX_NLINK Want/got stx_nlink
    STATX_UID Want/got stx_uid
    STATX_GID Want/got stx_gid
    STATX_ATIME Want/got stx_atime{,_ns}
    STATX_MTIME Want/got stx_mtime{,_ns}
    STATX_CTIME Want/got stx_ctime{,_ns}
    STATX_INO Want/got stx_ino
    STATX_SIZE Want/got stx_size
    STATX_BLOCKS Want/got stx_blocks
    STATX_BASIC_STATS [The stuff in the normal stat struct]
    STATX_BTIME Want/got stx_btime{,_ns}
    STATX_ALL [All currently available stuff]

    stx_btime is the file creation time, stx_mask is a bitmask indicating the
    data provided and __spares*[] are where as-yet undefined fields can be
    placed.

    Time fields are structures with separate seconds and nanoseconds fields
    plus a reserved field in case we want to add even finer resolution. Note
    that times will be negative if before 1970; in such a case, the nanosecond
    fields will also be negative if not zero.

    The bits defined in the stx_attributes field convey information about a
    file, how it is accessed, where it is and what it does. The following
    attributes map to FS_*_FL flags and are the same numerical value:

    STATX_ATTR_COMPRESSED File is compressed by the fs
    STATX_ATTR_IMMUTABLE File is marked immutable
    STATX_ATTR_APPEND File is append-only
    STATX_ATTR_NODUMP File is not to be dumped
    STATX_ATTR_ENCRYPTED File requires key to decrypt in fs

    Within the kernel, the supported flags are listed by:

    KSTAT_ATTR_FS_IOC_FLAGS

    [Are any other IOC flags of sufficient general interest to be exposed
    through this interface?]

    New flags include:

    STATX_ATTR_AUTOMOUNT Object is an automount trigger

    These are for the use of GUI tools that might want to mark files specially,
    depending on what they are.

    Fields in struct statx come in a number of classes:

    (0) stx_dev_*, stx_blksize.

    These are local system information and are always available.

    (1) stx_mode, stx_nlinks, stx_uid, stx_gid, stx_[amc]time, stx_ino,
    stx_size, stx_blocks.

    These will be returned whether the caller asks for them or not. The
    corresponding bits in stx_mask will be set to indicate whether they
    actually have valid values.

    If the caller didn't ask for them, then they may be approximated. For
    example, NFS won't waste any time updating them from the server,
    unless as a byproduct of updating something requested.

    If the values don't actually exist for the underlying object (such as
    UID or GID on a DOS file), then the bit won't be set in the stx_mask,
    even if the caller asked for the value. In such a case, the returned
    value will be a fabrication.

    Note that there are instances where the type might not be valid, for
    instance Windows reparse points.

    (2) stx_rdev_*.

    This will be set only if stx_mode indicates we're looking at a
    blockdev or a chardev, otherwise will be 0.

    (3) stx_btime.

    Similar to (1), except this will be set to 0 if it doesn't exist.

    =======
    TESTING
    =======

    The following test program can be used to test the statx system call:

    samples/statx/test-statx.c

    Just compile and run, passing it paths to the files you want to examine.
    The file is built automatically if CONFIG_SAMPLES is enabled.

    Here's some example output. Firstly, an NFS directory that crosses to
    another FSID. Note that the AUTOMOUNT attribute is set because transiting
    this directory will cause d_automount to be invoked by the VFS.

    [root@andromeda ~]# /tmp/test-statx -A /warthog/data
    statx(/warthog/data) = 0
    results=7ff
    Size: 4096 Blocks: 8 IO Block: 1048576 directory
    Device: 00:26 Inode: 1703937 Links: 125
    Access: (3777/drwxrwxrwx) Uid: 0 Gid: 4041
    Access: 2016-11-24 09:02:12.219699527+0000
    Modify: 2016-11-17 10:44:36.225653653+0000
    Change: 2016-11-17 10:44:36.225653653+0000
    Attributes: 0000000000001000 (-------- -------- -------- -------- -------- -------- ---m---- --------)

    Secondly, the result of automounting on that directory.

    [root@andromeda ~]# /tmp/test-statx /warthog/data
    statx(/warthog/data) = 0
    results=7ff
    Size: 4096 Blocks: 8 IO Block: 1048576 directory
    Device: 00:27 Inode: 2 Links: 125
    Access: (3777/drwxrwxrwx) Uid: 0 Gid: 4041
    Access: 2016-11-24 09:02:12.219699527+0000
    Modify: 2016-11-17 10:44:36.225653653+0000
    Change: 2016-11-17 10:44:36.225653653+0000

    Signed-off-by: David Howells
    Signed-off-by: Al Viro

    David Howells
     

02 Mar, 2017

3 commits


01 Mar, 2017

1 commit

  • Pull ARM updates from Russell King:

    - nommu updates from Afzal Mohammed cleaning up the vectors support

    - allow DMA memory "mapping" for nommu Benjamin Gaignard

    - fixing a correctness issue with R_ARM_PREL31 relocations in the
    module linker

    - add strlen() prototype for the decompressor

    - support for DEBUG_VIRTUAL from Florian Fainelli

    - adjusting memory bounds after memory reservations have been
    registered

    - unipher cache handling updates from Masahiro Yamada

    - initrd and Thumb Kconfig cleanups

    * 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm: (23 commits)
    ARM: mm: round the initrd reservation to page boundaries
    ARM: mm: clean up initrd initialisation
    ARM: mm: move initrd init code out of arm_memblock_init()
    ARM: 8655/1: improve NOMMU definition of pgprot_*()
    ARM: 8654/1: decompressor: add strlen prototype
    ARM: 8652/1: cache-uniphier: clean up active way setup code
    ARM: 8651/1: cache-uniphier: include instead of
    ARM: 8650/1: module: handle negative R_ARM_PREL31 addends correctly
    ARM: 8649/2: nommu: remove Hivecs configuration is asm
    ARM: 8648/2: nommu: display vectors base
    ARM: 8647/2: nommu: dynamic exception base address setting
    ARM: 8646/1: mmu: decouple VECTORS_BASE from Kconfig
    ARM: 8644/1: Reduce "CPU: shutdown" message to debug level
    ARM: 8641/1: treewide: Replace uses of virt_to_phys with __pa_symbol
    ARM: 8640/1: Add support for CONFIG_DEBUG_VIRTUAL
    ARM: 8639/1: Define KERNEL_START and KERNEL_END
    ARM: 8638/1: mtd: lart: Rename partition defines to be prefixed with PART_
    ARM: 8637/1: Adjust memory boundaries after reservations
    ARM: 8636/1: Cleanup sanity_check_meminfo
    ARM: add CPU_THUMB_CAPABLE to indicate possible Thumb support
    ...

    Linus Torvalds
     

28 Feb, 2017

1 commit


22 Feb, 2017

1 commit

  • Pull block layer updates from Jens Axboe:

    - blk-mq scheduling framework from me and Omar, with a port of the
    deadline scheduler for this framework. A port of BFQ from Paolo is in
    the works, and should be ready for 4.12.

    - Various fixups and improvements to the above scheduling framework
    from Omar, Paolo, Bart, me, others.

    - Cleanup of the exported sysfs blk-mq data into debugfs, from Omar.
    This allows us to export more information that helps debug hangs or
    performance issues, without cluttering or abusing the sysfs API.

    - Fixes for the sbitmap code, the scalable bitmap code that was
    migrated from blk-mq, from Omar.

    - Removal of the BLOCK_PC support in struct request, and refactoring of
    carrying SCSI payloads in the block layer. This cleans up the code
    nicely, and enables us to kill the SCSI specific parts of struct
    request, shrinking it down nicely. From Christoph mainly, with help
    from Hannes.

    - Support for ranged discard requests and discard merging, also from
    Christoph.

    - Support for OPAL in the block layer, and for NVMe as well. Mainly
    from Scott Bauer, with fixes/updates from various others folks.

    - Error code fixup for gdrom from Christophe.

    - cciss pci irq allocation cleanup from Christoph.

    - Making the cdrom device operations read only, from Kees Cook.

    - Fixes for duplicate bdi registrations and bdi/queue life time
    problems from Jan and Dan.

    - Set of fixes and updates for lightnvm, from Matias and Javier.

    - A few fixes for nbd from Josef, using idr to name devices and a
    workqueue deadlock fix on receive. Also marks Josef as the current
    maintainer of nbd.

    - Fix from Josef, overwriting queue settings when the number of
    hardware queues is updated for a blk-mq device.

    - NVMe fix from Keith, ensuring that we don't repeatedly mark and IO
    aborted, if we didn't end up aborting it.

    - SG gap merging fix from Ming Lei for block.

    - Loop fix also from Ming, fixing a race and crash between setting loop
    status and IO.

    - Two block race fixes from Tahsin, fixing request list iteration and
    fixing a race between device registration and udev device add
    notifiations.

    - Double free fix from cgroup writeback, from Tejun.

    - Another double free fix in blkcg, from Hou Tao.

    - Partition overflow fix for EFI from Alden Tondettar.

    * tag 'for-4.11/linus-merge-signed' of git://git.kernel.dk/linux-block: (156 commits)
    nvme: Check for Security send/recv support before issuing commands.
    block/sed-opal: allocate struct opal_dev dynamically
    block/sed-opal: tone down not supported warnings
    block: don't defer flushes on blk-mq + scheduling
    blk-mq-sched: ask scheduler for work, if we failed dispatching leftovers
    blk-mq: don't special case flush inserts for blk-mq-sched
    blk-mq-sched: don't add flushes to the head of requeue queue
    blk-mq: have blk_mq_dispatch_rq_list() return if we queued IO or not
    block: do not allow updates through sysfs until registration completes
    lightnvm: set default lun range when no luns are specified
    lightnvm: fix off-by-one error on target initialization
    Maintainers: Modify SED list from nvme to block
    Move stack parameters for sed_ioctl to prevent oversized stack with CONFIG_KASAN
    uapi: sed-opal fix IOW for activate lsp to use correct struct
    cdrom: Make device operations read-only
    elevator: fix loading wrong elevator type for blk-mq devices
    cciss: switch to pci_irq_alloc_vectors
    block/loop: fix race between I/O and set_status
    blk-mq-sched: don't hold queue_lock when calling exit_icq
    block: set make_request_fn manually in blk_mq_update_nr_hw_queues
    ...

    Linus Torvalds
     

11 Feb, 2017

3 commits

  • There is a error message within devm_ioremap_resource
    already, so remove the dev_err call to avoid redundant
    error message.

    Signed-off-by: Wei Yongjun
    Reviewed-by: Marek Vasut
    Signed-off-by: Brian Norris

    Wei Yongjun
     
  • From Cyrille:

    """
    This pull request contains the following notable changes:
    - add support to the 4-byte address instruction set.
    - add support to new memory parts.
    - add support to S3AN memories.
    - add support to the Intel SPI controller.
    - add support to the Aspeed AST2400 and AST2550 controllers.
    - fix max SPI transfer and message sizes in m25p80_read().
    - fix the Candence QSPI driver.
    - fix the Freescale QSPI driver.
    """

    Brian Norris
     
  • physmap_of sort of depends on the gemini and versatile modules (when
    they're enabled), but this isn't expressed in Kconfig. Let's just merge
    the modules all together, when enabled. Then we can avoid exporting a
    few symbols, and the versatile and gemini code can now be modular again
    (the below commit accidentally made them built-in only).

    Resolves errors like this:

    ERROR: "of_flash_probe_versatile" [drivers/mtd/maps/physmap_of.ko] undefined!
    ERROR: "of_flash_probe_gemini" [drivers/mtd/maps/physmap_of.ko] undefined!

    Fixes: 56ff337ea433 ("mtd: physmap_of: add a hook for Gemini flash probing")
    Cc: Linus Walleij
    Signed-off-by: Brian Norris
    Reviewed-by: Linus Walleij

    Brian Norris
     

10 Feb, 2017

20 commits

  • Checking for ret < 0 is redundant because a previous check on ret
    being non-zero already handles the ret < 0 case. Remove the redundant
    code. Found by CoverityScan, CID#1398863, CID#1398864

    Signed-off-by: Colin Ian King
    Reviewed-by: Richard Weinberger
    Acked-by: Marek Vasut
    Signed-off-by: Cyrille Pitchen

    Colin Ian King
     
  • There are some read modes for flash, such as NORMAL, FAST,
    QUAD, DDR QUAD. These modes will use the identical lut table base
    So rename SEQID_QUAD_READ to SEQID_READ.

    Signed-off-by: Yunhui Cui
    Signed-off-by: Yunhui Cui
    Acked-by: Han xu
    Signed-off-by: Cyrille Pitchen

    Yunhui Cui
     
  • We can get the read/write/erase opcode from the spi nor framework
    directly. This patch uses the information stored in the SPI-NOR to
    remove the hardcode in the fsl_qspi_init_lut().

    Signed-off-by: Yunhui Cui
    Signed-off-by: Yunhui Cui
    Acked-by: Han xu
    Signed-off-by: Cyrille Pitchen

    Yunhui Cui
     
  • Add GigaDevice GD25Q16 (16M-bit) to supported list.

    Signed-off-by: Kamal Dasu
    Acked-by: Marek Vasut
    Signed-off-by: Cyrille Pitchen

    Kamal Dasu
     
  • The page calculation under spi_nor_s3an_addr_convert() was wrong. On
    Default Address Mode we need to perform a divide by page_size.

    Signed-off-by: Ricardo Ribalda Delgado
    Acked-by: Marek Vasut
    Signed-off-by: Cyrille Pitchen

    Ricardo Ribalda
     
  • The first argument of ioread32_rep() and ioread8_rep is not
    const. Change aspeed_smc_read_from_ahb() prototype to fix compile
    warning :

    drivers/mtd/spi-nor/aspeed-smc.c: In function 'aspeed_smc_read_from_ahb':
    drivers/mtd/spi-nor/aspeed-smc.c:212:16: warning: passing argument 1 of 'ioread32_rep' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
    ioread32_rep(src, buf, len >> 2);

    Signed-off-by: Cédric Le Goater
    Reviewed-by: Marek Vasut
    Signed-off-by: Cyrille Pitchen

    Cédric Le Goater
     
  • The MR25 family doesn't support JEDEC, so they need explicit mentioning
    in the list of supported spi IDs. This makes it possible to add these
    using for example:

    compatible = "everspin,mr25h40";

    There was already an entry for mr25h256. Move that one out of the "keep
    for compatibility" section and put in a new group for Everspin MRAMs.

    Signed-off-by: Uwe Kleine-König
    Acked-by: Rob Herring
    Signed-off-by: Cyrille Pitchen

    Uwe Kleine-König
     
  • From Lee Jones:

    """
    Immutable branch between MFD and MTD due for the v4.11 merge window
    """

    Cyrille Pitchen
     
  • This chip has write protection enabled on power-up,
    so this flag is necessary to support write operations.

    Signed-off-by: Victor Shyba
    Acked-by: Marek Vasut
    Signed-off-by: Cyrille Pitchen

    Victor Shyba
     
  • This patch provides an alternative mean to support memory above 16MiB
    (128Mib) by replacing 3byte address op codes by their associated 4byte
    address versions.

    Using the dedicated 4byte address op codes doesn't change the internal
    state of the SPI NOR memory as opposed to using other means such as
    updating a Base Address Register (BAR) and sending command to enter/leave
    the 4byte mode.

    Hence when a CPU reset occurs, early bootloaders don't need to be aware
    of BAR value or 4byte mode being enabled: they can still access the first
    16MiB of the SPI NOR memory using the regular 3byte address op codes.

    Signed-off-by: Cyrille Pitchen
    Tested-by: Vignesh R
    Acked-by: Marek Vasut

    Cyrille Pitchen
     
  • This patch renames the SPINOR_OP_* macros of the 4-byte address
    instruction set so the new names all share a common pattern: the 4-byte
    address name is built from the 3-byte address name appending the "_4B"
    suffix.

    The patch also introduces new op codes to support other SPI protocols such
    as SPI 1-4-4 and SPI 1-2-2.

    This is a transitional patch and will help a later patch of spi-nor.c
    to automate the translation from the 3-byte address op codes into their
    4-byte address version.

    Signed-off-by: Cyrille Pitchen
    Acked-by: Mark Brown
    Acked-by: Marek Vasut

    Cyrille Pitchen
     
  • Consider a message size limit when calculating the maximum amount
    of data that can be read.

    The message size limit has been introduced with 4.9, so cc it
    to stable.

    Signed-off-by: Heiner Kallweit
    Signed-off-by: Cyrille Pitchen

    Heiner Kallweit
     
  • This driver adds mtd support for the Aspeed AST2400 SoC static memory
    controllers:

    * New Static Memory Controller (referred as FMC)
    . BMC firmware
    . AST2500 compatible register set
    . 5 chip select pins (CE0 ∼ CE4)
    . supports NOR flash, NAND flash and SPI flash memory.

    * SPI Flash Controller (SPI)
    . host Firmware
    . slightly different register set, between AST2500 and the legacy
    controller
    . supports SPI flash memory
    . 1 chip select pin (CE0)

    The legacy static memory controller (referred as SMC) is not
    supported, as well as types other than SPI.

    Signed-off-by: Cédric Le Goater
    Reviewed-by: Joel Stanley
    Signed-off-by: Cyrille Pitchen

    Cédric Le Goater
     
  • This driver adds mtd support for the Aspeed AST2500 SoC static memory
    controllers :

    * Firmware SPI Memory Controller (FMC)
    . BMC firmware
    . 3 chip select pins (CE0 ~ CE2)
    . supports SPI type flash memory (CE0-CE1)
    . CE2 can be of NOR type flash but this is not supported by the
    driver

    * SPI Flash Controller (SPI1 and SPI2)
    . host firmware
    . 2 chip select pins (CE0 ~ CE1)
    . supports SPI type flash memory

    Each controller has a memory range on which it maps its flash module
    slaves. Each slave is assigned a memory window for its mapping that
    can be changed at bootime with the Segment Address Register.

    Each SPI flash slave can then be accessed in two modes: Command and
    User. When in User mode, accesses to the memory segment of the slaves
    are translated in SPI transfers. When in Command mode, the HW
    generates the SPI commands automatically and the memory segment is
    accessed as if doing a MMIO.

    Currently, only the User mode is supported. Command mode needs a
    little more work to check that the memory window on the AHB bus fits
    the module size.

    Based on previous work from Milton D. Miller II

    Signed-off-by: Cédric Le Goater
    Reviewed-by: Joel Stanley
    Reviewed-by: Marek Vasut
    Signed-off-by: Cyrille Pitchen

    Cédric Le Goater
     
  • This patch removes the WARN_ONCE() test in spi_nor_write().
    This macro triggers the display of a warning message almost every time we
    use a UBI file-system because a write operation is performed at offset 64,
    which is in the middle of the SPI NOR memory page. This is a valid
    operation for ubifs.

    Hence this warning is pretty annoying and useless so we just remove it.

    Signed-off-by: Cyrille Pitchen
    Suggested-by: Richard Weinberger
    Suggested-by: Andras Szemzo
    Acked-by: Boris Brezillon

    Cyrille Pitchen
     
  • The patch checks whether the Quad Enable bit is already set in the Status
    Register. If so, the function exits immediately with a successful return
    code.

    Signed-off-by: Cyrille Pitchen
    Reviewed-by: Jagan Teki
    Acked-by: Marek Vasut

    Cyrille Pitchen
     
  • Xilinx Spartan-3AN FPGAs contain an In-System Flash where they keep
    their configuration data and (optionally) some user data.

    The protocol of this flash follows most of the spi-nor standard. With
    the following differences:

    - Page size might not be a power of two.
    - The address calculation (default addressing mode).
    - The spi nor commands used.

    Protocol is described on Xilinx User Guide UG333

    Signed-off-by: Ricardo Ribalda Delgado
    Cc: Boris Brezillon
    Cc: Brian Norris
    Cc: Marek Vasut
    Reviewed-by: Marek Vasut
    Signed-off-by: Cyrille Pitchen

    Ricardo Ribalda
     
  • The user visible change here is that mtd partitions get an of_node link
    in sysfs.

    Signed-off-by: Sascha Hauer
    Signed-off-by: Uwe Kleine-König
    Signed-off-by: Brian Norris

    Sascha Hauer
     
  • Some devices may have an extra TRX partition used as failsafe one. If
    we detect such partition we should set a proper name for it and don't
    parse it.

    Signed-off-by: Rafał Miłecki
    Acked-by: Marek Vasut
    Signed-off-by: Brian Norris

    Rafał Miłecki
     
  • This change simplifies main parsing loop logic a bit. In future it may
    be useful for moving TRX support to separated module / parser (if we
    implement support for them at some point).
    Finally parsing TRX at the end puts us in a better position as we have
    better flash layout knowledge. It may be useful e.g. if it appears there
    is more than 1 TRX partition.

    Signed-off-by: Rafał Miłecki
    Acked-by: Marek Vasut
    Signed-off-by: Brian Norris

    Rafał Miłecki
     

09 Feb, 2017

2 commits

  • For reading flash content we use MMIO but it's possible to read only
    first 16 MiB this way. It's simply an arch design/limitation.
    To support flash sizes bigger than 16 MiB implement indirect access
    using ChipCommon registers.
    This has been tested using MX25L25635F.

    Signed-off-by: Rafał Miłecki
    Acked-by: Marek Vasut
    Signed-off-by: Brian Norris

    Rafał Miłecki
     
  • From Boris:

    """
    This pull request contains minor fixes/improvements on existing drivers:
    - sunxi: avoid busy-waiting for NAND events
    - ifc: fix ECC handling on IFC v1.0
    - OX820: add explicit dependency on ARCH_OXNAS in Kconfig
    - core: add a new manufacture ID and fix a kernel-doc warning
    - fsmc: kill pdata support
    - lpc32xx_slc: remove unneeded NULL check
    """

    Conflicts:
    include/linux/mtd/nand.h
    [Brian: trivial conflict in the comment section]

    Brian Norris