Skip to content

PCI: ARM/ARM64: remove pci_fixup_irqs() usage

Lorenzo Pieralisi linux-arm-kernel linux-pci 7 versions – New

Get series with b4
b4 am 20170621154136.GA1362@red-moon

Versions newest first · linked by author and title

  1. v2 Latest posting 6/60 of 42 patches 0 repliesNew
  2. v2 posting 5/60 of 42 patches 0 repliesSuperseded
  3. v2 posting 4/60 of 42 patches 0 repliesSuperseded
Earlier versions · 4
VersionPostedPatchesRepliesStatus
v2 posting 3/60 of 42 patches0 repliesSuperseded
v2 posting 2/60 of 42 patches0 repliesSuperseded
v2 posting 1/642 patches0 repliesSuperseded
v10 of 18 patches0 repliesSuperseded

Patches in v2 posting 6/6 No applies recorded yet

None of the 42 patches the cover letter announces are in this archive.

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [RFT PATCH v2 00/42] PCI: ARM/ARM64: remove pci_fixup_irqs() usage

Hi Linus,

Quoted 16 lines · Linus Walleij
Quoted 6 lines · Lorenzo Pieralisi

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:

drivers/pci/host/pci-ftpci100.c +0 -0
index 86f8a3d1c1da..5162dffc102b 100644

drivers/pci/host/pci-ftpci100.c static int faraday_pci_probe(struct platform_device *pdev) · line 454

Quoted 5 lines
drivers/pci/host/pci-ftpci100.c +2 -0
@@ -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

Quoted 52 lines
drivers/pci/host/pci-ftpci100.c +8 -6
     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