OSDN Git Service

uclinux-h8/linux.git
3 years agodrm/amd/amdgpu: Update VCN initizalization behvaior
Bokun Zhang [Tue, 10 Nov 2020 20:15:50 +0000 (15:15 -0500)]
drm/amd/amdgpu: Update VCN initizalization behvaior

- Issue:
  In the original vcn3.0 code, it assumes that the VCN's
  init_status is always 1, even after the MMSCH
  updates the header.

  This is incorrect since by default, it should be set to 0,
  and MMSCH will update it to 1 if VCN is ready.

- Fix:
  We need to read back the table header after send it to MMSCH.
  After that, if a VCN instance is not ready (host disabled it),
  we needs to disable the ring buffer as well.

Signed-off-by: Bokun Zhang <Bokun.Zhang@amd.com>
Reviewed-by: Monk Liu <monk.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: add UMC to ip discovery map
John Clements [Wed, 11 Nov 2020 08:51:19 +0000 (16:51 +0800)]
drm/amdgpu: add UMC to ip discovery map

resolve issue with UMC base offset not being set correctly in ip discovery sequence

Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: John Clements <john.clements@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: disable rom clock gating support for APUs
Hawking Zhang [Fri, 23 Oct 2020 13:48:19 +0000 (21:48 +0800)]
drm/amdgpu: disable rom clock gating support for APUs

ROM clock gating enable/disable is not supported
on APU platform. (i.e. CGTT_ROM_CLK_CTRL0 register
is not availabe on APU). SMUIO callbacks will check
APU flag before enable/disable rom clock gating, and
skip the programming. Accordingly, query clock gating
status through CGTT_ROM_CLK_CTRL0 also doesn't support
on APU platform.

The change applies to RAVEN/RAVEN2/PICASSO/RENOIR.

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: John Clements <john.clements@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: switch to use smuio callbacks for AI family
Hawking Zhang [Tue, 20 Oct 2020 15:50:46 +0000 (23:50 +0800)]
drm/amdgpu: switch to use smuio callbacks for AI family

Switch to smuio callbacks: use smuio v9_0 callbacks
for Vega10/12, smuio v11_0 callbacks for Vega20/Arcturus.
APUs don't support enable/disable rom clock gating and
also don't support read bios from rom. So APU flag check
is needed in clock gating callbacks and asic funciton
for read bios from rom to prevent access unknown offset
on APU.

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: John Clements <john.clements@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: implement smuio v11_0 callbacks
Hawking Zhang [Tue, 20 Oct 2020 16:00:19 +0000 (00:00 +0800)]
drm/amdgpu: implement smuio v11_0 callbacks

Vega20/Arcturus will use smuio v11_0 callbacks

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: John Clements <john.clements@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: implement smuio v9_0 callbacks
Hawking Zhang [Tue, 20 Oct 2020 15:59:12 +0000 (23:59 +0800)]
drm/amdgpu: implement smuio v9_0 callbacks

Vega10/12 will use smuio v9_0 callbacks

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: John Clements <john.clements@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: add amdgpu_smuio structure
Hawking Zhang [Sat, 7 Nov 2020 14:50:05 +0000 (22:50 +0800)]
drm/amdgpu: add amdgpu_smuio structure

Add amdgpu_smuio structure in amdgpu_device to
provide various callback functions to support
smuio ip funcitonality

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: John Clements <john.clements@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: correct table_clk_vlt memory size due to replacing one-element array...
mengwang [Tue, 10 Nov 2020 04:06:46 +0000 (12:06 +0800)]
drm/amd/pm: correct table_clk_vlt memory size due to replacing one-element array with flexible-array in struct phm_clock_voltage_dependency_table

Add 1 to the size passed to kzalloc after replacing one-element array.

There is a regular need in the kernel to provide a way to declare having
a dynamically sized set of trailing elements in a structure. Kernel code
should always use “flexible array members”[1] for these cases. The older
style of one-element or zero-length arrays should no longer be used[2].

Refactor the code according to the use of a flexible-array member in
struct phm_ppt_v1_mm_clock_voltage_dependency_table, instead of a
one-element array, and use the struct_size() helper to calculate the
size for the allocation.

[1] https://en.wikipedia.org/wiki/Flexible_array_member
[2] https://www.kernel.org/doc/html/v5.9-rc1/process/deprecated.html#zero-length-and-one-element-arrays

Signed-off-by: Mengbing Wang <mengbing.wang@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: update the swSMU headers for vangogh
Xiaojian Du [Fri, 30 Oct 2020 08:10:09 +0000 (16:10 +0800)]
drm/amd/pm: update the swSMU headers for vangogh

This patch is to update the swSMU headers for vangogh.

Signed-off-by: Xiaojian Du <Xiaojian.Du@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: add the interface to dump smu metrics table for vangogh
Xiaojian Du [Tue, 3 Nov 2020 07:53:31 +0000 (15:53 +0800)]
drm/amd/pm: add the interface to dump smu metrics table for vangogh

This patch is to add the interface to dump smu metrics table for vangogh.

Signed-off-by: Xiaojian Du <Xiaojian.Du@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/radeon/sumo_dpm: Move 'sumo_get_pi()'s prototype into shared header
Lee Jones [Tue, 10 Nov 2020 19:31:07 +0000 (19:31 +0000)]
drm/radeon/sumo_dpm: Move 'sumo_get_pi()'s prototype into shared header

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/sumo_dpm.c:81:25: warning: no previous prototype for ‘sumo_get_pi’ [-Wmissing-prototypes]
 81 | struct sumo_power_info *sumo_get_pi(struct radeon_device *rdev)
 | ^~~~~~~~~~~

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/radeon/ni: Remove set but unused variable 'mc_shared_chmap'
Lee Jones [Tue, 10 Nov 2020 19:31:09 +0000 (19:31 +0000)]
drm/radeon/ni: Remove set but unused variable 'mc_shared_chmap'

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/ni.c: In function ‘cayman_gpu_init’:
 drivers/gpu/drm/radeon/ni.c:880:6: warning: variable ‘mc_shared_chmap’ set but not used [-Wunused-but-set-variable]

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/radeon/evergreen_dma: Fix doc-rot of function parameter 'resv'
Lee Jones [Tue, 10 Nov 2020 19:30:56 +0000 (19:30 +0000)]
drm/radeon/evergreen_dma: Fix doc-rot of function parameter 'resv'

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/evergreen_dma.c:112: warning: Function parameter or member 'resv' not described in 'evergreen_copy_dma'
 drivers/gpu/drm/radeon/evergreen_dma.c:112: warning: Excess function parameter 'fence' description in 'evergreen_copy_dma'

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Cc: linux-media@vger.kernel.org
Cc: linaro-mm-sig@lists.linaro.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/radeon/evergreen_cs: Fix misnaming issues surrounding 'p' param
Lee Jones [Tue, 10 Nov 2020 19:31:00 +0000 (19:31 +0000)]
drm/radeon/evergreen_cs: Fix misnaming issues surrounding 'p' param

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/evergreen_cs.c:1026: warning: Function parameter or member 'p' not described in 'evergreen_cs_packet_parse_vline'
 drivers/gpu/drm/radeon/evergreen_cs.c:1026: warning: Excess function parameter 'parser' description in 'evergreen_cs_packet_parse_vline'
 drivers/gpu/drm/radeon/evergreen_cs.c:1095: warning: Function parameter or member 'p' not described in 'evergreen_cs_handle_reg'
 drivers/gpu/drm/radeon/evergreen_cs.c:1095: warning: Excess function parameter 'parser' description in 'evergreen_cs_handle_reg'
 drivers/gpu/drm/radeon/evergreen_cs.c:1757: warning: Function parameter or member 'p' not described in 'evergreen_is_safe_reg'
 drivers/gpu/drm/radeon/evergreen_cs.c:1757: warning: Excess function parameter 'parser' description in 'evergreen_is_safe_reg'

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/radeon/cik_sdma: Demote vague attempt at kernel-doc
Lee Jones [Tue, 10 Nov 2020 19:30:57 +0000 (19:30 +0000)]
drm/radeon/cik_sdma: Demote vague attempt at kernel-doc

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/cik_sdma.c:949: warning: Function parameter or member 'ring' not described in 'cik_dma_vm_flush'
 drivers/gpu/drm/radeon/cik_sdma.c:949: warning: Function parameter or member 'vm_id' not described in 'cik_dma_vm_flush'
 drivers/gpu/drm/radeon/cik_sdma.c:949: warning: Function parameter or member 'pd_addr' not described in 'cik_dma_vm_flush'

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Cc: linux-media@vger.kernel.org
Cc: linaro-mm-sig@lists.linaro.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/radeon/r600_cs: Fix some doc-rot and supply missing function param docs
Lee Jones [Tue, 10 Nov 2020 19:30:59 +0000 (19:30 +0000)]
drm/radeon/r600_cs: Fix some doc-rot and supply missing function param docs

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/r600_cs.c:793: warning: Function parameter or member 'p' not described in 'r600_cs_packet_parse_vline'
 drivers/gpu/drm/radeon/r600_cs.c:793: warning: Excess function parameter 'parser' description in 'r600_cs_packet_parse_vline'
 drivers/gpu/drm/radeon/r600_cs.c:826: warning: Function parameter or member 'p' not described in 'r600_cs_common_vline_parse'
 drivers/gpu/drm/radeon/r600_cs.c:826: warning: Excess function parameter 'parser' description in 'r600_cs_common_vline_parse'
 drivers/gpu/drm/radeon/r600_cs.c:968: warning: Function parameter or member 'p' not described in 'r600_cs_check_reg'
 drivers/gpu/drm/radeon/r600_cs.c:968: warning: Excess function parameter 'parser' description in 'r600_cs_check_reg'
 drivers/gpu/drm/radeon/r600_cs.c:1473: warning: Function parameter or member 'base_offset' not described in 'r600_check_texture_resource'
 drivers/gpu/drm/radeon/r600_cs.c:1473: warning: Function parameter or member 'mip_offset' not described in 'r600_check_texture_resource'
 drivers/gpu/drm/radeon/r600_cs.c:1473: warning: Function parameter or member 'tiling_flags' not described in 'r600_check_texture_resource'

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/radeon/r100: Fix some kernel-doc formatting, misnaming and missing issues
Lee Jones [Tue, 10 Nov 2020 19:30:58 +0000 (19:30 +0000)]
drm/radeon/r100: Fix some kernel-doc formatting, misnaming and missing issues

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/r100.c:163: warning: Function parameter or member 'async' not described in 'r100_page_flip'
 drivers/gpu/drm/radeon/r100.c:848: warning: Function parameter or member 'rdev' not described in 'r100_ring_hdp_flush'
 drivers/gpu/drm/radeon/r100.c:848: warning: Function parameter or member 'ring' not described in 'r100_ring_hdp_flush'
 drivers/gpu/drm/radeon/r100.c:1425: warning: Function parameter or member 'p' not described in 'r100_cs_packet_parse_vline'
 drivers/gpu/drm/radeon/r100.c:1425: warning: Excess function parameter 'parser' description in 'r100_cs_packet_parse_vline'

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Cc: linux-media@vger.kernel.org
Cc: linaro-mm-sig@lists.linaro.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/radeon/radeon_mn: Supply description for 'cur_seq' even if it is unused
Lee Jones [Tue, 10 Nov 2020 19:30:55 +0000 (19:30 +0000)]
drm/radeon/radeon_mn: Supply description for 'cur_seq' even if it is unused

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/radeon_mn.c:51: warning: Function parameter or member 'cur_seq' not described in 'radeon_mn_invalidate'

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/radeon/ci_dpm: Remove set but unused variable 'dpm_event_src'
Lee Jones [Tue, 10 Nov 2020 19:30:50 +0000 (19:30 +0000)]
drm/radeon/ci_dpm: Remove set but unused variable 'dpm_event_src'

And the piece of code that has never been executed.

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/ci_dpm.c: In function ‘ci_set_dpm_event_sources’:
 drivers/gpu/drm/radeon/ci_dpm.c:1369:28: warning: variable ‘dpm_event_src’ set but not used [-Wunused-but-set-variable]

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/radeon/radeon_ib: Supply description for 'radeon_ib_get's get param
Lee Jones [Tue, 10 Nov 2020 19:30:53 +0000 (19:30 +0000)]
drm/radeon/radeon_ib: Supply description for 'radeon_ib_get's get param

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/radeon_ib.c:61: warning: Function parameter or member 'vm' not described in 'radeon_ib_get'

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/radeon/radeon_sync: Add description for function param 'rdev'
Lee Jones [Tue, 10 Nov 2020 19:30:52 +0000 (19:30 +0000)]
drm/radeon/radeon_sync: Add description for function param 'rdev'

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/radeon_sync.c:92: warning: Function parameter or member 'rdev' not described in 'radeon_sync_resv'

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Cc: linux-media@vger.kernel.org
Cc: linaro-mm-sig@lists.linaro.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/radeon/radeon_dp_mst: Remove unused variable 'ret' from radeon_mst_encoder_dpms()
Lee Jones [Tue, 10 Nov 2020 19:30:54 +0000 (19:30 +0000)]
drm/radeon/radeon_dp_mst: Remove unused variable 'ret' from radeon_mst_encoder_dpms()

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/radeon_dp_mst.c: In function ‘radeon_mst_encoder_dpms’:
 drivers/gpu/drm/radeon/radeon_dp_mst.c:366:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/radeon/trinity_dpm: Remove some defined but never used arrays
Lee Jones [Tue, 10 Nov 2020 19:30:48 +0000 (19:30 +0000)]
drm/radeon/trinity_dpm: Remove some defined but never used arrays

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/trinity_dpm.c:146:18: warning: ‘trinity_sysls_default’ defined but not used [-Wunused-const-variable=]
 drivers/gpu/drm/radeon/trinity_dpm.c:131:18: warning: ‘trinity_mgcg_shls_disable’ defined but not used [-Wunused-const-variable=]
 drivers/gpu/drm/radeon/trinity_dpm.c:120:18: warning: ‘trinity_mgcg_shls_enable’ defined but not used [-Wunused-const-variable=]

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/radeon/kv_dpm: Strip out unused functions and their tables
Lee Jones [Tue, 10 Nov 2020 19:30:49 +0000 (19:30 +0000)]
drm/radeon/kv_dpm: Strip out unused functions and their tables

These haven't been used since the driver was upstreamed in 2013.

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/kv_dpm.c:161:40: warning: ‘cpl_cac_config_reg’ defined but not used [-Wunused-const-variable=]
 drivers/gpu/drm/radeon/kv_dpm.c:156:40: warning: ‘mc3_cac_config_reg’ defined but not used [-Wunused-const-variable=]
 drivers/gpu/drm/radeon/kv_dpm.c:151:40: warning: ‘mc2_cac_config_reg’ defined but not used [-Wunused-const-variable=]
 drivers/gpu/drm/radeon/kv_dpm.c:146:40: warning: ‘mc1_cac_config_reg’ defined but not used [-Wunused-const-variable=]
 drivers/gpu/drm/radeon/kv_dpm.c:141:40: warning: ‘mc0_cac_config_reg’ defined but not used [-Wunused-const-variable=]
 drivers/gpu/drm/radeon/kv_dpm.c:136:40: warning: ‘sx0_cac_config_reg’ defined but not used [-Wunused-const-variable=]
 drivers/gpu/drm/radeon/kv_dpm.c:104:43: warning: ‘cpl_local_cac_cfg_kv’ defined but not used [-Wunused-const-variable=]
 drivers/gpu/drm/radeon/kv_dpm.c:98:43: warning: ‘mc3_local_cac_cfg_kv’ defined but not used [-Wunused-const-variable=]
 drivers/gpu/drm/radeon/kv_dpm.c:92:43: warning: ‘mc2_local_cac_cfg_kv’ defined but not used [-Wunused-const-variable=]
 drivers/gpu/drm/radeon/kv_dpm.c:86:43: warning: ‘mc1_local_cac_cfg_kv’ defined but not used [-Wunused-const-variable=]
 drivers/gpu/drm/radeon/kv_dpm.c:80:43: warning: ‘mc0_local_cac_cfg_kv’ defined but not used [-Wunused-const-variable=]
 drivers/gpu/drm/radeon/kv_dpm.c:67:43: warning: ‘sx_local_cac_cfg_kv’ defined but not used [-Wunused-const-variable=]

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/radeon/radeon_vm: Fix some function parameter documentation
Lee Jones [Tue, 10 Nov 2020 19:30:51 +0000 (19:30 +0000)]
drm/radeon/radeon_vm: Fix some function parameter documentation

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/radeon_vm.c:131: warning: Function parameter or member 'rdev' not described in 'radeon_vm_get_bos'
 drivers/gpu/drm/radeon/radeon_vm.c:643: warning: Excess function parameter 'start' description in 'radeon_vm_update_page_directory'
 drivers/gpu/drm/radeon/radeon_vm.c:643: warning: Excess function parameter 'end' description in 'radeon_vm_update_page_directory'
 drivers/gpu/drm/radeon/radeon_vm.c:819: warning: Function parameter or member 'ib' not described in 'radeon_vm_update_ptes'
 drivers/gpu/drm/radeon/radeon_vm.c:915: warning: Function parameter or member 'bo_va' not described in 'radeon_vm_bo_update'
 drivers/gpu/drm/radeon/radeon_vm.c:915: warning: Excess function parameter 'vm' description in 'radeon_vm_bo_update'
 drivers/gpu/drm/radeon/radeon_vm.c:915: warning: Excess function parameter 'bo' description in 'radeon_vm_bo_update'
 drivers/gpu/drm/radeon/radeon_vm.c:1155: warning: Excess function parameter 'vm' description in 'radeon_vm_bo_invalidate'

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/radeon/cik: Remove set but unused variable 'mc_shared_chmap'
Lee Jones [Tue, 10 Nov 2020 19:30:47 +0000 (19:30 +0000)]
drm/radeon/cik: Remove set but unused variable 'mc_shared_chmap'

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/cik.c: In function ‘cik_gpu_init’:
 drivers/gpu/drm/radeon/cik.c:3180:6: warning: variable ‘mc_shared_chmap’ set but not used [-Wunused-but-set-variable]

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Cc: linux-media@vger.kernel.org
Cc: linaro-mm-sig@lists.linaro.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/radeon/ni: Demote vague attempt at function header doc
Lee Jones [Tue, 10 Nov 2020 19:30:45 +0000 (19:30 +0000)]
drm/radeon/ni: Demote vague attempt at function header doc

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/ni.c: In function ‘cayman_gpu_init’:
 drivers/gpu/drm/radeon/ni.c:2679: warning: Function parameter or member 'ring' not described in 'cayman_vm_flush'
 drivers/gpu/drm/radeon/ni.c:2679: warning: Function parameter or member 'vm_id' not described in 'cayman_vm_flush'
 drivers/gpu/drm/radeon/ni.c:2679: warning: Function parameter or member 'pd_addr' not described in 'cayman_vm_flush'

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/radeon/si: Remove set but unused variable 'mc_shared_chmap'
Lee Jones [Tue, 10 Nov 2020 19:30:46 +0000 (19:30 +0000)]
drm/radeon/si: Remove set but unused variable 'mc_shared_chmap'

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/si.c: In function ‘si_gpu_init’:
 drivers/gpu/drm/radeon/si.c:3090:6: warning: variable ‘mc_shared_chmap’ set but not used [-Wunused-but-set-variable]

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/radeon/evergreen: Add comment for 'evergreen_page_flip()'s 'async' param
Lee Jones [Tue, 10 Nov 2020 19:30:43 +0000 (19:30 +0000)]
drm/radeon/evergreen: Add comment for 'evergreen_page_flip()'s 'async' param

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/evergreen.c: In function ‘evergreen_gpu_init’:
 drivers/gpu/drm/radeon/evergreen.c:1419: warning: Function parameter or member 'async' not described in 'evergreen_page_flip'

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/radeon/evergreen: Remove set but unused variable 'mc_shared_chmap'
Lee Jones [Tue, 10 Nov 2020 19:30:44 +0000 (19:30 +0000)]
drm/radeon/evergreen: Remove set but unused variable 'mc_shared_chmap'

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/evergreen.c: In function ‘evergreen_gpu_init’:
 drivers/gpu/drm/radeon/evergreen.c:3135:6: warning: variable ‘mc_shared_chmap’ set but not used [-Wunused-but-set-variable]

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/radeon/cik: Fix a bunch of function parameter descriptions
Lee Jones [Mon, 9 Nov 2020 21:18:55 +0000 (21:18 +0000)]
drm/radeon/cik: Fix a bunch of function parameter descriptions

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/cik.c:1869:5: warning: no previous prototype for ‘ci_mc_load_microcode’ [-Wmissing-prototypes]
 drivers/gpu/drm/radeon/cik.c: In function ‘cik_gpu_init’:
 drivers/gpu/drm/radeon/cik.c:3181:6: warning: variable ‘mc_shared_chmap’ set but not used [-Wunused-but-set-variable]
 drivers/gpu/drm/radeon/cik.c: At top level:
 drivers/gpu/drm/radeon/cik.c:4852:5: warning: no previous prototype for ‘cik_gpu_check_soft_reset’ [-Wmissing-prototypes]
 drivers/gpu/drm/radeon/cik.c:5850:6: warning: no previous prototype for ‘cik_enter_rlc_safe_mode’ [-Wmissing-prototypes]
 drivers/gpu/drm/radeon/cik.c:5871:6: warning: no previous prototype for ‘cik_exit_rlc_safe_mode’ [-Wmissing-prototypes]
 drivers/gpu/drm/radeon/cik.c:6289:6: warning: no previous prototype for ‘cik_update_cg’ [-Wmissing-prototypes]
 drivers/gpu/drm/radeon/cik.c:6421:6: warning: no previous prototype for ‘cik_init_cp_pg_table’ [-Wmissing-prototypes]
 drivers/gpu/drm/radeon/cik.c:6678:5: warning: no previous prototype for ‘cik_get_csb_size’ [-Wmissing-prototypes]
 drivers/gpu/drm/radeon/cik.c:6710:6: warning: no previous prototype for ‘cik_get_csb_buffer’ [-Wmissing-prototypes]
 drivers/gpu/drm/radeon/cik.c:3084: warning: Function parameter or member 'max_rb_num_per_se' not described in 'cik_get_rb_disabled'
 drivers/gpu/drm/radeon/cik.c:3084: warning: Excess function parameter 'max_rb_num' description in 'cik_get_rb_disabled'
 drivers/gpu/drm/radeon/cik.c:3084: warning: Excess function parameter 'se_num' description in 'cik_get_rb_disabled'
 drivers/gpu/drm/radeon/cik.c:3114: warning: Function parameter or member 'max_rb_num_per_se' not described in 'cik_setup_rb'
 drivers/gpu/drm/radeon/cik.c:3114: warning: Excess function parameter 'max_rb_num' description in 'cik_setup_rb'
 drivers/gpu/drm/radeon/cik.c:5662: warning: Function parameter or member 'mc_client' not described in 'cik_vm_decode_fault'
 drivers/gpu/drm/radeon/cik.c:5690: warning: Function parameter or member 'ring' not described in 'cik_vm_flush'
 drivers/gpu/drm/radeon/cik.c:5690: warning: Function parameter or member 'vm_id' not described in 'cik_vm_flush'
 drivers/gpu/drm/radeon/cik.c:5690: warning: Function parameter or member 'pd_addr' not described in 'cik_vm_flush'

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Cc: linux-media@vger.kernel.org
Cc: linaro-mm-sig@lists.linaro.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/radeon/r600: Fix a misnamed parameter description and a formatting issue
Lee Jones [Mon, 9 Nov 2020 21:18:54 +0000 (21:18 +0000)]
drm/radeon/r600: Fix a misnamed parameter description and a formatting issue

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/r600.c:2965: warning: Function parameter or member 'resv' not described in 'r600_copy_cpdma'
 drivers/gpu/drm/radeon/r600.c:2965: warning: Excess function parameter 'fence' description in 'r600_copy_cpdma'
 drivers/gpu/drm/radeon/r600.c:4382: warning: Function parameter or member 'rdev' not described in 'r600_mmio_hdp_flush'

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Cc: linux-media@vger.kernel.org
Cc: linaro-mm-sig@lists.linaro.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/radeon/radeon_display: Fix function doc formatting and missing param issues
Lee Jones [Mon, 9 Nov 2020 21:18:53 +0000 (21:18 +0000)]
drm/radeon/radeon_display: Fix function doc formatting and missing param issues

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/radeon_display.c:264: warning: Function parameter or member '__work' not described in 'radeon_unpin_work_func'
 drivers/gpu/drm/radeon/radeon_display.c:406: warning: Function parameter or member '__work' not described in 'radeon_flip_work_func'
 drivers/gpu/drm/radeon/radeon_display.c:956: warning: Function parameter or member 'freq' not described in 'radeon_compute_pll_avivo'
 drivers/gpu/drm/radeon/radeon_display.c:956: warning: Function parameter or member 'fb_div_p' not described in 'radeon_compute_pll_avivo'
 drivers/gpu/drm/radeon/radeon_display.c:956: warning: Function parameter or member 'frac_fb_div_p' not described in 'radeon_compute_pll_avivo'
 drivers/gpu/drm/radeon/radeon_display.c:956: warning: Function parameter or member 'ref_div_p' not described in 'radeon_compute_pll_avivo'
 drivers/gpu/drm/radeon/radeon_display.c:956: warning: Function parameter or member 'post_div_p' not described in 'radeon_compute_pll_avivo'

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: report to <xorg-driver-ati@lists.x.org>
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Cc: linux-media@vger.kernel.org
Cc: linaro-mm-sig@lists.linaro.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/radeon/radeon_cs: Fix a bunch of doc-rot issues
Lee Jones [Mon, 9 Nov 2020 21:18:47 +0000 (21:18 +0000)]
drm/radeon/radeon_cs: Fix a bunch of doc-rot issues

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/radeon_cs.c:416: warning: Function parameter or member 'backoff' not described in 'radeon_cs_parser_fini'
 drivers/gpu/drm/radeon/radeon_cs.c:735: warning: Function parameter or member 'p' not described in 'radeon_cs_packet_parse'
 drivers/gpu/drm/radeon/radeon_cs.c:735: warning: Function parameter or member 'idx' not described in 'radeon_cs_packet_parse'
 drivers/gpu/drm/radeon/radeon_cs.c:735: warning: Excess function parameter 'parser' description in 'radeon_cs_packet_parse'
 drivers/gpu/drm/radeon/radeon_cs.c:844: warning: Function parameter or member 'p' not described in 'radeon_cs_packet_next_reloc'
 drivers/gpu/drm/radeon/radeon_cs.c:844: warning: Function parameter or member 'cs_reloc' not described in 'radeon_cs_packet_next_reloc'
 drivers/gpu/drm/radeon/radeon_cs.c:844: warning: Function parameter or member 'nomm' not described in 'radeon_cs_packet_next_reloc'
 drivers/gpu/drm/radeon/radeon_cs.c:844: warning: Excess function parameter 'parser' description in 'radeon_cs_packet_next_reloc'
 drivers/gpu/drm/radeon/radeon_cs.c:844: warning: Excess function parameter 'data' description in 'radeon_cs_packet_next_reloc'
 drivers/gpu/drm/radeon/radeon_cs.c:844: warning: Excess function parameter 'offset_start' description in 'radeon_cs_packet_next_reloc'
 drivers/gpu/drm/radeon/radeon_cs.c:844: warning: Excess function parameter 'offset_mask' description in 'radeon_cs_packet_next_reloc'
 drivers/gpu/drm/radeon/radeon_cs.c:844: warning: Excess function parameter 'reloc' description in 'radeon_cs_packet_next_reloc'

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Jerome Glisse <glisse@freedesktop.org>
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Cc: linux-media@vger.kernel.org
Cc: linaro-mm-sig@lists.linaro.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/radeon/r600: Strip out set but unused 'tmp' variables
Lee Jones [Mon, 9 Nov 2020 21:18:46 +0000 (21:18 +0000)]
drm/radeon/r600: Strip out set but unused 'tmp' variables

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/r600.c: In function ‘r600_pcie_gart_tlb_flush’:
 drivers/gpu/drm/radeon/r600.c:1083:7: warning: variable ‘tmp’ set but not used [-Wunused-but-set-variable]
 drivers/gpu/drm/radeon/r600.c: At top level:
 drivers/gpu/drm/radeon/r600.c: In function ‘r600_mmio_hdp_flush’:
 drivers/gpu/drm/radeon/r600.c:4393:7: warning: variable ‘tmp’ set but not used [-Wunused-but-set-variable]

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Cc: linux-media@vger.kernel.org
Cc: linaro-mm-sig@lists.linaro.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/radeon/radeon_ring: Add missing function parameters 'rdev' and 'data'
Lee Jones [Mon, 9 Nov 2020 21:18:45 +0000 (21:18 +0000)]
drm/radeon/radeon_ring: Add missing function parameters 'rdev' and 'data'

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/radeon_ring.c:226: warning: Function parameter or member 'rdev' not described in 'radeon_ring_unlock_undo'
 drivers/gpu/drm/radeon/radeon_ring.c:240: warning: Function parameter or member 'rdev' not described in 'radeon_ring_lockup_update'
 drivers/gpu/drm/radeon/radeon_ring.c:283: warning: Function parameter or member 'data' not described in 'radeon_ring_backup'

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/radeon/radeon_i2c: Remove pointless function header
Lee Jones [Mon, 9 Nov 2020 21:18:43 +0000 (21:18 +0000)]
drm/radeon/radeon_i2c: Remove pointless function header

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/radeon_i2c.c:46: warning: Function parameter or member 'radeon_connector' not described in 'radeon_ddc_probe'
 drivers/gpu/drm/radeon/radeon_i2c.c:46: warning: Function parameter or member 'use_aux' not described in 'radeon_ddc_probe'

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/radeon/radeon_display: Remove unused variable 'mod'
Lee Jones [Mon, 9 Nov 2020 21:18:42 +0000 (21:18 +0000)]
drm/radeon/radeon_display: Remove unused variable 'mod'

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/radeon_display.c: In function ‘radeon_div’:
 drivers/gpu/drm/radeon/radeon_display.c:1094:11: warning: variable ‘mod’ set but not used [-Wunused-but-set-variable]

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: report to <xorg-driver-ati@lists.x.org>
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Cc: linux-media@vger.kernel.org
Cc: linaro-mm-sig@lists.linaro.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/radeon/radeon_connectors: Strip out set but unused variable 'ret'
Lee Jones [Mon, 9 Nov 2020 21:18:41 +0000 (21:18 +0000)]
drm/radeon/radeon_connectors: Strip out set but unused variable 'ret'

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/radeon_connectors.c: In function ‘radeon_setup_mst_connector’:
 drivers/gpu/drm/radeon/radeon_connectors.c:2574:7: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/radeon/radeon_fence: Demote some non-conformant kernel-doc headers and fix another
Lee Jones [Mon, 9 Nov 2020 21:18:38 +0000 (21:18 +0000)]
drm/radeon/radeon_fence: Demote some non-conformant kernel-doc headers and fix another

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/radeon_fence.c:168: warning: Function parameter or member 'wait' not described in 'radeon_fence_check_signaled'
 drivers/gpu/drm/radeon/radeon_fence.c:168: warning: Function parameter or member 'mode' not described in 'radeon_fence_check_signaled'
 drivers/gpu/drm/radeon/radeon_fence.c:168: warning: Function parameter or member 'flags' not described in 'radeon_fence_check_signaled'
 drivers/gpu/drm/radeon/radeon_fence.c:168: warning: Function parameter or member 'key' not described in 'radeon_fence_check_signaled'
 drivers/gpu/drm/radeon/radeon_fence.c:393: warning: Function parameter or member 'f' not described in 'radeon_fence_enable_signaling'
 drivers/gpu/drm/radeon/radeon_fence.c:393: warning: Excess function parameter 'fence' description in 'radeon_fence_enable_signaling'
 drivers/gpu/drm/radeon/radeon_fence.c:1010: warning: Function parameter or member 'm' not described in 'radeon_debugfs_gpu_reset'
 drivers/gpu/drm/radeon/radeon_fence.c:1010: warning: Function parameter or member 'data' not described in 'radeon_debugfs_gpu_reset'

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: Jerome Glisse <glisse@freedesktop.org>
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Cc: linux-media@vger.kernel.org
Cc: linaro-mm-sig@lists.linaro.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/radeon/radeon_ttm: Place declaration of 'rdev' in same clause as its use
Lee Jones [Fri, 13 Nov 2020 05:06:52 +0000 (00:06 -0500)]
drm/radeon/radeon_ttm: Place declaration of 'rdev' in same clause as its use

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/radeon_ttm.c: In function ‘radeon_ttm_tt_create’:
 drivers/gpu/drm/radeon/radeon_ttm.c:611:24: warning: variable ‘rdev’ set but not used [-Wunused-but-set-variable]

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Jerome Glisse <glisse@freedesktop.org>
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/radeon/atombios_crtc: Remove description of non-existent function param 'encoder'
Lee Jones [Fri, 6 Nov 2020 21:49:48 +0000 (21:49 +0000)]
drm/radeon/atombios_crtc: Remove description of non-existent function param 'encoder'

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/atombios_crtc.c:1796: warning: Excess function parameter 'encoder' description in 'radeon_get_shared_nondp_ppll'

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/radeon: Move prototypes to shared header
Lee Jones [Fri, 6 Nov 2020 21:49:45 +0000 (21:49 +0000)]
drm/radeon: Move prototypes to shared header

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/radeon_kms.c:756:5: warning: no previous prototype for ‘radeon_get_vblank_counter_kms’ [-Wmissing-prototypes]
 756 | u32 radeon_get_vblank_counter_kms(struct drm_crtc *crtc)
 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 drivers/gpu/drm/radeon/radeon_kms.c:826:5: warning: no previous prototype for ‘radeon_enable_vblank_kms’ [-Wmissing-prototypes]
 826 | int radeon_enable_vblank_kms(struct drm_crtc *crtc)
 | ^~~~~~~~~~~~~~~~~~~~~~~~
 drivers/gpu/drm/radeon/radeon_kms.c:853:6: warning: no previous prototype for ‘radeon_disable_vblank_kms’ [-Wmissing-prototypes]
 853 | void radeon_disable_vblank_kms(struct drm_crtc *crtc)
 | ^~~~~~~~~~~~~~~~~~~~~~~~~

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Cc: linux-media@vger.kernel.org
Cc: linaro-mm-sig@lists.linaro.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/radeon/radeon_drv: Move prototypes to a shared headerfile
Lee Jones [Fri, 6 Nov 2020 21:49:43 +0000 (21:49 +0000)]
drm/radeon/radeon_drv: Move prototypes to a shared headerfile

Fixes the following W=1 kernel build warning(s):

 62 | void radeon_driver_unload_kms(struct drm_device *dev)
 | ^~~~~~~~~~~~~~~~~~~~~~~~
 drivers/gpu/drm/radeon/radeon_kms.c:105:5: warning: no previous prototype for ‘radeon_driver_load_kms’ [-Wmissing-prototypes]
 105 | int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags)
 | ^~~~~~~~~~~~~~~~~~~~~~
 drivers/gpu/drm/radeon/radeon_kms.c:619:6: warning: no previous prototype for ‘radeon_driver_lastclose_kms’ [-Wmissing-prototypes]
 619 | void radeon_driver_lastclose_kms(struct drm_device *dev)
 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~
 drivers/gpu/drm/radeon/radeon_kms.c:634:5: warning: no previous prototype for ‘radeon_driver_open_kms’ [-Wmissing-prototypes]
 634 | int radeon_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv)
 | ^~~~~~~~~~~~~~~~~~~~~~
 drivers/gpu/drm/radeon/radeon_kms.c:705:6: warning: no previous prototype for ‘radeon_driver_postclose_kms’ [-Wmissing-prototypes]
 705 | void radeon_driver_postclose_kms(struct drm_device *dev,
 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Gareth Hughes <gareth@valinux.com>
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/radeon/radeon_drv: Source file headers are not good candidates for kernel-doc
Lee Jones [Fri, 6 Nov 2020 21:49:41 +0000 (21:49 +0000)]
drm/radeon/radeon_drv: Source file headers are not good candidates for kernel-doc

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/radeon_drv.c:2: warning: Cannot understand  * file radeon_drv.c

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Gareth Hughes <gareth@valinux.com>
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/radeon/radeon_kms: Include header containing our own prototypes
Lee Jones [Fri, 6 Nov 2020 21:49:37 +0000 (21:49 +0000)]
drm/radeon/radeon_kms: Include header containing our own prototypes

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/radeon_kms.c:61:6: warning: no previous prototype for ‘radeon_driver_unload_kms’ [-Wmissing-prototypes]
 drivers/gpu/drm/radeon/radeon_kms.c:104:5: warning: no previous prototype for ‘radeon_driver_load_kms’ [-Wmissing-prototypes]
 drivers/gpu/drm/radeon/radeon_kms.c:618:6: warning: no previous prototype for ‘radeon_driver_lastclose_kms’ [-Wmissing-prototypes]
 drivers/gpu/drm/radeon/radeon_kms.c:633:5: warning: no previous prototype for ‘radeon_driver_open_kms’ [-Wmissing-prototypes]
 drivers/gpu/drm/radeon/radeon_kms.c:704:6: warning: no previous prototype for ‘radeon_driver_postclose_kms’ [-Wmissing-prototypes]
 drivers/gpu/drm/radeon/radeon_kms.c:755:5: warning: no previous prototype for ‘radeon_get_vblank_counter_kms’ [-Wmissing-prototypes]
 drivers/gpu/drm/radeon/radeon_kms.c:825:5: warning: no previous prototype for ‘radeon_enable_vblank_kms’ [-Wmissing-prototypes]
 drivers/gpu/drm/radeon/radeon_kms.c:852:6: warning: no previous prototype for ‘radeon_disable_vblank_kms’ [-Wmissing-prototypes]

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agogpu: drm: radeon: radeon_device: Fix a bunch of kernel-doc misdemeanours
Lee Jones [Thu, 5 Nov 2020 14:45:15 +0000 (14:45 +0000)]
gpu: drm: radeon: radeon_device: Fix a bunch of kernel-doc misdemeanours

 - Demote non-conformant headers
 - Fix misnaming issues
 - Rename labels with identical names
 - Remove incorrect descriptions

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/radeon_device.c:637:6: warning: no previous prototype for ‘radeon_device_is_virtual’ [-Wmissing-prototypes]
 drivers/gpu/drm/radeon/radeon_device.c:552: warning: duplicate section name 'Note'
 drivers/gpu/drm/radeon/radeon_device.c:556: warning: duplicate section name 'Note'
 drivers/gpu/drm/radeon/radeon_device.c:561: warning: duplicate section name 'Note'
 drivers/gpu/drm/radeon/radeon_device.c:564: warning: duplicate section name 'Note'
 drivers/gpu/drm/radeon/radeon_device.c:1106: warning: Function parameter or member 'family' not described in 'radeon_gart_size_auto'
 drivers/gpu/drm/radeon/radeon_device.c:1291: warning: Function parameter or member 'ddev' not described in 'radeon_device_init'
 drivers/gpu/drm/radeon/radeon_device.c:1565: warning: Function parameter or member 'dev' not described in 'radeon_suspend_kms'
 drivers/gpu/drm/radeon/radeon_device.c:1565: warning: Function parameter or member 'suspend' not described in 'radeon_suspend_kms'
 drivers/gpu/drm/radeon/radeon_device.c:1565: warning: Function parameter or member 'fbcon' not described in 'radeon_suspend_kms'
 drivers/gpu/drm/radeon/radeon_device.c:1565: warning: Function parameter or member 'freeze' not described in 'radeon_suspend_kms'
 drivers/gpu/drm/radeon/radeon_device.c:1565: warning: Excess function parameter 'pdev' description in 'radeon_suspend_kms'
 drivers/gpu/drm/radeon/radeon_device.c:1565: warning: Excess function parameter 'state' description in 'radeon_suspend_kms'
 drivers/gpu/drm/radeon/radeon_device.c:1669: warning: Function parameter or member 'dev' not described in 'radeon_resume_kms'
 drivers/gpu/drm/radeon/radeon_device.c:1669: warning: Function parameter or member 'resume' not described in 'radeon_resume_kms'
 drivers/gpu/drm/radeon/radeon_device.c:1669: warning: Function parameter or member 'fbcon' not described in 'radeon_resume_kms'
 drivers/gpu/drm/radeon/radeon_device.c:1669: warning: Excess function parameter 'pdev' description in 'radeon_resume_kms'

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agogpu: drm: amd: amdgpu: amdgpu: Mark global variables as __maybe_unused
Lee Jones [Thu, 5 Nov 2020 14:45:16 +0000 (14:45 +0000)]
gpu: drm: amd: amdgpu: amdgpu: Mark global variables as __maybe_unused

These 3 variables are used in *some* sourcefiles which include
amdgpu.h, but not *all*.  This leads to a flurry of build warnings.

Fixes the following W=1 kernel build warning(s):

 from drivers/gpu/drm/amd/amdgpu/amdgpu.h:67,
 drivers/gpu/drm/amd/amdgpu/amdgpu.h:198:19: warning: ‘no_system_mem_limit’ defined but not used [-Wunused-const-variable=]
 drivers/gpu/drm/amd/amdgpu/amdgpu.h:197:19: warning: ‘debug_evictions’ defined but not used [-Wunused-const-variable=]
 drivers/gpu/drm/amd/amdgpu/amdgpu.h:196:18: warning: ‘sched_policy’ defined but not used [-Wunused-const-variable=]

 NB: Repeats ~650 times - snipped for brevity.

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Cc: linux-media@vger.kernel.org
Cc: linaro-mm-sig@lists.linaro.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agogpu: drm: radeon: radeon_drv: Remove unused variable 'ret'
Lee Jones [Thu, 5 Nov 2020 14:45:13 +0000 (14:45 +0000)]
gpu: drm: radeon: radeon_drv: Remove unused variable 'ret'

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/radeon/radeon_drv.c: In function ‘radeon_pmops_runtime_suspend’:
 drivers/gpu/drm/radeon/radeon_drv.c:455:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Gareth Hughes <gareth@valinux.com>
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agogpu: drm: scheduler: sched_entity: Demote non-conformant kernel-doc headers
Lee Jones [Thu, 5 Nov 2020 14:45:05 +0000 (14:45 +0000)]
gpu: drm: scheduler: sched_entity: Demote non-conformant kernel-doc headers

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/scheduler/sched_entity.c:316: warning: Function parameter or member 'f' not described in 'drm_sched_entity_clear_dep'
 drivers/gpu/drm/scheduler/sched_entity.c:316: warning: Function parameter or member 'cb' not described in 'drm_sched_entity_clear_dep'
 drivers/gpu/drm/scheduler/sched_entity.c:330: warning: Function parameter or member 'f' not described in 'drm_sched_entity_wakeup'
 drivers/gpu/drm/scheduler/sched_entity.c:330: warning: Function parameter or member 'cb' not described in 'drm_sched_entity_wakeup'

Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Nirmoy Das <nirmoy.aiemd@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-media@vger.kernel.org
Cc: linaro-mm-sig@lists.linaro.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agogpu: drm: scheduler: sched_main: Provide missing description for 'sched' paramter
Lee Jones [Thu, 5 Nov 2020 14:45:04 +0000 (14:45 +0000)]
gpu: drm: scheduler: sched_main: Provide missing description for 'sched' paramter

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/scheduler/sched_main.c:74: warning: Function parameter or member 'sched' not described in 'drm_sched_rq_init'

Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-media@vger.kernel.org
Cc: linaro-mm-sig@lists.linaro.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agoamd/display/amdgpu_dm: delete same check in if condition
Bernard Zhao [Tue, 10 Nov 2020 08:03:13 +0000 (00:03 -0800)]
amd/display/amdgpu_dm: delete same check in if condition

In function amdgpu_dm_connector_get_modes, drm_edid_is_valid
will check weather (!edid), no need to check again in the if
branch.

Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Bernard Zhao <bernard@vivo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/pm: Use kmemdup instead of kmalloc and memcpy
Tian Tao [Tue, 10 Nov 2020 11:34:58 +0000 (19:34 +0800)]
drm/amd/pm: Use kmemdup instead of kmalloc and memcpy

Fixes coccicheck warning:
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_processpptables.c:255:
36-43: WARNING opportunity for kmemdup

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: update gfx golden setting for dimgrey_cavefish
Tao Zhou [Tue, 10 Nov 2020 03:51:14 +0000 (11:51 +0800)]
drm/amdgpu: update gfx golden setting for dimgrey_cavefish

Set LDS_CONFIG to 0x20 on dimgrey_cavefish to fix GPU hang.

Signed-off-by: Tao Zhou <tao.zhou1@amd.com>
Reviewed-by: Jiansong Chen <Jiansong.Chen@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrivers: amdgpu: amdgpu_display: Fixed the spelling of falg to flag
Bhaskar Chowdhury [Mon, 9 Nov 2020 21:07:25 +0000 (02:37 +0530)]
drivers: amdgpu: amdgpu_display: Fixed the spelling of falg to flag

s/falg/flag/p

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Bhaskar Chowdhury <unixbhaskar@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu/pm/smu11: cache smu firmware version
Alex Deucher [Fri, 6 Nov 2020 14:50:22 +0000 (09:50 -0500)]
drm/amdgpu/pm/smu11: cache smu firmware version

So we print the proper SMU firmware version in debugfs, ioctls, etc.
for vangogh.

Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu/pm/smu12: cache smu firmware version
Alex Deucher [Fri, 6 Nov 2020 14:49:10 +0000 (09:49 -0500)]
drm/amdgpu/pm/smu12: cache smu firmware version

So we print the proper SMU firmware version in debugfs, ioctls, etc.
for Renoir.

Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/amdgpu/amdgpu_kms: Remove 'struct drm_amdgpu_info_device dev_info' from the...
Lee Jones [Fri, 6 Nov 2020 21:49:46 +0000 (21:49 +0000)]
drm/amd/amdgpu/amdgpu_kms: Remove 'struct drm_amdgpu_info_device dev_info' from the stack

Place it on the heap instead.

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c: In function ‘amdgpu_info_ioctl’:
 drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c:979:1: warning: the frame size of 1128 bytes is larger than 1024 bytes [-Wframe-larger-than=]

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/display/dc/basics/fixpt31_32: Move variables to where they're used
Lee Jones [Fri, 6 Nov 2020 21:49:42 +0000 (21:49 +0000)]
drm/amd/display/dc/basics/fixpt31_32: Move variables to where they're used

Also rid some unused ones.

This patch solves 2000 warnings!

Fixes the following W=1 kernel build warning(s):

 In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/dc_types.h:33,
 from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services_types.h:30,
 from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services.h:35,
 from drivers/gpu/drm/amd/amdgpu/../display/amdgpu_dm/amdgpu_dm_helpers.c:35:
 At top level:
 drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:76:32: warning: ‘dc_fixpt_ln2_div_2’ defined but not used [-Wunused-const-variable=]
 76 | static const struct fixed31_32 dc_fixpt_ln2_div_2 = { 1488522236LL };
 | ^~~~~~~~~~~~~~~~~~
 drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:75:32: warning: ‘dc_fixpt_ln2’ defined but not used [-Wunused-const-variable=]
 75 | static const struct fixed31_32 dc_fixpt_ln2 = { 2977044471LL };
 | ^~~~~~~~~~~~
 drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:74:32: warning: ‘dc_fixpt_e’ defined but not used [-Wunused-const-variable=]
 74 | static const struct fixed31_32 dc_fixpt_e = { 11674931555LL };
 | ^~~~~~~~~~
 drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:73:32: warning: ‘dc_fixpt_two_pi’ defined but not used [-Wunused-const-variable=]
 73 | static const struct fixed31_32 dc_fixpt_two_pi = { 26986075409LL };
 | ^~~~~~~~~~~~~~~
 drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:72:32: warning: ‘dc_fixpt_pi’ defined but not used [-Wunused-const-variable=]
 72 | static const struct fixed31_32 dc_fixpt_pi = { 13493037705LL };
 | ^~~~~~~~~~~

Cc: Harry Wentland <harry.wentland@amd.com>
Cc: Leo Li <sunpeng.li@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/amdgpu/amdgpu_device: Provide documentation for 'reg_addr' params
Lee Jones [Fri, 6 Nov 2020 21:49:44 +0000 (21:49 +0000)]
drm/amd/amdgpu/amdgpu_device: Provide documentation for 'reg_addr' params

Fixes the following W=1 kernel build warning(s):

 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:594: warning: Function parameter or member 'reg_addr' not described in 'amdgpu_device_indirect_rreg'
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:624: warning: Function parameter or member 'reg_addr' not described in 'amdgpu_device_indirect_rreg64'

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Sumit Semwal <sumit.semwal@linaro.org>
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Cc: linux-media@vger.kernel.org
Cc: linaro-mm-sig@lists.linaro.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrivers: amdgpu: amdgpu_display.c: Fix a spelling doens\'t to doesn\'t
Bhaskar Chowdhury [Mon, 9 Nov 2020 08:38:24 +0000 (14:08 +0530)]
drivers: amdgpu: amdgpu_display.c: Fix a spelling doens\'t to doesn\'t

s/doens't/doesn't/p

Signed-off-by: Bhaskar Chowdhury <unixbhaskar@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/amdgpu: Add rev_id workaround logic for SRIOV setup
Bokun Zhang [Mon, 9 Nov 2020 19:09:03 +0000 (14:09 -0500)]
drm/amd/amdgpu: Add rev_id workaround logic for SRIOV setup

- When we are under SRIOV setup, the rev_id cannot be read
  properly. Therefore, we will return default value for it

Signed-off-by: Bokun Zhang <Bokun.Zhang@amd.com>
Reviewed-by: Monk Liu <monk.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/amdgpu: Fix incorrect logic to increment VCN doorbell index
Bokun Zhang [Mon, 9 Nov 2020 18:59:27 +0000 (13:59 -0500)]
drm/amd/amdgpu: Fix incorrect logic to increment VCN doorbell index

- The original logic uses a counter based index assignment,
  which is incorrect if we only assign VCN1 to this VF but no VCN0

  The doorbell index is absolute, so we can calculate it by
  using index variable i and j

Signed-off-by: Bokun Zhang <Bokun.Zhang@amd.com>
Reviewed-by: Monk Liu <monk.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/display: cap dpp dto phase not more than modulo.
Yongqiang Sun [Sun, 1 Nov 2020 18:05:11 +0000 (13:05 -0500)]
drm/amd/display: cap dpp dto phase not more than modulo.

[Why]
4K monitor shows corruption if dpp dto phase is larger than modulo.

[How]
cap phase value never larger than modulo.

Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com>
Acked-by: Bindu Ramamurthy <bindu.r@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/display: check actual clock value.
Yongqiang Sun [Fri, 30 Oct 2020 13:29:07 +0000 (09:29 -0400)]
drm/amd/display: check actual clock value.

[Why]
Actual dpp/disp clock PMFW set are always equal or more than requested.
Need to cache the actual clock for debugging purpose.

[How]
Add actuall dpp/disp clk in clock manager and save it when set clocks.
Add an ASSERT in case of actual clock less than requested.

Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com>
Acked-by: Bindu Ramamurthy <bindu.r@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/display: 3.2.111
Aric Cyr [Mon, 2 Nov 2020 15:20:29 +0000 (10:20 -0500)]
drm/amd/display: 3.2.111

Signed-off-by: Aric Cyr <aric.cyr@amd.com>
Acked-by: Bindu Ramamurthy <bindu.r@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/display: [FW Promotion] Release 0.0.41
Anthony Koo [Sun, 1 Nov 2020 20:49:31 +0000 (15:49 -0500)]
drm/amd/display: [FW Promotion] Release 0.0.41

Signed-off-by: Anthony Koo <Anthony.Koo@amd.com>
Acked-by: Bindu Ramamurthy <bindu.r@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/display: Check other planes for iflip only if GSL already enabled
Alvin Lee [Fri, 30 Oct 2020 17:49:46 +0000 (13:49 -0400)]
drm/amd/display: Check other planes for iflip only if GSL already enabled

[Why]
We don't want GSL to be enabled when only updating
plane address

[How]
Only check other pipes for immediate flip if GSL is
already enabled

Signed-off-by: Alvin Lee <alvin.lee2@amd.com>
Acked-by: Bindu Ramamurthy <bindu.r@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/display: Explicitly disable cursor when disabling CRTC
Victor Lu [Fri, 23 Oct 2020 17:38:58 +0000 (13:38 -0400)]
drm/amd/display: Explicitly disable cursor when disabling CRTC

[why]
On DCE, the cursor is not being disabled on commits where there is no
CRTC or FB enabled.

[how]
Explicitly disable the cursor in the commit tail only if the pending
commit disables the CRTC.

Signed-off-by: Victor Lu <victorchengchi.lu@amd.com>
Acked-by: Bindu Ramamurthy <bindu.r@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/display: update dpp dto phase and modulo.
Yongqiang Sun [Mon, 26 Oct 2020 16:33:24 +0000 (12:33 -0400)]
drm/amd/display: update dpp dto phase and modulo.

[Why & How]
Program modulo with ref dpp clk Mhz/10.
Program phase with pipe dpp clk Mhz /10.
DMUB FW could use these value to determine optimization clk
for PSR power saving.

Signed-off-by: Yongqiang Sun <yongqiang.sun@amd.com>
Acked-by: Bindu Ramamurthy <bindu.r@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/display: force use sRGB for video TF is sRGB or BT709
Jing Zhou [Wed, 28 Oct 2020 07:50:53 +0000 (15:50 +0800)]
drm/amd/display: force use sRGB for video TF is sRGB or BT709

[Why]
When mpo enabled, video comes is 709. Desktop use sRGB.
So color change easily noticeable especially when switch between
mpo/non-mpo.

[How]
Force use sRGB for video TF is sRGB or BT709.
DCN1/DCN2 use predefined type with YUV.
DCN3 use distributed points type with YUV.

Signed-off-by: Jing Zhou <Jing.Zhou@amd.com>
Acked-by: Bindu Ramamurthy <bindu.r@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/display: Only wait for flip pending on immediate flips
Aric Cyr [Thu, 29 Oct 2020 21:40:51 +0000 (17:40 -0400)]
drm/amd/display: Only wait for flip pending on immediate flips

[Why]
We want to make sure all immediate flips are completed before locking
the pipes, but not pipes that are not flip immediate as they will be
locked by the OTG

[How]
Skip non flip immediate pipes when checking for flip pending.

Signed-off-by: Aric Cyr <aric.cyr@amd.com>
Acked-by: Bindu Ramamurthy <bindu.r@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/display: Move common speakersToChannels definition to hw_shared.h
Eric Bernstein [Mon, 26 Oct 2020 17:33:28 +0000 (13:33 -0400)]
drm/amd/display: Move common speakersToChannels definition to hw_shared.h

Signed-off-by: Eric Bernstein <eric.bernstein@amd.com>
Acked-by: Bindu Ramamurthy <bindu.r@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/display: correct dml dsc bpc assignment
Dmytro Laktyushkin [Wed, 28 Oct 2020 14:05:36 +0000 (10:05 -0400)]
drm/amd/display: correct dml dsc bpc assignment

Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Acked-by: Bindu Ramamurthy <bindu.r@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/display: Engage PSR synchronously
Krunoslav Kovac [Tue, 20 Oct 2020 20:23:15 +0000 (16:23 -0400)]
drm/amd/display: Engage PSR synchronously

[Why & How]
The intended use is to force PSR into active state and ignore all
events until explicit EXIT.
A new event force_static is added to power module. It is then sent
to FW.

Signed-off-by: Krunoslav Kovac <Krunoslav.Kovac@amd.com>
Acked-by: Bindu Ramamurthy <bindu.r@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/display: Prevent freesync power optimization during validation
Isabel Zhang [Fri, 23 Oct 2020 15:55:32 +0000 (11:55 -0400)]
drm/amd/display: Prevent freesync power optimization during validation

[Why]
Due to the freesync power optimization increasing vtotal, the driver
believes that MPO is supported. MPO is turned on. Freesync then
exits, MPO can no longer be supported and immediate flip fails. This
causes corruption on the panel.

[How]
Avoid the freesync optimization when doing validation so in the case
freesync exits, driver can still support the configuration.

Signed-off-by: Isabel Zhang <isabel.zhang@amd.com>
Acked-by: Bindu Ramamurthy <bindu.r@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/display: Add fallback to prefetch mode 1 if 0 fails
Isabel Zhang [Wed, 21 Oct 2020 18:01:26 +0000 (14:01 -0400)]
drm/amd/display: Add fallback to prefetch mode 1 if 0 fails

[Why]
In some cases, prefetch mode 0 is unsupported but prefetch 1 is
supported. Due to previous change always forcing prefetch mode to 0, we
are failing bandwidth validation in cases where we should not.

[How]
By default try prefetch mode 0 but in the case validation fails, attempt
to do prefetch mode 1 to see if it is supported.

Signed-off-by: Isabel Zhang <isabel.zhang@amd.com>
Acked-by: Bindu Ramamurthy <bindu.r@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: enable DCN for navi10 headless SKU
Tianci.Yin [Fri, 6 Nov 2020 06:56:35 +0000 (14:56 +0800)]
drm/amdgpu: enable DCN for navi10 headless SKU

There is a NULL pointer crash when DCN disabled on headless SKU.
On normal SKU, the variable adev->ddev.mode_config.funcs is
initialized in dm_hw_init(), and it is fine to access it in
amdgpu_device_resume(). But on headless SKU, DCN is disabled,
the funcs variable is not initialized, then crash arises.
Enable DCN to fix this issue.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Guchun Chen <guchun.chen@amd.com>
Signed-off-by: Tianci.Yin <tianci.yin@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amd/amdgpu: Import amdgpu_amdkfd_gfx_v9 header file into implementation
Ramesh Errabolu [Fri, 6 Nov 2020 19:01:20 +0000 (13:01 -0600)]
drm/amd/amdgpu: Import amdgpu_amdkfd_gfx_v9 header file into implementation

[Why]
Prevent compiler warnings when building amdgpu kernel module

[How]
Add the include directive for amdgpu_amdkfd_gfx_v9 header file

Fixes: aeee2a48ec9239 ("drm/amd/amdgpu: Enable arcturus devices to access the method kgd_gfx_v9_get_cu_occupancy that is already defined")
Reviewed-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
Signed-off-by: Ramesh Errabolu <Ramesh.Errabolu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reported-by: kernel test robot <lkp@intel.com>
3 years agodrm/amdgpu: Add and use seperate reg headers for dcn302
Bhawanpreet Lakha [Thu, 5 Nov 2020 18:37:35 +0000 (13:37 -0500)]
drm/amdgpu: Add and use seperate reg headers for dcn302

Currently we are using dcn3 reg headers for dcn302. The offsets are
different between the two so they need seperate headers.

Add dcn302 header files and use these instead of dcn3 header

Signed-off-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agodrm/amdgpu: add ta firmware load for green-sardine
Roman Li [Mon, 26 Oct 2020 21:12:34 +0000 (17:12 -0400)]
drm/amdgpu: add ta firmware load for green-sardine

[Why]
In preparation to enabling hdcp on green sardine.

[How]
Add green-sardine ta f/w loading in psp_v12

Signed-off-by: Roman Li <roman.li@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
3 years agoMerge v5.10-rc3 into drm-next
Daniel Vetter [Tue, 10 Nov 2020 12:58:05 +0000 (13:58 +0100)]
Merge v5.10-rc3 into drm-next

We need commit f8f6ae5d077a ("mm: always have io_remap_pfn_range() set
pgprot_decrypted()") to be able to merge Jason's cleanup patch.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
3 years agoMerge tag 'amd-drm-next-5.11-2020-11-05' of git://people.freedesktop.org/~agd5f/linux...
Dave Airlie [Tue, 10 Nov 2020 07:48:47 +0000 (17:48 +1000)]
Merge tag 'amd-drm-next-5.11-2020-11-05' of git://people.freedesktop.org/~agd5f/linux into drm-next

amd-drm-next-5.11-2020-11-05:

amdgpu:
- Add initial support for Vangogh
- Add support for Green Sardine
- Add initial support for Dimgrey Cavefish
- Scatter/Gather display support for Renoir
- Updates for Sienna Cichlid
- Updates for Navy Flounder
- SMU7 power improvements
- Modifier support for gfx9+
- CI BACO fixes
- Arcturus SMU fixes
- Lots of code cleanups
- DC fixes
- Kernel doc fixes
- Add more GPU HW client information to page fault error logging
- MPO clock tuning for RV
- FP fixes for DCN3 on ARM and PPC

radeon:
- Expose voltage via hwmon on Sumo APUs

amdkfd:
- Fix unique id handling
- Misc fixes

From: Alex Deucher <alexdeucher@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201105222749.201798-1-alexander.deucher@amd.com
3 years agoLinux 5.10-rc3
Linus Torvalds [Mon, 9 Nov 2020 00:10:16 +0000 (16:10 -0800)]
Linux 5.10-rc3

3 years agoMerge tag 'driver-core-5.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sun, 8 Nov 2020 19:30:25 +0000 (11:30 -0800)]
Merge tag 'driver-core-5.10-rc3' of git://git./linux/kernel/git/gregkh/driver-core

Pull driver core documentation fixes from Greg KH:
 "Some small Documentation fixes that were fallout from the larger
  documentation update we did in 5.10-rc2.

  Nothing major here at all, but all of these have been in linux-next
  and resolve build warnings when building the documentation files"

* tag 'driver-core-5.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
  Documentation: remove mic/index from misc-devices/index.rst
  scripts: get_api.pl: Add sub-titles to ABI output
  scripts: get_abi.pl: Don't let ABI files to create subtitles
  docs: leds: index.rst: add a missing file
  docs: ABI: sysfs-class-net: fix a typo
  docs: ABI: sysfs-driver-dma-ioatdma: what starts with /sys

3 years agoMerge tag 'tty-5.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
Linus Torvalds [Sun, 8 Nov 2020 19:28:08 +0000 (11:28 -0800)]
Merge tag 'tty-5.10-rc3' of git://git./linux/kernel/git/gregkh/tty

Pull tty/serial fixes from Greg KH:
 "Here are a small number of small tty and serial fixes for some
  reported problems for the tty core, vt code, and some serial drivers.

  They include fixes for:

   - a buggy and obsolete vt font ioctl removal

   - 8250_mtk serial baudrate runtime warnings

   - imx serial earlycon build configuration fix

   - txx9 serial driver error path cleanup issues

   - tty core fix in release_tty that can be triggered by trying to bind
     an invalid serial port name to a speakup console device

  Almost all of these have been in linux-next without any problems, the
  only one that hasn't, just deletes code :)"

* tag 'tty-5.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
  vt: Disable KD_FONT_OP_COPY
  tty: fix crash in release_tty if tty->port is not set
  serial: txx9: add missing platform_driver_unregister() on error in serial_txx9_init
  tty: serial: imx: enable earlycon by default if IMX_SERIAL_CONSOLE is enabled
  serial: 8250_mtk: Fix uart_get_baud_rate warning

3 years agoMerge tag 'usb-5.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Linus Torvalds [Sun, 8 Nov 2020 19:24:10 +0000 (11:24 -0800)]
Merge tag 'usb-5.10-rc3' of git://git./linux/kernel/git/gregkh/usb

Pull USB fixes from Greg KH:
 "Here are some small USB fixes and new device ids:

   - USB gadget fixes for some reported issues

   - Fixes for the ever-troublesome apple fastcharge driver, hopefully
     we finally have it right.

   - More USB core quirks for odd devices

   - USB serial driver fixes for some long-standing issues that were
     recently found

   - some new USB serial driver device ids

  All have been in linux-next with no reported issues"

* tag 'usb-5.10-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
  USB: apple-mfi-fastcharge: fix reference leak in apple_mfi_fc_set_property
  usb: mtu3: fix panic in mtu3_gadget_stop()
  USB: serial: option: add Telit FN980 composition 0x1055
  USB: serial: option: add LE910Cx compositions 0x1203, 0x1230, 0x1231
  USB: serial: cyberjack: fix write-URB completion race
  USB: Add NO_LPM quirk for Kingston flash drive
  USB: serial: option: add Quectel EC200T module support
  usb: raw-gadget: fix memory leak in gadget_setup
  usb: dwc2: Avoid leaving the error_debugfs label unused
  usb: dwc3: ep0: Fix delay status handling
  usb: gadget: fsl: fix null pointer checking
  usb: gadget: goku_udc: fix potential crashes in probe
  usb: dwc3: pci: add support for the Intel Alder Lake-S

3 years agofork: fix copy_process(CLONE_PARENT) race with the exiting ->real_parent
Eddy Wu [Sat, 7 Nov 2020 06:47:22 +0000 (14:47 +0800)]
fork: fix copy_process(CLONE_PARENT) race with the exiting ->real_parent

current->group_leader->exit_signal may change during copy_process() if
current->real_parent exits.

Move the assignment inside tasklist_lock to avoid the race.

Signed-off-by: Eddy Wu <eddy_wu@trendmicro.com>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
3 years agovt: Disable KD_FONT_OP_COPY
Daniel Vetter [Sun, 8 Nov 2020 15:38:06 +0000 (16:38 +0100)]
vt: Disable KD_FONT_OP_COPY

It's buggy:

On Fri, Nov 06, 2020 at 10:30:08PM +0800, Minh Yuan wrote:
> We recently discovered a slab-out-of-bounds read in fbcon in the latest
> kernel ( v5.10-rc2 for now ).  The root cause of this vulnerability is that
> "fbcon_do_set_font" did not handle "vc->vc_font.data" and
> "vc->vc_font.height" correctly, and the patch
> <https://lkml.org/lkml/2020/9/27/223> for VT_RESIZEX can't handle this
> issue.
>
> Specifically, we use KD_FONT_OP_SET to set a small font.data for tty6, and
> use  KD_FONT_OP_SET again to set a large font.height for tty1. After that,
> we use KD_FONT_OP_COPY to assign tty6's vc_font.data to tty1's vc_font.data
> in "fbcon_do_set_font", while tty1 retains the original larger
> height. Obviously, this will cause an out-of-bounds read, because we can
> access a smaller vc_font.data with a larger vc_font.height.

Further there was only one user ever.
- Android's loadfont, busybox and console-tools only ever use OP_GET
  and OP_SET
- fbset documentation only mentions the kernel cmdline font: option,
  not anything else.
- systemd used OP_COPY before release 232 published in Nov 2016

Now unfortunately the crucial report seems to have gone down with
gmane, and the commit message doesn't say much. But the pull request
hints at OP_COPY being broken

https://github.com/systemd/systemd/pull/3651

So in other words, this never worked, and the only project which
foolishly every tried to use it, realized that rather quickly too.

Instead of trying to fix security issues here on dead code by adding
missing checks, fix the entire thing by removing the functionality.

Note that systemd code using the OP_COPY function ignored the return
value, so it doesn't matter what we're doing here really - just in
case a lone server somewhere happens to be extremely unlucky and
running an affected old version of systemd. The relevant code from
font_copy_to_all_vcs() in systemd was:

/* copy font from active VT, where the font was uploaded to */
cfo.op = KD_FONT_OP_COPY;
cfo.height = vcs.v_active-1; /* tty1 == index 0 */
(void) ioctl(vcfd, KDFONTOP, &cfo);

Note this just disables the ioctl, garbage collecting the now unused
callbacks is left for -next.

v2: Tetsuo found the old mail, which allowed me to find it on another
archive. Add the link too.

Acked-by: Peilin Ye <yepeilin.cs@gmail.com>
Reported-by: Minh Yuan <yuanmingbuaa@gmail.com>
References: https://lists.freedesktop.org/archives/systemd-devel/2016-June/036935.html
References: https://github.com/systemd/systemd/pull/3651
Cc: Greg KH <greg@kroah.com>
Cc: Peilin Ye <yepeilin.cs@gmail.com>
Cc: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: https://lore.kernel.org/r/20201108153806.3140315-1-daniel.vetter@ffwll.ch
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3 years agoMerge tag 'xfs-5.10-fixes-3' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
Linus Torvalds [Sun, 8 Nov 2020 18:23:07 +0000 (10:23 -0800)]
Merge tag 'xfs-5.10-fixes-3' of git://git./fs/xfs/xfs-linux

Pull xfs fixes from Darrick Wong:

 - Fix an uninitialized struct problem

 - Fix an iomap problem zeroing unwritten EOF blocks

 - Fix some clumsy error handling when writeback fails on filesystems
   with blocksize < pagesize

 - Fix a retry loop not resetting loop variables properly

 - Fix scrub flagging rtinherit inodes on a non-rt fs, since the kernel
   actually does permit that combination

 - Fix excessive page cache flushing when unsharing part of a file

* tag 'xfs-5.10-fixes-3' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
  xfs: only flush the unshared range in xfs_reflink_unshare
  xfs: fix scrub flagging rtinherit even if there is no rt device
  xfs: fix missing CoW blocks writeback conversion retry
  iomap: clean up writeback state logic on writepage error
  iomap: support partial page discard on writeback block mapping failure
  xfs: flush new eof page on truncate to avoid post-eof corruption
  xfs: set xefi_discard when creating a deferred agfl free log intent item

3 years agoMerge branch 'hch' (patches from Christoph)
Linus Torvalds [Sun, 8 Nov 2020 18:11:31 +0000 (10:11 -0800)]
Merge branch 'hch' (patches from Christoph)

Merge procfs splice read fixes from Christoph Hellwig:
 "Greg reported a problem due to the fact that Android tests use procfs
  files to test splice, which stopped working with the changes for
  set_fs() removal.

  This series adds read_iter support for seq_file, and uses those for
  various proc files using seq_file to restore splice read support"

[ Side note: Christoph initially had a scripted "move everything over"
  patch, which looks fine, but I personally would prefer us to actively
  discourage splice() on random files.  So this does just the minimal
  basic core set of proc file op conversions.

  For completeness, and in case people care, that script was

     sed -i -e 's/\.proc_read\(\s*=\s*\)seq_read/\.proc_read_iter\1seq_read_iter/g'

  but I'll wait and see if somebody has a strong argument for using
  splice on random small /proc files before I'd run it on the whole
  kernel.   - Linus ]

* emailed patches from Christoph Hellwig <hch@lst.de>:
  proc "seq files": switch to ->read_iter
  proc "single files": switch to ->read_iter
  proc/stat: switch to ->read_iter
  proc/cpuinfo: switch to ->read_iter
  proc: wire up generic_file_splice_read for iter ops
  seq_file: add seq_read_iter

3 years agoMerge tag 'x86-urgent-2020-11-08' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sun, 8 Nov 2020 18:09:36 +0000 (10:09 -0800)]
Merge tag 'x86-urgent-2020-11-08' of git://git./linux/kernel/git/tip/tip

Pull x86 fixes from Thomas Gleixner:
 "A set of x86 fixes:

   - Use SYM_FUNC_START_WEAK in the mem* ASM functions instead of a
     combination of .weak and SYM_FUNC_START_LOCAL which makes LLVMs
     integrated assembler upset

   - Correct the mitigation selection logic which prevented the related
     prctl to work correctly

   - Make the UV5 hubless system work correctly by fixing up the
     malformed table entries and adding the missing ones"

* tag 'x86-urgent-2020-11-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/platform/uv: Recognize UV5 hubless system identifier
  x86/platform/uv: Remove spaces from OEM IDs
  x86/platform/uv: Fix missing OEM_TABLE_ID
  x86/speculation: Allow IBPB to be conditionally enabled on CPUs with always-on STIBP
  x86/lib: Change .weak to SYM_FUNC_START_WEAK for arch/x86/lib/mem*_64.S

3 years agoMerge tag 'perf-urgent-2020-11-08' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sun, 8 Nov 2020 18:05:10 +0000 (10:05 -0800)]
Merge tag 'perf-urgent-2020-11-08' of git://git./linux/kernel/git/tip/tip

Pull perf fix from Thomas Gleixner:
 "A single fix for the perf core plugging a memory leak in the address
  filter parser"

* tag 'perf-urgent-2020-11-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  perf/core: Fix a memory leak in perf_event_parse_addr_filter()

3 years agoMerge tag 'locking-urgent-2020-11-08' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Sun, 8 Nov 2020 17:56:37 +0000 (09:56 -0800)]
Merge tag 'locking-urgent-2020-11-08' of git://git./linux/kernel/git/tip/tip

Pull futex fix from Thomas Gleixner:
 "A single fix for the futex code where an intermediate state in the
  underlying RT mutex was not handled correctly and triggering a BUG()
  instead of treating it as another variant of retry condition"

* tag 'locking-urgent-2020-11-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  futex: Handle transient "ownerless" rtmutex state correctly

3 years agoMerge tag 'irq-urgent-2020-11-08' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sun, 8 Nov 2020 17:52:57 +0000 (09:52 -0800)]
Merge tag 'irq-urgent-2020-11-08' of git://git./linux/kernel/git/tip/tip

Pull irq fixes from Thomas Gleixner:
 "A set of fixes for interrupt chip drivers:

   - Fix the fallout of the IPI as interrupt conversion in Kconfig and
     the BCM2836 interrupt chip driver

   - Fixes for interrupt affinity setting and the handling of
     hierarchical irq domains in the SiFive PLIC driver

   - Make the unmapped event handling in the TI SCI driver work
     correctly

   - A few minor fixes and cleanups in various chip drivers and Kconfig"

* tag 'irq-urgent-2020-11-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  dt-bindings: irqchip: ti, sci-inta: Fix diagram indentation for unmapped events
  irqchip/ti-sci-inta: Add support for unmapped event handling
  dt-bindings: irqchip: ti, sci-inta: Update for unmapped event handling
  irqchip/renesas-intc-irqpin: Merge irlm_bit and needs_irlm
  irqchip/sifive-plic: Fix chip_data access within a hierarchy
  irqchip/sifive-plic: Fix broken irq_set_affinity() callback
  irqchip/stm32-exti: Add all LP timer exti direct events support
  irqchip/bcm2836: Fix missing __init annotation
  irqchip/mips: Drop selection of IRQ_DOMAIN_HIERARCHY
  irqchip/mst: Make mst_intc_of_init static
  irqchip/mst: MST_IRQ should depend on ARCH_MEDIATEK or ARCH_MSTARV7
  genirq: Let GENERIC_IRQ_IPI select IRQ_DOMAIN_HIERARCHY

3 years agoMerge tag 'core-urgent-2020-11-08' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Sun, 8 Nov 2020 17:51:28 +0000 (09:51 -0800)]
Merge tag 'core-urgent-2020-11-08' of git://git./linux/kernel/git/tip/tip

Pull entry code fix from Thomas Gleixner:
 "A single fix for the generic entry code to correct the wrong
  assumption that the lockdep interrupt state needs not to be
  established before calling the RCU check"

* tag 'core-urgent-2020-11-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  entry: Fix the incorrect ordering of lockdep and RCU check

3 years agoMerge tag 'powerpc-5.10-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc...
Linus Torvalds [Sun, 8 Nov 2020 17:37:20 +0000 (09:37 -0800)]
Merge tag 'powerpc-5.10-3' of git://git./linux/kernel/git/powerpc/linux

Pull powerpc fixes from Michael Ellerman:

 - fix miscompilation with GCC 4.9 by using asm_goto_volatile for put_user()

 - fix for an RCU splat at boot caused by a recent lockdep change

 - fix for a possible deadlock in our EEH debugfs code

 - several fixes for handling of _PAGE_ACCESSED on 32-bit platforms

 - build fix when CONFIG_NUMA=n

Thanks to Andreas Schwab, Christophe Leroy, Oliver O'Halloran, Qian Cai,
and Scott Cheloha.

* tag 'powerpc-5.10-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
  powerpc/numa: Fix build when CONFIG_NUMA=n
  powerpc/8xx: Manage _PAGE_ACCESSED through APG bits in L1 entry
  powerpc/8xx: Always fault when _PAGE_ACCESSED is not set
  powerpc/40x: Always fault when _PAGE_ACCESSED is not set
  powerpc/603: Always fault when _PAGE_ACCESSED is not set
  powerpc: Use asm_goto_volatile for put_user()
  powerpc/smp: Call rcu_cpu_starting() earlier
  powerpc/eeh_cache: Fix a possible debugfs deadlock

3 years agoMerge tag 'block-5.10-2020-11-07' of git://git.kernel.dk/linux-block
Linus Torvalds [Sat, 7 Nov 2020 21:56:07 +0000 (13:56 -0800)]
Merge tag 'block-5.10-2020-11-07' of git://git.kernel.dk/linux-block

Pull block fixes from Jens Axboe:

 - NVMe pull request from Christoph:
    - revert a nvme_queue size optimization (Keith Bush)
    - fabrics timeout races fixes (Chao Leng and Sagi Grimberg)"

 - null_blk zone locking fix (Damien)

* tag 'block-5.10-2020-11-07' of git://git.kernel.dk/linux-block:
  null_blk: Fix scheduling in atomic with zoned mode
  nvme-tcp: avoid repeated request completion
  nvme-rdma: avoid repeated request completion
  nvme-tcp: avoid race between time out and tear down
  nvme-rdma: avoid race between time out and tear down
  nvme: introduce nvme_sync_io_queues
  Revert "nvme-pci: remove last_sq_tail"

3 years agoMerge tag 'io_uring-5.10-2020-11-07' of git://git.kernel.dk/linux-block
Linus Torvalds [Sat, 7 Nov 2020 21:49:24 +0000 (13:49 -0800)]
Merge tag 'io_uring-5.10-2020-11-07' of git://git.kernel.dk/linux-block

Pull io_uring fixes from Jens Axboe:
 "A set of fixes for io_uring:

   - SQPOLL cancelation fixes

   - Two fixes for the io_identity COW

   - Cancelation overflow fix (Pavel)

   - Drain request cancelation fix (Pavel)

   - Link timeout race fix (Pavel)"

* tag 'io_uring-5.10-2020-11-07' of git://git.kernel.dk/linux-block:
  io_uring: fix link lookup racing with link timeout
  io_uring: use correct pointer for io_uring_show_cred()
  io_uring: don't forget to task-cancel drained reqs
  io_uring: fix overflowed cancel w/ linked ->files
  io_uring: drop req/tctx io_identity separately
  io_uring: ensure consistent view of original task ->mm from SQPOLL
  io_uring: properly handle SQPOLL request cancelations
  io-wq: cancel request if it's asking for files and we don't have them

3 years agofutex: Handle transient "ownerless" rtmutex state correctly
Mike Galbraith [Wed, 4 Nov 2020 15:12:44 +0000 (16:12 +0100)]
futex: Handle transient "ownerless" rtmutex state correctly

Gratian managed to trigger the BUG_ON(!newowner) in fixup_pi_state_owner().
This is one possible chain of events leading to this:

Task Prio       Operation
T1   120 lock(F)
T2   120 lock(F)   -> blocks (top waiter)
T3   50 (RT) lock(F)   -> boosts T1 and blocks (new top waiter)
XX    timeout/  -> wakes T2
signal
T1   50 unlock(F) -> wakes T3 (rtmutex->owner == NULL, waiter bit is set)
T2   120 cleanup   -> try_to_take_mutex() fails because T3 is the top waiter
           and the lower priority T2 cannot steal the lock.
        -> fixup_pi_state_owner() sees newowner == NULL -> BUG_ON()

The comment states that this is invalid and rt_mutex_real_owner() must
return a non NULL owner when the trylock failed, but in case of a queued
and woken up waiter rt_mutex_real_owner() == NULL is a valid transient
state. The higher priority waiter has simply not yet managed to take over
the rtmutex.

The BUG_ON() is therefore wrong and this is just another retry condition in
fixup_pi_state_owner().

Drop the locks, so that T3 can make progress, and then try the fixup again.

Gratian provided a great analysis, traces and a reproducer. The analysis is
to the point, but it confused the hell out of that tglx dude who had to
page in all the futex horrors again. Condensed version is above.

[ tglx: Wrote comment and changelog ]

Fixes: c1e2f0eaf015 ("futex: Avoid violating the 10th rule of futex")
Reported-by: Gratian Crisan <gratian.crisan@ni.com>
Signed-off-by: Mike Galbraith <efault@gmx.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/87a6w6x7bb.fsf@ni.com
Link: https://lore.kernel.org/r/87sg9pkvf7.fsf@nanos.tec.linutronix.de