From patchwork Wed Feb 26 22:02:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Atish Patra X-Patchwork-Id: 11407371 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5573014D5 for ; Wed, 26 Feb 2020 22:02:57 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 31A5524656 for ; Wed, 26 Feb 2020 22:02:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="FYPiux3y"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=wdc.com header.i=@wdc.com header.b="mlaV+0Sp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 31A5524656 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=wdc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id:Date :Subject:To:From:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zMKRgPZQqBDX7dImFKAFTs2xTyaBV4wkVFd8eAzc4fM=; b=FYPiux3yz+fseE m7rdEw22QagliOSdwFaes8C4BfLaqfzy7uqDleKZB+RDTH5tFpbyExBmNf81TnqCWxs27WRVPTCJt PWgOfnkL9YBPABZNDXtXepVBCFujXHcuUBBtA6VeecHcMOJjrFLPQQolAnTHIbTxw6daFWG/XrOJL ugKiJdZipUcCG8ej2ma3gPFeoOIen+lv/monH5eKOew40Xx0hKThCv7x15DpsbQ2JkjvGbs+GGYMT S0glPZEJTwwyXtWmEOemYLUZGP+z6Xde2im/uDqpe1WIEPKZkSsZ1nuMZ4IrLZ2mePkNyyJlNGryW VfgVQrgiKh/7piNB2x5g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1j74lY-0004Kn-D8; Wed, 26 Feb 2020 22:02:52 +0000 Received: from esa1.hgst.iphmx.com ([68.232.141.245]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1j74lC-0003nS-9b for linux-riscv@lists.infradead.org; Wed, 26 Feb 2020 22:02:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1582754550; x=1614290550; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=JqXfvLC9I8btjifDyDxA+vz0y13stX9yiYKqjoJkjmU=; b=mlaV+0Sp48IJOw8+821+WJevWHnRJMwW1crepbohOjCRO+b6Yn+3Sak9 34FRkfK4lWd346cW9wetFJFxrV5YoRzR29/Y9EB0Xq89Cd2Gepod03YBW m4vLdu/iEfbEk54/HH0vLd4NXukv0TUnhiDC6+uADAzMqL7nQXtcQYmBe dioktv/ipSNQ4xIwTvxujQKHWTDB7HVi5ufVPZ6V6OZ/T6+yCx6a3WSwL ePnFm3ohZIszw6P6ZSRsVyoldruiFa1IEwuZd0VS92gGHHAcxb4s5llL7 QYXNKyDPeRcl3jnwz5QHyYAhgW4iL22WZbXOjI6LUHj+LretufSaFTBCh w==; IronPort-SDR: nqMKBQUzQlQlxEQW/6B+x4fQtBAdyM9qBg2Uk5H56U05cTF/hDDtuqlfGS85ds/Rl8ucaykbpk eWdFDNxXOZ0CeWvhetXF+zKRe83wsPkmjp9ylXXAqgG50LbFdjAT3kuFrR9dnK9UKsTQ/6KHQg Hbb1aGnvd5a5RpNYsQjJ2wMBjBPJFPUVHdSsrFtXeHZ6jvG5g3NdYgKmmVk+dFIq1TcYSm+p6z mL8KLzjIi2/x7g+Op4Gc/Gzx0Mq0EMUWrSAPsqAFgzLsOGwTPiDtXblK5YeM03oYhZNqsIeIX6 Ml4= X-IronPort-AV: E=Sophos;i="5.70,489,1574092800"; d="scan'208";a="238981863" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 27 Feb 2020 06:02:24 +0800 IronPort-SDR: AbQq68+MPk2C1QEx4XkHqrt60bHJiswhc2nNbWfmz/hn35DQk3hE8L0NVkmHotWOxgXFUfpqYa RdMBN8ZnNInKMEvH7D/yLS8FCvsHDX/w+s2ih8DmJCOPIWMY/mcl9VJeo9Aq8zp7RvxdZyoQvS xeNzPfwUBVZuQehbQOcx4knK9uCZeDoxjROc2AZ5CsW8YqS4xVEc4pvdjyZTy7EVzN0bdSH35M jKa69opLDRcQPQROhfVq/WBf4PJtg18ODZ/WfA9HEftCUevxpNvzs31sh3R27IHAKibtc81aHO V44b3C3gxC+veHeUT1FfaZQn Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Feb 2020 13:54:49 -0800 IronPort-SDR: EVY8lUPNbgljmW6HqEuqUs1GnjnBfBSafUXNYMK1AMj6XuCsBqsRkDnNQI1K0i0CCkdrN7W9V9 ysHazwBXnlQMwZfgMr8PTvYVU9zP8Xyi9hfVBkXLxN9hZDPt5ln0P5Jv3UJDkg2dU9+tPydUPz gVWO1CYmsd52gIsvas27XINqLZ+RvJPkXX6yH30hsTpy6aeRfPlD4Lvlji8UTOFG3GoB+LvUgY gKa7m8TeX4ssIDVdSdE9QFEJx3uLqo46bT/S/VbJtIeiqdIaAr62kQniHQwh0ZLSdesWkyhoT4 Uq4= WDCIronportException: Internal Received: from yoda.sdcorp.global.sandisk.com (HELO yoda.int.fusionio.com) ([10.196.158.80]) by uls-op-cesaip02.wdc.com with ESMTP; 26 Feb 2020 14:02:24 -0800 From: Atish Patra To: linux-kernel@vger.kernel.org Subject: [PATCH v10 08/12] RISC-V: Export SBI error to linux error mapping function Date: Wed, 26 Feb 2020 14:02:09 -0800 Message-Id: <20200226220213.27423-9-atish.patra@wdc.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200226220213.27423-1-atish.patra@wdc.com> References: <20200226220213.27423-1-atish.patra@wdc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200226_140230_419881_A9861106 X-CRM114-Status: GOOD ( 11.76 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.3 on bombadil.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.141.245 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kate Stewart , Madhavan Srinivasan , Zong Li , Heiko Carstens , Michael Kelley , Atish Patra , Gary Guo , linux-riscv@lists.infradead.org, Mike Rapoport , Kees Cook , Marc Zyngier , "Rafael J. Wysocki" , Daniel Jordan , Geert Uytterhoeven , Greentime Hu , Borislav Petkov , Mao Han , Albert Ou , Jason Cooper , Sudeep Holla , Alexios Zavras , Paul Walmsley , Thomas Gleixner , Nick Hu , Greg Kroah-Hartman , Anup Patel , Vincent Chen , Palmer Dabbelt , "Eric W. Biederman" , Anup Patel , Steven Price Sender: "linux-riscv" Errors-To: linux-riscv-bounces+patchwork-linux-riscv=patchwork.kernel.org@lists.infradead.org All SBI related extensions will not be implemented in sbi.c to avoid bloating. Thus, sbi_err_map_linux_errno() will be used in other files implementing that specific extension. Export the function so that it can be used later. Signed-off-by: Atish Patra Reviewed-by: Anup Patel --- arch/riscv/include/asm/sbi.h | 1 + arch/riscv/kernel/sbi.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/riscv/include/asm/sbi.h b/arch/riscv/include/asm/sbi.h index 8766f6af9eb8..82ff88f06ddc 100644 --- a/arch/riscv/include/asm/sbi.h +++ b/arch/riscv/include/asm/sbi.h @@ -130,6 +130,7 @@ static inline unsigned long sbi_minor_version(void) { return sbi_spec_version & SBI_SPEC_VERSION_MINOR_MASK; } +int sbi_err_map_linux_errno(int err); #else /* CONFIG_RISCV_SBI */ /* stubs for code that is only reachable under IS_ENABLED(CONFIG_RISCV_SBI): */ void sbi_set_timer(uint64_t stime_value); diff --git a/arch/riscv/kernel/sbi.c b/arch/riscv/kernel/sbi.c index 932b23272be5..3a2a5352316b 100644 --- a/arch/riscv/kernel/sbi.c +++ b/arch/riscv/kernel/sbi.c @@ -46,7 +46,7 @@ struct sbiret sbi_ecall(int ext, int fid, unsigned long arg0, } EXPORT_SYMBOL(sbi_ecall); -static int sbi_err_map_linux_errno(int err) +int sbi_err_map_linux_errno(int err) { switch (err) { case SBI_SUCCESS: @@ -63,6 +63,7 @@ static int sbi_err_map_linux_errno(int err) return -ENOTSUPP; }; } +EXPORT_SYMBOL(sbi_err_map_linux_errno); #ifdef CONFIG_RISCV_SBI_V01 /**