public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org
Subject: drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c:413 amdgpu_get_xgmi_hive() warn: inconsistent indenting
Date: Wed, 30 Mar 2022 17:36:35 +0800	[thread overview]
Message-ID: <202203301722.eFgFpxPQ-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   d888c83fcec75194a8a48ccd283953bdba7b2550
commit: cfbb6b0047448e2d986160d9f30d60f604d9ad0f drm/amdgpu: Rework reset domain to be refcounted.
date:   7 weeks ago
config: riscv-randconfig-m031-20220327 (https://download.01.org/0day-ci/archive/20220330/202203301722.eFgFpxPQ-lkp@intel.com/config)
compiler: riscv32-linux-gcc (GCC) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

New smatch warnings:
drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c:413 amdgpu_get_xgmi_hive() warn: inconsistent indenting

Old smatch warnings:
drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c:473 amdgpu_xgmi_set_pstate() warn: ignoring unreachable code.

vim +413 drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c

   363	
   364	
   365	
   366	struct amdgpu_hive_info *amdgpu_get_xgmi_hive(struct amdgpu_device *adev)
   367	{
   368		struct amdgpu_hive_info *hive = NULL;
   369		int ret;
   370	
   371		if (!adev->gmc.xgmi.hive_id)
   372			return NULL;
   373	
   374		if (adev->hive) {
   375			kobject_get(&adev->hive->kobj);
   376			return adev->hive;
   377		}
   378	
   379		mutex_lock(&xgmi_mutex);
   380	
   381		list_for_each_entry(hive, &xgmi_hive_list, node)  {
   382			if (hive->hive_id == adev->gmc.xgmi.hive_id)
   383				goto pro_end;
   384		}
   385	
   386		hive = kzalloc(sizeof(*hive), GFP_KERNEL);
   387		if (!hive) {
   388			dev_err(adev->dev, "XGMI: allocation failed\n");
   389			hive = NULL;
   390			goto pro_end;
   391		}
   392	
   393		/* initialize new hive if not exist */
   394		ret = kobject_init_and_add(&hive->kobj,
   395				&amdgpu_xgmi_hive_type,
   396				&adev->dev->kobj,
   397				"%s", "xgmi_hive_info");
   398		if (ret) {
   399			dev_err(adev->dev, "XGMI: failed initializing kobject for xgmi hive\n");
   400			kobject_put(&hive->kobj);
   401			kfree(hive);
   402			hive = NULL;
   403			goto pro_end;
   404		}
   405	
   406		/**
   407		 * Avoid recreating reset domain when hive is reconstructed for the case
   408		 * of reset the devices in the XGMI hive during probe for SRIOV
   409		 * See https://www.spinics.net/lists/amd-gfx/msg58836.html
   410		 */
   411		if (adev->reset_domain->type != XGMI_HIVE) {
   412			hive->reset_domain = amdgpu_reset_create_reset_domain(XGMI_HIVE, "amdgpu-reset-hive");
 > 413				if (!hive->reset_domain) {
   414					dev_err(adev->dev, "XGMI: failed initializing reset domain for xgmi hive\n");
   415					ret = -ENOMEM;
   416					kobject_put(&hive->kobj);
   417					kfree(hive);
   418					hive = NULL;
   419					goto pro_end;
   420				}
   421		} else {
   422			amdgpu_reset_get_reset_domain(adev->reset_domain);
   423			hive->reset_domain = adev->reset_domain;
   424		}
   425	
   426		hive->hive_id = adev->gmc.xgmi.hive_id;
   427		INIT_LIST_HEAD(&hive->device_list);
   428		INIT_LIST_HEAD(&hive->node);
   429		mutex_init(&hive->hive_lock);
   430		atomic_set(&hive->number_devices, 0);
   431		task_barrier_init(&hive->tb);
   432		hive->pstate = AMDGPU_XGMI_PSTATE_UNKNOWN;
   433		hive->hi_req_gpu = NULL;
   434	
   435		/*
   436		 * hive pstate on boot is high in vega20 so we have to go to low
   437		 * pstate on after boot.
   438		 */
   439		hive->hi_req_count = AMDGPU_MAX_XGMI_DEVICE_PER_HIVE;
   440		list_add_tail(&hive->node, &xgmi_hive_list);
   441	
   442	pro_end:
   443		if (hive)
   444			kobject_get(&hive->kobj);
   445		mutex_unlock(&xgmi_mutex);
   446		return hive;
   447	}
   448	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

             reply	other threads:[~2022-03-30  9:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-30  9:36 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-05-29 14:13 drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c:413 amdgpu_get_xgmi_hive() warn: inconsistent indenting kernel test robot

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=202203301722.eFgFpxPQ-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=andrey.grodzovsky@amd.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    /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