All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Rob Clark <robdclark@gmail.com>
Cc: "Darren Etheridge" <detheridge@ti.com>,
	"Guido Martínez" <guido@vanguardiasur.com.ar>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	linux-omap <linux-omap@vger.kernel.org>,
	"Daniel Vetter" <daniel.vetter@ffwll.ch>,
	"Russell King" <linux@arm.linux.org.uk>,
	"Ezequiel García" <ezequiel@vanguardiasur.com.ar>,
	"Daniel Mack" <zonque@gmail.com>
Subject: Re: [PATCH/RESEND 0/9] drm: tilcdc driver fixes
Date: Tue, 8 Jul 2014 12:03:30 +0200	[thread overview]
Message-ID: <20140708100330.GU17271@phenom.ffwll.local> (raw)
In-Reply-To: <CAF6AEGvp+A7eKWXf8uBoqXHb0Dtnt_Wz_dgFZ7Ua=UaD7yKBDw@mail.gmail.com>

On Sat, Jun 28, 2014 at 06:51:15AM -0400, Rob Clark wrote:
> On Fri, Jun 27, 2014 at 6:08 PM, Darren Etheridge <detheridge@ti.com> wrote:
> > Guido,
> >
> >
> > On 06/17/2014 09:17 AM, Guido Martínez wrote:
> >>
> >> The tilcdc driver could be compiled as a module, but was severely broken
> >> and could not be used as such. This patchset attempts to fix the issues
> >> preventing a proper load/unload of the module.
> >>
> >> Issues included dangling sysfs nodes, dangling devices, memory leaks and
> >> a double kfree.
> >>
> >> It now seems to be working ok. We have tested this by loading and
> >> unloading the driver repeteadly, with both panel and slave connectors
> >> and found no flaws.
> >>
> >> There is still one warning left on tilcdc_crtc_destroy, caused by
> >> destroying the connector while still in an ON status. We don't know why
> >> this happens or why it's an issue, so we did not fix it.
> >>
> >
> > Yes I see what you mean, it triggers the WARN_ON in tilcdc_crtc_destroy
> > because DRM_MODE_DPMS_ON is still set.  This WARN_ON does make some sense
> > because DPMS_OFF would have the effect of turning off clocks and putting the
> > monitor to sleep which seems logical considering we have torn down the
> > display.  Adding a tilcdc_crtc_dpms(DPMS_OFF) right before the WARN_ON
> > confirms this, but it seems strange that this hasn't happened automatically
> > (+ Russell doesn't need to do it in his Armada driver) - so I suspect there
> > is a better way.
> 
> tbh, I'm not entirely sure offhand why drm_mode_config_cleanup()
> doesn't remove the fb's first (which should have the effect of
> shutting down any lit crtc/encoder/connector)..  that would seem like
> the sensible way to shut down..

All userspace fbs should be cleared already before going into the driver
unload. Which only leaves you with driver internal fbs (usually just one
for fbdev emulation). It's the driver's job to clean that up explicitly.
Then you can call mode_config_cleanup and the WARN_ON in there is a really
nice space leak check.

If we'd unconditionally clean up all fbs we'd have trouble with
driver-private embedded fbs and their refcounting and would loose the
space leak check.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: daniel@ffwll.ch (Daniel Vetter)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH/RESEND 0/9] drm: tilcdc driver fixes
Date: Tue, 8 Jul 2014 12:03:30 +0200	[thread overview]
Message-ID: <20140708100330.GU17271@phenom.ffwll.local> (raw)
In-Reply-To: <CAF6AEGvp+A7eKWXf8uBoqXHb0Dtnt_Wz_dgFZ7Ua=UaD7yKBDw@mail.gmail.com>

On Sat, Jun 28, 2014 at 06:51:15AM -0400, Rob Clark wrote:
> On Fri, Jun 27, 2014 at 6:08 PM, Darren Etheridge <detheridge@ti.com> wrote:
> > Guido,
> >
> >
> > On 06/17/2014 09:17 AM, Guido Mart?nez wrote:
> >>
> >> The tilcdc driver could be compiled as a module, but was severely broken
> >> and could not be used as such. This patchset attempts to fix the issues
> >> preventing a proper load/unload of the module.
> >>
> >> Issues included dangling sysfs nodes, dangling devices, memory leaks and
> >> a double kfree.
> >>
> >> It now seems to be working ok. We have tested this by loading and
> >> unloading the driver repeteadly, with both panel and slave connectors
> >> and found no flaws.
> >>
> >> There is still one warning left on tilcdc_crtc_destroy, caused by
> >> destroying the connector while still in an ON status. We don't know why
> >> this happens or why it's an issue, so we did not fix it.
> >>
> >
> > Yes I see what you mean, it triggers the WARN_ON in tilcdc_crtc_destroy
> > because DRM_MODE_DPMS_ON is still set.  This WARN_ON does make some sense
> > because DPMS_OFF would have the effect of turning off clocks and putting the
> > monitor to sleep which seems logical considering we have torn down the
> > display.  Adding a tilcdc_crtc_dpms(DPMS_OFF) right before the WARN_ON
> > confirms this, but it seems strange that this hasn't happened automatically
> > (+ Russell doesn't need to do it in his Armada driver) - so I suspect there
> > is a better way.
> 
> tbh, I'm not entirely sure offhand why drm_mode_config_cleanup()
> doesn't remove the fb's first (which should have the effect of
> shutting down any lit crtc/encoder/connector)..  that would seem like
> the sensible way to shut down..

All userspace fbs should be cleared already before going into the driver
unload. Which only leaves you with driver internal fbs (usually just one
for fbdev emulation). It's the driver's job to clean that up explicitly.
Then you can call mode_config_cleanup and the WARN_ON in there is a really
nice space leak check.

If we'd unconditionally clean up all fbs we'd have trouble with
driver-private embedded fbs and their refcounting and would loose the
space leak check.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

  reply	other threads:[~2014-07-08 10:03 UTC|newest]

Thread overview: 76+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-07  3:01 [PATCH 0/9] tilcdc driver fixes Guido Martínez
2014-06-07  3:02 ` [PATCH 1/9] drm/i2c: tda998x: move drm_i2c_encoder_destroy call Guido Martínez
2014-06-07  3:02 ` [PATCH 2/9] drm/tilcdc: panel: fix dangling sysfs connector node Guido Martínez
2014-06-07  3:02 ` [PATCH 3/9] drm/tilcdc: slave: " Guido Martínez
2014-06-07  3:02 ` [PATCH 4/9] drm/tilcdc: tfp410: " Guido Martínez
2014-06-07  3:02 ` [PATCH 5/9] drm/tilcdc: panel: fix leak when unloading the module Guido Martínez
2014-06-07  3:02 ` [PATCH 6/9] drm/tilcdc: fix release order on exit Guido Martínez
2014-06-07  3:02 ` [PATCH 7/9] drm/tilcdc: fix double kfree Guido Martínez
2014-06-07  3:02 ` [PATCH 8/9] drm/tilcdc: remove submodule destroy calls Guido Martínez
2014-06-07  3:02 ` [PATCH 9/9] drm/tilcdc: replace late_initcall with module_init Guido Martínez
2014-06-17 14:17 ` [PATCH/RESEND 0/9] drm: tilcdc driver fixes Guido Martínez
2014-06-17 14:17   ` Guido Martínez
2014-06-17 14:17   ` [PATCH/RESEND 1/9] drm/i2c: tda998x: move drm_i2c_encoder_destroy call Guido Martínez
2014-06-17 14:17     ` Guido Martínez
2014-06-24 16:38     ` Russell King - ARM Linux
2014-06-24 16:38       ` Russell King - ARM Linux
2014-06-25  3:55       ` Guido Martínez
2014-06-25  3:55         ` Guido Martínez
2014-06-17 14:17   ` [PATCH/RESEND 2/9] drm/tilcdc: panel: fix dangling sysfs connector node Guido Martínez
2014-06-17 14:17     ` Guido Martínez
2014-06-17 14:17   ` [PATCH/RESEND 3/9] drm/tilcdc: slave: " Guido Martínez
2014-06-17 14:17     ` Guido Martínez
2014-06-17 14:17   ` [PATCH/RESEND 4/9] drm/tilcdc: tfp410: " Guido Martínez
2014-06-17 14:17     ` Guido Martínez
2014-06-17 14:17   ` [PATCH/RESEND 5/9] drm/tilcdc: panel: fix leak when unloading the module Guido Martínez
2014-06-17 14:17     ` Guido Martínez
2014-06-17 14:17   ` [PATCH/RESEND 6/9] drm/tilcdc: fix release order on exit Guido Martínez
2014-06-17 14:17     ` Guido Martínez
2014-06-17 14:17   ` [PATCH/RESEND 7/9] drm/tilcdc: fix double kfree Guido Martínez
2014-06-17 14:17     ` Guido Martínez
2014-06-17 14:17   ` [PATCH/RESEND 8/9] drm/tilcdc: remove submodule destroy calls Guido Martínez
2014-06-17 14:17     ` Guido Martínez
2014-06-24 22:06     ` Darren Etheridge
2014-06-24 22:06       ` Darren Etheridge
2014-06-25  3:53       ` Guido Martínez
2014-06-25  3:53         ` Guido Martínez
2014-06-25 14:53       ` Ezequiel García
2014-06-25 14:53         ` Ezequiel García
2014-06-17 14:17   ` [PATCH/RESEND 9/9] drm/tilcdc: replace late_initcall with module_init Guido Martínez
2014-06-17 14:17     ` Guido Martínez
2014-06-24 22:04     ` Darren Etheridge
2014-06-24 22:04       ` Darren Etheridge
2014-06-25 13:00       ` Russell King - ARM Linux
2014-06-25 13:00         ` Russell King - ARM Linux
2014-06-25 13:13         ` Russell King - ARM Linux
2014-06-25 13:13           ` Russell King - ARM Linux
2014-06-25 14:32         ` Ezequiel García
2014-06-25 14:32           ` Ezequiel García
2014-06-25 14:46           ` Russell King - ARM Linux
2014-06-25 14:46             ` Russell King - ARM Linux
2014-06-25 15:48             ` Ezequiel García
2014-06-25 15:48               ` Ezequiel García
2014-06-19 13:41   ` [PATCH/RESEND 0/9] drm: tilcdc driver fixes Darren Etheridge
2014-06-19 13:41     ` Darren Etheridge
2014-06-19 16:25     ` Guido Martínez
2014-06-19 16:25       ` Guido Martínez
2014-06-24  0:26   ` Guido Martínez
2014-06-24  0:26     ` Guido Martínez
2014-06-27 22:08   ` Darren Etheridge
2014-06-27 22:08     ` Darren Etheridge
2014-06-28 10:51     ` Rob Clark
2014-06-28 10:51       ` Rob Clark
2014-07-08 10:03       ` Daniel Vetter [this message]
2014-07-08 10:03         ` Daniel Vetter
2014-07-01 23:39     ` Guido Martínez
2014-07-01 23:39       ` Guido Martínez
2014-07-02  2:31       ` Darren Etheridge
2014-07-02  2:31         ` Darren Etheridge
2014-07-02  4:08         ` Dave Airlie
2014-07-02  4:08           ` Dave Airlie
2014-07-02 20:38           ` Ezequiel García
2014-07-02 20:38             ` Ezequiel García
2014-07-08  1:32             ` Dave Airlie
2014-07-08  1:32               ` Dave Airlie
2014-07-01 23:52   ` Guido Martínez
2014-07-01 23:52     ` Guido Martínez

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=20140708100330.GU17271@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=daniel.vetter@ffwll.ch \
    --cc=detheridge@ti.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=ezequiel@vanguardiasur.com.ar \
    --cc=guido@vanguardiasur.com.ar \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=robdclark@gmail.com \
    --cc=zonque@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.