All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: Re: [RFC PATCH 2/2] acpi/pci_root: negotiate CXL _OSC
Date: Thu, 17 Mar 2022 13:48:35 +0800	[thread overview]
Message-ID: <202203171337.1O6VuoTj-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 25259 bytes --]

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
In-Reply-To: <20220317002704.1835870-3-vishal.l.verma@intel.com>
References: <20220317002704.1835870-3-vishal.l.verma@intel.com>
TO: Vishal Verma <vishal.l.verma@intel.com>

Hi Vishal,

[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on 74be98774dfbc5b8b795db726bd772e735d2edd4]

url:    https://github.com/0day-ci/linux/commits/Vishal-Verma/acpi-add-support-for-CXL-_OSC/20220317-082840
base:   74be98774dfbc5b8b795db726bd772e735d2edd4
:::::: branch date: 5 hours ago
:::::: commit date: 5 hours ago
config: x86_64-randconfig-m001 (https://download.01.org/0day-ci/archive/20220317/202203171337.1O6VuoTj-lkp(a)intel.com/config)
compiler: gcc-9 (Ubuntu 9.4.0-1ubuntu1~20.04) 9.4.0

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

New smatch warnings:
drivers/acpi/pci_root.c:450 acpi_pci_osc_control_set() error: uninitialized symbol 'cxl_ctrl'.
drivers/acpi/pci_root.c:564 calculate_cxl_control() error: uninitialized symbol 'control'.
drivers/acpi/pci_root.c:619 negotiate_os_control() error: uninitialized symbol 'cxl_support'.

Old smatch warnings:
drivers/acpi/pci_root.c:453 acpi_pci_osc_control_set() error: uninitialized symbol 'cxl_ctrl'.
drivers/acpi/pci_root.c:466 acpi_pci_osc_control_set() error: uninitialized symbol 'cxl_ctrl'.
drivers/acpi/pci_root.c:480 acpi_pci_osc_control_set() error: uninitialized symbol 'cxl_ctrl'.

vim +/cxl_ctrl +450 drivers/acpi/pci_root.c

2f7bbceb5b6aa93 Alexander Chiang           2009-06-10  401  
63f10f0f6df4e4e Kenji Kaneshige            2009-02-09  402  /**
75fb60f26befb59 Rafael J. Wysocki          2010-08-23  403   * acpi_pci_osc_control_set - Request control of PCI root _OSC features.
75fb60f26befb59 Rafael J. Wysocki          2010-08-23  404   * @handle: ACPI handle of a PCI root bridge (or PCIe Root Complex).
75fb60f26befb59 Rafael J. Wysocki          2010-08-23  405   * @mask: Mask of _OSC bits to request control of, place to store control mask.
843438deebe247f Yang Li                    2021-12-23  406   * @support: _OSC supported capability.
8020d862c22d52b Vishal Verma               2022-03-16  407   * @cxl_mask: Mask of CXL _OSC control bits, place to store control mask.
8020d862c22d52b Vishal Verma               2022-03-16  408   * @cxl_support: CXL _OSC supported capability.
63f10f0f6df4e4e Kenji Kaneshige            2009-02-09  409   *
75fb60f26befb59 Rafael J. Wysocki          2010-08-23  410   * Run _OSC query for @mask and if that is successful, compare the returned
75fb60f26befb59 Rafael J. Wysocki          2010-08-23  411   * mask of control bits with @req.  If all of the @req bits are set in the
75fb60f26befb59 Rafael J. Wysocki          2010-08-23  412   * returned mask, run _OSC request for it.
75fb60f26befb59 Rafael J. Wysocki          2010-08-23  413   *
75fb60f26befb59 Rafael J. Wysocki          2010-08-23  414   * The variable at the @mask address may be modified regardless of whether or
75fb60f26befb59 Rafael J. Wysocki          2010-08-23  415   * not the function returns success.  On success it will contain the mask of
75fb60f26befb59 Rafael J. Wysocki          2010-08-23  416   * _OSC bits the BIOS has granted control of, but its contents are meaningless
75fb60f26befb59 Rafael J. Wysocki          2010-08-23  417   * on failure.
63f10f0f6df4e4e Kenji Kaneshige            2009-02-09  418   **/
8020d862c22d52b Vishal Verma               2022-03-16  419  static acpi_status acpi_pci_osc_control_set(acpi_handle handle, u32 *mask,
8020d862c22d52b Vishal Verma               2022-03-16  420  					    u32 support, u32 *cxl_mask,
8020d862c22d52b Vishal Verma               2022-03-16  421  					    u32 cxl_support)
63f10f0f6df4e4e Kenji Kaneshige            2009-02-09  422  {
6bc779ee05d4fa6 Joerg Roedel               2021-08-24  423  	u32 req = OSC_PCI_EXPRESS_CAPABILITY_CONTROL;
75fb60f26befb59 Rafael J. Wysocki          2010-08-23  424  	struct acpi_pci_root *root;
866e61fc40c96e7 Bjorn Helgaas              2020-06-02  425  	acpi_status status;
8020d862c22d52b Vishal Verma               2022-03-16  426  	u32 ctrl, cxl_ctrl, capbuf[8];
63f10f0f6df4e4e Kenji Kaneshige            2009-02-09  427  
75fb60f26befb59 Rafael J. Wysocki          2010-08-23  428  	if (!mask)
75fb60f26befb59 Rafael J. Wysocki          2010-08-23  429  		return AE_BAD_PARAMETER;
75fb60f26befb59 Rafael J. Wysocki          2010-08-23  430  
63f10f0f6df4e4e Kenji Kaneshige            2009-02-09  431  	root = acpi_pci_find_root(handle);
63f10f0f6df4e4e Kenji Kaneshige            2009-02-09  432  	if (!root)
63f10f0f6df4e4e Kenji Kaneshige            2009-02-09  433  		return AE_NOT_EXIST;
63f10f0f6df4e4e Kenji Kaneshige            2009-02-09  434  
6bc779ee05d4fa6 Joerg Roedel               2021-08-24  435  	ctrl   = *mask;
6bc779ee05d4fa6 Joerg Roedel               2021-08-24  436  	*mask |= root->osc_control_set;
63f10f0f6df4e4e Kenji Kaneshige            2009-02-09  437  
8020d862c22d52b Vishal Verma               2022-03-16  438  	if (is_cxl(root)) {
8020d862c22d52b Vishal Verma               2022-03-16  439  		cxl_ctrl   = *cxl_mask;
8020d862c22d52b Vishal Verma               2022-03-16  440  		*mask |= root->osc_control_set;
8020d862c22d52b Vishal Verma               2022-03-16  441  	}
8020d862c22d52b Vishal Verma               2022-03-16  442  
75fb60f26befb59 Rafael J. Wysocki          2010-08-23  443  	/* Need to check the available controls bits before requesting them. */
6bc779ee05d4fa6 Joerg Roedel               2021-08-24  444  	do {
8020d862c22d52b Vishal Verma               2022-03-16  445  		status = acpi_pci_query_osc(root, support, mask, cxl_support,
8020d862c22d52b Vishal Verma               2022-03-16  446  					    cxl_mask);
63f10f0f6df4e4e Kenji Kaneshige            2009-02-09  447  		if (ACPI_FAILURE(status))
866e61fc40c96e7 Bjorn Helgaas              2020-06-02  448  			return status;
8020d862c22d52b Vishal Verma               2022-03-16  449  		if (is_cxl(root)) {
8020d862c22d52b Vishal Verma               2022-03-16 @450  			if ((ctrl == *mask) && (cxl_ctrl == *cxl_mask))
8020d862c22d52b Vishal Verma               2022-03-16  451  				break;
8020d862c22d52b Vishal Verma               2022-03-16  452  			decode_cxl_osc_control(root, "platform does not support",
8020d862c22d52b Vishal Verma               2022-03-16  453  					   cxl_ctrl & ~(*cxl_mask));
8020d862c22d52b Vishal Verma               2022-03-16  454  		} else {
75fb60f26befb59 Rafael J. Wysocki          2010-08-23  455  			if (ctrl == *mask)
75fb60f26befb59 Rafael J. Wysocki          2010-08-23  456  				break;
955f14b4ed0648d Bjorn Helgaas              2013-09-05  457  			decode_osc_control(root, "platform does not support",
955f14b4ed0648d Bjorn Helgaas              2013-09-05  458  					   ctrl & ~(*mask));
8020d862c22d52b Vishal Verma               2022-03-16  459  		}
75fb60f26befb59 Rafael J. Wysocki          2010-08-23  460  		ctrl = *mask;
8020d862c22d52b Vishal Verma               2022-03-16  461  		cxl_ctrl = *cxl_mask;
8020d862c22d52b Vishal Verma               2022-03-16  462  	} while (*mask || *cxl_mask);
6bc779ee05d4fa6 Joerg Roedel               2021-08-24  463  
6bc779ee05d4fa6 Joerg Roedel               2021-08-24  464  	/* No need to request _OSC if the control was already granted. */
8020d862c22d52b Vishal Verma               2022-03-16  465  	if (((root->osc_control_set & ctrl) == ctrl) &&
8020d862c22d52b Vishal Verma               2022-03-16  466  	    ((root->cxl_osc_control_set & cxl_ctrl) == cxl_ctrl))
6bc779ee05d4fa6 Joerg Roedel               2021-08-24  467  		return AE_OK;
2b8fd9186d9275b Rafael J. Wysocki          2010-08-23  468  
75fb60f26befb59 Rafael J. Wysocki          2010-08-23  469  	if ((ctrl & req) != req) {
955f14b4ed0648d Bjorn Helgaas              2013-09-05  470  		decode_osc_control(root, "not requesting control; platform does not support",
955f14b4ed0648d Bjorn Helgaas              2013-09-05  471  				   req & ~(ctrl));
866e61fc40c96e7 Bjorn Helgaas              2020-06-02  472  		return AE_SUPPORT;
63f10f0f6df4e4e Kenji Kaneshige            2009-02-09  473  	}
63f10f0f6df4e4e Kenji Kaneshige            2009-02-09  474  
b938a229c85a567 Bjorn Helgaas              2013-09-05  475  	capbuf[OSC_QUERY_DWORD] = 0;
b938a229c85a567 Bjorn Helgaas              2013-09-05  476  	capbuf[OSC_SUPPORT_DWORD] = root->osc_support_set;
b938a229c85a567 Bjorn Helgaas              2013-09-05  477  	capbuf[OSC_CONTROL_DWORD] = ctrl;
8020d862c22d52b Vishal Verma               2022-03-16  478  	if (is_cxl(root)) {
8020d862c22d52b Vishal Verma               2022-03-16  479  		capbuf[OSC_CXL_SUPPORT_DWORD] = root->cxl_osc_support_set;
8020d862c22d52b Vishal Verma               2022-03-16  480  		capbuf[OSC_CXL_CONTROL_DWORD] = cxl_ctrl;
8020d862c22d52b Vishal Verma               2022-03-16  481  	}
8020d862c22d52b Vishal Verma               2022-03-16  482  
8020d862c22d52b Vishal Verma               2022-03-16  483  	status = acpi_pci_run_osc(root, capbuf, mask, cxl_mask);
866e61fc40c96e7 Bjorn Helgaas              2020-06-02  484  	if (ACPI_FAILURE(status))
63f10f0f6df4e4e Kenji Kaneshige            2009-02-09  485  		return status;
866e61fc40c96e7 Bjorn Helgaas              2020-06-02  486  
866e61fc40c96e7 Bjorn Helgaas              2020-06-02  487  	root->osc_control_set = *mask;
8020d862c22d52b Vishal Verma               2022-03-16  488  	root->cxl_osc_control_set = *cxl_mask;
866e61fc40c96e7 Bjorn Helgaas              2020-06-02  489  	return AE_OK;
63f10f0f6df4e4e Kenji Kaneshige            2009-02-09  490  }
63f10f0f6df4e4e Kenji Kaneshige            2009-02-09  491  
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  492  static u32 calculate_support(void)
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  493  {
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  494  	u32 support;
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  495  
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  496  	/*
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  497  	 * All supported architectures that use ACPI have support for
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  498  	 * PCI domains, so we indicate this in _OSC support capabilities.
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  499  	 */
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  500  	support = OSC_PCI_SEGMENT_GROUPS_SUPPORT;
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  501  	support |= OSC_PCI_HPX_TYPE_3_SUPPORT;
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  502  	if (pci_ext_cfg_avail())
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  503  		support |= OSC_PCI_EXT_CONFIG_SUPPORT;
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  504  	if (pcie_aspm_support_enabled())
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  505  		support |= OSC_PCI_ASPM_SUPPORT | OSC_PCI_CLOCK_PM_SUPPORT;
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  506  	if (pci_msi_enabled())
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  507  		support |= OSC_PCI_MSI_SUPPORT;
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  508  	if (IS_ENABLED(CONFIG_PCIE_EDR))
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  509  		support |= OSC_PCI_EDR_SUPPORT;
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  510  
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  511  	return support;
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  512  }
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  513  
8020d862c22d52b Vishal Verma               2022-03-16  514  static u32 calculate_cxl_support(void)
8020d862c22d52b Vishal Verma               2022-03-16  515  {
8020d862c22d52b Vishal Verma               2022-03-16  516  	u32 support;
8020d862c22d52b Vishal Verma               2022-03-16  517  
8020d862c22d52b Vishal Verma               2022-03-16  518  	support = OSC_CXL_2_0_PORT_DEV_REG_ACCESS_SUPPORT;
8020d862c22d52b Vishal Verma               2022-03-16  519  	support |= OSC_CXL_PER_SUPPORT;
8020d862c22d52b Vishal Verma               2022-03-16  520  	if (IS_ENABLED(CONFIG_HOTPLUG_PCI_PCIE))
8020d862c22d52b Vishal Verma               2022-03-16  521  		support |= OSC_CXL_NATIVE_HP_SUPPORT;
8020d862c22d52b Vishal Verma               2022-03-16  522  
8020d862c22d52b Vishal Verma               2022-03-16  523  	return support;
8020d862c22d52b Vishal Verma               2022-03-16  524  }
8020d862c22d52b Vishal Verma               2022-03-16  525  
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  526  static u32 calculate_control(void)
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  527  {
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  528  	u32 control;
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  529  
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  530  	control = OSC_PCI_EXPRESS_CAPABILITY_CONTROL
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  531  		| OSC_PCI_EXPRESS_PME_CONTROL;
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  532  
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  533  	if (IS_ENABLED(CONFIG_PCIEASPM))
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  534  		control |= OSC_PCI_EXPRESS_LTR_CONTROL;
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  535  
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  536  	if (IS_ENABLED(CONFIG_HOTPLUG_PCI_PCIE))
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  537  		control |= OSC_PCI_EXPRESS_NATIVE_HP_CONTROL;
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  538  
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  539  	if (IS_ENABLED(CONFIG_HOTPLUG_PCI_SHPC))
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  540  		control |= OSC_PCI_SHPC_NATIVE_HP_CONTROL;
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  541  
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  542  	if (pci_aer_available())
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  543  		control |= OSC_PCI_EXPRESS_AER_CONTROL;
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  544  
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  545  	/*
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  546  	 * Per the Downstream Port Containment Related Enhancements ECN to
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  547  	 * the PCI Firmware Spec, r3.2, sec 4.5.1, table 4-5,
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  548  	 * OSC_PCI_EXPRESS_DPC_CONTROL indicates the OS supports both DPC
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  549  	 * and EDR.
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  550  	 */
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  551  	if (IS_ENABLED(CONFIG_PCIE_DPC) && IS_ENABLED(CONFIG_PCIE_EDR))
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  552  		control |= OSC_PCI_EXPRESS_DPC_CONTROL;
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  553  
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  554  	return control;
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  555  }
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  556  
8020d862c22d52b Vishal Verma               2022-03-16  557  static u32 calculate_cxl_control(void)
8020d862c22d52b Vishal Verma               2022-03-16  558  {
8020d862c22d52b Vishal Verma               2022-03-16  559  	u32 control;
8020d862c22d52b Vishal Verma               2022-03-16  560  
8020d862c22d52b Vishal Verma               2022-03-16  561  	if (pci_aer_available())
8020d862c22d52b Vishal Verma               2022-03-16  562  		control |= OSC_CXL_ERROR_REPORTING_CONTROL;
8020d862c22d52b Vishal Verma               2022-03-16  563  
8020d862c22d52b Vishal Verma               2022-03-16 @564  	return control;
8020d862c22d52b Vishal Verma               2022-03-16  565  }
8020d862c22d52b Vishal Verma               2022-03-16  566  
87f1f87a16818c3 Joerg Roedel               2021-08-24  567  static bool os_control_query_checks(struct acpi_pci_root *root, u32 support)
87f1f87a16818c3 Joerg Roedel               2021-08-24  568  {
87f1f87a16818c3 Joerg Roedel               2021-08-24  569  	struct acpi_device *device = root->device;
87f1f87a16818c3 Joerg Roedel               2021-08-24  570  
87f1f87a16818c3 Joerg Roedel               2021-08-24  571  	if (pcie_ports_disabled) {
87f1f87a16818c3 Joerg Roedel               2021-08-24  572  		dev_info(&device->dev, "PCIe port services disabled; not requesting _OSC control\n");
87f1f87a16818c3 Joerg Roedel               2021-08-24  573  		return false;
87f1f87a16818c3 Joerg Roedel               2021-08-24  574  	}
87f1f87a16818c3 Joerg Roedel               2021-08-24  575  
87f1f87a16818c3 Joerg Roedel               2021-08-24  576  	if ((support & ACPI_PCIE_REQ_SUPPORT) != ACPI_PCIE_REQ_SUPPORT) {
87f1f87a16818c3 Joerg Roedel               2021-08-24  577  		decode_osc_support(root, "not requesting OS control; OS requires",
87f1f87a16818c3 Joerg Roedel               2021-08-24  578  				   ACPI_PCIE_REQ_SUPPORT);
87f1f87a16818c3 Joerg Roedel               2021-08-24  579  		return false;
87f1f87a16818c3 Joerg Roedel               2021-08-24  580  	}
87f1f87a16818c3 Joerg Roedel               2021-08-24  581  
87f1f87a16818c3 Joerg Roedel               2021-08-24  582  	return true;
87f1f87a16818c3 Joerg Roedel               2021-08-24  583  }
87f1f87a16818c3 Joerg Roedel               2021-08-24  584  
53da48751c13ffc Dan Williams               2022-03-16  585  static void negotiate_os_control(struct acpi_pci_root *root, int *no_aspm)
^1da177e4c3f415 Linus Torvalds             2005-04-16  586  {
6bc779ee05d4fa6 Joerg Roedel               2021-08-24  587  	u32 support, control = 0, requested = 0;
8020d862c22d52b Vishal Verma               2022-03-16  588  	u32 cxl_support, cxl_control = 0, cxl_requested = 0;
3e43abb012d45dc Bjorn Helgaas              2013-09-05  589  	acpi_status status;
3e43abb012d45dc Bjorn Helgaas              2013-09-05  590  	struct acpi_device *device = root->device;
bfe2414aecca03d Jiang Liu                  2013-05-28  591  	acpi_handle handle = device->handle;
^1da177e4c3f415 Linus Torvalds             2005-04-16  592  
7bc5a2bad0b8d9d Matthew Garrett            2014-09-20  593  	/*
7bc5a2bad0b8d9d Matthew Garrett            2014-09-20  594  	 * Apple always return failure on _OSC calls when _OSI("Darwin") has
7bc5a2bad0b8d9d Matthew Garrett            2014-09-20  595  	 * been called successfully. We know the feature set supported by the
7bc5a2bad0b8d9d Matthew Garrett            2014-09-20  596  	 * platform, so avoid calling _OSC at all
7bc5a2bad0b8d9d Matthew Garrett            2014-09-20  597  	 */
630b3aff8a51c90 Lukas Wunner               2017-08-01  598  	if (x86_apple_machine) {
7bc5a2bad0b8d9d Matthew Garrett            2014-09-20  599  		root->osc_control_set = ~OSC_PCI_EXPRESS_PME_CONTROL;
7bc5a2bad0b8d9d Matthew Garrett            2014-09-20  600  		decode_osc_control(root, "OS assumes control of",
7bc5a2bad0b8d9d Matthew Garrett            2014-09-20  601  				   root->osc_control_set);
7bc5a2bad0b8d9d Matthew Garrett            2014-09-20  602  		return;
7bc5a2bad0b8d9d Matthew Garrett            2014-09-20  603  	}
7bc5a2bad0b8d9d Matthew Garrett            2014-09-20  604  
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  605  	support = calculate_support();
955f14b4ed0648d Bjorn Helgaas              2013-09-05  606  
955f14b4ed0648d Bjorn Helgaas              2013-09-05  607  	decode_osc_support(root, "OS supports", support);
de18966228ed4b4 Bjorn Helgaas              2013-09-05  608  
6bc779ee05d4fa6 Joerg Roedel               2021-08-24  609  	if (os_control_query_checks(root, support))
4c6f6060b7c4fe0 Joerg Roedel               2021-08-24  610  		requested = control = calculate_control();
ac1c8e35a3262d0 Kuppuswamy Sathyanarayanan 2020-03-23  611  
8020d862c22d52b Vishal Verma               2022-03-16  612  	if (is_cxl(root)) {
8020d862c22d52b Vishal Verma               2022-03-16  613  		cxl_support = calculate_cxl_support();
8020d862c22d52b Vishal Verma               2022-03-16  614  		decode_cxl_osc_support(root, "OS supports", cxl_support);
8020d862c22d52b Vishal Verma               2022-03-16  615  		cxl_requested = cxl_control = calculate_cxl_control();
8020d862c22d52b Vishal Verma               2022-03-16  616  	}
8020d862c22d52b Vishal Verma               2022-03-16  617  
8020d862c22d52b Vishal Verma               2022-03-16  618  	status = acpi_pci_osc_control_set(handle, &control, support,
8020d862c22d52b Vishal Verma               2022-03-16 @619  					  &cxl_control, cxl_support);
eca67315e0e0d5f Naga Chumbalkar            2011-03-21  620  	if (ACPI_SUCCESS(status)) {
6bc779ee05d4fa6 Joerg Roedel               2021-08-24  621  		if (control)
955f14b4ed0648d Bjorn Helgaas              2013-09-05  622  			decode_osc_control(root, "OS now controls", control);
8020d862c22d52b Vishal Verma               2022-03-16  623  		if (cxl_control)
8020d862c22d52b Vishal Verma               2022-03-16  624  			decode_cxl_osc_control(root, "OS now controls",
8020d862c22d52b Vishal Verma               2022-03-16  625  					   cxl_control);
6bc779ee05d4fa6 Joerg Roedel               2021-08-24  626  
b8178f130e25c1b Bjorn Helgaas              2013-04-01  627  		if (acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_ASPM) {
b8178f130e25c1b Bjorn Helgaas              2013-04-01  628  			/*
387d37577fdd05e Matthew Garrett            2015-04-07  629  			 * We have ASPM control, but the FADT indicates that
387d37577fdd05e Matthew Garrett            2015-04-07  630  			 * it's unsupported. Leave existing configuration
387d37577fdd05e Matthew Garrett            2015-04-07  631  			 * intact and prevent the OS from touching it.
b8178f130e25c1b Bjorn Helgaas              2013-04-01  632  			 */
387d37577fdd05e Matthew Garrett            2015-04-07  633  			dev_info(&device->dev, "FADT indicates ASPM is unsupported, using BIOS configuration\n");
387d37577fdd05e Matthew Garrett            2015-04-07  634  			*no_aspm = 1;
b8178f130e25c1b Bjorn Helgaas              2013-04-01  635  		}
eca67315e0e0d5f Naga Chumbalkar            2011-03-21  636  	} else {
3dc48af310709b8 Neil Horman                2013-08-29  637  		/*
3dc48af310709b8 Neil Horman                2013-08-29  638  		 * We want to disable ASPM here, but aspm_disabled
3dc48af310709b8 Neil Horman                2013-08-29  639  		 * needs to remain in its state from boot so that we
3dc48af310709b8 Neil Horman                2013-08-29  640  		 * properly handle PCIe 1.1 devices.  So we set this
3dc48af310709b8 Neil Horman                2013-08-29  641  		 * flag here, to defer the action until after the ACPI
3dc48af310709b8 Neil Horman                2013-08-29  642  		 * root scan.
3dc48af310709b8 Neil Horman                2013-08-29  643  		 */
3e43abb012d45dc Bjorn Helgaas              2013-09-05  644  		*no_aspm = 1;
6bc779ee05d4fa6 Joerg Roedel               2021-08-24  645  
6bc779ee05d4fa6 Joerg Roedel               2021-08-24  646  		/* _OSC is optional for PCI host bridges */
53da48751c13ffc Dan Williams               2022-03-16  647  		if ((status == AE_NOT_FOUND) && !is_pcie(root))
6bc779ee05d4fa6 Joerg Roedel               2021-08-24  648  			return;
6bc779ee05d4fa6 Joerg Roedel               2021-08-24  649  
6bc779ee05d4fa6 Joerg Roedel               2021-08-24  650  		if (control) {
6bc779ee05d4fa6 Joerg Roedel               2021-08-24  651  			decode_osc_control(root, "OS requested", requested);
6bc779ee05d4fa6 Joerg Roedel               2021-08-24  652  			decode_osc_control(root, "platform willing to grant", control);
6bc779ee05d4fa6 Joerg Roedel               2021-08-24  653  		}
8020d862c22d52b Vishal Verma               2022-03-16  654  		if (cxl_control) {
8020d862c22d52b Vishal Verma               2022-03-16  655  			decode_cxl_osc_control(root, "OS requested", cxl_requested);
8020d862c22d52b Vishal Verma               2022-03-16  656  			decode_cxl_osc_control(root, "platform willing to grant",
8020d862c22d52b Vishal Verma               2022-03-16  657  					   cxl_control);
8020d862c22d52b Vishal Verma               2022-03-16  658  		}
6bc779ee05d4fa6 Joerg Roedel               2021-08-24  659  
6bc779ee05d4fa6 Joerg Roedel               2021-08-24  660  		dev_info(&device->dev, "_OSC: platform retains control of PCIe features (%s)\n",
6bc779ee05d4fa6 Joerg Roedel               2021-08-24  661  			 acpi_format_exception(status));
eca67315e0e0d5f Naga Chumbalkar            2011-03-21  662  	}
3e43abb012d45dc Bjorn Helgaas              2013-09-05  663  }
3e43abb012d45dc Bjorn Helgaas              2013-09-05  664  

---
0-DAY CI Kernel Test Service
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

             reply	other threads:[~2022-03-17  5:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-17  5:48 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-03-18  0:33 [RFC PATCH 2/2] acpi/pci_root: negotiate CXL _OSC kernel test robot
2022-03-17  0:27 [RFC PATCH 0/2] acpi: add support for " Vishal Verma
2022-03-17  0:27 ` [RFC PATCH 2/2] acpi/pci_root: negotiate " Vishal Verma
2022-03-17  3:19   ` Dan Williams
2022-03-17  3:49     ` Verma, Vishal L
2022-03-17  3:25   ` kernel test robot
2022-03-17 16:10   ` Jonathan Cameron
2022-03-18 21:16     ` Verma, Vishal L

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=202203171337.1O6VuoTj-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild@lists.01.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 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.