[android-common:android14-kiwi-6.1 0/192] drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_topology.c:1727:6: warning: no previous prototype for 'kfd_fill_cache_non_crat_info'

kernel test robot <[email protected]>
Newsgroups dev.linux.lists.oe-kbuild-all
Message-ID <[email protected]>
Hi Ma,

FYI, the error/warning still remains.

tree:   https://android.googlesource.com/kernel/common android14-kiwi-6.1
head:   15bdff0dd01eed4ffc4ae138c5a611d8b102a4b6
commit: 0ac954ec7f6c6dd6b7e94340599ba4b788d056d5 [0/192] drm/amdkfd: Fix the warning of array-index-out-of-bounds
config: x86_64-buildonly-randconfig-002-20260716 (https://download.01.org/0day-ci/archive/20260718/[email protected]/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260718/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

>> drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_topology.c:1727:6: warning: no previous prototype for 'kfd_fill_cache_non_crat_info' [-Wmissing-prototypes]
    1727 | void kfd_fill_cache_non_crat_info(struct kfd_topology_device *dev, struct kfd_dev *kdev)
         |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~


vim +/kfd_fill_cache_non_crat_info +1727 drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_topology.c

  1723	
  1724	/* kfd_fill_cache_non_crat_info - Fill GPU cache info using kfd_gpu_cache_info
  1725	 * tables
  1726	 */
> 1727	void kfd_fill_cache_non_crat_info(struct kfd_topology_device *dev, struct kfd_dev *kdev)
  1728	{
  1729		struct kfd_gpu_cache_info *pcache_info = NULL;
  1730		int i, j, k;
  1731		int ct = 0;
  1732		unsigned int cu_processor_id;
  1733		int ret;
  1734		unsigned int num_cu_shared;
  1735		struct kfd_cu_info cu_info;
  1736		struct kfd_cu_info *pcu_info;
  1737		int gpu_processor_id;
  1738		struct kfd_cache_properties *props_ext;
  1739		int num_of_entries = 0;
  1740		int num_of_cache_types = 0;
  1741		struct kfd_gpu_cache_info cache_info[KFD_MAX_CACHE_TYPES];
  1742	
  1743		amdgpu_amdkfd_get_cu_info(kdev->adev, &cu_info);
  1744		pcu_info = &cu_info;
  1745	
  1746		gpu_processor_id = dev->node_props.simd_id_base;
  1747	
  1748		pcache_info = cache_info;
  1749		num_of_cache_types = kfd_get_gpu_cache_info(kdev, &pcache_info);
  1750		if (!num_of_cache_types) {
  1751			pr_warn("no cache info found\n");
  1752			return;
  1753		}
  1754	
  1755		/* For each type of cache listed in the kfd_gpu_cache_info table,
  1756		 * go through all available Compute Units.
  1757		 * The [i,j,k] loop will
  1758		 *		if kfd_gpu_cache_info.num_cu_shared = 1
  1759		 *			will parse through all available CU
  1760		 *		If (kfd_gpu_cache_info.num_cu_shared != 1)
  1761		 *			then it will consider only one CU from
  1762		 *			the shared unit
  1763		 */
  1764		for (ct = 0; ct < num_of_cache_types; ct++) {
  1765			cu_processor_id = gpu_processor_id;
  1766			if (pcache_info[ct].cache_level == 1) {
  1767				for (i = 0; i < pcu_info->num_shader_engines; i++) {
  1768					for (j = 0; j < pcu_info->num_shader_arrays_per_engine; j++) {
  1769						for (k = 0; k < pcu_info->num_cu_per_sh; k += pcache_info[ct].num_cu_shared) {
  1770	
  1771							ret = fill_in_l1_pcache(&props_ext, pcache_info, pcu_info,
  1772											pcu_info->cu_bitmap[i % 4][j + i / 4], ct,
  1773											cu_processor_id, k);
  1774	
  1775							if (ret < 0)
  1776								break;
  1777	
  1778							if (!ret) {
  1779								num_of_entries++;
  1780								list_add_tail(&props_ext->list, &dev->cache_props);
  1781							}
  1782	
  1783							/* Move to next CU block */
  1784							num_cu_shared = ((k + pcache_info[ct].num_cu_shared) <=
  1785								pcu_info->num_cu_per_sh) ?
  1786								pcache_info[ct].num_cu_shared :
  1787								(pcu_info->num_cu_per_sh - k);
  1788							cu_processor_id += num_cu_shared;
  1789						}
  1790					}
  1791				}
  1792			} else {
  1793				ret = fill_in_l2_l3_pcache(&props_ext, pcache_info,
  1794									pcu_info, ct, cu_processor_id);
  1795	
  1796				if (ret < 0)
  1797					break;
  1798	
  1799				if (!ret) {
  1800					num_of_entries++;
  1801					list_add_tail(&props_ext->list, &dev->cache_props);
  1802				}
  1803			}
  1804		}
  1805		dev->node_props.caches_count += num_of_entries;
  1806		pr_debug("Added [%d] GPU cache entries\n", num_of_entries);
  1807	}
  1808	

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.