From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 5/9] drm/i915: split i915_driver_modeset_probe() to pre/post irq install
Date: Tue, 4 Feb 2020 16:53:41 +0200 [thread overview]
Message-ID: <20200204145341.GU13686@intel.com> (raw)
In-Reply-To: <2b2cba799bbab1b63f6fe342db3c5bdbacc1cebf.1580823606.git.jani.nikula@intel.com>
On Tue, Feb 04, 2020 at 03:42:24PM +0200, Jani Nikula wrote:
> Pair the irq install and uninstall in the same layer. There are no
> functional changes in the happy day scenario. The cleanup paths are
> currently a mess though.
>
> Note that modeset probe pre-irq + post-irq install are matched by
> modeset driver remove pre-irq + post-irq uninstall, together, but not
> independently. They are not symmetric pairs.
>
> v2: don't add a new probe failure point here
>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
> drivers/gpu/drm/i915/i915_drv.c | 40 ++++++++++++++++++++++-----------
> 1 file changed, 27 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 2ef4b8fc5f4c..1243638506bc 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -272,7 +272,8 @@ intel_teardown_mchbar(struct drm_i915_private *dev_priv)
> release_resource(&dev_priv->mch_res);
> }
>
> -static int i915_driver_modeset_probe(struct drm_i915_private *i915)
> +/* part #1: call before irq install */
> +static int i915_driver_modeset_probe_noirq(struct drm_i915_private *i915)
> {
> int ret;
>
> @@ -296,15 +297,22 @@ static int i915_driver_modeset_probe(struct drm_i915_private *i915)
>
> intel_csr_ucode_init(i915);
>
> - ret = intel_irq_install(i915);
> - if (ret)
> - goto cleanup_csr;
> + return 0;
> +
> +out:
> + return ret;
> +}
> +
> +/* part #2: call after irq install */
> +static int i915_driver_modeset_probe(struct drm_i915_private *i915)
> +{
> + int ret;
>
> /* Important: The output setup functions called by modeset_init need
> * working irqs for e.g. gmbus and dp aux transfers. */
> ret = intel_modeset_init(i915);
> if (ret)
> - goto cleanup_irq;
> + goto out;
>
> ret = i915_gem_init(i915);
> if (ret)
> @@ -331,16 +339,10 @@ static int i915_driver_modeset_probe(struct drm_i915_private *i915)
> i915_gem_driver_remove(i915);
> i915_gem_driver_release(i915);
> cleanup_modeset:
> + /* FIXME */
> intel_modeset_driver_remove(i915);
> intel_irq_uninstall(i915);
> intel_modeset_driver_remove_noirq(i915);
> - goto cleanup_csr;
> -cleanup_irq:
> - intel_irq_uninstall(i915);
> -cleanup_csr:
> - intel_csr_ucode_fini(i915);
> - intel_power_domains_driver_remove(i915);
> - intel_vga_unregister(i915);
> out:
> return ret;
> }
> @@ -1541,10 +1543,18 @@ int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
> if (ret < 0)
> goto out_cleanup_mmio;
>
> - ret = i915_driver_modeset_probe(i915);
> + ret = i915_driver_modeset_probe_noirq(i915);
> if (ret < 0)
> goto out_cleanup_hw;
>
> + ret = intel_irq_install(i915);
> + if (ret)
> + goto out_cleanup_modeset;
> +
> + ret = i915_driver_modeset_probe(i915);
> + if (ret < 0)
> + goto out_cleanup_irq;
> +
> i915_driver_register(i915);
>
> enable_rpm_wakeref_asserts(&i915->runtime_pm);
> @@ -1553,6 +1563,10 @@ int i915_driver_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
>
> return 0;
>
> +out_cleanup_irq:
> + intel_irq_uninstall(i915);
> +out_cleanup_modeset:
> + /* FIXME */
Waiting for a mysterious cleanup_noirq() I guess.
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> out_cleanup_hw:
> i915_driver_hw_remove(i915);
> intel_memory_regions_driver_release(i915);
> --
> 2.20.1
--
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2020-02-04 14:55 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-04 13:42 [Intel-gfx] [PATCH 0/9] drm/i915: modeset probe/remove cleanup, again Jani Nikula
2020-02-04 13:42 ` [Intel-gfx] [PATCH 1/9] drm/i915: register vga switcheroo later, unregister earlier Jani Nikula
2020-02-04 13:42 ` [Intel-gfx] [PATCH 2/9] drm/i915: switch i915_driver_probe() to use i915 local variable Jani Nikula
2020-02-04 13:42 ` [Intel-gfx] [PATCH 3/9] drm/i915: split intel_modeset_driver_remove() to pre/post irq uninstall Jani Nikula
2020-02-04 14:46 ` Ville Syrjälä
2020-02-04 13:42 ` [Intel-gfx] [PATCH 4/9] drm/i915: split i915_driver_modeset_remove() " Jani Nikula
2020-02-04 14:49 ` Ville Syrjälä
2020-02-04 13:42 ` [Intel-gfx] [PATCH 5/9] drm/i915: split i915_driver_modeset_probe() to pre/post irq install Jani Nikula
2020-02-04 14:53 ` Ville Syrjälä [this message]
2020-02-04 13:42 ` [Intel-gfx] [PATCH 6/9] drm/i915: split intel_modeset_init() " Jani Nikula
2020-02-04 14:59 ` Ville Syrjälä
2020-02-04 13:42 ` [Intel-gfx] [PATCH 7/9] drm/i915: split intel_modeset_init() pre/post gem init Jani Nikula
2020-02-04 15:05 ` Ville Syrjälä
2020-02-04 13:42 ` [Intel-gfx] [PATCH 8/9] drm/i915: move more display related probe/remove stuff to display Jani Nikula
2020-02-04 15:11 ` Ville Syrjälä
2020-02-04 13:42 ` [Intel-gfx] [PATCH 9/9] drm/i915: remove the now redundant i915_driver_modeset_* call layer Jani Nikula
2020-02-04 15:16 ` Ville Syrjälä
2020-02-05 1:42 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: modeset probe/remove cleanup, again Patchwork
2020-02-05 2:05 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
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=20200204145341.GU13686@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@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