aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/interrupt.h4
-rw-r--r--include/linux/pci-ats.h10
-rw-r--r--include/linux/pci.h28
-rw-r--r--include/uapi/linux/pci_regs.h1
-rw-r--r--include/uapi/linux/switchtec_ioctl.h3
5 files changed, 41 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
291irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify); 291irq_set_affinity_notifier(unsigned int irq, struct irq_affinity_notify *notify);
292 292
293struct cpumask *irq_create_affinity_masks(int nvec, const struct irq_affinity *affd); 293struct cpumask *irq_create_affinity_masks(int nvec, const struct irq_affinity *affd);
294int irq_calc_affinity_vectors(int maxvec, const struct irq_affinity *affd); 294int 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
333static inline int 333static inline int
334irq_calc_affinity_vectors(int maxvec, const struct irq_affinity *affd) 334irq_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
8int pci_enable_pri(struct pci_dev *pdev, u32 reqs); 8int pci_enable_pri(struct pci_dev *pdev, u32 reqs);
9void pci_disable_pri(struct pci_dev *pdev); 9void pci_disable_pri(struct pci_dev *pdev);
10void pci_restore_pri_state(struct pci_dev *pdev);
10int pci_reset_pri(struct pci_dev *pdev); 11int 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
24static inline void pci_restore_pri_state(struct pci_dev *pdev)
25{
26}
27
23static inline int pci_reset_pri(struct pci_dev *pdev) 28static 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
32int pci_enable_pasid(struct pci_dev *pdev, int features); 37int pci_enable_pasid(struct pci_dev *pdev, int features);
33void pci_disable_pasid(struct pci_dev *pdev); 38void pci_disable_pasid(struct pci_dev *pdev);
39void pci_restore_pasid_state(struct pci_dev *pdev);
34int pci_pasid_features(struct pci_dev *pdev); 40int pci_pasid_features(struct pci_dev *pdev);
35int pci_max_pasids(struct pci_dev *pdev); 41int 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
54static inline void pci_restore_pasid_state(struct pci_dev *pdev)
55{
56}
57
48static inline int pci_pasid_features(struct pci_dev *pdev) 58static 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
188enum pci_irq_reroute_variant { 193enum 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 *);
1004int __must_check pcim_enable_device(struct pci_dev *pdev); 1018int __must_check pcim_enable_device(struct pci_dev *pdev);
1005void pcim_pin_device(struct pci_dev *pdev); 1019void pcim_pin_device(struct pci_dev *pdev);
1006 1020
1021static 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
1007static inline int pci_is_enabled(struct pci_dev *pdev) 1030static 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);
1027int pci_try_set_mwi(struct pci_dev *dev); 1050int pci_try_set_mwi(struct pci_dev *dev);
1028void pci_clear_mwi(struct pci_dev *dev); 1051void pci_clear_mwi(struct pci_dev *dev);
1029void pci_intx(struct pci_dev *dev, int enable); 1052void pci_intx(struct pci_dev *dev, int enable);
1030bool pci_intx_mask_supported(struct pci_dev *dev);
1031bool pci_check_and_mask_intx(struct pci_dev *dev); 1053bool pci_check_and_mask_intx(struct pci_dev *dev);
1032bool pci_check_and_unmask_intx(struct pci_dev *dev); 1054bool pci_check_and_unmask_intx(struct pci_dev *dev);
1033int pci_wait_for_pending(struct pci_dev *dev, int pos, u16 mask); 1055int pci_wait_for_pending(struct pci_dev *dev, int pos, u16 mask);
diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h
index d56bb0051009..c22d3ebaca20 100644
--- a/include/uapi/linux/pci_regs.h
+++ b/include/uapi/linux/pci_regs.h
@@ -517,6 +517,7 @@
517#define PCI_EXP_LNKCAP_SLS 0x0000000f /* Supported Link Speeds */ 517#define PCI_EXP_LNKCAP_SLS 0x0000000f /* Supported Link Speeds */
518#define PCI_EXP_LNKCAP_SLS_2_5GB 0x00000001 /* LNKCAP2 SLS Vector bit 0 */ 518#define PCI_EXP_LNKCAP_SLS_2_5GB 0x00000001 /* LNKCAP2 SLS Vector bit 0 */
519#define PCI_EXP_LNKCAP_SLS_5_0GB 0x00000002 /* LNKCAP2 SLS Vector bit 1 */ 519#define PCI_EXP_LNKCAP_SLS_5_0GB 0x00000002 /* LNKCAP2 SLS Vector bit 1 */
520#define PCI_EXP_LNKCAP_SLS_8_0GB 0x00000003 /* LNKCAP2 SLS Vector bit 2 */
520#define PCI_EXP_LNKCAP_MLW 0x000003f0 /* Maximum Link Width */ 521#define PCI_EXP_LNKCAP_MLW 0x000003f0 /* Maximum Link Width */
521#define PCI_EXP_LNKCAP_ASPMS 0x00000c00 /* ASPM Support */ 522#define PCI_EXP_LNKCAP_ASPMS 0x00000c00 /* ASPM Support */
522#define PCI_EXP_LNKCAP_L0SEL 0x00007000 /* L0s Exit Latency */ 523#define PCI_EXP_LNKCAP_L0SEL 0x00007000 /* L0s Exit Latency */
diff --git a/include/uapi/linux/switchtec_ioctl.h b/include/uapi/linux/switchtec_ioctl.h
index 3e824e1a6495..5e392968bad2 100644
--- a/include/uapi/linux/switchtec_ioctl.h
+++ b/include/uapi/linux/switchtec_ioctl.h
@@ -39,6 +39,9 @@ struct switchtec_ioctl_flash_info {
39 __u32 padding; 39 __u32 padding;
40}; 40};
41 41
42#define SWITCHTEC_IOCTL_PART_ACTIVE 1
43#define SWITCHTEC_IOCTL_PART_RUNNING 2
44
42struct switchtec_ioctl_flash_part_info { 45struct switchtec_ioctl_flash_part_info {
43 __u32 flash_partition; 46 __u32 flash_partition;
44 __u32 address; 47 __u32 address;