From: Joerg Roedel <joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org>
To: Laurent Pinchart
<laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org>
Cc: Katsuya MATSUBARA <matsu-AlSX/UN32fvPDbFq/vQRIQ@public.gmane.org>,
Hideki EIRAKU <hdk-AlSX/UN32fvPDbFq/vQRIQ@public.gmane.org>,
linux-sh-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Paul Mundt <lethal-M7jkjyW5wf5g9hUCZPvPmw@public.gmane.org>,
Magnus Damm <magnus.damm-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
Simon Horman <horms-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org>,
Russell King <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>,
Damian Hobson-Garcia
<dhobsong-AlSX/UN32fvPDbFq/vQRIQ@public.gmane.org>,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Subject: Re: [PATCH v5 1/4] iommu/shmobile: Add iommu driver for Renesas IPMMU modules
Date: Thu, 10 Jan 2013 19:32:37 +0100 [thread overview]
Message-ID: <20130110183236.GG25591@8bytes.org> (raw)
In-Reply-To: <1586668.MmWlG9A4gq@avalon>
Hi,
On Mon, Jan 07, 2013 at 07:11:58PM +0100, Laurent Pinchart wrote:
> > + l2index = (iova >> 12) & 0xff;
> > + spin_lock(&sh_domain->map_lock);
> > + ret = l2alloc(sh_domain, l1index);
>
> l2alloc calls dma_pool_alloc(GFP_KERNEL), that not safe in a non-sleepable
> context. Do we need a spinlock here, or could a mutex do ?
iommu_map should work in any context, so a mutex will not work. Also the
memory allocations in that path should be GFP_ATOMIC instead of
GFP_KERNEL.
Other than that this driver looks good from an IOMMU-API perspective.
Please Cc me on future versions of this patch-set directly.
Thanks,
Joerg
WARNING: multiple messages have this Message-ID (diff)
From: Joerg Roedel <joro@8bytes.org>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v5 1/4] iommu/shmobile: Add iommu driver for Renesas IPMMU modules
Date: Thu, 10 Jan 2013 18:32:37 +0000 [thread overview]
Message-ID: <20130110183236.GG25591@8bytes.org> (raw)
In-Reply-To: <1586668.MmWlG9A4gq@avalon>
Hi,
On Mon, Jan 07, 2013 at 07:11:58PM +0100, Laurent Pinchart wrote:
> > + l2index = (iova >> 12) & 0xff;
> > + spin_lock(&sh_domain->map_lock);
> > + ret = l2alloc(sh_domain, l1index);
>
> l2alloc calls dma_pool_alloc(GFP_KERNEL), that not safe in a non-sleepable
> context. Do we need a spinlock here, or could a mutex do ?
iommu_map should work in any context, so a mutex will not work. Also the
memory allocations in that path should be GFP_ATOMIC instead of
GFP_KERNEL.
Other than that this driver looks good from an IOMMU-API perspective.
Please Cc me on future versions of this patch-set directly.
Thanks,
Joerg
WARNING: multiple messages have this Message-ID (diff)
From: joro@8bytes.org (Joerg Roedel)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 1/4] iommu/shmobile: Add iommu driver for Renesas IPMMU modules
Date: Thu, 10 Jan 2013 19:32:37 +0100 [thread overview]
Message-ID: <20130110183236.GG25591@8bytes.org> (raw)
In-Reply-To: <1586668.MmWlG9A4gq@avalon>
Hi,
On Mon, Jan 07, 2013 at 07:11:58PM +0100, Laurent Pinchart wrote:
> > + l2index = (iova >> 12) & 0xff;
> > + spin_lock(&sh_domain->map_lock);
> > + ret = l2alloc(sh_domain, l1index);
>
> l2alloc calls dma_pool_alloc(GFP_KERNEL), that not safe in a non-sleepable
> context. Do we need a spinlock here, or could a mutex do ?
iommu_map should work in any context, so a mutex will not work. Also the
memory allocations in that path should be GFP_ATOMIC instead of
GFP_KERNEL.
Other than that this driver looks good from an IOMMU-API perspective.
Please Cc me on future versions of this patch-set directly.
Thanks,
Joerg
WARNING: multiple messages have this Message-ID (diff)
From: Joerg Roedel <joro@8bytes.org>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Hideki EIRAKU <hdk@igel.co.jp>,
Katsuya MATSUBARA <matsu@igel.co.jp>,
Russell King <linux@arm.linux.org.uk>,
Simon Horman <horms@verge.net.au>,
linux-sh@vger.kernel.org, Magnus Damm <magnus.damm@gmail.com>,
linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org,
Paul Mundt <lethal@linux-sh.org>,
Damian Hobson-Garcia <dhobsong@igel.co.jp>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v5 1/4] iommu/shmobile: Add iommu driver for Renesas IPMMU modules
Date: Thu, 10 Jan 2013 19:32:37 +0100 [thread overview]
Message-ID: <20130110183236.GG25591@8bytes.org> (raw)
In-Reply-To: <1586668.MmWlG9A4gq@avalon>
Hi,
On Mon, Jan 07, 2013 at 07:11:58PM +0100, Laurent Pinchart wrote:
> > + l2index = (iova >> 12) & 0xff;
> > + spin_lock(&sh_domain->map_lock);
> > + ret = l2alloc(sh_domain, l1index);
>
> l2alloc calls dma_pool_alloc(GFP_KERNEL), that not safe in a non-sleepable
> context. Do we need a spinlock here, or could a mutex do ?
iommu_map should work in any context, so a mutex will not work. Also the
memory allocations in that path should be GFP_ATOMIC instead of
GFP_KERNEL.
Other than that this driver looks good from an IOMMU-API perspective.
Please Cc me on future versions of this patch-set directly.
Thanks,
Joerg
next prev parent reply other threads:[~2013-01-10 18:32 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-25 11:19 [PATCH v5 0/4] Renesas IPMMU driver for sh7372, sh73a0 and r8a7740 Hideki EIRAKU
2012-12-25 11:19 ` Hideki EIRAKU
2012-12-25 11:19 ` Hideki EIRAKU
2012-12-25 11:19 ` [PATCH v5 1/4] iommu/shmobile: Add iommu driver for Renesas IPMMU modules Hideki EIRAKU
2012-12-25 11:19 ` Hideki EIRAKU
2012-12-25 11:19 ` Hideki EIRAKU
2013-01-07 18:11 ` Laurent Pinchart
2013-01-07 18:11 ` Laurent Pinchart
2013-01-07 18:11 ` Laurent Pinchart
2013-01-10 18:32 ` Joerg Roedel [this message]
2013-01-10 18:32 ` Joerg Roedel
2013-01-10 18:32 ` Joerg Roedel
2013-01-10 18:32 ` Joerg Roedel
2012-12-25 11:19 ` [PATCH v5 2/4] ARM: mach-shmobile: sh7372: Add IPMMU device Hideki EIRAKU
2012-12-25 11:19 ` Hideki EIRAKU
2012-12-25 11:19 ` Hideki EIRAKU
2012-12-25 11:19 ` [PATCH v5 3/4] ARM: mach-shmobile: sh73a0: " Hideki EIRAKU
2012-12-25 11:19 ` Hideki EIRAKU
2012-12-25 11:19 ` Hideki EIRAKU
2012-12-25 11:19 ` [PATCH v5 4/4] ARM: mach-shmobile: r8a7740: " Hideki EIRAKU
2012-12-25 11:19 ` Hideki EIRAKU
2012-12-25 11:19 ` Hideki EIRAKU
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=20130110183236.GG25591@8bytes.org \
--to=joro-zlv9swrftaidnm+yrofe0a@public.gmane.org \
--cc=dhobsong-AlSX/UN32fvPDbFq/vQRIQ@public.gmane.org \
--cc=hdk-AlSX/UN32fvPDbFq/vQRIQ@public.gmane.org \
--cc=horms-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org \
--cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=laurent.pinchart-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org \
--cc=lethal-M7jkjyW5wf5g9hUCZPvPmw@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org \
--cc=linux-sh-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=magnus.damm-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=matsu-AlSX/UN32fvPDbFq/vQRIQ@public.gmane.org \
/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.