From: Dan Carpenter <dan.carpenter@oracle.com>
To: Bhawanpreet.Lakha@amd.com
Cc: amd-gfx@lists.freedesktop.org
Subject: [bug report] drm/amd/display: Add DCN3 HWSEQ
Date: Fri, 5 Jun 2020 16:27:54 +0300 [thread overview]
Message-ID: <20200605132754.GA996387@mwanda> (raw)
Hello Bhawanpreet Lakha,
This is a semi-automatic email about new static checker warnings.
The patch 581b9589487e: "drm/amd/display: Add DCN3 HWSEQ" from May
21, 2020, leads to the following Smatch complaint:
drivers/gpu/drm/amd/amdgpu/../display/dc/dcn30/dcn30_hwseq.c:463 dcn30_init_hw()
warn: variable dereferenced before check 'res_pool->dccg' (see line 437)
drivers/gpu/drm/amd/amdgpu/../display/dc/dcn30/dcn30_hwseq.c
436 // Initialize the dccg
437 if (res_pool->dccg->funcs->dccg_init)
^^^^^^^^^^^^^^
The patch adds a dereference.
438 res_pool->dccg->funcs->dccg_init(res_pool->dccg);
439
440 //Enable ability to power gate / don't force power on permanently
441 hws->funcs.enable_power_gating_plane(dc->hwseq, true);
442
443 if (IS_FPGA_MAXIMUS_DC(dc->ctx->dce_environment)) {
444 REG_WRITE(RBBMIF_TIMEOUT_DIS, 0xFFFFFFFF);
445 REG_WRITE(RBBMIF_TIMEOUT_DIS_2, 0xFFFFFFFF);
446
447 hws->funcs.dccg_init(hws);
448
449 REG_UPDATE(DCHUBBUB_GLOBAL_TIMER_CNTL, DCHUBBUB_GLOBAL_TIMER_REFDIV, 2);
450 REG_UPDATE(DCHUBBUB_GLOBAL_TIMER_CNTL, DCHUBBUB_GLOBAL_TIMER_ENABLE, 1);
451 REG_WRITE(REFCLK_CNTL, 0);
452 } else {
453 if (!dcb->funcs->is_accelerated_mode(dcb)) {
454 hws->funcs.bios_golden_init(dc);
455 hws->funcs.disable_vga(dc->hwseq);
456 }
457
458 if (dc->ctx->dc_bios->fw_info_valid) {
459 res_pool->ref_clocks.xtalin_clock_inKhz =
460 dc->ctx->dc_bios->fw_info.pll_info.crystal_frequency;
461
462 if (!IS_FPGA_MAXIMUS_DC(dc->ctx->dce_environment)) {
463 if (res_pool->dccg && res_pool->hubbub) {
^^^^^^^^^^^^^^
This check is too late.
464
465 (res_pool->dccg->funcs->get_dccg_ref_freq)(res_pool->dccg,
regards,
dan carpenter
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next reply other threads:[~2020-06-05 13:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-05 13:27 Dan Carpenter [this message]
-- strict thread matches above, loose matches on Subject: below --
2020-06-05 13:28 [bug report] drm/amd/display: Add DCN3 HWSEQ Dan Carpenter
2024-07-13 23:46 Dan Carpenter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200605132754.GA996387@mwanda \
--to=dan.carpenter@oracle.com \
--cc=Bhawanpreet.Lakha@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox