From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>,
dri-devel@lists.freedesktop.org,
"Kirill A . Shutemov" <kirill@shutemov.name>,
Carlos Santa <carlos.santa@intel.com>,
stable@vger.kernel.org
Subject: Re: [PATCH 2/4] drm/fb-helper: Keep references for the current set of used connectors
Date: Wed, 26 Oct 2016 15:34:06 +0300 [thread overview]
Message-ID: <20161026123406.GB4617@intel.com> (raw)
In-Reply-To: <20161026095224.GM10167@nuc-i3427.alporthouse.com>
On Wed, Oct 26, 2016 at 10:52:24AM +0100, Chris Wilson wrote:
> On Wed, Oct 26, 2016 at 12:05:53PM +0300, ville.syrjala@linux.intel.com wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > The fbdev helper code keeps around two lists of connectors. One is the
> > list of all connectors it could use, and that list already holds
> > references for all the connectors. However the other list, or rather
> > lists, is the one actively being used. That list is tracked per-crtc
> > and currently doesn't hold any extra references. Let's grab those
> > extra references to avoid oopsing when the connector vanishes. The
> > list of all possible connectors should get updated when the hpd happens,
> > but the list of actively used connectors would not get updated until
> > the next time the fb-helper picks through the set of possible connectors.
> > And so we need to hang on to the connectors until that time.
> >
> > Cc: stable@vger.kernel.org
> > Cc: Carlos Santa <carlos.santa@intel.com>
> > Cc: Kirill A. Shutemov <kirill@shutemov.name>
> > Tested-by: Carlos Santa <carlos.santa@intel.com>
> > Tested-by: Kirill A. Shutemov <kirill@shutemov.name>
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97666
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> > drivers/gpu/drm/drm_fb_helper.c | 25 ++++++++++++++++++-------
> > 1 file changed, 18 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> > index db469d12d195..9ee1dacf97b8 100644
> > --- a/drivers/gpu/drm/drm_fb_helper.c
> > +++ b/drivers/gpu/drm/drm_fb_helper.c
> > @@ -2090,7 +2090,6 @@ static void drm_setup_crtcs(struct drm_fb_helper *fb_helper)
> > struct drm_fb_helper_crtc **crtcs;
> > struct drm_display_mode **modes;
> > struct drm_fb_offset *offsets;
> > - struct drm_mode_set *modeset;
> > bool *enabled;
> > int width, height;
> > int i;
> > @@ -2139,7 +2138,14 @@ static void drm_setup_crtcs(struct drm_fb_helper *fb_helper)
> > /* need to set the modesets up here for use later */
> > /* fill out the connector<->crtc mappings into the modesets */
> > for (i = 0; i < fb_helper->crtc_count; i++) {
> > - modeset = &fb_helper->crtc_info[i].mode_set;
> > + struct drm_mode_set *modeset = &fb_helper->crtc_info[i].mode_set;
> > + int j;
> > +
> > + for (j = 0; j < modeset->num_connectors; j++) {
> > + drm_connector_unreference(modeset->connectors[j]);
> > + modeset->connectors[j] = NULL;
> > + }
> > +
>
> Don't we also need a similar cleanup loop in drm_fb_helper_crtc_free()?
Sounds likely. I'll go have a look.
--
Ville Syrjälä
Intel OTC
WARNING: multiple messages have this Message-ID (diff)
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>,
dri-devel@lists.freedesktop.org,
"Kirill A . Shutemov" <kirill@shutemov.name>,
Carlos Santa <carlos.santa@intel.com>,
stable@vger.kernel.org
Subject: Re: [PATCH 2/4] drm/fb-helper: Keep references for the current set of used connectors
Date: Wed, 26 Oct 2016 15:34:06 +0300 [thread overview]
Message-ID: <20161026123406.GB4617@intel.com> (raw)
In-Reply-To: <20161026095224.GM10167@nuc-i3427.alporthouse.com>
On Wed, Oct 26, 2016 at 10:52:24AM +0100, Chris Wilson wrote:
> On Wed, Oct 26, 2016 at 12:05:53PM +0300, ville.syrjala@linux.intel.com wrote:
> > From: Ville Syrj�l� <ville.syrjala@linux.intel.com>
> >
> > The fbdev helper code keeps around two lists of connectors. One is the
> > list of all connectors it could use, and that list already holds
> > references for all the connectors. However the other list, or rather
> > lists, is the one actively being used. That list is tracked per-crtc
> > and currently doesn't hold any extra references. Let's grab those
> > extra references to avoid oopsing when the connector vanishes. The
> > list of all possible connectors should get updated when the hpd happens,
> > but the list of actively used connectors would not get updated until
> > the next time the fb-helper picks through the set of possible connectors.
> > And so we need to hang on to the connectors until that time.
> >
> > Cc: stable@vger.kernel.org
> > Cc: Carlos Santa <carlos.santa@intel.com>
> > Cc: Kirill A. Shutemov <kirill@shutemov.name>
> > Tested-by: Carlos Santa <carlos.santa@intel.com>
> > Tested-by: Kirill A. Shutemov <kirill@shutemov.name>
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97666
> > Signed-off-by: Ville Syrj�l� <ville.syrjala@linux.intel.com>
> > ---
> > drivers/gpu/drm/drm_fb_helper.c | 25 ++++++++++++++++++-------
> > 1 file changed, 18 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> > index db469d12d195..9ee1dacf97b8 100644
> > --- a/drivers/gpu/drm/drm_fb_helper.c
> > +++ b/drivers/gpu/drm/drm_fb_helper.c
> > @@ -2090,7 +2090,6 @@ static void drm_setup_crtcs(struct drm_fb_helper *fb_helper)
> > struct drm_fb_helper_crtc **crtcs;
> > struct drm_display_mode **modes;
> > struct drm_fb_offset *offsets;
> > - struct drm_mode_set *modeset;
> > bool *enabled;
> > int width, height;
> > int i;
> > @@ -2139,7 +2138,14 @@ static void drm_setup_crtcs(struct drm_fb_helper *fb_helper)
> > /* need to set the modesets up here for use later */
> > /* fill out the connector<->crtc mappings into the modesets */
> > for (i = 0; i < fb_helper->crtc_count; i++) {
> > - modeset = &fb_helper->crtc_info[i].mode_set;
> > + struct drm_mode_set *modeset = &fb_helper->crtc_info[i].mode_set;
> > + int j;
> > +
> > + for (j = 0; j < modeset->num_connectors; j++) {
> > + drm_connector_unreference(modeset->connectors[j]);
> > + modeset->connectors[j] = NULL;
> > + }
> > +
>
> Don't we also need a similar cleanup loop in drm_fb_helper_crtc_free()?
Sounds likely. I'll go have a look.
--
Ville Syrj�l�
Intel OTC
next prev parent reply other threads:[~2016-10-26 12:34 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-26 9:05 [PATCH 0/4] drm: Fix MST oopses in fbdev restore ville.syrjala
2016-10-26 9:05 ` [PATCH 1/4] drm/fb-helper: Fix connector ref leak on error ville.syrjala
2016-10-26 9:48 ` Chris Wilson
2016-10-26 9:48 ` Chris Wilson
2016-10-26 9:05 ` [PATCH 2/4] drm/fb-helper: Keep references for the current set of used connectors ville.syrjala
2016-10-26 9:05 ` ville.syrjala
2016-10-26 9:52 ` Chris Wilson
2016-10-26 9:52 ` Chris Wilson
2016-10-26 12:34 ` Ville Syrjälä [this message]
2016-10-26 12:34 ` Ville Syrjälä
2016-10-26 13:31 ` [PATCH v2 " ville.syrjala
2016-10-26 13:54 ` Chris Wilson
2016-10-26 13:54 ` Chris Wilson
2016-10-26 14:11 ` Ville Syrjälä
2016-10-26 14:11 ` Ville Syrjälä
2016-10-26 14:41 ` [PATCH v3 " ville.syrjala
2016-10-26 14:41 ` ville.syrjala
2016-10-26 9:05 ` [PATCH 3/4] drm/dp/mst: Clear port->pdt when tearing down the i2c adapter ville.syrjala
2016-10-26 9:05 ` ville.syrjala
2016-10-26 12:53 ` Daniel Vetter
2016-10-26 12:53 ` Daniel Vetter
2016-10-26 13:02 ` Ville Syrjälä
2016-10-26 13:02 ` Ville Syrjälä
2016-10-26 13:30 ` [PATCH v2 " ville.syrjala
2016-10-26 13:30 ` ville.syrjala
2016-10-26 13:35 ` Ville Syrjälä
2016-10-26 13:35 ` Ville Syrjälä
2016-10-26 14:02 ` Daniel Vetter
2016-10-26 14:02 ` Daniel Vetter
2016-10-26 16:54 ` Daniel Vetter
2016-10-26 16:54 ` Daniel Vetter
2016-10-26 14:46 ` [PATCH v3 " ville.syrjala
2016-10-26 14:46 ` ville.syrjala
2016-10-26 9:05 ` [PATCH 4/4] drm/dp/mst: Check peer device type before attempting EDID read ville.syrjala
2016-10-26 12:55 ` Daniel Vetter
2016-10-26 12:55 ` Daniel Vetter
2016-10-26 13:05 ` Ville Syrjälä
2016-10-26 13:05 ` Ville Syrjälä
2016-10-26 18:31 ` Carlos Santa
2016-10-26 18:31 ` Carlos Santa
2016-10-26 18:45 ` Ville Syrjälä
2016-10-26 18:45 ` Ville Syrjälä
2016-10-26 13:38 ` [PATCH 0/4] drm: Fix MST oopses in fbdev restore Ville Syrjälä
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=20161026123406.GB4617@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=carlos.santa@intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=dri-devel@lists.freedesktop.org \
--cc=kirill@shutemov.name \
--cc=stable@vger.kernel.org \
/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.