Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp4525509rwb; Tue, 8 Aug 2023 09:40:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHHtnYG5oC3btrKB2PhyQV36Z16exFYS1VSSITNJuHiDHYOqnq2gqw6RKHRz+ZKFLELCoTy X-Received: by 2002:a17:902:9006:b0:1bc:a3d:3b80 with SMTP id a6-20020a170902900600b001bc0a3d3b80mr167241plp.68.1691512853157; Tue, 08 Aug 2023 09:40:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691512853; cv=none; d=google.com; s=arc-20160816; b=Mpmg3g9zjzM1zUQtOvAXc3FM9VoOkJ6ciLWdPdQLBCazOr5mPK/ox4Oeqqh6Cfe673 zPXCDLkMC5WQsNWshW/HH3CA7WPqJLGPNMbG5QhZpJ+bCfhmJhuqh/Am0zO9tbL8fPze 0CLbEPfF6ZroC8xCuDZk5oORS01l9j9+ghmbShzQ8CojnzY2Jz7un20ME9J/RxfV+0Y0 FxtlfW4diL6mhDLu1w+ZKSWXzfiClRVQri0Rbb+Q4Lt/eJ0todOsfleTjzM/lVOlozsn EW6+/Xy/nfTRGMMy37fFjrcsfX+3D2TnzSOMkdayifm6Uz+2N52cgz7omNIS25PtQmmY ZfYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:subject:cc:to:from :date:references:in-reply-to:message-id:mime-version:user-agent :feedback-id:dkim-signature:dkim-signature; bh=QCX/lpfXwJ5z0pSWhPcBrqLzzwFNbbABXjKojnNk55A=; fh=tTNX+5rexcOKTOpeNM4FflMPmXjZkfJNYubiZrUXhdc=; b=avCWC18CxhaP04i4/L3DwLnQXgO4BTxsUNqNTWesXFQwatYDj2npRu4SDTTFw6BR0s DIZcs/eqsT/UkLJq3kY04XDy9GF83pJyT7boPBZUklRFGwXQkYWPpzcvf/7O+x7P69/s kSKLnkcQWWBDG1xahKQAlcGFsvb9Y9dbIKQsFuFjWwpU/yqetgboAPq1DNm1lAXFlGGG dmetRc54MrMd7ulp4x8Hwo3QhckIw2PNLKyH2hSXNPwM+OMsLSs/jFstdsSpLFXW9MqC Wc+vHTGYHm5dLFCvrbEoATrKzNup8qHIPkF7mPEUBrb+lsmMAEFuNMiCrPoAYhn76c3O l1xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm3 header.b=iDzl4ABA; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=m+0uuOPj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b14-20020a170902650e00b001b3eeaad177si5023252plk.99.2023.08.08.09.40.41; Tue, 08 Aug 2023 09:40:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm3 header.b=iDzl4ABA; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=m+0uuOPj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230131AbjHHPsw (ORCPT + 99 others); Tue, 8 Aug 2023 11:48:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229775AbjHHPr1 (ORCPT ); Tue, 8 Aug 2023 11:47:27 -0400 Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFB2D10C0; Tue, 8 Aug 2023 08:41:32 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id F125A3200906; Tue, 8 Aug 2023 09:46:05 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute6.internal (MEProxy); Tue, 08 Aug 2023 09:46:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm3; t= 1691502365; x=1691588765; bh=QCX/lpfXwJ5z0pSWhPcBrqLzzwFNbbABXjK ojnNk55A=; b=iDzl4ABAxMRM9X/i6koq5ZbUzWXbe9LzbrZAIxzX+cb6szPrCcQ THyakH0okjmXwZAL7f9WOa3F6XbffGdSy3qdvZxJplREiPRmpCkj3BLlCeYEHSCP Bj/KNmQNLXWcGMLlD0YGuGaaM0rw0bNvfh4G5XBN07rZrD3+xO4rYgaWnvZC93uA 65tbwHRL9Ef2AsCWWChos13pW9a4OFLZRVYbdtVgspv/2tvlSUaXrucuEDuGWrUR gJZckq3LePJdWDZoE+oO3fvqigBxNt9I5E7ID/PjdQ2sJVYm+wyzXwUGFJtcX9SN k8WU0LXJnUBacFFywxNOi67mewEHMUBTfyw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1691502365; x=1691588765; bh=QCX/lpfXwJ5z0pSWhPcBrqLzzwFNbbABXjK ojnNk55A=; b=m+0uuOPj8DzZFQauay0myP3ngR+pxV68xX3itgWvbpw0uI7V5fC HDeEk7v3dtDZzbKchxhT5j3fFtiw4bl4QVuM6p/p28GaEMy6Yg0KinVVLUn15Tic cZ+UBJ2zIxFjVpG3w//acLwNDEQxb/Vv7+PlhjSpQTv9lPcqwKnfPtXDZgaKp71D QjlPhp9BrnzlINKuisfQ4R7ORzXRfFH+mpEmsmVqhht3zW/f+wbKAIxh544er92k 9QUnNdVQu+bEHGkKU01h3j4GYGTblgDnC+VnQf98B0/JuERLqdJf7dr8K1EDZGm2 aKjsq36wVxB4rOe+PwtSfCB6a4+urkHoK6A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrledvgdeijecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvvefutgfgsehtqhertderreejnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepgfekueelgeeigefhudduledtkeefffejueelheelfedutedttdfgveeufeef ieegnecuffhomhgrihhnpehkvghrnhgvlhdrohhrghenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrrhhnugesrghrnhgusgdruggv X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 430EDB6008D; Tue, 8 Aug 2023 09:46:03 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-624-g7714e4406d-fm-20230801.001-g7714e440 Mime-Version: 1.0 Message-Id: In-Reply-To: References: <20230808-virt-to-phys-mips-v1-1-af6fcd45ed31@linaro.org> Date: Tue, 08 Aug 2023 15:45:41 +0200 From: "Arnd Bergmann" To: "Linus Walleij" , "Thomas Bogendoerfer" , "Florian Fainelli" , "Baoquan He" , "Jiaxun Yang" Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] MIPS: Drop virt_to_phys define to self Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 8, 2023, at 15:12, Linus Walleij wrote: > On Tue, Aug 8, 2023 at 11:29=E2=80=AFAM Linus Walleij wrote: > >> The function virt_to_phys was defined to virt_to_phys and then >> implemented right below. >> >> I can't understand why, just drop it and let the actual function >> slot in. >> >> Fixes: dfad83cb7193 ("MIPS: Add support for CONFIG_DEBUG_VIRTUAL") >> Signed-off-by: Linus Walleij >> --- >> arch/mips/include/asm/io.h | 1 - >> 1 file changed, 1 deletion(-) >> >> diff --git a/arch/mips/include/asm/io.h b/arch/mips/include/asm/io.h >> index affd21e9c20b..18ed44843541 100644 >> --- a/arch/mips/include/asm/io.h >> +++ b/arch/mips/include/asm/io.h >> @@ -111,7 +111,6 @@ extern phys_addr_t __virt_to_phys(volatile const = void *x); >> #define __virt_to_phys(x) __virt_to_phys_nodebug(x) >> #endif >> >> -#define virt_to_phys virt_to_phys >> static inline phys_addr_t virt_to_phys(const volatile void *x) >> { >> return __virt_to_phys(x); > > Just have to CC Arnd on this because I never feel I understand this > properly. > > Normally you would do this so as to override the default virt_to_phys() > from include/asm-generic/io.h, but we do not seem to be using it here? Correct. In linux-next, we have converted arch/sh to use include/asm-generic/io.h, so arch/mips is now the last one to not use it.=20 I see that Jiaxun Yang posted a patch for this in May and it looked like it should finally work [1], but there seems to still be something missing. > Further right below we are implementing phys_to_virt() with no > corresponding define, so in any case this needs to go or that one > needs a define. > > That said they seem like a good candidate to replace with the > generic variant because the content is the same sans some debug > hacks that I doubt are still needed. I think the ARCH_HAS_DEBUG_VIRTUAL option is useful in general, I'd rather move that into the common code if we were to unify it. For the moment, I'd suggest we leave the #define in place here in order to finish the patch that starts using the asm-generic header, and then we can look into using more of the generic code. Arnd [1] https://lore.kernel.org/linux-mips/20230519195135.79600-1-jiaxun.yan= g@flygoat.com/