lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Sun, 29 May 2022 22:13:29 +0800
From:   kernel test robot <lkp@...el.com>
To:     Andrey Grodzovsky <andrey.grodzovsky@....com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c:413 amdgpu_get_xgmi_hive()
 warn: inconsistent indenting

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   664a393a2663a0f62fc1b18157ccae33dcdbb8c8
commit: cfbb6b0047448e2d986160d9f30d60f604d9ad0f drm/amdgpu: Rework reset domain to be refcounted.
date:   4 months ago
config: arc-randconfig-m031-20220524 (https://download.01.org/0day-ci/archive/20220529/202205292210.BD83pOan-lkp@intel.com/config)
compiler: arceb-elf-gcc (GCC) 11.3.0

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@...el.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

Powered by blists - more mailing lists