Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp7151008rwn; Tue, 13 Sep 2022 14:56:43 -0700 (PDT) X-Google-Smtp-Source: AA6agR5MiearwV5cay5c1CD3jr4tGTC6o4GxsxbVExYvD5NqMWDtcgrDxLQH8//u8QDi9/pziGE2 X-Received: by 2002:a17:907:7b9d:b0:77d:8cd3:ea3a with SMTP id ne29-20020a1709077b9d00b0077d8cd3ea3amr7853698ejc.746.1663106203639; Tue, 13 Sep 2022 14:56:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663106203; cv=none; d=google.com; s=arc-20160816; b=Xkbrau5fvgVOTxFdwK2nMZlMxVCm/0urFwT3oEnKzBzbkbQX9GPUmYiztMHgYoeWYk ZTMPrCOoVSWHz3PVBpdezoxzFIfM+ICMRPhO0vdXqUheUw1DGuuKbBfRyorPvPo3q/0Z tc1DqBgoTsg4XkOtDczqOlqETDIeFQj9OqB+nwoNmMPm6lW08tugQfqfqkq47H1b1oPD Km21wudJc4yIUrbd3YbmFnyrgWTF/b+HvLYAiQr2HJyUUOdMP3KfOx/5ywEaGAaEwEpV DwWFp0gwpUsC6OE7CCmvM0+xmYyQm5DmYLv9ceaN+c5z3wA/Kyze6y7wCqY6KQHm9avm p2ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:message-id:subject:cc:to:from:date :dkim-signature; bh=GEndy/V+UWlEMvMX1JhRI9LEDmr0RXpz0AKCTX126HA=; b=RdrVVrgrIP2Mw2+CbQvVxe39m0W0i31B29zYnZnjqNaSEyBpVZnwSTle4DcNCk6Den ptQBQmkm854gB8jfZo5tOwft/UrHByhQj6CUOg+k4riKh5++UOo2ADomPhvKm0YeU6l3 A3aX8oj3lCZ8THi6suOBoTAUccGFYzBe5H+ZPNrbjtUNpD1umJ6a8IV/ZHHcTGjrPkf1 uYUDtEwvD9L3d1oqGYIwzFjcmwIpXRtmv5OFVU6Xgar4FgcpdjlDGfsj/BdS/tDs18i8 UjOfNJ1nvRSOeRNCPAwcJjYiWSn6jpTnklENwKa96w77RbP4N6MYAVdoZh3pIAfy6r9d CObA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=m8dxabHF; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ds17-20020a170907725100b0077c5ec87ec2si6979249ejc.297.2022.09.13.14.56.17; Tue, 13 Sep 2022 14:56:43 -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=@kernel.org header.s=k20201202 header.b=m8dxabHF; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229624AbiIMVxG (ORCPT + 99 others); Tue, 13 Sep 2022 17:53:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229487AbiIMVxE (ORCPT ); Tue, 13 Sep 2022 17:53:04 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C6876D9FF; Tue, 13 Sep 2022 14:53:03 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E9093615B0; Tue, 13 Sep 2022 21:53:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 13FC5C433C1; Tue, 13 Sep 2022 21:53:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1663105982; bh=Xxpeh83ghyVDcQZqEqOkPGke5vxRqIieah6+QXlXYMc=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=m8dxabHFp5ULuP6WVPkdHq/pklVKFakjrmD+SbtwbiclkVePpe6JtwAIIg9ofLhiE aLCDo58f47IfpYxG1Dc/pYnE+HhT0q2Uq6w8zqZBo5gZ1Ycq/JPzvmri6zAk22eFE2 jRXu4hxSxF02khL3LBiUf/WEnXyzrsFD2Fw31SE9jUJYtBmUGTwbRke/fYoLfwiK8b ADKQlfqRWd/BgsbHfAJ7Kw39MaxjfDe2llKNOR4iuz3REmytY75UhOUrUwrbVLNhhf CYffVsOrkK5xQcJa43+ocqDG7FuzS7IlCZywBl4cOF5Dug/qcxtMGg7b4hYUgVJlu9 NyaSmZ8RPh8UQ== Date: Tue, 13 Sep 2022 16:53:00 -0500 From: Bjorn Helgaas To: Pali =?iso-8859-1?Q?Roh=E1r?= Cc: Bjorn Helgaas , Lorenzo Pieralisi , Rob Herring , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Sergio Paracuellos , Matthias Brugger , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Subject: Re: [RFC PATCH 1/3] PCI: Add standard PCI Config Address macros Message-ID: <20220913215300.GA626928@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220913212421.yblwhgbd7zpdg5eo@pali> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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, Sep 13, 2022 at 11:24:21PM +0200, Pali Roh?r wrote: > On Tuesday 13 September 2022 16:11:43 Bjorn Helgaas wrote: > > On Sun, Sep 11, 2022 at 01:20:22PM +0200, Pali Roh?r wrote: > > > Lot of PCI and PCIe controllers are using standard Config Address for PCI > > > Configuration Mechanism #1 (as defined inPCI Local Bus Specification) or > > > its extended version. > > > > > > So introduce new macros PCI_CONF1_ADDRESS() and PCI_CONF1_EXT_ADDRESS() in > > > new include file linux/pci-conf1.h which can be suitable for PCI and PCIe > > > controllers which uses this type of access to PCI config space. > > > > > > Signed-off-by: Pali Roh?r > > > --- > > > include/linux/pci-conf1.h | 51 +++++++++++++++++++++++++++++++++++++++ > > > 1 file changed, 51 insertions(+) > > > create mode 100644 include/linux/pci-conf1.h > > > > This seems like a nice addition, but it would be nice if we could > > encapsulate it in drivers/pci. > > > > I know it's parallel to the existing include/linux/pci-ecam.h. I wish > > we could encapsulate *that* in drivers/pci, too. For pci-ecam.h, I > > think the only things that prevent that are drivers/acpi/pci_mcfg.c, > > loongarch, and a few arm64 things. > > As these macros describe original Intel x86 API, it can be used also in > arch/x86 PCI code. I would love to see that happen, too, and that could be a reason to put pci-conf.h in include/linux. But this series doesn't include that. > > I guess that's a long-winded way of saying that I think maybe we could > > put this in drivers/pci/pci.h even though the parallel ECAM stuff is > > in include/linux/pci-ecam.h. > > Well, if you like this change, let me know where to put those new > macros, into which file and in which subdirectory, and I can prepare a > new patch version. drivers/pci/pci.h > But doing all those arm64, x86, ACPI cleanup is a huge cross-tree work > which I'm really not going to do... Of course not, I didn't suggest or expect that. What I'm trying to point out is that I don't think we have very good reasons for pci-ecam.h to be public. And therefore, I don't think we need pci-conf1.h to be next to it. Unless you want to convert the arch/x86 code to use them as well. I'm not asking you to do that either, just that if you *did* do that, it would be an argument for keeping the macros where you put them. Bjorn