CC: [email protected]
CC: [email protected]
CC: [email protected]
TO: Shyam Sundar S K <[email protected]>
CC: Hans de Goede <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   c9194f32bfd932e976a158d1af97a63be68a2aab
commit: 76620567496237f1f1f54683ec7da1755ee501d7 platform/x86: amd-pmc: Add 
support for logging SMU metrics
date:   3 weeks ago
:::::: branch date: 24 hours ago
:::::: commit date: 3 weeks ago
config: x86_64-randconfig-c001-20210807 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 
41a6b50c25961addc04438b567ee1f4ef9e40f98)
reproduce (this is a W=1 build):
        wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=76620567496237f1f1f54683ec7da1755ee501d7
        git remote add linus 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 76620567496237f1f1f54683ec7da1755ee501d7
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 
clang-analyzer 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>


clang-analyzer warnings: (new ones prefixed by >>)
                   ^
   drivers/platform/x86/thinkpad_acpi.c:406:52: note: expanded from macro 
'dbg_printk'
   #define dbg_printk(a_dbg_level, format, arg...)                         \
                                                                           ^
   drivers/platform/x86/thinkpad_acpi.c:10347:7: note: Assuming 'dytc_version' 
is < 6
                   if (dytc_version >= 6) {
                       ^~~~~~~~~~~~~~~~~
   drivers/platform/x86/thinkpad_acpi.c:10347:3: note: Taking false branch
                   if (dytc_version >= 6) {
                   ^
   drivers/platform/x86/thinkpad_acpi.c:10358:7: note: Assuming 'err' is 0
                   if (err)
                       ^~~
   drivers/platform/x86/thinkpad_acpi.c:10358:3: note: Taking false branch
                   if (err)
                   ^
   drivers/platform/x86/thinkpad_acpi.c:10363:3: note: Calling 
'dytc_profile_refresh'
                   dytc_profile_refresh();
                   ^~~~~~~~~~~~~~~~~~~~~~
   drivers/platform/x86/thinkpad_acpi.c:10285:2: note: 'profile' declared 
without an initial value
           enum platform_profile_option profile;
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/platform/x86/thinkpad_acpi.c:10290:6: note: Assuming 
'dytc_mmc_get_available' is true
           if (dytc_mmc_get_available)
               ^~~~~~~~~~~~~~~~~~~~~~
   drivers/platform/x86/thinkpad_acpi.c:10290:2: note: Taking true branch
           if (dytc_mmc_get_available)
           ^
   drivers/platform/x86/thinkpad_acpi.c:10291:9: note: Calling 'dytc_command'
                   err = dytc_command(DYTC_CMD_MMC_GET, &output);
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/platform/x86/thinkpad_acpi.c:9934:19: note: Assuming the condition 
is false
           if (ACPI_FAILURE(acpi_get_handle(hkey_handle, "DYTC", 
&dytc_handle))) {
                            ^
   include/acpi/acexcep.h:58:42: note: expanded from macro 'ACPI_FAILURE'
   #define ACPI_FAILURE(a)                 (a)
                                            ^
   drivers/platform/x86/thinkpad_acpi.c:9934:2: note: Taking false branch
           if (ACPI_FAILURE(acpi_get_handle(hkey_handle, "DYTC", 
&dytc_handle))) {
           ^
   drivers/platform/x86/thinkpad_acpi.c:9938:6: note: Assuming the condition is 
false
           if (!acpi_evalf(dytc_handle, output, NULL, "dd", command))
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/platform/x86/thinkpad_acpi.c:9938:2: note: Taking false branch
           if (!acpi_evalf(dytc_handle, output, NULL, "dd", command))
           ^
   drivers/platform/x86/thinkpad_acpi.c:9940:2: note: Returning zero, which 
participates in a condition later
           return 0;
           ^~~~~~~~
   drivers/platform/x86/thinkpad_acpi.c:10291:9: note: Returning from 
'dytc_command'
                   err = dytc_command(DYTC_CMD_MMC_GET, &output);
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/platform/x86/thinkpad_acpi.c:10295:6: note: 'err' is 0
           if (err)
               ^~~
   drivers/platform/x86/thinkpad_acpi.c:10295:2: note: Taking false branch
           if (err)
           ^
   drivers/platform/x86/thinkpad_acpi.c:10299:2: note: Calling 
'convert_dytc_to_profile'
           convert_dytc_to_profile(perfmode, &profile);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/platform/x86/thinkpad_acpi.c:10151:2: note: Control jumps to the 
'default' case at line 10162
           switch (dytcmode) {
           ^
   drivers/platform/x86/thinkpad_acpi.c:10163:3: note: Returning without 
writing to '*profile'
                   return -EINVAL;
                   ^
   drivers/platform/x86/thinkpad_acpi.c:10299:2: note: Returning from 
'convert_dytc_to_profile'
           convert_dytc_to_profile(perfmode, &profile);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/platform/x86/thinkpad_acpi.c:10300:14: note: The left operand of 
'!=' is a garbage value
           if (profile != dytc_current_profile) {
               ~~~~~~~ ^
   drivers/platform/x86/thinkpad_acpi.c:11187:4: warning: Call to function 
'strcpy' is insecure as it does not provide bounding of the memory buffer. 
Replace unbounded copy functions with analogous functions that support length 
arguments such as 'strlcpy'. CWE-119 
[clang-analyzer-security.insecureAPI.strcpy]
                           strcpy(ibms_init[i].param, val);
                           ^~~~~~
   drivers/platform/x86/thinkpad_acpi.c:11187:4: note: Call to function 
'strcpy' is insecure as it does not provide bounding of the memory buffer. 
Replace unbounded copy functions with analogous functions that support length 
arguments such as 'strlcpy'. CWE-119
                           strcpy(ibms_init[i].param, val);
                           ^~~~~~
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   3 warnings generated.
   Suppressed 3 warnings (3 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   8 warnings generated.
>> drivers/platform/x86/amd-pmc.c:204:37: warning: The left operand of '<<' is 
>> a garbage value [clang-analyzer-core.UndefinedBinaryOperatorResult]
           smu_phys_addr = ((u64)phys_addr_hi << 32 | phys_addr_low);
                                              ^
   drivers/platform/x86/amd-pmc.c:363:6: note: Assuming 'rdev' is non-null
           if (!rdev || !pci_match_id(pmc_pci_ids, rdev)) {
               ^~~~~
   drivers/platform/x86/amd-pmc.c:363:6: note: Left side of '||' is false
   drivers/platform/x86/amd-pmc.c:363:15: note: Assuming the condition is false
           if (!rdev || !pci_match_id(pmc_pci_ids, rdev)) {
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/platform/x86/amd-pmc.c:363:2: note: Taking false branch
           if (!rdev || !pci_match_id(pmc_pci_ids, rdev)) {
           ^
   drivers/platform/x86/amd-pmc.c:370:6: note: Assuming 'err' is 0
           if (err) {
               ^~~
   drivers/platform/x86/amd-pmc.c:370:2: note: Taking false branch
           if (err) {
           ^
   drivers/platform/x86/amd-pmc.c:377:6: note: Assuming 'err' is 0
           if (err) {
               ^~~
   drivers/platform/x86/amd-pmc.c:377:2: note: Taking false branch
           if (err) {
           ^
   drivers/platform/x86/amd-pmc.c:385:6: note: Assuming 'err' is 0
           if (err) {
               ^~~
   drivers/platform/x86/amd-pmc.c:385:2: note: Taking false branch
           if (err) {
           ^
   drivers/platform/x86/amd-pmc.c:392:6: note: Assuming 'err' is 0
           if (err) {
               ^~~
   drivers/platform/x86/amd-pmc.c:392:2: note: Taking false branch
           if (err) {
           ^
   drivers/platform/x86/amd-pmc.c:403:6: note: Assuming field 'regbase' is 
non-null
           if (!dev->regbase)
               ^~~~~~~~~~~~~
   drivers/platform/x86/amd-pmc.c:403:2: note: Taking false branch
           if (!dev->regbase)
           ^
   drivers/platform/x86/amd-pmc.c:406:2: note: Loop condition is false.  
Exiting loop
           mutex_init(&dev->lock);
           ^
   include/linux/mutex.h:113:32: note: expanded from macro 'mutex_init'
   #define mutex_init(mutex)                                               \
                                                                           ^
   drivers/platform/x86/amd-pmc.c:409:8: note: Calling 
'amd_pmc_setup_smu_logging'
           err = amd_pmc_setup_smu_logging(dev);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/platform/x86/amd-pmc.c:192:21: note: 'phys_addr_hi' declared without 
an initial value
           u32 phys_addr_low, phys_addr_hi;
                              ^~~~~~~~~~~~
   drivers/platform/x86/amd-pmc.c:195:6: note: Assuming field 'cpu_id' is not 
equal to AMD_CPU_ID_PCO
           if (dev->cpu_id == AMD_CPU_ID_PCO)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/platform/x86/amd-pmc.c:195:2: note: Taking false branch
           if (dev->cpu_id == AMD_CPU_ID_PCO)
           ^
   drivers/platform/x86/amd-pmc.c:203:2: note: Calling 'amd_pmc_send_cmd'
           amd_pmc_send_cmd(dev, 0, &phys_addr_hi, SMU_MSG_LOG_GETDRAM_ADDR_HI, 
1);
           
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/platform/x86/amd-pmc.c:237:7: note: '__sleep_us' is not equal to 0
           rc = readx_poll_timeout(ioread32, dev->regbase + 
AMD_PMC_REGISTER_RESPONSE,
                ^
   include/linux/iopoll.h:121:2: note: expanded from macro 'readx_poll_timeout'
           read_poll_timeout(op, val, cond, sleep_us, timeout_us, false, addr)
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/iopoll.h:42:17: note: expanded from macro 'read_poll_timeout'
           might_sleep_if((__sleep_us) != 0); \
                          ^~~~~~~~~~~~
   include/linux/kernel.h:183:39: note: expanded from macro 'might_sleep_if'
   #define might_sleep_if(cond) do { if (cond) might_sleep(); } while (0)
                                         ^~~~
   drivers/platform/x86/amd-pmc.c:237:7: note: Taking true branch
           rc = readx_poll_timeout(ioread32, dev->regbase + 
AMD_PMC_REGISTER_RESPONSE,
                ^
   include/linux/iopoll.h:121:2: note: expanded from macro 'readx_poll_timeout'
           read_poll_timeout(op, val, cond, sleep_us, timeout_us, false, addr)
           ^
   include/linux/iopoll.h:42:2: note: expanded from macro 'read_poll_timeout'
           might_sleep_if((__sleep_us) != 0); \
           ^
   include/linux/kernel.h:183:35: note: expanded from macro 'might_sleep_if'
   #define might_sleep_if(cond) do { if (cond) might_sleep(); } while (0)
                                     ^
   drivers/platform/x86/amd-pmc.c:237:7: note: Loop condition is false.  
Exiting loop
           rc = readx_poll_timeout(ioread32, dev->regbase + 
AMD_PMC_REGISTER_RESPONSE,
                ^
   include/linux/iopoll.h:121:2: note: expanded from macro 'readx_poll_timeout'
           read_poll_timeout(op, val, cond, sleep_us, timeout_us, false, addr)
           ^
   include/linux/iopoll.h:42:2: note: expanded from macro 'read_poll_timeout'
           might_sleep_if((__sleep_us) != 0); \
           ^
   include/linux/kernel.h:183:45: note: expanded from macro 'might_sleep_if'
   #define might_sleep_if(cond) do { if (cond) might_sleep(); } while (0)
                                               ^
   include/linux/kernel.h:132:2: note: expanded from macro 'might_sleep'
--
           ^
   include/linux/iopoll.h:43:24: note: expanded from macro 'read_poll_timeout'
           if (sleep_before_read && __sleep_us) \
                                 ^
   drivers/platform/x86/amd-pmc.c:237:7: note: Loop condition is true.  
Entering loop body
           rc = readx_poll_timeout(ioread32, dev->regbase + 
AMD_PMC_REGISTER_RESPONSE,
                ^
   include/linux/iopoll.h:121:2: note: expanded from macro 'readx_poll_timeout'
           read_poll_timeout(op, val, cond, sleep_us, timeout_us, false, addr)
           ^
   include/linux/iopoll.h:45:2: note: expanded from macro 'read_poll_timeout'
           for (;;) { \
           ^
   drivers/platform/x86/amd-pmc.c:238:10: note: Assuming 'val' is equal to 0
                                   val, val != 0, PMC_MSG_DELAY_MIN_US,
                                        ^
   include/linux/iopoll.h:121:29: note: expanded from macro 'readx_poll_timeout'
           read_poll_timeout(op, val, cond, sleep_us, timeout_us, false, addr)
                                      ^~~~
   include/linux/iopoll.h:47:7: note: expanded from macro 'read_poll_timeout'
                   if (cond) \
                       ^~~~
   drivers/platform/x86/amd-pmc.c:237:7: note: Taking false branch
           rc = readx_poll_timeout(ioread32, dev->regbase + 
AMD_PMC_REGISTER_RESPONSE,
                ^
   include/linux/iopoll.h:121:2: note: expanded from macro 'readx_poll_timeout'
           read_poll_timeout(op, val, cond, sleep_us, timeout_us, false, addr)
           ^
   include/linux/iopoll.h:47:3: note: expanded from macro 'read_poll_timeout'
                   if (cond) \
                   ^
   drivers/platform/x86/amd-pmc.c:237:7: note: '__timeout_us' is 20000
           rc = readx_poll_timeout(ioread32, dev->regbase + 
AMD_PMC_REGISTER_RESPONSE,
                ^
   include/linux/iopoll.h:121:2: note: expanded from macro 'readx_poll_timeout'
           read_poll_timeout(op, val, cond, sleep_us, timeout_us, false, addr)
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/iopoll.h:49:7: note: expanded from macro 'read_poll_timeout'
                   if (__timeout_us && \
                       ^~~~~~~~~~~~
   drivers/platform/x86/amd-pmc.c:237:7: note: Left side of '&&' is true
           rc = readx_poll_timeout(ioread32, dev->regbase + 
AMD_PMC_REGISTER_RESPONSE,
                ^
   include/linux/iopoll.h:121:2: note: expanded from macro 'readx_poll_timeout'
           read_poll_timeout(op, val, cond, sleep_us, timeout_us, false, addr)
           ^
   include/linux/iopoll.h:49:7: note: expanded from macro 'read_poll_timeout'
                   if (__timeout_us && \
                       ^
   drivers/platform/x86/amd-pmc.c:237:7: note: Taking true branch
           rc = readx_poll_timeout(ioread32, dev->regbase + 
AMD_PMC_REGISTER_RESPONSE,
                ^
   include/linux/iopoll.h:121:2: note: expanded from macro 'readx_poll_timeout'
           read_poll_timeout(op, val, cond, sleep_us, timeout_us, false, addr)
           ^
   include/linux/iopoll.h:49:3: note: expanded from macro 'read_poll_timeout'
                   if (__timeout_us && \
                   ^
   drivers/platform/x86/amd-pmc.c:237:7: note:  Execution continues on line 237
           rc = readx_poll_timeout(ioread32, dev->regbase + 
AMD_PMC_REGISTER_RESPONSE,
                ^
   include/linux/iopoll.h:121:2: note: expanded from macro 'readx_poll_timeout'
           read_poll_timeout(op, val, cond, sleep_us, timeout_us, false, addr)
           ^
   include/linux/iopoll.h:52:4: note: expanded from macro 'read_poll_timeout'
                           break; \
                           ^
   drivers/platform/x86/amd-pmc.c:238:10: note: Assuming 'val' is equal to 0
                                   val, val != 0, PMC_MSG_DELAY_MIN_US,
                                        ^
   include/linux/iopoll.h:121:29: note: expanded from macro 'readx_poll_timeout'
           read_poll_timeout(op, val, cond, sleep_us, timeout_us, false, addr)
                                      ^~~~
   include/linux/iopoll.h:57:3: note: expanded from macro 'read_poll_timeout'
           (cond) ? 0 : -ETIMEDOUT; \
            ^~~~
   drivers/platform/x86/amd-pmc.c:237:7: note: '?' condition is false
           rc = readx_poll_timeout(ioread32, dev->regbase + 
AMD_PMC_REGISTER_RESPONSE,
                ^
   include/linux/iopoll.h:121:2: note: expanded from macro 'readx_poll_timeout'
           read_poll_timeout(op, val, cond, sleep_us, timeout_us, false, addr)
           ^
   include/linux/iopoll.h:57:2: note: expanded from macro 'read_poll_timeout'
           (cond) ? 0 : -ETIMEDOUT; \
           ^
   drivers/platform/x86/amd-pmc.c:240:6: note: 'rc' is -110
           if (rc) {
               ^~
   drivers/platform/x86/amd-pmc.c:240:2: note: Taking true branch
           if (rc) {
           ^
   drivers/platform/x86/amd-pmc.c:242:3: note: Returning without writing to 
'*data'
                   return rc;
                   ^
   drivers/platform/x86/amd-pmc.c:203:2: note: Returning from 'amd_pmc_send_cmd'
           amd_pmc_send_cmd(dev, 0, &phys_addr_hi, SMU_MSG_LOG_GETDRAM_ADDR_HI, 
1);
           
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/platform/x86/amd-pmc.c:204:37: note: The left operand of '<<' is a 
garbage value
           smu_phys_addr = ((u64)phys_addr_hi << 32 | phys_addr_low);
                                 ~~~~~~~~~~~~ ^
>> drivers/platform/x86/amd-pmc.c:204:43: warning: The right operand of '|' is 
>> a garbage value [clang-analyzer-core.UndefinedBinaryOperatorResult]
           smu_phys_addr = ((u64)phys_addr_hi << 32 | phys_addr_low);
                                                    ^
   drivers/platform/x86/amd-pmc.c:363:6: note: Assuming 'rdev' is non-null
           if (!rdev || !pci_match_id(pmc_pci_ids, rdev)) {
               ^~~~~
   drivers/platform/x86/amd-pmc.c:363:6: note: Left side of '||' is false
   drivers/platform/x86/amd-pmc.c:363:15: note: Assuming the condition is false
           if (!rdev || !pci_match_id(pmc_pci_ids, rdev)) {
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/platform/x86/amd-pmc.c:363:2: note: Taking false branch
           if (!rdev || !pci_match_id(pmc_pci_ids, rdev)) {
           ^
   drivers/platform/x86/amd-pmc.c:370:6: note: Assuming 'err' is 0
           if (err) {
               ^~~
   drivers/platform/x86/amd-pmc.c:370:2: note: Taking false branch
           if (err) {
           ^
   drivers/platform/x86/amd-pmc.c:377:6: note: Assuming 'err' is 0
           if (err) {
               ^~~
   drivers/platform/x86/amd-pmc.c:377:2: note: Taking false branch
           if (err) {
           ^
   drivers/platform/x86/amd-pmc.c:385:6: note: Assuming 'err' is 0
           if (err) {
               ^~~
   drivers/platform/x86/amd-pmc.c:385:2: note: Taking false branch
           if (err) {
           ^
   drivers/platform/x86/amd-pmc.c:392:6: note: Assuming 'err' is 0
           if (err) {
               ^~~
   drivers/platform/x86/amd-pmc.c:392:2: note: Taking false branch
           if (err) {
           ^
   drivers/platform/x86/amd-pmc.c:403:6: note: Assuming field 'regbase' is 
non-null
           if (!dev->regbase)
               ^~~~~~~~~~~~~
   drivers/platform/x86/amd-pmc.c:403:2: note: Taking false branch
           if (!dev->regbase)
           ^
   drivers/platform/x86/amd-pmc.c:406:2: note: Loop condition is false.  
Exiting loop
           mutex_init(&dev->lock);
           ^
   include/linux/mutex.h:113:32: note: expanded from macro 'mutex_init'
   #define mutex_init(mutex)                                               \
                                                                           ^
   drivers/platform/x86/amd-pmc.c:409:8: note: Calling 
'amd_pmc_setup_smu_logging'
           err = amd_pmc_setup_smu_logging(dev);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/platform/x86/amd-pmc.c:192:6: note: 'phys_addr_low' declared without 
an initial value
           u32 phys_addr_low, phys_addr_hi;
               ^~~~~~~~~~~~~
   drivers/platform/x86/amd-pmc.c:195:6: note: Assuming field 'cpu_id' is not 
equal to AMD_CPU_ID_PCO
           if (dev->cpu_id == AMD_CPU_ID_PCO)
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/platform/x86/amd-pmc.c:195:2: note: Taking false branch
           if (dev->cpu_id == AMD_CPU_ID_PCO)
           ^
   drivers/platform/x86/amd-pmc.c:202:2: note: Calling 'amd_pmc_send_cmd'
           amd_pmc_send_cmd(dev, 0, &phys_addr_low, 
SMU_MSG_LOG_GETDRAM_ADDR_LO, 1);
           
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/platform/x86/amd-pmc.c:237:7: note: '__sleep_us' is not equal to 0
           rc = readx_poll_timeout(ioread32, dev->regbase + 
AMD_PMC_REGISTER_RESPONSE,
                ^
   include/linux/iopoll.h:121:2: note: expanded from macro 'readx_poll_timeout'
           read_poll_timeout(op, val, cond, sleep_us, timeout_us, false, addr)
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/iopoll.h:42:17: note: expanded from macro 'read_poll_timeout'
           might_sleep_if((__sleep_us) != 0); \
                          ^~~~~~~~~~~~
   include/linux/kernel.h:183:39: note: expanded from macro 'might_sleep_if'
   #define might_sleep_if(cond) do { if (cond) might_sleep(); } while (0)
                                         ^~~~
   drivers/platform/x86/amd-pmc.c:237:7: note: Taking true branch
           rc = readx_poll_timeout(ioread32, dev->regbase + 
AMD_PMC_REGISTER_RESPONSE,
                ^
   include/linux/iopoll.h:121:2: note: expanded from macro 'readx_poll_timeout'
           read_poll_timeout(op, val, cond, sleep_us, timeout_us, false, addr)
           ^
   include/linux/iopoll.h:42:2: note: expanded from macro 'read_poll_timeout'
           might_sleep_if((__sleep_us) != 0); \
           ^
   include/linux/kernel.h:183:35: note: expanded from macro 'might_sleep_if'
   #define might_sleep_if(cond) do { if (cond) might_sleep(); } while (0)
                                     ^
   drivers/platform/x86/amd-pmc.c:237:7: note: Loop condition is false.  
Exiting loop
           rc = readx_poll_timeout(ioread32, dev->regbase + 
AMD_PMC_REGISTER_RESPONSE,
                ^
   include/linux/iopoll.h:121:2: note: expanded from macro 'readx_poll_timeout'
           read_poll_timeout(op, val, cond, sleep_us, timeout_us, false, addr)
           ^
   include/linux/iopoll.h:42:2: note: expanded from macro 'read_poll_timeout'
           might_sleep_if((__sleep_us) != 0); \
           ^
   include/linux/kernel.h:183:45: note: expanded from macro 'might_sleep_if'
   #define might_sleep_if(cond) do { if (cond) might_sleep(); } while (0)
                                               ^
   include/linux/kernel.h:132:2: note: expanded from macro 'might_sleep'

vim +204 drivers/platform/x86/amd-pmc.c

156ec4731cb22b Shyam Sundar S K 2020-11-05  189  
76620567496237 Shyam Sundar S K 2021-06-29  190  static int 
amd_pmc_setup_smu_logging(struct amd_pmc_dev *dev)
76620567496237 Shyam Sundar S K 2021-06-29  191  {
76620567496237 Shyam Sundar S K 2021-06-29  192         u32 phys_addr_low, 
phys_addr_hi;
76620567496237 Shyam Sundar S K 2021-06-29  193         u64 smu_phys_addr;
76620567496237 Shyam Sundar S K 2021-06-29  194  
76620567496237 Shyam Sundar S K 2021-06-29  195         if (dev->cpu_id == 
AMD_CPU_ID_PCO)
76620567496237 Shyam Sundar S K 2021-06-29  196                 return -EINVAL;
76620567496237 Shyam Sundar S K 2021-06-29  197  
76620567496237 Shyam Sundar S K 2021-06-29  198         /* Get Active devices 
list from SMU */
76620567496237 Shyam Sundar S K 2021-06-29  199         amd_pmc_send_cmd(dev, 
0, &dev->active_ips, SMU_MSG_GET_SUP_CONSTRAINTS, 1);
76620567496237 Shyam Sundar S K 2021-06-29  200  
76620567496237 Shyam Sundar S K 2021-06-29  201         /* Get dram address */
76620567496237 Shyam Sundar S K 2021-06-29  202         amd_pmc_send_cmd(dev, 
0, &phys_addr_low, SMU_MSG_LOG_GETDRAM_ADDR_LO, 1);
76620567496237 Shyam Sundar S K 2021-06-29  203         amd_pmc_send_cmd(dev, 
0, &phys_addr_hi, SMU_MSG_LOG_GETDRAM_ADDR_HI, 1);
76620567496237 Shyam Sundar S K 2021-06-29 @204         smu_phys_addr = 
((u64)phys_addr_hi << 32 | phys_addr_low);
76620567496237 Shyam Sundar S K 2021-06-29  205  
76620567496237 Shyam Sundar S K 2021-06-29  206         dev->smu_virt_addr = 
devm_ioremap(dev->dev, smu_phys_addr, sizeof(struct smu_metrics));
76620567496237 Shyam Sundar S K 2021-06-29  207         if (!dev->smu_virt_addr)
76620567496237 Shyam Sundar S K 2021-06-29  208                 return -ENOMEM;
76620567496237 Shyam Sundar S K 2021-06-29  209  
76620567496237 Shyam Sundar S K 2021-06-29  210         /* Start the logging */
76620567496237 Shyam Sundar S K 2021-06-29  211         amd_pmc_send_cmd(dev, 
0, NULL, SMU_MSG_LOG_START, 0);
76620567496237 Shyam Sundar S K 2021-06-29  212  
76620567496237 Shyam Sundar S K 2021-06-29  213         return 0;
76620567496237 Shyam Sundar S K 2021-06-29  214  }
76620567496237 Shyam Sundar S K 2021-06-29  215  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to