1. 22 Jun, 2017 6 commits
    • Rafał Miłecki's avatar
      mtd: extract TRX parser out of bcm47xxpart into a separated module · 99352afe
      Rafał Miłecki authored
      This makes TRX parsing code reusable with other platforms and parsers.
      
      Please note this patch doesn't really change anything in the existing
      code, just moves it. There is still some place for improvement (e.g.
      working on non-hacky method of checking rootfs format) but it's not
      really a subject of this change.
      Signed-off-by: default avatarRafał Miłecki <rafal@milecki.pl>
      Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
      99352afe
    • Rafał Miłecki's avatar
      mtd: partitions: add support for partition parsers · 1a0915be
      Rafał Miłecki authored
      Some devices have partitions that are kind of containers with extra
      subpartitions / volumes instead of e.g. a simple filesystem data. To
      support such cases we need to first create normal flash device
      partitions and then take care of these special ones.
      
      It's very common case for home routers. Depending on the vendor there
      are formats like TRX, Seama, TP-Link, WRGG & more. All of them are used
      to embed few partitions into a single one / single firmware file.
      
      Ideally all vendors would use some well documented / standardized format
      like UBI (and some probably start doing so), but there are still
      countless devices on the market using these poor vendor specific
      formats.
      
      This patch extends MTD subsystem by allowing to specify list of parsers
      that should be tried for a given partition. Supporting such poor formats
      is highly unlikely to be the top priority so these changes try to
      minimize maintenance cost to the minimum. It reuses existing code for
      these new parsers and just adds a one property and one new function.
      
      This implementation requires setting partition parsers in a flash
      parser. A proper change of bcm47xxpart will follow and in the future we
      will hopefully also find a solution for doing it with ofpart
      ("fixed-partitions").
      Signed-off-by: default avatarRafał Miłecki <rafal@milecki.pl>
      Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
      1a0915be
    • Rafał Miłecki's avatar
      mtd: partitions: add support for subpartitions · 97519dc5
      Rafał Miłecki authored
      Some flash device partitions can be containers with extra subpartitions
      (volumes). All callbacks are already capable of this additional level of
      indirection.
      
      This patch makes sure we always display subpartitions using a tree
      structure and takes care of deleting subpartitions when parent gets
      removed.
      Signed-off-by: default avatarRafał Miłecki <rafal@milecki.pl>
      Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
      97519dc5
    • Rafał Miłecki's avatar
      mtd: partitions: rename "master" to the "parent" where appropriate · 0a9d72b6
      Rafał Miłecki authored
      This prepares mtd subsystem for the new feature: subpartitions. In some
      cases flash device partition can be a container with extra subpartitions
      (volumes).
      
      So far there was a flat structure implemented. One master (flash device)
      could be partitioned into few partitions. Every partition got its master
      and it was enough to get things running.
      
      To support subpartitions we need to store pointer to the parent for each
      partition. This is required to implement more natural tree structure and
      handle all recursion and offsets calculation.
      
      To make code consistent this patch renamed "master" to the "parent" in
      places where we can be dealing with subpartitions.
      Signed-off-by: default avatarRafał Miłecki <rafal@milecki.pl>
      Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
      0a9d72b6
    • Rafał Miłecki's avatar
      mtd: partitions: remove sysfs files when deleting all master's partitions · c5ceaba7
      Rafał Miłecki authored
      When support for sysfs "offset" file was added it missed to update the
      del_mtd_partitions function. It deletes partitions just like
      mtd_del_partition does so both should also take care of removing sysfs
      files.
      
      This change moves sysfs_remove_files call to the shared function to fix
      this issue.
      
      Fixes: a62c24d7 ("mtd: part: Add sysfs variable for offset of partition")
      Cc: Dan Ehrenberg <dehrenberg@chromium.org>
      Signed-off-by: default avatarRafał Miłecki <rafal@milecki.pl>
      Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
      c5ceaba7
    • Rafał Miłecki's avatar
      mtd: partitions: add helper for deleting partition · 08263a9a
      Rafał Miłecki authored
      There are two similar functions handling deletion. One handles single
      partition and another the whole MTD flash device. They share (duplicate)
      some code so it makes sense to add a small helper for that part.
      
      Function del_mtd_partitions has been moved a bit to keep all deleting
      stuff together.
      Signed-off-by: default avatarRafał Miłecki <rafal@milecki.pl>
      Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
      08263a9a
  2. 20 Jun, 2017 2 commits
  3. 13 Jun, 2017 1 commit
  4. 08 Jun, 2017 3 commits
  5. 01 Jun, 2017 4 commits
  6. 22 May, 2017 9 commits
  7. 21 May, 2017 7 commits
    • Linus Torvalds's avatar
      Clean up x86 unsafe_get/put_user() type handling · 334a023e
      Linus Torvalds authored
      Al noticed that unsafe_put_user() had type problems, and fixed them in
      commit a7cc722f ("fix unsafe_put_user()"), which made me look more
      at those functions.
      
      It turns out that unsafe_get_user() had a type issue too: it limited the
      largest size of the type it could handle to "unsigned long".  Which is
      fine with the current users, but doesn't match our existing normal
      get_user() semantics, which can also handle "u64" even when that does
      not fit in a long.
      
      While at it, also clean up the type cast in unsafe_put_user().  We
      actually want to just make it an assignment to the expected type of the
      pointer, because we actually do want warnings from types that don't
      convert silently.  And it makes the code more readable by not having
      that one very long and complex line.
      
      [ This patch might become stable material if we ever end up back-porting
        any new users of the unsafe uaccess code, but as things stand now this
        doesn't matter for any current existing uses. ]
      
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      334a023e
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · f3926e4c
      Linus Torvalds authored
      Pull misc uaccess fixes from Al Viro:
       "Fix for unsafe_put_user() (no callers currently in mainline, but
        anyone starting to use it will step into that) + alpha osf_wait4()
        infoleak fix"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        osf_wait4(): fix infoleak
        fix unsafe_put_user()
      f3926e4c
    • Linus Torvalds's avatar
      Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 970c305a
      Linus Torvalds authored
      Pull scheduler fix from Thomas Gleixner:
       "A single scheduler fix:
      
        Prevent idle task from ever being preempted. That makes sure that
        synchronize_rcu_tasks() which is ignoring idle task does not pretend
        that no task is stuck in preempted state. If that happens and idle was
        preempted on a ftrace trampoline the machine crashes due to
        inconsistent state"
      
      * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        sched/core: Call __schedule() from do_idle() without enabling preemption
      970c305a
    • Linus Torvalds's avatar
      Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · e7a3d627
      Linus Torvalds authored
      Pull irq fixes from Thomas Gleixner:
       "A set of small fixes for the irq subsystem:
      
         - Cure a data ordering problem with chained interrupts
      
         - Three small fixlets for the mbigen irq chip"
      
      * 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        genirq: Fix chained interrupt data ordering
        irqchip/mbigen: Fix the clear register offset calculation
        irqchip/mbigen: Fix potential NULL dereferencing
        irqchip/mbigen: Fix memory mapping code
      e7a3d627
    • Al Viro's avatar
      osf_wait4(): fix infoleak · a8c39544
      Al Viro authored
      failing sys_wait4() won't fill struct rusage...
      
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      a8c39544
    • Al Viro's avatar
      fix unsafe_put_user() · a7cc722f
      Al Viro authored
      __put_user_size() relies upon its first argument having the same type as what
      the second one points to; the only other user makes sure of that and
      unsafe_put_user() should do the same.
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      a7cc722f
    • Linus Torvalds's avatar
      Merge tag 'trace-v4.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace · 56f410cf
      Linus Torvalds authored
      Pull tracing fixes from Steven Rostedt:
      
       - Fix a bug caused by not cleaning up the new instance unique triggers
         when deleting an instance. It also creates a selftest that triggers
         that bug.
      
       - Fix the delayed optimization happening after kprobes boot up self
         tests being removed by freeing of init memory.
      
       - Comment kprobes on why the delay optimization is not a problem for
         removal of modules, to keep other developers from searching that
         riddle.
      
       - Fix another case of rcu not watching in stack trace tracing.
      
      * tag 'trace-v4.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
        tracing: Make sure RCU is watching before calling a stack trace
        kprobes: Document how optimized kprobes are removed from module unload
        selftests/ftrace: Add test to remove instance with active event triggers
        selftests/ftrace: Fix bashisms
        ftrace: Remove #ifdef from code and add clear_ftrace_function_probes() stub
        ftrace/instances: Clear function triggers when removing instances
        ftrace: Simplify glob handling in unregister_ftrace_function_probe_func()
        tracing/kprobes: Enforce kprobes teardown after testing
        tracing: Move postpone selftests to core from early_initcall
      56f410cf
  8. 20 May, 2017 8 commits