From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B696AC433EF for ; Thu, 5 May 2022 15:07:28 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C78146B0071; Thu, 5 May 2022 11:07:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C28D66B0073; Thu, 5 May 2022 11:07:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AEF9D6B0074; Thu, 5 May 2022 11:07:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 9D5696B0071 for ; Thu, 5 May 2022 11:07:27 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 743DF2EA75 for ; Thu, 5 May 2022 15:07:27 +0000 (UTC) X-FDA: 79432018134.11.ABBAE1C Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by imf31.hostedemail.com (Postfix) with ESMTP id 10F9A20095 for ; Thu, 5 May 2022 15:07:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1651763246; x=1683299246; h=date:from:to:cc:subject:message-id:mime-version; bh=ocBht83/TVqIHB7fBIQ8ek09DRB391vGKX6ORBQ/3g4=; b=jky75122GJPvfcvKidbiN9WjpGsb7bifKASN9nisrjXihrnAHoc5t70U MoCiaI4d2DsJchkJVjLGXSKr4/DHtalxLBzhvJ+ZIHIz+/5naNMtUPVZ5 +kqgySqesqY6tIV0KgxBIhIHhQBC2teUV0GGQVjo4OOpa0f2QfLVrW2Fk +sitpqic5iY/f5NV/2d8/Mx4jZ2Nx4e3t4Z2IF+2wNpfOBEcGaSHGETTw Gt6MwyRVDCVSIJLnbVG9K1qKX62zpGwA7+lBAgl/6kVnpxWasKHjniJQt 1Dh3QRwRt3CTziT5A9OaJ5EotN/la9ofntJjx81J0Vzn4w6pwBQij6izE w==; X-IronPort-AV: E=McAfee;i="6400,9594,10338"; a="331122984" X-IronPort-AV: E=Sophos;i="5.91,201,1647327600"; d="scan'208";a="331122984" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 May 2022 08:03:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,201,1647327600"; d="scan'208";a="694693743" Received: from lkp-server01.sh.intel.com (HELO 5056e131ad90) ([10.239.97.150]) by orsmga004.jf.intel.com with ESMTP; 05 May 2022 08:03:28 -0700 Received: from kbuild by 5056e131ad90 with local (Exim 4.95) (envelope-from ) id 1nmd0p-000CUU-BM; Thu, 05 May 2022 15:03:27 +0000 Date: Thu, 5 May 2022 23:03:12 +0800 From: kernel test robot To: Jack Xiao Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org, Linux Memory Management List , Alex Deucher , Hawking Zhang Subject: [linux-next:master 8878/9357] drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c:3826:6: warning: variable 'index' is used uninitialized whenever 'if' condition is true Message-ID: <202205052242.u5bVKpOl-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 10F9A20095 Authentication-Results: imf31.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=jky75122; spf=none (imf31.hostedemail.com: domain of lkp@intel.com has no SPF policy when checking 134.134.136.100) smtp.mailfrom=lkp@intel.com; dmarc=pass (policy=none) header.from=intel.com X-Rspam-User: X-Stat-Signature: u61osjybsdtnxqr5ggdfcyxt4gmiwpnf X-HE-Tag: 1651763229-950626 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: 632a8c88e339fe86ae6e420a24dfc641d4dd0ab5 commit: 15d839c16a66434c19f9c8a560b7553f9468e588 [8878/9357] drm/amdgpu/gfx10: add mes support for gfx ib test config: arm64-allmodconfig (https://download.01.org/0day-ci/archive/20220505/202205052242.u5bVKpOl-lkp@intel.com/config) compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 5e004fb787698440a387750db7f8028e7cb14cfc) 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 arm64 cross compiling tool for clang build # apt-get install binutils-aarch64-linux-gnu # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=15d839c16a66434c19f9c8a560b7553f9468e588 git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git git fetch --no-tags linux-next master git checkout 15d839c16a66434c19f9c8a560b7553f9468e588 # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/gpu/drm/amd/amdgpu/ If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All warnings (new ones prefixed by >>): drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c:3829:12: error: implicit declaration of function 'amdgpu_mes_ctx_get_offs' [-Werror,-Wimplicit-function-declaration] offset = amdgpu_mes_ctx_get_offs(ring, AMDGPU_MES_CTX_IB_OFFS); ^ >> drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c:3826:6: warning: variable 'index' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized] if (ring->is_mes_queue) { ^~~~~~~~~~~~~~~~~~ drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c:3883:30: note: uninitialized use occurs here amdgpu_device_wb_free(adev, index); ^~~~~ drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c:3826:2: note: remove the 'if' if its condition is always false if (ring->is_mes_queue) { ^~~~~~~~~~~~~~~~~~~~~~~~~ drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c:3819:16: note: initialize the variable 'index' to silence this warning unsigned index; ^ = 0 1 warning and 1 error generated. vim +3826 drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c 3813 3814 static int gfx_v10_0_ring_test_ib(struct amdgpu_ring *ring, long timeout) 3815 { 3816 struct amdgpu_device *adev = ring->adev; 3817 struct amdgpu_ib ib; 3818 struct dma_fence *f = NULL; 3819 unsigned index; 3820 uint64_t gpu_addr; 3821 volatile uint32_t *cpu_ptr; 3822 long r; 3823 3824 memset(&ib, 0, sizeof(ib)); 3825 > 3826 if (ring->is_mes_queue) { 3827 uint32_t padding, offset; 3828 3829 offset = amdgpu_mes_ctx_get_offs(ring, AMDGPU_MES_CTX_IB_OFFS); 3830 padding = amdgpu_mes_ctx_get_offs(ring, 3831 AMDGPU_MES_CTX_PADDING_OFFS); 3832 3833 ib.gpu_addr = amdgpu_mes_ctx_get_offs_gpu_addr(ring, offset); 3834 ib.ptr = amdgpu_mes_ctx_get_offs_cpu_addr(ring, offset); 3835 3836 gpu_addr = amdgpu_mes_ctx_get_offs_gpu_addr(ring, padding); 3837 cpu_ptr = amdgpu_mes_ctx_get_offs_cpu_addr(ring, padding); 3838 *cpu_ptr = cpu_to_le32(0xCAFEDEAD); 3839 } else { 3840 r = amdgpu_device_wb_get(adev, &index); 3841 if (r) 3842 return r; 3843 3844 gpu_addr = adev->wb.gpu_addr + (index * 4); 3845 adev->wb.wb[index] = cpu_to_le32(0xCAFEDEAD); 3846 cpu_ptr = &adev->wb.wb[index]; 3847 3848 r = amdgpu_ib_get(adev, NULL, 20, AMDGPU_IB_POOL_DIRECT, &ib); 3849 if (r) { 3850 DRM_ERROR("amdgpu: failed to get ib (%ld).\n", r); 3851 goto err1; 3852 } 3853 } 3854 3855 ib.ptr[0] = PACKET3(PACKET3_WRITE_DATA, 3); 3856 ib.ptr[1] = WRITE_DATA_DST_SEL(5) | WR_CONFIRM; 3857 ib.ptr[2] = lower_32_bits(gpu_addr); 3858 ib.ptr[3] = upper_32_bits(gpu_addr); 3859 ib.ptr[4] = 0xDEADBEEF; 3860 ib.length_dw = 5; 3861 3862 r = amdgpu_ib_schedule(ring, 1, &ib, NULL, &f); 3863 if (r) 3864 goto err2; 3865 3866 r = dma_fence_wait_timeout(f, false, timeout); 3867 if (r == 0) { 3868 r = -ETIMEDOUT; 3869 goto err2; 3870 } else if (r < 0) { 3871 goto err2; 3872 } 3873 3874 if (le32_to_cpu(*cpu_ptr) == 0xDEADBEEF) 3875 r = 0; 3876 else 3877 r = -EINVAL; 3878 err2: 3879 if (!ring->is_mes_queue) 3880 amdgpu_ib_free(adev, &ib, NULL); 3881 dma_fence_put(f); 3882 err1: 3883 amdgpu_device_wb_free(adev, index); 3884 return r; 3885 } 3886 -- 0-DAY CI Kernel Test Service https://01.org/lkp