Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1451499
| Path | csiph.com!aioe.org!gothmog.csi.it!bofh.it!news.nic.it!robomod |
|---|---|
| From | Alex Deucher <alexdeucher@gmail.com> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH RFC] drm/radeon/ci add comment to document intentionally unreachable code |
| Date | Wed, 27 Jul 2016 22:40:01 +0200 |
| Message-ID | <rZDMt-4ga-7@gated-at.bofh.it> (permalink) |
| References | <rWJEJ-8P-13@gated-at.bofh.it> |
| X-Original-To | Nicholas Mc Guire <hofrat@osadl.org> |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=J96/Yw+BtHzsccSgwWq0eWHJ7nTKOwUeaS41XvJ5I00=; b=Egrh2yzU1vf63fFxfispKIObcRiOQjRZ4GhmfEjOlA4e8FbPpS15I/YshjZUrDVcMi +hNZxv76nTrm3auq8b/9pufFtF4hG1KBcqEzYstaUAG9EsOpN2l0nh3OUjBSSZozi/Rr aeH7MAAcWmV8jORiZJL2fGpAYD+iTtPviM7PEskcRwvr7FNsacihl9hm7wRXoIbiptj6 xkoYlXBmz1NSdguHMlU3hxIkPQuZ0BDl37L791kiEAvTIdWzQy83s1I7O5yL2KEFBr/n iE5ai1s4auXTFzxC++zfjdV7/jHS6HJyGDworlMLncrj7b1jDdv40p5fyda00q3G7Dx1 fHnA== |
| X-Google-Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=J96/Yw+BtHzsccSgwWq0eWHJ7nTKOwUeaS41XvJ5I00=; b=ddjldadHZp3j07tOyq9lkfA2HVhW0zBH2ELycWmcFF+2Sg2lylcqUSmZ0pK+YoCy7C UGijtwo0LMrvrZ7Pb+Yy+zLX1EUhEkM0i+qs6pX3UkQx5GN1cEEJOFy4MWZoApojoHIP hGxnFI/MoTguVI5i1kcT7jZSCgOy5AQ5xsj9bIM4ggZRDTHgqcXC3i39a2uV0ybewFX3 WbQd9fTvE99QHKcMIjvKOfKz3mFwzzfbjg9Qf9dROdQ/sMXrBy7AJqY7kDsBkNqBZJvy xydLnbXN9LBTXm0VHsA3fk78Pm9+Ted8MjGATDJd3/YvfE7Y1ntRY6a/4IkQzJcR1pOe tQTg== |
| X-Gm-Message-State | AEkoouuYFhwoCxkBk5Z+7LDF5eKV85wSnvK4Tkz6spyrBrjLs1XjtE6cyDaD4CuDD32mdLBdKrKl/pBpMw8OAQ== |
| X-Received | by 10.37.43.129 with SMTP id r123mr24789541ybr.51.1469651604132; Wed, 27 Jul 2016 13:33:24 -0700 (PDT) |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8 |
| Content-Transfer-Encoding | 8BIT |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 76 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Alex Deucher <alexander.deucher@amd.com>, Christian Koenig <christian.koenig@amd.com>, Maling list - DRI developers <dri-devel@lists.freedesktop.org>, LKML <linux-kernel@vger.kernel.org> |
| X-Original-Date | Wed, 27 Jul 2016 16:33:23 -0400 |
| X-Original-Message-ID | <CADnq5_Np3QApNKm7ZUFyRu2w72YirFadgCJ_uS4dYKC8UbwK5A@mail.gmail.com> |
| X-Original-References | <1468958046-9217-1-git-send-email-hofrat@osadl.org> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1451499 |
Show key headers only | View raw
On Tue, Jul 19, 2016 at 3:54 PM, Nicholas Mc Guire <hofrat@osadl.org> wrote:
> commit d967be9b80a5 ("drm/radeon/ci: disable needless sclk changes")
> introduces an unreachable if(C != C) conditional code section
> flagged by coccinelle script bad_conditional.cocci:
>
> Add a comment to make it clear that this is intentional.
>
> Fixes: d967be9b80a5 ("drm/radeon/ci: disable needless sclk changes")
>
> Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Applied. thanks.
Alex
> ---
> ./drivers/gpu/drm/radeon/ci_dpm.c:3847 bad/useless conditional
> <snip>
> 3845 } else {
> 3846 /* XXX check display min clock requirements */
> 3847 if (CISLAND_MINIMUM_ENGINE_CLOCK !=
> CISLAND_MINIMUM_ENGINE_CLOCK)
> 3848 pi->need_update_smu7_dpm_table |= DPMTABLE_UPDATE_SCLK;
> 3849 }
> <snip>
>
> which is unreachable given the condition - as this seems to be an
> intentional disabling of that code section as stated in the commit
> message of d967be9b80a5 ("drm/radeon/ci: disable needless sclk changes")
> that introduced that change it should be at least commented
>
> in drivers/gpu/drm/amd/amdgpu/ci_dpm.c at line 3988
> 3986 } else {
> 3987 /* XXX check display min clock requirements */
> 3988 if (CISLAND_MINIMUM_ENGINE_CLOCK !=
> CISLAND_MINIMUM_ENGINE_CLOCK)
> 3989 pi->need_update_smu7_dpm_table |= DPMTABLE_UPDATE_SCLK;
> 3990 }
>
> The below patch adds a possibly suitable comment (taken directly from
> commit d967be9b80a5 ("drm/radeon/ci: disable needless sclk changes")
> But I´m not sure if such constructs really should be in the upstream
> kernel at all....
>
> Patch was compile tested with x86_64_defconfig + CONFIG_DRM_RADEON=m
>
> Patch is against 4.7.0-rc7 (localversion-next is -next-20160719)
>
> drivers/gpu/drm/radeon/ci_dpm.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/radeon/ci_dpm.c b/drivers/gpu/drm/radeon/ci_dpm.c
> index 35e0fc3..7ba4508 100644
> --- a/drivers/gpu/drm/radeon/ci_dpm.c
> +++ b/drivers/gpu/drm/radeon/ci_dpm.c
> @@ -3843,7 +3843,10 @@ static void ci_find_dpm_states_clocks_in_dpm_table(struct radeon_device *rdev,
> if (i >= sclk_table->count) {
> pi->need_update_smu7_dpm_table |= DPMTABLE_OD_UPDATE_SCLK;
> } else {
> - /* XXX check display min clock requirements */
> + /* XXX The current code always reprogrammed the sclk levels,
> + * but we don't currently handle disp sclk requirements
> + * so just skip it.
> + */
> if (CISLAND_MINIMUM_ENGINE_CLOCK != CISLAND_MINIMUM_ENGINE_CLOCK)
> pi->need_update_smu7_dpm_table |= DPMTABLE_UPDATE_SCLK;
> }
> --
> 2.1.4
>
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
>
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
Re: [PATCH RFC] drm/radeon/ci add comment to document intentionally unreachable code Alex Deucher <alexdeucher@gmail.com> - 2016-07-27 22:40 +0200
csiph-web