All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Hiremath, Vaibhav" <hvaibhav@ti.com>
To: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>,
	"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>
Cc: "laurent.pinchart@ideasonboard.com"
	<laurent.pinchart@ideasonboard.com>,
	"david.cohen@nokia.com" <david.cohen@nokia.com>,
	"hiroshi.doyu@nokia.com" <hiroshi.doyu@nokia.com>
Subject: RE: [PATCH 1/4] omap iommu: Check existence of arch_iommu
Date: Sat, 26 Mar 2011 00:37:46 +0530	[thread overview]
Message-ID: <19F8576C6E063C45BE387C64729E739404E21D57E2@dbde02.ent.ti.com> (raw)
In-Reply-To: <1301066005-7882-1-git-send-email-sakari.ailus@maxwell.research.nokia.com>

> -----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 <sakari.ailus@maxwell.research.nokia.com>
> ---
>  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@neutronstar.dyndns.org>
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@neutronstar.dyndns.org>
    Signed-off-by: Tony Lindgren <tony@atomide.com>

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@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2011-03-25 19:08 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-25 15:13 [PATCH 0/4] iommu: Prevent oops in iommu_get() and while arch_iommu is in use Sakari Ailus
2011-03-25 15:13 ` [PATCH 1/4] omap iommu: Check existence of arch_iommu Sakari Ailus
2011-03-25 15:19   ` Sakari Ailus
2011-03-25 19:07   ` Hiremath, Vaibhav [this message]
2011-03-27 17:04     ` Sakari Ailus
2011-03-25 15:13 ` [PATCH 2/4] omap iommu: Add module information to struct iommu_functions Sakari Ailus
2011-03-25 15:13 ` [PATCH 3/4] omap2 iommu: Set module information in omap2_iommu_ops Sakari Ailus
2011-03-25 15:13 ` [PATCH 4/4] omap iommu: Prevent iommu implementations from being unloaded while in use Sakari Ailus
2011-03-25 19:37 ` [PATCH 0/4] iommu: Prevent oops in iommu_get() and while arch_iommu is " Ramirez Luna, Omar
2011-03-27 17:27   ` Sakari Ailus
2011-03-28  1:42     ` Ramirez Luna, Omar
2011-03-28  9:20       ` David Cohen
2011-03-29 15:44       ` Laurent Pinchart
2011-03-28  9:02     ` David Cohen
2011-03-29 15:32   ` Laurent Pinchart
2011-03-30  8:16     ` Sakari Ailus
2011-03-30  9:37       ` Laurent Pinchart
2011-03-30 13:50         ` Sakari Ailus
2011-03-30 13:56           ` Laurent Pinchart
2011-03-30 15:50             ` David Cohen
2011-04-04 14:05               ` Laurent Pinchart
2011-04-05  9:03                 ` Sakari Ailus
2011-04-05 11:23                   ` Laurent Pinchart
2011-04-05 11:54                     ` David Cohen
2011-04-06  8:55                       ` Laurent Pinchart
2011-04-05 15:20                     ` Sakari Ailus
2011-09-24 13:44     ` Steve Sakoman
2011-09-26 16:19       ` Laurent Pinchart
2011-03-25 15:17 Sakari Ailus
2011-03-25 15:17 ` [PATCH 1/4] omap iommu: Check existence of arch_iommu Sakari Ailus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19F8576C6E063C45BE387C64729E739404E21D57E2@dbde02.ent.ti.com \
    --to=hvaibhav@ti.com \
    --cc=david.cohen@nokia.com \
    --cc=hiroshi.doyu@nokia.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=sakari.ailus@maxwell.research.nokia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.