New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 866617 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Jul 26
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

Build warnings in AMD GPU code

Project Member Reported by groeck@chromium.org, Jul 23

Issue description

tree:   https://chromium.googlesource.com/chromiumos/third_party/kernel chromeos-4.14 
head:   0aa0b62c9c366ab01cf2489054bd0c3cba0bbc42 
commit: c3d31aa0e1f26dd3276b32a012cfad29798d724a [147/150] UPSTREAM: drm/amdgpu: Implement get_local_mem_info 
config: i386-allmodconfig (attached as .config) 
compiler: gcc-7 (Debian 7.3.0-16) 7.3.0 
reproduce: 
        git checkout c3d31aa0e1f26dd3276b32a012cfad29798d724a 
        # save the attached .config to linux build tree 
        make ARCH=i386 

All warnings (new ones prefixed by >>): 

   In file included from include/linux/kernel.h:14:0, 
                    from include/asm-generic/bug.h:18, 
                    from arch/x86/include/asm/bug.h:83, 
                    from include/linux/bug.h:5, 
                    from include/linux/mmdebug.h:5, 
                    from include/linux/mm.h:9, 
                    from drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.h:29, 
                    from drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c:23: 
   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c: In function 'get_local_mem_info': 
>> drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c:307:11: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 3 has type 'resource_size_t {aka unsigned int}' [-Wformat=] 
     pr_debug("Address base: 0x%llx limit 0x%llx public 0x%llx private 0x%llx\n", 
              ^ 
   include/linux/printk.h:286:21: note: in definition of macro 'pr_fmt' 
    #define pr_fmt(fmt) fmt 
                        ^~~ 
   include/linux/printk.h:334:2: note: in expansion of macro 'dynamic_pr_debug' 
     dynamic_pr_debug(fmt, ##__VA_ARGS__) 
     ^~~~~~~~~~~~~~~~ 
   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c:307:2: note: in expansion of macro 'pr_debug' 
     pr_debug("Address base: 0x%llx limit 0x%llx public 0x%llx private 0x%llx\n", 
     ^~~~~~~~ 
   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c:307:11: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'resource_size_t {aka unsigned int}' [-Wformat=] 
     pr_debug("Address base: 0x%llx limit 0x%llx public 0x%llx private 0x%llx\n", 
              ^ 
   include/linux/printk.h:286:21: note: in definition of macro 'pr_fmt' 
    #define pr_fmt(fmt) fmt 
                        ^~~ 
   include/linux/printk.h:334:2: note: in expansion of macro 'dynamic_pr_debug' 
     dynamic_pr_debug(fmt, ##__VA_ARGS__) 
     ^~~~~~~~~~~~~~~~ 
   drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c:307:2: note: in expansion of macro 'pr_debug' 
     pr_debug("Address base: 0x%llx limit 0x%llx public 0x%llx private 0x%llx\n", 
     ^~~~~~~~ 

vim +307 drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c 

If AMD doesn't support 32-bit builds, maybe the build should be restricted upstream and in chromeos-4.14 to 32-bit builds. Just a thought.


 
Cc: ddavenp...@chromium.org
Owner: dbehr@chromium.org
Status: Started (was: Untriaged)
should be fixed by
commit 0659d1ce015f16e94320c8dc1e59c71a6b919701
Author: Arnd Bergmann <arnd@arndb.de>
Date:   Mon Jan 8 13:53:56 2018 +0100

    UPSTREAM: drm/amdgpu: use %pap format string for phys_addr_t
    
    The newly added get_local_mem_info() function prints a phys_addr_t
    using 0x%llx, which is wrong on most 32-bit systems, as shown by
    this warning:
    
    drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c: In function 'get_local_mem_info':
    include/linux/kern_levels.h:5:18: error: format '%llx' expects argument of type 'long long unsigned int', but argument 2 has type 'resource_size_t {aka unsigned int}' [-Werror=format=]
    drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c:297:31: note: format string is defined here
      pr_debug("Address base: 0x%llx limit 0x%llx public 0x%llx private 0x%llx\n",
    
    Passing the address by reference to the special %pap format string will
    produce the correct output and avoid the warning.
    
    Fixes: 30f1c0421ec5 ("drm/amdgpu: Implement get_local_mem_info")
    BUG=b:79158447
    TEST=boot Grunt, run graphics_SanAngeles and login_LoginSuccess
    
    Signed-off-by: Arnd Bergmann <arnd@arndb.de>
    Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    (cherry picked from commit fb8baefc7b2d7b93ad96abacbe63fa99e3d213d6)
    Signed-off-by: Dominik Behr <dbehr@chromium.org>
    
    Change-Id: I72dd288bf96fc82633a78d4b6d883a6834fbcc83

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
index 335e454e2ee1..1d605e1c1d66 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
@@ -294,8 +294,8 @@ void get_local_mem_info(struct kgd_dev *kgd,
        }
        mem_info->vram_width = adev->mc.vram_width;
 
-       pr_debug("Address base: 0x%llx limit 0x%llx public 0x%llx private 0x%llx\n",
-                       adev->mc.aper_base, aper_limit,
+       pr_debug("Address base: %pap limit %pap public 0x%llx private 0x%llx\n",
+                       &adev->mc.aper_base, &aper_limit,
                        mem_info->local_mem_size_public,
                        mem_info->local_mem_size_private);

Status: Fixed (was: Started)

Sign in to add a comment