All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: [linux-next:master 955/1512] drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:658 amdgpu_gfx_enable_kgq() warn: inconsistent returns '&kiq->ring_lock'.
Date: Tue, 9 May 2023 21:04:17 +0800	[thread overview]
Message-ID: <202305092002.VnRkluOB-lkp@intel.com> (raw)

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: Linux Memory Management List <linux-mm@kvack.org>
TO: Alex Deucher <alexander.deucher@amd.com>
CC: Hawking Zhang <Hawking.Zhang@amd.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   47cba14ce6fc4f314bd814d07269d0c8de1e4ae6
commit: 9bfa241d12896ef661116467774280d9cf680ea1 [955/1512] drm/amdgpu: add [en/dis]able_kgq() functions
:::::: branch date: 10 hours ago
:::::: commit date: 4 days ago
config: ia64-randconfig-m031-20230507 (https://download.01.org/0day-ci/archive/20230509/202305092002.VnRkluOB-lkp@intel.com/config)
compiler: ia64-linux-gcc (GCC) 12.1.0

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Link: https://lore.kernel.org/r/202305092002.VnRkluOB-lkp@intel.com/

New smatch warnings:
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:658 amdgpu_gfx_enable_kgq() warn: inconsistent returns '&kiq->ring_lock'.

Old smatch warnings:
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:133 amdgpu_gfx_parse_disable_cu() warn: potential spectre issue 'mask' [w]
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:623 amdgpu_gfx_enable_kcq() warn: inconsistent returns '&kiq->ring_lock'.

vim +658 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c

849aca9f9c033a Hawking Zhang 2019-03-05  625  
9bfa241d12896e Alex Deucher  2023-04-24  626  int amdgpu_gfx_enable_kgq(struct amdgpu_device *adev, int xcc_id)
9bfa241d12896e Alex Deucher  2023-04-24  627  {
9bfa241d12896e Alex Deucher  2023-04-24  628  	struct amdgpu_kiq *kiq = &adev->gfx.kiq[xcc_id];
9bfa241d12896e Alex Deucher  2023-04-24  629  	struct amdgpu_ring *kiq_ring = &kiq->ring;
9bfa241d12896e Alex Deucher  2023-04-24  630  	int r, i, j;
9bfa241d12896e Alex Deucher  2023-04-24  631  
9bfa241d12896e Alex Deucher  2023-04-24  632  	if (!kiq->pmf || !kiq->pmf->kiq_map_queues)
9bfa241d12896e Alex Deucher  2023-04-24  633  		return -EINVAL;
9bfa241d12896e Alex Deucher  2023-04-24  634  
9bfa241d12896e Alex Deucher  2023-04-24  635  	spin_lock(&kiq->ring_lock);
9bfa241d12896e Alex Deucher  2023-04-24  636  	/* No need to map kcq on the slave */
9bfa241d12896e Alex Deucher  2023-04-24  637  	if (amdgpu_gfx_is_master_xcc(adev, xcc_id)) {
9bfa241d12896e Alex Deucher  2023-04-24  638  		r = amdgpu_ring_alloc(kiq_ring, kiq->pmf->map_queues_size *
9bfa241d12896e Alex Deucher  2023-04-24  639  						adev->gfx.num_gfx_rings);
9bfa241d12896e Alex Deucher  2023-04-24  640  		if (r) {
9bfa241d12896e Alex Deucher  2023-04-24  641  			DRM_ERROR("Failed to lock KIQ (%d).\n", r);
9bfa241d12896e Alex Deucher  2023-04-24  642  			spin_unlock(&adev->gfx.kiq[0].ring_lock);
9bfa241d12896e Alex Deucher  2023-04-24  643  			return r;
9bfa241d12896e Alex Deucher  2023-04-24  644  		}
9bfa241d12896e Alex Deucher  2023-04-24  645  
9bfa241d12896e Alex Deucher  2023-04-24  646  		for (i = 0; i < adev->gfx.num_gfx_rings; i++) {
9bfa241d12896e Alex Deucher  2023-04-24  647  			j = i + xcc_id * adev->gfx.num_gfx_rings;
9bfa241d12896e Alex Deucher  2023-04-24  648  			kiq->pmf->kiq_map_queues(kiq_ring,
9bfa241d12896e Alex Deucher  2023-04-24  649  						 &adev->gfx.gfx_ring[i]);
9bfa241d12896e Alex Deucher  2023-04-24  650  		}
9bfa241d12896e Alex Deucher  2023-04-24  651  	}
9bfa241d12896e Alex Deucher  2023-04-24  652  
9bfa241d12896e Alex Deucher  2023-04-24  653  	r = amdgpu_ring_test_helper(kiq_ring);
9bfa241d12896e Alex Deucher  2023-04-24  654  	spin_unlock(&kiq->ring_lock);
9bfa241d12896e Alex Deucher  2023-04-24  655  	if (r)
9bfa241d12896e Alex Deucher  2023-04-24  656  		DRM_ERROR("KCQ enable failed\n");
9bfa241d12896e Alex Deucher  2023-04-24  657  
9bfa241d12896e Alex Deucher  2023-04-24 @658  	return r;
9bfa241d12896e Alex Deucher  2023-04-24  659  }
9bfa241d12896e Alex Deucher  2023-04-24  660  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests

                 reply	other threads:[~2023-05-09 13:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202305092002.VnRkluOB-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=error27@gmail.com \
    --cc=oe-kbuild@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.