From patchwork Tue Nov 8 15:23:59 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 8353 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1RNnXD-0000xf-8v; Tue, 08 Nov 2011 16:24:23 +0100 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-4) with esmtp id 1RNnX1-0007AX-AZ; Tue, 08 Nov 2011 16:24:11 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756011Ab1KHPYH (ORCPT + 3 others); Tue, 8 Nov 2011 10:24:07 -0500 Received: from na3sys009aog118.obsmtp.com ([74.125.149.244]:48787 "EHLO na3sys009aog118.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755273Ab1KHPYE (ORCPT ); Tue, 8 Nov 2011 10:24:04 -0500 Received: from mail-bw0-f41.google.com ([209.85.214.41]) (using TLSv1) by na3sys009aob118.postini.com ([74.125.148.12]) with SMTP; Tue, 08 Nov 2011 07:24:04 PST Received: by mail-bw0-f41.google.com with SMTP id s6so612809bka.0 for ; Tue, 08 Nov 2011 07:24:03 -0800 (PST) Received: by 10.204.150.205 with SMTP id z13mr23110730bkv.67.1320765842697; Tue, 08 Nov 2011 07:24:02 -0800 (PST) Received: from [192.168.100.101] (a62-248-128-208.elisa-laajakaista.fi. [62.248.128.208]) by mx.google.com with ESMTPS id z13sm1889583bkw.8.2011.11.08.07.24.00 (version=SSLv3 cipher=OTHER); Tue, 08 Nov 2011 07:24:01 -0800 (PST) Subject: RE: [PATCH] omap_vout: fix section mismatch From: Tomi Valkeinen To: "Hiremath, Vaibhav" Cc: "linux-media@vger.kernel.org" , "Taneja, Archit" In-Reply-To: <79CD15C6BA57404B839C016229A409A802693C@DBDE01.ent.ti.com> References: <1320745628-20603-1-git-send-email-tomi.valkeinen@ti.com> <79CD15C6BA57404B839C016229A409A802693C@DBDE01.ent.ti.com> Date: Tue, 08 Nov 2011 17:23:59 +0200 Message-ID: <1320765839.1907.55.camel@deskari> Mime-Version: 1.0 X-Mailer: Evolution 2.32.2 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2011.11.8.150915 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MULTIPLE_RCPTS 0.1, MSGID_ADDED_BY_MTA 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_4000_4999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, INVALID_MSGID_NO_FQDN 0, __ANY_URI 0, __BOUNCE_CHALLENGE_SUBJ 0, __BOUNCE_NDR_SUBJ_EXEMPT 0, __CP_MEDIA_BODY 0, __CP_URI_IN_BODY 0, __CT 0, __CTYPE_HAS_BOUNDARY 0, __CTYPE_MULTIPART 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __MIME_VERSION 0, __MULTIPLE_RCPTS_CC_X2 0, __SANE_MSGID 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __URI_NO_WWW 0, __URI_NS ' X-LSpam-Score: -4.2 (----) X-LSpam-Report: No, score=-4.2 required=5.0 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, T_TVD_MIME_EPI=0.01 autolearn=ham On Tue, 2011-11-08 at 15:15 +0000, Hiremath, Vaibhav wrote: > I am not sure whether you had tested it, but kernel doesn't boot with V4L2 display enabled in defconfig. I have patch to fix this, will submit shortly - > > > diff --git a/drivers/media/video/omap/omap_vout.c b/drivers/media/video/omap/omap_vout.c > index 9c5c19f..9031c39 100644 > --- a/drivers/media/video/omap/omap_vout.c > +++ b/drivers/media/video/omap/omap_vout.c > @@ -2140,6 +2140,8 @@ static int omap_vout_remove(struct platform_device *pdev) > omap_vout_cleanup_device(vid_dev->vouts[k]); > > for (k = 0; k < vid_dev->num_displays; k++) { > + if (!vid_dev->displays[k] && !vid_dev->displays[k]->driver) > + continue; > if (vid_dev->displays[k]->state != OMAP_DSS_DISPLAY_DISABLED) > vid_dev->displays[k]->driver->disable(vid_dev->displays[k]); > > @@ -2226,7 +2228,7 @@ static int __init omap_vout_probe(struct platform_device *pdev) > for (i = 0; i < vid_dev->num_displays; i++) { > struct omap_dss_device *display = vid_dev->displays[i]; > > - if (display->driver->update) > + if (display && display->driver && display->driver->update) > display->driver->update(display, 0, 0, > display->panel.timings.x_res, > display->panel.timings.y_res); > > > Reason being, > > If you have enabled certain device and fail to enable in defconfig, this will lead to kernel crash in omap_vout driver. Hmm, I didn't quite understand the explanation. But now that you mention this, I did have the following patch in one of my work trees, but I seem to have forgotten to post it. It fixes the case where a display device defined in the board file doesn't have a driver loaded. I guess this is the same problem you mention? Is my patch fixing the same problem? Tomi diff --git a/drivers/media/video/omap/omap_vout.c b/drivers/media/video/omap/omap_vout.c index 30d8896..18fe02f 100644 --- a/drivers/media/video/omap/omap_vout.c +++ b/drivers/media/video/omap/omap_vout.c @@ -2159,6 +2159,14 @@ static int __init omap_vout_probe(struct platform_device *pdev) vid_dev->num_displays = 0; for_each_dss_dev(dssdev) { omap_dss_get_device(dssdev); + + if (!dssdev->driver) { + dev_warn(&pdev->dev, "no driver for display: %s\n", + dssdev->name); + omap_dss_put_device(dssdev); + continue; + } + vid_dev->displays[vid_dev->num_displays++] = dssdev; }