Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1474190rdb; Tue, 30 Jan 2024 22:28:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IHoiT4osMjz5UdYYWCXTWSgyZKf+x0Y2gYKbpoWfHRZB3gEkoHofil2e6LK/2gGmw/X2CLk X-Received: by 2002:a0d:d70e:0:b0:5ff:4281:a6a with SMTP id z14-20020a0dd70e000000b005ff42810a6amr727022ywd.8.1706682532542; Tue, 30 Jan 2024 22:28:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706682532; cv=pass; d=google.com; s=arc-20160816; b=UkE/o0HcvWrtPGDRt+oIpunmZcrgrwgB74c0tGEYWmlWKd+MIxk/mg32c5cLMZR2N7 WL04ZDanhLIABoRpj5pG/FBZZxUZVnLEWvb8Q93qXIHFH8g41bP61TaDgMu46oxqInhs ErbpoCoYpMJojkraX+JooOHGvYO/FPo+Y1VpoARWz4XSn9QnEysKhC0cC10SA2Mf9hZF hHKBP0dgGo0JfpM3tBc4pgqSnNRB63EuQeukdw1+WdJAH/vkSmygzaPliHguVS0LUxue fcZG83IOqEA0i2jjGEOe+nFo3ePUWoNbyPWs7OvOhG/hc7WZxaASQ6n/pkM1zSxsiFt3 Ftsw== 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=Bg7Wba83shIfZq+bLyDMqCiUf9KLjTXSMCc10Zpjqw8=; b=JH5Zn3hYmDEuSgRNEvvDUAZMjWFdn0pkfgxGJoa9UASWRNOWqBP0r211W6f9cCfcmY M/isgjzRmLb0xxMZqzA/ohbEqBQP08UIUN6BtGH50jQXkyI3kCGPNB1CtRMWVVEGNqg9 7OSn0D8X1jOCTdUBSHUxgMuFE1CbIhBgnZ6luyJP8vERpn6Tx9LSbcFinwm+6n/N4h8y 6x4SSVrF4wVRMdhX0zMUwk/87SWwUpmawPNj8vSDO2Vk+RNKzgO5O7gQibCneTy4ukAf UG6ocISXg8g6O4OCVLeaBPbzSf0XwZbU7oni+OxoEDS2MeN2N1DHeRJJljcyV+UcgFNU q2pQ==; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45831-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=1; AJvYcCWEGUy6Vo7f82/l9L28HWcJe+PWvp9dFtwLAY26RHFTIjXnFhsxeBr4Nu+KXEeHCL2yH85bMAu3N/1CZUMHdBRL5fl6K7E/lBo3Ofa5JA== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id q12-20020a05622a030c00b0042be368fe61si1346437qtw.681.2024.01.30.22.28.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 22:28:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-45831-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45831-linux.lists.archive=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 4165D1C21BE6 for ; Wed, 31 Jan 2024 06:28:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7288C3EA82; Wed, 31 Jan 2024 06:28:43 +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: 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 --- 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 - \ -- 2.17.1