From mboxrd@z Thu Jan 1 00:00:00 1970 From: linux@arm.linux.org.uk (Russell King - ARM Linux) Date: Fri, 14 Jun 2013 15:42:51 +0100 Subject: [PATCH RFC 2/8] DRM: Armada: Add Armada DRM driver In-Reply-To: References: <20130612134845.GQ18614@n2100.arm.linux.org.uk> <20130612164914.GT18614@n2100.arm.linux.org.uk> <20130612170512.GU18614@n2100.arm.linux.org.uk> <20130612194021.GX18614@n2100.arm.linux.org.uk> <20130612230057.GY18614@n2100.arm.linux.org.uk> <20130613111903.GA18614@n2100.arm.linux.org.uk> <20130613115016.GB18614@n2100.arm.linux.org.uk> <20130613130339.GD18614@n2100.arm.linux.org.uk> Message-ID: <20130614144251.GN18614@n2100.arm.linux.org.uk> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Fri, Jun 14, 2013 at 04:23:22PM +0200, Daniel Vetter wrote: > On Thu, Jun 13, 2013 at 3:03 PM, Russell King - ARM Linux > wrote: > > There's a bigger issue here - if it's possible for drm_crtc_helper_set_config() > > to be called with set->fb set but set->mode NULL, then we overwrite > > set->fb to NULL. Again, that results in a lost reference. > > > > For the time being, I'm using this patch, which solves my dropped > > refcount problem, and marks the other possible dropped reference. > > Either that check needs to be removed or it needs to properly drop > > the refcount on the fb before 'losing' the reference to it. > > Scrap my other mail, I see now where the leaking happens. One of them > is interface abuse which is now fixed (and i915 has a bunch of BUG_ONs > to enforce them). The other one is indeed a real case that eluded me > when I've done the refcountification for drm_framebuffers. I'll hack > up some patches, since this seems to be a good excuse to port some of > the i915 modeset improvements back to the crtc helpers. If you're happy with the patch I supplied, that's probably the minimal fix which should go to stable kernels (I'm using 3.9 here) - this also counts as a "user visible bug". It's something I've tripped over which causes exhausts memory and can prevent the X server from starting up. If you want me to package the patch up with a commit message and sign-off... From mboxrd@z Thu Jan 1 00:00:00 1970 From: Russell King - ARM Linux Subject: Re: [PATCH RFC 2/8] DRM: Armada: Add Armada DRM driver Date: Fri, 14 Jun 2013 15:42:51 +0100 Message-ID: <20130614144251.GN18614@n2100.arm.linux.org.uk> References: <20130612134845.GQ18614@n2100.arm.linux.org.uk> <20130612164914.GT18614@n2100.arm.linux.org.uk> <20130612170512.GU18614@n2100.arm.linux.org.uk> <20130612194021.GX18614@n2100.arm.linux.org.uk> <20130612230057.GY18614@n2100.arm.linux.org.uk> <20130613111903.GA18614@n2100.arm.linux.org.uk> <20130613115016.GB18614@n2100.arm.linux.org.uk> <20130613130339.GD18614@n2100.arm.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Daniel Vetter Cc: dri-devel , Rob Clark , Jason Cooper , "linux-arm-kernel@lists.infradead.org" , Sebastian Hesselbarth List-Id: dri-devel@lists.freedesktop.org On Fri, Jun 14, 2013 at 04:23:22PM +0200, Daniel Vetter wrote: > On Thu, Jun 13, 2013 at 3:03 PM, Russell King - ARM Linux > wrote: > > There's a bigger issue here - if it's possible for drm_crtc_helper_set_config() > > to be called with set->fb set but set->mode NULL, then we overwrite > > set->fb to NULL. Again, that results in a lost reference. > > > > For the time being, I'm using this patch, which solves my dropped > > refcount problem, and marks the other possible dropped reference. > > Either that check needs to be removed or it needs to properly drop > > the refcount on the fb before 'losing' the reference to it. > > Scrap my other mail, I see now where the leaking happens. One of them > is interface abuse which is now fixed (and i915 has a bunch of BUG_ONs > to enforce them). The other one is indeed a real case that eluded me > when I've done the refcountification for drm_framebuffers. I'll hack > up some patches, since this seems to be a good excuse to port some of > the i915 modeset improvements back to the crtc helpers. If you're happy with the patch I supplied, that's probably the minimal fix which should go to stable kernels (I'm using 3.9 here) - this also counts as a "user visible bug". It's something I've tripped over which causes exhausts memory and can prevent the X server from starting up. If you want me to package the patch up with a commit message and sign-off...