From patchwork Wed Jun 21 15:14:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 9802149 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0F29860329 for ; Wed, 21 Jun 2017 15:14:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F1104285C7 for ; Wed, 21 Jun 2017 15:14:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E487C285EC; Wed, 21 Jun 2017 15:14:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5042E285C7 for ; Wed, 21 Jun 2017 15:14:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752371AbdFUPO0 (ORCPT ); Wed, 21 Jun 2017 11:14:26 -0400 Received: from mail-it0-f44.google.com ([209.85.214.44]:37827 "EHLO mail-it0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751133AbdFUPO0 (ORCPT ); Wed, 21 Jun 2017 11:14:26 -0400 Received: by mail-it0-f44.google.com with SMTP id m47so5089102iti.0 for ; Wed, 21 Jun 2017 08:14:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=+BUCwdtkycIEX4/ex2n3WUdFAPRBwY8mGvWJAu+IGsQ=; b=bk3rGzwzyUKtSp0qGrKUq5mu8hoEnsfkmy2IRDnX7brtAbh8o3yF2VYcWBCSwub4KI f00XllEynwh6L2NEvQmgbIj8aAtjzeuU3XbneQtt7Ko6gjWGRJiD+hekycTTVvJXRKaj Ot+RfIKaRPW/gfyjp40NQq5z48OEzUMXoUowk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=+BUCwdtkycIEX4/ex2n3WUdFAPRBwY8mGvWJAu+IGsQ=; b=ljjMPlhB7Gs910U4NZ+q7I8o8IGV3JzN8Yna978UDBXWPm6fPAZ86o6BrdK75gPgdZ mxYeHTw7R7yYanDiKa4MCIwhjMEZxR9WYIpHYsjgSfZAXhBtdvtIWyuzAAaftT4Nxp+k mSdhc0cfKNXPsEHJfpv7pU6Rx1sOc/k8PMPzqXhmDzI5mYT+i54aU273cX/16lvVQm0b j4f+9zazAspdvL0vN0oqf7Mfsldimqqski5/qhAfHXRQJOHexRA6yJklxSBlmznH1/gh s7yqFfEPDXzmHH2Z90/wBrGGEW+n2tKPRSj7vLzQAl9fcgBrrGyafAP23l08YaHyEEF3 xoug== X-Gm-Message-State: AKS2vOxETlUiagwecw3gdJ1E0JwG7lVpVnWxGBczfilhr5BTy7J12Hbi 6PKgOFdZWfWhgh9lN9CrIC1WY6nRYZr4 X-Received: by 10.36.43.146 with SMTP id h140mr8948860ita.7.1498058055246; Wed, 21 Jun 2017 08:14:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.79.142.212 with HTTP; Wed, 21 Jun 2017 08:14:13 -0700 (PDT) In-Reply-To: <20170621104538.GA8477@red-moon> References: <20170608141342.2018-1-lorenzo.pieralisi@arm.com> <20170621103042.GA1712@red-moon> <20170621104538.GA8477@red-moon> From: Linus Walleij Date: Wed, 21 Jun 2017 17:14:13 +0200 Message-ID: Subject: Re: [RFT PATCH v2 00/42] PCI: ARM/ARM64: remove pci_fixup_irqs() usage To: Lorenzo Pieralisi Cc: linux-pci , "linux-arm-kernel@lists.infradead.org" , Arnd Bergmann , Will Deacon , Russell King , Pratyush Anand , Jingoo Han , Bjorn Helgaas , Rob Herring , Simon Horman , Mingkai Hu , Tanmay Inamdar , Murali Karicheri , Bharat Kumar Gogada , Shawn Lin , Minghuan Lian , Gabriele Paoloni , Thomas Petazzoni , Joao Pinto , Thierry Reding , Michal Simek , Stanimir Varbanov , Zhou Wang , Roy Zang , Matthew Minter Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Wed, Jun 21, 2017 at 12:45 PM, Lorenzo Pieralisi wrote: > Sorry I miss yet another usage of struct pci_bus before bus is > scanned in faraday_pci_parse_map_dma_ranges(), all these config > accessors want is to access bus number 0 and writei/read some config > values in there, please confirm. > > Updated patch here: I fixed it. This was needed: I'll send a modified and tested version of your patch. Yours, Linus Walleij diff --git a/drivers/pci/host/pci-ftpci100.c b/drivers/pci/host/pci-ftpci100.c index 86f8a3d1c1da..5162dffc102b 100644 --- a/drivers/pci/host/pci-ftpci100.c +++ b/drivers/pci/host/pci-ftpci100.c @@ -450,6 +450,8 @@ static int faraday_pci_probe(struct platform_device *pdev) struct resource *io; struct pci_host_bridge *host; struct clk *clk; + unsigned char max_bus_speed = PCI_SPEED_33MHz; + unsigned char cur_bus_speed = PCI_SPEED_33MHz; int ret; u32 val; LIST_HEAD(res); @@ -553,27 +555,27 @@ static int faraday_pci_probe(struct platform_device *pdev) unsigned long rate; u32 val; - faraday_pci_read_config(p->bus, 0, - FARADAY_PCI_STATUS_CMD, 4, &val); + faraday_raw_pci_read_config(p, 0, 0, + FARADAY_PCI_STATUS_CMD, 4, &val); rate = clk_get_rate(p->bus_clk); if ((rate == 33000000) && (val & PCI_STATUS_66MHZ_CAPABLE)) { dev_info(dev, "33MHz bus is 66MHz capable\n"); - p->bus->max_bus_speed = PCI_SPEED_66MHz; + max_bus_speed = PCI_SPEED_66MHz; ret = clk_set_rate(p->bus_clk, 66000000); if (ret) dev_err(dev, "failed to set bus clock\n"); } else { dev_info(dev, "33MHz only bus\n"); - p->bus->max_bus_speed = PCI_SPEED_33MHz; + max_bus_speed = PCI_SPEED_33MHz; } /* Bumping the clock may fail so read back the rate */ rate = clk_get_rate(p->bus_clk); if (rate == 33000000) - p->bus->cur_bus_speed = PCI_SPEED_33MHz; + cur_bus_speed = PCI_SPEED_33MHz; if (rate == 66000000) - p->bus->cur_bus_speed = PCI_SPEED_66MHz; + cur_bus_speed = PCI_SPEED_66MHz; } ret = faraday_pci_parse_map_dma_ranges(p, dev->of_node); @@ -587,6 +589,8 @@ static int faraday_pci_probe(struct platform_device *pdev) return ret; } p->bus = host->bus; + p->bus->max_bus_speed = max_bus_speed; + p->bus->cur_bus_speed = cur_bus_speed; pci_bus_assign_resources(p->bus); pci_bus_add_devices(p->bus);