1. 09 7月, 2019 2 次提交
  2. 04 7月, 2019 4 次提交
  3. 28 6月, 2019 3 次提交
    • V
      cpufreq: Avoid calling cpufreq_verify_current_freq() from handle_update() · 70a59fde
      Viresh Kumar 提交于
      On some occasions cpufreq_verify_current_freq() schedules a work whose
      callback is handle_update(), which further calls cpufreq_update_policy()
      which may end up calling cpufreq_verify_current_freq() again.
      
      On the other hand, when cpufreq_update_policy() is called from
      handle_update(), the pointer to the cpufreq policy is already
      available, but cpufreq_cpu_acquire() is still called to get it in
      cpufreq_update_policy(), which should be avoided as well.
      
      To fix these issues, create a new helper, refresh_frequency_limits(),
      and make both handle_update() call it cpufreq_update_policy().
      Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
      [ rjw: Rename reeval_frequency_limits() as refresh_frequency_limits() ]
      [ rjw: Changelog ]
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      70a59fde
    • V
      cpufreq: Consolidate cpufreq_update_current_freq() and __cpufreq_get() · 5980752e
      Viresh Kumar 提交于
      Their implementations are quite similar, so modify
      cpufreq_update_current_freq() somewhat and call it from
      __cpufreq_get().
      
      Also rename cpufreq_update_current_freq() to
      cpufreq_verify_current_freq(), as that's what it is doing.
      Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
      [ rjw: Subject & changelog ]
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      5980752e
    • V
      cpufreq: Don't skip frequency validation for has_target() drivers · 98015228
      Viresh Kumar 提交于
      CPUFREQ_CONST_LOOPS was introduced in a very old commit from pre-2.6
      kernel release by commit 6a4a93f9c0d5 ("[CPUFREQ] Fix 'out of sync'
      issue").
      
      Basically, that commit does two things:
      
       - It adds the frequency verification code (which is quite similar to
         what we have today as well).
      
       - And it sets the CPUFREQ_CONST_LOOPS flag only for setpolicy drivers,
         rightly so based on the code we had then. The idea was to avoid
         frequency validation for setpolicy drivers as the cpufreq core doesn't
         know what frequency the hardware is running at and so no point in
         doing frequency verification.
      
      The problem happened when we started to use the same CPUFREQ_CONST_LOOPS
      flag for constant loops-per-jiffy thing as well and many has_target()
      drivers started using the same flag and unknowingly skipped the
      verification of frequency. There is no logical reason behind skipping
      frequency validation because of the presence of CPUFREQ_CONST_LOOPS
      flag otherwise.
      
      Fix this issue by skipping frequency validation only for setpolicy
      drivers and always doing it for has_target() drivers irrespective of
      the presence or absence of CPUFREQ_CONST_LOOPS flag.
      
      cpufreq_notify_transition() is only called for has_target() type driver
      and not for set_policy type, and the check is simply redundant. Remove
      it as well.
      
      Also remove () around freq comparison statement as they aren't required
      and checkpatch also warns for them.
      Signed-off-by: NViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      98015228
  4. 26 6月, 2019 3 次提交
  5. 24 6月, 2019 1 次提交
  6. 17 6月, 2019 1 次提交
  7. 14 6月, 2019 4 次提交
  8. 13 6月, 2019 8 次提交
  9. 12 6月, 2019 14 次提交
    • H
      usb: typec: Make sure an alt mode exist before getting its partner · 5f54a85d
      Heikki Krogerus 提交于
      Adding check to typec_altmode_get_partner() to prevent
      potential NULL pointer dereference.
      Reported-by: NVladimir Yerilov <openmindead@gmail.com>
      Fixes: ad74b864 ("usb: typec: ucsi: Preliminary support for alternate modes")
      Signed-off-by: NHeikki Krogerus <heikki.krogerus@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5f54a85d
    • J
      clocksource/drivers/arm_arch_timer: Don't trace count reader functions · 5d6168fc
      Julien Thierry 提交于
      With v5.2-rc1, The ftrace functions_graph tracer locks up whenever it is
      enabled on arm64.
      
      Since commit 0ea41539 ("clocksource/arm_arch_timer: Use
      arch_timer_read_counter to access stable counters") a function pointer
      is consistently used to read the counter instead of potentially
      referencing an inlinable function.
      
      The graph tracers relies on accessing the timer counters to compute the
      time spent in functions which causes the lockup when attempting to trace
      these code paths.
      
      Annotate the arm arch timer counter accessors as notrace.
      
      Fixes: 0ea41539 ("clocksource/arm_arch_timer: Use
             arch_timer_read_counter to access stable counters")
      Signed-off-by: NJulien Thierry <julien.thierry@arm.com>
      Cc: Marc Zyngier <marc.zyngier@arm.com>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Acked-by: NMarc Zyngier <marc.zyngier@arm.com>
      Signed-off-by: NDaniel Lezcano <daniel.lezcano@linaro.org>
      5d6168fc
    • L
      i2c: pca-platform: Fix GPIO lookup code · a0cac264
      Linus Walleij 提交于
      The devm_gpiod_request_gpiod() call will add "-gpios" to
      any passed connection ID before looking it up.
      
      I do not think the reset GPIO on this platform is named
      "reset-gpios-gpios" but rather "reset-gpios" in the device
      tree, so fix this up so that we get a proper reset GPIO
      handle.
      
      Also drop the inclusion of the legacy GPIO header.
      
      Fixes: 0e8ce93b ("i2c: pca-platform: add devicetree awareness")
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Reviewed-by: NChris Packham <chris.packham@alliedtelesis.co.nz>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      a0cac264
    • J
      drm: add fallback override/firmware EDID modes workaround · 48eaeb76
      Jani Nikula 提交于
      We've moved the override and firmware EDID (simply "override EDID" from
      now on) handling to the low level drm_do_get_edid() function in order to
      transparently use the override throughout the stack. The idea is that
      you get the override EDID via the ->get_modes() hook.
      
      Unfortunately, there are scenarios where the DDC probe in drm_get_edid()
      called via ->get_modes() fails, although the preceding ->detect()
      succeeds.
      
      In the case reported by Paul Wise, the ->detect() hook,
      intel_crt_detect(), relies on hotplug detect, bypassing the DDC. In the
      case reported by Ilpo Järvinen, there is no ->detect() hook, which is
      interpreted as connected. The subsequent DDC probe reached via
      ->get_modes() fails, and we don't even look at the override EDID,
      resulting in no modes being added.
      
      Because drm_get_edid() is used via ->detect() all over the place, we
      can't trivially remove the DDC probe, as it leads to override EDID
      effectively meaning connector forcing. The goal is that connector
      forcing and override EDID remain orthogonal.
      
      Generally, the underlying problem here is the conflation of ->detect()
      and ->get_modes() via drm_get_edid(). The former should just detect, and
      the latter should just get the modes, typically via reading the EDID. As
      long as drm_get_edid() is used in ->detect(), it needs to retain the DDC
      probe. Or such users need to have a separate DDC probe step first.
      
      The EDID caching between ->detect() and ->get_modes() done by some
      drivers is a further complication that prevents us from making
      drm_do_get_edid() adapt to the two cases.
      
      Work around the regression by falling back to a separate attempt at
      getting the override EDID at drm_helper_probe_single_connector_modes()
      level. With a working DDC and override EDID, it'll never be called; the
      override EDID will come via ->get_modes(). There will still be a failing
      DDC probe attempt in the cases that require the fallback.
      
      v2:
      - Call drm_connector_update_edid_property (Paul)
      - Update commit message about EDID caching (Daniel)
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107583Reported-by: NPaul Wise <pabs3@bonedaddy.net>
      Cc: Paul Wise <pabs3@bonedaddy.net>
      References: http://mid.mail-archive.com/alpine.DEB.2.20.1905262211270.24390@whs-18.cs.helsinki.fiReported-by: NIlpo Järvinen <ilpo.jarvinen@cs.helsinki.fi>
      Cc: Ilpo Järvinen <ilpo.jarvinen@cs.helsinki.fi>
      Suggested-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      References: 15f080f0 ("drm/edid: respect connector force for drm_get_edid ddc probe")
      Fixes: 53fd40a9 ("drm: handle override and firmware EDID at drm_do_get_edid() level")
      Cc: <stable@vger.kernel.org> # v4.15+ 56a2b7f2 drm/edid: abstract override/firmware EDID retrieval
      Cc: <stable@vger.kernel.org> # v4.15+
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Harish Chegondi <harish.chegondi@intel.com>
      Tested-by: NPaul Wise <pabs3@bonedaddy.net>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190610093054.28445-1-jani.nikula@intel.com
      48eaeb76
    • R
      i2c: acorn: fix i2c warning · ca21f851
      Russell King 提交于
      The Acorn i2c driver (for RiscPC) triggers the "i2c adapter has no name"
      warning in the I2C core driver, resulting in the RTC being inaccessible.
      Fix this.
      
      Fixes: 2236baa7 ("i2c: Sanity checks on adapter registration")
      Signed-off-by: NRussell King <rmk+kernel@armlinux.org.uk>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      Cc: stable@kernel.org
      ca21f851
    • J
      drm/edid: abstract override/firmware EDID retrieval · 56a2b7f2
      Jani Nikula 提交于
      Abstract the debugfs override and the firmware EDID retrieval
      function. We'll be needing it in the follow-up. No functional changes.
      
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Harish Chegondi <harish.chegondi@intel.com>
      Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
      Tested-by: NTested-by: Paul Wise <pabs3@bonedaddy.net>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190607110513.12072-1-jani.nikula@intel.com
      56a2b7f2
    • V
      platform/mellanox: mlxreg-hotplug: Add devm_free_irq call to remove flow · 8c2eb7b6
      Vadim Pasternak 提交于
      Add devm_free_irq() call to mlxreg-hotplug remove() for clean release
      of devices irq resource. Fix debugobjects warning triggered by rmmod
      It prevents of use-after-free memory, related to
      mlxreg_hotplug_work_handler.
      
      Issue has been reported as debugobjects warning triggered by
      'rmmod mlxtreg-hotplug' flow, while running kernel with
      CONFIG_DEBUG_OBJECTS* options.
      
      [ 2489.623551] ODEBUG: free active (active state 0) object type: work_struct hint: mlxreg_hotplug_work_handler+0x0/0x7f0 [mlxreg_hotplug]
      [ 2489.637097] WARNING: CPU: 5 PID: 3924 at lib/debugobjects.c:328 debug_print_object+0xfe/0x180
      [ 2489.637165] RIP: 0010:debug_print_object+0xfe/0x180
      ?
      [ 2489.637214] Call Trace:
      [ 2489.637225]  __debug_check_no_obj_freed+0x25e/0x320
      [ 2489.637231]  kfree+0x82/0x110
      [ 2489.637238]  release_nodes+0x33c/0x4e0
      [ 2489.637242]  ? devres_remove_group+0x1b0/0x1b0
      [ 2489.637247]  device_release_driver_internal+0x146/0x270
      [ 2489.637251]  driver_detach+0x73/0xe0
      [ 2489.637254]  bus_remove_driver+0xa1/0x170
      [ 2489.637261]  __x64_sys_delete_module+0x29e/0x320
      [ 2489.637265]  ? __ia32_sys_delete_module+0x320/0x320
      [ 2489.637268]  ? blkcg_exit_queue+0x20/0x20
      [ 2489.637273]  ? task_work_run+0x7d/0x100
      [ 2489.637278]  ? exit_to_usermode_loop+0x5b/0xf0
      [ 2489.637281]  do_syscall_64+0x73/0x160
      [ 2489.637287]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
      [ 2489.637290] RIP: 0033:0x7f95c3596fd7
      
      The difference in release flow with and with no devm_free_irq is listed
      below:
      
      bus: 'platform': remove driver mlxreg-hotplug
       mlxreg_hotplug_remove(start)
      					-> devm_free_irq (with new code)
       mlxreg_hotplug_remove (end)
       release_nodes (start)
        mlxreg-hotplug: DEVRES REL devm_hwmon_release (8 bytes)
        device: 'hwmon3': device_unregister
        PM: Removing info for No Bus:hwmon3
        mlxreg-hotplug: DEVRES REL devm_kzalloc_release (88 bytes)
        mlxreg-hotplug: DEVRES REL devm_kzalloc_release (6 bytes)
        mlxreg-hotplug: DEVRES REL devm_kzalloc_release (5 bytes)
        mlxreg-hotplug: DEVRES REL devm_kzalloc_release (5 bytes)
        mlxreg-hotplug: DEVRES REL devm_kzalloc_release (5 bytes)
        mlxreg-hotplug: DEVRES REL devm_kzalloc_release (5 bytes)
        mlxreg-hotplug: DEVRES REL devm_kzalloc_release (5 bytes)
        mlxreg-hotplug: DEVRES REL devm_kzalloc_release (5 bytes)
        mlxreg-hotplug: DEVRES REL devm_kzalloc_release (5 bytes)
        mlxreg-hotplug: DEVRES REL devm_kzalloc_release (5 bytes)
        mlxreg-hotplug: DEVRES REL devm_kzalloc_release (5 bytes)
        mlxreg-hotplug: DEVRES REL devm_kzalloc_release (5 bytes)
        mlxreg-hotplug: DEVRES REL devm_irq_release (16 bytes) (no new code)
        mlxreg-hotplug: DEVRES REL devm_kzalloc_release (1376 bytes)
         ------------[ cut here ]------------ (no new code):
         ODEBUG: free active (active state 0) object type: work_struct hint: mlxreg_hotplug_work_handler
      
       release_nodes(end)
      driver: 'mlxreg-hotplug': driver_release
      
      Fixes: 1f976f69 ("platform/x86: Move Mellanox platform hotplug driver to platform/mellanox")
      Signed-off-by: NVadim Pasternak <vadimp@mellanox.com>
      Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      8c2eb7b6
    • V
      platform/x86: mlx-platform: Fix parent device in i2c-mux-reg device registration · 160da20b
      Vadim Pasternak 提交于
      Fix the issue found while running kernel with the option
      CONFIG_DEBUG_TEST_DRIVER_REMOVE.
      Driver 'mlx-platform' registers 'i2c_mlxcpld' device and then registers
      few underlying 'i2c-mux-reg' devices:
      	priv->pdev_i2c = platform_device_register_simple("i2c_mlxcpld", nr,
      							 NULL, 0);
      	...
      	for (i = 0; i < ARRAY_SIZE(mlxplat_mux_data); i++) {
      		priv->pdev_mux[i] = platform_device_register_resndata(
      						&mlxplat_dev->dev,
      						"i2c-mux-reg", i, NULL,
      						0, &mlxplat_mux_data[i],
      						sizeof(mlxplat_mux_data[i]));
      
      But actual parent of "i2c-mux-reg" device is priv->pdev_i2c->dev and
      not mlxplat_dev->dev.
      Patch fixes parent device parameter in a call to
      platform_device_register_resndata() for "i2c-mux-reg".
      
      It solves the race during initialization flow while 'i2c_mlxcpld.1' is
      removing after probe, while 'i2c-mux-reg.0' is still in probing flow:
      'i2c_mlxcpld.1'	flow:	probe -> remove -> probe.
      'i2c-mux-reg.0'	flow:		  probe -> ...
      
      [   12:621096] Registering platform device 'i2c_mlxcpld.1'. Parent at platform
      [   12:621117] device: 'i2c_mlxcpld.1': device_add
      [   12:621155] bus: 'platform': add device i2c_mlxcpld.1
      [   12:621384] Registering platform device 'i2c-mux-reg.0'. Parent at mlxplat
      [   12:621395] device: 'i2c-mux-reg.0': device_add
      [   12:621425] bus: 'platform': add device i2c-mux-reg.0
      [   12:621806] Registering platform device 'i2c-mux-reg.1'. Parent at mlxplat
      [   12:621828] device: 'i2c-mux-reg.1': device_add
      [   12:621892] bus: 'platform': add device i2c-mux-reg.1
      [   12:621906] bus: 'platform': add driver i2c_mlxcpld
      [   12:621996] bus: 'platform': driver_probe_device: matched device i2c_mlxcpld.1 with driver i2c_mlxcpld
      [   12:622003] bus: 'platform': really_probe: probing driver i2c_mlxcpld with device i2c_mlxcpld.1
      [   12:622100] i2c_mlxcpld i2c_mlxcpld.1: no default pinctrl state
      [   12:622293] device: 'i2c-1': device_add
      [   12:627280] bus: 'i2c': add device i2c-1
      [   12:627692] device: 'i2c-1': device_add
      [   12.629639] bus: 'platform': add driver i2c-mux-reg
      [   12.629718] bus: 'platform': driver_probe_device: matched device i2c-mux-reg.0 with driver i2c-mux-reg
      [   12.629723] bus: 'platform': really_probe: probing driver i2c-mux-reg with device i2c-mux-reg.0
      [   12.629818] i2c-mux-reg i2c-mux-reg.0: no default pinctrl state
      [   12.629981] platform i2c-mux-reg.0: Driver i2c-mux-reg requests probe deferral
      [   12.629986] platform i2c-mux-reg.0: Added to deferred list
      [   12.629992] bus: 'platform': driver_probe_device: matched device i2c-mux-reg.1 with driver i2c-mux-reg
      [   12.629997] bus: 'platform': really_probe: probing driver i2c-mux-reg with device i2c-mux-reg.1
      [   12.630091] i2c-mux-reg i2c-mux-reg.1: no default pinctrl state
      [   12.630247] platform i2c-mux-reg.1: Driver i2c-mux-reg requests probe deferral
      [   12.630252] platform i2c-mux-reg.1: Added to deferred list
      [   12.640892] devices_kset: Moving i2c-mux-reg.0 to end of list
      [   12.640900] platform i2c-mux-reg.0: Retrying from deferred list
      [   12.640911] bus: 'platform': driver_probe_device: matched device i2c-mux-reg.0 with driver i2c-mux-reg
      [   12.640919] bus: 'platform': really_probe: probing driver i2c-mux-reg with device i2c-mux-reg.0
      [   12.640999] i2c-mux-reg i2c-mux-reg.0: no default pinctrl state
      [   12.641177] platform i2c-mux-reg.0: Driver i2c-mux-reg requests probe deferral
      [   12.641187] platform i2c-mux-reg.0: Added to deferred list
      [   12.641198] devices_kset: Moving i2c-mux-reg.1 to end of list
      [   12.641219] platform i2c-mux-reg.1: Retrying from deferred list
      [   12.641237] bus: 'platform': driver_probe_device: matched device i2c-mux-reg.1 with driver i2c-mux-reg
      [   12.641247] bus: 'platform': really_probe: probing driver i2c-mux-reg with device i2c-mux-reg.1
      [   12.641331] i2c-mux-reg i2c-mux-reg.1: no default pinctrl state
      [   12.641465] platform i2c-mux-reg.1: Driver i2c-mux-reg requests probe deferral
      [   12.641469] platform i2c-mux-reg.1: Added to deferred list
      [   12.646427] device: 'i2c-1': device_add
      [   12.646647] bus: 'i2c': add device i2c-1
      [   12.647104] device: 'i2c-1': device_add
      [   12.669231] devices_kset: Moving i2c-mux-reg.0 to end of list
      [   12.669240] platform i2c-mux-reg.0: Retrying from deferred list
      [   12.669258] bus: 'platform': driver_probe_device: matched device i2c-mux-reg.0 with driver i2c-mux-reg
      [   12.669263] bus: 'platform': really_probe: probing driver i2c-mux-reg with device i2c-mux-reg.0
      [   12.669343] i2c-mux-reg i2c-mux-reg.0: no default pinctrl state
      [   12.669585] device: 'i2c-2': device_add
      [   12.669795] bus: 'i2c': add device i2c-2
      [   12.670201] device: 'i2c-2': device_add
      [   12.671427] i2c i2c-1: Added multiplexed i2c bus 2
      [   12.671514] device: 'i2c-3': device_add
      [   12.671724] bus: 'i2c': add device i2c-3
      [   12.672136] device: 'i2c-3': device_add
      [   12.673378] i2c i2c-1: Added multiplexed i2c bus 3
      [   12.673472] device: 'i2c-4': device_add
      [   12.673676] bus: 'i2c': add device i2c-4
      [   12.674060] device: 'i2c-4': device_add
      [   12.675861] i2c i2c-1: Added multiplexed i2c bus 4
      [   12.675941] device: 'i2c-5': device_add
      [   12.676150] bus: 'i2c': add device i2c-5
      [   12.676550] device: 'i2c-5': device_add
      [   12.678103] i2c i2c-1: Added multiplexed i2c bus 5
      [   12.678193] device: 'i2c-6': device_add
      [   12.678395] bus: 'i2c': add device i2c-6
      [   12.678774] device: 'i2c-6': device_add
      [   12.679969] i2c i2c-1: Added multiplexed i2c bus 6
      [   12.680065] device: 'i2c-7': device_add
      [   12.680275] bus: 'i2c': add device i2c-7
      [   12.680913] device: 'i2c-7': device_add
      [   12.682506] i2c i2c-1: Added multiplexed i2c bus 7
      [   12.682600] device: 'i2c-8': device_add
      [   12.682808] bus: 'i2c': add device i2c-8
      [   12.683189] device: 'i2c-8': device_add
      [   12.683907] device: 'i2c-1': device_unregister
      [   12.683945] device: 'i2c-1': device_unregister
      [   12.684387] device: 'i2c-1': device_create_release
      [   12.684536] bus: 'i2c': remove device i2c-1
      [   12.686019] i2c i2c-8: Failed to create compatibility class link
      [   12.686086] ------------[ cut here ]------------
      [   12.686087] can't create symlink to mux device
      [   12.686224] Workqueue: events deferred_probe_work_func
      [   12.686135] WARNING: CPU: 7 PID: 436 at drivers/i2c/i2c-mux.c:416 i2c_mux_add_adapter+0x729/0x7d0 [i2c_mux]
      [   12.686232] RIP: 0010:i2c_mux_add_adapter+0x729/0x7d0 [i2c_mux]
      [   0x190/0x190 [i2c_mux]
      [   12.686300]  ? i2c_mux_alloc+0xac/0x110 [i2c_mux]
      [   12.686306]  ? i2c_mux_reg_set+0x200/0x200 [i2c_mux_reg]
      [   12.686313]  i2c_mux_reg_probe+0x22c/0x731 [i2c_mux_reg]
      [   12.686322]  ? i2c_mux_reg_deselect+0x60/0x60 [i2c_mux_reg]
      [   12.686346]  platform_drv_probe+0xa8/0x110
      [   12.686351]  really_probe+0x185/0x720
      [   12.686358]  driver_probe_device+0xdf/0x1f0
      ...
      [   12.686522] i2c i2c-1: Added multiplexed i2c bus 8
      [   12.686621] device: 'i2c-9': device_add
      [   12.686626] kobject_add_internal failed for i2c-9 (error: -2 parent: i2c-1)
      [   12.694729] i2c-core: adapter 'i2c-1-mux (chan_id 8)': can't register device (-2)
      [   12.705726] i2c i2c-1: failed to add mux-adapter 8 as bus 9 (error=-2)
      [   12.714494] device: 'i2c-8': device_unregister
      [   12.714537] device: 'i2c-8': device_unregister
      
      Fixes: 6613d18e ("platform/x86: mlx-platform: Move module from arch/x86")
      Signed-off-by: NVadim Pasternak <vadimp@mellanox.com>
      Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      160da20b
    • M
      platform/x86: intel-vbtn: Report switch events when event wakes device · cb1921b1
      Mathew King 提交于
      When a switch event, such as tablet mode/laptop mode or docked/undocked,
      wakes a device make sure that the value of the swich is reported.
      Without when a device is put in tablet mode from laptop mode when it is
      suspended or vice versa the device will wake up but mode will be
      incorrect.
      
      Tested by suspending a device in laptop mode and putting it in tablet
      mode, the device resumes and is in tablet mode. When suspending the
      device in tablet mode and putting it in laptop mode the device resumes
      and is in laptop mode.
      Signed-off-by: NMathew King <mathewk@chromium.org>
      Reviewed-by: NJett Rink <jettrink@chromium.org>
      Reviewed-by: NMario Limonciello <mario.limonciello@dell.com>
      Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      cb1921b1
    • H
      platform/x86: asus-wmi: Only Tell EC the OS will handle display hotkeys from asus_nb_wmi · 401fee81
      Hans de Goede 提交于
      Commit 78f3ac76 ("platform/x86: asus-wmi: Tell the EC the OS will
      handle the display off hotkey") causes the backlight to be permanently off
      on various EeePC laptop models using the eeepc-wmi driver (Asus EeePC
      1015BX, Asus EeePC 1025C).
      
      The asus_wmi_set_devstate(ASUS_WMI_DEVID_BACKLIGHT, 2, NULL) call added
      by that commit is made conditional in this commit and only enabled in
      the quirk_entry structs in the asus-nb-wmi driver fixing the broken
      display / backlight on various EeePC laptop models.
      
      Cc: João Paulo Rechi Vita <jprvita@endlessm.com>
      Fixes: 78f3ac76 ("platform/x86: asus-wmi: Tell the EC the OS will handle the display off hotkey")
      Signed-off-by: NHans de Goede <hdegoede@redhat.com>
      Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      401fee81
    • R
      iommu/arm-smmu: Avoid constant zero in TLBI writes · 4e4abae3
      Robin Murphy 提交于
      Apparently, some Qualcomm arm64 platforms which appear to expose their
      SMMU global register space are still, in fact, using a hypervisor to
      mediate it by trapping and emulating register accesses. Sadly, some
      deployed versions of said trapping code have bugs wherein they go
      horribly wrong for stores using r31 (i.e. XZR/WZR) as the source
      register.
      
      While this can be mitigated for GCC today by tweaking the constraints
      for the implementation of writel_relaxed(), to avoid any potential
      arms race with future compilers more aggressively optimising register
      allocation, the simple way is to just remove all the problematic
      constant zeros. For the write-only TLB operations, the actual value is
      irrelevant anyway and any old nearby variable will provide a suitable
      GPR to encode. The one point at which we really do need a zero to clear
      a context bank happens before any of the TLB maintenance where crashes
      have been reported, so is apparently not a problem... :/
      Reported-by: NAngeloGioacchino Del Regno <kholk11@gmail.com>
      Tested-by: NMarc Gonzalez <marc.w.gonzalez@free.fr>
      Signed-off-by: NRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: NMarc Gonzalez <marc.w.gonzalez@free.fr>
      Acked-by: NWill Deacon <will.deacon@arm.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      4e4abae3
    • L
      drm/i915/perf: fix whitelist on Gen10+ · c5cc0bf8
      Lionel Landwerlin 提交于
      Gen10 added an additional NOA_WRITE register (high bits) and we forgot
      to whitelist it for userspace.
      
      Fixes: 95690a02 ("drm/i915/perf: enable perf support on CNL")
      Signed-off-by: NLionel Landwerlin <lionel.g.landwerlin@intel.com>
      Reviewed-by: NKenneth Graunke <kenneth@whitecape.org>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190601225845.12600-1-lionel.g.landwerlin@intel.com
      (cherry picked from commit bf210f6c)
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      c5cc0bf8
    • V
      drm/i915/sdvo: Implement proper HDMI audio support for SDVO · d74408f5
      Ville Syrjälä 提交于
      Our SDVO audio support is pretty bogus. We can't push audio over the
      SDVO bus, so trying to enable audio in the SDVO control register doesn't
      do anything. In fact it looks like the SDVO encoder will always mix in
      the audio coming over HDA, and there's no (at least documented) way to
      disable that from our side. So HDMI audio does work currently on gen4
      but only by luck really. On gen3 it got broken by the referenced commit.
      And what has always been missing on every platform is the ELD.
      
      To pass the ELD to the audio driver we need to write it to magic buffer
      in the SDVO encoder hardware which then gets pulled out via HDA in the
      other end. Ie. pretty much the same thing we had for native HDMI before
      we started to just pass the ELD between the drivers. This sort of
      explains why we even have that silly hardware buffer with native HDMI.
      
      $ cat /proc/asound/card0/eld#1.0
      -monitor_present		0
      -eld_valid		0
      +monitor_present		1
      +eld_valid		1
      +monitor_name		LG TV
      +connection_type		HDMI
      +...
      
      This also fixes our state readout since we can now query the SDVO
      encoder about the state of the "ELD valid" and "presence detect"
      bits. As mentioned those don't actually control whether audio
      gets sent over the HDMI cable, but it's the best we can do. And with
      the state checker appeased we can re-enable HDMI audio for gen3.
      
      Cc: stable@vger.kernel.org
      Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
      Cc: zardam@gmail.com
      Tested-by: zardam@gmail.com
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108976
      Fixes: de44e256 ("drm/i915/sdvo: Shut up state checker with hdmi cards on gen3")
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190409144054.24561-3-ville.syrjala@linux.intel.comReviewed-by: NImre Deak <imre.deak@intel.com>
      (cherry picked from commit dc49a56b)
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      d74408f5
    • V
      drm/i915: Fix per-pixel alpha with CCS · 77ce94db
      Ville Syrjälä 提交于
      We forgot to set .has_alpha=true for the A+CCS formats when the code
      started to consult .has_alpha. This manifests as A+CCS being treated
      as X+CCS which means no per-pixel alpha blending. Fix the format
      list appropriately.
      
      Cc: stable@vger.kernel.org
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Matt Roper <matthew.d.roper@intel.com>
      Cc: Heinrich Fink <heinrich.fink@daqri.com>
      Reported-by: NHeinrich Fink <heinrich.fink@daqri.com>
      Tested-by: NHeinrich Fink <heinrich.fink@daqri.com>
      Fixes: b2081525 ("drm/i915: Add plane alpha blending support, v2.")
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190603142500.25680-1-ville.syrjala@linux.intel.comReviewed-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      (cherry picked from commit 38f30041)
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      77ce94db