From: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Gabriele Paoloni <gabriele.paoloni@huawei.com>,
linux-pci <linux-pci@vger.kernel.org>,
Shawn Lin <shawn.lin@rock-chips.com>,
Will Deacon <will.deacon@arm.com>,
Michal Simek <michal.simek@xilinx.com>,
Thierry Reding <thierry.reding@gmail.com>,
Tanmay Inamdar <tinamdar@apm.com>,
Matthew Minter <matt@masarand.com>, Rob Herring <robh@kernel.org>,
Joao Pinto <Joao.Pinto@synopsys.com>,
Pratyush Anand <pratyush.anand@gmail.com>,
Russell King <linux@armlinux.org.uk>,
Murali Karicheri <m-karicheri2@ti.com>,
Arnd Bergmann <arnd@arndb.de>,
Bharat Kumar Gogada <bharat.kumar.gogada@xilinx.com>,
Simon Horman <horms@verge.net.au>,
Bjorn Helgaas <bhelgaas@google.com>,
Mingkai Hu <mingkai.hu@freescale.com>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
Jingoo Han <jingoohan1@gmail.com>,
Stanimir Varbanov <svarbanov@mm-sol.com>,
Minghuan Lian <minghuan.Lian@freescale.com>,
Zhou Wang <wangzhou1@hisilicon.com>,
Roy Zang <tie-fei.zang@freescale.com>
Subject: Re: [RFT PATCH v2 00/42] PCI: ARM/ARM64: remove pci_fixup_irqs() usage
Date: Wed, 21 Jun 2017 16:41:36 +0100 [thread overview]
Message-ID: <20170621154136.GA1362@red-moon> (raw)
In-Reply-To: <CACRpkda_6=qWRQDpTy67MFc=-fYRhqWDPx0NnNG5mjXQLyAAkw@mail.gmail.com>
Hi Linus,
On Wed, Jun 21, 2017 at 05:14:13PM +0200, Linus Walleij wrote:
> On Wed, Jun 21, 2017 at 12:45 PM, Lorenzo Pieralisi
> <lorenzo.pieralisi@arm.com> 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:
> 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;
I could not fix it myself since we do not have the same code base,
I can't find any clock handling in the mainline as per v4.12-rc6.
Is the ftpci100.c clock handling being queued for this merge window ?
This patch:
https://patchwork.ozlabs.org/patch/778716/
fixes a commit that is not in v4.12-rc6, I need some input to understand
how to proceed.
Thanks,
Lorenzo
> 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);
>
>
> I'll send a modified and tested version of your patch.
>
> Yours,
> Linus Walleij
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2017-06-21 15:41 UTC|newest]
Thread overview: 66+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-08 14:13 [RFT PATCH v2 00/42] PCI: ARM/ARM64: remove pci_fixup_irqs() usage Lorenzo Pieralisi
2017-06-08 14:13 ` [RFT PATCH v2 01/42] PCI: xilinx-nwl: Remove nwl_pcie_enable_msi() unused bus parameter Lorenzo Pieralisi
2017-06-08 14:13 ` [RFT PATCH v2 02/42] drivers: pci: host: iproc: Convert link check to raw PCI config accessors Lorenzo Pieralisi
[not found] ` <0eb77019-9945-592c-375d-e2de742b3237@broadcom.com>
2017-06-08 16:36 ` Lorenzo Pieralisi
2017-06-11 4:12 ` Oza Oza
2017-06-12 16:13 ` Lorenzo Pieralisi
[not found] ` <CAMSpPPc0uwV0JZYkegrCaemuoJ-wfWwkSXd7TMtFwENoLRXdBQ@mail.gmail.com>
[not found] ` <403daa9b-c0f6-971d-9312-ef103460d738@broadcom.com>
[not found] ` <CAMSpPPdDLjRURZowWAzSvagmmhmojwYFYoHVu3xYcH6i-guviQ@mail.gmail.com>
[not found] ` <3d90daa1-7090-337a-b5c1-967b7eaeb2d9@broadcom.com>
2017-06-14 13:39 ` Lorenzo Pieralisi
2017-06-21 14:39 ` Oza Oza
[not found] ` <CAMSpPPdzmQBOvhz2Cx+TnnNoX-N-0cr92O07GTzWwp1TKidPcw@mail.gmail.com>
2017-07-19 17:48 ` Lorenzo Pieralisi
2017-06-08 14:13 ` [RFT PATCH v2 03/42] drivers: pci: host: ftpci100: convert IRQ masking " Lorenzo Pieralisi
2017-06-16 9:05 ` Linus Walleij
2017-06-08 14:13 ` [RFT PATCH v2 04/42] PCI: Initialize bridge release function at bridge allocation Lorenzo Pieralisi
2017-06-08 14:13 ` [RFT PATCH v2 05/42] PCI: Add pci_free_host_bridge interface Lorenzo Pieralisi
2017-06-08 14:13 ` [RFT PATCH v2 06/42] PCI: Add devm_pci_alloc_host_bridge() interface Lorenzo Pieralisi
2017-06-08 14:13 ` [RFT PATCH v2 07/42] drivers: pci: host: ftpci100: Fix host bridge memory leakage Lorenzo Pieralisi
2017-06-16 9:02 ` Linus Walleij
2017-06-08 14:13 ` [RFT PATCH v2 08/42] drivers: pci: host: tegra: " Lorenzo Pieralisi
2017-06-08 14:13 ` [RFT PATCH v2 09/42] PCI: Introduce pci_scan_root_bus_bridge() Lorenzo Pieralisi
2017-06-08 14:13 ` [RFT PATCH v2 10/42] PCI: Make pci_register_host_bridge() PCI core internal Lorenzo Pieralisi
2017-06-08 14:13 ` [RFT PATCH v2 11/42] ARM: PCI: bios32: Convert PCI scan API to pci_scan_root_bus_bridge() Lorenzo Pieralisi
2017-06-08 14:13 ` [RFT PATCH v2 12/42] PCI: designware: " Lorenzo Pieralisi
2017-06-08 14:13 ` [RFT PATCH v2 13/42] PCI: aardvark: " Lorenzo Pieralisi
2017-06-08 14:13 ` [RFT PATCH v2 14/42] PCI: rcar: " Lorenzo Pieralisi
2017-06-08 14:13 ` [RFT PATCH v2 15/42] PCI: iproc: " Lorenzo Pieralisi
2017-06-08 14:13 ` [RFT PATCH v2 16/42] PCI: versatile: " Lorenzo Pieralisi
2017-06-08 14:13 ` [RFT PATCH v2 17/42] PCI: altera: " Lorenzo Pieralisi
2017-06-08 14:13 ` [RFT PATCH v2 18/42] PCI: xilinx: " Lorenzo Pieralisi
2017-06-08 14:13 ` [RFT PATCH v2 19/42] PCI: xgene: " Lorenzo Pieralisi
2017-06-08 14:13 ` [RFT PATCH v2 20/42] PCI: host-common: " Lorenzo Pieralisi
2017-06-08 14:13 ` [RFT PATCH v2 21/42] PCI: rockchip: " Lorenzo Pieralisi
2017-06-08 14:13 ` [RFT PATCH v2 22/42] PCI: xilinx-nwl: " Lorenzo Pieralisi
2017-06-08 14:13 ` [RFT PATCH v2 23/42] PCI: Remove pci_scan_root_bus_msi() Lorenzo Pieralisi
2017-06-08 14:13 ` [RFT PATCH v2 24/42] PCI: Build setup-irq.o on all arches Lorenzo Pieralisi
2017-06-08 14:13 ` [RFT PATCH v2 25/42] PCI: Add IRQ mapping function pointers to pci_host_bridge struct Lorenzo Pieralisi
2017-06-08 14:13 ` [RFT PATCH v2 26/42] PCI: Add pci_assign_irq() function and have pci_fixup_irqs() use it Lorenzo Pieralisi
2017-06-08 14:13 ` [RFT PATCH v2 27/42] OF/PCI: Update of_irq_parse_and_map_pci() comment Lorenzo Pieralisi
2017-06-08 14:13 ` [RFT PATCH v2 28/42] PCI: Add a call to pci_assign_irq() in pci_device_probe() Lorenzo Pieralisi
2017-06-08 14:13 ` [RFT PATCH v2 29/42] ARM: PCI: Remove pci_fixup_irqs() call for bios32 host controllers Lorenzo Pieralisi
2017-07-01 14:06 ` Lorenzo Pieralisi
2017-07-02 21:19 ` Bjorn Helgaas
2017-07-03 10:26 ` Lorenzo Pieralisi
2017-06-08 14:13 ` [RFT PATCH v2 30/42] PCI: tegra: Drop pci_fixup_irqs() Lorenzo Pieralisi
2017-06-08 14:13 ` [RFT PATCH v2 31/42] PCI: xilinx: " Lorenzo Pieralisi
2017-06-08 14:13 ` [RFT PATCH v2 32/42] PCI: rcar: " Lorenzo Pieralisi
2017-06-08 14:13 ` [RFT PATCH v2 33/42] PCI: iproc: " Lorenzo Pieralisi
2017-06-08 14:13 ` [RFT PATCH v2 34/42] PCI: designware-host: " Lorenzo Pieralisi
2017-06-08 14:13 ` [RFT PATCH v2 35/42] PCI: ftpci100: " Lorenzo Pieralisi
2017-06-08 14:13 ` [RFT PATCH v2 36/42] PCI: host-common: " Lorenzo Pieralisi
2017-06-08 14:13 ` [RFT PATCH v2 37/42] PCI: versatile: " Lorenzo Pieralisi
2017-06-08 14:13 ` [RFT PATCH v2 38/42] PCI: altera: " Lorenzo Pieralisi
2017-06-08 14:13 ` [RFT PATCH v2 39/42] PCI: xgene: Move to struct pci_host_bridge IRQ mapping functions Lorenzo Pieralisi
2017-06-08 14:13 ` [RFT PATCH v2 40/42] PCI: rockchip: " Lorenzo Pieralisi
2017-06-08 14:13 ` [RFT PATCH v2 41/42] PCI: xilinx-nwl: " Lorenzo Pieralisi
2017-06-08 14:13 ` [RFT PATCH v2 42/42] ARM64: PCI: Drop DT IRQ allocation from pcibios_alloc_irq() Lorenzo Pieralisi
2017-06-12 15:45 ` [RFT PATCH v2 00/42] PCI: ARM/ARM64: remove pci_fixup_irqs() usage Will Deacon
2017-06-12 16:20 ` Lorenzo Pieralisi
2017-06-19 23:12 ` Bjorn Helgaas
2017-06-20 14:44 ` Lorenzo Pieralisi
2017-06-21 8:39 ` Linus Walleij
2017-06-21 9:50 ` Lorenzo Pieralisi
2017-06-21 10:30 ` Lorenzo Pieralisi
2017-06-21 10:45 ` Lorenzo Pieralisi
2017-06-21 14:51 ` Linus Walleij
2017-06-21 15:14 ` Linus Walleij
2017-06-21 15:41 ` Lorenzo Pieralisi [this message]
2017-06-21 16:28 ` Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170621154136.GA1362@red-moon \
--to=lorenzo.pieralisi@arm.com \
--cc=Joao.Pinto@synopsys.com \
--cc=arnd@arndb.de \
--cc=bharat.kumar.gogada@xilinx.com \
--cc=bhelgaas@google.com \
--cc=gabriele.paoloni@huawei.com \
--cc=horms@verge.net.au \
--cc=jingoohan1@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=m-karicheri2@ti.com \
--cc=matt@masarand.com \
--cc=michal.simek@xilinx.com \
--cc=minghuan.Lian@freescale.com \
--cc=mingkai.hu@freescale.com \
--cc=pratyush.anand@gmail.com \
--cc=robh@kernel.org \
--cc=shawn.lin@rock-chips.com \
--cc=svarbanov@mm-sol.com \
--cc=thierry.reding@gmail.com \
--cc=thomas.petazzoni@free-electrons.com \
--cc=tie-fei.zang@freescale.com \
--cc=tinamdar@apm.com \
--cc=wangzhou1@hisilicon.com \
--cc=will.deacon@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).