1. 22 Mar, 2019 16 commits
  2. 21 Mar, 2019 14 commits
  3. 20 Mar, 2019 4 commits
  4. 19 Mar, 2019 6 commits
    • Jiada Wang's avatar
      PM / Domains: Avoid a potential deadlock · 2071ac98
      Jiada Wang authored
      Lockdep warns that prepare_lock and genpd->mlock can cause a deadlock
      the deadlock scenario is like following:
      First thread is probing cs2000
      cs2000_probe()
        clk_register()
          __clk_core_init()
            clk_prepare_lock()                            ----> acquires prepare_lock
              cs2000_recalc_rate()
                i2c_smbus_read_byte_data()
                  rcar_i2c_master_xfer()
                    dma_request_chan()
                      rcar_dmac_of_xlate()
                        rcar_dmac_alloc_chan_resources()
                          pm_runtime_get_sync()
                            __pm_runtime_resume()
                              rpm_resume()
                                rpm_callback()
                                  genpd_runtime_resume()   ----> acquires genpd->mlock
      
      Second thread is attaching any device to the same PM domain
      genpd_add_device()
        genpd_lock()                                       ----> acquires genpd->mlock
          cpg_mssr_attach_dev()
            of_clk_get_from_provider()
              __of_clk_get_from_provider()
                __clk_create_clk()
                  clk_prepare_lock()                       ----> acquires prepare_lock
      
      Since currently no PM provider access genpd's critical section
      in .attach_dev, and .detach_dev callbacks, so there is no need to protect
      these two callbacks with genpd->mlock.
      This patch avoids a potential deadlock by moving out .attach_dev and .detach_dev
      from genpd->mlock, so that genpd->mlock won't be held when prepare_lock is acquired
      in .attach_dev and .detach_dev
      Signed-off-by: default avatarJiada Wang <jiada_wang@mentor.com>
      Reviewed-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
      Tested-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      2071ac98
    • Andy Shevchenko's avatar
      ACPI / utils: Drop reference in test for device presence · 54e3aca8
      Andy Shevchenko authored
      When commit 8661423e ("ACPI / utils: Add new acpi_dev_present
      helper") introduced acpi_dev_present(), it missed the fact that
      bus_find_device() took a reference on the device found by it and
      the callers of acpi_dev_present() don't drop that reference.
      
      Drop the reference on the device in acpi_dev_present().
      
      Fixes: 8661423e ("ACPI / utils: Add new acpi_dev_present helper")
      Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Reviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      54e3aca8
    • Christian König's avatar
      drm/amdgpu: fix invalid use of change_bit · 72464382
      Christian König authored
      We only need to clear the bit in a 32bit integer.
      
      This fixes a crah on ARM64 and PPC64LE caused by
      "drm/amdgpu: update the vm invalidation engine layout V2"
      Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
      Acked-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      72464382
    • Christian König's avatar
      drm/amdgpu: revert "cleanup setting bulk_movable" · 39bbd331
      Christian König authored
      This reverts commit 8466cc61.
      
      It can trigger a reference counter bug in TTM. Need to investigate further, but
      for now revert the offending change.
      Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
      Reviewed-by: default avatarMichel Dänzer <michel.daenzer@amd.com>
      Tested-by: default avatarMichel Dänzer <michel.daenzer@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      39bbd331
    • Linus Torvalds's avatar
      Merge tag 'tag-chrome-platform-fixes-for-v5.1-rc2' of... · babf09c3
      Linus Torvalds authored
      Merge tag 'tag-chrome-platform-fixes-for-v5.1-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux
      
      Pull chrome platform fixes from Benson Leung:
       "Two fixes:
      
         - Fix locking and close a potential race condition in the new
           wilco_ec driver.
      
         - Fix a warning in cros_ec_debugfs on systems that do not support
           console logging, such as the Asus C201"
      
      * tag 'tag-chrome-platform-fixes-for-v5.1-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux:
        platform/chrome: cros_ec_debugfs: cancel/schedule logging work only if supported
        platform/chrome: Fix locking pattern in wilco_ec_mailbox()
      babf09c3
    • Guenter Roeck's avatar
      platform/chrome: cros_ec_debugfs: cancel/schedule logging work only if supported · 57aeef7f
      Guenter Roeck authored
      The following traceback was reported on ASUS C201, which does not support
      console logging.
      
      ------------[ cut here ]------------
      WARNING: CPU: 2 PID: 361 at kernel/workqueue.c:3030 __flush_work+0x38/0x154
      Modules linked in: snd_soc_hdmi_codec cros_ec_debugfs cros_ec_sysfs uvcvideo dw_hdmi_cec dw_hdmi_i2s_audio videobuf2_vmalloc cfg80211 gpio_charger rk_crypto rfkill videobuf2_memops videobuf2_v4l2 des_generic videobuf2_common ofpart m25p80 spi_nor tpm_i2c_infineon sbs_battery mtd tpm joydev cros_ec_dev coreboot_table evdev mousedev ip_tables x_tables [last unloaded: brcmutil]
      CPU: 2 PID: 361 Comm: systemd-sleep Not tainted 5.1.0-rc1-1-ARCH+ #1
      Hardware name: Rockchip (Device Tree)
      [<c020e4b0>] (unwind_backtrace) from [<c020ac18>] (show_stack+0x10/0x14)
      [<c020ac18>] (show_stack) from [<c07a3e04>] (dump_stack+0x7c/0x9c)
      [<c07a3e04>] (dump_stack) from [<c0222748>] (__warn+0xd0/0xec)
      [<c0222748>] (__warn) from [<c022279c>] (warn_slowpath_null+0x38/0x44)
      [<c022279c>] (warn_slowpath_null) from [<c02365d0>] (__flush_work+0x38/0x154)
      [<c02365d0>] (__flush_work) from [<c023786c>] (__cancel_work_timer+0x114/0x1a4)
      [<c023786c>] (__cancel_work_timer) from [<bf33233c>] (cros_ec_debugfs_suspend+0x14/0x1c [cros_ec_debugfs])
      [<bf33233c>] (cros_ec_debugfs_suspend [cros_ec_debugfs]) from [<c056a888>] (dpm_run_callback+0x64/0xcc)
      [<c056a888>] (dpm_run_callback) from [<c056ad2c>] (__device_suspend+0x174/0x3a8)
      [<c056ad2c>] (__device_suspend) from [<c056b9e0>] (dpm_suspend+0x174/0x1e0)
      [<c056b9e0>] (dpm_suspend) from [<c026b3e0>] (suspend_devices_and_enter+0x6c/0x50c)
      [<c026b3e0>] (suspend_devices_and_enter) from [<c026ba8c>] (pm_suspend+0x20c/0x274)
      [<c026ba8c>] (pm_suspend) from [<c026a628>] (state_store+0x54/0x88)
      [<c026a628>] (state_store) from [<c03cd2d0>] (kernfs_fop_write+0x114/0x180)
      [<c03cd2d0>] (kernfs_fop_write) from [<c035d48c>] (__vfs_write+0x1c/0x154)
      [<c035d48c>] (__vfs_write) from [<c035f9e8>] (vfs_write+0xb8/0x198)
      [<c035f9e8>] (vfs_write) from [<c035fbc0>] (ksys_write+0x3c/0x74)
      [<c035fbc0>] (ksys_write) from [<c0201000>] (ret_fast_syscall+0x0/0x4c)
      Exception stack(0xe9365fa8 to 0xe9365ff0)
      5fa0: 00000004 beef8b28 00000004 beef8b28 00000004 00000000
      5fc0: 00000004 beef8b28 02319170 00000004 beef8b28 00000004 b6f3d900 beef8b74
      5fe0: 0000006c beef8a98 b6c0adac b6c66534
      ---[ end trace f4ee5df14e8ea0ec ]---
      
      If console logging is not supported, the work structure is never
      initialized, resulting in the traceback. Calling cancel/schedule functions
      conditionally fixes the problem.
      
      While at it, also fix error handling in the probe function.
      Reported-by: default avatarUrja Rannikko <urjaman@gmail.com>
      Cc: Urja Rannikko <urjaman@gmail.com>
      Fixes: 6fce0a2c ("mfd / platform: cros_ec: Move debugfs attributes to its own driver")
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarBenson Leung <bleung@chromium.org>
      57aeef7f