File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -779,7 +779,7 @@ static int msix_capability_init(struct pci_dev *dev)
779
779
780
780
pci_read_config_word (dev , dev -> msix_cap + PCI_MSIX_FLAGS , & control );
781
781
/* Request & Map MSI-X table region */
782
- tsize = msix_table_size ( control );
782
+ tsize = pci_msix_vec_count ( dev );
783
783
dev -> msix_table_base = msix_map_region (dev , tsize );
784
784
if (!dev -> msix_table_base ) {
785
785
pci_msix_clear_and_set_ctrl (dev , PCI_MSIX_FLAGS_ENABLE , 0 );
@@ -1050,8 +1050,13 @@ int pci_msix_vec_count(struct pci_dev *dev)
1050
1050
if (!dev -> msix_cap )
1051
1051
return - EINVAL ;
1052
1052
1053
+ if (dev -> flags_qsize )
1054
+ return dev -> flags_qsize ;
1055
+
1053
1056
pci_read_config_word (dev , dev -> msix_cap + PCI_MSIX_FLAGS , & control );
1054
- return msix_table_size (control );
1057
+ dev -> flags_qsize = msix_table_size (control );
1058
+
1059
+ return dev -> flags_qsize ;
1055
1060
}
1056
1061
EXPORT_SYMBOL (pci_msix_vec_count );
1057
1062
Original file line number Diff line number Diff line change @@ -340,6 +340,7 @@ struct pci_dev {
340
340
u8 rom_base_reg ; /* Config register controlling ROM */
341
341
u8 pin ; /* Interrupt pin this device uses */
342
342
u16 pcie_flags_reg ; /* Cached PCIe Capabilities Register */
343
+ u16 flags_qsize ; /* Cached MSIX table size */
343
344
unsigned long * dma_alias_mask ;/* Mask of enabled devfn aliases */
344
345
345
346
struct pci_driver * driver ; /* Driver bound to this device */
You can’t perform that action at this time.
0 commit comments