diff options
| author | Krzysztof Wilczyński <kwilczynski@kernel.org> | 2026-05-08 04:35:40 +0000 |
|---|---|---|
| committer | Bjorn Helgaas <bhelgaas@google.com> | 2026-06-23 15:19:09 -0500 |
| commit | 574b5470f8d43c85bf3dcb8c48efc2788a2bfb0c (patch) | |
| tree | cbf01053f58b8ab025be5a226f7b14e1d11e1c94 /arch/alpha | |
| parent | 385ec1d40756e3bcb868814e305089b4edd32149 (diff) | |
| download | linux-next-574b5470f8d43c85bf3dcb8c48efc2788a2bfb0c.tar.gz linux-next-574b5470f8d43c85bf3dcb8c48efc2788a2bfb0c.zip | |
PCI/sysfs: Add __weak pci_legacy_has_sparse() helper
Currently, Alpha's sparse/dense legacy attribute handling is done via
pci_adjust_legacy_attr(), which updates dynamically allocated attributes at
runtime. The upcoming conversion to static attributes needs a way to
determine sparse support at visibility check time.
Add a __weak pci_legacy_has_sparse() that returns false by default. Alpha
overrides it to check has_sparse() on the bus host controller.
Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Tested-by: Shivaprasad G Bhat <sbhat@linux.ibm.com>
Link: https://patch.msgid.link/20260508043543.217179-22-kwilczynski@kernel.org
Diffstat (limited to 'arch/alpha')
| -rw-r--r-- | arch/alpha/include/asm/pci.h | 2 | ||||
| -rw-r--r-- | arch/alpha/kernel/pci-sysfs.c | 7 |
2 files changed, 9 insertions, 0 deletions
diff --git a/arch/alpha/include/asm/pci.h b/arch/alpha/include/asm/pci.h index ef19295f2e33..95de7ffd59e8 100644 --- a/arch/alpha/include/asm/pci.h +++ b/arch/alpha/include/asm/pci.h @@ -86,6 +86,8 @@ extern int pci_mmap_legacy_page_range(struct pci_bus *bus, enum pci_mmap_state mmap_state); extern void pci_adjust_legacy_attr(struct pci_bus *bus, enum pci_mmap_state mmap_type); +extern bool pci_legacy_has_sparse(struct pci_bus *bus, + enum pci_mmap_state type); #define HAVE_PCI_LEGACY 1 extern const struct attribute_group pci_dev_resource_attr_group; diff --git a/arch/alpha/kernel/pci-sysfs.c b/arch/alpha/kernel/pci-sysfs.c index 2038acbcfd2a..20736a0c1a39 100644 --- a/arch/alpha/kernel/pci-sysfs.c +++ b/arch/alpha/kernel/pci-sysfs.c @@ -184,6 +184,13 @@ int pci_mmap_legacy_page_range(struct pci_bus *bus, struct vm_area_struct *vma, return hose_mmap_page_range(hose, vma, mmap_type, sparse); } +bool pci_legacy_has_sparse(struct pci_bus *bus, enum pci_mmap_state type) +{ + struct pci_controller *hose = bus->sysdata; + + return has_sparse(hose, type); +} + /** * pci_adjust_legacy_attr - adjustment of legacy file attributes * @bus: bus to create files under |
