From patchwork Wed Jan 31 05:59:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yan Zhao X-Patchwork-Id: 194508 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1703920dyb; Tue, 30 Jan 2024 22:29:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IH5nsHSivOYI5KS4BIFXddymuH4218bbLvqBZH40ccirPrwoL7zMUXNdU7KnW1tffsTEaZ4 X-Received: by 2002:aa7:800e:0:b0:6d9:b4e6:ffb with SMTP id j14-20020aa7800e000000b006d9b4e60ffbmr913364pfi.0.1706682564285; Tue, 30 Jan 2024 22:29:24 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706682564; cv=pass; d=google.com; s=arc-20160816; b=B3Slnko7+HSRqPNrC85KI/tv0w+ly/2TllnQTSbYLp8AtpbO0s55rRV7opUL+G5IWa 5N8AteR6cPVbVaqDVGupEqNVVzzC5lRmZniqMHKfIAWihv2pL8Eu1+xyUG+YzPMv0RNk 1KVr9MwqcDZyCCv53xzrc0SLUhUa+WZuHjTF642BboIizMwFAO3M6VA/HXYDRkVUFMg+ m2QwC2UWY7Tbs8guvIJlzK/ixBU3KR1C9UDUf8RY7Gw+5pcO/m23JE319S0Q7XrJRYt9 l34wVfY6OhYq0sZOtPDoZUdkc49+Q4pHEU3hQlkio0ZfgZ0B8AUifw+qya3un8swDQe9 sG+A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=tMjuSeUE9J6zxCzLVGGLFVyFM7KVtcKmO8Jbkdq/0NY=; fh=h6GX5LkK1UYaSKo3inchVK8usjLkmAL3QCKC9jkinHc=; b=wtxmNzyO4oitf4BCMfs1D7qAhstacC9gBg2HnZ9MYk4a3QF0S5JLIA/5nfvViDe4NV iL/GeAWIFNUyIhzlkzA0qGWgaRVDy3rN3PrawHsEjApFAWJLXowf1TqxV4KsA0g7OrcX cfJrfMM/osZ5Lbssfy6TMxGl3qdRbC0YNGnV5Cy+6bg3J0qRZQqsMVfb4PeHh6PvEzL1 Aum90cDAobtp02pZYwEo5Rn+EAsAq18v8ubudrg2BikJiEjTImMVTgPizo/B6ur5Lm9U FCDC3NLA/h7HxidmAlJrHMxqck7UbXxRcuYE9kH/cygGJ02OsiypNVSXSu4NlI86ba5F eKDA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=We2OMRKG; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-45831-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45831-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=1; AJvYcCU9eGNZ53V08UtsvHy8z4+NiBfterl+T5/nRPkt4Pst3fZuHDe/bvM2vsromitUM+xvLOBKPZRJHW1noL+aqeh/LnaaXw== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id m10-20020a056a00080a00b006d3c35096dcsi9080835pfk.320.2024.01.30.22.29.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 22:29:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-45831-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=We2OMRKG; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-45831-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45831-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 79E51283897 for ; Wed, 31 Jan 2024 06:29:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5FB223EA88; Wed, 31 Jan 2024 06:28:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="We2OMRKG" Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0BE7D3E48F; Wed, 31 Jan 2024 06:28:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=134.134.136.31 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706682522; cv=none; b=ffmwqJEKl1frr+EeHoACz110SUraPpL24CWnywJf3B2yMedHzJu2rINl6ypfHxEKQ8Fdu5UhgdNWvplhVY2uHA8jO5dXXD2ij5OcROhJRRt4IUKREL+M1APsnVvMxp7AduYJy1mm3bfTTolw0c0ZQsNkHWJqToGVevt8K1725IU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706682522; c=relaxed/simple; bh=hfVSVgT0v5YPemJxSQBciKx1IHu0qbunahQtFTlHaHI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=YAToFqPgFtDwGNtCeXm68QvnKgQyunv2QqI6l/5oG+qt8innpCVoZ5KFs47mzX1oyH+ob9OEuauApKPKOKr5Sj7UxFDl/goYNWE1ZsKCp7VJkgBGGr6MbdHfcExzvNGuTMXLMjgiA+dkcWdggLF2HA6GVye8IRl7vGp1O8w4y9o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=We2OMRKG; arc=none smtp.client-ip=134.134.136.31 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706682521; x=1738218521; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=hfVSVgT0v5YPemJxSQBciKx1IHu0qbunahQtFTlHaHI=; b=We2OMRKGOsLHH3l/j9Vk4F4SVlti1xrIpm1no5lhY+jr9EpUbTf63X1Q 11T0CB6esi+fS/f+OY5jQa662l4EJGiebMm0yEV0IPDl7owu3xgIEXfUY HtVIEMqVe9R+O2E800MZzIagIu+i6rsB7kWaeIWEDLhAp5eesslOQL5ax WQh+/dj+0zeu0vIEe0rtdJ/P4H0WPzWOFC+HDwL3Q+p0ge/cCd38E4OWM Zj3it3Ckia26YDswK4dLPIwukGgsGuQC+HqHwe2TAjpPjmnZhNp+Jm7m9 eGDqP5crjDiZLND6Xznh/tbu9xvVtDtzP3l/cQc9tDhTsLcE+Db7CpQ0X g==; X-IronPort-AV: E=McAfee;i="6600,9927,10969"; a="467751655" X-IronPort-AV: E=Sophos;i="6.05,231,1701158400"; d="scan'208";a="467751655" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jan 2024 22:28:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,231,1701158400"; d="scan'208";a="30385588" Received: from yzhao56-desk.sh.intel.com ([10.239.159.62]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jan 2024 22:28:30 -0800 From: Yan Zhao To: arnd@arndb.de, linus.walleij@linaro.org, guoren@kernel.org, bcain@quicinc.com, jonas@southpole.se, stefan.kristiansson@saunalahti.fi, shorne@gmail.com Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-openrisc@vger.kernel.org, Yan Zhao Subject: [PATCH 2/4] csky: apply page shift to PFN instead of VA in pfn_to_virt Date: Wed, 31 Jan 2024 13:59:04 +0800 Message-Id: <20240131055904.2652-1-yan.y.zhao@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240131055159.2506-1-yan.y.zhao@intel.com> References: <20240131055159.2506-1-yan.y.zhao@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789586376524385948 X-GMAIL-MSGID: 1789586376524385948 Apply the page shift to PFN to get physical address for final VA. The macro __va should take physical address instead of PFN as input. Fixes: c1884e1e1164 ("csky: Make pfn accessors static inlines") Signed-off-by: Yan Zhao Reviewed-by: Guo Ren --- arch/csky/include/asm/page.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/csky/include/asm/page.h b/arch/csky/include/asm/page.h index 4a0502e324a6..2c4cc7825a7b 100644 --- a/arch/csky/include/asm/page.h +++ b/arch/csky/include/asm/page.h @@ -84,7 +84,7 @@ static inline unsigned long virt_to_pfn(const void *kaddr) static inline void * pfn_to_virt(unsigned long pfn) { - return (void *)((unsigned long)__va(pfn) << PAGE_SHIFT); + return __va(pfn << PAGE_SHIFT); } #define MAP_NR(x) PFN_DOWN((unsigned long)(x) - PAGE_OFFSET - \