drm/i915: do not clean GT table on error path
authorjsg <jsg@openbsd.org>
Mon, 4 Dec 2023 06:05:59 +0000 (06:05 +0000)
committerjsg <jsg@openbsd.org>
Mon, 4 Dec 2023 06:05:59 +0000 (06:05 +0000)
From Andrzej Hajda
84a6e475451dfe8db44bbf4fd0969906a9bfdc2f in linux-6.1.y/6.1.65
0561794b6b642b84b879bf97061c4b4fa692839e in mainline linux

sys/dev/pci/drm/i915/gt/intel_gt.c
sys/dev/pci/drm/i915/i915_driver.c

index d44e11c..f7cfe5a 100644 (file)
@@ -909,8 +909,6 @@ int intel_gt_probe_all(struct drm_i915_private *i915)
 
 err:
        i915_probe_error(i915, "Failed to initialize %s! (%d)\n", gtdef->name, ret);
-       intel_gt_release_all(i915);
-
        return ret;
 }
 
@@ -1006,8 +1004,6 @@ int intel_gt_probe_all(struct drm_i915_private *i915)
 
 err:
        i915_probe_error(i915, "Failed to initialize %s! (%d)\n", gtdef->name, ret);
-       intel_gt_release_all(i915);
-
        return ret;
 }
 
@@ -1028,15 +1024,6 @@ int intel_gt_tiles_init(struct drm_i915_private *i915)
        return 0;
 }
 
-void intel_gt_release_all(struct drm_i915_private *i915)
-{
-       struct intel_gt *gt;
-       unsigned int id;
-
-       for_each_gt(gt, i915, id)
-               i915->gt[id] = NULL;
-}
-
 void intel_gt_info_print(const struct intel_gt_info *info,
                         struct drm_printer *p)
 {
index 4585d23..b701ae1 100644 (file)
@@ -935,7 +935,7 @@ int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
        ret = i915_driver_mmio_probe(i915);
        if (ret < 0)
-               goto out_tiles_cleanup;
+               goto out_runtime_pm_put;
 
        ret = i915_driver_hw_probe(i915);
        if (ret < 0)
@@ -993,8 +993,6 @@ out_cleanup_hw:
        i915_ggtt_driver_late_release(i915);
 out_cleanup_mmio:
        i915_driver_mmio_release(i915);
-out_tiles_cleanup:
-       intel_gt_release_all(i915);
 out_runtime_pm_put:
        enable_rpm_wakeref_asserts(&i915->runtime_pm);
        i915_driver_late_release(i915);
@@ -1047,7 +1045,7 @@ int i915_driver_probe(struct drm_i915_private *i915, const struct pci_device_id
 
        ret = i915_driver_mmio_probe(i915);
        if (ret < 0)
-               goto out_tiles_cleanup;
+               goto out_runtime_pm_put;
 
        ret = i915_driver_hw_probe(i915);
        if (ret < 0)
@@ -1107,8 +1105,6 @@ out_cleanup_hw:
        i915_ggtt_driver_late_release(i915);
 out_cleanup_mmio:
        i915_driver_mmio_release(i915);
-out_tiles_cleanup:
-       intel_gt_release_all(i915);
 out_runtime_pm_put:
        enable_rpm_wakeref_asserts(&i915->runtime_pm);
        i915_driver_late_release(i915);