Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4644182iob; Sun, 8 May 2022 20:23:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9y/ufSJCpY5d1xryGMAR8x6VonGx5a732yDiF/ag5q42fDOymb+TkNhZpCdck3esbka+r X-Received: by 2002:a17:903:2281:b0:15e:95f7:37d1 with SMTP id b1-20020a170903228100b0015e95f737d1mr14303073plh.18.1652066616952; Sun, 08 May 2022 20:23:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652066616; cv=none; d=google.com; s=arc-20160816; b=CmKDpPTl04emjHKjBwlF2YDIzaWyeWQ8nN+vNbgnXldJdBu3jXwpRJ7i7QjpcgTlzA pzvgubt1QRSKt1rKWTIHqnNB4S/F8LbnM/1RVzfudd6OAsI8Xk67u7Ipp88osZFcXqxv aT2NYGlGXcZEiN/+gQ0pQYtD2UxCCkaBQGL0GfErRA/TCA7hIdWGcaK5pU4VKYqI9DOI KNpHQ/Uu/5fafXN3ThCucWouQIcLTkJ2EIsfl39PiXb69g7FoyVDihGL2Ncl8gzy4Wy8 ZlLeWN/00EY7BYYdl89svfPZy4nXi75YIhlqdBs3ZckxEihSt3s9rs67hJGX0QgbZdTf qkqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=T95DKyI860o0Ni6h4dJD+E7diEEpmm2y8EkaKK0YMZc=; b=ArR5IiJvKxVaq3DG9ZalMSZBzGt+iaxcvx/O3kaZHGT+LovKqXLXD0WnjWJ/Ga6gq+ WYPqI3gC+PERjXm+f9x2kPzUwVLxQtHPD/TyU1E/7o52Ymt2n1OVotHz44ZrbTeHmUwP j3kudfv9KdoaPkodBDpyZ70oCH82vz0i0Sp1tlheyHQRWaoPp7M8wasACLCNuNfNoiL1 aD2BSvlC/S4RRQhm1YIDNBKxpcWZnFOSX/gufP/vQ5zRVEAudi0Y5SFcY1RF+VHSu8nK 5JbgsINThrt0iyxIOVGD2N9a8n6uKYZvo+zBhycROHIAvyWoegMcnTnDx+xdFQSd/33e +etg== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id mh4-20020a17090b4ac400b001d26ee86442si15756939pjb.93.2022.05.08.20.23.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 20:23:36 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4099B996AF; Sun, 8 May 2022 20:21:38 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442575AbiEFPGH (ORCPT + 99 others); Fri, 6 May 2022 11:06:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344485AbiEFPGE (ORCPT ); Fri, 6 May 2022 11:06:04 -0400 Received: from mail-qv1-f49.google.com (mail-qv1-f49.google.com [209.85.219.49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA313396B6; Fri, 6 May 2022 08:02:20 -0700 (PDT) Received: by mail-qv1-f49.google.com with SMTP id js14so5584893qvb.12; Fri, 06 May 2022 08:02:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=T95DKyI860o0Ni6h4dJD+E7diEEpmm2y8EkaKK0YMZc=; b=LIEt+Hj0vorrPId2XXAkIzYrafDHh4aGVFsTJERz19t6ZBEGg4QqxOeWZIiZm1IzdA TP9/Gzt6OcBeCGJrc5ptrAoRAptT87/ed4fEOYP5rjMkxZ08BRCzZdUivGPaflqOrxid UdUX9guNF636lqAAqf2X6uu7i5yfhqe2peiWMfrHN17BblyZntp85mXqSYolGtsOeahP Bqhw8nXJb6yqqbGYgDVz49P6My1uYqB1fumdV7cjG5TbC6cor52Dz28WyGQi30JeLABb BwvMlRhRT0caLQGmbZHgEmqY572uMTBhKKCF09qxgDuhQCaEESY+w7YTVJqhTkeqT76H ghGQ== X-Gm-Message-State: AOAM532tB31TEiA294rcJNQ3ykT0zHFdc8p261lVpD/VsfCDQiBtEcEQ J6moxrX2XxBrpszDFBVA1FtpGT0qW2d+VQ== X-Received: by 2002:a05:6214:29c1:b0:45a:e0e5:7b2b with SMTP id gh1-20020a05621429c100b0045ae0e57b2bmr2778900qvb.44.1651849339531; Fri, 06 May 2022 08:02:19 -0700 (PDT) Received: from mail-yb1-f176.google.com (mail-yb1-f176.google.com. [209.85.219.176]) by smtp.gmail.com with ESMTPSA id bm25-20020a05620a199900b0069fc13ce22asm2625608qkb.91.2022.05.06.08.02.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 06 May 2022 08:02:19 -0700 (PDT) Received: by mail-yb1-f176.google.com with SMTP id w187so13355019ybe.2; Fri, 06 May 2022 08:02:18 -0700 (PDT) X-Received: by 2002:a05:6902:120e:b0:634:6f29:6b84 with SMTP id s14-20020a056902120e00b006346f296b84mr2817893ybu.604.1651849338111; Fri, 06 May 2022 08:02:18 -0700 (PDT) MIME-Version: 1.0 References: <20220505161028.GA492600@bhelgaas> <5239892986c94239a122ab2f7a18a7a5@AcuMS.aculab.com> <62c1bf6687ac4abc98d4015852930241@AcuMS.aculab.com> In-Reply-To: <62c1bf6687ac4abc98d4015852930241@AcuMS.aculab.com> From: Geert Uytterhoeven Date: Fri, 6 May 2022 17:02:06 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC v2 01/39] Kconfig: introduce HAS_IOPORT option and select it as necessary To: David Laight Cc: "Maciej W. Rozycki" , Arnd Bergmann , Rich Felker , "open list:IA64 (Itanium) PLATFORM" , "open list:SUPERH" , Catalin Marinas , Dave Hansen , "open list:MIPS" , "James E.J. Bottomley" , "open list:SPARC + UltraSPARC (sparc/sparc64)" , "open list:RISC-V ARCHITECTURE" , Will Deacon , linux-arch , Yoshinori Sato , Helge Deller , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , Russell King , Ingo Molnar , linux-pci , Bjorn Helgaas , Matt Turner , Albert Ou , Arnd Bergmann , Niklas Schnelle , "open list:M68K ARCHITECTURE" , Ivan Kokshaysky , Paul Walmsley , Thomas Gleixner , "moderated list:ARM PORT" , Richard Henderson , Michal Simek , Thomas Bogendoerfer , "open list:PARISC ARCHITECTURE" , Greg Kroah-Hartman , Linux Kernel Mailing List , Palmer Dabbelt , "open list:ALPHA PORT" , Borislav Petkov , "open list:LINUX FOR POWERPC (32-BIT AND 64-BIT)" , "David S. Miller" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi David On Fri, May 6, 2022 at 4:05 PM David Laight wrote: > From: Geert Uytterhoeven > > Sent: 06 May 2022 14:09 > > > The same is really true for other bus type - including ISA and EISA. > > > (Ignoring the horrid of probing ISI bus devices - hopefully they > > > are in the ACPI tables??_ > > > If a driver is probed on a ISA bus there ought to be functions > > > equivalent to pci_ioremap() (for both memory and IO addresses) > > > that return tokens appropriate for the specific bus. > > > > > > That is all a different load of churn. > > > > A loooong time ago, it was suggested to add register accessor > > functions to struct device, so e.g. readl(dev, offset) would call > > into these accessors, which would implement the bus-specific behavior. > > No more worries about readl(), __raw_readl(), ioread32b(), or whatever > > quirk is needed, at the (small on nowadays' machines) expense of > > some indirection... > > I was just thinking that the access functions might need a 'device'. > Although you also need the BAR (or equivalent). > So readl(dev, bar_token, offset) or readl(dev, bar_token + offset). Note that we do have such a system: regmap. > Clearly the 'dev' parameter could be compiled out for non-DEBUG > build on x86 - leaving the current(ish) object code. Assumed all devices are PCI devices. E.g. USB devices would still need the indirection. > You don't want an indirect call (this year), but maybe real > function call and a few tests won't make that much difference. > They might affect PCIe writes, but PCIe reads are so slow you > need to avoid them whenever possible. > I've not timed reads into something like an ethernet chip, > but into our fpga they are probably 1000 clocks+. > > OTOH I wouldn't want any overhead on the PIO fifo reads > on one of our small ppc devices. > We push a lot of data though that fifo and anything extra > would kill performance. Right. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds