From: "james qian wang (Arm Technology China)" <james.qian.wang@arm.com>
To: Ayan Halder <Ayan.Halder@arm.com>
Cc: Liviu Dudau <Liviu.Dudau@arm.com>,
Brian Starkey <Brian.Starkey@arm.com>,
"malidp@foss.arm.com" <malidp@foss.arm.com>,
"airlied@linux.ie" <airlied@linux.ie>,
"daniel@ffwll.ch" <daniel@ffwll.ch>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
nd <nd@arm.com>, Mihail Atanassov <Mihail.Atanassov@arm.com>
Subject: Re: [PATCH v2] drm/komeda: Reordered the komeda's de-init functions
Date: Wed, 28 Aug 2019 15:58:12 +0000 [thread overview]
Message-ID: <20190828155806.GA7020@jamwan02-TSP300> (raw)
In-Reply-To: <20190828145945.15904-1-ayan.halder@arm.com>
On Wed, Aug 28, 2019 at 03:00:19PM +0000, Ayan Halder wrote:
> From: Ayan Halder <Ayan.Halder@arm.com>
>
> The de-init routine should be doing the following in order:-
> 1. Unregister the drm device
> 2. Shut down the crtcs - failing to do this might cause a connector leakage
> See the 'commit 109c4d18e574 ("drm/arm/malidp: Ensure that the crtcs are
> shutdown before removing any encoder/connector")'
> 3. Disable the interrupts
> 4. Unbind the components
> 5. Free up DRM mode_config info
>
> Changes from v1:-
> 1. Re-ordered the header files inclusion
> 2. Rebased on top of the latest drm-misc-fixes
>
> Signed-off-by: Ayan Kumar Halder <ayan.halder@arm.com>
> Reviewed-by: Mihail Atanassov <mihail.atanassov@arm.com>
Looks good to me.
Reviewed-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com>
> ---
> .../gpu/drm/arm/display/komeda/komeda_kms.c | 23 ++++++++++++-------
> 1 file changed, 15 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c
> index 1f0e3f4e8d74..69d9e26c60c8 100644
> --- a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c
> +++ b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c
> @@ -14,8 +14,8 @@
> #include <drm/drm_gem_cma_helper.h>
> #include <drm/drm_gem_framebuffer_helper.h>
> #include <drm/drm_irq.h>
> -#include <drm/drm_vblank.h>
> #include <drm/drm_probe_helper.h>
> +#include <drm/drm_vblank.h>
>
> #include "komeda_dev.h"
> #include "komeda_framebuffer.h"
> @@ -306,11 +306,11 @@ struct komeda_kms_dev *komeda_kms_attach(struct komeda_dev *mdev)
> komeda_kms_irq_handler, IRQF_SHARED,
> drm->driver->name, drm);
> if (err)
> - goto cleanup_mode_config;
> + goto free_component_binding;
>
> err = mdev->funcs->enable_irq(mdev);
> if (err)
> - goto cleanup_mode_config;
> + goto free_component_binding;
>
> drm->irq_enabled = true;
>
> @@ -318,15 +318,21 @@ struct komeda_kms_dev *komeda_kms_attach(struct komeda_dev *mdev)
>
> err = drm_dev_register(drm, 0);
> if (err)
> - goto cleanup_mode_config;
> + goto free_interrupts;
>
> return kms;
>
> -cleanup_mode_config:
> +free_interrupts:
> drm_kms_helper_poll_fini(drm);
> drm->irq_enabled = false;
> + mdev->funcs->disable_irq(mdev);
> +free_component_binding:
> + component_unbind_all(mdev->dev, drm);
> +cleanup_mode_config:
> drm_mode_config_cleanup(drm);
> komeda_kms_cleanup_private_objs(kms);
> + drm->dev_private = NULL;
> + drm_dev_put(drm);
> free_kms:
> kfree(kms);
> return ERR_PTR(err);
> @@ -337,13 +343,14 @@ void komeda_kms_detach(struct komeda_kms_dev *kms)
> struct drm_device *drm = &kms->base;
> struct komeda_dev *mdev = drm->dev_private;
>
> - drm->irq_enabled = false;
> - mdev->funcs->disable_irq(mdev);
> drm_dev_unregister(drm);
> drm_kms_helper_poll_fini(drm);
> + drm_atomic_helper_shutdown(drm);
> + drm->irq_enabled = false;
> + mdev->funcs->disable_irq(mdev);
> component_unbind_all(mdev->dev, drm);
> - komeda_kms_cleanup_private_objs(kms);
> drm_mode_config_cleanup(drm);
> + komeda_kms_cleanup_private_objs(kms);
> drm->dev_private = NULL;
> drm_dev_put(drm);
> }
> --
> 2.21.0
next prev parent reply other threads:[~2019-08-28 15:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-28 15:00 [PATCH v2] drm/komeda: Reordered the komeda's de-init functions Ayan Halder
2019-08-28 15:58 ` james qian wang (Arm Technology China) [this message]
2019-08-28 17:35 ` Ayan Halder
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=20190828155806.GA7020@jamwan02-TSP300 \
--to=james.qian.wang@arm.com \
--cc=Ayan.Halder@arm.com \
--cc=Brian.Starkey@arm.com \
--cc=Liviu.Dudau@arm.com \
--cc=Mihail.Atanassov@arm.com \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=malidp@foss.arm.com \
--cc=nd@arm.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