All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/22] PCI: fix config and I/O Address space memory mappings
@ 2017-03-27  9:49 ` Lorenzo Pieralisi
  0 siblings, 0 replies; 115+ messages in thread
From: Lorenzo Pieralisi @ 2017-03-27  9:49 UTC (permalink / raw)
  To: linux-pci
  Cc: linux-kernel, linux-arm-kernel, Lorenzo Pieralisi,
	Pratyush Anand, Arnd Bergmann, Jonathan Corbet, Will Deacon,
	Thomas Gleixner, Jingoo Han, Bjorn Helgaas, Richard Henderson,
	Mingkai Hu, Tanmay Inamdar, Murali Karicheri, Russell King,
	Bharat Kumar Gogada, Ray Jui, Wenrui Li, Shawn Lin,
	Minghuan Lian, Tony Luck, Catalin Marinas, Jon Mason,
	Ingo Molnar, Gabriele Paoloni, Thomas Petazzoni, Joao Pinto,
	Thierry Reding, Luis R . Rodriguez, Michal Simek,
	Haavard Skinnemoen, Stanimir Varbanov, Zhou Wang, Roy Zang,
	John Garry

This patch series[1] is a v2 of a previous version:

v1 -> v2:
	- Changed pci_remap_cfgspace() to more generic ioremap_nopost()
	  interface
	- Added pgprot_nonposted
	- Fixed build errors on arches not relying on asm-generic headers
	- Added PCI versatile host controller driver patch
	- Added missing config space remapping to hisilicon host controller
	- Rebased against v4.11-rc4

v1: https://lkml.org/lkml/2017/2/27/228

PCI local bus specifications (Rev3.0, 3.2.5 "Transaction Ordering
and Posting") strictly require PCI configuration and I/O Address space
write transactions to be non-posted.

Current crop of DT/ACPI PCI host controllers drivers relies on
the ioremap interface to map ECAM and ECAM-derivative PCI config
regions and pci_remap_iospace() to create a VMA for mapping
PCI host bridge I/O Address space transactions to CPU virtual address
space.

On some platforms (ie ARM/ARM64) ioremap fails to comply with the PCI
configuration non-posted write transactions requirement, because it
provides a memory mapping that issues "bufferable" or, in PCI terms
"posted" write transactions. Likewise, the current pci_remap_iospace()
implementation maps the physical address range that the PCI translates
to I/O space cycles to virtual address space through pgprot_device()
attributes that on eg ARM64 provides a memory mapping issuing
posted writes transactions, which is not PCI specifications compliant.

This patch series[1] addresses both issues in one go:

- It updates the pci_remap_iospace() function to use a page mapping
  that guarantees non-posted write transactions for I/O space addresses
- It adds a kernel API to remap PCI config space resources, so that
  architecture can override it with a mapping implementation that
  guarantees PCI specifications compliancy wrt non-posted write
  configuration transactions
- It updates all PCI host controller implementations (and the generic
  ECAM layer) to use the newly introduced mapping interface

Tested on Juno ECAM based interface (DT/ACPI).

Non-ECAM PCI host controller drivers patches need checking to make
sure that:

- I patched the correct resource region mapping for config space
- There are not any other ways to ensure posted-write completion
  in the respective pci_ops that make the relevant patch unnecessary

[1] git://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/linux.git
pci/config-io-mappings-fix-v2

Cc: Pratyush Anand <pratyush.anand@gmail.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Will Deacon <will.deacon@arm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Jingoo Han <jingoohan1@gmail.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Mingkai Hu <mingkai.hu@freescale.com>
Cc: Tanmay Inamdar <tinamdar@apm.com>
Cc: Murali Karicheri <m-karicheri2@ti.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Bharat Kumar Gogada <bharat.kumar.gogada@xilinx.com>
Cc: Ray Jui <rjui@broadcom.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: Tony Luck <tony.luck@intel.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Jon Mason <jonmason@broadcom.com>
Cc: Ingo Molnar <mingo@redhat.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: Luis R. Rodriguez <mcgrof@kernel.org>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: Haavard Skinnemoen <hskinnemoen@gmail.com>
Cc: Stanimir Varbanov <svarbanov@mm-sol.com>
Cc: Zhou Wang <wangzhou1@hisilicon.com>
Cc: Roy Zang <tie-fei.zang@freescale.com>

Lorenzo Pieralisi (22):
  PCI: remove __weak tag from pci_remap_iospace()
  asm-generic/io.h: add ioremap_nopost remap interface
  asm-generic/pgtable.h: introduce pgprot_nonposted remap attribute
  PCI: fix pci_remap_iospace() remap attribute
  ARM64: implement ioremap_nopost() interface
  ARM: implement ioremap_nopost() interface
  PCI: ECAM: use ioremap_nopost() to map config region
  lib: implement Devres ioremap_nopost() interface
  PCI: xilinx: update PCI config space remap function
  PCI: xilinx-nwl: update PCI config space remap function
  PCI: spear13xx: update PCI config space remap function
  PCI: rockchip: update PCI config space remap function
  PCI: qcom: update PCI config space remap function
  PCI: iproc-platform: update PCI config space remap function
  PCI: hisi: update PCI config space remap function
  PCI: designware: update PCI config space remap function
  PCI: armada8k: update PCI config space remap function
  PCI: xgene: update PCI config space remap function
  PCI: tegra: update PCI config space remap function
  PCI: layerscape: update PCI config space remap function
  PCI: keystone-dw: update PCI config space remap function
  PCI: versatile: update PCI config space remap function

 Documentation/driver-model/devres.txt  |  3 ++
 arch/alpha/include/asm/io.h            |  1 +
 arch/arm/include/asm/io.h              | 10 +++++
 arch/arm/mm/ioremap.c                  |  7 +++
 arch/arm/mm/nommu.c                    |  9 ++++
 arch/arm64/include/asm/io.h            | 12 ++++++
 arch/avr32/include/asm/io.h            |  1 +
 arch/frv/include/asm/io.h              |  1 +
 arch/ia64/include/asm/io.h             |  1 +
 arch/x86/include/asm/io.h              |  1 +
 drivers/pci/dwc/pci-keystone-dw.c      |  2 +-
 drivers/pci/dwc/pci-layerscape.c       |  2 +-
 drivers/pci/dwc/pcie-armada8k.c        |  2 +-
 drivers/pci/dwc/pcie-designware-host.c | 12 +++---
 drivers/pci/dwc/pcie-hisi.c            |  7 ++-
 drivers/pci/dwc/pcie-qcom.c            |  2 +-
 drivers/pci/dwc/pcie-spear13xx.c       |  2 +-
 drivers/pci/ecam.c                     |  5 ++-
 drivers/pci/host/pci-tegra.c           |  4 +-
 drivers/pci/host/pci-versatile.c       |  3 +-
 drivers/pci/host/pci-xgene.c           |  4 +-
 drivers/pci/host/pcie-iproc-platform.c |  3 +-
 drivers/pci/host/pcie-rockchip.c       |  2 +-
 drivers/pci/host/pcie-xilinx-nwl.c     |  2 +-
 drivers/pci/host/pcie-xilinx.c         |  2 +-
 drivers/pci/pci.c                      |  4 +-
 include/asm-generic/io.h               |  4 ++
 include/asm-generic/pgtable.h          |  4 ++
 include/linux/device.h                 |  2 +
 include/linux/io.h                     |  2 +
 lib/devres.c                           | 78 ++++++++++++++++++++++++++++++++++
 31 files changed, 166 insertions(+), 28 deletions(-)

-- 
2.10.0

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

end of thread, other threads:[~2017-04-10 14:30 UTC | newest]

Thread overview: 115+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-27  9:49 [PATCH v2 00/22] PCI: fix config and I/O Address space memory mappings Lorenzo Pieralisi
2017-03-27  9:49 ` Lorenzo Pieralisi
2017-03-27  9:49 ` [PATCH v2 01/22] PCI: remove __weak tag from pci_remap_iospace() Lorenzo Pieralisi
2017-03-27  9:49   ` Lorenzo Pieralisi
2017-03-27  9:49   ` Lorenzo Pieralisi
2017-03-27  9:49 ` [PATCH v2 02/22] asm-generic/io.h: add ioremap_nopost remap interface Lorenzo Pieralisi
2017-03-27  9:49   ` Lorenzo Pieralisi
2017-03-28  1:41   ` Bjorn Helgaas
2017-03-28  1:41     ` Bjorn Helgaas
2017-03-28  1:41     ` Bjorn Helgaas
2017-03-28 14:45     ` Lorenzo Pieralisi
2017-03-28 14:45       ` Lorenzo Pieralisi
2017-03-30 16:47       ` Bjorn Helgaas
2017-03-30 16:47         ` Bjorn Helgaas
2017-03-30 16:47         ` Bjorn Helgaas
2017-04-05 10:58       ` Russell King - ARM Linux
2017-04-05 10:58         ` Russell King - ARM Linux
2017-04-05 12:38         ` Lorenzo Pieralisi
2017-04-05 12:38           ` Lorenzo Pieralisi
2017-04-06 10:26           ` Lorenzo Pieralisi
2017-04-06 10:26             ` Lorenzo Pieralisi
2017-04-06 10:47             ` Russell King - ARM Linux
2017-04-06 10:47               ` Russell King - ARM Linux
2017-04-10 14:30               ` Lorenzo Pieralisi
2017-04-10 14:30                 ` Lorenzo Pieralisi
2017-04-06 10:53             ` Luis R. Rodriguez
2017-04-06 10:53               ` Luis R. Rodriguez
2017-04-06 11:38               ` Lorenzo Pieralisi
2017-04-06 11:38                 ` Lorenzo Pieralisi
2017-04-06 11:59                 ` Luis R. Rodriguez
2017-04-06 11:59                   ` Luis R. Rodriguez
2017-04-06 13:07                   ` Russell King - ARM Linux
2017-04-06 13:07                     ` Russell King - ARM Linux
2017-04-06 16:21                     ` Lorenzo Pieralisi
2017-04-06 16:21                       ` Lorenzo Pieralisi
2017-04-06 16:40                       ` Russell King - ARM Linux
2017-04-06 16:40                         ` Russell King - ARM Linux
2017-04-06 17:09                         ` Lorenzo Pieralisi
2017-04-06 17:09                           ` Lorenzo Pieralisi
2017-04-06 17:19                           ` Russell King - ARM Linux
2017-04-06 17:19                             ` Russell King - ARM Linux
2017-04-06 12:11               ` Russell King - ARM Linux
2017-04-06 12:11                 ` Russell King - ARM Linux
2017-04-06 12:25                 ` Luis R. Rodriguez
2017-04-06 12:25                   ` Luis R. Rodriguez
2017-03-27  9:49 ` [PATCH v2 03/22] asm-generic/pgtable.h: introduce pgprot_nonposted remap attribute Lorenzo Pieralisi
2017-03-27  9:49   ` Lorenzo Pieralisi
2017-03-27  9:49 ` [PATCH v2 04/22] PCI: fix pci_remap_iospace() " Lorenzo Pieralisi
2017-03-27  9:49   ` Lorenzo Pieralisi
2017-03-27  9:49   ` Lorenzo Pieralisi
2017-03-27  9:49 ` [PATCH v2 05/22] ARM64: implement ioremap_nopost() interface Lorenzo Pieralisi
2017-03-27  9:49   ` Lorenzo Pieralisi
2017-03-27  9:49   ` Lorenzo Pieralisi
2017-03-30 16:19   ` Will Deacon
2017-03-30 16:19     ` Will Deacon
2017-03-30 16:19     ` Will Deacon
2017-03-27  9:49 ` [PATCH v2 06/22] ARM: " Lorenzo Pieralisi
2017-03-27  9:49   ` Lorenzo Pieralisi
2017-03-31 11:08   ` Lorenzo Pieralisi
2017-03-31 11:08     ` Lorenzo Pieralisi
2017-03-31 11:08     ` Lorenzo Pieralisi
2017-04-05 10:21     ` Lorenzo Pieralisi
2017-04-05 10:21       ` Lorenzo Pieralisi
2017-04-05 10:21       ` Lorenzo Pieralisi
2017-03-27  9:49 ` [PATCH v2 07/22] PCI: ECAM: use ioremap_nopost() to map config region Lorenzo Pieralisi
2017-03-27  9:49   ` Lorenzo Pieralisi
2017-03-30 16:20   ` Will Deacon
2017-03-30 16:20     ` Will Deacon
2017-03-30 16:20     ` Will Deacon
2017-03-27  9:49 ` [PATCH v2 08/22] lib: implement Devres ioremap_nopost() interface Lorenzo Pieralisi
2017-03-27  9:49   ` Lorenzo Pieralisi
2017-03-28  1:41   ` Bjorn Helgaas
2017-03-28  1:41     ` Bjorn Helgaas
2017-03-28  1:41     ` Bjorn Helgaas
2017-03-28 14:50     ` Lorenzo Pieralisi
2017-03-28 14:50       ` Lorenzo Pieralisi
2017-03-28 15:55       ` Tejun Heo
2017-03-28 15:55         ` Tejun Heo
2017-03-27  9:49 ` [PATCH v2 09/22] PCI: xilinx: update PCI config space remap function Lorenzo Pieralisi
2017-03-27  9:49   ` Lorenzo Pieralisi
2017-03-27  9:49 ` [PATCH v2 10/22] PCI: xilinx-nwl: " Lorenzo Pieralisi
2017-03-27  9:49   ` Lorenzo Pieralisi
2017-03-27  9:49   ` Lorenzo Pieralisi
2017-03-27  9:49 ` [PATCH v2 11/22] PCI: spear13xx: " Lorenzo Pieralisi
2017-03-27  9:49   ` Lorenzo Pieralisi
2017-03-27  9:49 ` [PATCH v2 12/22] PCI: rockchip: " Lorenzo Pieralisi
2017-03-27  9:49   ` Lorenzo Pieralisi
2017-03-27  9:49 ` [PATCH v2 13/22] PCI: qcom: " Lorenzo Pieralisi
2017-03-27  9:49   ` Lorenzo Pieralisi
2017-03-27  9:49 ` [PATCH v2 14/22] PCI: iproc-platform: " Lorenzo Pieralisi
2017-03-27  9:49   ` Lorenzo Pieralisi
2017-03-27  9:49   ` Lorenzo Pieralisi
2017-03-27  9:49 ` [PATCH v2 15/22] PCI: hisi: " Lorenzo Pieralisi
2017-03-27  9:49   ` Lorenzo Pieralisi
2017-03-27  9:49   ` Lorenzo Pieralisi
2017-03-27  9:49 ` [PATCH v2 16/22] PCI: designware: " Lorenzo Pieralisi
2017-03-27  9:49   ` Lorenzo Pieralisi
2017-03-27  9:49 ` [PATCH v2 17/22] PCI: armada8k: " Lorenzo Pieralisi
2017-03-27  9:49   ` Lorenzo Pieralisi
2017-03-27  9:49   ` Lorenzo Pieralisi
2017-03-27  9:49 ` [PATCH v2 18/22] PCI: xgene: " Lorenzo Pieralisi
2017-03-27  9:49   ` Lorenzo Pieralisi
2017-03-27  9:49   ` Lorenzo Pieralisi
2017-03-27  9:49 ` [PATCH v2 19/22] PCI: tegra: " Lorenzo Pieralisi
2017-03-27  9:49   ` Lorenzo Pieralisi
2017-03-27  9:49   ` Lorenzo Pieralisi
2017-03-27  9:49 ` [PATCH v2 20/22] PCI: layerscape: " Lorenzo Pieralisi
2017-03-27  9:49   ` Lorenzo Pieralisi
2017-03-27  9:49   ` Lorenzo Pieralisi
2017-03-27  9:49 ` [PATCH v2 21/22] PCI: keystone-dw: " Lorenzo Pieralisi
2017-03-27  9:49   ` Lorenzo Pieralisi
2017-03-27  9:49   ` Lorenzo Pieralisi
2017-03-27  9:49 ` [PATCH v2 22/22] PCI: versatile: " Lorenzo Pieralisi
2017-03-27  9:49   ` Lorenzo Pieralisi
2017-03-27  9:49   ` 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.