[PATCH v2] PCI: Do not attempt to set ExtTag for VFs

Håkon Bugge posted 1 patch 2 months, 3 weeks ago
drivers/pci/probe.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
[PATCH v2] PCI: Do not attempt to set ExtTag for VFs
Posted by Håkon Bugge 2 months, 3 weeks ago
The bit for enabling extended tags is Reserved and Preserved (RsvdP)
for VFs, according to PCIe r7.0 section 7.5.3.4 table 7.21.  Hence,
bail out early from pci_configure_extended_tags() if the device is a
VF.

Otherwise, we may see incorrect log messages such as:

	   kernel: pci 0000:af:00.2: enabling Extended Tags

(af:00.2 is a VF)

Fixes: 60db3a4d8cc9 ("PCI: Enable PCIe Extended Tags if supported")
Signed-off-by: Håkon Bugge <haakon.bugge@oracle.com>

---

v1 -> v2: Added ref to PCIe spec
---
 drivers/pci/probe.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 0ce98e18b5a87..014017e15bcc8 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -2244,7 +2244,8 @@ int pci_configure_extended_tags(struct pci_dev *dev, void *ign)
 	u16 ctl;
 	int ret;
 
-	if (!pci_is_pcie(dev))
+	/* PCI_EXP_DEVCTL_EXT_TAG is RsvdP in VFs */
+	if (!pci_is_pcie(dev) || dev->is_virtfn)
 		return 0;
 
 	ret = pcie_capability_read_dword(dev, PCI_EXP_DEVCAP, &cap);
-- 
2.43.5

Re: [PATCH v2] PCI: Do not attempt to set ExtTag for VFs
Posted by Bjorn Helgaas 4 weeks, 1 day ago
On Wed, Nov 12, 2025 at 10:54:40AM +0100, Håkon Bugge wrote:
> The bit for enabling extended tags is Reserved and Preserved (RsvdP)
> for VFs, according to PCIe r7.0 section 7.5.3.4 table 7.21.  Hence,
> bail out early from pci_configure_extended_tags() if the device is a
> VF.
> 
> Otherwise, we may see incorrect log messages such as:
> 
> 	   kernel: pci 0000:af:00.2: enabling Extended Tags
> 
> (af:00.2 is a VF)
> 
> Fixes: 60db3a4d8cc9 ("PCI: Enable PCIe Extended Tags if supported")
> Signed-off-by: Håkon Bugge <haakon.bugge@oracle.com>

Applied to pci/enumeration for v6.20, thanks!

> ---
> 
> v1 -> v2: Added ref to PCIe spec
> ---
>  drivers/pci/probe.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
> index 0ce98e18b5a87..014017e15bcc8 100644
> --- a/drivers/pci/probe.c
> +++ b/drivers/pci/probe.c
> @@ -2244,7 +2244,8 @@ int pci_configure_extended_tags(struct pci_dev *dev, void *ign)
>  	u16 ctl;
>  	int ret;
>  
> -	if (!pci_is_pcie(dev))
> +	/* PCI_EXP_DEVCTL_EXT_TAG is RsvdP in VFs */
> +	if (!pci_is_pcie(dev) || dev->is_virtfn)
>  		return 0;
>  
>  	ret = pcie_capability_read_dword(dev, PCI_EXP_DEVCAP, &cap);
> -- 
> 2.43.5
> 
Re: [PATCH v2] PCI: Do not attempt to set ExtTag for VFs
Posted by Haakon Bugge 2 months ago

> On 12 Nov 2025, at 10:54, Håkon Bugge <Haakon.Bugge@oracle.com> wrote:
> 
> The bit for enabling extended tags is Reserved and Preserved (RsvdP)
> for VFs, according to PCIe r7.0 section 7.5.3.4 table 7.21.  Hence,
> bail out early from pci_configure_extended_tags() if the device is a
> VF.
> 
> Otherwise, we may see incorrect log messages such as:
> 
>   kernel: pci 0000:af:00.2: enabling Extended Tags
> 
> (af:00.2 is a VF)
> 
> Fixes: 60db3a4d8cc9 ("PCI: Enable PCIe Extended Tags if supported")
> Signed-off-by: Håkon Bugge <haakon.bugge@oracle.com>

A gentle ping on this one.


Thxs, Håkon

> 
> ---
> 
> v1 -> v2: Added ref to PCIe spec
> ---
> drivers/pci/probe.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
> index 0ce98e18b5a87..014017e15bcc8 100644
> --- a/drivers/pci/probe.c
> +++ b/drivers/pci/probe.c
> @@ -2244,7 +2244,8 @@ int pci_configure_extended_tags(struct pci_dev *dev, void *ign)
> u16 ctl;
> int ret;
> 
> - if (!pci_is_pcie(dev))
> + /* PCI_EXP_DEVCTL_EXT_TAG is RsvdP in VFs */
> + if (!pci_is_pcie(dev) || dev->is_virtfn)
> return 0;
> 
> ret = pcie_capability_read_dword(dev, PCI_EXP_DEVCAP, &cap);
> -- 
> 2.43.5
> 

Re: [PATCH v2] PCI: Do not attempt to set ExtTag for VFs
Posted by Haakon Bugge 1 month ago
>> 
>> 
>> On 12 Nov 2025, at 10:54, Håkon Bugge <Haakon.Bugge@oracle.com> wrote:
>> 
>> The bit for enabling extended tags is Reserved and Preserved (RsvdP)
>> for VFs, according to PCIe r7.0 section 7.5.3.4 table 7.21.  Hence,
>> bail out early from pci_configure_extended_tags() if the device is a
>> VF.
>> 
>> Otherwise, we may see incorrect log messages such as:
>> 
>>  kernel: pci 0000:af:00.2: enabling Extended Tags
>> 
>> (af:00.2 is a VF)
>> 
>> Fixes: 60db3a4d8cc9 ("PCI: Enable PCIe Extended Tags if supported")
>> Signed-off-by: Håkon Bugge <haakon.bugge@oracle.com>
> 
> A gentle ping on this one.

Once more.


Thxs, Håkon


> 
> 
> Thxs, Håkon
> 
> 
>> ---
>> 
>> v1 -> v2: Added ref to PCIe spec
>> ---
>> drivers/pci/probe.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>> 
>> diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
>> index 0ce98e18b5a87..014017e15bcc8 100644
>> --- a/drivers/pci/probe.c
>> +++ b/drivers/pci/probe.c
>> @@ -2244,7 +2244,8 @@ int pci_configure_extended_tags(struct pci_dev *dev, void *ign)
>> u16 ctl;
>> int ret;
>> 
>> - if (!pci_is_pcie(dev))
>> + /* PCI_EXP_DEVCTL_EXT_TAG is RsvdP in VFs */
>> + if (!pci_is_pcie(dev) || dev->is_virtfn)
>> return 0;
>> 
>> ret = pcie_capability_read_dword(dev, PCI_EXP_DEVCAP, &cap);
>> --
>> 2.43.5
Re: [PATCH v2] PCI: Do not attempt to set ExtTag for VFs
Posted by yanjun.zhu 2 months ago
On 12/1/25 11:56 PM, Haakon Bugge wrote:
> 
> 
>> On 12 Nov 2025, at 10:54, Håkon Bugge <Haakon.Bugge@oracle.com> wrote:
>>
>> The bit for enabling extended tags is Reserved and Preserved (RsvdP)
>> for VFs, according to PCIe r7.0 section 7.5.3.4 table 7.21.  Hence,
>> bail out early from pci_configure_extended_tags() if the device is a
>> VF.


enabling extended tags in PCIe r7.0 section 7.5.3.4 table 7.21 is as below:
"
Extended Tag Field Enable - This bit, in combination with the 10-Bit Tag 
Requester Enable bit and the 14-Bit Tag Requester Enable bit, determines 
how many Tag field bits a Requester is permitted to use for non-UIO 
Requests. This bit is not applicable to a Requester when generating UIO 
Requests. The following applies when the 10-Bit Tag Requester Enable bit 
and the 14-Bit Tag Requester Enable bit are both Clear. If the Extended 
Tag Field Enable bit is Set, the Function is permitted to use an 8-bit 
Tag field as a Requester. If the bit is Clear, the Function is 
restricted to using a 5-bit Tag field. See § Section 2.2.6.2 for 
required behavior when one or both of these larger-Tag Requester Enable 
bits are Set. If software changes the value of the Extended Tag Field 
Enable bit while the Function has outstanding Non-Posted Requests, the 
result is undefined. Functions that do not implement this capability 
hardwire this bit to 0b. Default value of this bit is implementation 
specific.
"

Thus,
Reviewed-by: Zhu Yanjun <yanjun.zhu@linux.dev>

Zhu Yanjun

>>
>> Otherwise, we may see incorrect log messages such as:
>>
>>    kernel: pci 0000:af:00.2: enabling Extended Tags
>>
>> (af:00.2 is a VF)
>>
>> Fixes: 60db3a4d8cc9 ("PCI: Enable PCIe Extended Tags if supported")
>> Signed-off-by: Håkon Bugge <haakon.bugge@oracle.com>
> 
> A gentle ping on this one.
> 
> 
> Thxs, Håkon
> 
>>
>> ---
>>
>> v1 -> v2: Added ref to PCIe spec
>> ---
>> drivers/pci/probe.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
>> index 0ce98e18b5a87..014017e15bcc8 100644
>> --- a/drivers/pci/probe.c
>> +++ b/drivers/pci/probe.c
>> @@ -2244,7 +2244,8 @@ int pci_configure_extended_tags(struct pci_dev *dev, void *ign)
>> u16 ctl;
>> int ret;
>>
>> - if (!pci_is_pcie(dev))
>> + /* PCI_EXP_DEVCTL_EXT_TAG is RsvdP in VFs */
>> + if (!pci_is_pcie(dev) || dev->is_virtfn)
>> return 0;
>>
>> ret = pcie_capability_read_dword(dev, PCI_EXP_DEVCAP, &cap);
>> -- 
>> 2.43.5
>>
>