From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753279AbdHJQdV (ORCPT ); Thu, 10 Aug 2017 12:33:21 -0400 Received: from foss.arm.com ([217.140.101.70]:35054 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752524AbdHJQdU (ORCPT ); Thu, 10 Aug 2017 12:33:20 -0400 Subject: Re: [PATCH] arm64: fix pmem interface definition To: Arnd Bergmann , Catalin Marinas , Will Deacon Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20170810145253.2124019-1-arnd@arndb.de> From: Robin Murphy Message-ID: Date: Thu, 10 Aug 2017 17:33:17 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170810145253.2124019-1-arnd@arndb.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/08/17 15:52, Arnd Bergmann wrote: > Defining the two functions as 'static inline' and exporting them > leads to the interesting case where we can use the interface > from loadable modules, but not from built-in drivers, as shown > in this link failure: > > vers/nvdimm/claim.o: In function `nsio_rw_bytes': > claim.c:(.text+0x1b8): undefined reference to `arch_invalidate_pmem' > drivers/nvdimm/pmem.o: In function `pmem_dax_flush': > pmem.c:(.text+0x11c): undefined reference to `arch_wb_cache_pmem' > drivers/nvdimm/pmem.o: In function `pmem_make_request': > pmem.c:(.text+0x5a4): undefined reference to `arch_invalidate_pmem' > pmem.c:(.text+0x650): undefined reference to `arch_invalidate_pmem' > pmem.c:(.text+0x6d4): undefined reference to `arch_invalidate_pmem' > > This removes the bogus 'static inline'. Oops, yes, this was clearly a silly copy-paste error on my part. Acked-by: Robin Murphy > Fixes: d50e071fdaa3 ("arm64: Implement pmem API support") > Signed-off-by: Arnd Bergmann > --- > arch/arm64/mm/flush.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/arm64/mm/flush.c b/arch/arm64/mm/flush.c > index 280f90ff33a2..e36ed5087b5c 100644 > --- a/arch/arm64/mm/flush.c > +++ b/arch/arm64/mm/flush.c > @@ -85,7 +85,7 @@ EXPORT_SYMBOL(flush_dcache_page); > EXPORT_SYMBOL(flush_icache_range); > > #ifdef CONFIG_ARCH_HAS_PMEM_API > -static inline void arch_wb_cache_pmem(void *addr, size_t size) > +void arch_wb_cache_pmem(void *addr, size_t size) > { > /* Ensure order against any prior non-cacheable writes */ > dmb(osh); > @@ -93,7 +93,7 @@ static inline void arch_wb_cache_pmem(void *addr, size_t size) > } > EXPORT_SYMBOL_GPL(arch_wb_cache_pmem); > > -static inline void arch_invalidate_pmem(void *addr, size_t size) > +void arch_invalidate_pmem(void *addr, size_t size) > { > __inval_dcache_area(addr, size); > } >