linux-tegra.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joerg Roedel <joerg.roedel-5C7GfCeVMHo@public.gmane.org>
To: Hiroshi DOYU <hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 1/1] iommu/tegra: smmu: Fix unsleepable memory allocation
Date: Mon, 2 Jul 2012 11:57:47 +0200	[thread overview]
Message-ID: <20120702095747.GB2558@amd.com> (raw)
In-Reply-To: <1340790841-23349-1-git-send-email-hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

On Wed, Jun 27, 2012 at 12:54:01PM +0300, Hiroshi DOYU wrote:
> allo_pdir() is called in smmu_iommu_domain_init() with spin_lock
> held. memory allocations in it have to be atomic/unsleepable.
> 
> Signed-off-by: Hiroshi DOYU <hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> Reported-by: Chris Wright <chrisw-69jw2NvuJkxg9hUCZPvPmw@public.gmane.org>
> ---
>  drivers/iommu/tegra-smmu.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iommu/tegra-smmu.c b/drivers/iommu/tegra-smmu.c
> index ecd6790..3f3d09d 100644
> --- a/drivers/iommu/tegra-smmu.c
> +++ b/drivers/iommu/tegra-smmu.c
> @@ -550,13 +550,13 @@ static int alloc_pdir(struct smmu_as *as)
>  		return 0;
>  
>  	as->pte_count = devm_kzalloc(smmu->dev,
> -		     sizeof(as->pte_count[0]) * SMMU_PDIR_COUNT, GFP_KERNEL);
> +		     sizeof(as->pte_count[0]) * SMMU_PDIR_COUNT, GFP_ATOMIC);
>  	if (!as->pte_count) {
>  		dev_err(smmu->dev,
>  			"failed to allocate smmu_device PTE cunters\n");
>  		return -ENOMEM;
>  	}
> -	as->pdir_page = alloc_page(GFP_KERNEL | __GFP_DMA);
> +	as->pdir_page = alloc_page(GFP_ATOMIC | __GFP_DMA);
>  	if (!as->pdir_page) {
>  		dev_err(smmu->dev,
>  			"failed to allocate smmu_device page directory\n");

Okay, I queued this one for v3.5. It is small enough so that it counts
as a fix. The other two patches are 3.6 stuff.


	Joerg

-- 
AMD Operating System Research Center

Advanced Micro Devices GmbH Einsteinring 24 85609 Dornach
General Managers: Alberto Bozzo
Registration: Dornach, Landkr. Muenchen; Registerger. Muenchen, HRB Nr. 43632

  parent reply	other threads:[~2012-07-02  9:57 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-26 18:15 tegra alloc_pdir Chris Wright
     [not found] ` <20120626181555.GW15796-JyIX8gxvWYPr2PDY2+4mTGD2FQJk+8+b@public.gmane.org>
2012-06-27  9:46   ` Hiroshi Doyu
     [not found]     ` <20120627.124628.673793050413876363.hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-06-27  9:54       ` [PATCH 1/1] iommu/tegra: smmu: Fix unsleepable memory allocation Hiroshi DOYU
     [not found]         ` <1340790841-23349-1-git-send-email-hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-06-27 15:57           ` Chris Wright
2012-06-27 16:59           ` Stephen Warren
     [not found]             ` <4FEB3C04.6040606-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-06-28 10:42               ` Hiroshi Doyu
     [not found]                 ` <20120628134202.2102f715496a3b980b43f3b0-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-06-28 10:51                   ` [v2 1/1] iommu/tegra: smmu: Fix unsleepable memory allocation at alloc_pdir() Hiroshi DOYU
     [not found]                     ` <1340880707-6934-1-git-send-email-hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-06-28 16:57                       ` Stephen Warren
     [not found]                         ` <4FEC8CEE.1000401-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-06-28 18:35                           ` Hiroshi Doyu
     [not found]                             ` <20120628.213554.1189327754979133382.hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-06-28 19:08                               ` Stephen Warren
     [not found]                                 ` <4FECAB9C.9040809-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-06-28 19:19                                   ` Hiroshi Doyu
     [not found]                                     ` <20120628.221945.1306825810095951985.hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-06-29  6:15                                       ` [v3 1/2] iommu/tegra: smmu: Remove unnecessary sanity check " Hiroshi DOYU
     [not found]                                         ` <1340950527-16482-1-git-send-email-hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-06-29  6:15                                           ` [v3 2/2] iommu/tegra: smmu: Fix unsleepable memory allocation " Hiroshi DOYU
2012-06-29 15:34                                           ` [v3 1/2] iommu/tegra: smmu: Remove unnecessary sanity check " Stephen Warren
2012-07-02  9:57           ` Joerg Roedel [this message]
     [not found]             ` <20120702095747.GB2558-5C7GfCeVMHo@public.gmane.org>
2012-07-02 10:13               ` [PATCH 1/1] iommu/tegra: smmu: Fix unsleepable memory allocation Hiroshi Doyu
     [not found]                 ` <20120702.131326.685361720133451299.hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-07-02 10:19                   ` Hiroshi Doyu
     [not found]                     ` <20120702.131903.1053229523265080291.hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-07-02 10:42                       ` joerg.roedel-5C7GfCeVMHo
     [not found]                         ` <20120702104231.GD2558-5C7GfCeVMHo@public.gmane.org>
2012-07-02 11:14                           ` Hiroshi Doyu

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=20120702095747.GB2558@amd.com \
    --to=joerg.roedel-5c7gfcevmho@public.gmane.org \
    --cc=hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    --cc=iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).