]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/xe: Use raw device ID to find sub-platform descriptor
authorMichal Wajdeczko <michal.wajdeczko@intel.com>
Tue, 26 May 2026 19:54:46 +0000 (21:54 +0200)
committerMichal Wajdeczko <michal.wajdeczko@intel.com>
Wed, 27 May 2026 10:51:20 +0000 (12:51 +0200)
We don't need the partially initialized xe_device pointer to
find the sub-platform descriptor, as for the descriptor lookup
only the device ID is required and it can be obtained directly
from the pci_dev.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: Raag Jadav <raag.jadav@intel.com>
Link: https://patch.msgid.link/20260526195452.20545-2-michal.wajdeczko@intel.com
drivers/gpu/drm/xe/xe_pci.c

index 1243c7d8ed10a426689dba6a681c28283ecf5e02..0095a2d7efa49a7406c0e64055feb8b8d8d2cd74 100644 (file)
@@ -575,14 +575,14 @@ static bool id_blocked(u16 device_id)
 }
 
 static const struct xe_subplatform_desc *
-find_subplatform(const struct xe_device *xe, const struct xe_device_desc *desc)
+find_subplatform(const struct xe_device_desc *desc, u16 devid)
 {
        const struct xe_subplatform_desc *sp;
        const u16 *id;
 
        for (sp = desc->subplatforms; sp && sp->subplatform; sp++)
                for (id = sp->pciidlist; *id; id++)
-                       if (*id == xe->info.devid)
+                       if (*id == devid)
                                return sp;
 
        return NULL;
@@ -1064,6 +1064,8 @@ static int xe_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        struct xe_device *xe;
        int err;
 
+       subplatform_desc = find_subplatform(desc, pdev->device);
+
        xe_configfs_check_device(pdev);
 
        if (desc->require_force_probe && !id_forced(pdev->device)) {
@@ -1098,7 +1100,6 @@ static int xe_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        pci_set_drvdata(pdev, &xe->drm);
 
        xe_pm_assert_unbounded_bridge(xe);
-       subplatform_desc = find_subplatform(xe, desc);
 
        pci_set_master(pdev);