From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tony Lindgren Subject: Re: [RFC][PATCH] omapfb: Condition mutex acquisition Date: Tue, 29 Sep 2009 17:53:10 -0700 Message-ID: <20090930005310.GI16865@atomide.com> References: <1254236004.23991.17.camel@tubuntu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mho-02-ewr.mailhop.org ([204.13.248.72]:57306 "EHLO mho-02-ewr.mailhop.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752080AbZI3AxJ (ORCPT ); Tue, 29 Sep 2009 20:53:09 -0400 Content-Disposition: inline In-Reply-To: <1254236004.23991.17.camel@tubuntu> Sender: linux-omap-owner@vger.kernel.org List-Id: linux-omap@vger.kernel.org To: Tomi Valkeinen Cc: "ext Aguirre Rodriguez, Sergio Alberto" , "Deak Imre (Nokia-D/Helsinki)" , "linux-omap@vger.kernel.org" * Tomi Valkeinen [090929 07:54]: > On Tue, 2009-09-29 at 16:34 +0200, ext Aguirre Rodriguez, Sergio Alberto > wrote: > > From: Tomi Valkeinen [tomi.valkeinen@nokia.com] > > Sent: Tuesday, September 29, 2009 9:22 AM > > > On Tue, 2009-09-29 at 16:14 +0200, ext Aguirre Rodriguez, Sergio Alberto > > > wrote: > > > > From: Sergio Aguirre > > > > > > > > Acquiring mutex before framebuffer registration doesn't make sense, > > > > As there's no danger of external access to the memory related fields. > > > > > > What problem does this patch solve? It makes the code more complex. > > > > > > > Tomi, > > > > Thanks for your time. > > > > The problem was that, during platform driver registration, > > this sequence was executed: > > > > -> omapfb_probe > > -> omapfb_do_probe > > -> planes_init > > -> fbinfo_init > > -> set_fb_fix > > ... > > -> register_framebuffer > > > > And then, inside that function, an attempt of acquiring a > > mutex failed, because it wasn't initialized before trying it: > > > > mutex_lock(&fbi->mm_lock); > > > > It is actually initialized later in omapfb_do_probe in register_framebuffer call. > > > > So, how is the best to solve this then? > > Oh, I wasn't implying that there's something wrong with the fix, I just > didn't know what it was fixing =). > > Looks like a valid fix to me. Tomi & Imre, do you want me to add this to the omap-fixes queue, or are you planning to send other fixes too? If you want me to add it, please reply with your ack. I'll added it into omap-fixes-testing branch for now so we can get the omaps booted. Regards, Tony