[bug report] drm/amd/powerplay: implement smu7 hwmgr to manager asics with smu ip version 7.

2016-10-17 Thread Zhu, Rex
Thanks, Alex.

Patch was Reviewed-by: Rex Zhu 


Best Regards
Rex

-Original Message-
From: Alex Deucher [mailto:alexdeuc...@gmail.com] 
Sent: Friday, October 14, 2016 11:14 PM
To: Dan Carpenter
Cc: Zhu, Rex; Maling list - DRI developers
Subject: Re: [bug report] drm/amd/powerplay: implement smu7 hwmgr to manager 
asics with smu ip version 7.

On Fri, Oct 14, 2016 at 10:32 AM, Dan Carpenter  
wrote:
> Hello Rex Zhu,
>
> The patch 599a7e9fe1b6: "drm/amd/powerplay: implement smu7 hwmgr to 
> manager asics with smu ip version 7." from Sep 9, 2016, leads to the 
> following static checker warning:
>
> drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/smu7_hwmgr.c:2125 
> smu7_patch_limits_vddc()
> warn: passing casted pointer '>vddc' to 
> 'smu7_patch_ppt_v0_with_vdd_leakage()' 16 vs 32.
>
> drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/smu7_hwmgr.c
>   2119  static int smu7_patch_limits_vddc(struct pp_hwmgr *hwmgr,
>   2120   struct 
> phm_clock_and_voltage_limits *tab)
>   2121  {
>   2122  struct smu7_hwmgr *data = (struct smu7_hwmgr 
> *)(hwmgr->backend);
>   2123
>   2124  if (tab) {
>   2125  smu7_patch_ppt_v0_with_vdd_leakage(hwmgr, (uint32_t 
> *)>vddc,
>   2126  
> >vddc_leakage);
>
> This call corrupts vddci.
>
>   2127  smu7_patch_ppt_v0_with_vdd_leakage(hwmgr, (uint32_t 
> *)>vddci,
>   2128  
> >vddci_leakage);
>
> But that's fine since we immediately overwrite it here.  But 
> unfortunately this call corrupt tab->vddgfx.

Thanks.  Should be fixed in the attached patch.

Alex

>
>   2129  }
>   2130
>   2131  return 0;
>   2132  }
>
> regards,
> dan carpenter
> ___
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel


[bug report] drm/amd/powerplay: implement smu7 hwmgr to manager asics with smu ip version 7.

2016-10-14 Thread Dan Carpenter
Hello Rex Zhu,

The patch 599a7e9fe1b6: "drm/amd/powerplay: implement smu7 hwmgr to
manager asics with smu ip version 7." from Sep 9, 2016, leads to the
following static checker warning:

drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/smu7_hwmgr.c:2125 
smu7_patch_limits_vddc()
warn: passing casted pointer '>vddc' to 
'smu7_patch_ppt_v0_with_vdd_leakage()' 16 vs 32.

drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/smu7_hwmgr.c
  2119  static int smu7_patch_limits_vddc(struct pp_hwmgr *hwmgr,
  2120   struct 
phm_clock_and_voltage_limits *tab)
  2121  {
  2122  struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend);
  2123  
  2124  if (tab) {
  2125  smu7_patch_ppt_v0_with_vdd_leakage(hwmgr, (uint32_t 
*)>vddc,
  2126  
>vddc_leakage);

This call corrupts vddci.

  2127  smu7_patch_ppt_v0_with_vdd_leakage(hwmgr, (uint32_t 
*)>vddci,
  2128  
>vddci_leakage);

But that's fine since we immediately overwrite it here.  But
unfortunately this call corrupt tab->vddgfx.

  2129  }
  2130  
  2131  return 0;
  2132  }

regards,
dan carpenter


[bug report] drm/amd/powerplay: implement smu7 hwmgr to manager asics with smu ip version 7.

2016-10-14 Thread Alex Deucher
On Fri, Oct 14, 2016 at 10:32 AM, Dan Carpenter
 wrote:
> Hello Rex Zhu,
>
> The patch 599a7e9fe1b6: "drm/amd/powerplay: implement smu7 hwmgr to
> manager asics with smu ip version 7." from Sep 9, 2016, leads to the
> following static checker warning:
>
> drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/smu7_hwmgr.c:2125 
> smu7_patch_limits_vddc()
> warn: passing casted pointer '>vddc' to 
> 'smu7_patch_ppt_v0_with_vdd_leakage()' 16 vs 32.
>
> drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/smu7_hwmgr.c
>   2119  static int smu7_patch_limits_vddc(struct pp_hwmgr *hwmgr,
>   2120   struct 
> phm_clock_and_voltage_limits *tab)
>   2121  {
>   2122  struct smu7_hwmgr *data = (struct smu7_hwmgr 
> *)(hwmgr->backend);
>   2123
>   2124  if (tab) {
>   2125  smu7_patch_ppt_v0_with_vdd_leakage(hwmgr, (uint32_t 
> *)>vddc,
>   2126  
> >vddc_leakage);
>
> This call corrupts vddci.
>
>   2127  smu7_patch_ppt_v0_with_vdd_leakage(hwmgr, (uint32_t 
> *)>vddci,
>   2128  
> >vddci_leakage);
>
> But that's fine since we immediately overwrite it here.  But
> unfortunately this call corrupt tab->vddgfx.

Thanks.  Should be fixed in the attached patch.

Alex

>
>   2129  }
>   2130
>   2131  return 0;
>   2132  }
>
> regards,
> dan carpenter
> ___
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
-- next part --
A non-text attachment was scrubbed...
Name: 0001-drm-amdgpu-powerplay-smu7-fix-static-checker-warning.patch
Type: text/x-patch
Size: 1557 bytes
Desc: not available
URL: 



[bug report] drm/amd/powerplay: implement smu7 hwmgr to manager asics with smu ip version 7.

2016-10-13 Thread Christian König
Patch is Reviewed-by: Christian König .

Regards,
Christian.

Am 13.10.2016 um 09:43 schrieb Zhu, Rex:
> Please Review.
>
> Best Regards
> Rex
>
> -Original Message-
> From: Dan Carpenter [mailto:dan.carpenter at oracle.com]
> Sent: Wednesday, October 12, 2016 2:12 PM
> To: Zhu, Rex
> Cc: dri-devel at lists.freedesktop.org
> Subject: [bug report] drm/amd/powerplay: implement smu7 hwmgr to manager 
> asics with smu ip version 7.
>
> Hello Rex Zhu,
>
> This is a semi-automatic email about new static checker warnings.
>
> The patch 599a7e9fe1b6: "drm/amd/powerplay: implement smu7 hwmgr to manager 
> asics with smu ip version 7." from Sep 9, 2016, leads to the following Smatch 
> complaint:
>
> drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/smu7_hwmgr.c:1463 
> smu7_get_evv_voltages()
>error: we previously assumed 'table_info' could be null (see line 1455)
>
> drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/smu7_hwmgr.c
>1454   
>1455   if (table_info != NULL)
>   ^
> Check for non-NULL.
>
>1456   sclk_table = table_info->vdd_dep_on_sclk;
>1457   
>1458   for (i = 0; i < SMU7_MAX_LEAKAGE_COUNT; i++) {
>1459   vv_id = ATOM_VIRTUAL_VOLTAGE_ID0 + i;
>1460   
>1461   if (data->vdd_gfx_control == 
> SMU7_VOLTAGE_CONTROL_BY_SVID2) {
>1462   if (0 == 
> phm_get_sclk_for_voltage_evv(hwmgr,
>1463   
> table_info->vddgfx_lookup_table, vv_id, )) {
>  
> ^^^ Unchecked dereference.
>
>1464   if 
> (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps,
>1465   
> PHM_PlatformCaps_ClockStretcher)) {
>
> regards,
> dan carpenter
>
>
> ___
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel


-- next part --
An HTML attachment was scrubbed...
URL: 
<https://lists.freedesktop.org/archives/dri-devel/attachments/20161013/01752e1e/attachment.html>


[bug report] drm/amd/powerplay: implement smu7 hwmgr to manager asics with smu ip version 7.

2016-10-13 Thread Zhu, Rex

Please Review.

Best Regards
Rex

-Original Message-
From: Dan Carpenter [mailto:dan.carpen...@oracle.com] 
Sent: Wednesday, October 12, 2016 2:12 PM
To: Zhu, Rex
Cc: dri-devel at lists.freedesktop.org
Subject: [bug report] drm/amd/powerplay: implement smu7 hwmgr to manager asics 
with smu ip version 7.

Hello Rex Zhu,

This is a semi-automatic email about new static checker warnings.

The patch 599a7e9fe1b6: "drm/amd/powerplay: implement smu7 hwmgr to manager 
asics with smu ip version 7." from Sep 9, 2016, leads to the following Smatch 
complaint:

drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/smu7_hwmgr.c:1463 
smu7_get_evv_voltages()
 error: we previously assumed 'table_info' could be null (see line 1455)

drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/smu7_hwmgr.c
  1454  
  1455  if (table_info != NULL)
 ^
Check for non-NULL.

  1456  sclk_table = table_info->vdd_dep_on_sclk;
  1457  
  1458  for (i = 0; i < SMU7_MAX_LEAKAGE_COUNT; i++) {
  1459  vv_id = ATOM_VIRTUAL_VOLTAGE_ID0 + i;
  1460  
  1461  if (data->vdd_gfx_control == 
SMU7_VOLTAGE_CONTROL_BY_SVID2) {
  1462  if (0 == phm_get_sclk_for_voltage_evv(hwmgr,
  1463  
table_info->vddgfx_lookup_table, vv_id, )) {

^^^ Unchecked dereference.

  1464  if 
(phm_cap_enabled(hwmgr->platform_descriptor.platformCaps,
  1465  
PHM_PlatformCaps_ClockStretcher)) {

regards,
dan carpenter
-- next part --
A non-text attachment was scrubbed...
Name: 0001-drm-amd-powerplay-fix-static-checker-warnings-in-smu.patch
Type: application/octet-stream
Size: 1105 bytes
Desc: 0001-drm-amd-powerplay-fix-static-checker-warnings-in-smu.patch
URL: 
<https://lists.freedesktop.org/archives/dri-devel/attachments/20161013/7bf264a5/attachment-0001.obj>


[bug report] drm/amd/powerplay: implement smu7 hwmgr to manager asics with smu ip version 7.

2016-10-12 Thread Dan Carpenter
Hello Rex Zhu,

This is a semi-automatic email about new static checker warnings.

The patch 599a7e9fe1b6: "drm/amd/powerplay: implement smu7 hwmgr to 
manager asics with smu ip version 7." from Sep 9, 2016, leads to the 
following Smatch complaint:

drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/smu7_hwmgr.c:1463 
smu7_get_evv_voltages()
 error: we previously assumed 'table_info' could be null (see line 1455)

drivers/gpu/drm/amd/amdgpu/../powerplay/hwmgr/smu7_hwmgr.c
  1454  
  1455  if (table_info != NULL)
 ^
Check for non-NULL.

  1456  sclk_table = table_info->vdd_dep_on_sclk;
  1457  
  1458  for (i = 0; i < SMU7_MAX_LEAKAGE_COUNT; i++) {
  1459  vv_id = ATOM_VIRTUAL_VOLTAGE_ID0 + i;
  1460  
  1461  if (data->vdd_gfx_control == 
SMU7_VOLTAGE_CONTROL_BY_SVID2) {
  1462  if (0 == phm_get_sclk_for_voltage_evv(hwmgr,
  1463  
table_info->vddgfx_lookup_table, vv_id, )) {

^^^
Unchecked dereference.

  1464  if 
(phm_cap_enabled(hwmgr->platform_descriptor.platformCaps,
  1465  
PHM_PlatformCaps_ClockStretcher)) {

regards,
dan carpenter