From: "Michał Grzelak" <michal.grzelak@intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: "Michał Grzelak" <michal.grzelak@intel.com>,
intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org,
"Andi Shyti" <andi.shyti@linux.intel.com>,
"Krzysztof Karas" <krzysztof.karas@intel.com>,
"Sebastian Brzezinka" <sebastian.brzezinka@intel.com>,
"Krzysztof Niemiec" <krzysztof.niemiec@intel.com>,
"Janusz Krzysztofik" <janusz.krzysztofik@linux.intel.com>
Subject: Re: [PATCH v1] i915/i915_driver: move intel_gvt_init() level higher
Date: Thu, 29 Jan 2026 00:11:19 +0100 (CET) [thread overview]
Message-ID: <8e1ee0f6-12e8-cb6f-2845-c2f5cbde6fa0@intel.com> (raw)
In-Reply-To: <9f706b79a949d51fc97e8a5c2f68327413a22645@intel.com>
[-- Attachment #1: Type: text/plain, Size: 2955 bytes --]
On Wed, 28 Jan 2026, Jani Nikula wrote:
> On Wed, 28 Jan 2026, Michał Grzelak <michal.grzelak@intel.com> wrote:
>> i915_driver_probe() cannot currently handle error of intel_gvt_init()
>> because it is called from i915_driver_hw_probe(). Nevertheless, it's
>> error path is done in i915_driver_probe(). Fault of
>> i915_driver_hw_probe() thus causes list corruption, since
>> intel_gvt_driver_remove() was called twice.
>>
>> Move intel_gvt_init() up to i915_driver_probe(). Adjust error path of
>> i915_driver_hw_probe() so that intel_gvt_driver_remove() is called
>> always once.
>>
>> Signed-off-by: Michał Grzelak <michal.grzelak@intel.com>
>> ---
>> drivers/gpu/drm/i915/i915_driver.c | 18 +++++++++---------
>> 1 file changed, 9 insertions(+), 9 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c
>> index 1e087dfe03d0..0f507b8ae2f1 100644
>> --- a/drivers/gpu/drm/i915/i915_driver.c
>> +++ b/drivers/gpu/drm/i915/i915_driver.c
>> @@ -557,10 +557,6 @@ static int i915_driver_hw_probe(struct drm_i915_private *dev_priv)
>> drm_dbg(&dev_priv->drm, "can't enable MSI");
>> }
>>
>> - ret = intel_gvt_init(dev_priv);
>> - if (ret)
>> - goto err_msi;
>> -
>> intel_opregion_setup(display);
>>
>> ret = i915_pcode_init(dev_priv);
>> @@ -581,9 +577,6 @@ static int i915_driver_hw_probe(struct drm_i915_private *dev_priv)
>>
>> err_opregion:
>> intel_opregion_cleanup(display);
>> -err_msi:
>> - if (pdev->msi_enabled)
>> - pci_disable_msi(pdev);
>
> Why's this being moved?
>
No sane reason, it's me overlooking err_opregion error path.
Will fix it in next version.
BR,
Michał
>> err_mem_regions:
>> intel_memory_regions_driver_release(dev_priv);
>> err_ggtt:
>> @@ -870,9 +863,13 @@ int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
>> if (ret < 0)
>> goto out_cleanup_mmio;
>>
>> + ret = intel_gvt_init(i915);
>> + if (ret)
>> + goto out_cleanup_hw;
>> +
>> ret = intel_display_driver_probe_noirq(display);
>> if (ret < 0)
>> - goto out_cleanup_hw;
>> + goto out_cleanup_gvt;
>>
>> ret = intel_irq_install(i915);
>> if (ret)
>> @@ -921,6 +918,10 @@ int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
>> intel_irq_uninstall(i915);
>> out_cleanup_modeset:
>> intel_display_driver_remove_nogem(display);
>> +out_cleanup_gvt:
>> + if (pdev->msi_enabled)
>> + pci_disable_msi(pdev);
>> + intel_gvt_driver_remove(i915);
>> out_cleanup_hw:
>> i915_driver_hw_remove(i915);
>> intel_memory_regions_driver_release(i915);
>> @@ -928,7 +929,6 @@ int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
>> i915_gem_drain_freed_objects(i915);
>> i915_ggtt_driver_late_release(i915);
>> out_cleanup_mmio:
>> - intel_gvt_driver_remove(i915);
>> i915_driver_mmio_release(i915);
>> out_runtime_pm_put:
>> enable_rpm_wakeref_asserts(&i915->runtime_pm);
>
> --
> Jani Nikula, Intel
>
prev parent reply other threads:[~2026-01-28 23:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-28 18:09 [PATCH v1] i915/i915_driver: move intel_gvt_init() level higher Michał Grzelak
2026-01-28 19:09 ` ✗ i915.CI.BAT: failure for " Patchwork
2026-01-28 19:21 ` [PATCH v1] " Jani Nikula
2026-01-28 23:11 ` Michał Grzelak [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8e1ee0f6-12e8-cb6f-2845-c2f5cbde6fa0@intel.com \
--to=michal.grzelak@intel.com \
--cc=andi.shyti@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
--cc=janusz.krzysztofik@linux.intel.com \
--cc=krzysztof.karas@intel.com \
--cc=krzysztof.niemiec@intel.com \
--cc=sebastian.brzezinka@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox