Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp3699543pxy; Tue, 4 May 2021 08:04:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmSwBBe2qOHK9IRgR3lSrlaiYo5ZjY5ZHE4z2/EgswxX1qr5qkrUDl7ZFjJAvDmp3pMGwB X-Received: by 2002:a63:ed4d:: with SMTP id m13mr7477835pgk.433.1620140691638; Tue, 04 May 2021 08:04:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620140691; cv=none; d=google.com; s=arc-20160816; b=kiaUy3Jw5HKx0J6BJJ2CcBZ/bzn4nuBnwzIgsFHKcK7cnQoeXnbbbORiN/oA2gK0mq Blndkms+6l4t9QMp72OuLYZK5KRJWsamV7Keo5ZIc1zFArcdSwdIyaLXbLj+IPlfteJs Tio5XKfvrOyZz/xqTPJkEZzIMTy57F1NUwunm+EaZbpsE/p7P5ZOvixyGU9bnMHnEBKr peKGg7SEwBcGV9Tlewc33+ZYeWvUjEDyV6czRerWzC0NAJc6egdMbmocyEsPmnZNOLEb 2q0JiJlD05W1CN1jbxKfNiHLKbPrxmCGol0bxt2HijUeNI1+PIAfCPrSTA7wDYOU5AoL 1LdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=SmsKdExe4v2/sba9NMdGCfTO5GZ4kk9/eWEOLFyUMCs=; b=zSOMGDzycgMi2/ubTUqNZmPZ7L4q1mH+rAPOwzqqEa30fxup0zuXuRMa2gaSyetdpz ON6sjFVg8Zxj8DSQ/TePBKsFE8JhW2o9fehYNlzwNxpBy4hyX1CgxzRTiS2/8qAK6+Rz U7B0lQ+JXQWz7c8TSX4H/vliXjkL8mkXKpdiCMNRiAkRZ6hiFcfQv0gDamP+Is5GWCr5 t2HJuTKYQnh2+akgwBZgr4CAqPTsf8ups+2J8951jEZJDyulcyb91N3RBkqbYUuJ1i9j /e0lSBP33bRVpt1yde66mR2dlXJKkW8dLAa61zU90mRMCjo40tMUXeTKYBTn4+H9okeG /d0w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p6si3598094plq.109.2021.05.04.08.04.38; Tue, 04 May 2021 08:04:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231587AbhEDOZB (ORCPT + 99 others); Tue, 4 May 2021 10:25:01 -0400 Received: from foss.arm.com ([217.140.110.172]:59244 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231580AbhEDOZB (ORCPT ); Tue, 4 May 2021 10:25:01 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EF76AED1; Tue, 4 May 2021 07:24:05 -0700 (PDT) Received: from lpieralisi (e121166-lin.cambridge.arm.com [10.1.196.255]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4EF513F718; Tue, 4 May 2021 07:24:03 -0700 (PDT) Date: Tue, 4 May 2021 15:23:58 +0100 From: Lorenzo Pieralisi To: Bjorn Helgaas Cc: Greentime Hu , paul.walmsley@sifive.com, hes@sifive.com, erik.danie@sifive.com, zong.li@sifive.com, bhelgaas@google.com, robh+dt@kernel.org, aou@eecs.berkeley.edu, mturquette@baylibre.com, sboyd@kernel.org, p.zabel@pengutronix.de, alex.dewar90@gmail.com, khilman@baylibre.com, hayashi.kunihiko@socionext.com, vidyas@nvidia.com, jh80.chung@samsung.com, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org Subject: Re: [PATCH v6 5/6] PCI: fu740: Add SiFive FU740 PCIe host controller driver Message-ID: <20210504142358.GA25477@lpieralisi> References: <20210504105940.100004-6-greentime.hu@sifive.com> <20210504134632.GA1088165@bjorn-Precision-5520> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210504134632.GA1088165@bjorn-Precision-5520> User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 04, 2021 at 08:46:32AM -0500, Bjorn Helgaas wrote: > On Tue, May 04, 2021 at 06:59:39PM +0800, Greentime Hu wrote: > > From: Paul Walmsley > > > > Add driver for the SiFive FU740 PCIe host controller. > > This controller is based on the DesignWare PCIe core. > > > > Signed-off-by: Paul Walmsley > > Co-developed-by: Henry Styles > > Signed-off-by: Henry Styles > > Co-developed-by: Erik Danie > > Signed-off-by: Erik Danie > > Co-developed-by: Greentime Hu > > Signed-off-by: Greentime Hu > > --- > > drivers/pci/controller/dwc/Kconfig | 10 + > > drivers/pci/controller/dwc/Makefile | 1 + > > drivers/pci/controller/dwc/pcie-fu740.c | 309 ++++++++++++++++++++++++ > > 3 files changed, 320 insertions(+) > > create mode 100644 drivers/pci/controller/dwc/pcie-fu740.c > > > > diff --git a/drivers/pci/controller/dwc/Kconfig b/drivers/pci/controller/dwc/Kconfig > > index 22c5529e9a65..255d43b1661b 100644 > > --- a/drivers/pci/controller/dwc/Kconfig > > +++ b/drivers/pci/controller/dwc/Kconfig > > @@ -318,4 +318,14 @@ config PCIE_AL > > required only for DT-based platforms. ACPI platforms with the > > Annapurna Labs PCIe controller don't need to enable this. > > > > +config PCIE_FU740 > > + bool "SiFive FU740 PCIe host controller" > > + depends on PCI_MSI_IRQ_DOMAIN > > + depends on SOC_SIFIVE || COMPILE_TEST > > + depends on GPIOLIB > > 1) I'm a little disappointed that I reported the build issue 6 days > ago when we were already in the merge window, and it's taken until > now to make some progress. > > 2) I would prefer not to depend on GPIOLIB because it reduces > compile-test coverage. For example, the x86_64 defconfig does not > enable GPIOLIB, so one must manually enable it to even be able to > enable PCIE_FU740. > > Many other PCI controller drivers use GPIO, but no others depend on > GPIOLIB, so I infer that in the !GPIOLIB case, gpio/consumer.h > provides the stubs required for compile testing. > > We could have a conversation about whether it's better to > explicitly depend on GPIOLIB here, or whether building a working > FU740 driver implicitly depends on GPIOLIB being selected > elsewhere. That implicit dependency *is* a little obscure, but I > think that's what other drivers currently do, and I'd like to do > this consistently unless there's a good reason otherwise. I will drop the explicit GPIOLIB dependency and push it out. For (1) I agree with you - I merged when I received some input - it is reasonable to avoid adding it to v5.13 material for this reason, apologies. Thanks, Lorenzo > Here are some examples of other drivers: > > dwc/pci-dra7xx.c: > config PCI_DRA7XX_HOST > depends on SOC_DRA7XX || COMPILE_TEST > > config SOC_DRA7XX > select ARCH_OMAP2PLUS > > config ARCH_OMAP2PLUS > select GPIOLIB > > dwc/pci-meson.c: > config PCI_MESON > # doesn't, but probably *should* depend on "ARCH_MESON || COMPILE_TEST" > > menuconfig ARCH_MESON > select GPIOLIB > > dwc/pcie-qcom.c: > config PCIE_QCOM > depends on OF && (ARCH_QCOM || COMPILE_TEST) > > config ARCH_QCOM > select GPIOLIB > > pcie-rockchip.c: > config PCIE_ROCKCHIP_HOST > depends on ARCH_ROCKCHIP || COMPILE_TEST > > config ARCH_ROCKCHIP > select GPIOLIB > > > + select PCIE_DW_HOST > > + help > > + Say Y here if you want PCIe controller support for the SiFive > > + FU740. > > + > > endmenu