From patchwork Tue Nov 26 03:56:25 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 3236301 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 18246C045B for ; Tue, 26 Nov 2013 03:57:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3339520179 for ; Tue, 26 Nov 2013 03:57:12 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 158D120138 for ; Tue, 26 Nov 2013 03:57:11 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vl9li-0006gB-Mm; Tue, 26 Nov 2013 03:56:58 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vl9lg-0007ca-Ak; Tue, 26 Nov 2013 03:56:56 +0000 Received: from mail-qa0-f44.google.com ([209.85.216.44]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vl9lb-0007cE-CZ for linux-arm-kernel@lists.infradead.org; Tue, 26 Nov 2013 03:56:52 +0000 Received: by mail-qa0-f44.google.com with SMTP id i13so3939141qae.3 for ; Mon, 25 Nov 2013 19:56:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version:content-type; bh=/yNftvuMkyWYI2IOom7kQ1w7oA+89Q9+OIdaRt9Tf0o=; b=mLSAceiFeyuUrLQKU7REi1MlBM0nxi6DVHEblT6KDsbymmVlP6mLGmKI6hr0Iobsyx Y7NkHKx8Bz+uyFpUlcKKvIM/L01mSWZTdw8fcKT2ZVmCHUovXXpGlGoLCLLO0BJCYjwC Rtp4YU31wn83u7QG9KySsG7DhZvMn4MGpDUVuzJ+bXjPq7ShSJwwLJxG1XFWHpmep3xe EzQfwApon4g/ZkLfFbh/yHpLj7tdb8L7PBL0ljA0BwHdwKtryZ90DjNTEDiXTsCl33nr mZdQ87XPYEB/644gyLt/iu5MtPV4BDuJXlm3FWkVisOH9GIHMRuTLTOaH2rgdE1yl95T fB5w== X-Gm-Message-State: ALoCoQn3xs4EavIdpTGVGnSf8n1tf1+KgeRZ0ynNO+NTzufKDS+lfSkgehd+tjw/3O76Bi6OmMUj X-Received: by 10.49.1.106 with SMTP id 10mr52582737qel.55.1385438187395; Mon, 25 Nov 2013 19:56:27 -0800 (PST) Received: from xanadu.home (modemcable177.143-130-66.mc.videotron.ca. [66.130.143.177]) by mx.google.com with ESMTPSA id a5sm17296798qae.2.2013.11.25.19.56.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 25 Nov 2013 19:56:26 -0800 (PST) Date: Mon, 25 Nov 2013 22:56:25 -0500 (EST) From: Nicolas Pitre To: Russell King - ARM Linux Subject: Re: Build breakage from 'ARM: mm: use phys_addr_t appropriately in p2v and v2p conversions' In-Reply-To: <20131125233654.GV16735@n2100.arm.linux.org.uk> Message-ID: References: <20131125223636.GA20822@obsidianresearch.com> <20131125232003.GU16735@n2100.arm.linux.org.uk> <20131125233654.GV16735@n2100.arm.linux.org.uk> User-Agent: Alpine 2.10 (LFD 1266 2009-07-14) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20131125_225651_463914_80AC78BB X-CRM114-Status: GOOD ( 19.93 ) X-Spam-Score: -2.6 (--) Cc: Jason Gunthorpe , Santosh Shilimkar , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Mon, 25 Nov 2013, Russell King - ARM Linux wrote: > On Mon, Nov 25, 2013 at 11:20:03PM +0000, Russell King - ARM Linux wrote: > > On Mon, Nov 25, 2013 at 03:36:36PM -0700, Jason Gunthorpe wrote: > > > Which is after your new inlines.. > > > > > > An elegant fix wasn't obvious to me :) > > > > Same here... it's all rather complicated because of all those ifdefs. > > Nothing easy comes to mind about how to fix this one. I'll look into > > it at some point. > > > > If not, it's going to have to be a revert - or we bite the bullet and > > start killing off some of these Kconfig options such as making > > ARM_PATCH_PHYS_VIRT mandatory. > > Actually, I think Nicolas' commit: > > 1b9f95f8ade9efc2bd49f0e7b9dc61a038ac3eef > > was wrong to remove PLAT_PHYS_OFFSET. So, partially undoing Nicolas' > patch, and reordering things a little, we end up with this, which if > it weren't for the comment would be 5 lines shorter! [...] What about simply doing the following instead, which I'm sure used to work properly at some point: diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h index 9ecccc8650..2b8b8d3236 100644 --- a/arch/arm/include/asm/memory.h +++ b/arch/arm/include/asm/memory.h @@ -239,6 +239,14 @@ static inline unsigned long __phys_to_virt(phys_addr_t x) #else +#ifndef PHYS_OFFSET +#ifdef PLAT_PHYS_OFFSET +#define PHYS_OFFSET PLAT_PHYS_OFFSET +#else +#define PHYS_OFFSET UL(CONFIG_PHYS_OFFSET) +#endif +#endif + static inline phys_addr_t __virt_to_phys(unsigned long x) { return (phys_addr_t)x - PAGE_OFFSET + PHYS_OFFSET; @@ -253,14 +261,6 @@ static inline unsigned long __phys_to_virt(phys_addr_t x) #endif #endif /* __ASSEMBLY__ */ -#ifndef PHYS_OFFSET -#ifdef PLAT_PHYS_OFFSET -#define PHYS_OFFSET PLAT_PHYS_OFFSET -#else -#define PHYS_OFFSET UL(CONFIG_PHYS_OFFSET) -#endif -#endif - #ifndef __ASSEMBLY__ /*