[Intel-xe] [PATCH 4/4] drm/xe: Enable PCI device earlier

Matt Roper matthew.d.roper at intel.com
Wed Jun 14 20:52:02 UTC 2023


Newer Intel platforms require that inspect the contents of the GMD_ID
registers very early in the driver initialization process to determine
the IP version (and proper init sequences), of the platform.  Move the
general PCI device setup and enablement slightly earlier, before we
start trying to peek at the GMD_ID registers.

Signed-off-by: Matt Roper <matthew.d.roper at intel.com>
---
 drivers/gpu/drm/xe/xe_pci.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c
index b5bea42a458d..c86580eb1b56 100644
--- a/drivers/gpu/drm/xe/xe_pci.c
+++ b/drivers/gpu/drm/xe/xe_pci.c
@@ -651,9 +651,19 @@ static int xe_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 	subplatform_desc = find_subplatform(xe, desc);
 
+	pci_set_drvdata(pdev, xe);
+	err = pci_enable_device(pdev);
+	if (err)
+		goto err_drm_put;
+
+	pci_set_master(pdev);
+
+	if (pci_enable_msi(pdev) < 0)
+		drm_dbg(&xe->drm, "can't enable MSI");
+
 	err = xe_info_init(xe, desc, subplatform_desc);
 	if (err)
-		goto err_drm_put;
+		goto err_pci_disable;
 
 	xe_display_info_init(xe);
 
@@ -677,16 +687,6 @@ static int xe_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 		xe_step_name(xe->info.step.display),
 		xe_step_name(xe->info.step.basedie));
 
-	pci_set_drvdata(pdev, xe);
-	err = pci_enable_device(pdev);
-	if (err)
-		goto err_drm_put;
-
-	pci_set_master(pdev);
-
-	if (pci_enable_msi(pdev) < 0)
-		drm_dbg(&xe->drm, "can't enable MSI");
-
 	err = xe_device_probe(xe);
 	if (err)
 		goto err_pci_disable;
-- 
2.40.1



More information about the Intel-xe mailing list