Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp467095lqe; Sat, 6 Apr 2024 08:27:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVQMZlGITiwztcHsB9T7Lm/6e/TJoGJr7ZT+bvkRGE5YoTxu9aQQo10qQGWb+GBnExelhKnMVzr6pmF6/++zZFYku9hSfSSIfZqIO1nBg== X-Google-Smtp-Source: AGHT+IEL0uQyqPptgrcslMmycbYkCNw0DSVqJHMcHdUuDsoojJRVybQ47aLWL3HPrib46UxWgtnm X-Received: by 2002:a2e:9042:0:b0:2d6:a609:9a33 with SMTP id n2-20020a2e9042000000b002d6a6099a33mr3367838ljg.0.1712417255155; Sat, 06 Apr 2024 08:27:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712417255; cv=pass; d=google.com; s=arc-20160816; b=ugyRwNE77TYmO1O7FolnfTPry87B505pQgX3OItcIl87z54f1RNJV06LBsmAG4+3Zy fh0CysI5Q+lf3wyLtIRPk/3s53ZpV7bt5uxf+IxCsjqURx6nGLBXdSy6sQWtIJlcCsLq bHjrJ0kgFNyzXPxMJ+YEGMiwNl8S5Dmqr9F0mxaZdPVymS9Wc3SKepbUJPGpyDaGWAx5 ueTdoq2xfR7V0ZKcnJUsJk2ftkYGMM8vfa24XFg2biVpAJSIK22WGYRWgkN5j0lZNMzd t5XHWKsA21AwXxb/PmIx3RQUNBcSWMHV4ba6pbpMjFCIfoxS3ickOi/he6S3aemisA+0 LOcA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=subject:cc:to:from:date:references:in-reply-to:message-id :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:feedback-id:dkim-signature; bh=oxK5IEMYsCqg+AH1JLw0joM6IPkUb0+lxFTe0oSBGiQ=; fh=PHKpNFlXzKEBgzRymgIx4aTrdEMY7BtU3SvBHykMKPU=; b=ptExoCnHziC4FwNerA6N7jWnRuEgjEvQqeS7MG/8Dd0HaagbtXdOyqG+2k/QeY57Hy gblKgcRVmL59CH7Wyp64DGwa2hYt9MVHNPZyg+p1BRagjNKEXh5Y+okcZyoryJ2t5C3S 7MTBNGX09qXTwto4z9egNc/z497d1zo93bLB9mf2PtZW4SNTQJq7CT4NCO4vO3WoB7kW JVQR42M0S8IML4TbRAKylHJy54C39ko6areUS1hIQCRSLADIkho776vrgilS8NXr21wR 9rcX7RpSVvVZW2CmRL1AIhzsUqskHOZcwp3Uf6PRdYmq6bIFBCHUacbqvbw2X6vA/Rym nyFQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EpEUpiap; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-133973-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133973-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id p13-20020a170906b20d00b00a4e2ae4490dsi1799886ejz.877.2024.04.06.08.27.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Apr 2024 08:27:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-133973-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EpEUpiap; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-133973-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133973-linux.lists.archive=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 A803F1F2158B for ; Sat, 6 Apr 2024 15:27:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 25F503BBC5; Sat, 6 Apr 2024 15:27:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="EpEUpiap" 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 388263B18D for ; Sat, 6 Apr 2024 15:27:25 +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=1712417246; cv=none; b=kEXOSfyzRJo6RWZAuHI/JCHRbEr1oiqwm/6D7GVVdg+EzQtqCZeduGZDNO+QVxHPkE2FyuS/NXNRPEHXIQV2c2DrYz1LHOEmSoZfNAytwdREOLAiPX7rSYGblR34EUiFTJ3iwywYhQ1+iLq/64EpXjVuWC2+8jVUeo2zea91I/s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712417246; c=relaxed/simple; bh=2rySa9t9VCItK6MZJ9ubIFsysl4IsjaeTxE0EGK1V7Y=; h=MIME-Version:Message-Id:In-Reply-To:References:Date:From:To:Cc: Subject:Content-Type; b=PqmSMxFcQUKb1NobbxXTVuGjPCNA//5W+BVFWMorC1GI0GK/rZ7kbmmGNKTBjtcoOEcPTKcJVgj7vhBcZceAOyE3XjQdEIeccK61wq3kVrPhY9vbD0GgsRIk2/JyJQBr9sc55fNa4R5PNr2czLH2SVdJvUp76VQARqBU8MleNzw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=EpEUpiap; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8B7CBC43394; Sat, 6 Apr 2024 15:27:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712417245; bh=2rySa9t9VCItK6MZJ9ubIFsysl4IsjaeTxE0EGK1V7Y=; h=In-Reply-To:References:Date:From:To:Cc:Subject:From; b=EpEUpiapYMNcn35KoFQr4r+T1mq/Xd3hUqTVaf8wQNm+LyGBNgGJSk6Jq+Zr+1FtM jJChI1nJUcSosMep32XCj8ED5WtTPxzXXmSafxBDhVv0U1VZwX02xQ+19aW9xBUaUA hCg42yKaJHuVBtE/AWkKBi0y6kdUWb/YwVAZx5JC90P38+OCekI1gaFlJoDV4cNRxg 8D9+0PnomvKXelAqBK8PSVmuXJt3GP3JEMm3HeUUl5762Y5c/3cV+BPeQs7c9fOsPX W5uk5ar3DohzQIgNGPmWdcryh7QKZ3c7l/sGEoygzsew9XGkNjj2dJbBS9gUxEYaCE 8imEslZThxkdQ== Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfauth.nyi.internal (Postfix) with ESMTP id 8BF731200069; Sat, 6 Apr 2024 11:27:24 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute5.internal (MEProxy); Sat, 06 Apr 2024 11:27:24 -0400 X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudegvddgledtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusehkvghrnhgvlhdrohhrgheqnecuggftrf grthhtvghrnhepvdeviefgtedugeevieelvdfgveeuvdfgteegfeeiieejjeffgeeghedu gedtveehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh eprghrnhguodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdduvdekhedujedt vdegqddvkeejtddtvdeigedqrghrnhgupeepkhgvrhhnvghlrdhorhhgsegrrhhnuggsrd guvg X-ME-Proxy: Feedback-ID: i36794607:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id CC89EB6008D; Sat, 6 Apr 2024 11:27:23 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-333-gbfea15422e-fm-20240327.001-gbfea1542 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: In-Reply-To: References: <20240403122851.38808-1-schnelle@linux.ibm.com> <6b308ab0-dda7-4052-98b3-cb03e17e3e12@app.fastmail.com> Date: Sat, 06 Apr 2024 17:27:03 +0200 From: "Arnd Bergmann" To: "Michael Schmitz" , "Geert Uytterhoeven" Cc: "Niklas Schnelle" , linux-m68k@lists.linux-m68k.org, "Heiko Carstens" , linux-kernel@vger.kernel.org Subject: Re: [PATCH 0/1] m68k: Handle HAS_IOPORT dependencies Content-Type: text/plain On Sat, Apr 6, 2024, at 03:14, Michael Schmitz wrote: > Am 06.04.2024 um 09:13 schrieb Arnd Bergmann: >> On Fri, Apr 5, 2024, at 20:36, Michael Schmitz wrote: >>> Am 05.04.2024 um 23:16 schrieb Geert Uytterhoeven: >>> The last time I tried to add support for a different PCMCIA ethernet >>> adapter to apne.c _without_ adding to the hacks in io_mm.h, I wasn't >>> getting anywhere with the netdev crowd. That was ages ago, and I doubt >>> their enthusiasm for a rewrite of the 8390 code base to avoid using >>> inb() on MMIO architectures will be any better now. >> >> From what I can see, there is already an abstraction layer in >> these drivers that is used by all m68k drivers except apne: > > As well as ne ... which uses the 8390p.c helper. Is there any machine using ne.c that doesn't set HAS_IOPORT though? Q40 and ATARI_ETHERNEC both have custom inb()/outb(), so those are not affected by the change. >> $ git grep -w 'define\sei_inb' >> drivers/net/ethernet/8390/8390.h:#define ei_inb(_p) inb(_p) >> drivers/net/ethernet/8390/8390p.c:#define ei_inb(_p) inb(_p) >> drivers/net/ethernet/8390/ax88796.c:#define ei_inb(_a) readb(ax_convert_addr(_a)) >> drivers/net/ethernet/8390/etherh.c:#define ei_inb(_p) readb((void __iomem *)_p) >> drivers/net/ethernet/8390/hydra.c:#define ei_inb(port) in_8(port) >> drivers/net/ethernet/8390/mac8390.c:#define ei_inb(port) in_8(port) >> drivers/net/ethernet/8390/mcf8390.c:#define ei_inb ei_inb >> drivers/net/ethernet/8390/xsurf100.c:#define ei_inb(_a) z_readb(ax_convert_addr(_a)) >> drivers/net/ethernet/8390/zorro8390.c:#define ei_inb(port) in_8(port) >> >> Can't apne.c just do the same here? The patch below didn't >> take that long to come up with, but I may be missing something >> here of course. > > The address translation from ISA IO ports to MMIO addresses needs to be > added as well (in_8() does not use address translation on m68k). Indeed, I totally missed that bit. > apne.c also uses inw() which does have a different address translation > yet, but that's only for data transfer from the ring buffers and can > be handled entirely inside apne.c. and this as well. > Now that is all limited to m68k. I might be able to submit a patch, but > I cannot test any of this. > > ne.c needs the same treatment as far as I can see, and I could actually > test that one (on Atari, not actually on a PC ISA card). I'll see what I > can come up with. ATARI_ROM_ISA turns on HAS_IOPORT, so this one doesn't need any immediate changes as a result of Niklas's series. I see now that the apne driver doesn't actually need changes either since AMIGA_PCMCIA turns on ISA. I don't think there is an easy way to rework ne.c to avoid inb()/outb(), but you could consider splitting the atari support out into a separate module the same way as apne.c to make it use the atari operations directly. > I might well be missing something else here - as I said, it's been a few > years since I worked on the apne driver, and experimented with IO > abstractions in that context. The problem has always been making sure > drivers shared by different m68k platforms need only be built once and > still work on e.g. Q40 and Atari. Do you know of any other ISA style drivers that are used with the amiga pcmcia or the atari rom I/O operations, aside from the 8390 family? If this is the only one using it, it does sound like this could be simplified a lot by just making those two not share the object code with the ISA-style ne.c. Arnd