From patchwork Wed Jan 31 06:00:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yan Zhao X-Patchwork-Id: 194509 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1704273dyb; Tue, 30 Jan 2024 22:30:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IF/uFWqF3fOZpTnPirjvAvLR/bbb67dvCPhPMhTJeMLjQD+ZPF5HfJCruAxQiLhHx/mfyhy X-Received: by 2002:a81:7c0b:0:b0:604:1c9:62e1 with SMTP id x11-20020a817c0b000000b0060401c962e1mr632424ywc.44.1706682630942; Tue, 30 Jan 2024 22:30:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706682630; cv=pass; d=google.com; s=arc-20160816; b=t4keWSS/akFg1Vh1wOoTDlTRa3oAUjm2I1lBbweHLX56NaqKqffwqVJ68kIwL7Tap7 ie4JXl81Ac+D0AKL7qLQnz5VoW5YtD5iZmrKztiVZcXVL17kQyfsPi2b3Kr6lNHq2Bqu Ue/6Tpr6PYJPN6cqVr99aI8JuhcrUtXQK/yvU23WJkOUjWlkCt0gZMjHOtO7WKkCPUNt JJZCCNHGovoGwlwQHIRMvuU+X5GKEIkhpG4DGizT1JGgUhq+i1rKxKgi82Jg+ei9vnY9 5sZ7CN6+xplh6jQyOuERCjftDF3t88zHrvEEJ28D6ER1g2siJH6psKIyZ54ayoX4OhC6 UUtQ== 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=Tsccz4YcFO2xmRfKEQdog1xb0JOIPRDARLn/1bQa0lE=; fh=AZCEI+W1w8Wirfdh5mmfG6aXohxTlm8TE2cHvs34ytk=; b=fdrQo+LbOLJ4x8jBMS8+0aYFrn9n0PYBXXfhLKXywz6t3vg7jZuo3KQPWN52pXjY3m ni4eRvIbura2qyVtJKcfwqzeIqN/RKGmvAUVm2eiyry9t2xn9oUuJgsQvO6d1/XykuQ4 RRAXBTLvHNQh4ssXoA0d+Roe5Ss8EI8Sv1jK9oNSr/av1JFktAmSxI+P0acAvf1vzR9s Ftspp1J1xXzN/nKSB+61xWgACKfEf6i7BmpwHV41orFB4k+4ItihHwRfj6BOS1Xv++D5 0HMCuMXdEBHEvNrfpwOTjFhdxySRxA7Y/LR5KeK+d1jvl4a8m/vvsDk/lpOigRjUotUe xyjw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=RUUJh4ZU; 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-45834-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45834-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=1; AJvYcCWbkYN5pHMutyUInRl2GPc8qLn0TzPjoplaGvJGkm68XXdgK3/ybnu4kA7Y7JAAtRYeBfIsFKz6y5qLnAVNr5MaRJY22w== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id y6-20020a05622a120600b0042aa738fb14si5679422qtx.473.2024.01.30.22.30.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 22:30:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-45834-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=RUUJh4ZU; 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-45834-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45834-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 09A7C1C22753 for ; Wed, 31 Jan 2024 06:30:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 422A43EA91; Wed, 31 Jan 2024 06:29:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="RUUJh4ZU" Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) (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 07E8D3D56E; Wed, 31 Jan 2024 06:29:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.55.52.88 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706682593; cv=none; b=gZq7X9M31FLI/66EX0AP83nGavrq4m0Y9yWL86fDPgg5mPRMGffJ5yTM9A0cdHzLsTDQa/4ACFzDV+Vft3D3zkemzsY8USKrxwmqTEqcM4lqHt1zxYEByuqg1320s7ArHefPcNY0kvEzwIu9qWrO7FWQ40QlgYsWvqJbCBSAf9w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706682593; c=relaxed/simple; bh=2FW/d4u/muEUqMbOvxlTPNXE5CaRll4su+xJMlD1d+8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=JjRoAzAhv2xdkwmiRa5tlvyF+9pjXrVYKOER8oKao6oWGwwGTk5hJTylFJ+bzPjROh8CwLCpDUJT1kx8dF8D3dcVEPlHyEaR2D4oxYJY1HV3BpWsHRyS/VyFhupHuP3kDXzMWXVSNLZ4vf3owsDK1Shk9PNylHzSBk3UAPdCF0A= 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=RUUJh4ZU; arc=none smtp.client-ip=192.55.52.88 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=1706682592; x=1738218592; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=2FW/d4u/muEUqMbOvxlTPNXE5CaRll4su+xJMlD1d+8=; b=RUUJh4ZU/6OkQmQ7HDqomPWqUT2m/bgt2kNtWCqxFj2GTdFqZxAr8LW2 /fdCmj2nSrTW9llp+C2XBvfrg1GxVTiHSbPMf1e8A607xI44Io5JGBVVb z3EPGSf0aHAdvDhZVzUoW5vU2iIY6fTpAmTtwKYh62UZsKC2/6pfh0lrk EvHjexpGPnHgjHfQCy2YJ05dLQGZeIyYiOjOmVG8UBa11hHsZdWeOH7eh WVls0JYLhPuFRN11ibpOBCbES7IjVv5lducSp0nh5L4j2pVs+Dv6h/RZ9 RXq8WbNLmBl8vaQtwA/esepZ9ijolpZsDFebher0miwy4/qLv5fMQ4L/2 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10969"; a="434679669" X-IronPort-AV: E=Sophos;i="6.05,231,1701158400"; d="scan'208";a="434679669" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jan 2024 22:29:51 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10969"; a="822458493" X-IronPort-AV: E=Sophos;i="6.05,231,1701158400"; d="scan'208";a="822458493" Received: from yzhao56-desk.sh.intel.com ([10.239.159.62]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jan 2024 22:29:47 -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 3/4] Hexagon: apply page shift to PFN instead of VA in pfn_to_virt Date: Wed, 31 Jan 2024 14:00:21 +0800 Message-Id: <20240131060021.2749-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: 1789586446391329780 X-GMAIL-MSGID: 1789586446391329780 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: d6e81532b10d ("Hexagon: Make pfn accessors statics inlines") Signed-off-by: Yan Zhao --- arch/hexagon/include/asm/page.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/hexagon/include/asm/page.h b/arch/hexagon/include/asm/page.h index 10f1bc07423c..1d341590791a 100644 --- a/arch/hexagon/include/asm/page.h +++ b/arch/hexagon/include/asm/page.h @@ -135,7 +135,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); }