Linux PCI subsystem development
 help / color / mirror / Atom feed
* Re: [PATCH v3] PCI: vmd: Handle BUS_RESTRICT_CFG value 3 for Arrow Lake-HX
@ 2026-07-21 12:47 Lin Mohan
  2026-07-21 16:42 ` Bjorn Helgaas
  0 siblings, 1 reply; 10+ messages in thread
From: Lin Mohan @ 2026-07-21 12:47 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: Ali Alaei, linux-pci@vger.kernel.org

Hi Bjorn,

I am Lin Mohan, the reporter of
https://bugzilla.kernel.org/show_bug.cgi?id=221137.

Since commit 22b47bd49e45 ("PCI: vmd: Handle BUS_RESTRICT_CFG value 3
for Arrow Lake-HX") has already been merged, could you please add the
following tags in a follow-up fix?

Reported-by: Lin Mohan <linmhwork@outlook.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=221137
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=221136

This patch fixes the same Mode 3 / Dynamic Bus Offset issue I
reported on the 8086:09ab VMD device (Arrow Lake-S).

Thanks,
Lin Mohan

^ permalink raw reply	[flat|nested] 10+ messages in thread
* [PATCH v2] PCI: vmd: Handle BUS_RESTRICT_CFG value 3 for Arrow Lake-HX
@ 2026-06-04 21:40 Ali Alaei
  2026-06-28 14:34 ` [PATCH v3] " Ali Alaei
  0 siblings, 1 reply; 10+ messages in thread
From: Ali Alaei @ 2026-06-04 21:40 UTC (permalink / raw)
  To: linux-pci; +Cc: bhelgaas, lpieralisi, Ali Alaei

Intel Arrow Lake-HX platforms (e.g., Core Ultra 9 275HX) use VMD device
8086:ad0b, which is already in the driver's ID table. However, on these
platforms the VMCONFIG register's BUS_RESTRICT_CFG field returns 3 during
probe. vmd_get_bus_number_start() only handles values 0-2 and returns
-ENODEV for anything else, causing VMD probe to fail and leaving NVMe
drives behind the VMD controller invisible to the OS.

Handle cfg=3 the same as cfg=2 (busn_start=224).

Also add a PCI_POSSIBLE_ERROR() check after reading VMCONFIG: when a
device is removed or a config read fails, pci_read_config_word() returns
0xFFFF, and BUS_RESTRICT_CFG(0xFFFF) = 3. Without this check the new
case 3 would silently treat a read failure as a valid configuration,
masking the error instead of aborting probe. The driver already applies
this pattern for the VMLOCK read in vmd_get_phys_offsets().

Tested on: Acer Predator PH16-73 with Intel Core Ultra 9 275HX
           (VMD controller 0000:00:0e.0, 8086:ad0b).

v2: Add PCI_POSSIBLE_ERROR() guard after VMCONFIG read to avoid treating
    a config read failure (0xFFFF) as a valid cfg=3 value.

Signed-off-by: Ali Alaei <ali.alaei.tabatabaei@gmail.com>
---
 drivers/pci/controller/vmd.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c
index XXXXXXX..YYYYYYY 100644
--- a/drivers/pci/controller/vmd.c
+++ b/drivers/pci/controller/vmd.c
@@ -640,6 +640,8 @@ static int vmd_get_bus_number_start(struct vmd_dev *vmd)
 	pci_read_config_word(dev, PCI_REG_VMCAP, &reg);
 	if (BUS_RESTRICT_CAP(reg)) {
 		pci_read_config_word(dev, PCI_REG_VMCONFIG, &reg);
+		if (PCI_POSSIBLE_ERROR(reg))
+			return -ENODEV;

 		switch (BUS_RESTRICT_CFG(reg)) {
 		case 0:
@@ -649,6 +651,7 @@ static int vmd_get_bus_number_start(struct vmd_dev *vmd)
 		case 1:
 			vmd->busn_start = 128;
 			break;
+		case 3:
 		case 2:
 			vmd->busn_start = 224;
 			break;
--
2.49.0

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-08-05  3:27 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-21 12:47 [PATCH v3] PCI: vmd: Handle BUS_RESTRICT_CFG value 3 for Arrow Lake-HX Lin Mohan
2026-07-21 16:42 ` Bjorn Helgaas
2026-08-05  3:27   ` Krzysztof Wilczyński
  -- strict thread matches above, loose matches on Subject: below --
2026-06-04 21:40 [PATCH v2] " Ali Alaei
2026-06-28 14:34 ` [PATCH v3] " Ali Alaei
2026-06-28 14:46   ` sashiko-bot
2026-07-13 17:16   ` Ali Alaei
2026-07-15  5:56   ` Manivannan Sadhasivam
2026-07-20 22:47   ` Bjorn Helgaas
2026-07-21 12:47     ` Lin Mohan
2026-07-21 12:50     ` Lin Mohan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox