From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EBD98C433E1 for ; Thu, 23 Jul 2020 16:56:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C2DC3207BB for ; Thu, 23 Jul 2020 16:56:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595523369; bh=9qNrdyKreXu55OEnqmMFmaXouq8WzhxQTRQhDqKFzO0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=owXm4IG5qeic1ofPbK3Wz1RNWvg2h2nmFBbxAx+4R0toWyGQuwaYyPHQSjpTzhIs6 jdvTIM4d1HqE8ydjRfisqL/pMuh7WcW6Z3zyHikdrHzYsul//fAXsRzG4kRk1Q9ff1 i4gyoyGiiVEMdnRnEzj/dnuWC5nN1Obbvdb/6RP4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729827AbgGWQ4J (ORCPT ); Thu, 23 Jul 2020 12:56:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:34614 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726621AbgGWQ4I (ORCPT ); Thu, 23 Jul 2020 12:56:08 -0400 Received: from mail-oi1-f182.google.com (mail-oi1-f182.google.com [209.85.167.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E179C22C9E; Thu, 23 Jul 2020 16:56:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595523368; bh=9qNrdyKreXu55OEnqmMFmaXouq8WzhxQTRQhDqKFzO0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=o6wMUa0PL7/6U5SHYS/PNagOvSs/yXS6zJA7IduXu9mNIItpgxVjzh/vehP9o1uS5 7GU3azUhN1T2k4Slzl92tsJ0l5ngaMocjpWth3sl4E1Xrg/tUitOIxqUF5gFcxkFCk Xw5plQoEsDbZISRNB4LwPsRwJDiMjQVXpLVLYST0= Received: by mail-oi1-f182.google.com with SMTP id 12so5608396oir.4; Thu, 23 Jul 2020 09:56:07 -0700 (PDT) X-Gm-Message-State: AOAM533Su8a7BDBwduEvNbbUZlQu5a+sy6ZhQB+ECVOqGsN1nHe0iMV6 /kltMSb3BnW+2h45FZcNncSzb2Oay7IZMc07zQ== X-Google-Smtp-Source: ABdhPJxlKZuS4ILTZ0+IoSoyVcDFqevHuf8OXw4KW6x7xfb5X7pMDe0Ld53HmKjmZM6D5msfxGLb+rIS+n0uKMrGU/A= X-Received: by 2002:aca:bb82:: with SMTP id l124mr4763076oif.106.1595523367119; Thu, 23 Jul 2020 09:56:07 -0700 (PDT) MIME-Version: 1.0 References: <20200722022514.1283916-1-robh@kernel.org> <20200722022514.1283916-12-robh@kernel.org> <20200723162148.GA11749@e121166-lin.cambridge.arm.com> In-Reply-To: <20200723162148.GA11749@e121166-lin.cambridge.arm.com> From: Rob Herring Date: Thu, 23 Jul 2020 10:55:55 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 11/19] PCI: Move setting pci_host_bridge.busnr out of host drivers To: Lorenzo Pieralisi Cc: Bjorn Helgaas , Fabio Estevam , Gustavo Pimentel , Heiko Stuebner , Hou Zhiqiang , Jingoo Han , Jonathan Hunter , Karthikeyan Mitran , Linus Walleij , Lucas Stach , Marek Vasut , Michal Simek , Murali Karicheri , NXP Linux Team , Pengutronix Kernel Team , Richard Zhu , Ryder Lee , Sascha Hauer , Shawn Guo , Shawn Lin , Thierry Reding , Thomas Petazzoni , Tom Joseph , Will Deacon , Yoshihiro Shimoda , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , "moderated list:ARM/Mediatek SoC support" , PCI , "open list:MEDIA DRIVERS FOR RENESAS - FCP" , "open list:ARM/Rockchip SoC..." , linux-tegra Content-Type: text/plain; charset="UTF-8" Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On Thu, Jul 23, 2020 at 10:21 AM Lorenzo Pieralisi wrote: > > On Thu, Jul 23, 2020 at 09:26:01AM -0600, Rob Herring wrote: > > On Tue, Jul 21, 2020 at 8:25 PM Rob Herring wrote: > > > > > > Most host drivers only parse the DT bus range to set the root bus number > > > in pci_host_bridge.busnr. The ones that don't set busnr are buggy in > > > that they ignore what's in DT. Let's set busnr in pci_scan_root_bus_bridge() > > > where we already check for the bus resource and remove setting it in > > > host drivers. > > > > > > Cc: Jingoo Han > > > Cc: Gustavo Pimentel > > > Cc: Lorenzo Pieralisi > > > Cc: Bjorn Helgaas > > > Cc: Thomas Petazzoni > > > Cc: Will Deacon > > > Cc: Thierry Reding > > > Cc: Jonathan Hunter > > > Cc: Linus Walleij > > > Cc: Ryder Lee > > > Cc: Marek Vasut > > > Cc: Yoshihiro Shimoda > > > Cc: linux-tegra@vger.kernel.org > > > Cc: linux-mediatek@lists.infradead.org > > > Cc: linux-renesas-soc@vger.kernel.org > > > Signed-off-by: Rob Herring > > > --- > > > drivers/pci/controller/dwc/pcie-designware-host.c | 4 ---- > > > drivers/pci/controller/dwc/pcie-designware.h | 1 - > > > drivers/pci/controller/pci-aardvark.c | 5 ++--- > > > drivers/pci/controller/pci-host-common.c | 1 - > > > drivers/pci/controller/pci-tegra.c | 4 +--- > > > drivers/pci/controller/pci-v3-semi.c | 2 -- > > > drivers/pci/controller/pcie-mediatek.c | 8 +------- > > > drivers/pci/controller/pcie-rcar-host.c | 1 - > > > drivers/pci/probe.c | 1 + > > > 9 files changed, 5 insertions(+), 22 deletions(-) > > > > > > diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c > > > index 9e8a9cfc6d3a..fa922cb876a3 100644 > > > --- a/drivers/pci/controller/dwc/pcie-designware-host.c > > > +++ b/drivers/pci/controller/dwc/pcie-designware-host.c > > > @@ -374,9 +374,6 @@ int dw_pcie_host_init(struct pcie_port *pp) > > > pp->cfg0_base = pp->cfg->start; > > > pp->cfg1_base = pp->cfg->start + pp->cfg0_size; > > > break; > > > - case IORESOURCE_BUS: > > > - pp->busn = win->res; > > > - break; > > > } > > > } > > > > > > > > diff --git a/drivers/pci/controller/dwc/pcie-designware.h b/drivers/pci/controller/dwc/pcie-designware.h > > > index fd2146298b58..9fb44290ed43 100644 > > > --- a/drivers/pci/controller/dwc/pcie-designware.h > > > +++ b/drivers/pci/controller/dwc/pcie-designware.h > > > @@ -188,7 +188,6 @@ struct pcie_port { > > > struct resource *cfg; > > > struct resource *io; > > > struct resource *mem; > > > - struct resource *busn; > > > int irq; > > > const struct dw_pcie_host_ops *ops; > > > int msi_irq; > > > > These 2 hunks should be dropped as they are breaking the Amazon driver. > > > > Lorenzo, do you want to fixup or I can send a fix? > > Done (I have not removed the hunk below though): Right, that's correct. I'll post a separate patch removing 'pp->busn' as that's available from the bridge struct. The bridge struct surprisingly is not accessible from the DWC structs. I guess that's why there's a bunch of duplication of data. Rob > diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c > index 9e8a9cfc6d3a..9775558acdc8 100644 > --- a/drivers/pci/controller/dwc/pcie-designware-host.c > +++ b/drivers/pci/controller/dwc/pcie-designware-host.c > @@ -474,7 +474,6 @@ int dw_pcie_host_init(struct pcie_port *pp) > } > > bridge->sysdata = pp; > - bridge->busnr = pp->busn->start; > bridge->ops = &dw_pcie_ops; > bridge->map_irq = of_irq_parse_and_map_pci; > bridge->swizzle_irq = pci_common_swizzle;