[PATCH v3] drm/amdgpu: off by one in amdgpu_device_attr_create_groups() error handling

2020-05-20 Thread Dan Carpenter
8f7 ("drm/amdgpu: optimize amdgpu device attribute code") Signed-off-by: Dan Carpenter --- v2: style change v3: Fix embarrassing typo in the subject drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/am

[PATCH v2] drm/amdgpu: off by on in amdgpu_device_attr_create_groups() error handling

2020-05-20 Thread Dan Carpenter
8f7 ("drm/amdgpu: optimize amdgpu device attribute code") Signed-off-by: Dan Carpenter --- v2: style change drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/a

Re: [PATCH] drm/amdgpu: off by on in amdgpu_device_attr_create_groups() error handling

2020-05-20 Thread Dan Carpenter
On Wed, May 20, 2020 at 02:05:19PM +0200, Christian König wrote: > Am 20.05.20 um 14:00 schrieb Dan Carpenter: > > This loop in the error handling code should start a "i - 1" and end at > > "i == 0". Currently it starts a "i" and ends at "i == 1&

[PATCH] drm/amdgpu: off by on in amdgpu_device_attr_create_groups() error handling

2020-05-20 Thread Dan Carpenter
8f7 ("drm/amdgpu: optimize amdgpu device attribute code") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c index b7536

Re: [bug report] drm/amdgpu: add amdgpu_ras.c to support ras (v2)

2020-05-06 Thread Dan Carpenter
it tracks ras->supported. I will fix this. regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Re: [bug report] drm/amdgpu: add amdgpu_ras.c to support ras (v2)

2020-05-06 Thread Dan Carpenter
alues. But if it has a bug that will cause a crash and we'll have to find a way to disable it in the kernel for kernel lock down mode etc so either way we'll need to do a bit of work. 210 return -EINVAL; 211 } 212 213 return 0; 214 } regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Re: [bug report] drm/amdgpu: add amdgpu_ras.c to support ras (v2)

2020-05-05 Thread Dan Carpenter
ift '(((1))) << (head->block)' regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[bug report] drm/amdgpu: add amdgpu_ras.c to support ras (v2)

2020-05-05 Thread Dan Carpenter
return -EINVAL; 625 } 626 } 627 628 /* setup the obj */ 629 __amdgpu_ras_feature_enable(adev, head, enable); 630 631 return 0; 632 } regards, dan carpenter __

Re: [PATCH] drm/amdgpu: address the static checker warnings

2020-04-28 Thread Dan Carpenter
ill only return false when "hive" is NULL. regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Re: [PATCH] drm/amdgpu: address the static checker warnings

2020-04-24 Thread Dan Carpenter
for XGMI setup V2". > > Change-Id: I9c22b57abc9f512114112f93fb035f1fecf26beb > Signed-off-by: Evan Quan > Reported-by: Dan Carpenter > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/dr

[bug report] drm/amdgpu: optimize the gpu reset for XGMI setup V2

2020-04-24 Thread Dan Carpenter
mutex_unlock(>hive_lock); NULL dereference. 4200 return 0; 4201 } regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[bug report] drm/amd/display: Add HDCP module

2020-04-16 Thread Dan Carpenter
{ 0 } 137 }; 138 regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[bug report] drm/amd/display: Add ABM driver implementation

2020-04-06 Thread Dan Carpenter
And it also adds NULL checking on dmcu. 665 return true; 666 667 memset(_table, 0, sizeof(ram_table)); 668 regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[PATCH net-next] drm/amd/display: Fix link_detect_sink()

2020-04-06 Thread Dan Carpenter
/../display/dc/core/dc_link.c:425 link_detect_sink() warn: if statement not indented Also I changed "ZAZTODO" to just "TODO". The ZAZ isn't used anywhere else. Fixes: 621514aa4140 ("drm/amd/display: codestyle cleanup on dc_link file until detect_dp func") Signed-off-

[PATCH net-next] drm/amdgpu: Uninitialized variable in gfx_v9_0_rlcg_wreg()

2020-03-20 Thread Dan Carpenter
/amdgpu: revise RLCG access path") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c index 7bc2486167e7..affbff76758c 100644 -

Re: [PATCH] drm/amdgpu/display: Fix an error handling path in 'dm_update_crtc_state()'

2020-03-12 Thread Dan Carpenter
new_stream = NULL; > + } > > > dc_stream_release() is NULL-checked, so the if can be dropped. > > re, > wh Walter, it's really hard to separate your reply from the quoted email. What's going on with that? Could you configure your email cli

[PATCH] drm/amd/display: clean up a condition in dmub_psr_copy_settings()

2020-03-12 Thread Dan Carpenter
t be NULL. For "res_ctx->pipe_ctx[i].stream->link" we know that it is equal to "link" and "link" is non-NULL. Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff

[bug report] drm/amdgpu: add function to creat all ras debugfs node

2020-03-12 Thread Dan Carpenter
f(fs_info.debugfs_name, "%s_err_inject", 1138 ras_block_str(obj->head.block)); 1139 fs_info.head = obj->head; 1140 amdgpu_ras_debugfs_create(adev, _info); 1141 } 1142 } 1143 } regards, dan ca

Re: [bug report] drm/amd/amdgpu: Add debugfs support for reading GPRs (v2)

2020-03-10 Thread Dan Carpenter
On Tue, Nov 28, 2017 at 09:37:44AM -0500, Tom St Denis wrote: > On 28/11/17 09:29 AM, Dan Carpenter wrote: > > Hello Tom St Denis, > > > > The patch c5a60ce81b49: "drm/amd/amdgpu: Add debugfs support for > > reading GPRs (v2)" from Dec 5, 2016, leads to the

[PATCH v2] drm/amd/display: Fix dmub_psr_destroy()

2020-02-28 Thread Dan Carpenter
This is freeing the wrong variable so it will crash. It should be freeing "*dmub" instead of "dmub". Fixes: 4c1a1335dfe0 ("drm/amd/display: Driverside changes to support PSR in DMCUB") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/display/dc/dce/dmub_p

Re: [PATCH] drm/amd/display: Use after free in dmub_psr_destroy()

2020-02-28 Thread Dan Carpenter
On Fri, Feb 28, 2020 at 11:05:11AM +0100, Michel Dänzer wrote: > On 2020-02-28 9:22 a.m., Dan Carpenter wrote: > > These lines need to be re-ordered so that we don't dereference "dmub" > > after we just freed it. > > > > Fixes: 4c1a1335dfe0 ("drm/amd/

[PATCH] drm/amd/display: Use after free in dmub_psr_destroy()

2020-02-28 Thread Dan Carpenter
These lines need to be re-ordered so that we don't dereference "dmub" after we just freed it. Fixes: 4c1a1335dfe0 ("drm/amd/display: Driverside changes to support PSR in DMCUB") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c | 2 +- 1 file

[PATCH] drm/amdgpu/display: clean up some indenting

2020-02-24 Thread Dan Carpenter
These lines were accidentally indented 4 spaces more than they should be. Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers

[PATCH] drm/amdgpu: return -EFAULT if copy_to_user() fails

2020-02-12 Thread Dan Carpenter
The copy_to_user() function returns the number of bytes remaining to be copied, but we want to return a negative error code to the user. Fixes: 030d5b97a54b ("drm/amdgpu: use amdgpu_device_vram_access in amdgpu_ttm_vram_read") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/

[PATCH] drm/amd/display: Fix some use after free bugs

2020-02-05 Thread Dan Carpenter
eb8a134a0a ("drm/amd/display: Add sysfs interface for set/get srm") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c

Re: KASAN: use-after-free Read in vgem_gem_dumb_create

2020-02-03 Thread Dan Carpenter
drm/amdgpu: use kernel is_power_of_2 rather than > > local version") > > Aside: This bisect line is complete nonsense ... I'm kinda at the > point where I'm assuming that syzbot bisect results are garbage, which > is maybe not what we want. I guess much stricter filte

Re: KASAN: use-after-free Read in vgem_gem_dumb_create

2020-02-01 Thread Dan Carpenter
On Sat, Feb 01, 2020 at 05:02:47PM +0800, Hillf Danton wrote: > > On Sat, 1 Feb 2020 09:17:57 +0300 Dan Carpenter wrote: > > On Sat, Feb 01, 2020 at 12:32:09PM +0800, Hillf Danton wrote: > > > > > > Release obj in error path. > > > > > > --- a/dri

Re: KASAN: use-after-free Read in vgem_gem_dumb_create

2020-02-01 Thread Dan Carpenter
a67900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb > > ^ > > 88809fa67980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb > > 88809fa67a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb > > ========

Re: KASAN: use-after-free Read in vgem_gem_dumb_create

2020-01-31 Thread Dan Carpenter
urn >base; 204 } regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[PATCH] drm/amd/display: Possible divide by zero in set_speed()

2020-01-31 Thread Dan Carpenter
If "speed" is zero then we use it as a divisor to find "prescale". It's better to move the check for zero to the very start of the function. Fixes: 9eeec26a1339 ("drm/amd/display: Refine i2c frequency calculating sequence") Signed-off-by: Dan Carpenter --- driv

[bug report] drm/amdgpu: add initial VCN2.0 support (v2)

2019-11-26 Thread Dan Carpenter
_RAW_MASK; 1090 SOC15_WAIT_ON_RREG(VCN, 0, mmUVD_LMI_STATUS, tmp, tmp, r); 1091 if (r) 1092 return r; regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[PATCH] drm/amdgpu: Fix a bug in jpeg_v1_0_start()

2019-11-26 Thread Dan Carpenter
Originally the last WREG32_SOC15() was a part of the if statement block but the curly braces are on the wrong line. Fixes: bb0db70f3f75 ("drm/amdgpu: separate JPEG1.0 code out from VCN1.0") Signed-off-by: Dan Carpenter --- From static analysis (Smatch). Not tested. drivers/gpu/drm/

[bug report] drm/radeon: never unpin UVD bo v3

2019-11-25 Thread Dan Carpenter
216 217 radeon_bo_unreserve(rdev->uvd.vcpu_bo); 218 219 for (i = 0; i < rdev->uvd.max_handles; ++i) { 220 atomic_set(>uvd.handles[i], 0); 221 rdev->uvd.filp[i] = NULL; 222 rdev->u

[PATCH] drm/amdgpu: Release the correct object on error in amdgpu_benchmark_move()

2019-11-14 Thread Dan Carpenter
There is a typo so this unreserves "sobj" instead of "dobj". Fixes: bb812f1ea87d ("drm/amdgpu: allocate gart memory when it's required (v3)") Signed-off-by: Dan Carpenter --- From static analysis. Not tested. drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c | 2 +

[bug report] drm/amd/display: Register DMUB service with DC

2019-11-13 Thread Dan Carpenter
if (adev->dm.dc) ^^^ Check 1050 dc_destroy(>dm.dc); 1051 /* regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[bug report] drm/amd/display: Add MST atomic routines

2019-11-13 Thread Dan Carpenter
vcpi slots: %d\n", (int)dm_new_connector_state->vcpi_slots); 4872 return dm_new_connector_state->vcpi_slots; 4873 } 4874 return 0; 4875 } regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[bug report] drm/amd/display: move wm ranges reporting to end of init hw

2019-10-29 Thread Dan Carpenter
9 REG_WRITE(DCCG_GATE_DISABLE_CNTL, 0); 1300 1301 REG_WRITE(DCCG_GATE_DISABLE_CNTL2, 0); 1302 1303 REG_UPDATE(DCFCLK_CNTL, DCFCLK_GATE_DIS, 0); 1304 } 1305 1306 dc->hwss.enable_power_gating_plane(dc->hwseq, true);

Re: [PATCH] drm/sched: Fix passing zero to 'PTR_ERR' warning

2019-10-29 Thread Dan Carpenter
/* FIXME: Oct 2019: Remove this code when fence can't be NULL. */ if (!fence) fence = ERR_PTR(-EINVAL); if (IS_ERR(fence)) { ... regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Re: [PATCH] drm/sched: Fix passing zero to 'PTR_ERR' warning

2019-10-29 Thread Dan Carpenter
(IS_ERR(fence)) - return PTR_ERR(fence); - return 0; + return PTR_ERR_OR_ZERO(fence); regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[PATCH] drm/amdgpu/vi: silence an uninitialized variable warning

2019-10-17 Thread Dan Carpenter
ed symbol 'baco_reset'. Fixes: 425db2553e43 ("drm/amdgpu: expose BACO interfaces to upper level from PP") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c b

[PATCH] drm/amd/powerplay: unlock on error in smu_resume()

2019-10-07 Thread Dan Carpenter
This function needs to drop the mutex before returning. Fixes: f7e3a5776fa6 ("drm/amd/powerplay: check SMU engine readiness before proceeding on S3 resume") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletio

[PATCH] drm/amd/powerplay: Fix error handling in smu_init_fb_allocations()

2019-10-07 Thread Dan Carpenter
e "i" signed int for the error handling to work, so I just updated "ret" as well as a clean up. Fixes: f96357a991b9 ("drm/amd/powerplay: implement smu_init(fini)_fb_allocations function") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 5 ++---

[PATCH] drm/amdkfd: Fix a && vs || typo

2019-10-07 Thread Dan Carpenter
In the current code if "device_info" is ever NULL then the kernel will Oops so probably || was intended instead of &&. Fixes: e392c887df97 ("drm/amdkfd: Use array to probe kfd2kgd_calls") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdkfd/kfd_device

[bug report] drm/amd/display: Fix exception from AUX acquire failure

2019-10-02 Thread Dan Carpenter
TIMEOUT: 119 result = -ETIMEDOUT; 120 break; 121 } 122 123 return result; 124 } regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[PATCH] drm/amd/powerplay: Fix an off by one in navi10_get_smu_msg_index()

2019-08-26 Thread Dan Carpenter
The navi10_message_map[] array has SMU_MSG_MAX_COUNT elements so the ">" has to be changed to ">=" to prevent reading one element beyond the end of the array. Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 2 +- 1 file changed, 1 inserti

[bug report] drm/amd/powerplay: implement smc firmware v2.1 for smu11

2019-08-19 Thread Dan Carpenter
lay_table_size = size; 400 401 return 0; regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[bug report] drm/amd/display: add set and get clock for testing purposes

2019-08-19 Thread Dan Carpenter
0 if (!dc->clk_mgr->funcs->get_clock) ^ This will oops if ->clk_mgr is NULL 3231 return DC_FAIL_UNSUPPORTED_1; 3232 regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Re: [PATCH][drm-next] drm/amd/display: fix a potential null pointer dereference

2019-08-17 Thread Dan Carpenter
stly pointing this out because that NULL check is written so higgledy-piggledy. At first I thought this was staging code so I was planning to ignore the patch. :P regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Re: [bug report] drm/amdkfd: Add procfs-style information for KFD processes

2019-06-24 Thread Dan Carpenter
that with comments. I'll try to address this in > a coming patch. > Part of the reason for error handling is just to silence static checker warnings because otherwise everyone has to review it to see if the resource leaks are important. It's easier in the long run to just fix everything

[bug report] drm/amdkfd: Add procfs-style information for KFD processes

2019-06-24 Thread Dan Carpenter
quot;, 316 (int)process->lead_thread->pid); Error handling and error code missing. 317 } 318 out: 319 mutex_unlock(_processes_mutex); 320 321 return process; 322 } regards, dan carpenter ___

Re: [PATCH -next v3] drm/amdgpu: return 'ret' immediately if failed in amdgpu_pmu_init

2019-06-24 Thread Dan Carpenter
On Mon, Jun 24, 2019 at 05:29:33PM +0800, maowenan wrote: > > > On 2019/6/24 16:39, Dan Carpenter wrote: > > On Mon, Jun 24, 2019 at 11:45:32AM +0800, Mao Wenan wrote: > >> There is one warning: > >> drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c: In function ‘amdgpu_pm

Re: [PATCH -next v3] drm/amdgpu: return 'ret' immediately if failed in amdgpu_pmu_init

2019-06-24 Thread Dan Carpenter
ve to pull the arguments back as well. I think this fix that Julia suggested is really the right so leave the indenting alone. It looks like you've right aligned the arguments. That's not the right way, the original was correct. regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Re: [PATCH -next] drm/amdgpu: remove set but not used variables 'ret'

2019-06-23 Thread Dan Carpenter
On Sat, Jun 22, 2019 at 01:43:19PM +0300, Dan Carpenter wrote: > On Sat, Jun 22, 2019 at 11:03:14AM +0800, Mao Wenan wrote: > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c > > b/drivers/gpu/drm/amd/amdgpu/amdgpu_pmu.c > > index 0e6dba9..0bf4dd9 100644 > > --- a

Re: [PATCH -next] drm/amdgpu: remove set but not used variables 'ret'

2019-06-22 Thread Dan Carpenter
_6_MAX_COUNTERS); You're resending this for other reasons, but don't forget to update the indenting on the arguments so they still line up with the '('. regards, dan carpenter

[PATCH] drm/amdgpu: Fix bounds checking in amdgpu_ras_is_supported()

2019-06-08 Thread Dan Carpenter
ife, because debugfs is generally root only. Fixes: 36ea1bd2d084 ("drm/amdgpu: add debugfs ctrl node") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h b/drivers/gpu/drm

Re: [PATCH][next] drm/amd/display: remove redundant assignment to status

2019-06-06 Thread Dan Carpenter
ders, because people naturally assume it is not dead. GCC has a feature to warn about uninitialized variables and we're randomly initializing status to a bogus value to disable static analysis... regards, dan carpenter

[bug report] drm/amd/display: Move link functions from dc to dc_link

2019-05-30 Thread Dan Carpenter
^ Can link_stream be NULL? 2927 return; 2928 2929 if (link_stream) ^^^ We check here so maybe? 2930 decide_link_settings(link_stream, _settings); 2931 regards, dan carpenter __

[PATCH] drm/amd/powerplay: fix locking in smu_feature_set_supported()

2019-05-15 Thread Dan Carpenter
There is a typo so the code unlocks twice instead of taking the lock and then releasing it. Fixes: f14a323db5b0 ("drm/amd/powerplay: implement update enabled feature state to smc for smu11") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 2 +- 1 file

Re: [PATCH][next] drm/amdgpu: fix return of an uninitialized value in variable ret

2019-05-10 Thread Dan Carpenter
gt; - if (ret) > - return ret; > + return -EINVAL; From a naive reading of the code without knowing the hardware spec then you would probably think that lo_base_addr can also be uninitialized. regards, dan carpenter _

[bug report] drm/amd/display: wait for fence without holding reservation lock

2019-05-02 Thread Dan Carpenter
buffer before flip\n"); 5350 5351 amdgpu_bo_get_tiling_flags(abo, _flags); 5352 5353 amdgpu_bo_unreserve(abo); regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Re: [bug report] drm/amd/display: If one stream full updates, full update all planes

2019-04-23 Thread Dan Carpenter
On Tue, Apr 23, 2019 at 02:16:53PM +, Kazlauskas, Nicholas wrote: > On 4/23/19 10:10 AM, Dan Carpenter wrote: > > Hello David Francis, > > > > This is a semi-automatic email about new static checker warnings. > > > > The patch c238bfe0be9e: "drm/a

[bug report] drm/amd/display: If one stream full updates, full update all planes

2019-04-23 Thread Dan Carpenter
if (u->plane_info) 1491 format = u->plane_info->format; 1492 else if (u->surface) ^^ But the old code assumed it could be NULL 1493 format

[bug report] drm/amd/display: Link train only when link is DP and backend is enabled

2019-03-25 Thread Dan Carpenter
New check 551 return; 552 553 if (link_stream) ^^^ The old code used to check for NULL 554 decide_link_settings(link_stream, _settings); 555 regards, dan carpenter _

[bug report] drm/amd/display: On DCN1, Wait for vupdate on cursor updates

2019-03-25 Thread Dan Carpenter
us_to_vupdate = lines_to_vupdate * us_per_line; 222 223 /* 70 us is a conservative estimate of cursor update time*/ 224 if (us_to_vupdate < 70) 225 udelay(us_to_vupdate); 226 }

[PATCH] drm/amd/powerplay: Off by one in vega20_get_smu_msg_index()

2019-03-21 Thread Dan Carpenter
The > should be >= so that we don't read one element beyond the end of the vega20_message_map[] array. Fixes: 3ec3c931489f ("drm/amd/powerplay: implement smu vega20_message_map for vega20") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/powerplay/vega20_ppt.c | 3 ++- 1

Re: [PATCH] drm/amd/powerplay: Fix double unlock bug in smu_sys_set_pp_table()

2019-03-21 Thread Dan Carpenter
On Thu, Mar 21, 2019 at 09:20:38AM +0100, Julia Lawall wrote: > > > On Thu, 21 Mar 2019, Huang, Ray wrote: > > > > -Original Message- > > > From: Dan Carpenter [mailto:dan.carpen...@oracle.com] > > > Sent: Thursday, March 21, 2019 2:28 PM > >

[PATCH] drm/amd/powerplay: Fix double unlock bug in smu_sys_set_pp_table()

2019-03-21 Thread Dan Carpenter
We already unlocked a few lines earlier so this code unlocks twice on the success path. Fixes: 5809d7420f97 ("drm/amd/powerplay: implement sysfs of pp_table for smu11 (v2)") Signed-off-by: Dan Carpenter --- I'm not sure what this bug looks like at runtime, but it's slightly weird t

[PATCH] drm/amd/powerplay: delete some dead code

2019-03-21 Thread Dan Carpenter
The "size" variable is unsigned. We never pass invalid sizes to this function and we already used it as an array offset earlier so it's too late to check here. Signed-off-by: Dan Carpenter --- drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 3 --- 1 file changed, 3 deletions(-)

[bug report] drm/amdgpu: add amdgpu_ras.c to support ras (v2)

2019-03-20 Thread Dan Carpenter
|| pages <= 0) Check 1216 return 0; 1217 regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[bug report] drm/amdgpu: tighten gpu_recover in mailbox_flr to avoid duplicate recover in sriov

2019-03-05 Thread Dan Carpenter
^^ amdgpu_lockup_timeout is an int and I'm not sure if that's what you want to test. MAX_SCHEDULE_TIMEOUT is LONG_MAX. 271 amdgpu_device_gpu_recover(adev, NULL); 272 } regards, dan carpenter ___ amd-gfx mailing list

[bug report] drm/amd/display: Call into DC once per multiplane flip

2019-02-19 Thread Dan Carpenter
4851 mutex_unlock(>dc_lock); 4852 } 4853 4854 if (planes_count) { regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Re: [Intel-gfx] [PATCH 1/3] drm/i915: Move dsc rate params compute into drm

2019-02-14 Thread Dan Carpenter via amd-gfx
Hi David, url: https://github.com/0day-ci/linux/commits/David-Francis/Make-DRM-DSC-helpers-more-generally-usable/20190214-052541 smatch warnings: drivers/gpu/drm/drm_dsc.c:306 drm_dsc_compute_rc_parameters() warn: impossible condition '(vdsc_cfg->nfl_bpg_offset > 65535) => (0-u16max >

[bug report] drm/amd/display: Calc vline position in dc.

2019-02-13 Thread Dan Carpenter via amd-gfx
154 else 155 *start_line = vsync_line - req_delta_lines; 156 157 *end_line = *start_line + 2; 158 159 if (*end_line >= dc_crtc_timing->v_total) 160 *end_line = 2;

[bug report] drm/amd/display: Call into DC once per multiplane flip

2019-02-05 Thread Dan Carpenter
dm, regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[bug report] drm/amd/dc: Add dc display driver (v2)

2019-01-09 Thread Dan Carpenter
rrent_state" gets dereferenced inside the function. This style of one function cleans up everything error handling is always buggy... :/ https://plus.google.com/u/0/106378716002406849458/posts/1Ud9JbaYnPr 755 return false; 756 } regards, dan carpenter _

[bug report] drm/amdgpu : Generate XGMI topology info from driver level

2019-01-04 Thread Dan Carpenter
137 } 138 139 list_for_each_entry(tmp_adev, >device_list, gmc.xgmi.head) { 140 ret = amdgpu_xgmi_update_topology(hive, tmp_adev); 141 if (ret) 142 break; 143 } 144

[bug report] drm/amdkfd: Add DMABuf import functionality

2018-12-14 Thread Dan Carpenter
truct kgd_mem **), , 1646NULL); 1647 if (r) 1648 goto err_unlock; regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[bug report] drm/amd/display: Add support for Freesync 2 HDR and Content to Display Mapping

2018-11-23 Thread Dan Carpenter
_params->max_content == 0 || ^ Too late. 827 fs_params->max_display == 0) 828 return false; regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.or

[bug report] drm/amdgpu: Refine CSA related functions

2018-11-23 Thread Dan Carpenter
fails. 50 return 0; 51 } regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[bug report] drm/amd/dc: Add dc display driver (v2)

2018-11-01 Thread Dan Carpenter
ms->asic_id); 676 if (!dc->res_pool) 677 goto fail; 678 679 dc_resource_state_construct(dc, dc->current_state); 680 681 if (!create_links(dc, init_params->num_virtual_links)) 682 goto fail; 683

[bug report] drm/amd/display: Build stream update and plane updates in dm

2018-09-28 Thread Dan Carpenter
num_plane].surface->dst_rect = 5196 new_dm_plane_state->dc_state->dst_rect; 5197 updates[num_plane].surface->rotation = regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.free

[PATCH] drm/amdgpu: fix a NULL check in debugfs init

2018-09-26 Thread Dan Carpenter
The debugfs_create_file() returns error pointers if DEBUGFS isn't enabled. But here, we know that it is enabled so it returns NULL on error which could lead to a NULL dereference a few lines later. Signed-off-by: Dan Carpenter --- If someone wanted to delete the error handling as well

[bug report] drm/amd/display: Program vline interrupt on FAST update

2018-09-25 Thread Dan Carpenter
^ The old code didn't check. 1464 // if otg funcs defined check if blanked before programming 1465 if (!pipe_ctx->stream_res.tg->funcs->is_blanke

Re: [PATCH 1/6] drm/dp_mst: Introduce drm_dp_mst_connector_atomic_check()

2018-09-20 Thread Dan Carpenter
Hi Lyude, Thank you for the patch! Perhaps something to improve: url: https://github.com/0day-ci/linux/commits/Lyude-Paul/Fix-legacy-DPMS-changes-with-MST/20180919-203434 base: git://anongit.freedesktop.org/drm-intel for-linux-next smatch warnings:

[bug report] drm/radeon: use pcie functions for link width

2018-09-04 Thread Dan Carpenter
speed_cntl |= LC_INITIATE_LINK_SPEED_CHANGE; 9651 WREG32_PCIE_PORT(PCIE_LC_SPEED_CNTL, speed_cntl); 9652 9653 for (i = 0; i < rdev->usec_timeout; i++) { 9654 speed_cntl = RREG32_PCIE_PORT(PCIE_LC_SPEED_CNTL); 9655 if ((speed

[PATCH] drm/amd/display: indent an if statement

2018-08-14 Thread Dan Carpenter
The if statement isn't indented and it makes static checkers complain. Signed-off-by: Dan Carpenter diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c index 4ca41d6e3bcf..d82ba58c720f 100644 --- a/drivers/gpu/drm/amd/display/dc

[PATCH] drm/amdgpu: fix integer overflow test in amdgpu_bo_list_create()

2018-08-10 Thread Dan Carpenter
ist array after the list") Signed-off-by: Dan Carpenter diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c index d472a2c8399f..b80243d3972e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_list.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bo_l

[bug report] drm/amd/display: Read AUX channel even if only status byte is returned

2018-07-31 Thread Dan Carpenter
76 ); 677 678 break; regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[PATCH] drm/amd/display: off by one in find_irq_source_info()

2018-07-04 Thread Dan Carpenter
The ->info[] array has DAL_IRQ_SOURCES_NUMBER elements so this condition should be >= instead of > or we could read one element beyond the end of the array. Fixes: 4562236b3bc0 ("drm/amd/dc: Add dc display driver (v2)") Signed-off-by: Dan Carpenter diff --git a/drivers/gpu

[bug report] drm/amd/display: Fix indentation in dcn10 resource constructor

2018-06-27 Thread Dan Carpenter
fill in from actual raven resource when we create 1014 * more than virtual encoder 1015 */ regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[PATCH] drm/amd/display: Fix a loop timeout in wait_for_fbc_state_changed()

2018-06-20 Thread Dan Carpenter
t;) Signed-off-by: Dan Carpenter diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c index e2994d337044..8e83ec66fd22 100644 --- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_compressor.c +++ b/drivers/gpu/drm/amd/

[PATCH] drm/amd/amdgpu: Fix debugfs error handling

2018-06-14 Thread Dan Carpenter
you don't have to look at the surrounding code to see whether debugfs is enabled or not. Signed-off-by: Dan Carpenter diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c index f5fb93795a69..dd9a4fb9ce39 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debu

[bug report] drm/amd/powerplay: add control gfxoff enabling in late init

2018-05-17 Thread Dan Carpenter
hecked dereference. 195 (hwmgr->feature_mask & PP_GFXOFF_MASK)) { 196 ret = hwmgr->hwmgr_func->gfx_off_control(hwmgr, true); 197 if (ret) 198 pr_err("gfx off enabling failed!\n"); 199

[bug report] drm/amd/pp: Use gfx rlc funcs directly in powerplay

2018-05-17 Thread Dan Carpenter
(uint16_t)(PPSMC_MSG_EnableDpmDidt)); 970 PP_ASSERT_WITH_CODE((0 == result), 971 "Failed to enable DPM DIDT.", return result); 972 } 973 mutex_unlock(>grb

[bug report] drm/amd/display: Adding stutter entry wm to dce bw struct

2018-05-17 Thread Dan Carpenter
3248 bw_fixed_to_int(bw_mul(data-> 3249 stutter_entry_watermark[0], bw_int_to_fixed(1000))); See also: drivers/gpu/drm/amd/amdgpu/../display/dc/calcs/dce_calcs.c:3356 bw_calcs() warn: inconsistent indenting regards, dan carpenter _

[bug report] drm/amd/pp: Change voltage/clk range for OD feature on VI

2018-05-17 Thread Dan Carpenter
x_vddc'. drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/vegam_smumgr.c:1588 vegam_populate_clock_stretcher_data_table() error: uninitialized symbol 'efuse'. drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/vegam_smumgr.c:1725 vegam_populate_avfs_parameters() erro

[PATCH] drm/amd/pp: missing curly braces in smu7_enable_sclk_mclk_dpm()

2018-05-17 Thread Dan Carpenter
We added some more lines of code to this if statement but forgot to add curly braces. Fixes: 0c24e7ef233b ("drm/amd/powerplay: add specific changes for VEGAM in smu7_hwmgr.c") Signed-off-by: Dan Carpenter <dan.carpen...@oracle.com> diff --git a/drivers/gpu/drm/amd/powerplay/hw

Re: [PATCH] drm/amdkfd: Integer overflows in ioctl

2018-04-25 Thread Dan Carpenter
for this to be bigger than the number of GPUs in the system. The > maximum number of GPUs supported due to device minor limit in DRM is 128. > 128 is sort of a magic number. Is there a MAX_GPU define or something? regards, dan carpenter ___ a

[PATCH] drm/amdkfd: Integer overflows in ioctl

2018-04-24 Thread Dan Carpenter
args->n_devices is a u32 that comes from the user. The multiplication could overflow on 32 bit systems possibly leading to privilege escalation. Fixes: 5ec7e02854b3 ("drm/amdkfd: Add ioctls for GPUVM memory management") Signed-off-by: Dan Carpenter dan.carpen...@oracle.com> diff

[bug report] amd\powerplay Implement get dal power level

2018-04-04 Thread Dan Carpenter
e should be using table->entries[0] here? 1487 return 0; 1488 } 1489 } 1490 return -EINVAL; 1491 } regards, dan carpenter ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx

<    1   2   3   4   >