From patchwork Sat Feb 24 17:42:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg via B4 Relay X-Patchwork-Id: 205911 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp1252866dyb; Sat, 24 Feb 2024 09:43:26 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXYfOjGbkfNBzxKZidFMiDkhj06xaaah1dPi2g41SJRhoCh4TqZ/S+w+0mYJX/g/rA3M4XocMNiDDt9UX1uh2J3Tx5nlw== X-Google-Smtp-Source: AGHT+IEFFDMHPXVXi8FnKs3lKRqU/jqZZbt6dvtbp+nKdxrTIyvnjZGpjUgng0O+O/wU/B3KX6kP X-Received: by 2002:a05:6808:1996:b0:3c1:34f8:718e with SMTP id bj22-20020a056808199600b003c134f8718emr4062328oib.44.1708796606381; Sat, 24 Feb 2024 09:43:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708796606; cv=pass; d=google.com; s=arc-20160816; b=oQdB9cEprNm+rfCUZcsS0Uu3eFPzGHzeggywhnHDQcCBjpfYHBafrFpSzBxQ7h+AeU pyipEdRO+J5l8Thlz8rvCWG3OEdBR2hVubJZBMFazFdhzxe4IXkzbUYp2OwS/ih8LVSh O4hzlKNWAbBA0CRY04q6glOSAlXl2HisvGPma56ZbVdWf0k7v6eTsdcpLE7ksN9N0lA0 TfqIDABLQ5YrU3ZjLy3XKYI5efkSV+m89m2bDTwlfMHHOjisu09hM1s5vQri3x8gPVqe xqniOOruIL1PTtdlo/cEtJyMvYcZ79/G+XINsyIKqq3YAxDY/jz26AtYNB0W7IPmKB+R uWZQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:date:from:dkim-signature; bh=as1vhJnTJ+EuPoSBCrbF/MlzfpRRk/+1GsLtSk5qlmk=; fh=axaiTczyEibQIAZR7tL5HdXpt5eDXppl7AUtI52L8OM=; b=wr7VN7AUOlIau6HJEQrF9Eq1cp6/PiEf46gicDGF5qwyT1UNah4t7uDO2SS783DC7l bmD64Z5BnBcc2pVZsgbqG63TGrNtoSXOTpEm1BFP6npVfQVQecC63comt6CnwjwukFOl Rfu/hIeLFnxVVi052DqnPQl/UkrhYfklPtfuaWPk1YFssNTgs3vHf+oQTiFvZzwOzWPz jOeXIZBtt4ZptR/q3lzB9V4GAu0yOqmYcJYC6ugk5MlS7KK2sm3bNSyWems+E5hlGIQG +c+rOg56/vddkhQnJrWiLxZOEPeu0pcNhDpJBTBSKgN8GsvHKx39O9lm+7WQNkRTU5f8 tSXw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=vKBq28rD; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-79764-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79764-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id kd28-20020a056214401c00b0068d1501ebb9si1503420qvb.458.2024.02.24.09.43.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 09:43:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79764-ouuuleilei=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=@kernel.org header.s=k20201202 header.b=vKBq28rD; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-79764-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79764-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 0FDE51C20C6B for ; Sat, 24 Feb 2024 17:43:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5A9DD4D9E5; Sat, 24 Feb 2024 17:42:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="vKBq28rD" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 4138947A7D; Sat, 24 Feb 2024 17:42:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708796547; cv=none; b=ECNXw0Xg8jCdFP4PihgyZ+++rr9ILKEoYfBCP7TTSL7i+EjDniheWvLSMtcLT2DIM+vaFTmS7LzA68HuPwR/ch3arub1SxiwcRX1k5fRbmYLy0mHSYP5uoPaMBJ71vaUyC0xjdnx4R6/rAEkAM/hbSTmv8PNQeFe3QAphU2WZzw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708796547; c=relaxed/simple; bh=KhibXx79KhV4Nn5Ac7moITyyyPysThl4fpScNz8Pr/M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=DrhjAhYgfKOrGLdFmES+fQLvewQOoBLVuWZ0SngqYeTQUhZnAeF6g0PPnq1G0vgl7nESlqJ4ZgmDKX65Mm0IU5FEfsw09mj1arYmXEdogX20/zdojpjsRyw0xgpAL1y4ILUkwOLHqJ4xCos7jf3fEw0gbMbeZ5n8qxzJ0ngYl5o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=vKBq28rD; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id E5B20C433C7; Sat, 24 Feb 2024 17:42:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708796546; bh=KhibXx79KhV4Nn5Ac7moITyyyPysThl4fpScNz8Pr/M=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=vKBq28rDLYBxWS+6wdcz3Ro6DeCqynaZXnZgYW9pifNgbUAldTOOJrElePN7r/583 5FjNG14v+PULmhB4HC4olHOxqM2yPmyBCobKXtVzMncaO6/478HUdvYQERDZePjTWJ Slc9drLkTWSGDothmavQWfJWNB7SUj5nvcFolS6Oow9CO7x86/gauxxCboux+16PIx LNd4uHOIKT0d0iz68VuihNCSTjRuDcAqGQMzzKTio1/r3OI5BtavbGMU7pnXVvy62A NZZeqb2sGXkZ3Phr9D5WCXjpNtKUnrDr0A3RuiDnAw7G4SH0lAxsWxq66MmS00iO7k bdaLavbDEZ5rw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id D4CF1C48BF6; Sat, 24 Feb 2024 17:42:26 +0000 (UTC) From: Sam Ravnborg via B4 Relay Date: Sat, 24 Feb 2024 18:42:22 +0100 Subject: [PATCH v2 1/7] sparc32: Use generic cmpdi2/ucmpdi2 variants Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240224-sam-fix-sparc32-all-builds-v2-1-1f186603c5c4@ravnborg.org> References: <20240224-sam-fix-sparc32-all-builds-v2-0-1f186603c5c4@ravnborg.org> In-Reply-To: <20240224-sam-fix-sparc32-all-builds-v2-0-1f186603c5c4@ravnborg.org> To: "Maciej W. Rozycki" , sparclinux@vger.kernel.org, Andreas Larsson , Randy Dunlap Cc: Miquel Raynal , linux-parport@lists.infradead.org, "David S. Miller" , Arnd Bergmann , linux-kernel@vger.kernel.org, Sam Ravnborg X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1708796545; l=3720; i=sam@ravnborg.org; s=20230107; h=from:subject:message-id; bh=J7PFWlRTGPOE40ffjTuq4qFkXa+HB/VYE+coSnVem7c=; =?utf-8?q?b=3DvbgHBac6mbEY?= =?utf-8?q?rKMqmpY/6A/xQZQwbFq2qJIc/DAzPT9BwFc2LOH7g4a6bo2kBYCR6oflCdIeHFdn?= r3Zmm3YPC8JijWXAcCsTfvRh+UV4vm59dTk7YY+6QFT67fdRb6ej X-Developer-Key: i=sam@ravnborg.org; a=ed25519; pk=R0+pqV7BRYOAeOIGkyOrSNke7arx5y3LkEuNi37YEyU= X-Endpoint-Received: by B4 Relay for sam@ravnborg.org/20230107 with auth_id=22 X-Original-From: Sam Ravnborg Reply-To: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791803109954958060 X-GMAIL-MSGID: 1791803109954958060 From: Sam Ravnborg Use the generic variants - the implementation is the same. As a nice side-effect fix the following warnings: cmpdi2.c: warning: no previous prototype for '__cmpdi2' [-Wmissing-prototypes] ucmpdi2.c: warning: no previous prototype for '__ucmpdi2' [-Wmissing-prototypes] Signed-off-by: Sam Ravnborg Fixes: 0fcb70851fbf ("Makefile.extrawarn: turn on missing-prototypes globally") Reviewed-by: Randy Dunlap Tested-by: Randy Dunlap # build-tested Reviewed-by: Maciej W. Rozycki Tested-by: Maciej W. Rozycki # build-tested Cc: "David S. Miller" Cc: Andreas Larsson --- arch/sparc/Kconfig | 2 ++ arch/sparc/lib/Makefile | 4 ++-- arch/sparc/lib/cmpdi2.c | 28 ---------------------------- arch/sparc/lib/ucmpdi2.c | 20 -------------------- 4 files changed, 4 insertions(+), 50 deletions(-) diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index b087d4fe00af..734f23daecca 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig @@ -57,6 +57,8 @@ config SPARC32 select CLZ_TAB select DMA_DIRECT_REMAP select GENERIC_ATOMIC64 + select GENERIC_LIB_CMPDI2 + select GENERIC_LIB_UCMPDI2 select HAVE_UID16 select LOCK_MM_AND_FIND_VMA select OLD_SIGACTION diff --git a/arch/sparc/lib/Makefile b/arch/sparc/lib/Makefile index 59669ebddd4e..ee5091dd67ed 100644 --- a/arch/sparc/lib/Makefile +++ b/arch/sparc/lib/Makefile @@ -14,7 +14,7 @@ lib-$(CONFIG_SPARC32) += divdi3.o udivdi3.o lib-$(CONFIG_SPARC32) += copy_user.o locks.o lib-$(CONFIG_SPARC64) += atomic_64.o lib-$(CONFIG_SPARC32) += lshrdi3.o ashldi3.o -lib-$(CONFIG_SPARC32) += muldi3.o bitext.o cmpdi2.o +lib-$(CONFIG_SPARC32) += muldi3.o bitext.o lib-$(CONFIG_SPARC64) += multi3.o lib-$(CONFIG_SPARC64) += fls.o lib-$(CONFIG_SPARC64) += fls64.o @@ -51,5 +51,5 @@ lib-$(CONFIG_SPARC64) += copy_in_user.o memmove.o lib-$(CONFIG_SPARC64) += mcount.o ipcsum.o xor.o hweight.o ffs.o obj-$(CONFIG_SPARC64) += iomap.o -obj-$(CONFIG_SPARC32) += atomic32.o ucmpdi2.o +obj-$(CONFIG_SPARC32) += atomic32.o obj-$(CONFIG_SPARC64) += PeeCeeI.o diff --git a/arch/sparc/lib/cmpdi2.c b/arch/sparc/lib/cmpdi2.c deleted file mode 100644 index 333367fe7353..000000000000 --- a/arch/sparc/lib/cmpdi2.c +++ /dev/null @@ -1,28 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -#include - -#include "libgcc.h" - -word_type __cmpdi2(long long a, long long b) -{ - const DWunion au = { - .ll = a - }; - const DWunion bu = { - .ll = b - }; - - if (au.s.high < bu.s.high) - return 0; - else if (au.s.high > bu.s.high) - return 2; - - if ((unsigned int) au.s.low < (unsigned int) bu.s.low) - return 0; - else if ((unsigned int) au.s.low > (unsigned int) bu.s.low) - return 2; - - return 1; -} - -EXPORT_SYMBOL(__cmpdi2); diff --git a/arch/sparc/lib/ucmpdi2.c b/arch/sparc/lib/ucmpdi2.c deleted file mode 100644 index 82c1cccb1264..000000000000 --- a/arch/sparc/lib/ucmpdi2.c +++ /dev/null @@ -1,20 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -#include -#include "libgcc.h" - -word_type __ucmpdi2(unsigned long long a, unsigned long long b) -{ - const DWunion au = {.ll = a}; - const DWunion bu = {.ll = b}; - - if ((unsigned int) au.s.high < (unsigned int) bu.s.high) - return 0; - else if ((unsigned int) au.s.high > (unsigned int) bu.s.high) - return 2; - if ((unsigned int) au.s.low < (unsigned int) bu.s.low) - return 0; - else if ((unsigned int) au.s.low > (unsigned int) bu.s.low) - return 2; - return 1; -} -EXPORT_SYMBOL(__ucmpdi2); From patchwork Sat Feb 24 17:42:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg via B4 Relay X-Patchwork-Id: 205913 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp1252901dyb; Sat, 24 Feb 2024 09:43:34 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXR7qySLkaca6LomtOQ7tKH/QN0btMKLMz83uJ1nXGXTx5cGxAICbq6mztkElCPcOM9oGjKyL05ZLiC6Iu1s4T9Wsve2Q== X-Google-Smtp-Source: AGHT+IE0hCKxaJCP+YUSL+EB/ASiRbCN2ygsra8iUW28Wt22xigfM6NyDJQKpNQpSz7F8sdO8kLb X-Received: by 2002:aa7:c447:0:b0:565:add8:5fd9 with SMTP id n7-20020aa7c447000000b00565add85fd9mr958400edr.0.1708796614255; Sat, 24 Feb 2024 09:43:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708796614; cv=pass; d=google.com; s=arc-20160816; b=IEl8dPFOK+Exm/oQ4Ea31q+Q3TxMgO9q2gyTn8UqKL0LuBeORpftYfvLIe/uT1fwnr LqyBYaGQviEg2ffrjEwmPXZGeaM45veoHLOrIVl/eXGNUXwvuqJmKZBDf0pjbgmZ1OYT CEzt3haFzM1CK8hQk3z7zA0jH6Onhcn4SO2TQgLJVpHqXMNx1ZPmpt73Q9nenB9EyKfF J64O4ixiFkR8wUwOGdj1t5CSs2vrA9GuNBmS2hAMqySB5iQO2urGbr+F/b5SqOD/PMKt hw1LNS5IwK5+WqIQMTb57hgxPk1Mup44iak6WKQyqJyWVpBkk3dX1oAnxR93lLLe03yM QuXw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:date:from:dkim-signature; bh=dpwYUz+pjbegrNW0qAQPtS6j2wHaKyvmy+DOUTu854s=; fh=axaiTczyEibQIAZR7tL5HdXpt5eDXppl7AUtI52L8OM=; b=KUITqsbLKeOICp7u3DJi2q4oCaWuN2kiQ+pwXyrVUOHw2uVTWpKGegAYDRav6+C4Ds 9dv+JdYHHhX1j8zmjCIech34UvMPL0A/141eE7TboBbB8K4NewREOk8y+PMEQDwYh6nq xot3QMVIj+Bv6djS3p1+eZECFIgp8ETCQFDa8Bf/Ewe9H9WcujNdEA3abuKIvCxTrVJ4 ObRdba0nlK9K5fZuXNbpXHuxolxlLKh8GUA3vVu9m1oHHSJZry1wt7zdev5PoohNX3ld KNAzel4i7laV0NBuZ7Rx2TMVJrvYkuBsPRha6zS5tftkJ1xb3kWtpTEk94G3+hbIkVBc SxTA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tHtWOHbP; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-79763-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79763-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id o30-20020a509b1e000000b005642c27ffb9si601629edi.386.2024.02.24.09.43.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 09:43:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79763-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tHtWOHbP; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-79763-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79763-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 668751F21BC1 for ; Sat, 24 Feb 2024 17:43:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AA73D4D9F6; Sat, 24 Feb 2024 17:42:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="tHtWOHbP" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 4134C47A6B; Sat, 24 Feb 2024 17:42:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708796547; cv=none; b=AHG6tMwUU3gm6AjQe8j5rgFKgjr7LvfshD2v30ZB+EB7UAYbNZpNJ5HOvlv7lxy9WQLAm8o7XVtxK5SDaHFiW8ShHv196IlWmsrJQ+svrII3OalhIgxYHx1emIr6uat+dLk9am70tmMLJNtPFX4y+sIvQI8zYwTjAgxk35SBNok= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708796547; c=relaxed/simple; bh=bGfNa9P0bcSr1b3FZ6CzcNWFHSx5/mcdtp5dllWw6FY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=DCPwkug7Rk1gd32M1GjT9QoAyXfelMJRbrZhZ0WrzB1cqpHQWpMyIP5CgxaDvwm1HGfFogb8PqeGIPOkM16aeJsHGskpeZnnpEwjomH8G+R3M8KWdVDhF33aKnXzhZvB1IwTIw/ob0V5ILpyx6F4jVvE45DifzV6nqAwl5zuDGc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=tHtWOHbP; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id F3FBCC43390; Sat, 24 Feb 2024 17:42:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708796547; bh=bGfNa9P0bcSr1b3FZ6CzcNWFHSx5/mcdtp5dllWw6FY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=tHtWOHbPkr46dvIZ4Ubq0+uhrNV29D3fsqWKnp0cg3Z62cXU2E7HbP3xQF9F+5He0 WhYC8Jh7CyEbv9Y6qbZwMxuS/8WYVu3rs+pRZwmtNoEXp/s+nHWoc4ixzBpWrCHyJN CsJpOzK8wTKUlGXSAEymJj3cfw443AbvgPVBEzPimCMq+1Le5bPHTqSdbMVlV+q0Ap m1MKCftBrWlA+TqQFg9gxkZqKX33doaBgvWHr++KS9902f/TDPQId7U2mkagf1PhKb KJDE7fa8oiBFyUDUmga1t2pbA4ChOgDKrQBQ6XA0yI8gUBTF/Mz634MdGCDsxSBth6 Ks4Zu63LwbfCQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3049C54E4F; Sat, 24 Feb 2024 17:42:26 +0000 (UTC) From: Sam Ravnborg via B4 Relay Date: Sat, 24 Feb 2024 18:42:23 +0100 Subject: [PATCH v2 2/7] sparc32: Fix build with trapbase Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240224-sam-fix-sparc32-all-builds-v2-2-1f186603c5c4@ravnborg.org> References: <20240224-sam-fix-sparc32-all-builds-v2-0-1f186603c5c4@ravnborg.org> In-Reply-To: <20240224-sam-fix-sparc32-all-builds-v2-0-1f186603c5c4@ravnborg.org> To: "Maciej W. Rozycki" , sparclinux@vger.kernel.org, Andreas Larsson , Randy Dunlap Cc: Miquel Raynal , linux-parport@lists.infradead.org, "David S. Miller" , Arnd Bergmann , linux-kernel@vger.kernel.org, Sam Ravnborg X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1708796545; l=4806; i=sam@ravnborg.org; s=20230107; h=from:subject:message-id; bh=yODVsKtXRLRL5P00tESgJdJda/SYlfy6l2Y847zfeCU=; =?utf-8?q?b=3D9FtF0vthGV5K?= =?utf-8?q?V/hPt5Yc5TbLmZTI0ewIdffIWFA7tPr+zMCJ1cWT6xw/uPgyN67nKD8Ds9tpzUpF?= so4wk2r8AiAQBjVYbWLaHrouAw+VOauFmCspxcSiA8y0iTb2VBVv X-Developer-Key: i=sam@ravnborg.org; a=ed25519; pk=R0+pqV7BRYOAeOIGkyOrSNke7arx5y3LkEuNi37YEyU= X-Endpoint-Received: by B4 Relay for sam@ravnborg.org/20230107 with auth_id=22 X-Original-From: Sam Ravnborg Reply-To: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791803118906294694 X-GMAIL-MSGID: 1791803118906294694 From: Sam Ravnborg Fix the following build errors: irq_32.c:258:7: error: array subscript [16, 79] is outside array bounds of 'struct tt_entry[1] irq_32.c:271:14: error: assignment to 'struct tt_entry *' from incompatible pointer type 'struct tt_entry (*)[] trapbase is a pointer to an array of tt_entry, but the code declared it as a pointer so the compiler see a single entry and not an array. Fix this by modifyinf the declaration to be an array, and modify all users to take the address of the first member. Signed-off-by: Sam Ravnborg Acked-by: Randy Dunlap Tested-by: Randy Dunlap # build-tested Cc: Andreas Larsson Cc: "David S. Miller" --- arch/sparc/kernel/irq_32.c | 6 +++--- arch/sparc/kernel/kernel.h | 8 ++++---- arch/sparc/kernel/kgdb_32.c | 4 ++-- arch/sparc/kernel/leon_smp.c | 6 +++--- arch/sparc/kernel/setup_32.c | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/arch/sparc/kernel/irq_32.c b/arch/sparc/kernel/irq_32.c index e8452be5123b..8605dd710f3c 100644 --- a/arch/sparc/kernel/irq_32.c +++ b/arch/sparc/kernel/irq_32.c @@ -268,11 +268,11 @@ int sparc_floppy_request_irq(unsigned int irq, irq_handler_t irq_handler) if (sparc_cpu_model != sparc_leon) { struct tt_entry *trap_table; - trap_table = &trapbase_cpu1; + trap_table = &trapbase_cpu1[0]; INSTANTIATE(trap_table) - trap_table = &trapbase_cpu2; + trap_table = &trapbase_cpu2[0]; INSTANTIATE(trap_table) - trap_table = &trapbase_cpu3; + trap_table = &trapbase_cpu3[0]; INSTANTIATE(trap_table) } #endif diff --git a/arch/sparc/kernel/kernel.h b/arch/sparc/kernel/kernel.h index 15da3c0597a5..a8fb7c0bf053 100644 --- a/arch/sparc/kernel/kernel.h +++ b/arch/sparc/kernel/kernel.h @@ -138,10 +138,10 @@ extern unsigned int t_nmi[]; extern unsigned int linux_trap_ipi15_sun4d[]; extern unsigned int linux_trap_ipi15_sun4m[]; -extern struct tt_entry trapbase; -extern struct tt_entry trapbase_cpu1; -extern struct tt_entry trapbase_cpu2; -extern struct tt_entry trapbase_cpu3; +extern struct tt_entry trapbase[]; +extern struct tt_entry trapbase_cpu1[]; +extern struct tt_entry trapbase_cpu2[]; +extern struct tt_entry trapbase_cpu3[]; extern char cputypval[]; diff --git a/arch/sparc/kernel/kgdb_32.c b/arch/sparc/kernel/kgdb_32.c index 58ad3f7de1fb..3b2c673ec627 100644 --- a/arch/sparc/kernel/kgdb_32.c +++ b/arch/sparc/kernel/kgdb_32.c @@ -37,7 +37,7 @@ void pt_regs_to_gdb_regs(unsigned long *gdb_regs, struct pt_regs *regs) gdb_regs[GDB_Y] = regs->y; gdb_regs[GDB_PSR] = regs->psr; gdb_regs[GDB_WIM] = 0; - gdb_regs[GDB_TBR] = (unsigned long) &trapbase; + gdb_regs[GDB_TBR] = (unsigned long) &trapbase[0]; gdb_regs[GDB_PC] = regs->pc; gdb_regs[GDB_NPC] = regs->npc; gdb_regs[GDB_FSR] = 0; @@ -72,7 +72,7 @@ void sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *p) gdb_regs[GDB_PSR] = t->kpsr; gdb_regs[GDB_WIM] = t->kwim; - gdb_regs[GDB_TBR] = (unsigned long) &trapbase; + gdb_regs[GDB_TBR] = (unsigned long) &trapbase[0]; gdb_regs[GDB_PC] = t->kpc; gdb_regs[GDB_NPC] = t->kpc + 4; gdb_regs[GDB_FSR] = 0; diff --git a/arch/sparc/kernel/leon_smp.c b/arch/sparc/kernel/leon_smp.c index 991e9ad3d3e8..1ee393abc463 100644 --- a/arch/sparc/kernel/leon_smp.c +++ b/arch/sparc/kernel/leon_smp.c @@ -245,13 +245,13 @@ void __init leon_smp_done(void) /* Free unneeded trap tables */ if (!cpu_present(1)) { - free_reserved_page(virt_to_page(&trapbase_cpu1)); + free_reserved_page(virt_to_page(&trapbase_cpu1[0])); } if (!cpu_present(2)) { - free_reserved_page(virt_to_page(&trapbase_cpu2)); + free_reserved_page(virt_to_page(&trapbase_cpu2[0])); } if (!cpu_present(3)) { - free_reserved_page(virt_to_page(&trapbase_cpu3)); + free_reserved_page(virt_to_page(&trapbase_cpu3[0])); } /* Ok, they are spinning and ready to go. */ smp_processors_ready = 1; diff --git a/arch/sparc/kernel/setup_32.c b/arch/sparc/kernel/setup_32.c index e3b72a7b46d3..704375c061e7 100644 --- a/arch/sparc/kernel/setup_32.c +++ b/arch/sparc/kernel/setup_32.c @@ -67,7 +67,7 @@ static void prom_sync_me(void) __asm__ __volatile__("wr %0, 0x0, %%tbr\n\t" "nop\n\t" "nop\n\t" - "nop\n\t" : : "r" (&trapbase)); + "nop\n\t" : : "r" (&trapbase[0])); prom_printf("PROM SYNC COMMAND...\n"); show_mem(); @@ -285,7 +285,7 @@ void __init setup_arch(char **cmdline_p) int i; unsigned long highest_paddr; - sparc_ttable = &trapbase; + sparc_ttable = &trapbase[0]; /* Initialize PROM console and command line. */ *cmdline_p = prom_getbootargs(); From patchwork Sat Feb 24 17:42:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg via B4 Relay X-Patchwork-Id: 205910 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp1252851dyb; Sat, 24 Feb 2024 09:43:23 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX930lJwN8AZFFEKZa5R7rrQATLUJOmiPBWAZQ3Tr/0kTtNeR7WqrF3bdNKqlTqt7OeCfpsEDYRQta1IAzL+TieyRzodQ== X-Google-Smtp-Source: AGHT+IHZwM42QIOgn6I7f1QBdrdeUbXaci3p+emSI1EnboGApqL83Qz4ONtDOpIuZJmlpcvPxNdo X-Received: by 2002:a05:6a21:8cc9:b0:1a0:a43b:cbd8 with SMTP id ta9-20020a056a218cc900b001a0a43bcbd8mr3941882pzb.59.1708796603242; Sat, 24 Feb 2024 09:43:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708796603; cv=pass; d=google.com; s=arc-20160816; b=r4Dh7Ttt+hHcBNPWRzwrvr1+gxBD1zDXJO0Jzjs0Gzu12UUO/3YamDZ1pZZFhaLUBw /i6ofB91FsamsxSFIMpQ2045v4Frcj+PTNExpMXO/T38o0Dss2LCbCaQkUg6m8w1RoXK +9b0AfuKwAUgsrPzGR618OaU4h/kaSat0yEJzHNB7HqHv3or1uDNZ7ebJSWnbW1VVrht U4xGqevLWc+7h+v1lbd6efe38dengAfKnqKi9csOfphXoFCxSo/NCw0aJfgOJ9e5n2gK NCNvfeVDniobFxxtcIVm+Yvx4hI/V9OArSmvRhvQUlij2XBbbp42XU9jT+MRQVHECSYH BlOQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:date:from:dkim-signature; bh=HdkwYBE87KAl2eVhFl1UlsklVaFc2wKkdEVxWRc/lYA=; fh=axaiTczyEibQIAZR7tL5HdXpt5eDXppl7AUtI52L8OM=; b=fdzw5lOIb5x6IAE6ozL5Cpr2BQd7ZzBOQGoNGFrGZsb++IEGRqC4OpSh61B9x5rMy8 DEigAvPnxanIqhOMzAGqhKdfi3iwmHH0JO8mBK5sDf949TOL2ALqkN1HriFLQvNJYIJc 6lH93y/hdFBU4F2Pnge/PZWUUKadWpfT4nfvKMVlQqrB45bjAWOTbiUzjDTFJl/y6k4H f2oHueh4DXijhidyGajszB6/vV9WwI6MLRUAx8gc/ObdqcQ3fOAfYGvDI2Us3nVMGpuu gv485vclU5h3Nzbs7uIZeZm1NCESrHmXWNSurnEYjA1cq510NCIzXlp6e28ltQ4GHbgB 8atQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pdvWCZAS; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-79766-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79766-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id i21-20020a635415000000b005dc97d88896si1146049pgb.729.2024.02.24.09.43.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 09:43:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79766-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pdvWCZAS; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-79766-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79766-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 11AD52827C1 for ; Sat, 24 Feb 2024 17:43:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3329D4D5B5; Sat, 24 Feb 2024 17:42:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pdvWCZAS" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 6650F47F59; Sat, 24 Feb 2024 17:42:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708796547; cv=none; b=mbTamu+tk0kP0zUwTZuOs5BLS4DefPyraK+l7lMXHCfDNcsx+Zy9UkGkheL/hOAslN1Yy21o2UxQ0HDLvkOSLfO3wKmX633XfTzJJno/wkPGg9P9hpb0bEb/AnVJu/gYdKEGsjvEs4/OE41HVBXzAeybvoCra3cab/InMbrLUUc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708796547; c=relaxed/simple; bh=cTWwSnGLk/pM/d3HuBGFVevuzYQU4YydbqLVII6r0V4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rphqdJDW6uhYDld/tTzca9+SDGzDRUqkkTUQBYigkkuwSP8TkuzpWX3T/sIZHf5gmiQRaoO3pyrRdTOVRww+lVxOgT2qrNebHUj8nomwmVmg33FnZvFD3LjVq5lNKJ1C6Peub5yFdTt69vMwYkOj3cgxh1fbzPDuEuZYyrByq68= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=pdvWCZAS; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id 0ACDDC43394; Sat, 24 Feb 2024 17:42:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708796547; bh=cTWwSnGLk/pM/d3HuBGFVevuzYQU4YydbqLVII6r0V4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=pdvWCZASAi+WNfRDh2KsqzBL+9Hc/gzwtu7buOAMWaXRROJV1/Dt756GV8/vgOzDl +9NWVatyLUb4uanYAYh/aq1FRsJM5q5IeXjSUyAGJlQvCsL48hwIK84adtC7b7EZnm Lx0WjCtragrMPIW7fw42Fno5S6ALJydead7DUW4FZQZszKlx5XGU48o9IeulMRkipI zJDik67RT0wgv+Y3lv0dEGP9JR+t2Z7svtiprL+gELIPFXIqQTWo2GhSj/9xr/E6lN h6pppKoeplQVj36+loti7iq9it37sYNw3PGAoRp7y4TdeGvBlHor0qMVxa7GU/Jgaz 5xJqmXe1e6tAg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF6A3C54E49; Sat, 24 Feb 2024 17:42:26 +0000 (UTC) From: Sam Ravnborg via B4 Relay Date: Sat, 24 Feb 2024 18:42:24 +0100 Subject: [PATCH v2 3/7] mtd: maps: sun_uflash: Declare uflash_devinit static Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240224-sam-fix-sparc32-all-builds-v2-3-1f186603c5c4@ravnborg.org> References: <20240224-sam-fix-sparc32-all-builds-v2-0-1f186603c5c4@ravnborg.org> In-Reply-To: <20240224-sam-fix-sparc32-all-builds-v2-0-1f186603c5c4@ravnborg.org> To: "Maciej W. Rozycki" , sparclinux@vger.kernel.org, Andreas Larsson , Randy Dunlap Cc: Miquel Raynal , linux-parport@lists.infradead.org, "David S. Miller" , Arnd Bergmann , linux-kernel@vger.kernel.org, Sam Ravnborg X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1708796545; l=1022; i=sam@ravnborg.org; s=20230107; h=from:subject:message-id; bh=1CQEn1rR62vDngISirB1bMAgXc9+BD3JSgTxbntNHpM=; =?utf-8?q?b=3DJ7vmq08a1WA/?= =?utf-8?q?yKaJnn8961lo1M50MdiWJaS56NAsS66meT3rhpm7+wO7l1LTep/srhdb9PoD+9SA?= OHZdMimeCmy5hI9xnAPkeScVn7WU6Yy3CoFvNqOgAlKwHkwNbP+z X-Developer-Key: i=sam@ravnborg.org; a=ed25519; pk=R0+pqV7BRYOAeOIGkyOrSNke7arx5y3LkEuNi37YEyU= X-Endpoint-Received: by B4 Relay for sam@ravnborg.org/20230107 with auth_id=22 X-Original-From: Sam Ravnborg Reply-To: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791803106955097736 X-GMAIL-MSGID: 1791803106955097736 From: Sam Ravnborg This fixes the following warning: sun_uflash.c:50:5: error: no previous prototype for 'uflash_devinit' Signed-off-by: Sam Ravnborg Fixes: 0fcb70851fbf ("Makefile.extrawarn: turn on missing-prototypes globally") Reviewed-by: Randy Dunlap Tested-by: Randy Dunlap # build-tested Cc: Andreas Larsson Cc: "David S. Miller" Acked-by: Miquel Raynal --- drivers/mtd/maps/sun_uflash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/maps/sun_uflash.c b/drivers/mtd/maps/sun_uflash.c index f58cfb15d6e8..b69dade3f7ad 100644 --- a/drivers/mtd/maps/sun_uflash.c +++ b/drivers/mtd/maps/sun_uflash.c @@ -47,7 +47,7 @@ struct map_info uflash_map_templ = { .bankwidth = UFLASH_BUSWIDTH, }; -int uflash_devinit(struct platform_device *op, struct device_node *dp) +static int uflash_devinit(struct platform_device *op, struct device_node *dp) { struct uflash_dev *up; From patchwork Sat Feb 24 17:42:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg via B4 Relay X-Patchwork-Id: 205912 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp1252875dyb; Sat, 24 Feb 2024 09:43:28 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXYMeYM+HCHGLQM3tSdB3CxgO/PRcDB4smXmWJZP2hIFl3g+0gRe5VivqJFcHKLLNTPXfd1MpKH7I5NE1W1Ws9SCjr56Q== X-Google-Smtp-Source: AGHT+IF6CWGY9DZQOQPpYr1L5FZTokWFr9VOvrDSZKUQeBR66DI7jKEEbAkI4IEJ70k4TA6CmGAi X-Received: by 2002:a17:903:230f:b0:1dc:8ad6:5d72 with SMTP id d15-20020a170903230f00b001dc8ad65d72mr1434927plh.31.1708796608662; Sat, 24 Feb 2024 09:43:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708796608; cv=pass; d=google.com; s=arc-20160816; b=H0NEPbeB8wS+OmtNsqimtUX1vkDFGvnYP/oiUg+kIrVKMfbDT38IOJ+B0k6i07dpho v5zepvUsMccq6t7E+6ezdFfQUuC6hpChOHduLxGDPq1kw5JnSpSVPSUpDBu+PjoN3pFw FsgNrJlJvmrtYd0hn/PJuaQzUoyEZrO8uZil6XtV6nW92yn6kIEVEJzH8RebrBeUVOfc FKkqUPYAKC/7zNUEpkYXLUzfE++MASWQS+dxqCwckx9GBKnfeXVlXXs6vqcIpuk/sGuZ tPXTY9JlMxk0dXHQPkYVbfeAvJP2yzomdKDn3cLC9z1SHqp+WtJdMYjhG4Jb1HGImKWw xs+w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:date:from:dkim-signature; bh=4HpOk7zZE7nx/sZ7j8F9kKuPChnwCSpHi/P5GU5/Vbo=; fh=axaiTczyEibQIAZR7tL5HdXpt5eDXppl7AUtI52L8OM=; b=QBvbkWCpr/s78guXYwGtfRhf2P6FmpZk1Qyg+R/y81osp+bWX4Yt7W/WQ+fyF8ZHD2 pkllD8l8XdcmObY7ahBVLMoyE+W7MYPrCHKdwHZ4LCRjIL4PffBVTNwCHXs11D0klvoM Z828JAGwBd/ODjBBaSnT2vp2qiiflpHg1lRmj1VbpfI7L2PYdKbsj1CDcXe5Nytj8ZkP SbGhVCpYubbuiZBrQJI/a7UZgbeMHrIppJSLny+uJvU1jVRc3gLF0bxD7DlJyJHVFvle h2GbT9jUy8S2gF75dogoqNA7pAzP/M4qlPf6IoyETUBYRK0RgEgkEqbj1zpKQIu1cxU4 2oag==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TRg3FNRX; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-79767-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79767-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id mi6-20020a17090b4b4600b00295cd8cf1fasi1174795pjb.178.2024.02.24.09.43.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 09:43:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79767-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TRg3FNRX; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-79767-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79767-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id E332BB21CEF for ; Sat, 24 Feb 2024 17:43:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2F5584D5B0; Sat, 24 Feb 2024 17:42:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="TRg3FNRX" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 6F2BA481C6; Sat, 24 Feb 2024 17:42:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708796547; cv=none; b=h7bo6VneFcAoDDLKYQ0rFRvxfovH0yXvJGGweqpO2IaFLMD5ZCrXcluWDtAGR17MGxPS2k5nVvOhKkvOp/SuferOuB8FTvOvyxylrkfUlAbskhVCFSRTLiNVF3VvQfVLJribdrE2IAaRgpZNW8b/CssMi/Cr6FAp3xwPdrhK780= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708796547; c=relaxed/simple; bh=mvWrNAqQfzrlCBLUO5SP77modfdYW8iRs5f0ks8WiYM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CZw6Ee7ZESsD9vvZwuZf3687TcrFcZVMtRkVshlD1Jp7E9aAJ7SHJ1Z2znnCtn5JY1oKHlHzJAdkU3jobJhXRzOi9tMyOvIONG4LRStWJ+XgbcxVME8j82DTAr7pR2hhf4QJjTwhO7kUPrwyG0yZULPWaY7mgI2hDCfsrlgx7s8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TRg3FNRX; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id 194CBC43399; Sat, 24 Feb 2024 17:42:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708796547; bh=mvWrNAqQfzrlCBLUO5SP77modfdYW8iRs5f0ks8WiYM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=TRg3FNRXQk/dYRUqBb81VFFqX2O9FBHEUOTkyFKhmU5G0Qy8NkLxBTtg1HpDxI1YE U/DJDyeN4SC0RthrLs9UjcYGbn0CvHwgXwMeAaIhESq5x5Cn05EIDFApr7JO8XNjop SfIO5pD7e8qmk9adENcW/Z1QBJTTujB+rhOn/Xy3OtI1O4M8PMDD5hFMp+s9MIvvlv Bpq3TPtab7eZcxRUPYk6hmXZJXbwC7FspvQKZSFu1dlXRYH/nqgsluRVx24BvoMp58 PjdUFXSJ9PsuTyo5B11UUoPItrFzFMb5Dn18Eez2tbFLx4nxuvcD6mOM1m5StVP4oE YTIyXVUwBPYFw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08FA0C5478C; Sat, 24 Feb 2024 17:42:27 +0000 (UTC) From: Sam Ravnborg via B4 Relay Date: Sat, 24 Feb 2024 18:42:25 +0100 Subject: [PATCH v2 4/7] sparc32: Do not select ZONE_DMA Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240224-sam-fix-sparc32-all-builds-v2-4-1f186603c5c4@ravnborg.org> References: <20240224-sam-fix-sparc32-all-builds-v2-0-1f186603c5c4@ravnborg.org> In-Reply-To: <20240224-sam-fix-sparc32-all-builds-v2-0-1f186603c5c4@ravnborg.org> To: "Maciej W. Rozycki" , sparclinux@vger.kernel.org, Andreas Larsson , Randy Dunlap Cc: Miquel Raynal , linux-parport@lists.infradead.org, "David S. Miller" , Arnd Bergmann , linux-kernel@vger.kernel.org, Sam Ravnborg X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1708796545; l=1855; i=sam@ravnborg.org; s=20230107; h=from:subject:message-id; bh=e4J0zd9pY2ujVasdD/OCfxLoCPAiNjhFop1a9KlpN8Y=; =?utf-8?q?b=3DMVGnDmkOPaAA?= =?utf-8?q?7gRzYjqyp6PXBzdF71VyxCP8e0uInzrhjO9FFoFgAN2oOm0ccll9Qw/OROQJGh0b?= tBxygqh1CQrVXFSrK/1kydoqp55XdUlRYUubtHR+KhsaSKdOG8NN X-Developer-Key: i=sam@ravnborg.org; a=ed25519; pk=R0+pqV7BRYOAeOIGkyOrSNke7arx5y3LkEuNi37YEyU= X-Endpoint-Received: by B4 Relay for sam@ravnborg.org/20230107 with auth_id=22 X-Original-From: Sam Ravnborg Reply-To: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791803113074573434 X-GMAIL-MSGID: 1791803113074573434 From: Sam Ravnborg sparc32 has no limited DMA zone so there is no need to select ZONE_DMA. Based on analysis from Marciej: " Actually I think ZONE_DMA should go too (it's linked to GENERIC_ISA_DMA, isn't it? -- cf. commit 5ac6da669e24 ("[PATCH] Set CONFIG_ZONE_DMA for arches with GENERIC_ISA_DMA")), and the whole thing use: Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") The GENERIC_ISA_DMA option itself was added to arch/sparc/config.in with 2.5.31 as: define_bool CONFIG_GENERIC_ISA_DMA y despite of: define_bool CONFIG_ISA n " The sparc32 code did not differ between ZONE_NORMAL and ZONE_DMA, which confirms the above. This patch drop ZONE_DMA. Signed-off-by: Sam Ravnborg Reported-by: "Maciej W. Rozycki" Cc: Andreas Larsson Cc: "David S. Miller" Cc: Randy Dunlap Cc: Maciej W. Rozycki Cc: Arnd Bergmann --- arch/sparc/Kconfig | 1 - arch/sparc/mm/srmmu.c | 1 - 2 files changed, 2 deletions(-) diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index 734f23daecca..bdbde506c01e 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig @@ -62,7 +62,6 @@ config SPARC32 select HAVE_UID16 select LOCK_MM_AND_FIND_VMA select OLD_SIGACTION - select ZONE_DMA config SPARC64 def_bool 64BIT diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c index 852085ada368..7aae2f6f4973 100644 --- a/arch/sparc/mm/srmmu.c +++ b/arch/sparc/mm/srmmu.c @@ -975,7 +975,6 @@ void __init srmmu_paging_init(void) { unsigned long max_zone_pfn[MAX_NR_ZONES] = { 0 }; - max_zone_pfn[ZONE_DMA] = max_low_pfn; max_zone_pfn[ZONE_NORMAL] = max_low_pfn; max_zone_pfn[ZONE_HIGHMEM] = highend_pfn; From patchwork Sat Feb 24 17:42:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg via B4 Relay X-Patchwork-Id: 205914 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp1253075dyb; Sat, 24 Feb 2024 09:44:03 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVeLzDAR/i5fRklRXBTI5ntOTsoSWR0PqsJe9YqJwUnFJKENsVZU/8Ff/FWQbgG5kwLMqrlGwneIZuYQv74a083zeRCAw== X-Google-Smtp-Source: AGHT+IEQmaR9cFN7Cxp0YQYvkPCP/UEcuhSm7608iho9gHTtsMZrJhJk3iKUwkZBHW61bmzZjxhN X-Received: by 2002:a05:6871:2b04:b0:21e:bbdf:8b94 with SMTP id dr4-20020a0568712b0400b0021ebbdf8b94mr3662932oac.37.1708796643491; Sat, 24 Feb 2024 09:44:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708796643; cv=pass; d=google.com; s=arc-20160816; b=S54rcHa5LDMMkRqMs7RnyyW8HIj55KiMAZLUnz7tEptUoFo+kfO6e33uu4uCEUelaU paROulh1qS73m5uhGv21tXda7BLoyzibMvqz0qTmh+bgP5S9kpJTKBdkDU3/uEWwDoe5 uuajRXssjKJC9N26I+mtUqjZS2+sadKYKOnmPPQrhfmsesUss1icmPyEbCQOGLYq9XSW 1AhpSIV7Klw9OHImj4bs727ED7hTz18o0N/vci96bg+1xRHe5rXgBDNhfbRDE/duBq4W lcu91HZIcftQKjhDpxHzOVNZ9SgBcXsS2IcLeDGfsRSuyAf+XkOaxl/W4wgcchhWIdhv Ixmw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:date:from:dkim-signature; bh=znUJV/NADeyhFc4Ob5OZEgisoHIeh9Fz/mBlRZdw2sc=; fh=axaiTczyEibQIAZR7tL5HdXpt5eDXppl7AUtI52L8OM=; b=PODmZa/YS+aq6361y/NYXRuWqJBIcSckEN7Lq3LMMo5hlR4Azw12JNMHFYa2tJUiLu 0tKZoi8CoGUt9L6SzjfF5qS3FpHwIU3wXQ9Ts7LVjCxBIKzDgm8rQhhomMvWcgt+e8ic 0vA4YLaKT+roLudYTLq1kNogflan6jLC/ZMBeyFWQZloqLek2keWvisapsjvitoozGNw dXVMV+uHtwCBaBusPeQKrVng8GBociPHpaGB9r9JjndyJxr7CVB9XWt4P5B2OeROZwe5 oTkhA3CKUxLyImRZMWC9USfurM3c3ei9BFcrFxN5Qlub+V0uq6TPOsCBtXa0yNNiISrO zB9A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pCZSbrwk; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-79768-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79768-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id e1-20020a636901000000b005cee178fe54si1169202pgc.222.2024.02.24.09.44.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 09:44:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79768-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pCZSbrwk; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-79768-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79768-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 497682827CD for ; Sat, 24 Feb 2024 17:44:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 53D294EB44; Sat, 24 Feb 2024 17:42:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pCZSbrwk" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 709B3481D0; Sat, 24 Feb 2024 17:42:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708796547; cv=none; b=jwM1l/7KJQVNopp3tQfekbjP1vb71dPHVEtc8V9qVeWldwYl/Hluy6A2NS6T+aCwg/UtZlcRqDIj7vKWQ/r1uV+x6N3pK1WBAKWN8EDzNT+d2nLr3Xx5JCRTYxebLPl2+TqVX9udyrwJE5ANhGVfKnYmew6K1HYTIaMKDiamvlo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708796547; c=relaxed/simple; bh=u0AAmcTQTypGp4uSwwmS/uHNMvpmNjjwLex7HeF5FKw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=OIcKlnm78ckSUNfnsmqToafOa7LA0KrTUpFhW5svbUE/JPH17pj9z59MMGH8Y69M27huBWAzB/3oXslrHaJy3fIAwEhQor8/hjShwe7N/qROR4XFsZ6ndGKrBi4xSefODq5kHNGYlBEp4MCyxwwqDbRDc3Zp6hykig720QFhsXc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=pCZSbrwk; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id 27307C433B1; Sat, 24 Feb 2024 17:42:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708796547; bh=u0AAmcTQTypGp4uSwwmS/uHNMvpmNjjwLex7HeF5FKw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=pCZSbrwkL9/e642Vk6RPAVvF4CN8L+fJ6tAFLW54+TMFala7V6bWP1I69Pu3mEmFF JPoheV03sIOIngy8axzqi0bzjnF8iq6KtA3LQUXaK0SkUkYFDc9VVL9rjD/NFSd8Q2 V29KQSL+7vlctvLgtH3n3GkKhxgwBMFZbvWWxKBOaG+P1ZbfsiZWIOJKRk01/3CuF3 Z2O9Db3r2ANcm+FX7jTIQJnf/Ewv3gD91LEGZOPJqZQp3JewvfPtgacdKlyGYzzykb HUYpFbB//sX7UKx+PaBGDgW97YvMo5nTLlH9V+NLx+d5bGA87hffoL6waZWpZtarTi 6AqtkiDnIPiMw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 15956C48BF6; Sat, 24 Feb 2024 17:42:27 +0000 (UTC) From: Sam Ravnborg via B4 Relay Date: Sat, 24 Feb 2024 18:42:26 +0100 Subject: [PATCH v2 5/7] sparc32: Do not select GENERIC_ISA_DMA Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240224-sam-fix-sparc32-all-builds-v2-5-1f186603c5c4@ravnborg.org> References: <20240224-sam-fix-sparc32-all-builds-v2-0-1f186603c5c4@ravnborg.org> In-Reply-To: <20240224-sam-fix-sparc32-all-builds-v2-0-1f186603c5c4@ravnborg.org> To: "Maciej W. Rozycki" , sparclinux@vger.kernel.org, Andreas Larsson , Randy Dunlap Cc: Miquel Raynal , linux-parport@lists.infradead.org, "David S. Miller" , Arnd Bergmann , linux-kernel@vger.kernel.org, Sam Ravnborg X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1708796545; l=1135; i=sam@ravnborg.org; s=20230107; h=from:subject:message-id; bh=OWAinB5URH3jM/Z4sqc7e9m3++OQMwYINtdPlTPG+3w=; =?utf-8?q?b=3DIarfFy+3MHxh?= =?utf-8?q?NsZ6KvRnK2UXkA3EcCfDklgPPW35n08X0QuMF3S7OCNXV+xsMYB11dgu5G8uxlWu?= oHxA3Ud3BP7eCnoq1lfEMf3GTDc4b3d1ofPjxcyUBNxO04uvCIoj X-Developer-Key: i=sam@ravnborg.org; a=ed25519; pk=R0+pqV7BRYOAeOIGkyOrSNke7arx5y3LkEuNi37YEyU= X-Endpoint-Received: by B4 Relay for sam@ravnborg.org/20230107 with auth_id=22 X-Original-From: Sam Ravnborg Reply-To: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791803149206916047 X-GMAIL-MSGID: 1791803149206916047 From: Sam Ravnborg sparc32 do not support generic isa dma, so do not select the symbol. This fixes the following warnings: dma.c:70:5: error: no previous prototype for 'request_dma' [-Werror=missing-prototypes] dma.c:88:6: error: no previous prototype for 'free_dma' [-Werror=missing-prototypes] Signed-off-by: Sam Ravnborg Fixes: 0fcb70851fbf ("Makefile.extrawarn: turn on missing-prototypes globally") Acked-by: Randy Dunlap Tested-by: Randy Dunlap # build-tested Cc: Andreas Larsson Cc: "David S. Miller" Cc: Randy Dunlap Cc: Maciej W. Rozycki --- arch/sparc/Kconfig | 4 ---- 1 file changed, 4 deletions(-) diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index bdbde506c01e..440e53d37d20 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig @@ -137,10 +137,6 @@ config HIGHMEM default y if SPARC32 select KMAP_LOCAL -config GENERIC_ISA_DMA - bool - default y if SPARC32 - config PGTABLE_LEVELS default 4 if 64BIT default 3 From patchwork Sat Feb 24 17:42:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg via B4 Relay X-Patchwork-Id: 205916 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp1253127dyb; Sat, 24 Feb 2024 09:44:14 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXE0sEuDNs19oidc2+fIqtW0GFp711ukskRyZfzmDjnC1dbKqg4+vH6c3TVuPhFEgLM5xKWH81pP5fFVVuVYMBGRYc9kA== X-Google-Smtp-Source: AGHT+IGY2xwVPWCEYe1zGXwTnWqAQaqnnQWxIbvguANftdzzlpLqO9jce1k5VeXluK5ClywRO24Z X-Received: by 2002:a05:6808:2393:b0:3bf:d26b:3efc with SMTP id bp19-20020a056808239300b003bfd26b3efcmr3669597oib.0.1708796654380; Sat, 24 Feb 2024 09:44:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708796654; cv=pass; d=google.com; s=arc-20160816; b=V9DoSGg4lI2euzuza1LsVjnJwjH9TGzA20f8ucT18ccfjBRYoZTgKpXtnnJDbDAP7P 8U0K/eW4To+ZtoeZnZnHCGC/Bcvyed7nWb5dkUZ3tPYWGVsc9aRizwhqzSGyVsP1HCOQ 64yAqozbe9EO2nv34JjJOdG4phA8qcyjVJoXSKU0lu3FbRrt4D2G+KEM+g8Pil973SaB W27r5s/AG8r6N7itsmRnbEHr9lO4HQNJxeFAnJAqzD8rUpDgj6RGt9pcgQXEvHoY66Xw 3c63PkrbHb1ducpmTUpvriOqDrGDtnTIBLpo5li9V9/2swq6iji01+1Wx1WLDNWD9jIN 4olw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:date:from:dkim-signature; bh=DOee87lEiMkTpvgjCUR6WsUCosx0BEzvPSJnNBhlHj4=; fh=OdQDGowjVR/aZ7tyqP8rfFw4/m3+TGAiNU87sROqqEY=; b=k4+yF/OcQdviF+T7uogukWiD8D1oZeHJJt57PgmB/o/RbTLEa/qpIRiZBDJM0sJ724 2VZnr5KcftKAiVm+FmS8/6UKHStxtA6kmjhxtNgoomRDBMD1c15DTw0KJKLNJlKG/Yha /eBPLSMFks6Rlh703xRvUwfw3F0TGMFksWI//meknLhBV/SfzMBxcktSqsYEdkcn8XN0 4koG0mBuBjnSewnSn+DifFa/hs0OArCNb3Tkh5FwJb8+7NSzAiG1Fm1s5JkLj/To6Gp8 VY26AsuZOxzIXmUhRHZmTbjDD/In5MdvIot9QQdgvoCf2BULGvSYunhbT9W14riOgytr HxpQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Qj0iyEGU; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-79769-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79769-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id w15-20020ac87e8f000000b0042e38b7bf40si1608485qtj.112.2024.02.24.09.44.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 09:44:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79769-ouuuleilei=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=@kernel.org header.s=k20201202 header.b=Qj0iyEGU; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-79769-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79769-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 1E2541C212FE for ; Sat, 24 Feb 2024 17:44:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7BBFC4F208; Sat, 24 Feb 2024 17:42:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Qj0iyEGU" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 8829D481DA; Sat, 24 Feb 2024 17:42:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708796547; cv=none; b=E3ljo+888i+WbvC9lTnq8nlODlhDcSNsGEn+eP2nsmeD/sBTg3ISwjkI/mgp2TU8o5H2aPIQ3dJ9j1OFT8lXLAmsLNsKDC7VXA9nsEcPrkLROYeI9HOr88yrX0jDAtgD7nPCFN14box+eiNiiElWqCSCKCH6zJchEL34CsE5M6o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708796547; c=relaxed/simple; bh=aBXH6eHAeemUY+2GjxoEzpq9SPbIFngM8x9dUDRKN8Q=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=d192M1HScBMalaW0dU22B6GoXPbgfTvHSCtZcqPYc8nOx7E7x3/qog02YlBz+617e6bkUAPUfZzJjtUsKD0KgGvEvAg7dHWpkZIKu7qdr/4uet3qdExe6JMlFQIOdKe28xb168RbFAbPm8VvcUBGCBy7cD/0E54ZV7Wx4K4qLaA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Qj0iyEGU; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id 34D6EC433A6; Sat, 24 Feb 2024 17:42:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708796547; bh=aBXH6eHAeemUY+2GjxoEzpq9SPbIFngM8x9dUDRKN8Q=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=Qj0iyEGUTD87Q6hv0J4ltINyVNg+3dcxeIIjTkq/NNXDTGp3UJl3cFpoeb9/Moc9T gl63mLcXK5kolDSy8AmOoXJ9z1dahYRH/MaNhnjwcAyTy16wrB5D/CTeQNWASD+Ttq RhOU48f87j2/hh19WTNytWHNU42SIY5a/LvaamvBuquT0aDvCqgOvvxYNEvhvQr727 HLTT+zceQ3MgEuNTPLZEsou+J63ZDQHCwssxPEtqL3EOm5iYIMZJWYEfSOikmsQ3hU UkYAuztwffuSCv0RWkqTWPi6/DFWZ0ldG8byTc6VUOkl3y/0amd1SLqwIRZxaZrYNH SWfjjCpMPgK4Q== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2428EC54E49; Sat, 24 Feb 2024 17:42:27 +0000 (UTC) From: Sam Ravnborg via B4 Relay Date: Sat, 24 Feb 2024 18:42:27 +0100 Subject: [PATCH v2 6/7] sparc32: Fix parport build with sparc32 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240224-sam-fix-sparc32-all-builds-v2-6-1f186603c5c4@ravnborg.org> References: <20240224-sam-fix-sparc32-all-builds-v2-0-1f186603c5c4@ravnborg.org> In-Reply-To: <20240224-sam-fix-sparc32-all-builds-v2-0-1f186603c5c4@ravnborg.org> To: "Maciej W. Rozycki" , sparclinux@vger.kernel.org, Andreas Larsson , Randy Dunlap Cc: Miquel Raynal , linux-parport@lists.infradead.org, "David S. Miller" , Arnd Bergmann , linux-kernel@vger.kernel.org, Sam Ravnborg , stable@vger.kernel.org X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1708796545; l=14433; i=sam@ravnborg.org; s=20230107; h=from:subject:message-id; bh=oZ0rejxcMTa2joV1C1od/thuO4r9k+TAXb9nS1wKQd4=; =?utf-8?q?b=3DcKBrnF7aWGPD?= =?utf-8?q?9vHNuDEXKrQyp1pKioyRJlw9lk76hTdVqYhZ0kEOTq4w/d/ZnlCqXGhef7xfM931?= iH9DG/HrDWI0IYkHzo5k5cSODWK2hWXhNuyRkd/lbRLNAWcY7XmO X-Developer-Key: i=sam@ravnborg.org; a=ed25519; pk=R0+pqV7BRYOAeOIGkyOrSNke7arx5y3LkEuNi37YEyU= X-Endpoint-Received: by B4 Relay for sam@ravnborg.org/20230107 with auth_id=22 X-Original-From: Sam Ravnborg Reply-To: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791803160619625295 X-GMAIL-MSGID: 1791803160619625295 From: Sam Ravnborg include/asm/parport.h is sparc64 specific. Rename it to parport_64.h and use the generic version for sparc32. This fixed all{mod,yes}config build errors like: parport_pc.c:(.text):undefined-reference-to-ebus_dma_enable parport_pc.c:(.text):undefined-reference-to-ebus_dma_irq_enable parport_pc.c:(.text):undefined-reference-to-ebus_dma_register The errors occur as the sparc32 build references sparc64 symbols. Signed-off-by: Sam Ravnborg Cc: "David S. Miller" Cc: Andreas Larsson Cc: Randy Dunlap Cc: Maciej W. Rozycki Closes: https://lore.kernel.org/r/20230406160548.25721-1-rdunlap@infradead.org/ Fixes: 66bcd06099bb ("parport_pc: Also enable driver for PCI systems") Cc: stable@vger.kernel.org # v5.18+ Tested-by: Randy Dunlap # build-tested --- arch/sparc/include/asm/parport.h | 259 +----------------------------------- arch/sparc/include/asm/parport_64.h | 256 +++++++++++++++++++++++++++++++++++ 2 files changed, 263 insertions(+), 252 deletions(-) diff --git a/arch/sparc/include/asm/parport.h b/arch/sparc/include/asm/parport.h index 0a7ffcfd59cd..e2eed8f97665 100644 --- a/arch/sparc/include/asm/parport.h +++ b/arch/sparc/include/asm/parport.h @@ -1,256 +1,11 @@ /* SPDX-License-Identifier: GPL-2.0 */ -/* parport.h: sparc64 specific parport initialization and dma. - * - * Copyright (C) 1999 Eddie C. Dost (ecd@skynet.be) - */ +#ifndef ___ASM_SPARC_PARPORT_H +#define ___ASM_SPARC_PARPORT_H -#ifndef _ASM_SPARC64_PARPORT_H -#define _ASM_SPARC64_PARPORT_H 1 - -#include -#include - -#include -#include -#include - -#define PARPORT_PC_MAX_PORTS PARPORT_MAX - -/* - * While sparc64 doesn't have an ISA DMA API, we provide something that looks - * close enough to make parport_pc happy - */ -#define HAS_DMA - -#ifdef CONFIG_PARPORT_PC_FIFO -static DEFINE_SPINLOCK(dma_spin_lock); - -#define claim_dma_lock() \ -({ unsigned long flags; \ - spin_lock_irqsave(&dma_spin_lock, flags); \ - flags; \ -}) - -#define release_dma_lock(__flags) \ - spin_unlock_irqrestore(&dma_spin_lock, __flags); +#if defined(__sparc__) && defined(__arch64__) +#include +#else +#include +#endif #endif -static struct sparc_ebus_info { - struct ebus_dma_info info; - unsigned int addr; - unsigned int count; - int lock; - - struct parport *port; -} sparc_ebus_dmas[PARPORT_PC_MAX_PORTS]; - -static DECLARE_BITMAP(dma_slot_map, PARPORT_PC_MAX_PORTS); - -static inline int request_dma(unsigned int dmanr, const char *device_id) -{ - if (dmanr >= PARPORT_PC_MAX_PORTS) - return -EINVAL; - if (xchg(&sparc_ebus_dmas[dmanr].lock, 1) != 0) - return -EBUSY; - return 0; -} - -static inline void free_dma(unsigned int dmanr) -{ - if (dmanr >= PARPORT_PC_MAX_PORTS) { - printk(KERN_WARNING "Trying to free DMA%d\n", dmanr); - return; - } - if (xchg(&sparc_ebus_dmas[dmanr].lock, 0) == 0) { - printk(KERN_WARNING "Trying to free free DMA%d\n", dmanr); - return; - } -} - -static inline void enable_dma(unsigned int dmanr) -{ - ebus_dma_enable(&sparc_ebus_dmas[dmanr].info, 1); - - if (ebus_dma_request(&sparc_ebus_dmas[dmanr].info, - sparc_ebus_dmas[dmanr].addr, - sparc_ebus_dmas[dmanr].count)) - BUG(); -} - -static inline void disable_dma(unsigned int dmanr) -{ - ebus_dma_enable(&sparc_ebus_dmas[dmanr].info, 0); -} - -static inline void clear_dma_ff(unsigned int dmanr) -{ - /* nothing */ -} - -static inline void set_dma_mode(unsigned int dmanr, char mode) -{ - ebus_dma_prepare(&sparc_ebus_dmas[dmanr].info, (mode != DMA_MODE_WRITE)); -} - -static inline void set_dma_addr(unsigned int dmanr, unsigned int addr) -{ - sparc_ebus_dmas[dmanr].addr = addr; -} - -static inline void set_dma_count(unsigned int dmanr, unsigned int count) -{ - sparc_ebus_dmas[dmanr].count = count; -} - -static inline unsigned int get_dma_residue(unsigned int dmanr) -{ - return ebus_dma_residue(&sparc_ebus_dmas[dmanr].info); -} - -static int ecpp_probe(struct platform_device *op) -{ - unsigned long base = op->resource[0].start; - unsigned long config = op->resource[1].start; - unsigned long d_base = op->resource[2].start; - unsigned long d_len; - struct device_node *parent; - struct parport *p; - int slot, err; - - parent = op->dev.of_node->parent; - if (of_node_name_eq(parent, "dma")) { - p = parport_pc_probe_port(base, base + 0x400, - op->archdata.irqs[0], PARPORT_DMA_NOFIFO, - op->dev.parent->parent, 0); - if (!p) - return -ENOMEM; - dev_set_drvdata(&op->dev, p); - return 0; - } - - for (slot = 0; slot < PARPORT_PC_MAX_PORTS; slot++) { - if (!test_and_set_bit(slot, dma_slot_map)) - break; - } - err = -ENODEV; - if (slot >= PARPORT_PC_MAX_PORTS) - goto out_err; - - spin_lock_init(&sparc_ebus_dmas[slot].info.lock); - - d_len = (op->resource[2].end - d_base) + 1UL; - sparc_ebus_dmas[slot].info.regs = - of_ioremap(&op->resource[2], 0, d_len, "ECPP DMA"); - - if (!sparc_ebus_dmas[slot].info.regs) - goto out_clear_map; - - sparc_ebus_dmas[slot].info.flags = 0; - sparc_ebus_dmas[slot].info.callback = NULL; - sparc_ebus_dmas[slot].info.client_cookie = NULL; - sparc_ebus_dmas[slot].info.irq = 0xdeadbeef; - strcpy(sparc_ebus_dmas[slot].info.name, "parport"); - if (ebus_dma_register(&sparc_ebus_dmas[slot].info)) - goto out_unmap_regs; - - ebus_dma_irq_enable(&sparc_ebus_dmas[slot].info, 1); - - /* Configure IRQ to Push Pull, Level Low */ - /* Enable ECP, set bit 2 of the CTR first */ - outb(0x04, base + 0x02); - ns87303_modify(config, PCR, - PCR_EPP_ENABLE | - PCR_IRQ_ODRAIN, - PCR_ECP_ENABLE | - PCR_ECP_CLK_ENA | - PCR_IRQ_POLAR); - - /* CTR bit 5 controls direction of port */ - ns87303_modify(config, PTR, - 0, PTR_LPT_REG_DIR); - - p = parport_pc_probe_port(base, base + 0x400, - op->archdata.irqs[0], - slot, - op->dev.parent, - 0); - err = -ENOMEM; - if (!p) - goto out_disable_irq; - - dev_set_drvdata(&op->dev, p); - - return 0; - -out_disable_irq: - ebus_dma_irq_enable(&sparc_ebus_dmas[slot].info, 0); - ebus_dma_unregister(&sparc_ebus_dmas[slot].info); - -out_unmap_regs: - of_iounmap(&op->resource[2], sparc_ebus_dmas[slot].info.regs, d_len); - -out_clear_map: - clear_bit(slot, dma_slot_map); - -out_err: - return err; -} - -static int ecpp_remove(struct platform_device *op) -{ - struct parport *p = dev_get_drvdata(&op->dev); - int slot = p->dma; - - parport_pc_unregister_port(p); - - if (slot != PARPORT_DMA_NOFIFO) { - unsigned long d_base = op->resource[2].start; - unsigned long d_len; - - d_len = (op->resource[2].end - d_base) + 1UL; - - ebus_dma_irq_enable(&sparc_ebus_dmas[slot].info, 0); - ebus_dma_unregister(&sparc_ebus_dmas[slot].info); - of_iounmap(&op->resource[2], - sparc_ebus_dmas[slot].info.regs, - d_len); - clear_bit(slot, dma_slot_map); - } - - return 0; -} - -static const struct of_device_id ecpp_match[] = { - { - .name = "ecpp", - }, - { - .name = "parallel", - .compatible = "ecpp", - }, - { - .name = "parallel", - .compatible = "ns87317-ecpp", - }, - { - .name = "parallel", - .compatible = "pnpALI,1533,3", - }, - {}, -}; - -static struct platform_driver ecpp_driver = { - .driver = { - .name = "ecpp", - .of_match_table = ecpp_match, - }, - .probe = ecpp_probe, - .remove = ecpp_remove, -}; - -static int parport_pc_find_nonpci_ports(int autoirq, int autodma) -{ - return platform_driver_register(&ecpp_driver); -} - -#endif /* !(_ASM_SPARC64_PARPORT_H */ diff --git a/arch/sparc/include/asm/parport_64.h b/arch/sparc/include/asm/parport_64.h new file mode 100644 index 000000000000..0a7ffcfd59cd --- /dev/null +++ b/arch/sparc/include/asm/parport_64.h @@ -0,0 +1,256 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* parport.h: sparc64 specific parport initialization and dma. + * + * Copyright (C) 1999 Eddie C. Dost (ecd@skynet.be) + */ + +#ifndef _ASM_SPARC64_PARPORT_H +#define _ASM_SPARC64_PARPORT_H 1 + +#include +#include + +#include +#include +#include + +#define PARPORT_PC_MAX_PORTS PARPORT_MAX + +/* + * While sparc64 doesn't have an ISA DMA API, we provide something that looks + * close enough to make parport_pc happy + */ +#define HAS_DMA + +#ifdef CONFIG_PARPORT_PC_FIFO +static DEFINE_SPINLOCK(dma_spin_lock); + +#define claim_dma_lock() \ +({ unsigned long flags; \ + spin_lock_irqsave(&dma_spin_lock, flags); \ + flags; \ +}) + +#define release_dma_lock(__flags) \ + spin_unlock_irqrestore(&dma_spin_lock, __flags); +#endif + +static struct sparc_ebus_info { + struct ebus_dma_info info; + unsigned int addr; + unsigned int count; + int lock; + + struct parport *port; +} sparc_ebus_dmas[PARPORT_PC_MAX_PORTS]; + +static DECLARE_BITMAP(dma_slot_map, PARPORT_PC_MAX_PORTS); + +static inline int request_dma(unsigned int dmanr, const char *device_id) +{ + if (dmanr >= PARPORT_PC_MAX_PORTS) + return -EINVAL; + if (xchg(&sparc_ebus_dmas[dmanr].lock, 1) != 0) + return -EBUSY; + return 0; +} + +static inline void free_dma(unsigned int dmanr) +{ + if (dmanr >= PARPORT_PC_MAX_PORTS) { + printk(KERN_WARNING "Trying to free DMA%d\n", dmanr); + return; + } + if (xchg(&sparc_ebus_dmas[dmanr].lock, 0) == 0) { + printk(KERN_WARNING "Trying to free free DMA%d\n", dmanr); + return; + } +} + +static inline void enable_dma(unsigned int dmanr) +{ + ebus_dma_enable(&sparc_ebus_dmas[dmanr].info, 1); + + if (ebus_dma_request(&sparc_ebus_dmas[dmanr].info, + sparc_ebus_dmas[dmanr].addr, + sparc_ebus_dmas[dmanr].count)) + BUG(); +} + +static inline void disable_dma(unsigned int dmanr) +{ + ebus_dma_enable(&sparc_ebus_dmas[dmanr].info, 0); +} + +static inline void clear_dma_ff(unsigned int dmanr) +{ + /* nothing */ +} + +static inline void set_dma_mode(unsigned int dmanr, char mode) +{ + ebus_dma_prepare(&sparc_ebus_dmas[dmanr].info, (mode != DMA_MODE_WRITE)); +} + +static inline void set_dma_addr(unsigned int dmanr, unsigned int addr) +{ + sparc_ebus_dmas[dmanr].addr = addr; +} + +static inline void set_dma_count(unsigned int dmanr, unsigned int count) +{ + sparc_ebus_dmas[dmanr].count = count; +} + +static inline unsigned int get_dma_residue(unsigned int dmanr) +{ + return ebus_dma_residue(&sparc_ebus_dmas[dmanr].info); +} + +static int ecpp_probe(struct platform_device *op) +{ + unsigned long base = op->resource[0].start; + unsigned long config = op->resource[1].start; + unsigned long d_base = op->resource[2].start; + unsigned long d_len; + struct device_node *parent; + struct parport *p; + int slot, err; + + parent = op->dev.of_node->parent; + if (of_node_name_eq(parent, "dma")) { + p = parport_pc_probe_port(base, base + 0x400, + op->archdata.irqs[0], PARPORT_DMA_NOFIFO, + op->dev.parent->parent, 0); + if (!p) + return -ENOMEM; + dev_set_drvdata(&op->dev, p); + return 0; + } + + for (slot = 0; slot < PARPORT_PC_MAX_PORTS; slot++) { + if (!test_and_set_bit(slot, dma_slot_map)) + break; + } + err = -ENODEV; + if (slot >= PARPORT_PC_MAX_PORTS) + goto out_err; + + spin_lock_init(&sparc_ebus_dmas[slot].info.lock); + + d_len = (op->resource[2].end - d_base) + 1UL; + sparc_ebus_dmas[slot].info.regs = + of_ioremap(&op->resource[2], 0, d_len, "ECPP DMA"); + + if (!sparc_ebus_dmas[slot].info.regs) + goto out_clear_map; + + sparc_ebus_dmas[slot].info.flags = 0; + sparc_ebus_dmas[slot].info.callback = NULL; + sparc_ebus_dmas[slot].info.client_cookie = NULL; + sparc_ebus_dmas[slot].info.irq = 0xdeadbeef; + strcpy(sparc_ebus_dmas[slot].info.name, "parport"); + if (ebus_dma_register(&sparc_ebus_dmas[slot].info)) + goto out_unmap_regs; + + ebus_dma_irq_enable(&sparc_ebus_dmas[slot].info, 1); + + /* Configure IRQ to Push Pull, Level Low */ + /* Enable ECP, set bit 2 of the CTR first */ + outb(0x04, base + 0x02); + ns87303_modify(config, PCR, + PCR_EPP_ENABLE | + PCR_IRQ_ODRAIN, + PCR_ECP_ENABLE | + PCR_ECP_CLK_ENA | + PCR_IRQ_POLAR); + + /* CTR bit 5 controls direction of port */ + ns87303_modify(config, PTR, + 0, PTR_LPT_REG_DIR); + + p = parport_pc_probe_port(base, base + 0x400, + op->archdata.irqs[0], + slot, + op->dev.parent, + 0); + err = -ENOMEM; + if (!p) + goto out_disable_irq; + + dev_set_drvdata(&op->dev, p); + + return 0; + +out_disable_irq: + ebus_dma_irq_enable(&sparc_ebus_dmas[slot].info, 0); + ebus_dma_unregister(&sparc_ebus_dmas[slot].info); + +out_unmap_regs: + of_iounmap(&op->resource[2], sparc_ebus_dmas[slot].info.regs, d_len); + +out_clear_map: + clear_bit(slot, dma_slot_map); + +out_err: + return err; +} + +static int ecpp_remove(struct platform_device *op) +{ + struct parport *p = dev_get_drvdata(&op->dev); + int slot = p->dma; + + parport_pc_unregister_port(p); + + if (slot != PARPORT_DMA_NOFIFO) { + unsigned long d_base = op->resource[2].start; + unsigned long d_len; + + d_len = (op->resource[2].end - d_base) + 1UL; + + ebus_dma_irq_enable(&sparc_ebus_dmas[slot].info, 0); + ebus_dma_unregister(&sparc_ebus_dmas[slot].info); + of_iounmap(&op->resource[2], + sparc_ebus_dmas[slot].info.regs, + d_len); + clear_bit(slot, dma_slot_map); + } + + return 0; +} + +static const struct of_device_id ecpp_match[] = { + { + .name = "ecpp", + }, + { + .name = "parallel", + .compatible = "ecpp", + }, + { + .name = "parallel", + .compatible = "ns87317-ecpp", + }, + { + .name = "parallel", + .compatible = "pnpALI,1533,3", + }, + {}, +}; + +static struct platform_driver ecpp_driver = { + .driver = { + .name = "ecpp", + .of_match_table = ecpp_match, + }, + .probe = ecpp_probe, + .remove = ecpp_remove, +}; + +static int parport_pc_find_nonpci_ports(int autoirq, int autodma) +{ + return platform_driver_register(&ecpp_driver); +} + +#endif /* !(_ASM_SPARC64_PARPORT_H */ From patchwork Sat Feb 24 17:42:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg via B4 Relay X-Patchwork-Id: 205915 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp1253080dyb; Sat, 24 Feb 2024 09:44:04 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX1+Je5QHbfrUvtWaCoIUR2jAlz+akiYhF0Qg+jSDBKtvnXu2HQmtkdCvrAbkPG6Dw/bYOEJV+hwM4xd7y94Kpfk0a+Sg== X-Google-Smtp-Source: AGHT+IGE1k1CMU8Ax5WIyKKqtw7CrLRgK0xOdgi6mvI3MvQDm5sMMnx7kAolnQZ4p/tUrkNhsAa7 X-Received: by 2002:ac8:7396:0:b0:42e:6f56:c358 with SMTP id t22-20020ac87396000000b0042e6f56c358mr2692277qtp.42.1708796644141; Sat, 24 Feb 2024 09:44:04 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708796644; cv=pass; d=google.com; s=arc-20160816; b=jcjn2VcuIWp63VQnRDM0aDEmfVosruyBJdr9i2II7btYLZ3s/E7RbkU4Xy05+hVXEr VQMjdy58HrUmroyg5gML8WCuFLOSnIc4p93geoVSu65u0Gd116g/GuOzCV3IA3JpXed6 kTOYKjQFSeboVQTUsf4k7JoW3ere0SuXciqyQj5dhtZsQnZMuErWvgg0bb91tDHtSV8U ULnP09XrH70sh53+SLOMp0tFjKr2D2XJbGCJL3LhN+swUom9+ysacRft1FaADDFFm8IF PllsrdxEllztsma7N365Kt4VAVJ7lUQRlSO5tk9Lu5VKmJJzOjYy9eJV3KWHWoOfhmCv 0mdw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=reply-to:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:subject:date:from:dkim-signature; bh=xl5sr6xGvkgt0DRk80TmwdWAopeF+k3ng7NlSeZyPdc=; fh=axaiTczyEibQIAZR7tL5HdXpt5eDXppl7AUtI52L8OM=; b=sje/2fmZFdyvFlqCNHsBKdLJ/Vn+OLsoPp8VTTPMxfzn/jlXF3Tm3y+viv2oqQB+s8 06wB6Yz7o2FH8xyu3G81INvBHYVmG3+AzX/7N8GioVtfj+iD8NUGObXIHclGP/07O9uv eDhe9VaVf1OWX6RmNbB1mL/IrvT0WND/6Zb7e+mv8fWoTDcJcJl604nBcQUMsoAe7b3S J5NeBYdoUDt2sUViufNUXaTM+WgCkhIiBJtOEOOrfY1iKmvKAhCN995i1bWxn8P+w0Kc xEXk6Imf7BoqebkCthB90uMc7B91ehig3d4d1UnrI9ZfwTc5SfvT6mxuZU8mgJ3017h/ /y6w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hM6IjYpO; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-79770-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79770-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id l21-20020ac87255000000b0042e626ae053si1513202qtp.213.2024.02.24.09.44.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 09:44:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79770-ouuuleilei=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=@kernel.org header.s=k20201202 header.b=hM6IjYpO; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-79770-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79770-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 E9E681C20C05 for ; Sat, 24 Feb 2024 17:44:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 53F434EB45; Sat, 24 Feb 2024 17:42:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hM6IjYpO" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 882DF481DB; Sat, 24 Feb 2024 17:42:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708796547; cv=none; b=Ajv9tYzRrhrlREtimXSrFdsRIEB06fww/EY1t0AuEbff2YjQtdnd+eTVhAwFat85MZpGi3MqN14RV7oJ9qWWWJ9q9x68Rn6lzx85dsI+xBwBQ2wWd9A0XAUkqt3ccUmggxixZd3Su5o5f3tR6JT5gT0Cf+G3kh7zmhcwyJqyfWo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708796547; c=relaxed/simple; bh=BpChDc4AdXLSlhIQ1beqDCEhZX4ty/N7Hr3rHV89JQc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BxYe0MbaMXG8lIpnFBd7K+R94u1iYG+omsv8JP18+dnYm4a1Nvx+NMXaU1w6mYNAvFUHIM8UyTkAkC+P5dGPxV7SRXVOiOWMuz543mgADPLiD4IgB1o3dE8bGX41t0P6A8oZLzGNEyxwBhI4fpsXmTCLi0J3lO0rR1U7hkDnU6Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hM6IjYpO; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPS id 43250C433B2; Sat, 24 Feb 2024 17:42:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708796547; bh=BpChDc4AdXLSlhIQ1beqDCEhZX4ty/N7Hr3rHV89JQc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=hM6IjYpOnP7O32ustFTBJR9nsLehBYm1XHe6qd6G6vfsQOaVgkWe/VXrM3tkUp0nU e5OSJtZ4x4ZbbOtuk9R2+inYXs903bweTKX3iY0gVhbTszG36R9vnd0G1e0zaXNo7L M3TKZQO2Bra3x7BpiC/JzhaeNvvjj8KwauKOZEClrOCej7DRwq/b9k20rwNBuFTCua 3W/dFbNMK1sIdeYJ+OES6eG+G3BrzyU41DiOas48ZzveyaFMvsJqGwpAmJr3Mli4J9 FZJaeqvEfuUwxz8S9wqg9buQaMHw5Gib2qkCNwgQpx2IA+NTCWWBuVe/Dfkax3dF3R +7TCZzp1b3klA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 329BCC54E4F; Sat, 24 Feb 2024 17:42:27 +0000 (UTC) From: Sam Ravnborg via B4 Relay Date: Sat, 24 Feb 2024 18:42:28 +0100 Subject: [PATCH v2 7/7] sparc32: Fix section mismatch in leon_pci_grpci Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240224-sam-fix-sparc32-all-builds-v2-7-1f186603c5c4@ravnborg.org> References: <20240224-sam-fix-sparc32-all-builds-v2-0-1f186603c5c4@ravnborg.org> In-Reply-To: <20240224-sam-fix-sparc32-all-builds-v2-0-1f186603c5c4@ravnborg.org> To: "Maciej W. Rozycki" , sparclinux@vger.kernel.org, Andreas Larsson , Randy Dunlap Cc: Miquel Raynal , linux-parport@lists.infradead.org, "David S. Miller" , Arnd Bergmann , linux-kernel@vger.kernel.org, Sam Ravnborg X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1708796545; l=1706; i=sam@ravnborg.org; s=20230107; h=from:subject:message-id; bh=sp1d/B24jZbQZh3/vvpsecjIEsONMYKjjInm+P7c4rg=; =?utf-8?q?b=3Dg6ryIctXAY8E?= =?utf-8?q?RVSP7byE0Sv/rPNTxni/bFVxqgeeV0JsbhZM6eDayu5hVR10CVQe98O1Q1FHWAAM?= /aIXJuA6B9nUPGrWcgHnnmW73F4QqXtQDcNHs5JOfJ8Z60bsp0Ek X-Developer-Key: i=sam@ravnborg.org; a=ed25519; pk=R0+pqV7BRYOAeOIGkyOrSNke7arx5y3LkEuNi37YEyU= X-Endpoint-Received: by B4 Relay for sam@ravnborg.org/20230107 with auth_id=22 X-Original-From: Sam Ravnborg Reply-To: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791803149628477492 X-GMAIL-MSGID: 1791803149628477492 From: Sam Ravnborg Passing a datastructre marked _initconst to platform_driver_register() is wrong. Drop the __initconst notation. This fixes the following warnings: WARNING: modpost: vmlinux: section mismatch in reference: grpci1_of_driver+0x30 (section: .data) -> grpci1_of_match (section: .init.rodata) WARNING: modpost: vmlinux: section mismatch in reference: grpci2_of_driver+0x30 (section: .data) -> grpci2_of_match (section: .init.rodata) Signed-off-by: Sam Ravnborg Cc: "David S. Miller" Cc: Andreas Larsson Tested-by: Randy Dunlap # build-tested --- arch/sparc/kernel/leon_pci_grpci1.c | 2 +- arch/sparc/kernel/leon_pci_grpci2.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/sparc/kernel/leon_pci_grpci1.c b/arch/sparc/kernel/leon_pci_grpci1.c index 8700a0e3b0df..b2b639bee068 100644 --- a/arch/sparc/kernel/leon_pci_grpci1.c +++ b/arch/sparc/kernel/leon_pci_grpci1.c @@ -697,7 +697,7 @@ static int grpci1_of_probe(struct platform_device *ofdev) return err; } -static const struct of_device_id grpci1_of_match[] __initconst = { +static const struct of_device_id grpci1_of_match[] = { { .name = "GAISLER_PCIFBRG", }, diff --git a/arch/sparc/kernel/leon_pci_grpci2.c b/arch/sparc/kernel/leon_pci_grpci2.c index 282b49d496ea..9f662340b5b2 100644 --- a/arch/sparc/kernel/leon_pci_grpci2.c +++ b/arch/sparc/kernel/leon_pci_grpci2.c @@ -889,7 +889,7 @@ static int grpci2_of_probe(struct platform_device *ofdev) return err; } -static const struct of_device_id grpci2_of_match[] __initconst = { +static const struct of_device_id grpci2_of_match[] = { { .name = "GAISLER_GRPCI2", },