[PATCH v3 1/3] PCI: Configure root port MPS during host probing

Hans Zhang 18255117159 at 163.com
Wed May 7 07:55:28 PDT 2025



On 2025/5/7 15:38, Niklas Cassel wrote:
> On Wed, May 07, 2025 at 01:34:37AM +0800, Hans Zhang wrote:
> 
> (snip)
> 
>>   static void pci_configure_mps(struct pci_dev *dev)
>>   {
>>   	struct pci_dev *bridge = pci_upstream_bridge(dev);
>> @@ -2178,6 +2209,10 @@ static void pci_configure_mps(struct pci_dev *dev)
>>   		return;
>>   	}
> 
> We should probably add a comment explaining why we are doing this here.
> 
> Perhaps something like:
> 
> /*
>   * Unless MPS strategy is PCIE_BUS_TUNE_OFF (don't touch MPS at all),
>   * start off by setting root ports' MPS to MPSS. Depending on the MPS
>   * strategy, and the MPSS of the devices below the root port, the MPS
>   * of the root port might get overriden later.
>   */
> 
> 

Dear Niklas,

Thank you very much for your reply and suggestions.
It will be added in the next version.

Best regards,
Hans

>> +	if (pci_pcie_type(dev) == PCI_EXP_TYPE_ROOT_PORT &&
>> +	    pcie_bus_config != PCIE_BUS_TUNE_OFF)
>> +		pcie_write_mps(dev, 128 << dev->pcie_mpss);
>> +
>>   	if (!bridge || !pci_is_pcie(bridge))
>>   		return;
>>   
> 
> 
> Kind regards,
> Niklas




More information about the linux-amlogic mailing list