1. 24 Mar, 2020 7 commits
  2. 22 Mar, 2020 1 commit
  3. 21 Mar, 2020 4 commits
  4. 20 Mar, 2020 1 commit
    • Kevin Hao's avatar
      i2c: dev: Fix the race between the release of i2c_dev and cdev · 1413ef63
      Kevin Hao authored
      The struct cdev is embedded in the struct i2c_dev. In the current code,
      we would free the i2c_dev struct directly in put_i2c_dev(), but the
      cdev is manged by a kobject, and the release of it is not predictable.
      So it is very possible that the i2c_dev is freed before the cdev is
      entirely released. We can easily get the following call trace with
      CONFIG_DEBUG_KOBJECT_RELEASE and CONFIG_DEBUG_OBJECTS_TIMERS enabled.
        ODEBUG: free active (active state 0) object type: timer_list hint: delayed_work_timer_fn+0x0/0x38
        WARNING: CPU: 19 PID: 1 at lib/debugobjects.c:325 debug_print_object+0xb0/0xf0
        Modules linked in:
        CPU: 19 PID: 1 Comm: swapper/0 Tainted: G        W         5.2.20-yocto-standard+ #120
        Hardware name: Marvell OcteonTX CN96XX board (DT)
        pstate: 80c00089 (Nzcv daIf +PAN +UAO)
        pc : debug_print_object+0xb0/0xf0
        lr : debug_print_object+0xb0/0xf0
        sp : ffff00001292f7d0
        x29: ffff00001292f7d0 x28: ffff800b82151788
        x27: 0000000000000001 x26: ffff800b892c0000
        x25: ffff0000124a2558 x24: 0000000000000000
        x23: ffff00001107a1d8 x22: ffff0000116b5088
        x21: ffff800bdc6afca8 x20: ffff000012471ae8
        x19: ffff00001168f2c8 x18: 0000000000000010
        x17: 00000000fd6f304b x16: 00000000ee79de43
        x15: ffff800bc0e80568 x14: 79616c6564203a74
        x13: 6e6968207473696c x12: 5f72656d6974203a
        x11: ffff0000113f0018 x10: 0000000000000000
        x9 : 000000000000001f x8 : 0000000000000000
        x7 : ffff0000101294cc x6 : 0000000000000000
        x5 : 0000000000000000 x4 : 0000000000000001
        x3 : 00000000ffffffff x2 : 0000000000000000
        x1 : 387fc15c8ec0f200 x0 : 0000000000000000
        Call trace:
         debug_print_object+0xb0/0xf0
         __debug_check_no_obj_freed+0x19c/0x228
         debug_check_no_obj_freed+0x1c/0x28
         kfree+0x250/0x440
         put_i2c_dev+0x68/0x78
         i2cdev_detach_adapter+0x60/0xc8
         i2cdev_notifier_call+0x3c/0x70
         notifier_call_chain+0x8c/0xe8
         blocking_notifier_call_chain+0x64/0x88
         device_del+0x74/0x380
         device_unregister+0x54/0x78
         i2c_del_adapter+0x278/0x2d0
         unittest_i2c_bus_remove+0x3c/0x80
         platform_drv_remove+0x30/0x50
         device_release_driver_internal+0xf4/0x1c0
         driver_detach+0x58/0xa0
         bus_remove_driver+0x84/0xd8
         driver_unregister+0x34/0x60
         platform_driver_unregister+0x20/0x30
         of_unittest_overlay+0x8d4/0xbe0
         of_unittest+0xae8/0xb3c
         do_one_initcall+0xac/0x450
         do_initcall_level+0x208/0x224
         kernel_init_freeable+0x2d8/0x36c
         kernel_init+0x18/0x108
         ret_from_fork+0x10/0x1c
        irq event stamp: 3934661
        hardirqs last  enabled at (3934661): [<ffff00001009fa04>] debug_exception_exit+0x4c/0x58
        hardirqs last disabled at (3934660): [<ffff00001009fb14>] debug_exception_enter+0xa4/0xe0
        softirqs last  enabled at (3934654): [<ffff000010081d94>] __do_softirq+0x46c/0x628
        softirqs last disabled at (3934649): [<ffff0000100b4a1c>] irq_exit+0x104/0x118
      
      This is a common issue when using cdev embedded in a struct.
      Fortunately, we already have a mechanism to solve this kind of issue.
      Please see commit 233ed09d ("chardev: add helper function to
      register char devs with a struct device") for more detail.
      
      In this patch, we choose to embed the struct device into the i2c_dev,
      and use the API provided by the commit 233ed09d to make sure that
      the release of i2c_dev and cdev are in sequence.
      Signed-off-by: default avatarKevin Hao <haokexin@gmail.com>
      Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
      1413ef63
  5. 13 Mar, 2020 4 commits
  6. 10 Mar, 2020 10 commits
  7. 26 Feb, 2020 5 commits
  8. 24 Feb, 2020 1 commit
  9. 23 Feb, 2020 7 commits
    • Linus Torvalds's avatar
      Merge tag 'for-5.6-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux · d2eee258
      Linus Torvalds authored
      Pull btrfs fixes from David Sterba:
       "These are fixes that were found during testing with help of error
        injection, plus some other stable material.
      
        There's a fixup to patch added to rc1 causing locking in wrong context
        warnings, tests found one more deadlock scenario. The patches are
        tagged for stable, two of them now in the queue but we'd like all
        three released at the same time.
      
        I'm not happy about fixes to fixes in such a fast succession during
        rcs, but I hope we found all the fallouts of commit 28553fa9
        ('Btrfs: fix race between shrinking truncate and fiemap')"
      
      * tag 'for-5.6-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
        Btrfs: fix deadlock during fast fsync when logging prealloc extents beyond eof
        Btrfs: fix btrfs_wait_ordered_range() so that it waits for all ordered extents
        btrfs: fix bytes_may_use underflow in prealloc error condtition
        btrfs: handle logged extent failure properly
        btrfs: do not check delayed items are empty for single transaction cleanup
        btrfs: reset fs_root to NULL on error in open_ctree
        btrfs: destroy qgroup extent records on transaction abort
      d2eee258
    • Linus Torvalds's avatar
      Merge tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 · a3163ca0
      Linus Torvalds authored
      Pull ext4 fixes from Ted Ts'o:
       "More miscellaneous ext4 bug fixes (all stable fodder)"
      
      * tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
        ext4: fix mount failure with quota configured as module
        jbd2: fix ocfs2 corrupt when clearing block group bits
        ext4: fix race between writepages and enabling EXT4_EXTENTS_FL
        ext4: rename s_journal_flag_rwsem to s_writepages_rwsem
        ext4: fix potential race between s_flex_groups online resizing and access
        ext4: fix potential race between s_group_info online resizing and access
        ext4: fix potential race between online resizing and write operations
        ext4: add cond_resched() to __ext4_find_entry()
        ext4: fix a data race in EXT4_I(inode)->i_disksize
      a3163ca0
    • Linus Torvalds's avatar
      Merge tag 'csky-for-linus-5.6-rc3' of git://github.com/c-sky/csky-linux · c6188dff
      Linus Torvalds authored
      Pull csky updates from Guo Ren:
       "Sorry, I missed 5.6-rc1 merge window, but in this pull request the
        most are the fixes and the rests are between fixes and features. The
        only outside modification is the MAINTAINERS file update with our
        mailing list.
      
         - cache flush implementation fixes
      
         - ftrace modify panic fix
      
         - CONFIG_SMP boot problem fix
      
         - fix pt_regs saving for atomic.S
      
         - fix fixaddr_init without highmem.
      
         - fix stack protector support
      
         - fix fake Tightly-Coupled Memory code compile and use
      
         - fix some typos and coding convention"
      
      * tag 'csky-for-linus-5.6-rc3' of git://github.com/c-sky/csky-linux: (23 commits)
        csky: Replace <linux/clk-provider.h> by <linux/of_clk.h>
        csky: Implement copy_thread_tls
        csky: Add PCI support
        csky: Minimize defconfig to support buildroot config.fragment
        csky: Add setup_initrd check code
        csky: Cleanup old Kconfig options
        arch/csky: fix some Kconfig typos
        csky: Fixup compile warning for three unimplemented syscalls
        csky: Remove unused cache implementation
        csky: Fixup ftrace modify panic
        csky: Add flush_icache_mm to defer flush icache all
        csky: Optimize abiv2 copy_to_user_page with VM_EXEC
        csky: Enable defer flush_dcache_page for abiv2 cpus (807/810/860)
        csky: Remove unnecessary flush_icache_* implementation
        csky: Support icache flush without specific instructions
        csky/Kconfig: Add Kconfig.platforms to support some drivers
        csky/smp: Fixup boot failed when CONFIG_SMP
        csky: Set regs->usp to kernel sp, when the exception is from kernel
        csky/mm: Fixup export invalid_pte_table symbol
        csky: Separate fixaddr_init from highmem
        ...
      c6188dff
    • Geert Uytterhoeven's avatar
      csky: Replace <linux/clk-provider.h> by <linux/of_clk.h> · 99db590b
      Geert Uytterhoeven authored
      The C-Sky platform code is not a clock provider, and just needs to call
      of_clk_init().
      
      Hence it can include <linux/of_clk.h> instead of <linux/clk-provider.h>.
      Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      99db590b
    • Linus Torvalds's avatar
      Merge tag 'ras-urgent-2020-02-22' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · dca132a6
      Linus Torvalds authored
      Pull RAS fixes from Thomas Gleixner:
       "Two fixes for the AMD MCE driver:
      
         - Populate the per CPU MCA bank descriptor pointer only after it has
           been completely set up to prevent a use-after-free in case that one
           of the subsequent initialization step fails
      
         - Implement a proper release function for the sysfs entries of MCA
           threshold controls instead of freeing the memory right in the CPU
           teardown code, which leads to another use-after-free when the
           associated sysfs file is opened and accessed"
      
      * tag 'ras-urgent-2020-02-22' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/mce/amd: Fix kobject lifetime
        x86/mce/amd: Publish the bank pointer only after setup has succeeded
      dca132a6
    • Linus Torvalds's avatar
      Merge tag 'irq-urgent-2020-02-22' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · f3cc2494
      Linus Torvalds authored
      Pull irq fixes from Thomas Gleixner:
       "Two fixes for the irq core code which are follow ups to the recent MSI
        fixes:
      
         - The WARN_ON which was put into the MSI setaffinity callback for
           paranoia reasons actually triggered via a callchain which escaped
           when all the possible ways to reach that code were analyzed.
      
           The proc/irq/$N/*affinity interfaces have a quirk which came in
           when ALPHA moved to the generic interface: In case that the written
           affinity mask does not contain any online CPU it calls into ALPHAs
           magic auto affinity setting code.
      
           A few years later this mechanism was also made available to x86 for
           no good reasons and in a way which circumvents all sanity checks
           for interrupts which cannot have their affinity set from process
           context on X86 due to the way the X86 interrupt delivery works.
      
           It would be possible to make this work properly, but there is no
           point in doing so. If the interrupt is not yet started then the
           affinity setting has no effect and if it is started already then it
           is already assigned to an online CPU so there is no point to
           randomly move it to some other CPU. Just return EINVAL as the code
           has done before that change forever.
      
         - The new MSI quirk bit in the irq domain flags turned out to be
           already occupied, which escaped the author and the reviewers
           because the already in use bits were 0,6,2,3,4,5 listed in that
           order.
      
           That bit 6 was simply overlooked because the ordering was straight
           forward linear otherwise. So the new bit ended up being a
           duplicate.
      
           Fix it up by switching the oddball 6 to the obvious 1"
      
      * tag 'irq-urgent-2020-02-22' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        genirq/irqdomain: Make sure all irq domain flags are distinct
        genirq/proc: Reject invalid affinity masks (again)
      f3cc2494
    • Linus Torvalds's avatar
      Merge tag 'x86-urgent-2020-02-22' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · fca10378
      Linus Torvalds authored
      Pull x86 fixes from Thomas Gleixner:
       "Two fixes for x86:
      
         - Remove the __force_oder definiton from the kaslr boot code as it is
           already defined in the page table code which makes GCC 10 builds
           fail because it changed the default to -fno-common.
      
         - Address the AMD erratum 1054 concerning the IRPERF capability and
           enable the Instructions Retired fixed counter on machines which are
           not affected by the erratum"
      
      * tag 'x86-urgent-2020-02-22' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/cpu/amd: Enable the fixed Instructions Retired counter IRPERF
        x86/boot/compressed: Don't declare __force_order in kaslr_64.c
      fca10378