From nobody Tue Nov 26 06:39:24 2024 Received: from smtpout35.security-mail.net (smtpout35.security-mail.net [85.31.212.35]) (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 41DE31EF939 for ; Mon, 21 Oct 2024 13:35:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=85.31.212.35 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729517712; cv=fail; b=UxjiTRcSGIN3BCp9L5e10lEkt7Ywduk9waIq2NCjKpKcoOEgJkSp1d/cUFdaYQWHJKaAyuwnuBsgs5Sl6CR3CUeQE6yZdP4hFtsPXU1TpDhIFi0uZ5ChsNc0srqkNVOkxbv5gKPNAwUpyojLMA56dZ8qoNGEwRCtAOH3QypkOjo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729517712; c=relaxed/simple; bh=rWJitnMus/PcMNtJrIku8s/XDC0T/AmzlDyeGJ3xs4c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=nO/rLGywgp+nzcOoZMJnOjY20OY4SDDNXC9/E6dc6zCnBO1FuNAJegtfSMwsY6W5/pIqHSV3h8ypzGJpIlO9SRPaMzgV+lHQqpc7Yz3MjlEo7SGeNo5QTS2Jr+dlEzbLVsGnKgrlNzR6b1d/HiGsJGxruCP93erJGetleiBtMr8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=kalrayinc.com; spf=pass smtp.mailfrom=kalrayinc.com; dkim=pass (1024-bit key) header.d=kalrayinc.com header.i=@kalrayinc.com header.b=MFRSR8P0; dkim=fail (2048-bit key) header.d=kalrayinc.com header.i=@kalrayinc.com header.b=rmGxICws reason="signature verification failed"; arc=fail smtp.client-ip=85.31.212.35 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=kalrayinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kalrayinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=kalrayinc.com header.i=@kalrayinc.com header.b="MFRSR8P0"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=kalrayinc.com header.i=@kalrayinc.com header.b="rmGxICws" Received: from localhost (fx305.security-mail.net [127.0.0.1]) by fx305.security-mail.net (Postfix) with ESMTP id E80EF30EDB2 for ; Mon, 21 Oct 2024 15:33:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kalrayinc.com; s=sec-sig-email; t=1729517590; bh=rWJitnMus/PcMNtJrIku8s/XDC0T/AmzlDyeGJ3xs4c=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=MFRSR8P0yKzPopQ8LsA64SbgGQ+Zdbc9sTwQgFNUDXk4BaWkWxISJbIhZzU4bH9mq 2Vugiak3MGLxxAv7cTv3jBohQZ4BChmjnJuva5I5Y3yiyLtsDMn/rgC0km//wC3o6N uCZopOzh8/m061soxppXadaaI/knD1E5GKEErhSs= Received: from fx305 (fx305.security-mail.net [127.0.0.1]) by fx305.security-mail.net (Postfix) with ESMTP id AF31330ED42; Mon, 21 Oct 2024 15:33:09 +0200 (CEST) Received: from PR0P264CU014.outbound.protection.outlook.com (mail-francecentralazlp17012050.outbound.protection.outlook.com [40.93.76.50]) by fx305.security-mail.net (Postfix) with ESMTPS id 0F14B30ED27; Mon, 21 Oct 2024 15:33:09 +0200 (CEST) Received: from PAYP264MB3766.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:118::6) by MR1P264MB2339.FRAP264.PROD.OUTLOOK.COM (2603:10a6:501:34::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.29; Mon, 21 Oct 2024 13:33:08 +0000 Received: from PAYP264MB3766.FRAP264.PROD.OUTLOOK.COM ([fe80::6fc2:2c8c:edc1:f626]) by PAYP264MB3766.FRAP264.PROD.OUTLOOK.COM ([fe80::6fc2:2c8c:edc1:f626%3]) with mapi id 15.20.8069.027; Mon, 21 Oct 2024 13:33:08 +0000 X-Secumail-id: ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Tc9QX+31wE0T1TB3nHXVkzQqarNmD1ULc6H5Lnti47pAb0CgJWfhQqDBJ34LKleEZXGBlxJDCc/3ksq/va1qF2xsSaCNuplGgT72PHS+e7Cp+hCpfdxca969mkKBFbJGjyom7Gxh9Gko4KhkLSKflV56XsWm3+eej4avbAEWWF8qVNJUlcWeA3d4qel2h+yLSeA+FbhFqJtHpPCDq7o2KLu8t8HhV01+uaA+xxIRZbLGGyBVC9VyAb+L7e6pNdnX2+eI6SR9UM88s+MXHduDKqBhroFVoEJ4IfSKmwm93zW/4RxlfmT5qlD2BXrh5XniFopHy2mfPvi98egVDdq5gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qyh6O614b/8IkSe3xXMOvUBqzvmThFjUZ7QxLC46PX0=; b=HDIt7DI3IfOk8EuzLPFnuSPETtyO2O3tsN0uJArjQ4U24nBAjI39aKgf3nF/lOyFwW3wxWyOF0UqaobTPKNPJjQfAmo1ePBxUq8scACFeb1l99xyFLUG2oFdM4xF9nUstqH6zaUfZnSwuv6PCfIxCpC6HjEMD/63wnv1syxAcvBckNV4hizzAcrbcVS2toZgn/UN4Nywg9DL7vHXIy/t+8oKk2DHBU/XFK+s5+H2j5/BZzeJcbm3K/Hb2yBP0g7mGi48TnYx5odmzd/dmI2LY2OHxqe2r+5eh78HIMQMVT8HrgLouPaeHpkIhMocle1GHuc8zssgxT+Lyu9pvn6O0g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=kalrayinc.com; dmarc=pass action=none header.from=kalrayinc.com; dkim=pass header.d=kalrayinc.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kalrayinc.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qyh6O614b/8IkSe3xXMOvUBqzvmThFjUZ7QxLC46PX0=; b=rmGxICwszCUq4zWSwspsPAuwB6rPhweDe1iLbFZgn9ycdPZjTcAjZRP+1XXPlf9S/po0BsZGeVr7h2qR6qEcJ17tfoXl0nRYIy6o5HKLiY2RXWChdpbT1MgT5v682xplNlt6hqQlOuXdJ1/VxsvMYjb+2uhzZ1gduIbjS0uDS4VlDBlRi3XDOeEPtO8jLyHkMxNS81C9I29CdofP4QI1ZZ4GF2fLg4rHrF3cedC55dqD6nb1Hvbz0C+z99KwDdm2auWuY8mWQQiFGKS9MDCJ0+tSo4gce03IAz5Ge54/maynCPCJfY+9C5m8sMaPtgA7lJWoOofYWlXMWdnVHfwB6w== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=kalrayinc.com; From: Julian Vetter To: Arnd Bergmann , Catalin Marinas , Will Deacon , Guo Ren , Huacai Chen , WANG Xuerui , Andrew Morton , Geert Uytterhoeven , Richard Henderson , Niklas Schnelle , Takashi Iwai , Miquel Raynal , David Laight , Johannes Berg , Christoph Hellwig Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-csky@vger.kernel.org, loongarch@lists.linux.dev, linux-arch@vger.kernel.org, Yann Sionneau , Julian Vetter Subject: [PATCH v10 3/4] csky: Use new fallback IO memcpy/memset Date: Mon, 21 Oct 2024 15:31:53 +0200 Message-ID: <20241021133154.516847-4-jvetter@kalrayinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241021133154.516847-1-jvetter@kalrayinc.com> References: <20241021133154.516847-1-jvetter@kalrayinc.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: AS4P192CA0012.EURP192.PROD.OUTLOOK.COM (2603:10a6:20b:5da::20) To PAYP264MB3766.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:118::6) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAYP264MB3766:EE_|MR1P264MB2339:EE_ X-MS-Office365-Filtering-Correlation-Id: e534fd21-48f0-4c24-3243-08dcf1d4e643 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|52116014|7416014|376014|1800799024|921020|38350700014; X-Microsoft-Antispam-Message-Info: T2ZL6eMCe/CVAf5qmUjAJXLDo3vFwC+eSoYWgZSnkqD91akiGQL5cPLNjie49TJPYKYzK5vDn7SRXxG+6aAgrxYEj51XYgKDgPOYj573Yr0MpJ71xrjkXlg2FGLXksl2ysZTM/VRwa8gC8buWLofKXNBf+0qx5w7WzdGat3GGiuqBgwqF5dHvA6WdIVXrguqPrzWlxEuVarWfgnk/B2pu+Se0d/tvRMSqmfUqbF4KtTiSJ8OKgBi0LtNi1Z4AIKkj/oNzU3aZomOojhDqE+odbphUdmKQSfiZIXry2ley82plwVMEjXwKzIagcJfJOWF/2UlLB6JXDtIRCvu8zhaIm3eT+O3vsO8+RijS3ZB54WeDl/ydqv7TTQU9T3oJ/6WfCPesj2udmkYKvZUhe8+lC/sFzRh1wlq2i2qm/l2iDvag7aRmbSJl/dIUMFmVxUrV4rPmZ1DbEGI9CYB32/cgSCGtwR3nSyDfh5SQNneoJmC9i+AW7hSepPQwxfoqetQj9GOhY6UKwDAzOYftwVGXjKzAytZZ1rKhhkbrkdGfeK82rgq655TV9Ka4yB4lIrEXczYvS4Z+YR61R6sh7WoMYE/44mz8UiEt0U/O+fxOetUkAssU0GTRMVWdQ+ilM3uvL/AW+McirUFSRAGgEIk8Gaip3d7opuTa/q8gcXY2cPhbNFBFYR9v53FZtgkHyExGT2Q5daHhmnTrKlc5oyS7Amzpze+w+/+zzYXhGEGwIuG9AbcHbeB2UFO9beWFqBCIJbrVdsk393fs96klyKynyXIigvyAr2trKc7NxeHZFHnRKwFA+HbbxHgAV6aZVlqvBlazRlocCwx1ea1Wxtu6RkENPm9iDghxOIj3G/7VN2d57h0euNcJSKed2rXhUJo0tyAOyi8KmBCNyod2peNsfFmpHkBxw0GDVC0xFaAMTZAtCB9biGalTEpDsgXBz/0ryz p2cRYopPFmrODtxtMzUprhk2k1VbIUatlTJkTgwLLsZ3EwbIIkVaG5UCqLk7YI37lZQkMxNIeV+U2PjPR8PRvjPDqmjiIpyK6wyzJ5AX4si/Q4VzTOwkD6Pgxc52XAVQJGm0+Y1t1vbtKlFdZSyDa5n17ChSt2wUreUGWlhc65Ae1jErWhy+WqO9kZYgcl3xaJPlsBHjT5ZgdJliDvFqERw6JoBAuJaqIhTnK3FDKYlNeCw9uKMq9ylf0FUMrO5x2eylPdoRAh3Q+g5csWlRw1cf3cZsfwvQmF8AibnVgN/j9My33Qf1z8GRpPLz/qf618IPg63QH23blDH3C5a9DFko2D5Izb/9QZ2qASPeqC+ksKJ0Gq8xS8EY++JxJ+k9OA9Chh9omxyai90CLXki5VL8z1rHyjGXYmzdD//XNjZkzyi7USrTwe1RHB1lF X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAYP264MB3766.FRAP264.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230040)(366016)(52116014)(7416014)(376014)(1800799024)(921020)(38350700014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: WMGD2dne5ziNP4UGyiS9Z0nwIH1njwtIRPauGN2C8DuJ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yCKuT2LjQwJMYDLyYZCTRMKEUMjQivqINpbkEkm4JuCJ5c/bwrpfE6T2FJqJWLJ5F54pl3jZf229JP4wYl72LOQgbZ9bPHNxrK1vNRq5yFv+9i+5frtwhH3SZARk46/d/FSAM40O+h9mYj8c6heBK04Z8XV4++UEHxz7yeTUhc0SAFqeSlX6co0man3bshKo/Zvigzioz3kkdqOGNw3Z5PaGJNNCHJqLbCIqq/XryK2wBJWCWZfBC9qm/HJZ/5a1yN1vH1/gHUsgEQ8ZDQJO/LbLUdl6w+n+01HkSwRXvoipwzHt8eHBntSeX9fG7J0cft+gqcKcMrSJqdAQJzvOJLpvH1ycuRLIlCAM5CeQPeywe7vEOmqaPb7SDW4YeBq89NVccdWFmd+r0Ghd5cII29gySRUiBwnrD8VM+s0mi2Vz0Ta3lHxfM20IduS7Ecu0lHE903I88X52zxjt+yKKgB4uYnEJ5PHUbeVh X-OriginatorOrg: kalrayinc.com X-MS-Exchange-CrossTenant-Network-Message-Id: e534fd21-48f0-4c24-3243-08dcf1d4e643 X-MS-Exchange-CrossTenant-AuthSource: PAYP264MB3766.FRAP264.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2024 13:33:07.9985 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8931925d-7620-4a64-b7fe-20afd86363d3 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: QH1PP+A6oSJI72aC/BhZiypWVMTDk2EYnt0Kpzh8W3e2hcmpngqMnfvwon7znGzACj9mOWPILQJoHHUbfyJ8AQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MR1P264MB2339 X-ALTERMIMEV2_out: done Content-Type: text/plain; charset="utf-8" Use the new fallback memcpy_{from,to}io and memset_io functions from asm-generic/io.h on the csky processor architecture. Acked-by: Guo Ren Reviewed-by: Yann Sionneau Signed-off-by: Julian Vetter --- Changes for v10: - Slightly updated commit message to clarify that on csky we now use the fallback from asm-generic/io.h --- arch/csky/include/asm/io.h | 11 ----- arch/csky/kernel/Makefile | 2 +- arch/csky/kernel/io.c | 91 -------------------------------------- 3 files changed, 1 insertion(+), 103 deletions(-) delete mode 100644 arch/csky/kernel/io.c diff --git a/arch/csky/include/asm/io.h b/arch/csky/include/asm/io.h index 4725bb977b0f..ed53f0b47388 100644 --- a/arch/csky/include/asm/io.h +++ b/arch/csky/include/asm/io.h @@ -31,17 +31,6 @@ #define writel(v,c) ({ wmb(); writel_relaxed((v),(c)); mb(); }) #endif =20 -/* - * String version of I/O memory access operations. - */ -extern void __memcpy_fromio(void *, const volatile void __iomem *, size_t); -extern void __memcpy_toio(volatile void __iomem *, const void *, size_t); -extern void __memset_io(volatile void __iomem *, int, size_t); - -#define memset_io(c,v,l) __memset_io((c),(v),(l)) -#define memcpy_fromio(a,c,l) __memcpy_fromio((a),(c),(l)) -#define memcpy_toio(c,a,l) __memcpy_toio((c),(a),(l)) - /* * I/O memory mapping functions. */ diff --git a/arch/csky/kernel/Makefile b/arch/csky/kernel/Makefile index 8a868316b912..de1c3472e8f0 100644 --- a/arch/csky/kernel/Makefile +++ b/arch/csky/kernel/Makefile @@ -2,7 +2,7 @@ extra-y :=3D vmlinux.lds =20 obj-y +=3D head.o entry.o atomic.o signal.o traps.o irq.o time.o vdso.o vd= so/ -obj-y +=3D power.o syscall.o syscall_table.o setup.o io.o +obj-y +=3D power.o syscall.o syscall_table.o setup.o obj-y +=3D process.o cpu-probe.o ptrace.o stacktrace.o obj-y +=3D probes/ =20 diff --git a/arch/csky/kernel/io.c b/arch/csky/kernel/io.c deleted file mode 100644 index 5883f13fa2b1..000000000000 --- a/arch/csky/kernel/io.c +++ /dev/null @@ -1,91 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 - -#include -#include -#include - -/* - * Copy data from IO memory space to "real" memory space. - */ -void __memcpy_fromio(void *to, const volatile void __iomem *from, size_t c= ount) -{ - while (count && !IS_ALIGNED((unsigned long)from, 4)) { - *(u8 *)to =3D __raw_readb(from); - from++; - to++; - count--; - } - - while (count >=3D 4) { - *(u32 *)to =3D __raw_readl(from); - from +=3D 4; - to +=3D 4; - count -=3D 4; - } - - while (count) { - *(u8 *)to =3D __raw_readb(from); - from++; - to++; - count--; - } -} -EXPORT_SYMBOL(__memcpy_fromio); - -/* - * Copy data from "real" memory space to IO memory space. - */ -void __memcpy_toio(volatile void __iomem *to, const void *from, size_t cou= nt) -{ - while (count && !IS_ALIGNED((unsigned long)to, 4)) { - __raw_writeb(*(u8 *)from, to); - from++; - to++; - count--; - } - - while (count >=3D 4) { - __raw_writel(*(u32 *)from, to); - from +=3D 4; - to +=3D 4; - count -=3D 4; - } - - while (count) { - __raw_writeb(*(u8 *)from, to); - from++; - to++; - count--; - } -} -EXPORT_SYMBOL(__memcpy_toio); - -/* - * "memset" on IO memory space. - */ -void __memset_io(volatile void __iomem *dst, int c, size_t count) -{ - u32 qc =3D (u8)c; - - qc |=3D qc << 8; - qc |=3D qc << 16; - - while (count && !IS_ALIGNED((unsigned long)dst, 4)) { - __raw_writeb(c, dst); - dst++; - count--; - } - - while (count >=3D 4) { - __raw_writel(qc, dst); - dst +=3D 4; - count -=3D 4; - } - - while (count) { - __raw_writeb(c, dst); - dst++; - count--; - } -} -EXPORT_SYMBOL(__memset_io); --=20 2.34.1