From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161051AbcFOOBz (ORCPT ); Wed, 15 Jun 2016 10:01:55 -0400 Received: from 8bytes.org ([81.169.241.247]:36363 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753435AbcFOOBw (ORCPT ); Wed, 15 Jun 2016 10:01:52 -0400 Date: Wed, 15 Jun 2016 15:59:50 +0200 From: "Cc: Joerg Roedel" To: Mike Galbraith Cc: LKML , Sagar Arun Kamble Subject: Re: [patch] drivers/iommu: Fix iova DEBUG_PREEMPT splat Message-ID: <20160615135950.GM26566@8bytes.org> References: <1465822596.4006.2.camel@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1465822596.4006.2.camel@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 13, 2016 at 02:56:36PM +0200, Mike Galbraith wrote: > > Signed-off-by: Mike Galbraith > Cc: Joerg Roedel > --- > drivers/iommu/iova.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > --- a/drivers/iommu/iova.c > +++ b/drivers/iommu/iova.c > @@ -749,8 +749,9 @@ static bool __iova_rcache_insert(struct > bool can_insert = false; > unsigned long flags; > > + local_irq_save(flags); > cpu_rcache = this_cpu_ptr(rcache->cpu_rcaches); > - spin_lock_irqsave(&cpu_rcache->lock, flags); > + spin_lock(&cpu_rcache->lock); > > if (!iova_magazine_full(cpu_rcache->loaded)) { > can_insert = true; > @@ -812,8 +813,9 @@ static unsigned long __iova_rcache_get(s > bool has_pfn = false; > unsigned long flags; > > + local_irq_save(flags); > cpu_rcache = this_cpu_ptr(rcache->cpu_rcaches); > - spin_lock_irqsave(&cpu_rcache->lock, flags); > + spin_lock(&cpu_rcache->lock); > > if (!iova_magazine_empty(cpu_rcache->loaded)) { > has_pfn = true; >>From an earlier patch submitted by Sagar (Cc'ed) I think the right fix is to just make the code use get_cpu_ptr/put_cpu_ptr instead of this_cpu_ptr. Joerg