arch/s390/pci/pci.c
Source file repositories/reference/linux-study-clean/arch/s390/pci/pci.c
File Facts
- System
- Linux kernel
- Corpus path
arch/s390/pci/pci.c- Extension
.c- Size
- 30048 bytes
- Lines
- 1233
- Domain
- Architecture Layer
- Bucket
- arch/s390
- Inferred role
- Architecture Layer: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/slab.hlinux/err.hlinux/export.hlinux/delay.hlinux/seq_file.hlinux/jump_label.hlinux/pci.hlinux/printk.hlinux/lockdep.hlinux/list_sort.hasm/machine.hasm/isc.hasm/airq.hasm/facility.hasm/pci_insn.hasm/pci_clp.hasm/pci_dma.hpci_bus.hpci_iov.h
Detected Declarations
function zpci_zdev_putfunction zpci_remove_reserved_devicesfunction pci_domain_nrfunction pci_proc_domainfunction zpci_register_ioatfunction zpci_unregister_ioatfunction zpci_fmb_enable_devicefunction zpci_fmb_disable_devicefunction zpci_cfg_loadfunction zpci_cfg_storefunction pcibios_align_resourcefunction iounmapfunction pci_iounmap_fhfunction pci_iounmap_miofunction pci_iounmapfunction pci_readfunction pci_writefunction zpci_map_resourcesfunction zpci_unmap_resourcesfunction zpci_alloc_iomapfunction zpci_free_iomapfunction zpci_do_update_iomap_fhfunction zpci_update_fhfunction zpci_setup_bus_resourcesfunction zpci_cleanup_bus_resourcesfunction pcibios_device_addfunction pcibios_release_devicefunction pcibios_enable_devicefunction pcibios_disable_devicefunction __zpci_register_domainfunction __zpci_alloc_domainfunction zpci_alloc_domainfunction zpci_free_domainfunction zpci_enable_devicefunction zpci_reenable_devicefunction zpci_disable_devicefunction pci_reset_functionfunction zpci_create_devicefunction zpci_add_devicefunction zpci_is_device_configuredfunction zpci_scan_configured_devicefunction zpci_deconfigure_devicefunction zpci_device_reservedfunction zpci_release_devicefunction zpci_report_errorfunction zpci_clear_error_statefunction zpci_reset_load_store_blockedfunction zpci_mem_init
Annotated Snippet
if (tmp->fid == fid) {
zdev = tmp;
zpci_zdev_get(zdev);
break;
}
}
spin_unlock(&zpci_list_lock);
return zdev;
}
void zpci_remove_reserved_devices(void)
{
struct zpci_dev *tmp, *zdev;
enum zpci_state state;
LIST_HEAD(remove);
spin_lock(&zpci_list_lock);
list_for_each_entry_safe(zdev, tmp, &zpci_list, entry) {
if (zdev->state == ZPCI_FN_STATE_STANDBY &&
!clp_get_state(zdev->fid, &state) &&
state == ZPCI_FN_STATE_RESERVED)
list_move_tail(&zdev->entry, &remove);
}
spin_unlock(&zpci_list_lock);
list_for_each_entry_safe(zdev, tmp, &remove, entry)
zpci_device_reserved(zdev);
}
int pci_domain_nr(struct pci_bus *bus)
{
return ((struct zpci_bus *) bus->sysdata)->domain_nr;
}
EXPORT_SYMBOL_GPL(pci_domain_nr);
int pci_proc_domain(struct pci_bus *bus)
{
return pci_domain_nr(bus);
}
EXPORT_SYMBOL_GPL(pci_proc_domain);
/* Modify PCI: Register I/O address translation parameters */
int zpci_register_ioat(struct zpci_dev *zdev, u8 dmaas,
u64 base, u64 limit, u64 iota, u8 *status)
{
u64 req = ZPCI_CREATE_REQ(zdev->fh, dmaas, ZPCI_MOD_FC_REG_IOAT);
struct zpci_fib fib = {0};
u8 cc;
fib.pba = base;
/* Work around off by one in ISM virt device */
if (zdev->pft == PCI_FUNC_TYPE_ISM && limit > base)
fib.pal = limit + (1 << 12);
else
fib.pal = limit;
fib.iota = iota;
fib.gd = zdev->gisa;
cc = zpci_mod_fc(req, &fib, status);
if (cc)
zpci_dbg(3, "reg ioat fid:%x, cc:%d, status:%d\n", zdev->fid, cc, *status);
return cc;
}
EXPORT_SYMBOL_GPL(zpci_register_ioat);
/* Modify PCI: Unregister I/O address translation parameters */
int zpci_unregister_ioat(struct zpci_dev *zdev, u8 dmaas)
{
u64 req = ZPCI_CREATE_REQ(zdev->fh, dmaas, ZPCI_MOD_FC_DEREG_IOAT);
struct zpci_fib fib = {0};
u8 cc, status;
fib.gd = zdev->gisa;
cc = zpci_mod_fc(req, &fib, &status);
if (cc)
zpci_dbg(3, "unreg ioat fid:%x, cc:%d, status:%d\n", zdev->fid, cc, status);
return cc;
}
/* Modify PCI: Set PCI function measurement parameters */
int zpci_fmb_enable_device(struct zpci_dev *zdev)
{
u64 req = ZPCI_CREATE_REQ(zdev->fh, 0, ZPCI_MOD_FC_SET_MEASURE);
struct zpci_iommu_ctrs *ctrs;
struct zpci_fib fib = {0};
unsigned long flags;
u8 cc, status;
if (zdev->fmb || sizeof(*zdev->fmb) < zdev->fmb_length)
return -EINVAL;
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/slab.h`, `linux/err.h`, `linux/export.h`, `linux/delay.h`, `linux/seq_file.h`, `linux/jump_label.h`, `linux/pci.h`.
- Detected declarations: `function zpci_zdev_put`, `function zpci_remove_reserved_devices`, `function pci_domain_nr`, `function pci_proc_domain`, `function zpci_register_ioat`, `function zpci_unregister_ioat`, `function zpci_fmb_enable_device`, `function zpci_fmb_disable_device`, `function zpci_cfg_load`, `function zpci_cfg_store`.
- Atlas domain: Architecture Layer / arch/s390.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.