Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4412421rwd; Tue, 30 May 2023 05:15:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5/6LLJPTgN5E0gijN7pFCeiiVuN+M8w8zs9MFm0t4ZNVTD/OycUM2ynN/b6lxjdFzF57Da X-Received: by 2002:a17:90b:4f85:b0:256:87f4:432a with SMTP id qe5-20020a17090b4f8500b0025687f4432amr2118210pjb.18.1685448916100; Tue, 30 May 2023 05:15:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685448916; cv=none; d=google.com; s=arc-20160816; b=VtwEhXUnbqVjWTeiaZufefF924kLviXPNw9/KvcLxeJmlOkJXPzKLhPxz3ggjOQd7+ DlOrwrPL29veCFQHszNDg12UpgFSLvjGDZW6ZHNKEx31D+bXJ3XJ4qKgDHD6qEBwmwkZ fRKxl95qGTaZX2UsSU+CkO5kHXVP9TqymQX1zJK6/KptJYo16UbFJnDgzCXAF/Ohsx0y OJqvQjEm/rzAMIf0knPVNAq/nnZb9XdnCjFsWuf+OLXeupUiqiP0O1bzKcf2lkaZBM+6 bQyiEQH7TojDkQ9pVBZsTUqUxswB6dfmYCrV80f48XzS24oVzfRkbZF9yz831cOal4Jn ABGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:references:in-reply-to :message-id:mime-version:user-agent:feedback-id:dkim-signature :dkim-signature; bh=P+2rgMj4xQlfafj7GcrGEIKSMhcZ1qGdM9UbAgiRc6I=; b=Uie8D1pl4AAAMfVnROJOhyf6nqm3YU/9FyEYoRkeFIZoCkEntUFjboNmIiqQdUSytA A604myzSQHKuHFZVcC0ThtZRNk/5iEvK+4kLDd0mf3uJ3pJKi5Zksp2L4H7wBK5WW5xB hTz6r4dSoYi04ev2RLM3Jh8qmdX0SUwaHzOyIsAa1/qEIKshMZN2Ewzi1yYlxB9pqBYI 5DSQPoWFb5wr7m41X0hzkBbET74CubPiYJmhTCQUJKPfDmI9EXCCi1oPwQQf2uFLEIHp nWn0hpsrEtqLKZxJK+OO4I+Y/LHMMFY0hQeJgffulTen9NrARdh1Uu7BoZfVuHsS9XWE 3ZxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm3 header.b=KpZug7Xl; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=NLT3WQ2M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i2-20020a17090ac40200b0023d22d0f0fdsi13560116pjt.19.2023.05.30.05.15.03; Tue, 30 May 2023 05:15:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm3 header.b=KpZug7Xl; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=NLT3WQ2M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232060AbjE3LzS (ORCPT + 99 others); Tue, 30 May 2023 07:55:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230517AbjE3LzR (ORCPT ); Tue, 30 May 2023 07:55:17 -0400 Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CD3D1A2; Tue, 30 May 2023 04:54:39 -0700 (PDT) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 00BF85C0095; Tue, 30 May 2023 07:54:13 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute6.internal (MEProxy); Tue, 30 May 2023 07:54:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1685447652; x=1685534052; bh=P+ 2rgMj4xQlfafj7GcrGEIKSMhcZ1qGdM9UbAgiRc6I=; b=KpZug7XlPd6I1x7Wff 6Ic267AhM0pU+D26WvjCTNFBtR5jNha0vLw0Sybpz69ElQGgG/O0nrMaKWa+/vuL 6M9VXXTLnngiS2Bbv1ZVDDEAWUtzXFukJ8dgBV7A8HM+RXiUqdAYspomQGRwwwTw HyhOlZoWYHo1e3IqmlP6dAk7YU359IFgQPxT86FAaKuG95trapBtiZnIZSpZ2wzE owCUYHf2Th8BujcrTPFuDhiNT3+sh77vC1OBB71hL5QLxerZgwb8lAYb6ASp8VjZ 7pDITToH5UCRIhbVCm9fD4ynEGi/0triFLIHyjpUMp2PUEIUOTpCie3SNXiY4V/x O1vg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1685447652; x=1685534052; bh=P+2rgMj4xQlfa fj7GcrGEIKSMhcZ1qGdM9UbAgiRc6I=; b=NLT3WQ2MbghARrWk4NbyL1DxwXO50 Gotlj0w/VK/ciTqdYrcxqCy9MXNlXeczFqODZwJYCLwtATP/4KE4kl8xwkqPxH/z Rm+kQOr1MSG97y11F+QzD3pIuOYLU1GiL0h70ee+fmWPxUvfXin8kNVOtQP9qAAE 1pRlkv+xGA066avXbTFi6gOTZ+NV7zbg7XchPCDogmVpc5tYk6Jdft9qjM2ivD+x wfkzPQyxboBvnGt2TyOB/oMY2q2Q+Jqy09zZBP79bnYF0fjC5vZYUwTLM9fg0BDJ 5KYTL+mDdrpF10uw9EojQzlYWDBSEYZaozaDiMsaUdiGm8gvPNnJA2XeQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeekjedggeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepffehueegteeihfegtefhjefgtdeugfegjeelheejueethfefgeeghfektdek teffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id D80C0B60086; Tue, 30 May 2023 07:54:11 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-441-ga3ab13cd6d-fm-20230517.001-ga3ab13cd Mime-Version: 1.0 Message-Id: <891e6ac4-30ae-4b86-b692-3b6b7b8b4e57@app.fastmail.com> In-Reply-To: <2023053059-self-mangle-30b6@gregkh> References: <20230516110038.2413224-1-schnelle@linux.ibm.com> <20230516110038.2413224-34-schnelle@linux.ibm.com> <2023053059-self-mangle-30b6@gregkh> Date: Tue, 30 May 2023 13:53:50 +0200 From: "Arnd Bergmann" To: "Greg Kroah-Hartman" , "Niklas Schnelle" Cc: "Jiri Slaby" , "Bjorn Helgaas" , =?UTF-8?Q?Uwe_Kleine-K=C3=B6nig?= , "Mauro Carvalho Chehab" , "Alan Stern" , "Rafael J . Wysocki" , "Geert Uytterhoeven" , "Paul Walmsley" , "Palmer Dabbelt" , "Albert Ou" , linux-kernel@vger.kernel.org, Linux-Arch , linux-pci@vger.kernel.org, "Arnd Bergmann" , linux-serial@vger.kernel.org Subject: Re: [PATCH v4 33/41] tty: serial: handle HAS_IOPORT dependencies Content-Type: text/plain X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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 On Tue, May 30, 2023, at 12:48, Greg Kroah-Hartman wrote: > On Tue, May 16, 2023 at 01:00:29PM +0200, Niklas Schnelle wrote: >> In a future patch HAS_IOPORT=n will result in inb()/outb() and friends >> not being declared. We thus need to add HAS_IOPORT as dependency for >> those drivers using them unconditionally. For 8250 based drivers some >> support MMIO only use so fence only the parts requiring I/O ports. > > Why can't you have dummy inb()/outb() so we don't need these #ifdefs all > over the place in .c files? Was that documented somewhere? We do that > for other driver/hardware apis, why are these so special they don't > deserve that? That was what our original approach did years ago, and Linus rightfully rejected it. Almost every driver either requires inb()/outb() to do anything, or it doesn't use them at all. The 8250 uart is one of the few exceptions to this, as it has many variants. It would be possible to separate this out more in the 8250 driver as well and split it out into separate modules and indirect function pointers, but that would be a larger rework and have a higher risk of regressions. Also, the 8250 driver is already full of #ifdef in .c files, Arnd