From patchwork Fri Mar 25 19:07:46 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hiremath, Vaibhav" X-Patchwork-Id: 6209 Return-path: Envelope-to: mchehab@pedra Delivery-date: Fri, 25 Mar 2011 16:08:18 -0300 Received: from mchehab by pedra with local (Exim 4.72) (envelope-from ) id 1Q3CMs-0007uH-5s for mchehab@pedra; Fri, 25 Mar 2011 16:08:18 -0300 Received: from casper.infradead.org [85.118.1.10] by pedra with IMAP (fetchmail-6.3.17) for (single-drop); Fri, 25 Mar 2011 16:08:18 -0300 (BRT) Received: from vger.kernel.org ([209.132.180.67]) by casper.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1Q3CMn-0007Iy-DX; Fri, 25 Mar 2011 19:08:13 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752687Ab1CYTIK (ORCPT + 1 other); Fri, 25 Mar 2011 15:08:10 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:43259 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752359Ab1CYTIJ convert rfc822-to-8bit (ORCPT ); Fri, 25 Mar 2011 15:08:09 -0400 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id p2PJ7x4T000882 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 25 Mar 2011 14:08:01 -0500 Received: from dbde70.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id p2PJ7tOb024839; Sat, 26 Mar 2011 00:37:56 +0530 (IST) Received: from dbde02.ent.ti.com ([172.24.170.145]) by dbde70.ent.ti.com ([172.24.170.148]) with mapi; Sat, 26 Mar 2011 00:37:51 +0530 From: "Hiremath, Vaibhav" To: Sakari Ailus , "linux-media@vger.kernel.org" CC: "laurent.pinchart@ideasonboard.com" , "david.cohen@nokia.com" , "hiroshi.doyu@nokia.com" Date: Sat, 26 Mar 2011 00:37:46 +0530 Subject: RE: [PATCH 1/4] omap iommu: Check existence of arch_iommu Thread-Topic: [PATCH 1/4] omap iommu: Check existence of arch_iommu Thread-Index: Acvq/0+RkGzJ9Gz7TiSfJN3oMJr4/gAIAMrw Message-ID: <19F8576C6E063C45BE387C64729E739404E21D57E2@dbde02.ent.ti.com> References: <4D8CB106.7030608@maxwell.research.nokia.com> <1301066005-7882-1-git-send-email-sakari.ailus@maxwell.research.nokia.com> In-Reply-To: <1301066005-7882-1-git-send-email-sakari.ailus@maxwell.research.nokia.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Sender: > -----Original Message----- > From: linux-media-owner@vger.kernel.org [mailto:linux-media- > owner@vger.kernel.org] On Behalf Of Sakari Ailus > Sent: Friday, March 25, 2011 8:43 PM > To: linux-media@vger.kernel.org > Cc: laurent.pinchart@ideasonboard.com; david.cohen@nokia.com; > hiroshi.doyu@nokia.com > Subject: [PATCH 1/4] omap iommu: Check existence of arch_iommu > > Check that the arch_iommu has been installed before trying to use it. This > will lead to kernel oops if the arch_iommu isn't there. > > Signed-off-by: Sakari Ailus > --- > arch/arm/plat-omap/iommu.c | 3 +++ > 1 files changed, 3 insertions(+), 0 deletions(-) > > diff --git a/arch/arm/plat-omap/iommu.c b/arch/arm/plat-omap/iommu.c > index b1107c0..f0fea0b 100644 > --- a/arch/arm/plat-omap/iommu.c > +++ b/arch/arm/plat-omap/iommu.c > @@ -104,6 +104,9 @@ static int iommu_enable(struct iommu *obj) > if (!obj) > return -EINVAL; > > + if (!arch_iommu) > + return -ENOENT; > + [Hiremath, Vaibhav] Similar patch has already been submitted and accepted in community, not sure which baseline you are using. Please refer to below commit - commit ef4815ab1ff10d642c21ef92faa6544934bc78d1 Author: Martin Hostettler Date: Thu Feb 24 12:51:31 2011 -0800 omap: iommu: Gracefully fail iommu_enable if no arch_iommu is registered In a modular build of the iommu code it's possible that the arch iommu code isn't loaded when trying to enable the iommu. Instead of blindly following a null pointer return -NODEV in that case. Signed-off-by: Martin Hostettler Signed-off-by: Tony Lindgren Thanks, Vaibhav > clk_enable(obj->clk); > > err = arch_iommu->enable(obj); > -- > 1.7.2.3 > > -- > 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 --- 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 diff --git a/arch/arm/plat-omap/iommu.c b/arch/arm/plat-omap/iommu.c index b1107c0..3d8f55e 100644 --- a/arch/arm/plat-omap/iommu.c +++ b/arch/arm/plat-omap/iommu.c @@ -104,6 +104,9 @@ static int iommu_enable(struct iommu *obj) if (!obj) return -EINVAL; + if (!arch_iommu) + return -ENODEV; + clk_enable(obj->clk); err = arch_iommu->enable(obj);