Message ID | 20090703161140.845950e8.ospite@studenti.unina.it (mailing list archive) |
---|---|
State | Superseded, archived |
Headers |
Return-path: <linux-media-owner@vger.kernel.org> Envelope-to: mchehab@infradead.org Delivery-date: Fri, 03 Jul 2009 14:12:52 +0000 Received: from bombadil.infradead.org [18.85.46.34] by pedra.chehab.org with IMAP (fetchmail-6.3.6) for <mchehab@localhost> (single-drop); Fri, 03 Jul 2009 11:15:07 -0300 (BRT) Received: from vger.kernel.org ([209.132.176.167]) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1MMjVU-0003TI-42; Fri, 03 Jul 2009 14:12:52 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752704AbZGCOMq (ORCPT <rfc822; kmpark@infradead.org> + 1 other); Fri, 3 Jul 2009 10:12:46 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753806AbZGCOMq (ORCPT <rfc822;linux-media-outgoing>); Fri, 3 Jul 2009 10:12:46 -0400 Received: from smtp-out26.alice.it ([85.33.2.26]:2932 "EHLO smtp-out26.alice.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752704AbZGCOMp (ORCPT <rfc822; linux-media@vger.kernel.org>); Fri, 3 Jul 2009 10:12:45 -0400 Received: from fbcmmo06.fbc.local ([192.168.184.137]) by smtp-out26.alice.it with Microsoft SMTPSVC(6.0.3790.3959); Fri, 3 Jul 2009 16:12:47 +0200 Received: from FBCMCL01B07.fbc.local ([192.168.171.45]) by fbcmmo06.fbc.local with Microsoft SMTPSVC(6.0.3790.3959); Fri, 3 Jul 2009 16:11:49 +0200 Received: from badebec ([79.3.186.72]) by FBCMCL01B07.fbc.local with Microsoft SMTPSVC(6.0.3790.3959); Fri, 3 Jul 2009 16:11:47 +0200 Date: Fri, 3 Jul 2009 16:11:40 +0200 From: Antonio Ospite <ospite@studenti.unina.it> To: linux-media@vger.kernel.org Cc: Guennadi Liakhovetski <kernel@pengutronix.de>, Robert Jarzmik <robert.jarzmik@free.fr> Subject: Re: pxa_camera: Oops in pxa_camera_probe. Message-Id: <20090703161140.845950e8.ospite@studenti.unina.it> In-Reply-To: <20090701204325.2a277884.ospite@studenti.unina.it> References: <20090701204325.2a277884.ospite@studenti.unina.it> X-Mailer: Sylpheed 2.6.0 (GTK+ 2.16.3; i686-pc-linux-gnu) X-Face: z*RaLf`X<@C75u6Ig9}{oW$H; 1_\2t5)({*|jhM<pyWR#k60!#=#>/Vb; ]yA5<GWI5`6u&+ ; 6b'@y|8w"wB; 4/e!7wYYrcqdJFY,~%Gk_4]cq$Ei/7<j&N3ah(m`ku?pX.&+~:_/wC~dwn^)MizBG !pE^+iDQQ1yC6^,)YDKkxDd!T>\I~93>J<_`<4)A{':UrE Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="PGP-SHA1"; boundary="Signature=_Fri__3_Jul_2009_16_11_40_+0200_V6crx/DzZYRXOhpK" X-OriginalArrivalTime: 03 Jul 2009 14:11:47.0128 (UTC) FILETIME=[33785B80:01C9FBE8] Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: <linux-media.vger.kernel.org> X-Mailing-List: linux-media@vger.kernel.org |
Commit Message
Antonio Ospite
July 3, 2009, 2:11 p.m. UTC
On Wed, 1 Jul 2009 20:43:25 +0200 Antonio Ospite <ospite@studenti.unina.it> wrote: > Hi, > > I get this with pxa-camera in mainline linux (from today). > I haven't touched my board code which used to work in 2.6.30 > I think I've tracked down the cause. The board code is triggering a bug in pxa_camera. The same should apply to mioa701 as well. > Linux video capture interface: v2.00 > Unable to handle kernel NULL pointer dereference at virtual address 00000060 > pgd = c0004000 > [00000060] *pgd=00000000 > Internal error: Oops: f5 [#1] PREEMPT > Modules linked in: > CPU: 0 Tainted: G W (2.6.31-rc1-ezxdev #1) > PC is at dev_driver_string+0x0/0x38 > LR is at pxa_camera_probe+0x144/0x428 The offending dev_driver_str() here is the one in the dev_warn() call in mclk_get_divisor(). This is what is happening: in struct pxacamera_platform_data I have: .mclk_10khz = 5000, which makes the > test in mclk_get_divisor() succeed calling dev_warn to report that the clock has been limited, but pcdev->soc_host.dev is still uninitialized at this time. I could lower the value in my platform data and avoid the bug, but it would be good to have this fixed ASAP anyway. The attached rough patch fixes the problem, but you will surely come out with a better one :) Thanks, Antonio
Comments
On Fri, 3 Jul 2009, Antonio Ospite wrote: > On Wed, 1 Jul 2009 20:43:25 +0200 > Antonio Ospite <ospite@studenti.unina.it> wrote: > > > Hi, > > > > I get this with pxa-camera in mainline linux (from today). > > I haven't touched my board code which used to work in 2.6.30 > > > > I think I've tracked down the cause. The board code is triggering a > bug in pxa_camera. The same should apply to mioa701 as well. > > > Linux video capture interface: v2.00 > > Unable to handle kernel NULL pointer dereference at virtual address 00000060 > > pgd = c0004000 > > [00000060] *pgd=00000000 > > Internal error: Oops: f5 [#1] PREEMPT > > Modules linked in: > > CPU: 0 Tainted: G W (2.6.31-rc1-ezxdev #1) > > PC is at dev_driver_string+0x0/0x38 > > LR is at pxa_camera_probe+0x144/0x428 > > The offending dev_driver_str() here is the one in the dev_warn() call in > mclk_get_divisor(). > > This is what is happening: in struct pxacamera_platform_data I have: > .mclk_10khz = 5000, > > which makes the > test in mclk_get_divisor() succeed calling dev_warn > to report that the clock has been limited, but pcdev->soc_host.dev is > still uninitialized at this time. > > I could lower the value in my platform data and avoid the bug, but it > would be good to have this fixed ASAP anyway. > > The attached rough patch fixes the problem, but you will surely come > out with a better one :) Why should I? Your patch seems correct to me so far, thanks. I'll push it for 2.6.31. Please, next time inline your patch as described in Documentation/SubmittingPatches. Thanks Guennadi --- Guennadi Liakhovetski, Ph.D. Freelance Open-Source Software Developer http://www.open-technology.de/ -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Fri, 3 Jul 2009 22:03:27 +0200 (CEST) Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote: > On Fri, 3 Jul 2009, Antonio Ospite wrote: > > > > Linux video capture interface: v2.00 > > > Unable to handle kernel NULL pointer dereference at virtual address 00000060 > > > pgd = c0004000 > > > [00000060] *pgd=00000000 > > > Internal error: Oops: f5 [#1] PREEMPT > > > Modules linked in: > > > CPU: 0 Tainted: G W (2.6.31-rc1-ezxdev #1) > > > PC is at dev_driver_string+0x0/0x38 > > > LR is at pxa_camera_probe+0x144/0x428 > > > > The offending dev_driver_str() here is the one in the dev_warn() call in > > mclk_get_divisor(). > > > > This is what is happening: in struct pxacamera_platform_data I have: > > .mclk_10khz = 5000, > > > > which makes the > test in mclk_get_divisor() succeed calling dev_warn > > to report that the clock has been limited, but pcdev->soc_host.dev is > > still uninitialized at this time. > > > > I could lower the value in my platform data and avoid the bug, but it > > would be good to have this fixed ASAP anyway. > > > > The attached rough patch fixes the problem, but you will surely come > > out with a better one :) > > Why should I? Your patch seems correct to me so far, thanks. I'll push it > for 2.6.31. Please, next time inline your patch as described in > Documentation/SubmittingPatches. > Well, it should be correct, I just thought it could be considered unpretty with the pcdev->soc_host initializations scattered here and there, that's what I was referring to. But, if this is ok to you, it's ok to me too :) Ciao, Antonio
Antonio Ospite <ospite@studenti.unina.it> writes: > On Fri, 3 Jul 2009 22:03:27 +0200 (CEST) > Guennadi Liakhovetski <g.liakhovetski@gmx.de> wrote: > >> On Fri, 3 Jul 2009, Antonio Ospite wrote: >> >> > > Linux video capture interface: v2.00 >> > > Unable to handle kernel NULL pointer dereference at virtual address 00000060 >> > > pgd = c0004000 >> > > [00000060] *pgd=00000000 >> > > Internal error: Oops: f5 [#1] PREEMPT >> > > Modules linked in: >> > > CPU: 0 Tainted: G W (2.6.31-rc1-ezxdev #1) >> > > PC is at dev_driver_string+0x0/0x38 >> > > LR is at pxa_camera_probe+0x144/0x428 >> > >> > The offending dev_driver_str() here is the one in the dev_warn() call in >> > mclk_get_divisor(). >> > >> > This is what is happening: in struct pxacamera_platform_data I have: >> > .mclk_10khz = 5000, >> > >> > which makes the > test in mclk_get_divisor() succeed calling dev_warn >> > to report that the clock has been limited, but pcdev->soc_host.dev is >> > still uninitialized at this time. Antonio, Would you check [1] and see if your stack does correspond to the one I reported some time ago ? As this is fresh in your memory, you'll be far quicker that me. Ah, and by the way, I like your patch too, agree that mioa701 is touched, and I think it should go upstream. Cheers. -- Robert [1] http://osdir.com/ml/linux-media/2009-04/msg00874.html -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Sat, 04 Jul 2009 21:35:22 +0200 Robert Jarzmik <robert.jarzmik@free.fr> wrote: > >> > The offending dev_driver_str() here is the one in the dev_warn() call in > >> > mclk_get_divisor(). > >> > > >> > This is what is happening: in struct pxacamera_platform_data I have: > >> > .mclk_10khz = 5000, > >> > > >> > which makes the > test in mclk_get_divisor() succeed calling dev_warn > >> > to report that the clock has been limited, but pcdev->soc_host.dev is > >> > still uninitialized at this time. > > Antonio, > > Would you check [1] and see if your stack does correspond to the one I reported > some time ago ? As this is fresh in your memory, you'll be far quicker that me. > ... > [1] http://osdir.com/ml/linux-media/2009-04/msg00874.html Yes, I think that is it. The offsets are different of course but the call stack is pretty much the same. Regards, Antonio
mclk_get_divisor uses pcdev->soc_host.dev, make sure it is initialized. Signed-off-by: Antonio Ospite <ospite@studenti.unina.it> diff --git a/drivers/media/video/pxa_camera.c b/drivers/media/video/pxa_camera.c index 46e0d8a..e048d25 100644 --- a/drivers/media/video/pxa_camera.c +++ b/drivers/media/video/pxa_camera.c @@ -1579,6 +1579,7 @@ static int __devinit pxa_camera_probe(struct platform_device *pdev) pcdev->mclk = 20000000; } + pcdev->soc_host.dev = &pdev->dev; pcdev->mclk_divisor = mclk_get_divisor(pcdev); INIT_LIST_HEAD(&pcdev->capture); @@ -1644,7 +1645,6 @@ static int __devinit pxa_camera_probe(struct platform_device *pdev) pcdev->soc_host.drv_name = PXA_CAM_DRV_NAME; pcdev->soc_host.ops = &pxa_soc_camera_host_ops; pcdev->soc_host.priv = pcdev; - pcdev->soc_host.dev = &pdev->dev; pcdev->soc_host.nr = pdev->id; err = soc_camera_host_register(&pcdev->soc_host);