From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joerg Roedel Subject: Re: [PATCH 1/1] iommu/tegra: smmu: Fix unsleepable memory allocation Date: Mon, 2 Jul 2012 11:57:47 +0200 Message-ID: <20120702095747.GB2558@amd.com> References: <20120627.124628.673793050413876363.hdoyu@nvidia.com> <1340790841-23349-1-git-send-email-hdoyu@nvidia.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Return-path: Content-Disposition: inline In-Reply-To: <1340790841-23349-1-git-send-email-hdoyu-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> Sender: linux-tegra-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Hiroshi DOYU Cc: iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-tegra@vger.kernel.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 > Reported-by: Chris Wright > --- > 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