All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Vishal Verma <vishal.l.verma@intel.com>
Cc: llvm@lists.linux.dev, kbuild-all@lists.01.org
Subject: Re: [RFC PATCH 2/2] acpi/pci_root: negotiate CXL _OSC
Date: Thu, 17 Mar 2022 11:25:27 +0800	[thread overview]
Message-ID: <202203171123.Jy0945To-lkp@intel.com> (raw)
In-Reply-To: <20220317002704.1835870-3-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
config: x86_64-randconfig-a001 (https://download.01.org/0day-ci/archive/20220317/202203171123.Jy0945To-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project a6ec1e3d798f8eab43fb3a91028c6ab04e115fcb)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/8020d862c22d52b61a590343b2202e5d05332100
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Vishal-Verma/acpi-add-support-for-CXL-_OSC/20220317-082840
        git checkout 8020d862c22d52b61a590343b2202e5d05332100
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/acpi/

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

All warnings (new ones prefixed by >>):

>> drivers/acpi/pci_root.c:562:3: warning: variable 'control' is uninitialized when used here [-Wuninitialized]
                   control |= OSC_CXL_ERROR_REPORTING_CONTROL;
                   ^~~~~~~
   drivers/acpi/pci_root.c:559:13: note: initialize the variable 'control' to silence this warning
           u32 control;
                      ^
                       = 0
>> drivers/acpi/pci_root.c:612:6: warning: variable 'cxl_support' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
           if (is_cxl(root)) {
               ^~~~~~~~~~~~
   drivers/acpi/pci_root.c:619:22: note: uninitialized use occurs here
                                             &cxl_control, cxl_support);
                                                           ^~~~~~~~~~~
   drivers/acpi/pci_root.c:612:2: note: remove the 'if' if its condition is always true
           if (is_cxl(root)) {
           ^~~~~~~~~~~~~~~~~~
   drivers/acpi/pci_root.c:588:17: note: initialize the variable 'cxl_support' to silence this warning
           u32 cxl_support, cxl_control = 0, cxl_requested = 0;
                          ^
                           = 0
   2 warnings generated.


vim +/control +562 drivers/acpi/pci_root.c

   556	
   557	static u32 calculate_cxl_control(void)
   558	{
   559		u32 control;
   560	
   561		if (pci_aer_available())
 > 562			control |= OSC_CXL_ERROR_REPORTING_CONTROL;
   563	
   564		return control;
   565	}
   566	
   567	static bool os_control_query_checks(struct acpi_pci_root *root, u32 support)
   568	{
   569		struct acpi_device *device = root->device;
   570	
   571		if (pcie_ports_disabled) {
   572			dev_info(&device->dev, "PCIe port services disabled; not requesting _OSC control\n");
   573			return false;
   574		}
   575	
   576		if ((support & ACPI_PCIE_REQ_SUPPORT) != ACPI_PCIE_REQ_SUPPORT) {
   577			decode_osc_support(root, "not requesting OS control; OS requires",
   578					   ACPI_PCIE_REQ_SUPPORT);
   579			return false;
   580		}
   581	
   582		return true;
   583	}
   584	
   585	static void negotiate_os_control(struct acpi_pci_root *root, int *no_aspm)
   586	{
   587		u32 support, control = 0, requested = 0;
   588		u32 cxl_support, cxl_control = 0, cxl_requested = 0;
   589		acpi_status status;
   590		struct acpi_device *device = root->device;
   591		acpi_handle handle = device->handle;
   592	
   593		/*
   594		 * Apple always return failure on _OSC calls when _OSI("Darwin") has
   595		 * been called successfully. We know the feature set supported by the
   596		 * platform, so avoid calling _OSC at all
   597		 */
   598		if (x86_apple_machine) {
   599			root->osc_control_set = ~OSC_PCI_EXPRESS_PME_CONTROL;
   600			decode_osc_control(root, "OS assumes control of",
   601					   root->osc_control_set);
   602			return;
   603		}
   604	
   605		support = calculate_support();
   606	
   607		decode_osc_support(root, "OS supports", support);
   608	
   609		if (os_control_query_checks(root, support))
   610			requested = control = calculate_control();
   611	
 > 612		if (is_cxl(root)) {
   613			cxl_support = calculate_cxl_support();
   614			decode_cxl_osc_support(root, "OS supports", cxl_support);
   615			cxl_requested = cxl_control = calculate_cxl_control();
   616		}
   617	
   618		status = acpi_pci_osc_control_set(handle, &control, support,
   619						  &cxl_control, cxl_support);
   620		if (ACPI_SUCCESS(status)) {
   621			if (control)
   622				decode_osc_control(root, "OS now controls", control);
   623			if (cxl_control)
   624				decode_cxl_osc_control(root, "OS now controls",
   625						   cxl_control);
   626	
   627			if (acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_ASPM) {
   628				/*
   629				 * We have ASPM control, but the FADT indicates that
   630				 * it's unsupported. Leave existing configuration
   631				 * intact and prevent the OS from touching it.
   632				 */
   633				dev_info(&device->dev, "FADT indicates ASPM is unsupported, using BIOS configuration\n");
   634				*no_aspm = 1;
   635			}
   636		} else {
   637			/*
   638			 * We want to disable ASPM here, but aspm_disabled
   639			 * needs to remain in its state from boot so that we
   640			 * properly handle PCIe 1.1 devices.  So we set this
   641			 * flag here, to defer the action until after the ACPI
   642			 * root scan.
   643			 */
   644			*no_aspm = 1;
   645	
   646			/* _OSC is optional for PCI host bridges */
   647			if ((status == AE_NOT_FOUND) && !is_pcie(root))
   648				return;
   649	
   650			if (control) {
   651				decode_osc_control(root, "OS requested", requested);
   652				decode_osc_control(root, "platform willing to grant", control);
   653			}
   654			if (cxl_control) {
   655				decode_cxl_osc_control(root, "OS requested", cxl_requested);
   656				decode_cxl_osc_control(root, "platform willing to grant",
   657						   cxl_control);
   658			}
   659	
   660			dev_info(&device->dev, "_OSC: platform retains control of PCIe features (%s)\n",
   661				 acpi_format_exception(status));
   662		}
   663	}
   664	

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

  parent reply	other threads:[~2022-03-17  3:25 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-17  0:27 [RFC PATCH 0/2] acpi: add support for CXL _OSC Vishal Verma
2022-03-17  0:27 ` [RFC PATCH 1/2] PCI/ACPI: Use CXL _OSC instead of PCIe _OSC Vishal Verma
2022-03-17  1:47   ` Dan Williams
2022-03-17 15:40     ` Jonathan Cameron
2022-03-17  0:27 ` [RFC PATCH 2/2] acpi/pci_root: negotiate CXL _OSC 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 [this message]
2022-03-17 16:10   ` Jonathan Cameron
2022-03-18 21:16     ` Verma, Vishal L
2022-03-17 15:19 ` [RFC PATCH 0/2] acpi: add support for " Jonathan Cameron
2022-03-18 19:52   ` Verma, Vishal L
  -- strict thread matches above, loose matches on Subject: below --
2022-03-17  5:48 [RFC PATCH 2/2] acpi/pci_root: negotiate " kernel test robot
2022-03-18  0:33 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=202203171123.Jy0945To-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=llvm@lists.linux.dev \
    --cc=vishal.l.verma@intel.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 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.