sfrench/cifs-2.6.git
6 years agoMerge tag 'drm-misc-next-2017-10-12' of git://anongit.freedesktop.org/drm/drm-misc...
Dave Airlie [Fri, 13 Oct 2017 06:24:59 +0000 (16:24 +1000)]
Merge tag 'drm-misc-next-2017-10-12' of git://anongit.freedesktop.org/drm/drm-misc into drm-next

More 4.15 drm-misc stuff:

Cross-subsystem Changes:
- bridge cleanup refactor (Benjamin Gaignard)

Core Changes:
- less surprising atomic iterators (Maarten), fixes an oops introduced
  in drm-next
- better gem/fb helper docs (Noralf)
- fix dma-buf rcu races (Christian König)

Driver Changes:
- adv7511: CEC support (Hans Verkuil)
- sun4i update from Chen-Yu to improve hdmi and A31 support
- sii8620: add remote control support (Maceiej Purski)

New drivers:
- SiI9234 bridge driver (Maciej Purski)
- 7" rpi touch panel (Eric Anholt)

Note that this contains a topic pull from regmap, needed by the sun4i
changes. Mark Brown sent that out for pulling into drm-misc.

* tag 'drm-misc-next-2017-10-12' of git://anongit.freedesktop.org/drm/drm-misc: (29 commits)
  drm/dp: WARN about invalid/unknown link rates and bw codes
  drm/msm/mdp5: remove less than 0 comparison for unsigned value
  drm/bridge/sii8620: add remote control support
  drm/sun4i: hdmi: Add support for A31's HDMI controller
  drm/sun4i: hdmi: Add A31 specific DDC register definitions
  drm/sun4i: hdmi: Add support for controller hardware variants
  dt-bindings: display: sun4i: Add binding for A31 HDMI controller
  drm/sun4i: hdmi: Allow using second PLL as TMDS clk parent
  drm/sun4i: hdmi: create a regmap for later use
  drm/sun4i: hdmi: Disable clks in bind function error path and unbind function
  drm/sun4i: tcon: Add support for demuxing TCON output on A31
  drm/sun4i: tcon: Add variant callback for TCON output muxing
  drm/bridge/synopsys: dsi :remove is_panel_bridge
  drm/vc4: remove bridge from driver internal structure
  drm/stm: ltdc: remove bridge from driver internal structure
  drm/drm_of: add drm_of_panel_bridge_remove function
  drm/bridge: make drm_panel_bridge_remove more robust
  dma-fence: fix dma_fence_get_rcu_safe v2
  dma-buf: make reservation_object_copy_fences rcu save
  drm/atomic: Unref duplicated drm_atomic_state in drm_atomic_helper_resume()
  ...

6 years agodrm: vblank: remove drm_timestamp_monotonic parameter
Arnd Bergmann [Wed, 11 Oct 2017 15:20:13 +0000 (17:20 +0200)]
drm: vblank: remove drm_timestamp_monotonic parameter

There is a risk of overflowing vblank timestamps in 2038 or 2106 if
someone sets the drm_timestamp_monotonic module parameter to zero.

I found no indication of anyone ever setting the parameter, or
complaining about the default being wrong, after it was introduced
as a way to handle backwards-compatibility with linux prior to
c61eef726a78 ("drm: add support for monotonic vblank timestamps"),
so it's probably safer to just remove the parameter completely
and only allowing the default behavior.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
6 years agodrm: vblank: use ktime_t instead of timeval
Arnd Bergmann [Wed, 11 Oct 2017 15:20:12 +0000 (17:20 +0200)]
drm: vblank: use ktime_t instead of timeval

The drm vblank handling uses 'timeval' to store timestamps in either
monotonic or wall-clock time base. In either case, it reads the current
time as a ktime_t in get_drm_timestamp() and converts it from there.

This is a bit suspicious, as users of 'timeval' often suffer from
the time_t overflow in y2038. I have gone through this code and
found that it is unlikely to cause problems here:

- The user space ABI does not use time_t or timeval, but uses
  'u32' and 'long' as the types. This means at least that rebuilding
  user programs against a new libc with 64-bit time_t does not
  change the ABI.

- As of commit c61eef726a78 ("drm: add support for monotonic vblank
  timestamps") in linux-3.8, the monotonic timestamp is the default
  and can only get reverted to wall-clock through a module-parameter.

- With the default monotonic timestamps, there is no problem at all.

- The drm_wait_vblank_ioctl() interface is alway safe on 64-bit
  architectures, on 32-bit it might overflow the 'long' timestamps
  in 2038 with wall-clock timestamps.

- The event handling uses 'u32' seconds, which overflow in 2106
  on both 32-bit and 64-bit machines, when wall-clock timestamps
  are used.

- The effect of overflowing either of the two is only temporary
  (during the overflow, and is likely to keep working again
  afterwards. It is likely the same problem as observing a
  'settimeofday()' call, which was the reason for moving to the
  monotonic timestamps in the first place.

Overall, this seems good enough, so my patch removes the use of
'timeval' from the vblank handling altogether and uses ktime_t
consistently, except for the part where we copy the data to user
space structures in the existing format.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
6 years agoMerge tag 'drm-intel-next-2017-09-29' of git://anongit.freedesktop.org/drm/drm-intel...
Dave Airlie [Thu, 12 Oct 2017 00:20:03 +0000 (10:20 +1000)]
Merge tag 'drm-intel-next-2017-09-29' of git://anongit.freedesktop.org/drm/drm-intel into drm-next

2nd batch of v4.15 features:

- lib/scatterlist updates, use for userptr allocations (Tvrtko)
- Fixed point wrapper cleanup (Mahesh)
- Gen9+ transition watermarks, watermark optimization and fixes (Mahesh)
- Display IPC (Isochronous Priority Control) support (Mahesh)
- GEM workaround fixes (Oscar)
- GVT: PCI config sanitize series (Changbin)
- GVT: Workload submission error handling series (Fred)
- PSR fixes and refactoring (Rodrigo)
- HWSP based optimizations (Chris)
- Private PAT management (Zhi)
- IRQ handling fixes and refactoring (Ville)
- Module parameter refactoring and variable name clash fix (Michal)
- Execlist refactoring, incomplete request unwinding on reset (Chris)
- GuC scheduling improvements (Michal)
- OA updates (Lionel)
- Coffeelake out of alpha support (Rodrigo)
- seqno fixes (Chris)
- Execlist refactoring (Mika)
- DP and DP MST cleanups (Dhinakaran)
- Cannonlake slice/sublice config (Ben)
- Numerous fixes all around (Everyone)

* tag 'drm-intel-next-2017-09-29' of git://anongit.freedesktop.org/drm/drm-intel: (168 commits)
  drm/i915: Update DRIVER_DATE to 20170929
  drm/i915: Use memset64() to prefill the GTT page
  drm/i915: Also discard second CRC on gen8+ platforms.
  drm/i915/psr: Set frames before SU entry for psr2
  drm/dp: Add defines for latency in sink
  drm/i915: Allow optimized platform checks
  drm/i915: Avoid using dev_priv->info.gen directly.
  i915: Use %pS printk format for direct addresses
  drm/i915/execlists: Notify context-out for lost requests
  drm/i915/cnl: Add support slice/subslice/eu configs
  drm/i915: Compact device info access by a small re-ordering
  drm/i915: Add IS_PLATFORM macro
  drm/i915/selftests: Try to recover from a wedged GPU during reset tests
  drm/i915/huc: Reorganize HuC authentication
  drm/i915: Fix default values of some modparams
  drm/i915: Extend I915_PARAMS_FOR_EACH with default member value
  drm/i915: Make I915_PARAMS_FOR_EACH macro more flexible
  drm/i915: Enable scanline read based on frame timestamps
  drm/i915/execlists: Microoptimise execlists_cancel_port_request()
  drm/i915: Don't rmw PIPESTAT enable bits
  ...

6 years agodrm: Pass struct drm_file * to __drm_mode_object_find [v2]
Keith Packard [Wed, 15 Mar 2017 06:25:07 +0000 (23:25 -0700)]
drm: Pass struct drm_file * to __drm_mode_object_find [v2]

This will allow __drm_mode_object_file to be extended to perform
access control checks based on the file in use.

v2: Also fix up vboxvideo driver in staging

[airlied: merging early as this is an API change]

Suggested-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
6 years agodrm/dp: WARN about invalid/unknown link rates and bw codes
Jani Nikula [Mon, 9 Oct 2017 09:29:57 +0000 (12:29 +0300)]
drm/dp: WARN about invalid/unknown link rates and bw codes

Falling back to the lowest value is likely the only thing we can do, but
doing it silently seems like a bad thing to do. Catch it early and make
loud noises.

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Thierry Reding <treding@nvidia.com>
Cc: Rob Clark <robdclark@gmail.com>
Cc: Sean Paul <seanpaul@chromium.org>
Cc: Manasi Navare <manasi.d.navare@intel.com>
Cc: dri-devel@lists.freedesktop.org
Reviewed-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Manasi Navare <manasi.d.navare@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171009092959.29021-1-jani.nikula@intel.com
6 years agoMerge tag 'regmap-poll-field' of git://git.kernel.org/pub/scm/linux/kernel/git/brooni...
Daniel Vetter [Wed, 11 Oct 2017 11:22:50 +0000 (13:22 +0200)]
Merge tag 'regmap-poll-field' of git://git./linux/kernel/git/broonie/regmap into drm-misc-next

regmap: Add field polling macro

Requested by Maxime Ripard to make sun4i compile again (next time
the other way round is better).

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20171004104732.jkps4ufekfizcrkz@sirena.co.uk
6 years agodrm/msm/mdp5: remove less than 0 comparison for unsigned value
Aishwarya Pant [Tue, 10 Oct 2017 18:42:07 +0000 (00:12 +0530)]
drm/msm/mdp5: remove less than 0 comparison for unsigned value

pipe is an unsigned int and less than zero comparison for unsigned
values is always false.

Detected using the following cocci script:

@@
unsigned int i;
@@
* i < 0

Signed-off-by: Aishwarya Pant <aishpant@gmail.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20171010184207.iv3dinrtwvbv7fei@aishwarya
6 years agodrm/bridge/sii8620: add remote control support
Maciej Purski [Thu, 24 Aug 2017 08:58:07 +0000 (10:58 +0200)]
drm/bridge/sii8620: add remote control support

MHL specification defines Remote Control Protocol(RCP) to
send input events between MHL devices.
The driver now recognizes RCP messages and reacts to them
by reporting key events to input subsystem, allowing
a user to control a device using TV remote control.

Signed-off-by: Maciej Purski <m.purski@samsung.com>
Acked-by: Sean Young <sean@mess.org>
Acked-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1503565087-19730-1-git-send-email-m.purski@samsung.com
6 years agodrm/sun4i: hdmi: Add support for A31's HDMI controller
Chen-Yu Tsai [Tue, 10 Oct 2017 03:20:06 +0000 (11:20 +0800)]
drm/sun4i: hdmi: Add support for A31's HDMI controller

The HDMI controller found in the A31 SoCs is slightly different
from the one already supported, which is found in the A10s:

  - Need different initial values for the PLL related registers

  - Different behavior of the DDC and TMDS clocks

  - Different register layout for the DDC portion

  - Separate DDC parent clock

This patch adds support for it.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171010032008.682-10-wens@csie.org
6 years agodrm/sun4i: hdmi: Add A31 specific DDC register definitions
Chen-Yu Tsai [Tue, 10 Oct 2017 03:20:05 +0000 (11:20 +0800)]
drm/sun4i: hdmi: Add A31 specific DDC register definitions

The DDC block for the HDMI controller is different on the A31.

This patch adds the register definitions.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171010032008.682-9-wens@csie.org
6 years agodrm/sun4i: hdmi: Add support for controller hardware variants
Chen-Yu Tsai [Tue, 10 Oct 2017 03:20:04 +0000 (11:20 +0800)]
drm/sun4i: hdmi: Add support for controller hardware variants

The HDMI controller found in earlier Allwinner SoCs have slight
differences between the A10, A10s, and the A31:

  - Need different initial values for the PLL related registers

  - Different behavior of the DDC and TMDS clocks

  - Different register layout for the DDC portion

  - Separate DDC parent clock on the A31

  - Explicit reset control

For the A31, the HDMI TMDS clock has a different value offset for
the divider. The HDMI DDC block is different from the one in the
other SoCs. As far as the DDC clock goes, it has no pre-divider,
as it is clocked from a slower parent clock, not the TMDS clock.
The divider offset from the register value is different. And the
clock control register is at a different offset.

A new variant data structure is created to store pointers to the
above functions, structures, and the different initial values.
Another flag notates whether there is a separate DDC parent clock.
If not, the TMDS clock is passed to the DDC clock create function,
as before.

Regmap fields are used to deal with the different register layout
of the DDC block.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171010032008.682-8-wens@csie.org
6 years agodt-bindings: display: sun4i: Add binding for A31 HDMI controller
Chen-Yu Tsai [Tue, 10 Oct 2017 03:20:03 +0000 (11:20 +0800)]
dt-bindings: display: sun4i: Add binding for A31 HDMI controller

The HDMI controller in the A31 SoC is slightly different from the
earlier version. In addition to the TMDS clock and DDC controls,
this version now takes a second DDC clock input.

Add a compatible string for it, and add the DDC clock input to the
list of clocks required.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171010032008.682-7-wens@csie.org
6 years agodrm/sun4i: hdmi: Allow using second PLL as TMDS clk parent
Chen-Yu Tsai [Tue, 10 Oct 2017 03:20:02 +0000 (11:20 +0800)]
drm/sun4i: hdmi: Allow using second PLL as TMDS clk parent

On SoCs with two display pipelines, it is possible that the two
pipelines are active at the same time, with potentially incompatible
dot clocks.

Let the HDMI encoder's TMDS clock go through all of its parents when
calculating possible clock rates. This allows usage of the second video
PLL as its parent.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171010032008.682-6-wens@csie.org
6 years agodrm/sun4i: hdmi: create a regmap for later use
Chen-Yu Tsai [Tue, 10 Oct 2017 03:20:01 +0000 (11:20 +0800)]
drm/sun4i: hdmi: create a regmap for later use

The HDMI driver is written with readl/writel I/O to the registers.
However, to support the A31 variant, which has a different layout
for the DDC registers, it was recommended to use regfields to have
a cleaner implementation. To use regfields, we need to create an
underlying regmap.

This patch only adds the regmap. It does not convert the existing
driver accesses to use regmap.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171010032008.682-5-wens@csie.org
6 years agodrm/sun4i: hdmi: Disable clks in bind function error path and unbind function
Chen-Yu Tsai [Tue, 10 Oct 2017 03:20:00 +0000 (11:20 +0800)]
drm/sun4i: hdmi: Disable clks in bind function error path and unbind function

The HDMI driver enables the bus and mod clocks in the bind function, but
does not disable them if it then bails our due to any errors. Neither
does it disable the clocks in the unbind function.

Fix this by adding a proper error path to the bind function, and
clk_disable_unprepare calls to the unbind function.

Also rename the err_cleanup_connector label to err_cleanup_encoder,
since it is the encoder that gets cleaned up.

Fixes: 9c5681011a0c ("drm/sun4i: Add HDMI support")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171010032008.682-4-wens@csie.org
6 years agodrm/sun4i: tcon: Add support for demuxing TCON output on A31
Chen-Yu Tsai [Tue, 10 Oct 2017 03:19:59 +0000 (11:19 +0800)]
drm/sun4i: tcon: Add support for demuxing TCON output on A31

On systems with 2 TCONs such as the A31, it is possible to demux the
output of the TCONs to one encoder.

Add support for this for the A31.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171010032008.682-3-wens@csie.org
6 years agodrm/sun4i: tcon: Add variant callback for TCON output muxing
Chen-Yu Tsai [Tue, 10 Oct 2017 03:19:58 +0000 (11:19 +0800)]
drm/sun4i: tcon: Add variant callback for TCON output muxing

Different SoCs have different muxing options and values for the TCON
outputs. Instead of stuffing every possibility in sun4i_tcon_set_mux(),
add a callback pointer to sun4i_tcon_quirks that each TCON variant
can use to provide muxing support.

The current muxing options in sun4i_tcon_set_mux() for sun5i-a13 are
moved to a new sun5i-specific callback function.

Since the new callback replaces what the .has_unknown_mux field in
tcon quirks did in the past, the field is removed.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171010032008.682-2-wens@csie.org
6 years agodrm/bridge/synopsys: dsi :remove is_panel_bridge
benjamin.gaignard@linaro.org [Mon, 2 Oct 2017 09:34:48 +0000 (11:34 +0200)]
drm/bridge/synopsys: dsi :remove is_panel_bridge

When using drm_of_panel_bridge_remove() we can simplify the
code and remove is_panel_bridge from dw_mipi_dsi structure.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Reviewed-by: Philippe Cornu <philippe.cornu@st.com>
Tested-by: Philippe Cornu <philippe.cornu@st.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1506936888-23844-6-git-send-email-benjamin.gaignard@linaro.org
6 years agodrm/vc4: remove bridge from driver internal structure
benjamin.gaignard@linaro.org [Mon, 2 Oct 2017 09:34:47 +0000 (11:34 +0200)]
drm/vc4: remove bridge from driver internal structure

With a call to drm_of_panel_bridge_remove() we could remove
the bridge without store it in vc4_dpi internal driver structure.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/1506936888-23844-5-git-send-email-benjamin.gaignard@linaro.org
6 years agodrm/stm: ltdc: remove bridge from driver internal structure
benjamin.gaignard@linaro.org [Mon, 2 Oct 2017 09:34:46 +0000 (11:34 +0200)]
drm/stm: ltdc: remove bridge from driver internal structure

With a call to drm_of_panel_bridge_remove() we could remove the bridge
without store it in ldtc internal driver structure.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Reviewed-by: Philippe Cornu <philippe.cornu@st.com>
Tested-by: Philippe Cornu <philippe.cornu@st.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1506936888-23844-4-git-send-email-benjamin.gaignard@linaro.org
6 years agodrm/drm_of: add drm_of_panel_bridge_remove function
benjamin.gaignard@linaro.org [Mon, 2 Oct 2017 09:34:45 +0000 (11:34 +0200)]
drm/drm_of: add drm_of_panel_bridge_remove function

This function is the pendant of drm_of_find_panel_or_bridge()
to remove a previously allocated panel_bridge.
Given a specific port and endpoint it remove the panel bridge.
Since drm_panel_bridge_remove() will check that bridge parameter
is not NULL and is a real drm_panel_bridge and no a simple bridge
it is safe to call it directly.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Reviewed-by: Philippe Cornu <philippe.cornu@st.com>
Tested-by: Philippe Cornu <philippe.cornu@st.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1506936888-23844-3-git-send-email-benjamin.gaignard@linaro.org
6 years agodrm/bridge: make drm_panel_bridge_remove more robust
benjamin.gaignard@linaro.org [Mon, 2 Oct 2017 09:32:31 +0000 (11:32 +0200)]
drm/bridge: make drm_panel_bridge_remove more robust

Make sure that bridge parameter is not NULL and can be safely
cast into a panel_bridge structure.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Reviewed-by: Philippe Cornu <philippe.cornu@st.com>
Tested-by: Philippe Cornu <philippe.cornu@st.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1506936755-23625-2-git-send-email-benjamin.gaignard@linaro.org
6 years agodma-fence: fix dma_fence_get_rcu_safe v2
Christian König [Fri, 15 Sep 2017 09:53:07 +0000 (11:53 +0200)]
dma-fence: fix dma_fence_get_rcu_safe v2

When dma_fence_get_rcu() fails to acquire a reference it doesn't necessary
mean that there is no fence at all.

It usually mean that the fence was replaced by a new one and in this situation
we certainly want to have the new one as result and *NOT* NULL.

v2: Keep extra check after dma_fence_get_rcu().

Signed-off-by: Christian König <christian.koenig@amd.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: linux-media@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: linaro-mm-sig@lists.linaro.org
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1505469187-3565-1-git-send-email-deathsimple@vodafone.de
6 years agodma-buf: make reservation_object_copy_fences rcu save
Christian König [Mon, 4 Sep 2017 19:02:45 +0000 (21:02 +0200)]
dma-buf: make reservation_object_copy_fences rcu save

Stop requiring that the src reservation object is locked for this operation.

Acked-by: Chunming Zhou <david1.zhou@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1504551766-5093-1-git-send-email-deathsimple@vodafone.de
6 years agodrm/atomic: Unref duplicated drm_atomic_state in drm_atomic_helper_resume()
Jeffy Chen [Mon, 9 Oct 2017 06:46:41 +0000 (14:46 +0800)]
drm/atomic: Unref duplicated drm_atomic_state in drm_atomic_helper_resume()

Kmemleak reported memory leak after suspend and resume:
unreferenced object 0xffffffc0e31d8880 (size 128):
  comm "bash", pid 181, jiffies 4294763583 (age 24.694s)
  hex dump (first 32 bytes):
    01 00 00 00 00 00 00 00 00 20 a2 eb c0 ff ff ff  ......... ......
    01 00 00 00 00 00 00 00 80 87 1d e3 c0 ff ff ff  ................
  backtrace:
    [<ffffffc00034bb64>] __save_stack_trace+0x48/0x6c
    [<ffffffc00034c244>] create_object+0x138/0x254
    [<ffffffc0009dd218>] kmemleak_alloc+0x58/0x8c
    [<ffffffc000346de4>] kmem_cache_alloc_trace+0x188/0x254
    [<ffffffc0005af4c0>] drm_atomic_state_alloc+0x3c/0x88
    [<ffffffc000591f0c>] drm_atomic_helper_duplicate_state+0x28/0x158
    [<ffffffc000592098>] drm_atomic_helper_suspend+0x5c/0xf0

Problem here is that we are duplicating the drm_atomic_state in
drm_atomic_helper_suspend(), but not unreference it in the resume path.

Fixes: 1494276000db ("drm/atomic-helper: Implement subsystem-level suspend/resume")
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171009064641.15174-1-jeffy.chen@rock-chips.com
Fixes: 0853695c3ba4 ("drm: Add reference counting to drm_atomic_state")
Cc: <stable@vger.kernel.org> # v4.10+
6 years agodrm: adv7511/33: add HDMI CEC support
Hans Verkuil [Sat, 7 Oct 2017 10:46:58 +0000 (12:46 +0200)]
drm: adv7511/33: add HDMI CEC support

Add support for HDMI CEC to the drm adv7511/adv7533 drivers.

The CEC registers that we need to use are identical for both drivers,
but they appear at different offsets in the register map.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20171007104658.14528-3-hverkuil@xs4all.nl
6 years agodt-bindings: adi,adv7511.txt: document cec clock
Hans Verkuil [Sat, 7 Oct 2017 10:46:57 +0000 (12:46 +0200)]
dt-bindings: adi,adv7511.txt: document cec clock

Document the cec clock binding.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20171007104658.14528-2-hverkuil@xs4all.nl
6 years agoMerge branch 'drm-next-4.15' of git://people.freedesktop.org/~agd5f/linux into drm...
Dave Airlie [Mon, 9 Oct 2017 01:00:16 +0000 (11:00 +1000)]
Merge branch 'drm-next-4.15' of git://people.freedesktop.org/~agd5f/linux into drm-next

More new stuff for 4.15. Highlights:
- Add clock query interface for raven
- Add new FENCE_TO_HANDLE ioctl
- UVD video encode ring support on polaris
- transparent huge page DMA support
- deadlock fixes
- compute pipe lru tweaks
- powerplay cleanups and regression fixes
- fix duplicate symbol issue with radeon and amdgpu
- misc bug fixes

* 'drm-next-4.15' of git://people.freedesktop.org/~agd5f/linux: (72 commits)
  drm/radeon/dp: make radeon_dp_get_dp_link_config static
  drm/radeon: move ci_send_msg_to_smc to where it's used
  drm/amd/sched: fix deadlock caused by unsignaled fences of deleted jobs
  drm/amd/sched: NULL out the s_fence field after run_job
  drm/amd/sched: move adding finish callback to amd_sched_job_begin
  drm/amd/sched: fix an outdated comment
  drm/amd/sched: rename amd_sched_entity_pop_job
  drm/amdgpu: minor coding style fix
  drm/ttm: add transparent huge page support for DMA allocations v2
  drm/ttm: add support for different pool sizes
  drm/ttm: remove unsued options from ttm_mem_global_alloc_page
  drm/amdgpu: add uvd enc irq
  drm/amdgpu: add uvd enc ib test
  drm/amdgpu: add uvd enc ring test
  drm/amdgpu: add uvd enc vm functions (v2)
  drm/amdgpu: add uvd enc into run queue
  drm/amdgpu: add uvd enc rings
  drm/amdgpu: add new uvd enc ring methods
  drm/amdgpu: add uvd enc command in header
  drm/amdgpu: add uvd enc registers in header
  ...

6 years agodrm/radeon/dp: make radeon_dp_get_dp_link_config static
Alex Deucher [Fri, 29 Sep 2017 15:35:52 +0000 (11:35 -0400)]
drm/radeon/dp: make radeon_dp_get_dp_link_config static

It's not used outside this file any longer.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/radeon: move ci_send_msg_to_smc to where it's used
Alex Deucher [Fri, 29 Sep 2017 14:07:40 +0000 (10:07 -0400)]
drm/radeon: move ci_send_msg_to_smc to where it's used

It's used in ci_dpm.c so move it there and make it static.

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/gem-fb-helper: Improve documentation
Noralf Trønnes [Fri, 22 Sep 2017 15:47:44 +0000 (17:47 +0200)]
drm/gem-fb-helper: Improve documentation

Make the docs read a little better.

Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/1506095264-41622-1-git-send-email-noralf@tronnes.org
6 years agodrm/amd/sched: fix deadlock caused by unsignaled fences of deleted jobs
Nicolai Hähnle [Thu, 28 Sep 2017 09:57:32 +0000 (11:57 +0200)]
drm/amd/sched: fix deadlock caused by unsignaled fences of deleted jobs

Highly concurrent Piglit runs can trigger a race condition where a pending
SDMA job on a buffer object is never executed because the corresponding
process is killed (perhaps due to a crash). Since the job's fences were
never signaled, the buffer object was effectively leaked. Worse, the
buffer was stuck wherever it happened to be at the time, possibly in VRAM.

The symptom was user space processes stuck in interruptible waits with
kernel stacks like:

    [<ffffffffbc5e6722>] dma_fence_default_wait+0x112/0x250
    [<ffffffffbc5e6399>] dma_fence_wait_timeout+0x39/0xf0
    [<ffffffffbc5e82d2>] reservation_object_wait_timeout_rcu+0x1c2/0x300
    [<ffffffffc03ce56f>] ttm_bo_cleanup_refs_and_unlock+0xff/0x1a0 [ttm]
    [<ffffffffc03cf1ea>] ttm_mem_evict_first+0xba/0x1a0 [ttm]
    [<ffffffffc03cf611>] ttm_bo_mem_space+0x341/0x4c0 [ttm]
    [<ffffffffc03cfc54>] ttm_bo_validate+0xd4/0x150 [ttm]
    [<ffffffffc03cffbd>] ttm_bo_init_reserved+0x2ed/0x420 [ttm]
    [<ffffffffc042f523>] amdgpu_bo_create_restricted+0x1f3/0x470 [amdgpu]
    [<ffffffffc042f9fa>] amdgpu_bo_create+0xda/0x220 [amdgpu]
    [<ffffffffc04349ea>] amdgpu_gem_object_create+0xaa/0x140 [amdgpu]
    [<ffffffffc0434f97>] amdgpu_gem_create_ioctl+0x97/0x120 [amdgpu]
    [<ffffffffc037ddba>] drm_ioctl+0x1fa/0x480 [drm]
    [<ffffffffc041904f>] amdgpu_drm_ioctl+0x4f/0x90 [amdgpu]
    [<ffffffffbc23db33>] do_vfs_ioctl+0xa3/0x5f0
    [<ffffffffbc23e0f9>] SyS_ioctl+0x79/0x90
    [<ffffffffbc864ffb>] entry_SYSCALL_64_fastpath+0x1e/0xad
    [<ffffffffffffffff>] 0xffffffffffffffff

Note: The correctness of this change depends on the earlier commit
"drm/amd/sched: move adding finish callback to amd_sched_job_begin"

v2: set an error on the finished fence

Signed-off-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Andres Rodriguez <andresx7@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/sched: NULL out the s_fence field after run_job
Nicolai Hähnle [Thu, 28 Sep 2017 09:51:32 +0000 (11:51 +0200)]
drm/amd/sched: NULL out the s_fence field after run_job

amd_sched_process_job drops the fence reference, so NULL out the s_fence
field before adding it as a callback to guard against accidentally using
s_fence after it may have be freed.

v2: add a clarifying comment

Signed-off-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Andres Rodriguez <andresx7@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/sched: move adding finish callback to amd_sched_job_begin
Nicolai Hähnle [Thu, 28 Sep 2017 09:37:02 +0000 (11:37 +0200)]
drm/amd/sched: move adding finish callback to amd_sched_job_begin

The finish callback is responsible for removing the job from the ring
mirror list, among other things. It makes sense to add it as callback
in the place where the job is added to the ring mirror list.

Signed-off-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Andres Rodriguez <andresx7@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/sched: fix an outdated comment
Nicolai Hähnle [Thu, 28 Sep 2017 09:35:05 +0000 (11:35 +0200)]
drm/amd/sched: fix an outdated comment

Signed-off-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Andres Rodriguez <andresx7@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/sched: rename amd_sched_entity_pop_job
Nicolai Hähnle [Thu, 28 Sep 2017 09:21:15 +0000 (11:21 +0200)]
drm/amd/sched: rename amd_sched_entity_pop_job

The function does not actually remove the job from the FIFO, so "peek"
describes it better.

Signed-off-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Andres Rodriguez <andresx7@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: minor coding style fix
Christian König [Mon, 18 Sep 2017 12:01:45 +0000 (14:01 +0200)]
drm/amdgpu: minor coding style fix

Fix two minor 80 char issues.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/ttm: add transparent huge page support for DMA allocations v2
Christian König [Thu, 6 Jul 2017 07:59:43 +0000 (09:59 +0200)]
drm/ttm: add transparent huge page support for DMA allocations v2

Try to allocate huge pages when it makes sense.

v2: fix comment and use ifdef

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/ttm: add support for different pool sizes
Christian König [Tue, 4 Jul 2017 14:56:24 +0000 (16:56 +0200)]
drm/ttm: add support for different pool sizes

Correctly handle different page sizes in the memory accounting.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/ttm: remove unsued options from ttm_mem_global_alloc_page
Christian König [Mon, 18 Sep 2017 13:45:11 +0000 (15:45 +0200)]
drm/ttm: remove unsued options from ttm_mem_global_alloc_page

Nobody is actually using that, remove it.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: add uvd enc irq
James Zhu [Fri, 29 Sep 2017 20:47:31 +0000 (16:47 -0400)]
drm/amdgpu: add uvd enc irq

Add UVD encode IRQ handle and enable the UVD encode trap

Signed-off-by: James Zhu <James.Zhu@amd.com>
Reviewed-and-Tested-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: add uvd enc ib test
James Zhu [Fri, 29 Sep 2017 20:42:27 +0000 (16:42 -0400)]
drm/amdgpu: add uvd enc ib test

Generate create/destroy messages to test UVD encode indirect buffer function.
And enable UVD encode IB test during device initialization.

Signed-off-by: James Zhu <James.Zhu@amd.com>
Reviewed-and-Tested-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: add uvd enc ring test
James Zhu [Fri, 29 Sep 2017 20:40:12 +0000 (16:40 -0400)]
drm/amdgpu: add uvd enc ring test

Add UVD encode ring test functions. And enable UVD encode ring test
during UVD encode hardware initialization.

Signed-off-by: James Zhu <James.Zhu@amd.com>
Reviewed-and-Tested-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: add uvd enc vm functions (v2)
James Zhu [Fri, 29 Sep 2017 20:37:11 +0000 (16:37 -0400)]
drm/amdgpu: add uvd enc vm functions (v2)

Add UVD encode ring vm functions to handle frame ecoding.

v2: squash in warning fix (James)

Signed-off-by: James Zhu <James.Zhu@amd.com>
Reviewed-and-Tested-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: add uvd enc into run queue
James Zhu [Fri, 29 Sep 2017 19:20:23 +0000 (15:20 -0400)]
drm/amdgpu: add uvd enc into run queue

Signed-off-by: James Zhu <James.Zhu@amd.com>
Reviewed-and-Tested-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: add uvd enc rings
James Zhu [Fri, 29 Sep 2017 21:29:06 +0000 (17:29 -0400)]
drm/amdgpu: add uvd enc rings

UVD 6.3 has two UVD encode rings.  Add the ring structures and initialize the hw ring buffers.
Currently only ASIC Polaris10/11/12 uses UVD6.3 encode engine on HEVC encoding.

Signed-off-by: James Zhu <James.Zhu@amd.com>
Reviewed-and-Tested-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: add new uvd enc ring methods
James Zhu [Fri, 29 Sep 2017 20:14:26 +0000 (16:14 -0400)]
drm/amdgpu: add new uvd enc ring methods

Add new UVD encode ring methods get/set/emit/flush/sync to support uvd6.3 HEVC encoding

Signed-off-by: James Zhu <James.Zhu@amd.com>
Reviewed-and-Tested-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: add uvd enc command in header
James Zhu [Fri, 29 Sep 2017 18:17:34 +0000 (14:17 -0400)]
drm/amdgpu: add uvd enc command in header

Add UVD encode command interface definition for uvd6.3 HEVC encoding

Signed-off-by: James Zhu <James.Zhu@amd.com>
Reviewed-and-Tested-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: add uvd enc registers in header
James Zhu [Mon, 2 Oct 2017 00:00:07 +0000 (20:00 -0400)]
drm/amdgpu: add uvd enc registers in header

Add UVD encode write/read/size/base registers definition for uvd6.3 HEVC ecoding

Signed-off-by: James Zhu <James.Zhu@amd.com>
Reviewed-and-Tested-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/powerplay: fix mclk can't switch on Tonga
Rex Zhu [Fri, 6 Oct 2017 04:17:16 +0000 (12:17 +0800)]
drm/amd/powerplay: fix mclk can't switch on Tonga

regression issue caused by
commit 47047263c52779f1f3393c32e3e53661b53a372e
("drm/amd/powerplay: delete eventmgr related files.")

Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/powerplay: Partially revert changes and fix smu7_notify_smc_display()
Tom St Denis [Wed, 4 Oct 2017 17:44:52 +0000 (13:44 -0400)]
drm/amd/powerplay:  Partially revert changes and fix smu7_notify_smc_display()

This partially reverts 0b6b4cbf77c995a34a4ec3d705a636434dadc51a and fixes
the noise issues on Tonga.

Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/powerplay: fix typo on avfs disable
Evan Quan [Sat, 30 Sep 2017 01:13:47 +0000 (09:13 +0800)]
drm/amd/powerplay: fix typo on avfs disable

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/powerplay: get raven sclk and mclk levels (v2)
Evan Quan [Tue, 26 Sep 2017 03:51:58 +0000 (11:51 +0800)]
drm/amd/powerplay: get raven sclk and mclk levels (v2)

v2: squash in rebase fix (Tom)

Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/powerplay: get raven current sclk and mclk (v2)
Evan Quan [Tue, 26 Sep 2017 03:49:28 +0000 (11:49 +0800)]
drm/amd/powerplay: get raven current sclk and mclk (v2)

v2: squash in rebase fix (Tom)

Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/powerplay: get raven max/min gfx clocks (v2)
Evan Quan [Tue, 26 Sep 2017 03:43:35 +0000 (11:43 +0800)]
drm/amd/powerplay: get raven max/min gfx clocks (v2)

v2: squash in rebase fix (Tom)

Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/powerplay: added new raven ppsmc messages
Evan Quan [Tue, 26 Sep 2017 03:37:34 +0000 (11:37 +0800)]
drm/amd/powerplay: added new raven ppsmc messages

Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/powerplay: fixed wrong return value on error (v2)
Evan Quan [Tue, 26 Sep 2017 03:35:30 +0000 (11:35 +0800)]
drm/amd/powerplay: fixed wrong return value on error (v2)

v2: squash in typo fix (Tom)

Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: Fixed a potential circular lock
ozeng [Wed, 27 Sep 2017 21:53:12 +0000 (17:53 -0400)]
drm/amdgpu: Fixed a potential circular lock

The dead circular lock senario captured is as followed.
The idea of the fix is moving read_user_wptr outside of
acquire_queue...release_queue critical section

[   63.477482] WARNING: possible circular locking dependency detected
[   63.484091] 4.12.0-kfd-ozeng #3 Not tainted
[   63.488531] ------------------------------------------------------
[   63.495146] HelloWorldLoop/2526 is trying to acquire lock:
[   63.501011]  (&mm->mmap_sem){++++++}, at: [<ffffffff911898ce>] __might_fault+0x3e/0x90
[   63.509472]
               but task is already holding lock:
[   63.515716]  (&adev->srbm_mutex){+.+...}, at: [<ffffffffc0484feb>] lock_srbm+0x2b/0x50 [amdgpu]
[   63.525099]
               which lock already depends on the new lock.

[   63.533841]
               the existing dependency chain (in reverse order) is:
[   63.541839]
               -> #2 (&adev->srbm_mutex){+.+...}:
[   63.548178]        lock_acquire+0x6d/0x90
[   63.552461]        __mutex_lock+0x70/0x8c0
[   63.556826]        mutex_lock_nested+0x16/0x20
[   63.561603]        gfx_v8_0_kiq_resume+0x1039/0x14a0 [amdgpu]
[   63.567817]        gfx_v8_0_hw_init+0x204d/0x2210 [amdgpu]
[   63.573675]        amdgpu_device_init+0xdea/0x1790 [amdgpu]
[   63.579640]        amdgpu_driver_load_kms+0x63/0x220 [amdgpu]
[   63.585743]        drm_dev_register+0x145/0x1e0
[   63.590605]        amdgpu_pci_probe+0x11e/0x160 [amdgpu]
[   63.596266]        local_pci_probe+0x40/0xa0
[   63.600803]        pci_device_probe+0x134/0x150
[   63.605650]        driver_probe_device+0x2a1/0x460
[   63.610785]        __driver_attach+0xdc/0xe0
[   63.615321]        bus_for_each_dev+0x5f/0x90
[   63.619984]        driver_attach+0x19/0x20
[   63.624337]        bus_add_driver+0x40/0x270
[   63.628908]        driver_register+0x5b/0xe0
[   63.633446]        __pci_register_driver+0x5b/0x60
[   63.638586]        rtsx_pci_switch_output_voltage+0x1d/0x20 [rtsx_pci]
[   63.645564]        do_one_initcall+0x4c/0x1b0
[   63.650205]        do_init_module+0x56/0x1ea
[   63.654767]        load_module+0x208c/0x27d0
[   63.659335]        SYSC_finit_module+0x96/0xd0
[   63.664058]        SyS_finit_module+0x9/0x10
[   63.668629]        entry_SYSCALL_64_fastpath+0x1f/0xbe
[   63.674088]
               -> #1 (reservation_ww_class_mutex){+.+.+.}:
[   63.681257]        lock_acquire+0x6d/0x90
[   63.685551]        __ww_mutex_lock.constprop.11+0x8c/0xed0
[   63.691426]        ww_mutex_lock+0x67/0x70
[   63.695802]        amdgpu_verify_access+0x6d/0x100 [amdgpu]
[   63.701743]        ttm_bo_mmap+0x8e/0x100 [ttm]
[   63.706615]        amdgpu_bo_mmap+0xd/0x60 [amdgpu]
[   63.711814]        amdgpu_mmap+0x35/0x40 [amdgpu]
[   63.716904]        mmap_region+0x3b5/0x5a0
[   63.721255]        do_mmap+0x400/0x4d0
[   63.725260]        vm_mmap_pgoff+0xb0/0xf0
[   63.729625]        SyS_mmap_pgoff+0x19e/0x260
[   63.734292]        SyS_mmap+0x1d/0x20
[   63.738199]        entry_SYSCALL_64_fastpath+0x1f/0xbe
[   63.743681]
               -> #0 (&mm->mmap_sem){++++++}:
[   63.749641]        __lock_acquire+0x1401/0x1420
[   63.754491]        lock_acquire+0x6d/0x90
[   63.758750]        __might_fault+0x6b/0x90
[   63.763176]        kgd_hqd_load+0x24f/0x270 [amdgpu]
[   63.768432]        load_mqd+0x4b/0x50 [amdkfd]
[   63.773192]        create_queue_nocpsch+0x535/0x620 [amdkfd]
[   63.779237]        pqm_create_queue+0x34d/0x4f0 [amdkfd]
[   63.784835]        kfd_ioctl_create_queue+0x282/0x670 [amdkfd]
[   63.790973]        kfd_ioctl+0x310/0x4d0 [amdkfd]
[   63.795944]        do_vfs_ioctl+0x90/0x6e0
[   63.800268]        SyS_ioctl+0x74/0x80
[   63.804207]        entry_SYSCALL_64_fastpath+0x1f/0xbe
[   63.809607]
               other info that might help us debug this:

[   63.818026] Chain exists of:
                 &mm->mmap_sem --> reservation_ww_class_mutex --> &adev->srbm_mutex

[   63.830382]  Possible unsafe locking scenario:

[   63.836605]        CPU0                    CPU1
[   63.841364]        ----                    ----
[   63.846123]   lock(&adev->srbm_mutex);
[   63.850061]                                lock(reservation_ww_class_mutex);
[   63.857475]                                lock(&adev->srbm_mutex);
[   63.864084]   lock(&mm->mmap_sem);
[   63.867657]
                *** DEADLOCK ***

[   63.873884] 3 locks held by HelloWorldLoop/2526:
[   63.878739]  #0:  (&process->mutex){+.+.+.}, at: [<ffffffffc06e1a9a>] kfd_ioctl_create_queue+0x24a/0x670 [amdkfd]
[   63.889543]  #1:  (&dqm->lock){+.+...}, at: [<ffffffffc06eedeb>] create_queue_nocpsch+0x3b/0x620 [amdkfd]
[   63.899684]  #2:  (&adev->srbm_mutex){+.+...}, at: [<ffffffffc0484feb>] lock_srbm+0x2b/0x50 [amdgpu]
[   63.909500]
               stack backtrace:
[   63.914187] CPU: 3 PID: 2526 Comm: HelloWorldLoop Not tainted 4.12.0-kfd-ozeng #3
[   63.922184] Hardware name: AMD Carrizo/Gardenia, BIOS WGA5819N_Weekly_15_08_1 08/19/2015
[   63.930865] Call Trace:
[   63.933464]  dump_stack+0x85/0xc9
[   63.936999]  print_circular_bug+0x1f9/0x207
[   63.941442]  __lock_acquire+0x1401/0x1420
[   63.945745]  ? lock_srbm+0x2b/0x50 [amdgpu]
[   63.950185]  lock_acquire+0x6d/0x90
[   63.953885]  ? __might_fault+0x3e/0x90
[   63.957899]  __might_fault+0x6b/0x90
[   63.961699]  ? __might_fault+0x3e/0x90
[   63.965755]  kgd_hqd_load+0x24f/0x270 [amdgpu]
[   63.970577]  load_mqd+0x4b/0x50 [amdkfd]
[   63.974745]  create_queue_nocpsch+0x535/0x620 [amdkfd]
[   63.980242]  pqm_create_queue+0x34d/0x4f0 [amdkfd]
[   63.985320]  kfd_ioctl_create_queue+0x282/0x670 [amdkfd]
[   63.991021]  kfd_ioctl+0x310/0x4d0 [amdkfd]
[   63.995499]  ? kfd_ioctl_destroy_queue+0x70/0x70 [amdkfd]
[   64.001234]  do_vfs_ioctl+0x90/0x6e0
[   64.005065]  ? up_read+0x1a/0x40
[   64.008496]  SyS_ioctl+0x74/0x80
[   64.011955]  entry_SYSCALL_64_fastpath+0x1f/0xbe
[   64.016863] RIP: 0033:0x7f4b3bd35f07
[   64.020696] RSP: 002b:00007ffe7689ec38 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
[   64.028786] RAX: ffffffffffffffda RBX: 00000000002a2000 RCX: 00007f4b3bd35f07
[   64.036414] RDX: 00007ffe7689ecb0 RSI: 00000000c0584b02 RDI: 0000000000000005
[   64.044045] RBP: 00007f4a3212d000 R08: 00007f4b3c919000 R09: 0000000000080000
[   64.051674] R10: 00007f4b376b64b8 R11: 0000000000000246 R12: 00007f4a3212d000
[   64.059324] R13: 0000000000000015 R14: 0000000000000064 R15: 00007ffe7689ef50

Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/radeon: make functions alloc_pasid and free_pasid static
Colin Ian King [Thu, 28 Sep 2017 13:46:17 +0000 (14:46 +0100)]
drm/radeon: make functions alloc_pasid and free_pasid static

The functions alloc_pasid  and free_pasid are local to the
source and do not need to be in global scope, so make them static.

Cleans up sparse warnings:
warning: symbol 'alloc_pasid' was not declared. Should it be static?
warning: symbol 'free_pasid' was not declared. Should it be static?

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amdgpu: add FENCE_TO_HANDLE ioctl that returns syncobj or sync_file
Marek Olšák [Tue, 12 Sep 2017 20:42:14 +0000 (22:42 +0200)]
drm/amdgpu: add FENCE_TO_HANDLE ioctl that returns syncobj or sync_file

for being able to convert an amdgpu fence into one of the handles.
Mesa will use this.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/syncobj: add a new helper drm_syncobj_get_fd
Marek Olšák [Tue, 12 Sep 2017 20:42:13 +0000 (22:42 +0200)]
drm/syncobj: add a new helper drm_syncobj_get_fd

Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/syncobj: extract two helpers from drm_syncobj_create
Marek Olšák [Tue, 12 Sep 2017 20:42:12 +0000 (22:42 +0200)]
drm/syncobj: extract two helpers from drm_syncobj_create

For amdgpu.

drm_syncobj_create is renamed to drm_syncobj_create_as_handle, and new
helpers drm_syncobj_create and drm_syncobj_get_handle are added.

Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/powerplay: delete flag PP_VALID
Rex Zhu [Thu, 28 Sep 2017 08:12:51 +0000 (16:12 +0800)]
drm/amd/powerplay: delete flag PP_VALID

don't need to check pp_valid, all pp
export functions are moved to ip_funcs
and pp_funcs. so just need to check the
function point.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/powerplay: move set_clockgating_by_smu to pp func table
Rex Zhu [Tue, 26 Sep 2017 05:39:38 +0000 (13:39 +0800)]
drm/amd/powerplay: move set_clockgating_by_smu to pp func table

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/amd/powerplay: tidy up ret checks in amd_powerplay.c (v3)
Rex Zhu [Fri, 29 Sep 2017 06:36:15 +0000 (14:36 +0800)]
drm/amd/powerplay: tidy up ret checks in amd_powerplay.c (v3)

v2: squash in regression fix (Rex)
v3: Squash in regression fix (Rex)

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agodrm/panel: Add support for the Raspberry Pi 7" Touchscreen.
Eric Anholt [Wed, 27 Sep 2017 19:36:54 +0000 (12:36 -0700)]
drm/panel: Add support for the Raspberry Pi 7" Touchscreen.

This driver communicates with the Atmel microcontroller for sequencing
the poweron of the TC358762 DSI-DPI bridge and controlling the
backlight PWM.

v2: Set the same default orientation as the closed source firmware
    used, which is the best for viewing angle.
v3: Rewrite as an i2c client driver after bridge driver rejection.
v4: Finish probe without the DSI host, using the new delayed
    registration, and attach to the host during mipi_dsi_driver probe.
v5: Rework to drop the "probe without DSI host" mode again, now that
    vc4 will create the host early on.
v6: Drop unused brightness #define (noticed by Thierry)

Signed-off-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20170927193654.12609-4-eric@anholt.net
Reviewed-by: Archit Taneja <architt@codeaurora.org>
Acked-by: Thierry Reding <treding@nvidia.com>
6 years agodt-bindings: Document the Raspberry Pi Touchscreen nodes.
Eric Anholt [Wed, 27 Sep 2017 19:36:53 +0000 (12:36 -0700)]
dt-bindings: Document the Raspberry Pi Touchscreen nodes.

This doesn't yet cover input, but the driver does get the display
working when the firmware is disabled from talking to our I2C lines.

Signed-off-by: Eric Anholt <eric@anholt.net>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20170927193654.12609-3-eric@anholt.net
6 years agodrm/bridge: add Silicon Image SiI9234 driver
Maciej Purski [Thu, 5 Oct 2017 14:07:10 +0000 (16:07 +0200)]
drm/bridge: add Silicon Image SiI9234 driver

SiI9234 transmitter converts eTMDS/HDMI signal to MHL 1.0.
It is controlled via I2C bus. Its interaction with other
devices in video pipeline is performed mainly on HW level.
The only interaction it does on device driver level is
filtering-out unsupported video modes, it exposes drm_bridge
interface to perform this operation.

This patch is based on the code refactored by Tomasz Stanislawski
<t.stanislaws@samsung.com>, which was initially developed by:
Adam Hampson <ahampson@sta.samsung.com>
Erik Gilling <konkers@android.com>
Shankar Bandal <shankar.b@samsung.com>
Dharam Kumar <dharam.kr@samsung.com>

Signed-off-by: Maciej Purski <m.purski@samsung.com>
Acked-by: Rob Herring <robh@kernel.org> [for dt bindings]
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1507212431-5801-2-git-send-email-m.purski@samsung.com
6 years agodrm/atomic: Make atomic iterators less surprising
Maarten Lankhorst [Wed, 27 Sep 2017 08:35:32 +0000 (10:35 +0200)]
drm/atomic: Make atomic iterators less surprising

Commit 669c9215afea ("drm/atomic: Make async plane update checks work as
intended, v2.") assumed incorrectly that if only 1 plane is matched in
the loop, the variables will be set to that plane. In reality we reset
them to NULL every time a new plane was iterated. This behavior is
surprising, so fix this by making the for loops only assign the
variables on a match.

When we have not added all the planes/crtc/connector to the state, and
there's a few NULL ones after the last one we iterated, te assumption
is broken that the pointers will hold the values from the last loop
iteration, which holds true for all other for_each macros we're using.
Except of course the iterator pointer itself, but that one really is
entirely internal.

Cc: Dmitry Osipenko <digetx@gmail.com>
Fixes: 669c9215afea ("drm/atomic: Make async plane update checks work as intended, v2.")
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20170927083532.5756-2-maarten.lankhorst@linux.intel.com
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Tested-by: Dmitry Osipenko <digetx@gmail.com>
6 years agodrm/atomic: Remove unneeded null check for private objects
Maarten Lankhorst [Wed, 27 Sep 2017 08:35:31 +0000 (10:35 +0200)]
drm/atomic: Remove unneeded null check for private objects

It can be seen in drm_atomic_get_private_obj_state() that
ptr will never be NULL, so skip the check for that case.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20170927083532.5756-1-maarten.lankhorst@linux.intel.com
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
6 years agoMerge tag 'drm-misc-next-2017-10-05' of git://anongit.freedesktop.org/git/drm-misc...
Dave Airlie [Fri, 6 Oct 2017 01:10:25 +0000 (11:10 +1000)]
Merge tag 'drm-misc-next-2017-10-05' of git://anongit.freedesktop.org/git/drm-misc into drm-next

More drm-misc for 4.15:

Cross-subsystem Changes:
- bunch more simple outreachy patches (Meghana Madhyastha, Aishwarya
  Pant, Haneen Mohammed)
- Quite a pile of static checker/cocci/spelling fixups all over.
- Final driver patches+core cleanup of Noralf's new drm_gem_fb_create
  helper.

Core Changes:
- legacy DPMS docs improved
- add dri-devel m-l to fbdev to catch people who try to fix
  fbcon-on-kms bugs in the wrong place

Driver Changes:
- vc4: prep for dsi panels (Eric)

* tag 'drm-misc-next-2017-10-05' of git://anongit.freedesktop.org/git/drm-misc: (34 commits)
  drm: fix typo in drm_gem_get_pages() comment
  MAINTAINERS: Add dri-devel as a mailing list for anything fbdev
  drm/virtio: Replace instances of reference/unreference with get/put
  drm/fb-cma-helper: Remove unused functions
  drm/tve200: Use drm_gem_fb_create() and drm_gem_fb_prepare_fb()
  drm/sun4i: Use drm_gem_fb_create()
  drm/shmobile: Use drm_gem_fb_create()
  drm/rcar-du: Use drm_gem_fb_create()
  drm/mxsfb: Use drm_gem_fb_create() and drm_gem_fb_prepare_fb()
  drm/meson: Use drm_gem_fb_create()
  drm/hisilicon/kirin: Use drm_gem_fb_create()
  drm/fsl-dcu: Use drm_gem_fb_create()
  drm/tinydrm: Use drm_gem_framebuffer_helper
  drm: of: always initialize panel in drm_of_find_panel_or_bridge()
  drm/tve200: Check for IS_ERR instead of NULL in probe
  drm/tve200: make two functions static
  drm/armada: Remove unused #include <drmP.h>
  drm/rockchip: Rely on the default best_encoder() behavior
  drm/vc4: Set up the DSI host at pdev probe time, not component bind.
  drm/vc4: Avoid using vrefresh==0 mode in DSI htotal math.
  ...

6 years agodrm: fix typo in drm_gem_get_pages() comment
Jordan Crouse [Tue, 3 Oct 2017 15:38:10 +0000 (09:38 -0600)]
drm: fix typo in drm_gem_get_pages() comment

I spent an embarrassingly long time looking for drm_gem_init_object()
before I realized I was actually looking for drm_gem_object_init().
Fix the typo to keep other poor developers from suffering the same
fate.

Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/1507045091-6550-1-git-send-email-jcrouse@codeaurora.org
6 years agoregmap: add iopoll-like polling macro for regmap_field
Chen-Yu Tsai [Fri, 29 Sep 2017 08:23:01 +0000 (16:23 +0800)]
regmap: add iopoll-like polling macro for regmap_field

This patch adds a macro regmap_field_read_poll_timeout that works
similar to the readx_poll_timeout defined in linux/iopoll.h, except
that this can also return the error value returned by a failed
regmap_field_read.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
6 years agoMAINTAINERS: Add dri-devel as a mailing list for anything fbdev
Daniel Vetter [Fri, 8 Sep 2017 15:35:28 +0000 (17:35 +0200)]
MAINTAINERS: Add dri-devel as a mailing list for anything fbdev

fbdev is in maintenance only, except that it's still used by drm
through the drm fbdev emulation, to be able to use fbcon. And people
might want to sometimes extend fbcon to enable new features for drm
drivers, e.g. Hans' panel orientation work.

The problem is that when those patches only touch fbdev code they'll
never show up on drm developer's radar, which means we end up with
designs that don't really fit whell into the full stack. That happened
a bit with the panel orientation work, where an fbcon patch made it
into 4.14, implementing a design that won't really work on the drm
side. Which means we now have to redo things, and on top coordinate 2
subsystem trees.

Since fbdev is super low-volume we can prevent this in the future by
simply adding the dri-devel mailing list to the fbdev subsystem.

Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: linux-fbdev@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: Sean Paul <seanpaul@chromium.org>
Cc: David Airlie <airlied@linux.ie>
Acked-by: Sean Paul <seanpaul@chromium.org>
Acked-by: Dave Airlie <airlied@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20170908153528.17528-1-daniel.vetter@ffwll.ch
6 years agoMerge airlied/drm-next into drm-misc-next
Daniel Vetter [Tue, 3 Oct 2017 09:09:16 +0000 (11:09 +0200)]
Merge airlied/drm-next into drm-misc-next

Just catching up with upstream.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
6 years agoBackMerge tag 'v4.14-rc3' into drm-next
Dave Airlie [Mon, 2 Oct 2017 23:35:04 +0000 (09:35 +1000)]
BackMerge tag 'v4.14-rc3' into drm-next

Linux 4.14-rc3

Requested by Daniel for the tracing build fix in fixes.

6 years agodrm/virtio: Replace instances of reference/unreference with get/put
Srishti Sharma [Fri, 29 Sep 2017 10:03:39 +0000 (15:33 +0530)]
drm/virtio: Replace instances of reference/unreference with get/put

Replace reference/unreference with get/put as it is consistent
with the kernel coding style. Done using the following semantic
patch by coccinelle.

@r@
expression e;
@@

-drm_gem_object_unreference_unlocked(e);
+drm_gem_object_put_unlocked(e);

Signed-off-by: Srishti Sharma <srishtishar@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/1506679419-7130-1-git-send-email-srishtishar@gmail.com
6 years agoLinux 4.14-rc3 v4.14-rc3
Linus Torvalds [Sun, 1 Oct 2017 21:54:54 +0000 (14:54 -0700)]
Linux 4.14-rc3

6 years agodrm/amd/powerplay: refine code in amd_powerplay.c (v2)
Rex Zhu [Fri, 29 Sep 2017 05:57:54 +0000 (13:57 +0800)]
drm/amd/powerplay: refine code in amd_powerplay.c (v2)

1. use flag PP_DPM_DISABLED within powerplay
   notify amdgpu dpm state by cgs interface.
2. delete redundant virtualization check in
   powerplay

v2: squash in fix for hwmgr_init (Rex)

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
6 years agoMerge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 1 Oct 2017 20:55:32 +0000 (13:55 -0700)]
Merge branch 'x86-urgent-for-linus' of git://git./linux/kernel/git/tip/tip

Pull x86 fixes from Thomas Gleixner:
 "This contains the following fixes and improvements:

   - Avoid dereferencing an unprotected VMA pointer in the fault signal
     generation code

   - Fix inline asm call constraints for GCC 4.4

   - Use existing register variable to retrieve the stack pointer
     instead of forcing the compiler to create another indirect access
     which results in excessive extra 'mov %rsp, %<dst>' instructions

   - Disable branch profiling for the memory encryption code to prevent
     an early boot crash

   - Fix a sparse warning caused by casting the __user annotation in
     __get_user_asm_u64() away

   - Fix an off by one error in the loop termination of the error patch
     in the x86 sysfs init code

   - Add missing CPU IDs to various Intel specific drivers to enable the
     functionality on recent hardware

   - More (init) constification in the numachip code"

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/asm: Use register variable to get stack pointer value
  x86/mm: Disable branch profiling in mem_encrypt.c
  x86/asm: Fix inline asm call constraints for GCC 4.4
  perf/x86/intel/uncore: Correct num_boxes for IIO and IRP
  perf/x86/intel/rapl: Add missing CPU IDs
  perf/x86/msr: Add missing CPU IDs
  perf/x86/intel/cstate: Add missing CPU IDs
  x86: Don't cast away the __user in __get_user_asm_u64()
  x86/sysfs: Fix off-by-one error in loop termination
  x86/mm: Fix fault error path using unsafe vma pointer
  x86/numachip: Add const and __initconst to numachip2_clockevent

6 years agoMerge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 1 Oct 2017 20:03:16 +0000 (13:03 -0700)]
Merge branch 'timers-urgent-for-linus' of git://git./linux/kernel/git/tip/tip

Pull timer fixes from Thomas Gleixner:
 "This adds a new timer wheel function which is required for the
  conversion of the timer callback function from the 'unsigned long
  data' argument to 'struct timer_list *timer'. This conversion has two
  benefits:

   1) It makes struct timer_list smaller

   2) Many callers hand in a pointer to the timer or to the structure
      containing the timer, which happens via type casting both at setup
      and in the callback. This change gets rid of the typecasts.

  Once the conversion is complete, which is planned for 4.15, the old
  setup function and the intermediate typecast in the new setup function
  go away along with the data field in struct timer_list.

  Merging this now into mainline allows a smooth queueing of the actual
  conversion in the affected maintainer trees without creating
  dependencies"

* 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  um/time: Fixup namespace collision
  timer: Prepare to change timer callback argument type

6 years agoMerge branch 'smp-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 1 Oct 2017 19:34:42 +0000 (12:34 -0700)]
Merge branch 'smp-urgent-for-linus' of git://git./linux/kernel/git/tip/tip

Pull smp/hotplug fixes from Thomas Gleixner:
 "This addresses the fallout of the new lockdep mechanism which covers
  completions in the CPU hotplug code.

  The lockdep splats are false positives, but there is no way to
  annotate that reliably. The solution is to split the completions for
  CPU up and down, which requires some reshuffling of the failure
  rollback handling as well"

* 'smp-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  smp/hotplug: Hotplug state fail injection
  smp/hotplug: Differentiate the AP completion between up and down
  smp/hotplug: Differentiate the AP-work lockdep class between up and down
  smp/hotplug: Callback vs state-machine consistency
  smp/hotplug: Rewrite AP state machine core
  smp/hotplug: Allow external multi-instance rollback
  smp/hotplug: Add state diagram

6 years agoMerge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 1 Oct 2017 19:10:02 +0000 (12:10 -0700)]
Merge branch 'sched-urgent-for-linus' of git://git./linux/kernel/git/tip/tip

Pull scheduler fixes from Thomas Gleixner:
 "The scheduler pull request comes with the following updates:

   - Prevent a divide by zero issue by validating the input value of
     sysctl_sched_time_avg

   - Make task state printing consistent all over the place and have
     explicit state characters for IDLE and PARKED so they wont be
     displayed as 'D' state which confuses tools"

* 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  sched/sysctl: Check user input value of sysctl_sched_time_avg
  sched/debug: Add explicit TASK_PARKED printing
  sched/debug: Ignore TASK_IDLE for SysRq-W
  sched/debug: Add explicit TASK_IDLE printing
  sched/tracing: Use common task-state helpers
  sched/tracing: Fix trace_sched_switch task-state printing
  sched/debug: Remove unused variable
  sched/debug: Convert TASK_state to hex
  sched/debug: Implement consistent task-state printing

6 years agoMerge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 1 Oct 2017 19:06:31 +0000 (12:06 -0700)]
Merge branch 'perf-urgent-for-linus' of git://git./linux/kernel/git/tip/tip

Pull perf fixes from Thomas Gleixner:

 - Prevent a division by zero in the perf aux buffer handling

 - Sync kernel headers with perf tool headers

 - Fix a build failure in the syscalltbl code

 - Make the debug messages of perf report --call-graph work correctly

 - Make sure that all required perf files are in the MANIFEST for
   container builds

 - Fix the atrr.exclude kernel handling so it respects the
   perf_event_paranoid and the user permissions

 - Make perf test on s390x work correctly

* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  perf/aux: Only update ->aux_wakeup in non-overwrite mode
  perf test: Fix vmlinux failure on s390x part 2
  perf test: Fix vmlinux failure on s390x
  perf tools: Fix syscalltbl build failure
  perf report: Fix debug messages with --call-graph option
  perf evsel: Fix attr.exclude_kernel setting for default cycles:p
  tools include: Sync kernel ABI headers with tooling headers
  perf tools: Get all of tools/{arch,include}/ in the MANIFEST

6 years agoMerge branch 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 1 Oct 2017 19:02:47 +0000 (12:02 -0700)]
Merge branch 'locking-urgent-for-linus' of git://git./linux/kernel/git/tip/tip

Pull  locking fixes from Thomas Gleixner:
 "Two fixes for locking:

   - Plug a hole the pi_stat->owner serialization which was changed
     recently and failed to fixup two usage sites.

   - Prevent reordering of the rwsem_has_spinner() check vs the
     decrement of rwsem count in up_write() which causes a missed
     wakeup"

* 'locking-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  locking/rwsem-xadd: Fix missed wakeup due to reordering of load
  futex: Fix pi_state->owner serialization

6 years agoMerge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 1 Oct 2017 19:00:56 +0000 (12:00 -0700)]
Merge branch 'irq-urgent-for-linus' of git://git./linux/kernel/git/tip/tip

Pull irq fixes from Thomas Gleixner:

 - Add a missing NULL pointer check in free_irq()

 - Fix a memory leak/memory corruption in the generic irq chip

 - Add missing rcu annotations for radix tree access

 - Use ffs instead of fls when extracting data from a chip register in
   the MIPS GIC irq driver

 - Fix the unmasking of IPI interrupts in the MIPS GIC driver so they
   end up at the target CPU and not at CPU0

* 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  irq/generic-chip: Don't replace domain's name
  irqdomain: Add __rcu annotations to radix tree accessors
  irqchip/mips-gic: Use effective affinity to unmask
  irqchip/mips-gic: Fix shifts to extract register fields
  genirq: Check __free_irq() return value for NULL

6 years agoMerge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 1 Oct 2017 18:12:29 +0000 (11:12 -0700)]
Merge branch 'core-urgent-for-linus' of git://git./linux/kernel/git/tip/tip

Pull objtool fixes from Thomas Gleixner:
 "Two small fixes for objtool:

   - Support frame pointer setup via 'lea (%rsp), %rbp' which was not
     yet supported and caused build warnings

   - Disable unreacahble warnings for GCC4.4 and older to avoid false
     positives caused by the compiler itself"

* 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  objtool: Support unoptimized frame pointer setup
  objtool: Skip unreachable warnings for GCC 4.4 and older

6 years agodrm/fb-cma-helper: Remove unused functions
Noralf Trønnes [Sun, 24 Sep 2017 12:26:25 +0000 (14:26 +0200)]
drm/fb-cma-helper: Remove unused functions

The cma drivers use the drm_gem_framebuffer_helper functions now,
so remove drm_fb_cma_destroy, drm_fb_cma_create_handle,
drm_fb_cma_create_with_funcs, drm_fb_cma_create and
drm_fb_cma_prepare_fb.

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/1506255985-61113-11-git-send-email-noralf@tronnes.org
6 years agodrm/tve200: Use drm_gem_fb_create() and drm_gem_fb_prepare_fb()
Noralf Trønnes [Sun, 24 Sep 2017 12:26:24 +0000 (14:26 +0200)]
drm/tve200: Use drm_gem_fb_create() and drm_gem_fb_prepare_fb()

drm_fb_cma_create() and drm_fb_cma_prepare_fb() are just wrappers now,
use drm_gem_fb_create() and drm_gem_fb_prepare_fb() directly.

Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/1506255985-61113-10-git-send-email-noralf@tronnes.org
6 years agodrm/sun4i: Use drm_gem_fb_create()
Noralf Trønnes [Sun, 24 Sep 2017 12:26:23 +0000 (14:26 +0200)]
drm/sun4i: Use drm_gem_fb_create()

drm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now,
so use the function directly.

Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/1506255985-61113-9-git-send-email-noralf@tronnes.org
6 years agodrm/shmobile: Use drm_gem_fb_create()
Noralf Trønnes [Sun, 24 Sep 2017 12:26:22 +0000 (14:26 +0200)]
drm/shmobile: Use drm_gem_fb_create()

drm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now,
so use the function directly.

Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/1506255985-61113-8-git-send-email-noralf@tronnes.org
6 years agodrm/rcar-du: Use drm_gem_fb_create()
Noralf Trønnes [Sun, 24 Sep 2017 12:26:21 +0000 (14:26 +0200)]
drm/rcar-du: Use drm_gem_fb_create()

drm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now,
so use the function directly.

Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/1506255985-61113-7-git-send-email-noralf@tronnes.org
6 years agodrm/mxsfb: Use drm_gem_fb_create() and drm_gem_fb_prepare_fb()
Noralf Trønnes [Sun, 24 Sep 2017 12:26:20 +0000 (14:26 +0200)]
drm/mxsfb: Use drm_gem_fb_create() and drm_gem_fb_prepare_fb()

drm_fb_cma_create() and drm_fb_cma_prepare_fb() are just wrappers now,
use drm_gem_fb_create() and drm_gem_fb_prepare_fb() directly.

Cc: Marek Vasut <marex@denx.de>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/1506255985-61113-6-git-send-email-noralf@tronnes.org
6 years agodrm/meson: Use drm_gem_fb_create()
Noralf Trønnes [Sun, 24 Sep 2017 12:26:19 +0000 (14:26 +0200)]
drm/meson: Use drm_gem_fb_create()

drm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now,
so use the function directly.

Cc: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/1506255985-61113-5-git-send-email-noralf@tronnes.org
6 years agodrm/hisilicon/kirin: Use drm_gem_fb_create()
Noralf Trønnes [Sun, 24 Sep 2017 12:26:18 +0000 (14:26 +0200)]
drm/hisilicon/kirin: Use drm_gem_fb_create()

drm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now,
so use the function directly.

Cc: Xinliang Liu <z.liuxinliang@hisilicon.com>
Cc: Rongrong Zou <zourongrong@gmail.com>
Cc: Xinwei Kong <kong.kongxinwei@hisilicon.com>
Cc: Chen Feng <puck.chen@hisilicon.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Xinliang Liu <z.liuxinliang@hisilicon.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/1506255985-61113-4-git-send-email-noralf@tronnes.org
6 years agodrm/fsl-dcu: Use drm_gem_fb_create()
Noralf Trønnes [Sun, 24 Sep 2017 12:26:17 +0000 (14:26 +0200)]
drm/fsl-dcu: Use drm_gem_fb_create()

drm_fb_cma_create() is just a wrapper around drm_gem_fb_create() now,
so use the function directly.

Cc: Stefan Agner <stefan@agner.ch>
Cc: Alison Wang <alison.wang@freescale.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/1506255985-61113-3-git-send-email-noralf@tronnes.org
6 years agodrm/tinydrm: Use drm_gem_framebuffer_helper
Noralf Trønnes [Sun, 24 Sep 2017 12:26:16 +0000 (14:26 +0200)]
drm/tinydrm: Use drm_gem_framebuffer_helper

Use drm_gem_framebuffer_helper directly instead of the cma
library wrappers.

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/1506255985-61113-2-git-send-email-noralf@tronnes.org
6 years agodrm/amdgpu: use designated initialiser for thermal_irq_src.
Dave Airlie [Thu, 28 Sep 2017 06:12:28 +0000 (16:12 +1000)]
drm/amdgpu: use designated initialiser for thermal_irq_src.

This fixes the 0-day build warning.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
6 years agodrm: of: always initialize panel in drm_of_find_panel_or_bridge()
Dan Carpenter [Mon, 25 Sep 2017 10:30:38 +0000 (13:30 +0300)]
drm: of: always initialize panel in drm_of_find_panel_or_bridge()

The callers expect "panel" to be initialized, but that isn't true if we
return -ENODEV.  It causes bugs like:

    drivers/gpu/drm/tve200/tve200_drv.c:83 tve200_modeset_init()
    error: uninitialized symbol 'panel'.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20170925103038.lvr5msjvekwczctn@mwanda