linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Shiwu Zhang <shiwu.zhang@amd.com>
Cc: oe-kbuild-all@lists.linux.dev,
	Linux Memory Management List <linux-mm@kvack.org>,
	Alex Deucher <alexander.deucher@amd.com>, Le Ma <Le.Ma@amd.com>
Subject: [linux-next:master 2819/3918] drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:614 amdgpu_gfx_enable_kcq() warn: inconsistent indenting
Date: Tue, 23 May 2023 05:44:00 +0800	[thread overview]
Message-ID: <202305230552.WOByQyYa-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   9f258af06b6268be8e960f63c3f66e88bdbbbdb0
commit: 96c998bc80bee7d6dd0cf001e33f4ccbd82723f8 [2819/3918] drm/amdgpu: enable the ring and IB test for slave kcq
config: s390-randconfig-m031-20230522 (https://download.01.org/0day-ci/archive/20230523/202305230552.WOByQyYa-lkp@intel.com/config)
compiler: s390-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>
| Closes: https://lore.kernel.org/oe-kbuild-all/202305230552.WOByQyYa-lkp@intel.com/

New smatch warnings:
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c:614 amdgpu_gfx_enable_kcq() warn: inconsistent indenting

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:1223 amdgpu_gfx_set_compute_partition() warn: was && intended here instead of ||?

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

3ab6fe4b28a661 Likun Gao     2019-10-24  570  
def799c6596d07 Le Ma         2022-05-24  571  int amdgpu_gfx_enable_kcq(struct amdgpu_device *adev, int xcc_id)
849aca9f9c033a Hawking Zhang 2019-03-05  572  {
def799c6596d07 Le Ma         2022-05-24  573  	struct amdgpu_kiq *kiq = &adev->gfx.kiq[xcc_id];
def799c6596d07 Le Ma         2022-05-24  574  	struct amdgpu_ring *kiq_ring = &kiq->ring;
849aca9f9c033a Hawking Zhang 2019-03-05  575  	uint64_t queue_mask = 0;
def799c6596d07 Le Ma         2022-05-24  576  	int r, i, j;
849aca9f9c033a Hawking Zhang 2019-03-05  577  
849aca9f9c033a Hawking Zhang 2019-03-05  578  	if (!kiq->pmf || !kiq->pmf->kiq_map_queues || !kiq->pmf->kiq_set_resources)
849aca9f9c033a Hawking Zhang 2019-03-05  579  		return -EINVAL;
849aca9f9c033a Hawking Zhang 2019-03-05  580  
849aca9f9c033a Hawking Zhang 2019-03-05  581  	for (i = 0; i < AMDGPU_MAX_COMPUTE_QUEUES; ++i) {
def799c6596d07 Le Ma         2022-05-24  582  		if (!test_bit(i, adev->gfx.mec_bitmap[xcc_id].queue_bitmap))
849aca9f9c033a Hawking Zhang 2019-03-05  583  			continue;
849aca9f9c033a Hawking Zhang 2019-03-05  584  
849aca9f9c033a Hawking Zhang 2019-03-05  585  		/* This situation may be hit in the future if a new HW
849aca9f9c033a Hawking Zhang 2019-03-05  586  		 * generation exposes more than 64 queues. If so, the
849aca9f9c033a Hawking Zhang 2019-03-05  587  		 * definition of queue_mask needs updating */
849aca9f9c033a Hawking Zhang 2019-03-05  588  		if (WARN_ON(i > (sizeof(queue_mask)*8))) {
849aca9f9c033a Hawking Zhang 2019-03-05  589  			DRM_ERROR("Invalid KCQ enabled: %d\n", i);
849aca9f9c033a Hawking Zhang 2019-03-05  590  			break;
849aca9f9c033a Hawking Zhang 2019-03-05  591  		}
849aca9f9c033a Hawking Zhang 2019-03-05  592  
5c180eb910df3c Yong Zhao     2020-03-04  593  		queue_mask |= (1ull << amdgpu_queue_mask_bit_to_set_resource_bit(adev, i));
849aca9f9c033a Hawking Zhang 2019-03-05  594  	}
849aca9f9c033a Hawking Zhang 2019-03-05  595  
849aca9f9c033a Hawking Zhang 2019-03-05  596  	DRM_INFO("kiq ring mec %d pipe %d q %d\n", kiq_ring->me, kiq_ring->pipe,
849aca9f9c033a Hawking Zhang 2019-03-05  597  							kiq_ring->queue);
def799c6596d07 Le Ma         2022-05-24  598  	spin_lock(&kiq->ring_lock);
849aca9f9c033a Hawking Zhang 2019-03-05  599  	r = amdgpu_ring_alloc(kiq_ring, kiq->pmf->map_queues_size *
849aca9f9c033a Hawking Zhang 2019-03-05  600  					adev->gfx.num_compute_rings +
849aca9f9c033a Hawking Zhang 2019-03-05  601  					kiq->pmf->set_resources_size);
849aca9f9c033a Hawking Zhang 2019-03-05  602  	if (r) {
849aca9f9c033a Hawking Zhang 2019-03-05  603  		DRM_ERROR("Failed to lock KIQ (%d).\n", r);
506fe17d2c25a5 Dan Carpenter 2023-05-03  604  		spin_unlock(&kiq->ring_lock);
849aca9f9c033a Hawking Zhang 2019-03-05  605  		return r;
849aca9f9c033a Hawking Zhang 2019-03-05  606  	}
849aca9f9c033a Hawking Zhang 2019-03-05  607  
712ce872213c1d Jack Xiao     2020-06-16  608  	if (adev->enable_mes)
712ce872213c1d Jack Xiao     2020-06-16  609  		queue_mask = ~0ULL;
712ce872213c1d Jack Xiao     2020-06-16  610  
849aca9f9c033a Hawking Zhang 2019-03-05  611  	kiq->pmf->kiq_set_resources(kiq_ring, queue_mask);
def799c6596d07 Le Ma         2022-05-24  612  	for (i = 0; i < adev->gfx.num_compute_rings; i++) {
def799c6596d07 Le Ma         2022-05-24  613  		j = i + xcc_id * adev->gfx.num_compute_rings;
66daccde429611 Le Ma         2021-12-01 @614  			kiq->pmf->kiq_map_queues(kiq_ring,
96c998bc80bee7 Shiwu Zhang   2022-06-03  615  						 &adev->gfx.compute_ring[j]);
def799c6596d07 Le Ma         2022-05-24  616  	}
849aca9f9c033a Hawking Zhang 2019-03-05  617  
849aca9f9c033a Hawking Zhang 2019-03-05  618  	r = amdgpu_ring_test_helper(kiq_ring);
def799c6596d07 Le Ma         2022-05-24  619  	spin_unlock(&kiq->ring_lock);
849aca9f9c033a Hawking Zhang 2019-03-05  620  	if (r)
849aca9f9c033a Hawking Zhang 2019-03-05  621  		DRM_ERROR("KCQ enable failed\n");
849aca9f9c033a Hawking Zhang 2019-03-05  622  
849aca9f9c033a Hawking Zhang 2019-03-05  623  	return r;
849aca9f9c033a Hawking Zhang 2019-03-05  624  }
849aca9f9c033a Hawking Zhang 2019-03-05  625  

:::::: The code at line 614 was first introduced by commit
:::::: 66daccde429611530db82605c197be01adadb389 drm/amdgpu: add master/slave check in init phase

:::::: TO: Le Ma <le.ma@amd.com>
:::::: CC: Alex Deucher <alexander.deucher@amd.com>

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


                 reply	other threads:[~2023-05-22 21:44 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=202305230552.WOByQyYa-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=Le.Ma@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=linux-mm@kvack.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=shiwu.zhang@amd.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox