mbox series

[RFC,0/2] PCI: Introduce pci_ops::use_arch_sysdata

Message ID 20210319161956.2838291-1-boqun.feng@gmail.com
Headers show
Series PCI: Introduce pci_ops::use_arch_sysdata | expand

Message

Boqun Feng March 19, 2021, 4:19 p.m. UTC
Hi Bjorn,

I'm currently working on virtual PCI support for Hyper-V ARM64 guests.
Similar to virtual PCI on x86 Hyper-V guests, the PCI root bus is not
probed via ACPI (or of), it's probed from Hyper-V VMbus, therefore it
doesn't have config window.

Since ARM64 is a CONFIG_PCI_DOMAINS_GENERIC=y, PCI core code always
treats as the root bus has a config window. So we need to resolve this
and want to reuse the code as much as possible. My current solution is
introducing a pci_ops::use_arch_sysdata, and if it's true, the PCI core
code treats the pci_bus::sysdata as an arch-specific sysdata (rather
than pci_config_window) for CONFIG_PCI_DOMAINS_GENERIC=y architectures.
This allows us to reuse the existing code for Hyper-V PCI controller.

This is simply a proposal, I'm open to any suggestion.

Thanks!

Regards,
Boqun


Boqun Feng (2):
  arm64: PCI: Allow use arch-specific pci sysdata
  PCI: hv: Tell PCI core arch-specific sysdata is used

 arch/arm64/include/asm/pci.h        | 29 +++++++++++++++++++++++++++++
 arch/arm64/kernel/pci.c             | 15 ++++++++++++---
 drivers/pci/controller/pci-hyperv.c |  3 +++
 include/linux/pci.h                 |  3 +++
 4 files changed, 47 insertions(+), 3 deletions(-)

Comments

Bjorn Helgaas March 19, 2021, 7:04 p.m. UTC | #1
On Sat, Mar 20, 2021 at 12:19:54AM +0800, Boqun Feng wrote:
> Hi Bjorn,
> 
> I'm currently working on virtual PCI support for Hyper-V ARM64 guests.
> Similar to virtual PCI on x86 Hyper-V guests, the PCI root bus is not
> probed via ACPI (or of), it's probed from Hyper-V VMbus, therefore it

Prime example of why "OF" should be capitalized to prevent the
confusion of reading it as an English word, where it looks like a typo
and makes no sense.  Capitalizing it gives me and other uninitiates a
hint that it's an initialism.  Also applies to your commit logs and
code comments.

> doesn't have config window.