1. 18 6月, 2016 2 次提交
  2. 16 6月, 2016 2 次提交
    • V
      PM / OPP: Add 'UNKNOWN' status for shared_opp in struct opp_table · 79ee2e8f
      Viresh Kumar 提交于
      dev_pm_opp_get_sharing_cpus() returns 0 even in the case when the OPP
      core doesn't know whether or not the table is shared. It works on the
      majority of platforms, where the OPP table is never created before
      invoking the function and then -ENODEV is returned by it.
      
      But in the case of one platform (Jetson TK1) at least, the situation
      is a bit different. The OPP table has been created (somehow) before
      dev_pm_opp_get_sharing_cpus() is called and it returns 0. Its caller
      treats that as 'the CPUs don't share OPPs' and that leads to degraded
      performance.
      
      Fix this by converting 'shared_opp' in struct opp_table to an enum
      and making dev_pm_opp_get_sharing_cpus() return -EINVAL in case when
      the value of that field is "access unknown", so that the caller can
      handle it accordingly (cpufreq-dt considers that as 'all CPUs share
      the table', for example).
      
      Fixes: 6f707daa "PM / OPP: Add dev_pm_opp_get_sharing_cpus()"
      Reported-and-tested-by: NAlexandre Courbot <acourbot@nvidia.com>
      Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
      [ rjw : Subject & changelog ]
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      79ee2e8f
    • J
      base: make module_create_drivers_dir race-free · 7e1b1fc4
      Jiri Slaby 提交于
      Modules which register drivers via standard path (driver_register) in
      parallel can cause a warning:
      WARNING: CPU: 2 PID: 3492 at ../fs/sysfs/dir.c:31 sysfs_warn_dup+0x62/0x80
      sysfs: cannot create duplicate filename '/module/saa7146/drivers'
      Modules linked in: hexium_gemini(+) mxb(+) ...
      ...
      Call Trace:
      ...
       [<ffffffff812e63a2>] sysfs_warn_dup+0x62/0x80
       [<ffffffff812e6487>] sysfs_create_dir_ns+0x77/0x90
       [<ffffffff8140f2c4>] kobject_add_internal+0xb4/0x340
       [<ffffffff8140f5b8>] kobject_add+0x68/0xb0
       [<ffffffff8140f631>] kobject_create_and_add+0x31/0x70
       [<ffffffff8157a703>] module_add_driver+0xc3/0xd0
       [<ffffffff8155e5d4>] bus_add_driver+0x154/0x280
       [<ffffffff815604c0>] driver_register+0x60/0xe0
       [<ffffffff8145bed0>] __pci_register_driver+0x60/0x70
       [<ffffffffa0273e14>] saa7146_register_extension+0x64/0x90 [saa7146]
       [<ffffffffa0033011>] hexium_init_module+0x11/0x1000 [hexium_gemini]
      ...
      
      As can be (mostly) seen, driver_register causes this call sequence:
        -> bus_add_driver
          -> module_add_driver
            -> module_create_drivers_dir
      The last one creates "drivers" directory in /sys/module/<...>. When
      this is done in parallel, the directory is attempted to be created
      twice at the same time.
      
      This can be easily reproduced by loading mxb and hexium_gemini in
      parallel:
      while :; do
        modprobe mxb &
        modprobe hexium_gemini
        wait
        rmmod mxb hexium_gemini saa7146_vv saa7146
      done
      
      saa7146 calls pci_register_driver for both mxb and hexium_gemini,
      which means /sys/module/saa7146/drivers is to be created for both of
      them.
      
      Fix this by a new mutex in module_create_drivers_dir which makes the
      test-and-create "drivers" dir atomic.
      
      I inverted the condition and removed 'return' to avoid multiple
      unlocks or a goto.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Fixes: fe480a26 (Modules: only add drivers/ direcory if needed)
      Cc: v2.6.21+ <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7e1b1fc4
  3. 21 5月, 2016 1 次提交
    • R
      PM / sleep: Handle failures in device_suspend_late() consistently · 3a17fb32
      Rafael J. Wysocki 提交于
      Grygorii Strashko reports:
      
       The PM runtime will be left disabled for the device if its
       .suspend_late() callback fails and async suspend is not allowed
       for this device. In this case device will not be added in
       dpm_late_early_list and dpm_resume_early() will ignore this
       device, as result PM runtime will be disabled for it forever
       (side effect: after 8 subsequent failures for the same device
       the PM runtime will be reenabled due to disable_depth overflow).
      
      To fix this problem, add devices to dpm_late_early_list regardless
      of whether or not device_suspend_late() returns errors for them.
      
      That will ensure failures in there to be handled consistently for
      all devices regardless of their async suspend/resume status.
      Reported-by: NGrygorii Strashko <grygorii.strashko@ti.com>
      Tested-by: NGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Cc: All applicable <stable@vger.kernel.org>
      3a17fb32
  4. 06 5月, 2016 1 次提交
  5. 05 5月, 2016 3 次提交
  6. 03 5月, 2016 1 次提交
    • G
      Revert "base: dd: don't remove driver_data in -EPROBE_DEFER case" · c6e360a0
      Greg Kroah-Hartman 提交于
      This reverts commit ded9db38.
      
      Thierry Reding writes:
      	This causes a boot regression on at least one board, caused by
      	one of the drivers looking at driver data to check whether or
      	not the driver has properly loaded. If the code encounters a
      	non-NULL pointer it tries to dereference it, but because it's
      	already been freed there is no memory backing it and things
      	crash.
      
      	I don't think keeping stale pointers around is a good idea. The
      	whole point of setting this to NULL in the core is so that probe
      	failures result in the same starting conditions no matter what.
      
      	Can we please get this reverted?
      Reported-by: NThierry Reding <thierry.reding@gmail.com>
      Cc: Yi Zhang <yizhang_hust@163.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c6e360a0
  7. 02 5月, 2016 2 次提交
  8. 28 4月, 2016 4 次提交
  9. 27 4月, 2016 3 次提交
  10. 25 4月, 2016 4 次提交
  11. 22 4月, 2016 4 次提交
  12. 16 4月, 2016 1 次提交
  13. 15 4月, 2016 1 次提交
  14. 09 4月, 2016 1 次提交
  15. 08 4月, 2016 1 次提交
  16. 01 4月, 2016 1 次提交
  17. 30 3月, 2016 4 次提交
  18. 24 3月, 2016 1 次提交
  19. 23 3月, 2016 3 次提交