From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.free-electrons.com ([62.4.15.54]:34669 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753723AbdGLRGw (ORCPT ); Wed, 12 Jul 2017 13:06:52 -0400 From: Gregory CLEMENT To: Chris Packham Cc: Jason Cooper , Andrew Lunn , Sebastian Hesselbarth , Thomas Petazzoni , linux-arm-kernel@lists.infradead.org, stable@vger.kernel.org Subject: Re: [PATCH] ARM: mvebu: use __pa_symbol in the mv98dx3236 platform SMP code References: <20170707075928.2938-1-gregory.clement@free-electrons.com> Date: Wed, 12 Jul 2017 19:06:40 +0200 In-Reply-To: <20170707075928.2938-1-gregory.clement@free-electrons.com> (Gregory CLEMENT's message of "Fri, 7 Jul 2017 09:59:28 +0200") Message-ID: <874luhbn4v.fsf@free-electrons.com> MIME-Version: 1.0 Content-Type: text/plain Sender: stable-owner@vger.kernel.org List-ID: Hi, On ven., juil. 07 2017, Gregory CLEMENT wrote: > As we already did for Armada XP switch from virt_to_phys() to > __pa_symbol(). > > The reason for it was well explained by Mark Rutland so let's quote him: > > "virt_to_phys() is intended to operate on the linear/direct mapping of > RAM. > > __pa_symbol() is intended to operate on the kernel mapping, which may > not be in the linear/direct mapping on all architectures. e.g. arm64 and > x86_64 map the kernel image and RAM separately. > > On 32-bit ARM the kernel image mapping is tied to the linear/direct > mapping, so that works, but as it's semantically wrong (and broken for > generic code), the DEBUG_VIRTUAL checks complain." > > Fixes: db88977894ab ("arm: mvebu: support for SMP on 98DX3336 SoC") > Cc: > Signed-off-by: Gregory CLEMENT Applied on mvebu/fixes with the tags from Chris and Floriant. Gregory > --- > > Hi Chris, > > with this patch I don't expect any regression, hover it would be nice > if you can test it. > > Thanks, > > Gregory > > arch/arm/mach-mvebu/platsmp.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/arm/mach-mvebu/platsmp.c b/arch/arm/mach-mvebu/platsmp.c > index e62273aacb43..4ffbbd217e82 100644 > --- a/arch/arm/mach-mvebu/platsmp.c > +++ b/arch/arm/mach-mvebu/platsmp.c > @@ -211,7 +211,7 @@ static int mv98dx3236_resume_set_cpu_boot_addr(int hw_cpu, void *boot_addr) > return PTR_ERR(base); > > writel(0, base + MV98DX3236_CPU_RESUME_CTRL_REG); > - writel(virt_to_phys(boot_addr), base + MV98DX3236_CPU_RESUME_ADDR_REG); > + writel(__pa_symbol(boot_addr), base + MV98DX3236_CPU_RESUME_ADDR_REG); > > iounmap(base); > > -- > 2.13.2 > -- Gregory Clement, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com