> -----Original Message----- > From: linux-media-owner@xxxxxxxxxxxxxxx [mailto:linux-media- > owner@xxxxxxxxxxxxxxx] On Behalf Of Sakari Ailus > Sent: Friday, March 25, 2011 8:43 PM > To: linux-media@xxxxxxxxxxxxxxx > Cc: laurent.pinchart@xxxxxxxxxxxxxxxx; david.cohen@xxxxxxxxx; > hiroshi.doyu@xxxxxxxxx > 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 <sakari.ailus@xxxxxxxxxxxxxxxxxxxxxxxxxx> > --- > 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 <martin@xxxxxxxxxxxxxxxxxxxxxx> 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 <martin@xxxxxxxxxxxxxxxxxxxxxx> Signed-off-by: Tony Lindgren <tony@xxxxxxxxxxx> 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); 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@xxxxxxxxxxxxxxx > 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@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html