All of lore.kernel.org
 help / color / mirror / Atom feed
* drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1445:2-9: opportunity for str_enabled_disabled(enabled)
@ 2026-08-16  9:31 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-08-16  9:31 UTC (permalink / raw)
  To: Yang Wang
  Cc: oe-kbuild-all, linux-kernel, Alex Deucher, Hawking Zhang,
	Kenneth Feng

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   3eb40771c00a8488fa6ed2cc1fe203477908bf38
commit: 2a9c5154a5650c09ad44ff5e1dff74754e15a3c6 drm/amdgpu: check ASPM on the dGPU host link
date:   4 days ago
config: x86_64-randconfig-104-20260816 (https://download.01.org/0day-ci/archive/20260816/202608161707.IAEa5YkL-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Fixes: 2a9c5154a565 ("drm/amdgpu: check ASPM on the dGPU host link")
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202608161707.IAEa5YkL-lkp@intel.com/

cocci warnings: (new ones prefixed by >>)
>> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1445:2-9: opportunity for str_enabled_disabled(enabled)

vim +1445 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c

  1397	
  1398	/**
  1399	 * amdgpu_device_should_use_aspm - check if the device should program ASPM
  1400	 *
  1401	 * @adev: amdgpu_device pointer
  1402	 *
  1403	 * Confirm whether the module parameter and pcie bridge agree that ASPM should
  1404	 * be set for this device.
  1405	 *
  1406	 * Returns true if it should be used or false if not.
  1407	 */
  1408	bool amdgpu_device_should_use_aspm(struct amdgpu_device *adev)
  1409	{
  1410		struct pci_dev *aspm_pdev, *parent;
  1411		bool enabled;
  1412	
  1413		switch (amdgpu_aspm) {
  1414		case -1:
  1415			break;
  1416		case 0:
  1417			return false;
  1418		case 1:
  1419			return true;
  1420		default:
  1421			return false;
  1422		}
  1423		if (adev->flags & AMD_IS_APU)
  1424			return false;
  1425		if (amdgpu_device_aspm_support_quirk(adev))
  1426			return false;
  1427	
  1428		/*
  1429		 * pcie_aspm_enabled() checks the link between its argument and
  1430		 * the immediate upstream bridge. Use SWUS for dGPUs with an
  1431		 * internal switch so that this is the host-facing link.
  1432		 */
  1433		aspm_pdev = amdgpu_device_get_aspm_pdev(adev);
  1434		parent = pci_upstream_bridge(aspm_pdev);
  1435		if (!parent) {
  1436			dev_dbg(adev->dev, "ASPM: no upstream PCIe link for %s\n",
  1437				pci_name(aspm_pdev));
  1438			return false;
  1439		}
  1440	
  1441		enabled = pcie_aspm_enabled(aspm_pdev);
  1442		/* Report the exact link used for the automatic ASPM decision. */
  1443		dev_dbg(adev->dev, "ASPM: link %s <-> %s is %s\n",
  1444			pci_name(parent), pci_name(aspm_pdev),
> 1445			enabled ? "enabled" : "disabled");
  1446	
  1447		return enabled;
  1448	}
  1449	

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-16  9:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-16  9:31 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:1445:2-9: opportunity for str_enabled_disabled(enabled) kernel test robot

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.