On Tue, Jan 24, 2017 at 03:05:22PM +0800, zhichang.yuan wrote:
After indirect-IO is introduced, system must can assigned indirect-IO devices
with logical I/O ranges which are different from those for PCI I/O devices.
Otherwise, I/O accessors can't identify whether the I/O port is for memory
mapped I/O or indirect-IO.
As current helper, pci_register_io_range(), is used for PCI I/O ranges
registration and translation, indirect-IO devices should also apply these
helpers to manage the I/O ranges. It will be easy to ensure the assigned
logical I/O ranges unique.
But for indirect-IO devices, there is no cpu address. The current
pci_register_io_range() can not work for this case.
This patch makes some changes on the pci_register_io_range() to support the
I/O range registration with device's fwnode also. After this, the indirect-IO
devices can register the device-local I/O range to system logical I/O and
easily perform the translation between device-local I/O range and sytem
logical I/O range.
Signed-off-by: zhichang.yuan <yuanzhichang@xxxxxxxxxxxxx>
Signed-off-by: Gabriele Paoloni <gabriele.paoloni@xxxxxxxxxx>
Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
I had a couple trivial comments, but you can include my:
Acked-by: Bjorn Helgaas <bhelgaas@xxxxxxxxxx> # drivers/pci parts
in your next revision. I don't know who you have in mind to merge this;
it doesn't really touch much of PCI. But let me know if you need anything
else from me.
---
drivers/acpi/pci_root.c | 12 +++++-------
drivers/of/address.c | 8 ++------
drivers/pci/pci.c | 44 ++++++++++++++++++++++++++++++++++++++++----
include/linux/pci.h | 7 +++++--
4 files changed, 52 insertions(+), 19 deletions(-)