All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC/RFT PATCH 00/18] PCI: ARM/ARM64: remove pci_fixup_irqs() usage
@ 2017-04-26 11:17 ` Lorenzo Pieralisi
  0 siblings, 0 replies; 100+ messages in thread
From: Lorenzo Pieralisi @ 2017-04-26 11:17 UTC (permalink / raw)
  To: linux-pci
  Cc: Wenrui Li, Gabriele Paoloni, Shawn Lin, Will Deacon,
	Michal Simek, Thierry Reding, Tanmay Inamdar, Matthew Minter,
	Rob Herring, Lorenzo Pieralisi, Pratyush Anand, Russell King,
	Murali Karicheri, Arnd Bergmann, Bharat Kumar Gogada, Joao Pinto,
	Bjorn Helgaas, Mingkai Hu, linux-arm-kernel, Thomas Petazzoni,
	Jingoo Han, Stanimir Varbanov, Minghuan Lian, Zhou Wang,
	Simon Horman, Roy Zang

Current pci_fixup_irqs() usage on ARM/ARM64 host controller drivers is
flawed in that pci_fixup_irqs() allocates IRQs for all PCI devices present
in a system; those PCI devices possibly belong to different PCI bus trees
(and possibly rooted at different host bridges) and may well be enabled
(ie probed and bound to a driver) by the time pci_fixup_irqs() is called
when probing a given host bridge driver.

Furthermore, current kernel code relying on pci_fixup_irqs() to
assign legacy PCI IRQs to devices does not work at all for
hotplugged devices in that the code carrying out the IRQ fixup
is called at host bridge driver probe time, which just cannot take
into account devices hotplugged after system has booted.

By leveraging Matthew Minter's patch series (and its purpose):

http://lkml.kernel.org/r/1445576642-29624-2-git-send-email-matt@masarand.com

this series[1] adds IRQs mapping and swizzling primitives to
the struct pci_host_bridge which allows IRQs to be allocated for
for a device at probe time with host bridge specific functions,
fixing the aforementioned limitations.

Current series remove pci_fixup_irqs() usage on ARM/ARM64; removal
can be extended to other architectures provided the IRQs map/swizzle
functions are set-up properly in the respective host bridges
set-up/probe paths.

Tested on kvmtool with PCI host generic.

[1] git://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/linux.git pci/pci-fixup-irqs-removal

Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Pratyush Anand <pratyush.anand@gmail.com>
Cc: Jingoo Han <jingoohan1@gmail.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Rob Herring <robh@kernel.org>
Cc: Simon Horman <horms@verge.net.au>
Cc: Mingkai Hu <mingkai.hu@freescale.com>
Cc: Tanmay Inamdar <tinamdar@apm.com>
Cc: Murali Karicheri <m-karicheri2@ti.com>
Cc: Bharat Kumar Gogada <bharat.kumar.gogada@xilinx.com>
Cc: Wenrui Li <wenrui.li@rock-chips.com>
Cc: Shawn Lin <shawn.lin@rock-chips.com>
Cc: Minghuan Lian <minghuan.Lian@freescale.com>
Cc: Matthew Minter <matt@masarand.com>
Cc: Gabriele Paoloni <gabriele.paoloni@huawei.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Joao Pinto <Joao.Pinto@synopsys.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: Stanimir Varbanov <svarbanov@mm-sol.com>
Cc: Zhou Wang <wangzhou1@hisilicon.com>
Cc: Roy Zang <tie-fei.zang@freescale.com>

Lorenzo Pieralisi (13):
  PCI: Initialize bridge release function at bridge allocation
  PCI: Add pci_free_host_bridge interface
  PCI: Introduce pci_scan_root_bus_bridge()
  ARM: PCI: bios32: Convert PCI scan API to pci_scan_root_bus_bridge()
  ARM: PCI: dove: Convert PCI scan API to pci_scan_root_bus_bridge()
  ARM: PCI: iop13xx: Convert PCI scan API to pci_scan_root_bus_bridge()
  ARM: PCI: orion5x: Convert PCI scan API to pci_scan_root_bus_bridge()
  PCI: designware: Convert PCI scan API to pci_scan_root_bus_bridge()
  PCI: aardvark: Convert PCI scan API to pci_scan_root_bus_bridge()
  PCI: rcar: Convert PCI scan API to pci_scan_root_bus_bridge()
  PCI: Remove pci_scan_root_bus_msi()
  ARM: PCI: Remove pci_fixup_irqs() call for bios32 host controllers
  ARM/ARM64: PCI: Drop pci_fixup_irqs() usage for DT based host
    controllers

Matthew Minter (5):
  PCI: Build setup-irq.o on all arches
  PCI: Add IRQ mapping function pointers to pci_host_bridge struct
  PCI: Add pci_assign_irq() function and have pci_fixup_irqs() use it
  OF/PCI: Update of_irq_parse_and_map_pci() comment
  PCI: Add a call to pci_assign_irq() in pci_device_probe()

 arch/arm/kernel/bios32.c               | 63 ++++++++++++++++++++++-----
 arch/arm/mach-dove/pcie.c              | 36 ++++++++++++----
 arch/arm/mach-iop13xx/pci.c            | 36 +++++++++++++---
 arch/arm/mach-orion5x/pci.c            | 47 ++++++++++++++------
 arch/arm64/kernel/pci.c                | 32 +++++++++++---
 drivers/of/of_pci_irq.c                |  3 +-
 drivers/pci/Makefile                   | 17 +-------
 drivers/pci/dwc/pcie-designware-host.c | 41 +++++++++---------
 drivers/pci/host/pci-aardvark.c        | 33 +++++++++++---
 drivers/pci/host/pci-host-common.c     |  4 --
 drivers/pci/host/pci-tegra.c           |  3 +-
 drivers/pci/host/pci-versatile.c       |  1 -
 drivers/pci/host/pcie-altera.c         |  1 -
 drivers/pci/host/pcie-iproc.c          | 43 ++++++++++++-------
 drivers/pci/host/pcie-rcar.c           | 28 +++++++-----
 drivers/pci/host/pcie-xilinx.c         |  3 --
 drivers/pci/pci-driver.c               |  2 +
 drivers/pci/probe.c                    | 78 ++++++++++++++++++++++------------
 drivers/pci/setup-irq.c                | 45 +++++++++++++++-----
 include/linux/pci.h                    |  9 ++--
 20 files changed, 363 insertions(+), 162 deletions(-)

-- 
2.10.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 100+ messages in thread

end of thread, other threads:[~2017-06-02 14:44 UTC | newest]

Thread overview: 100+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-26 11:17 [RFC/RFT PATCH 00/18] PCI: ARM/ARM64: remove pci_fixup_irqs() usage Lorenzo Pieralisi
2017-04-26 11:17 ` Lorenzo Pieralisi
2017-04-26 11:17 ` [RFC/RFT PATCH 01/18] PCI: Initialize bridge release function at bridge allocation Lorenzo Pieralisi
2017-04-26 11:17   ` Lorenzo Pieralisi
2017-04-28 12:13   ` Arnd Bergmann
2017-04-28 12:13     ` Arnd Bergmann
2017-04-26 11:17 ` [RFC/RFT PATCH 02/18] PCI: Add pci_free_host_bridge interface Lorenzo Pieralisi
2017-04-26 11:17   ` Lorenzo Pieralisi
2017-04-28 12:14   ` Arnd Bergmann
2017-04-28 12:14     ` Arnd Bergmann
2017-04-26 11:17 ` [RFC/RFT PATCH 03/18] PCI: Introduce pci_scan_root_bus_bridge() Lorenzo Pieralisi
2017-04-26 11:17   ` Lorenzo Pieralisi
2017-04-28 12:28   ` Arnd Bergmann
2017-04-28 12:28     ` Arnd Bergmann
2017-05-02 17:15     ` Lorenzo Pieralisi
2017-05-02 17:15       ` Lorenzo Pieralisi
2017-05-02 19:36       ` Arnd Bergmann
2017-05-02 19:36         ` Arnd Bergmann
2017-05-25 20:56       ` Bjorn Helgaas
2017-05-25 20:56         ` Bjorn Helgaas
2017-05-26 13:07         ` Lorenzo Pieralisi
2017-05-26 13:07           ` Lorenzo Pieralisi
2017-05-26 17:29           ` Ray Jui
2017-05-26 17:29             ` Ray Jui
2017-05-31 10:20             ` Lorenzo Pieralisi
2017-05-31 10:20               ` Lorenzo Pieralisi
2017-05-30 11:16           ` Oza Oza
2017-05-30 11:16             ` Oza Oza
2017-05-31 11:13         ` Lorenzo Pieralisi
2017-05-31 11:13           ` Lorenzo Pieralisi
2017-04-26 11:17 ` [RFC/RFT PATCH 04/18] ARM: PCI: bios32: Convert PCI scan API to pci_scan_root_bus_bridge() Lorenzo Pieralisi
2017-04-26 11:17   ` Lorenzo Pieralisi
2017-04-28 12:41   ` Arnd Bergmann
2017-04-28 12:41     ` Arnd Bergmann
2017-04-26 11:17 ` [RFC/RFT PATCH 05/18] ARM: PCI: dove: " Lorenzo Pieralisi
2017-04-26 11:17   ` Lorenzo Pieralisi
2017-04-28 12:38   ` Arnd Bergmann
2017-04-28 12:38     ` Arnd Bergmann
2017-04-28 12:52     ` Arnd Bergmann
2017-04-28 12:52       ` Arnd Bergmann
2017-05-03 10:31     ` Lorenzo Pieralisi
2017-05-03 10:31       ` Lorenzo Pieralisi
2017-05-03 12:02       ` Arnd Bergmann
2017-05-03 12:02         ` Arnd Bergmann
2017-04-26 11:17 ` [RFC/RFT PATCH 06/18] ARM: PCI: iop13xx: " Lorenzo Pieralisi
2017-04-26 11:17   ` Lorenzo Pieralisi
2017-04-26 11:17 ` [RFC/RFT PATCH 07/18] ARM: PCI: orion5x: " Lorenzo Pieralisi
2017-04-26 11:17   ` Lorenzo Pieralisi
2017-04-26 15:12   ` Andrew Lunn
2017-04-26 15:12     ` Andrew Lunn
2017-04-26 16:13     ` Lorenzo Pieralisi
2017-04-26 16:13       ` Lorenzo Pieralisi
2017-04-26 18:53       ` Andrew Lunn
2017-04-26 18:53         ` Andrew Lunn
2017-04-27 10:40         ` Lorenzo Pieralisi
2017-04-27 10:40           ` Lorenzo Pieralisi
2017-04-26 11:17 ` [RFC/RFT PATCH 08/18] PCI: designware: " Lorenzo Pieralisi
2017-04-26 11:17   ` Lorenzo Pieralisi
2017-04-28 13:13   ` Arnd Bergmann
2017-04-28 13:13     ` Arnd Bergmann
2017-05-03 10:16     ` Lorenzo Pieralisi
2017-05-03 10:16       ` Lorenzo Pieralisi
2017-06-02 11:49     ` Lorenzo Pieralisi
2017-06-02 11:49       ` Lorenzo Pieralisi
2017-06-02 13:12       ` Arnd Bergmann
2017-06-02 13:12         ` Arnd Bergmann
2017-06-02 13:56         ` Lorenzo Pieralisi
2017-06-02 13:56           ` Lorenzo Pieralisi
2017-06-02 14:44           ` Arnd Bergmann
2017-06-02 14:44             ` Arnd Bergmann
2017-04-26 11:18 ` [RFC/RFT PATCH 09/18] PCI: aardvark: " Lorenzo Pieralisi
2017-04-26 11:18   ` Lorenzo Pieralisi
2017-04-26 11:18 ` [RFC/RFT PATCH 10/18] PCI: rcar: " Lorenzo Pieralisi
2017-04-26 11:18   ` Lorenzo Pieralisi
2017-04-28 12:53   ` Arnd Bergmann
2017-04-28 12:53     ` Arnd Bergmann
2017-04-26 11:18 ` [RFC/RFT PATCH 11/18] PCI: Remove pci_scan_root_bus_msi() Lorenzo Pieralisi
2017-04-26 11:18   ` Lorenzo Pieralisi
2017-04-26 11:18 ` [RFC/RFT PATCH 12/18] PCI: Build setup-irq.o on all arches Lorenzo Pieralisi
2017-04-26 11:18   ` Lorenzo Pieralisi
2017-04-26 11:18 ` [RFC/RFT PATCH 13/18] PCI: Add IRQ mapping function pointers to pci_host_bridge struct Lorenzo Pieralisi
2017-04-26 11:18   ` Lorenzo Pieralisi
2017-04-26 11:18 ` [RFC/RFT PATCH 14/18] PCI: Add pci_assign_irq() function and have pci_fixup_irqs() use it Lorenzo Pieralisi
2017-04-26 11:18   ` Lorenzo Pieralisi
2017-04-26 11:18 ` [RFC/RFT PATCH 15/18] OF/PCI: Update of_irq_parse_and_map_pci() comment Lorenzo Pieralisi
2017-04-26 11:18   ` Lorenzo Pieralisi
2017-04-26 11:18 ` [RFC/RFT PATCH 16/18] PCI: Add a call to pci_assign_irq() in pci_device_probe() Lorenzo Pieralisi
2017-04-26 11:18   ` Lorenzo Pieralisi
2017-04-26 11:18 ` [RFC/RFT PATCH 17/18] ARM: PCI: Remove pci_fixup_irqs() call for bios32 host controllers Lorenzo Pieralisi
2017-04-26 11:18   ` Lorenzo Pieralisi
2017-04-26 11:18 ` [RFC/RFT PATCH 18/18] ARM/ARM64: PCI: Drop pci_fixup_irqs() usage for DT based " Lorenzo Pieralisi
2017-04-26 11:18   ` Lorenzo Pieralisi
2017-04-28 13:05   ` Arnd Bergmann
2017-04-28 13:05     ` Arnd Bergmann
2017-05-03 10:51     ` Lorenzo Pieralisi
2017-05-03 10:51       ` Lorenzo Pieralisi
2017-04-27 20:06 ` [RFC/RFT PATCH 00/18] PCI: ARM/ARM64: remove pci_fixup_irqs() usage Thierry Reding
2017-04-27 20:06   ` Thierry Reding
2017-05-03 10:34   ` Lorenzo Pieralisi
2017-05-03 10:34     ` Lorenzo Pieralisi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.