From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753912AbdDKHuN (ORCPT ); Tue, 11 Apr 2017 03:50:13 -0400 Received: from mga01.intel.com ([192.55.52.88]:7753 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752733AbdDKHuM (ORCPT ); Tue, 11 Apr 2017 03:50:12 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,184,1488873600"; d="scan'208";a="247137839" Message-ID: <1491925807.2545.0.camel@intel.com> Subject: Re: [PATCH 1/1] nios2: implement flush_dcache_mmap_lock/unlock From: Ley Foon Tan To: Julien Beraud , linux-kernel@vger.kernel.org, nios2-dev@lists.rocketboards.org Date: Tue, 11 Apr 2017 23:50:07 +0800 In-Reply-To: <20170403111110.5442-1-julien.beraud@spectracom.orolia.com> References: <20170403111110.5442-1-julien.beraud@spectracom.orolia.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.18.5.2-0ubuntu3.1 Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id v3B7oJHi011011 On Mon, 2017-04-03 at 13:11 +0200, Julien Beraud wrote: > Use spin_lock/unlock_irq instead of doing nothing. This fixes > corruptions > of the vma_interval_tree causing the kernel to be stuck in an > infinite loop in vma_interval_tree_foreach. > > Signed-off-by: Julien Beraud > --- >  arch/nios2/include/asm/cacheflush.h | 6 ++++-- >  1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/arch/nios2/include/asm/cacheflush.h > b/arch/nios2/include/asm/cacheflush.h > index 52abba973dc2..55e383c173f7 100644 > --- a/arch/nios2/include/asm/cacheflush.h > +++ b/arch/nios2/include/asm/cacheflush.h > @@ -46,7 +46,9 @@ extern void copy_from_user_page(struct > vm_area_struct *vma, struct page *page, >  extern void flush_dcache_range(unsigned long start, unsigned long > end); >  extern void invalidate_dcache_range(unsigned long start, unsigned > long end); > > -#define flush_dcache_mmap_lock(mapping)                do { } while > (0) > -#define flush_dcache_mmap_unlock(mapping)      do { } while (0) > +#define flush_dcache_mmap_lock(mapping) \ > +       spin_lock_irq(&(mapping)->tree_lock) > +#define flush_dcache_mmap_unlock(mapping) \ > +       spin_unlock_irq(&(mapping)->tree_lock) > >  #endif /* _ASM_NIOS2_CACHEFLUSH_H */ > -- > 2.11.0 > Acked-by: Ley Foon Tan Regards Ley Foon