Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1589547

Re: [PATCH V2] PCI/ASPM: reconfigure ASPM following hotplug for POLICY_DEFAULT

From Sinan Kaya <okaya@codeaurora.org>
Newsgroups linux.kernel
Subject Re: [PATCH V2] PCI/ASPM: reconfigure ASPM following hotplug for POLICY_DEFAULT
Date 2017-02-28 16:20 +0100
Message-ID <tfRJf-6ds-9@gated-at.bofh.it> (permalink)
References <t5MBc-4Gh-1@gated-at.bofh.it> <tfNPj-3Bl-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 2/28/2017 6:03 AM, Patel, Mayurkumar wrote:
>> -	/* Save default state */
>> -	link->aspm_default = link->aspm_enabled;
> But, I am finding a problem with this change, if Policy is set to default,
> BIOS enables ASPM L1, but pcie_config_aspm_link() disables ASPM L1
> due to link->aspm_enabled is different than link->aspm_default while
> called from pcie_aspm_init_link_state() during hotplug insertion.
> 

Thanks for testing. I think it means the enable count logic I put below
is not working.

I was trying to figure out when to use saved values vs. the values in
registers by looking at the enable_cnt.

enable_cnt is 0 during boot on my system.

The enable_cnt should have been non-zero following an insertion following
remove and default and enabled values should have been identical. 

Can you print out the values of pdev->aspm_default, link->aspm_default, 
and link->aspm_enabled in this function along with atomic_read(&pdev->enable_cnt)?

> 
>> +	/*
>> +	 * Save default state from FW when enabling ASPM for the first time
>> +	 * during boot by looking at the calculated link->aspm_enabled bits
>> +	 * above and enable_cnt will be zero.
>> +	 *
>> +	 * If this path is getting called for the second/third time
>> +	 * (enable_cnt will be non-zero). Assume that the current state of the
>> +	 * ASPM registers may not necessarily match what FW asked us to do as
>> +	 * in the case of hotplug insertion/removal.
>> +	 */
>> +	if (!atomic_read(&pdev->enable_cnt))
>> +		pdev->aspm_default = link->aspm_default = link->aspm_enabled;
>> +	else
>> +		link->aspm_default = pdev->aspm_default;


-- 
Sinan Kaya
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

RE: [PATCH V2] PCI/ASPM: reconfigure ASPM following hotplug for  POLICY_DEFAULT "Patel, Mayurkumar" <mayurkumar.patel@intel.com> - 2017-02-28 12:10 +0100
  Re: [PATCH V2] PCI/ASPM: reconfigure ASPM following hotplug for  POLICY_DEFAULT Sinan Kaya <okaya@codeaurora.org> - 2017-02-28 16:20 +0100
    RE: [PATCH V2] PCI/ASPM: reconfigure ASPM following hotplug for  POLICY_DEFAULT "Patel, Mayurkumar" <mayurkumar.patel@intel.com> - 2017-02-28 22:50 +0100
      Re: [PATCH V2] PCI/ASPM: reconfigure ASPM following hotplug for  POLICY_DEFAULT Sinan Kaya <okaya@codeaurora.org> - 2017-03-01 19:00 +0100
        RE: [PATCH V2] PCI/ASPM: reconfigure ASPM following hotplug for  POLICY_DEFAULT "Patel, Mayurkumar" <mayurkumar.patel@intel.com> - 2017-03-02 17:20 +0100
          Re: [PATCH V2] PCI/ASPM: reconfigure ASPM following hotplug for  POLICY_DEFAULT Sinan Kaya <okaya@codeaurora.org> - 2017-03-02 19:30 +0100
            RE: [PATCH V2] PCI/ASPM: reconfigure ASPM following hotplug for  POLICY_DEFAULT "Patel, Mayurkumar" <mayurkumar.patel@intel.com> - 2017-03-03 10:50 +0100
              Re: [PATCH V2] PCI/ASPM: reconfigure ASPM following hotplug for  POLICY_DEFAULT okaya@codeaurora.org - 2017-03-03 11:40 +0100

csiph-web