mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00

-----BEGIN PGP SIGNATURE----- iQJIBAABCgAyFiEEgMe7l+5h9hnxdsnuWYigwDrT+vwFAmfmt1AUHGJoZWxnYWFz QGdvb2dsZS5jb20ACgkQWYigwDrT+vxqNw//cC1BlVe4UUVR5r9nfpoFeGAZeDJz 32naGvZKjwL0tR6dStO/BEZx4QrBp+smVfJfuxtQxfzLHLgMigM2jVhfa7XUmaun 7yZlJZu4Jmydc57sPf56CFOYOFP6zyPzSaE8u1Eb4IIqpvuoYpvDayDt6PSsLmFS PDzqmicT3nuNbbcfE4rYLyL6JsXooKCR1h+NNcDjy7Run9DvQbE6N2PPvXCu6O97 aC3+kYUydEpgn9DfjBDghe+GBQCkBPldwnWqXBxKDFmYj5bKFujNccS9/IDSEuuX oWntDRAXgLWg048sBC1AuJQajF3UaqffRGJkzUBaZWbU/jB9t5N/Z3GpYlXzizRx CAqnt/ciGUKVbaESKwoeeIqgK+wG1bnrmoEaJHXFGqjr6sjm2A2T5EzyBMJ1hFwE wUq6SDnkp5igG7rWtsBPo/lGa5h/pNlaXng11570ikD2ZfHVfRgwy2MpXYxChrkt X2q/lRYU7yyfNJQ8O5LQJ6bYztatjxT0TxXNFv+cxfVrdI7vnQMuaeBE352jn+Lo aZ8fTJDFbRXtrZolcoetZjBdHwPIS42wYQtvxo/ylUl64xKEzZEzN09XODjwn74v nuOzDtbM0TAjZWxi6bwRFPnemTEAQxPuv1i4VdPQ7yblvC0at2agNBsz6Fdq60GS s80YMJVUU0UcVoc= =gM1i -----END PGP SIGNATURE----- Merge tag 'pci-v6.15-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci Pull pci updates from Bjorn Helgaas: "Enumeration: - Enable Configuration RRS SV, which makes device readiness visible, early instead of during child bus scanning (Bjorn Helgaas) - Log debug messages about reset methods being used (Bjorn Helgaas) - Avoid reset when it has been disabled via sysfs (Nishanth Aravamudan) - Add common pci-ep-bus.yaml schema for exporting several peripherals of a single PCI function via devicetree (Andrea della Porta) - Create DT nodes for PCI host bridges to enable loading device tree overlays to create platform devices for PCI devices that have several features that require multiple drivers (Herve Codina) Resource management: - Enlarge devres table[] to accommodate bridge windows, ROM, IOV BARs, etc., and validate BAR index in devres interfaces (Philipp Stanner) - Fix typo that repeatedly distributed resources to a bridge instead of iterating over subordinate bridges, which resulted in too little space to assign some BARs (Kai-Heng Feng) - Relax bridge window tail sizing for optional resources, e.g., IOV BARs, to avoid failures when removing and re-adding devices (Ilpo Järvinen) - Allow drivers to enable devices even if we haven't assigned optional IOV resources to them (Ilpo Järvinen) - Rework handling of optional resources (IOV BARs, ROMs) to reduce failures if we can't allocate them (Ilpo Järvinen) - Fix a NULL dereference in the SR-IOV VF creation error path (Shay Drory) - Fix s390 mmio_read/write syscalls, which didn't cause page faults in some cases, which broke vfio-pci lazy mapping on first access (Niklas Schnelle) - Add pdev->non_mappable_bars to replace CONFIG_VFIO_PCI_MMAP, which was disabled only for s390 (Niklas Schnelle) - Support mmap of PCI resources on s390 except for ISM devices (Niklas Schnelle) ASPM: - Delay pcie_link_state deallocation to avoid dangling pointers that cause invalid references during hot-unplug (Daniel Stodden) Power management: - Allow PCI bridges to go to D3Hot when suspending on all non-x86 systems (Manivannan Sadhasivam) Power control: - Create pwrctrl devices in pci_scan_device() to make it more symmetric with pci_pwrctrl_unregister() and make pwrctrl devices for PCI bridges possible (Manivannan Sadhasivam) - Unregister pwrctrl devices in pci_destroy_dev() so DOE, ASPM, etc. can still access devices after pci_stop_dev() (Manivannan Sadhasivam) - If there's a pwrctrl device for a PCI device, skip scanning it because the pwrctrl core will rescan the bus after the device is powered on (Manivannan Sadhasivam) - Add a pwrctrl driver for PCI slots based on voltage regulators described via devicetree (Manivannan Sadhasivam) Bandwidth control: - Add set_pcie_speed.sh to TEST_PROGS to fix issue when executing the set_pcie_cooling_state.sh test case (Yi Lai) - Avoid a NULL pointer dereference when we run out of bus numbers to assign for a bridge secondary bus (Lukas Wunner) Hotplug: - Drop superfluous pci_hotplug_slot_list, try_module_get() calls, and NULL pointer checks (Lukas Wunner) - Drop shpchp module init/exit logging, replace shpchp dbg() with ctrl_dbg(), and remove unused dbg(), err(), info(), warn() wrappers (Ilpo Järvinen) - Drop 'shpchp_debug' module parameter in favor of standard dynamic debugging (Ilpo Järvinen) - Drop unused cpcihp .get_power(), .set_power() function pointers (Guilherme Giacomo Simoes) - Disable hotplug interrupts in portdrv only when pciehp is not enabled to avoid issuing two hotplug commands too close together (Feng Tang) - Skip pciehp 'device replaced' check if the device has been removed to address a deadlock when resuming after a device was removed during system sleep (Lukas Wunner) - Don't enable pciehp hotplug interupt when resuming in poll mode (Ilpo Järvinen) Virtualization: - Fix bugs in 'pci=config_acs=' kernel command line parameter (Tushar Dave) DOE: - Expose supported DOE features via sysfs (Alistair Francis) - Allow DOE support to be enabled even if CXL isn't enabled (Alistair Francis) Endpoint framework: - Convert PCI device data so pci-epf-test works correctly on big-endian endpoint systems (Niklas Cassel) - Add BAR_RESIZABLE type to endpoint framework and add DWC core support for EPF drivers to set BAR_RESIZABLE type and size (Niklas Cassel) - Fix pci-epf-test double free that causes an oops if the host reboots and PERST# deassertion restarts endpoint BAR allocation (Christian Bruel) - Fix endpoint BAR testing so tests can skip disabled BARs instead of reporting them as failures (Niklas Cassel) - Widen endpoint test BAR size variable to accommodate BARs larger than INT_MAX (Niklas Cassel) - Remove unused tools 'pci' build target left over after moving tests to tools/testing/selftests/pci_endpoint (Jianfeng Liu) Altera PCIe controller driver: - Add DT binding and driver support for Agilex family (P-Tile, F-Tile, R-Tile) (Matthew Gerlach and D M, Sharath Kumar) AMD MDB PCIe controller driver: - Add DT binding and driver for AMD MDB (Multimedia DMA Bridge) (Thippeswamy Havalige) Broadcom STB PCIe controller driver: - Add BCM2712 MSI-X DT binding and interrupt controller drivers and add softdep on irq_bcm2712_mip driver to ensure that it is loaded first (Stanimir Varbanov) - Expand inbound window map to 64GB so it can accommodate BCM2712 (Stanimir Varbanov) - Add BCM2712 support and DT updates (Stanimir Varbanov) - Apply link speed restriction before bringing link up, not after (Jim Quinlan) - Update Max Link Speed in Link Capabilities via the internal writable register, not the read-only config register (Jim Quinlan) - Handle regulator_bulk_get() error to avoid panic when we call regulator_bulk_free() later (Jim Quinlan) - Disable regulators only when removing the bus immediately below a Root Port because we don't support regulators deeper in the hierarchy (Jim Quinlan) - Make const read-only arrays static (Colin Ian King) Cadence PCIe endpoint driver: - Correct MSG TLP generation so endpoints can generate INTx messages (Hans Zhang) Freescale i.MX6 PCIe controller driver: - Identify the second controller on i.MX8MQ based on devicetree 'linux,pci-domain' instead of DBI 'reg' address (Richard Zhu) - Remove imx_pcie_cpu_addr_fixup() since dwc core can now derive the ATU input address (using parent_bus_offset) from devicetree (Frank Li) Freescale Layerscape PCIe controller driver: - Drop deprecated 'num-ib-windows' and 'num-ob-windows' and unnecessary 'status' from example (Krzysztof Kozlowski) - Correct the syscon_regmap_lookup_by_phandle_args("fsl,pcie-scfg") arg_count to fix probe failure on LS1043A (Ioana Ciornei) HiSilicon STB PCIe controller driver: - Call phy_exit() to clean up if histb_pcie_probe() fails (Christophe JAILLET) Intel Gateway PCIe controller driver: - Remove intel_pcie_cpu_addr() since dwc core can now derive the ATU input address (using parent_bus_offset) from devicetree (Frank Li) Intel VMD host bridge driver: - Convert vmd_dev.cfg_lock from spinlock_t to raw_spinlock_t so pci_ops.read() will never sleep, even on PREEMPT_RT where spinlock_t becomes a sleepable lock, to avoid calling a sleeping function from invalid context (Ryo Takakura) MediaTek PCIe Gen3 controller driver: - Remove leftover mac_reset assert for Airoha EN7581 SoC (Lorenzo Bianconi) - Add EN7581 PBUS controller 'mediatek,pbus-csr' DT property and program host bridge memory aperture to this syscon node (Lorenzo Bianconi) Qualcomm PCIe controller driver: - Add qcom,pcie-ipq5332 binding (Varadarajan Narayanan) - Add qcom i.MX8QM and i.MX8QXP/DXP optional DMA interrupt (Alexander Stein) - Add optional dma-coherent DT property for Qualcomm SA8775P (Dmitry Baryshkov) - Make DT iommu property required for SA8775P and prohibited for SDX55 (Dmitry Baryshkov) - Add DT IOMMU and DMA-related properties for Qualcomm SM8450 (Dmitry Baryshkov) - Add endpoint DT properties for SAR2130P and enable endpoint mode in driver (Dmitry Baryshkov) - Describe endpoint BAR0 and BAR2 as 64-bit only and BAR1 and BAR3 as RESERVED (Manivannan Sadhasivam) Rockchip DesignWare PCIe controller driver: - Describe rk3568 and rk3588 BARs as Resizable, not Fixed (Niklas Cassel) Synopsys DesignWare PCIe controller driver: - Add debugfs-based Silicon Debug, Error Injection, Statistical Counter support for DWC (Shradha Todi) - Add debugfs property to expose LTSSM status of DWC PCIe link (Hans Zhang) - Add Rockchip support for DWC debugfs features (Niklas Cassel) - Add dw_pcie_parent_bus_offset() to look up the parent bus address of a specified 'reg' property and return the offset from the CPU physical address (Frank Li) - Use dw_pcie_parent_bus_offset() to derive CPU -> ATU addr offset via 'reg[config]' for host controllers and 'reg[addr_space]' for endpoint controllers (Frank Li) - Apply struct dw_pcie.parent_bus_offset in ATU users to remove use of .cpu_addr_fixup() when programming ATU (Frank Li) TI J721E PCIe driver: - Correct the 'link down' interrupt bit for J784S4 (Siddharth Vadapalli) TI Keystone PCIe controller driver: - Describe AM65x BARs 2 and 5 as Resizable (not Fixed) and reduce alignment requirement from 1MB to 64KB (Niklas Cassel) Xilinx Versal CPM PCIe controller driver: - Free IRQ domain in probe error path to avoid leaking it (Thippeswamy Havalige) - Add DT .compatible "xlnx,versal-cpm5nc-host" and driver support for Versal Net CPM5NC Root Port controller (Thippeswamy Havalige) - Add driver support for CPM5_HOST1 (Thippeswamy Havalige) Miscellaneous: - Convert fsl,mpc83xx-pcie binding to YAML (J. Neuschäfer) - Use for_each_available_child_of_node_scoped() to simplify apple, kirin, mediatek, mt7621, tegra drivers (Zhang Zekun)" * tag 'pci-v6.15-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci: (197 commits) PCI: layerscape: Fix arg_count to syscon_regmap_lookup_by_phandle_args() PCI: j721e: Fix the value of .linkdown_irq_regfield for J784S4 misc: pci_endpoint_test: Add support for PCITEST_IRQ_TYPE_AUTO PCI: endpoint: pci-epf-test: Expose supported IRQ types in CAPS register PCI: dw-rockchip: Endpoint mode cannot raise INTx interrupts PCI: endpoint: Add intx_capable to epc_features struct dt-bindings: PCI: Add common schema for devices accessible through PCI BARs PCI: intel-gw: Remove intel_pcie_cpu_addr() PCI: imx6: Remove imx_pcie_cpu_addr_fixup() PCI: dwc: Use parent_bus_offset to remove need for .cpu_addr_fixup() PCI: dwc: ep: Ensure proper iteration over outbound map windows PCI: dwc: ep: Use devicetree 'reg[addr_space]' to derive CPU -> ATU addr offset PCI: dwc: ep: Consolidate devicetree handling in dw_pcie_ep_get_resources() PCI: dwc: ep: Call epc_create() early in dw_pcie_ep_init() PCI: dwc: Use devicetree 'reg[config]' to derive CPU -> ATU addr offset PCI: dwc: Add dw_pcie_parent_bus_offset() checking and debug PCI: dwc: Add dw_pcie_parent_bus_offset() PCI/bwctrl: Fix NULL pointer dereference on bus number exhaustion PCI: xilinx-cpm: Add cpm_csr register mapping for CPM5_HOST1 variant PCI: brcmstb: Make const read-only arrays static ...
336 lines
8.9 KiB
C
336 lines
8.9 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef __ASM_S390_PCI_H
|
|
#define __ASM_S390_PCI_H
|
|
|
|
#include <linux/pci.h>
|
|
#include <linux/mutex.h>
|
|
#include <linux/iommu.h>
|
|
#include <linux/pci_hotplug.h>
|
|
#include <asm/pci_clp.h>
|
|
#include <asm/pci_debug.h>
|
|
#include <asm/pci_insn.h>
|
|
#include <asm/sclp.h>
|
|
|
|
#define ARCH_GENERIC_PCI_MMAP_RESOURCE 1
|
|
#define arch_can_pci_mmap_wc() 1
|
|
|
|
#define PCIBIOS_MIN_IO 0x1000
|
|
#define PCIBIOS_MIN_MEM 0x10000000
|
|
|
|
#define pcibios_assign_all_busses() (0)
|
|
|
|
void __iomem *pci_iomap(struct pci_dev *, int, unsigned long);
|
|
void pci_iounmap(struct pci_dev *, void __iomem *);
|
|
int pci_domain_nr(struct pci_bus *);
|
|
int pci_proc_domain(struct pci_bus *);
|
|
|
|
#define ZPCI_BUS_NR 0 /* default bus number */
|
|
|
|
#define ZPCI_NR_DMA_SPACES 1
|
|
#define ZPCI_NR_DEVICES CONFIG_PCI_NR_FUNCTIONS
|
|
#define ZPCI_DOMAIN_BITMAP_SIZE (1 << 16)
|
|
|
|
#ifdef PCI
|
|
#if (ZPCI_NR_DEVICES > ZPCI_DOMAIN_BITMAP_SIZE)
|
|
# error ZPCI_NR_DEVICES can not be bigger than ZPCI_DOMAIN_BITMAP_SIZE
|
|
#endif
|
|
#endif /* PCI */
|
|
|
|
/* PCI Function Controls */
|
|
#define ZPCI_FC_FN_ENABLED 0x80
|
|
#define ZPCI_FC_ERROR 0x40
|
|
#define ZPCI_FC_BLOCKED 0x20
|
|
#define ZPCI_FC_DMA_ENABLED 0x10
|
|
|
|
#define ZPCI_FMB_DMA_COUNTER_VALID (1 << 23)
|
|
|
|
struct zpci_fmb_fmt0 {
|
|
u64 dma_rbytes;
|
|
u64 dma_wbytes;
|
|
};
|
|
|
|
struct zpci_fmb_fmt1 {
|
|
u64 rx_bytes;
|
|
u64 rx_packets;
|
|
u64 tx_bytes;
|
|
u64 tx_packets;
|
|
};
|
|
|
|
struct zpci_fmb_fmt2 {
|
|
u64 consumed_work_units;
|
|
u64 max_work_units;
|
|
};
|
|
|
|
struct zpci_fmb_fmt3 {
|
|
u64 tx_bytes;
|
|
};
|
|
|
|
struct zpci_fmb {
|
|
u32 format : 8;
|
|
u32 fmt_ind : 24;
|
|
u32 samples;
|
|
u64 last_update;
|
|
/* common counters */
|
|
u64 ld_ops;
|
|
u64 st_ops;
|
|
u64 stb_ops;
|
|
u64 rpcit_ops;
|
|
/* format specific counters */
|
|
union {
|
|
struct zpci_fmb_fmt0 fmt0;
|
|
struct zpci_fmb_fmt1 fmt1;
|
|
struct zpci_fmb_fmt2 fmt2;
|
|
struct zpci_fmb_fmt3 fmt3;
|
|
};
|
|
} __packed __aligned(128);
|
|
|
|
enum zpci_state {
|
|
ZPCI_FN_STATE_STANDBY = 0,
|
|
ZPCI_FN_STATE_CONFIGURED = 1,
|
|
ZPCI_FN_STATE_RESERVED = 2,
|
|
};
|
|
|
|
struct zpci_bar_struct {
|
|
struct resource *res; /* bus resource */
|
|
void __iomem *mio_wb;
|
|
void __iomem *mio_wt;
|
|
u32 val; /* bar start & 3 flag bits */
|
|
u16 map_idx; /* index into bar mapping array */
|
|
u8 size; /* order 2 exponent */
|
|
};
|
|
|
|
struct kvm_zdev;
|
|
|
|
#define ZPCI_FUNCTIONS_PER_BUS 256
|
|
struct zpci_bus {
|
|
struct kref kref;
|
|
struct pci_bus *bus;
|
|
struct zpci_dev *function[ZPCI_FUNCTIONS_PER_BUS];
|
|
struct list_head resources;
|
|
struct list_head bus_next;
|
|
struct resource bus_resource;
|
|
int topo; /* TID if topo_is_tid, PCHID otherwise */
|
|
int domain_nr;
|
|
u8 multifunction : 1;
|
|
u8 topo_is_tid : 1;
|
|
enum pci_bus_speed max_bus_speed;
|
|
};
|
|
|
|
/* Private data per function */
|
|
struct zpci_dev {
|
|
struct zpci_bus *zbus;
|
|
struct list_head entry; /* list of all zpci_devices, needed for hotplug, etc. */
|
|
struct list_head iommu_list;
|
|
struct kref kref;
|
|
struct rcu_head rcu;
|
|
struct hotplug_slot hotplug_slot;
|
|
|
|
struct mutex state_lock; /* protect state changes */
|
|
enum zpci_state state;
|
|
u32 fid; /* function ID, used by sclp */
|
|
u32 fh; /* function handle, used by insn's */
|
|
u32 gisa; /* GISA designation for passthrough */
|
|
u16 vfn; /* virtual function number */
|
|
u16 pchid; /* physical channel ID */
|
|
u16 maxstbl; /* Maximum store block size */
|
|
u16 rid; /* RID as supplied by firmware */
|
|
u16 tid; /* Topology for which RID is valid */
|
|
u8 pfgid; /* function group ID */
|
|
u8 pft; /* pci function type */
|
|
u8 port;
|
|
u8 fidparm;
|
|
u8 dtsm; /* Supported DT mask */
|
|
u8 rid_available : 1;
|
|
u8 has_hp_slot : 1;
|
|
u8 has_resources : 1;
|
|
u8 is_physfn : 1;
|
|
u8 util_str_avail : 1;
|
|
u8 irqs_registered : 1;
|
|
u8 tid_avail : 1;
|
|
u8 rtr_avail : 1; /* Relaxed translation allowed */
|
|
unsigned int devfn; /* DEVFN part of the RID*/
|
|
|
|
u8 pfip[CLP_PFIP_NR_SEGMENTS]; /* pci function internal path */
|
|
u32 uid; /* user defined id */
|
|
u8 util_str[CLP_UTIL_STR_LEN]; /* utility string */
|
|
|
|
/* IRQ stuff */
|
|
u64 msi_addr; /* MSI address */
|
|
unsigned int max_msi; /* maximum number of MSI's */
|
|
unsigned int msi_first_bit;
|
|
unsigned int msi_nr_irqs;
|
|
struct airq_iv *aibv; /* adapter interrupt bit vector */
|
|
unsigned long aisb; /* number of the summary bit */
|
|
|
|
/* DMA stuff */
|
|
unsigned long *dma_table;
|
|
int tlb_refresh;
|
|
|
|
struct iommu_device iommu_dev; /* IOMMU core handle */
|
|
|
|
char res_name[16];
|
|
bool mio_capable;
|
|
struct zpci_bar_struct bars[PCI_STD_NUM_BARS];
|
|
|
|
u64 start_dma; /* Start of available DMA addresses */
|
|
u64 end_dma; /* End of available DMA addresses */
|
|
u64 dma_mask; /* DMA address space mask */
|
|
|
|
/* Function measurement block */
|
|
struct mutex fmb_lock;
|
|
struct zpci_fmb *fmb;
|
|
u16 fmb_update; /* update interval */
|
|
u16 fmb_length;
|
|
|
|
u8 version;
|
|
enum pci_bus_speed max_bus_speed;
|
|
|
|
struct dentry *debugfs_dev;
|
|
|
|
/* IOMMU and passthrough */
|
|
struct iommu_domain *s390_domain; /* attached IOMMU domain */
|
|
struct kvm_zdev *kzdev;
|
|
struct mutex kzdev_lock;
|
|
spinlock_t dom_lock; /* protect s390_domain change */
|
|
};
|
|
|
|
static inline bool zdev_enabled(struct zpci_dev *zdev)
|
|
{
|
|
return (zdev->fh & (1UL << 31)) ? true : false;
|
|
}
|
|
|
|
extern const struct attribute_group zpci_attr_group;
|
|
extern const struct attribute_group pfip_attr_group;
|
|
extern const struct attribute_group zpci_ident_attr_group;
|
|
|
|
#define ARCH_PCI_DEV_GROUPS &zpci_attr_group, \
|
|
&pfip_attr_group, \
|
|
&zpci_ident_attr_group,
|
|
|
|
extern unsigned int s390_pci_force_floating __initdata;
|
|
extern unsigned int s390_pci_no_rid;
|
|
|
|
extern union zpci_sic_iib *zpci_aipb;
|
|
extern struct airq_iv *zpci_aif_sbv;
|
|
|
|
/* -----------------------------------------------------------------------------
|
|
Prototypes
|
|
----------------------------------------------------------------------------- */
|
|
/* Base stuff */
|
|
struct zpci_dev *zpci_create_device(u32 fid, u32 fh, enum zpci_state state);
|
|
int zpci_add_device(struct zpci_dev *zdev);
|
|
int zpci_enable_device(struct zpci_dev *);
|
|
int zpci_reenable_device(struct zpci_dev *zdev);
|
|
int zpci_disable_device(struct zpci_dev *);
|
|
int zpci_scan_configured_device(struct zpci_dev *zdev, u32 fh);
|
|
int zpci_deconfigure_device(struct zpci_dev *zdev);
|
|
void zpci_device_reserved(struct zpci_dev *zdev);
|
|
bool zpci_is_device_configured(struct zpci_dev *zdev);
|
|
int zpci_scan_devices(void);
|
|
|
|
int zpci_hot_reset_device(struct zpci_dev *zdev);
|
|
int zpci_register_ioat(struct zpci_dev *, u8, u64, u64, u64, u8 *);
|
|
int zpci_unregister_ioat(struct zpci_dev *, u8);
|
|
void zpci_remove_reserved_devices(void);
|
|
void zpci_update_fh(struct zpci_dev *zdev, u32 fh);
|
|
|
|
/* CLP */
|
|
int clp_setup_writeback_mio(void);
|
|
int clp_scan_pci_devices(struct list_head *scan_list);
|
|
int clp_query_pci_fn(struct zpci_dev *zdev);
|
|
int clp_enable_fh(struct zpci_dev *zdev, u32 *fh, u8 nr_dma_as);
|
|
int clp_disable_fh(struct zpci_dev *zdev, u32 *fh);
|
|
int clp_get_state(u32 fid, enum zpci_state *state);
|
|
int clp_refresh_fh(u32 fid, u32 *fh);
|
|
|
|
/* UID */
|
|
void update_uid_checking(bool new);
|
|
|
|
/* IOMMU Interface */
|
|
int zpci_init_iommu(struct zpci_dev *zdev);
|
|
void zpci_destroy_iommu(struct zpci_dev *zdev);
|
|
int zpci_iommu_register_ioat(struct zpci_dev *zdev, u8 *status);
|
|
|
|
#ifdef CONFIG_PCI
|
|
static inline bool zpci_use_mio(struct zpci_dev *zdev)
|
|
{
|
|
return static_branch_likely(&have_mio) && zdev->mio_capable;
|
|
}
|
|
|
|
/* Error handling and recovery */
|
|
void zpci_event_error(void *);
|
|
void zpci_event_availability(void *);
|
|
bool zpci_is_enabled(void);
|
|
#else /* CONFIG_PCI */
|
|
static inline void zpci_event_error(void *e) {}
|
|
static inline void zpci_event_availability(void *e) {}
|
|
#endif /* CONFIG_PCI */
|
|
|
|
#ifdef CONFIG_HOTPLUG_PCI_S390
|
|
int zpci_init_slot(struct zpci_dev *);
|
|
void zpci_exit_slot(struct zpci_dev *);
|
|
#else /* CONFIG_HOTPLUG_PCI_S390 */
|
|
static inline int zpci_init_slot(struct zpci_dev *zdev)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline void zpci_exit_slot(struct zpci_dev *zdev) {}
|
|
#endif /* CONFIG_HOTPLUG_PCI_S390 */
|
|
|
|
/* Helpers */
|
|
static inline struct zpci_dev *to_zpci(struct pci_dev *pdev)
|
|
{
|
|
struct zpci_bus *zbus = pdev->sysdata;
|
|
|
|
return zbus->function[pdev->devfn];
|
|
}
|
|
|
|
static inline struct zpci_dev *to_zpci_dev(struct device *dev)
|
|
{
|
|
return to_zpci(to_pci_dev(dev));
|
|
}
|
|
|
|
struct zpci_dev *get_zdev_by_fid(u32);
|
|
|
|
/* DMA */
|
|
int zpci_dma_init(void);
|
|
void zpci_dma_exit(void);
|
|
int zpci_dma_init_device(struct zpci_dev *zdev);
|
|
int zpci_dma_exit_device(struct zpci_dev *zdev);
|
|
|
|
/* IRQ */
|
|
int __init zpci_irq_init(void);
|
|
void __init zpci_irq_exit(void);
|
|
|
|
/* FMB */
|
|
int zpci_fmb_enable_device(struct zpci_dev *);
|
|
int zpci_fmb_disable_device(struct zpci_dev *);
|
|
|
|
/* Debug */
|
|
int zpci_debug_init(void);
|
|
void zpci_debug_exit(void);
|
|
void zpci_debug_init_device(struct zpci_dev *, const char *);
|
|
void zpci_debug_exit_device(struct zpci_dev *);
|
|
|
|
/* Error handling */
|
|
int zpci_report_error(struct pci_dev *, struct zpci_report_error_header *);
|
|
int zpci_clear_error_state(struct zpci_dev *zdev);
|
|
int zpci_reset_load_store_blocked(struct zpci_dev *zdev);
|
|
|
|
#ifdef CONFIG_NUMA
|
|
|
|
/* Returns the node based on PCI bus */
|
|
static inline int __pcibus_to_node(const struct pci_bus *bus)
|
|
{
|
|
return NUMA_NO_NODE;
|
|
}
|
|
|
|
static inline const struct cpumask *
|
|
cpumask_of_pcibus(const struct pci_bus *bus)
|
|
{
|
|
return cpu_online_mask;
|
|
}
|
|
|
|
#endif /* CONFIG_NUMA */
|
|
|
|
#endif
|