diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/interrupt.h | 4 | ||||
-rw-r--r-- | include/linux/pci-ats.h | 10 | ||||
-rw-r--r-- | include/linux/pci.h | 28 |
3 files changed, 37 insertions, 5 deletions
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index a6fba4804672..0991f973f8ca 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -291,7 +291,7 @@ extern int | |||
291 | irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify); | 291 | irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify); |
292 | 292 | ||
293 | struct cpumask *irq_create_affinity_masks(int nvec, const struct irq_affinity *affd); | 293 | struct cpumask *irq_create_affinity_masks(int nvec, const struct irq_affinity *affd); |
294 | int irq_calc_affinity_vectors(int maxvec, const struct irq_affinity *affd); | 294 | int irq_calc_affinity_vectors(int minvec, int maxvec, const struct irq_affinity *affd); |
295 | 295 | ||
296 | #else /* CONFIG_SMP */ | 296 | #else /* CONFIG_SMP */ |
297 | 297 | ||
@@ -331,7 +331,7 @@ irq_create_affinity_masks(int nvec, const struct irq_affinity *affd) | |||
331 | } | 331 | } |
332 | 332 | ||
333 | static inline int | 333 | static inline int |
334 | irq_calc_affinity_vectors(int maxvec, const struct irq_affinity *affd) | 334 | irq_calc_affinity_vectors(int minvec, int maxvec, const struct irq_affinity *affd) |
335 | { | 335 | { |
336 | return maxvec; | 336 | return maxvec; |
337 | } | 337 | } |
diff --git a/include/linux/pci-ats.h b/include/linux/pci-ats.h index 57e0b8250947..782fb8e0755f 100644 --- a/include/linux/pci-ats.h +++ b/include/linux/pci-ats.h | |||
@@ -7,6 +7,7 @@ | |||
7 | 7 | ||
8 | int pci_enable_pri(struct pci_dev *pdev, u32 reqs); | 8 | int pci_enable_pri(struct pci_dev *pdev, u32 reqs); |
9 | void pci_disable_pri(struct pci_dev *pdev); | 9 | void pci_disable_pri(struct pci_dev *pdev); |
10 | void pci_restore_pri_state(struct pci_dev *pdev); | ||
10 | int pci_reset_pri(struct pci_dev *pdev); | 11 | int pci_reset_pri(struct pci_dev *pdev); |
11 | 12 | ||
12 | #else /* CONFIG_PCI_PRI */ | 13 | #else /* CONFIG_PCI_PRI */ |
@@ -20,6 +21,10 @@ static inline void pci_disable_pri(struct pci_dev *pdev) | |||
20 | { | 21 | { |
21 | } | 22 | } |
22 | 23 | ||
24 | static inline void pci_restore_pri_state(struct pci_dev *pdev) | ||
25 | { | ||
26 | } | ||
27 | |||
23 | static inline int pci_reset_pri(struct pci_dev *pdev) | 28 | static inline int pci_reset_pri(struct pci_dev *pdev) |
24 | { | 29 | { |
25 | return -ENODEV; | 30 | return -ENODEV; |
@@ -31,6 +36,7 @@ static inline int pci_reset_pri(struct pci_dev *pdev) | |||
31 | 36 | ||
32 | int pci_enable_pasid(struct pci_dev *pdev, int features); | 37 | int pci_enable_pasid(struct pci_dev *pdev, int features); |
33 | void pci_disable_pasid(struct pci_dev *pdev); | 38 | void pci_disable_pasid(struct pci_dev *pdev); |
39 | void pci_restore_pasid_state(struct pci_dev *pdev); | ||
34 | int pci_pasid_features(struct pci_dev *pdev); | 40 | int pci_pasid_features(struct pci_dev *pdev); |
35 | int pci_max_pasids(struct pci_dev *pdev); | 41 | int pci_max_pasids(struct pci_dev *pdev); |
36 | 42 | ||
@@ -45,6 +51,10 @@ static inline void pci_disable_pasid(struct pci_dev *pdev) | |||
45 | { | 51 | { |
46 | } | 52 | } |
47 | 53 | ||
54 | static inline void pci_restore_pasid_state(struct pci_dev *pdev) | ||
55 | { | ||
56 | } | ||
57 | |||
48 | static inline int pci_pasid_features(struct pci_dev *pdev) | 58 | static inline int pci_pasid_features(struct pci_dev *pdev) |
49 | { | 59 | { |
50 | return -EINVAL; | 60 | return -EINVAL; |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 5c1c0ae38dd3..bd68ed11b394 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -183,6 +183,11 @@ enum pci_dev_flags { | |||
183 | PCI_DEV_FLAGS_BRIDGE_XLATE_ROOT = (__force pci_dev_flags_t) (1 << 9), | 183 | PCI_DEV_FLAGS_BRIDGE_XLATE_ROOT = (__force pci_dev_flags_t) (1 << 9), |
184 | /* Do not use FLR even if device advertises PCI_AF_CAP */ | 184 | /* Do not use FLR even if device advertises PCI_AF_CAP */ |
185 | PCI_DEV_FLAGS_NO_FLR_RESET = (__force pci_dev_flags_t) (1 << 10), | 185 | PCI_DEV_FLAGS_NO_FLR_RESET = (__force pci_dev_flags_t) (1 << 10), |
186 | /* | ||
187 | * Resume before calling the driver's system suspend hooks, disabling | ||
188 | * the direct_complete optimization. | ||
189 | */ | ||
190 | PCI_DEV_FLAGS_NEEDS_RESUME = (__force pci_dev_flags_t) (1 << 11), | ||
186 | }; | 191 | }; |
187 | 192 | ||
188 | enum pci_irq_reroute_variant { | 193 | enum pci_irq_reroute_variant { |
@@ -356,6 +361,8 @@ struct pci_dev { | |||
356 | unsigned int msix_enabled:1; | 361 | unsigned int msix_enabled:1; |
357 | unsigned int ari_enabled:1; /* ARI forwarding */ | 362 | unsigned int ari_enabled:1; /* ARI forwarding */ |
358 | unsigned int ats_enabled:1; /* Address Translation Service */ | 363 | unsigned int ats_enabled:1; /* Address Translation Service */ |
364 | unsigned int pasid_enabled:1; /* Process Address Space ID */ | ||
365 | unsigned int pri_enabled:1; /* Page Request Interface */ | ||
359 | unsigned int is_managed:1; | 366 | unsigned int is_managed:1; |
360 | unsigned int needs_freset:1; /* Dev requires fundamental reset */ | 367 | unsigned int needs_freset:1; /* Dev requires fundamental reset */ |
361 | unsigned int state_saved:1; | 368 | unsigned int state_saved:1; |
@@ -366,7 +373,7 @@ struct pci_dev { | |||
366 | unsigned int is_thunderbolt:1; /* Thunderbolt controller */ | 373 | unsigned int is_thunderbolt:1; /* Thunderbolt controller */ |
367 | unsigned int __aer_firmware_first_valid:1; | 374 | unsigned int __aer_firmware_first_valid:1; |
368 | unsigned int __aer_firmware_first:1; | 375 | unsigned int __aer_firmware_first:1; |
369 | unsigned int broken_intx_masking:1; | 376 | unsigned int broken_intx_masking:1; /* INTx masking can't be used */ |
370 | unsigned int io_window_1k:1; /* Intel P2P bridge 1K I/O windows */ | 377 | unsigned int io_window_1k:1; /* Intel P2P bridge 1K I/O windows */ |
371 | unsigned int irq_managed:1; | 378 | unsigned int irq_managed:1; |
372 | unsigned int has_secondary_link:1; | 379 | unsigned int has_secondary_link:1; |
@@ -399,6 +406,12 @@ struct pci_dev { | |||
399 | u8 ats_stu; /* ATS Smallest Translation Unit */ | 406 | u8 ats_stu; /* ATS Smallest Translation Unit */ |
400 | atomic_t ats_ref_cnt; /* number of VFs with ATS enabled */ | 407 | atomic_t ats_ref_cnt; /* number of VFs with ATS enabled */ |
401 | #endif | 408 | #endif |
409 | #ifdef CONFIG_PCI_PRI | ||
410 | u32 pri_reqs_alloc; /* Number of PRI requests allocated */ | ||
411 | #endif | ||
412 | #ifdef CONFIG_PCI_PASID | ||
413 | u16 pasid_features; | ||
414 | #endif | ||
402 | phys_addr_t rom; /* Physical address of ROM if it's not from the BAR */ | 415 | phys_addr_t rom; /* Physical address of ROM if it's not from the BAR */ |
403 | size_t romlen; /* Length of ROM if it's not from the BAR */ | 416 | size_t romlen; /* Length of ROM if it's not from the BAR */ |
404 | char *driver_override; /* Driver name to force a match */ | 417 | char *driver_override; /* Driver name to force a match */ |
@@ -694,7 +707,8 @@ struct pci_error_handlers { | |||
694 | pci_ers_result_t (*slot_reset)(struct pci_dev *dev); | 707 | pci_ers_result_t (*slot_reset)(struct pci_dev *dev); |
695 | 708 | ||
696 | /* PCI function reset prepare or completed */ | 709 | /* PCI function reset prepare or completed */ |
697 | void (*reset_notify)(struct pci_dev *dev, bool prepare); | 710 | void (*reset_prepare)(struct pci_dev *dev); |
711 | void (*reset_done)(struct pci_dev *dev); | ||
698 | 712 | ||
699 | /* Device driver may resume normal operations */ | 713 | /* Device driver may resume normal operations */ |
700 | void (*resume)(struct pci_dev *dev); | 714 | void (*resume)(struct pci_dev *dev); |
@@ -1004,6 +1018,15 @@ int __must_check pci_reenable_device(struct pci_dev *); | |||
1004 | int __must_check pcim_enable_device(struct pci_dev *pdev); | 1018 | int __must_check pcim_enable_device(struct pci_dev *pdev); |
1005 | void pcim_pin_device(struct pci_dev *pdev); | 1019 | void pcim_pin_device(struct pci_dev *pdev); |
1006 | 1020 | ||
1021 | static inline bool pci_intx_mask_supported(struct pci_dev *pdev) | ||
1022 | { | ||
1023 | /* | ||
1024 | * INTx masking is supported if PCI_COMMAND_INTX_DISABLE is | ||
1025 | * writable and no quirk has marked the feature broken. | ||
1026 | */ | ||
1027 | return !pdev->broken_intx_masking; | ||
1028 | } | ||
1029 | |||
1007 | static inline int pci_is_enabled(struct pci_dev *pdev) | 1030 | static inline int pci_is_enabled(struct pci_dev *pdev) |
1008 | { | 1031 | { |
1009 | return (atomic_read(&pdev->enable_cnt) > 0); | 1032 | return (atomic_read(&pdev->enable_cnt) > 0); |
@@ -1027,7 +1050,6 @@ int __must_check pci_set_mwi(struct pci_dev *dev); | |||
1027 | int pci_try_set_mwi(struct pci_dev *dev); | 1050 | int pci_try_set_mwi(struct pci_dev *dev); |
1028 | void pci_clear_mwi(struct pci_dev *dev); | 1051 | void pci_clear_mwi(struct pci_dev *dev); |
1029 | void pci_intx(struct pci_dev *dev, int enable); | 1052 | void pci_intx(struct pci_dev *dev, int enable); |
1030 | bool pci_intx_mask_supported(struct pci_dev *dev); | ||
1031 | bool pci_check_and_mask_intx(struct pci_dev *dev); | 1053 | bool pci_check_and_mask_intx(struct pci_dev *dev); |
1032 | bool pci_check_and_unmask_intx(struct pci_dev *dev); | 1054 | bool pci_check_and_unmask_intx(struct pci_dev *dev); |
1033 | int pci_wait_for_pending(struct pci_dev *dev, int pos, u16 mask); | 1055 | int pci_wait_for_pending(struct pci_dev *dev, int pos, u16 mask); |