lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <A3397C8B8B789E45844E7EC5DEAD89D06E912210@satlexdag05.amd.com>
Date:	Mon, 26 Oct 2015 15:55:38 +0000
From:	"Deucher, Alexander" <Alexander.Deucher@....com>
To:	Andrzej Hajda <a.hajda@...sung.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
CC:	Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>,
	Marek Szyprowski <m.szyprowski@...sung.com>,
	David Airlie <airlied@...ux.ie>,
	"Koenig, Christian" <Christian.Koenig@....com>,
	"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>
Subject: RE: [PATCH 38/38] drm/radeon: simplify boot level calculation

> -----Original Message-----
> From: Andrzej Hajda [mailto:a.hajda@...sung.com]
> Sent: Monday, September 21, 2015 9:34 AM
> To: linux-kernel@...r.kernel.org
> Cc: Andrzej Hajda; Bartlomiej Zolnierkiewicz; Marek Szyprowski; David Airlie;
> Deucher, Alexander; Koenig, Christian; dri-devel@...ts.freedesktop.org
> Subject: [PATCH 38/38] drm/radeon: simplify boot level calculation
> 
> The patch simplifies the code without changing behaviour, but most
> problably there is a bug somewhere else.

I'd prefer the leave the code as is in case we ever add ACP support to these asics.

Thanks,

Alex

> 
> The problem has been detected using proposed semantic patch
> scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1].
> 
> [1]: http://permalink.gmane.org/gmane.linux.kernel/2038576
> 
> Signed-off-by: Andrzej Hajda <a.hajda@...sung.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/kv_dpm.c | 11 +----------
>  drivers/gpu/drm/radeon/kv_dpm.c     | 11 +----------
>  2 files changed, 2 insertions(+), 20 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/kv_dpm.c
> b/drivers/gpu/drm/amd/amdgpu/kv_dpm.c
> index 94ec04a..f9cfc56 100644
> --- a/drivers/gpu/drm/amd/amdgpu/kv_dpm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/kv_dpm.c
> @@ -1622,19 +1622,10 @@ static int kv_update_samu_dpm(struct
> amdgpu_device *adev, bool gate)
> 
>  static u8 kv_get_acp_boot_level(struct amdgpu_device *adev)
>  {
> -	u8 i;
>  	struct amdgpu_clock_voltage_dependency_table *table =
>  		&adev-
> >pm.dpm.dyn_state.acp_clock_voltage_dependency_table;
> 
> -	for (i = 0; i < table->count; i++) {
> -		if (table->entries[i].clk >= 0) /* XXX */
> -			break;
> -	}
> -
> -	if (i >= table->count)
> -		i = table->count - 1;
> -
> -	return i;
> +	return table->count ? 0 : -1;
>  }
> 
>  static void kv_update_acp_boot_level(struct amdgpu_device *adev)
> diff --git a/drivers/gpu/drm/radeon/kv_dpm.c
> b/drivers/gpu/drm/radeon/kv_dpm.c
> index 2d71da4..dc9aab5 100644
> --- a/drivers/gpu/drm/radeon/kv_dpm.c
> +++ b/drivers/gpu/drm/radeon/kv_dpm.c
> @@ -1546,19 +1546,10 @@ static int kv_update_samu_dpm(struct
> radeon_device *rdev, bool gate)
> 
>  static u8 kv_get_acp_boot_level(struct radeon_device *rdev)
>  {
> -	u8 i;
>  	struct radeon_clock_voltage_dependency_table *table =
>  		&rdev-
> >pm.dpm.dyn_state.acp_clock_voltage_dependency_table;
> 
> -	for (i = 0; i < table->count; i++) {
> -		if (table->entries[i].clk >= 0) /* XXX */
> -			break;
> -	}
> -
> -	if (i >= table->count)
> -		i = table->count - 1;
> -
> -	return i;
> +	return table->count ? 0 : -1;
>  }
> 
>  static void kv_update_acp_boot_level(struct radeon_device *rdev)
> --
> 1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ