Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'pci/endpoint'

- Fix ntb/vntb copy & paste errors (Baruch Siach)

- Add configfs sub-groups synchronously to avoid NULL pointer dereference
when racing with removal (Liu Song)

- Fix swapped parameters in pci_{primary/secondary}_epc_epf_unlink()
functions (Manikanta Maddireddy)

* pci/endpoint:
PCI: endpoint: Fix swapped parameters in pci_{primary/secondary}_epc_epf_unlink() functions
PCI: endpoint: Avoid creating sub-groups asynchronously
Documentation: PCI: endpoint: Fix ntb/vntb copy & paste errors

+16 -21
+7 -7
Documentation/PCI/endpoint/pci-vntb-howto.rst
··· 52 52 # cd /sys/kernel/config/pci_ep/ 53 53 # mkdir functions/pci_epf_vntb/func1 54 54 55 - The "mkdir func1" above creates the pci-epf-ntb function device that will 55 + The "mkdir func1" above creates the pci-epf-vntb function device that will 56 56 be probed by pci_epf_vntb driver. 57 57 58 58 The PCI endpoint framework populates the directory with the following 59 59 configurable fields:: 60 60 61 - # ls functions/pci_epf_ntb/func1 62 - baseclass_code deviceid msi_interrupts pci-epf-ntb.0 61 + # ls functions/pci_epf_vntb/func1 62 + baseclass_code deviceid msi_interrupts pci-epf-vntb.0 63 63 progif_code secondary subsys_id vendorid 64 64 cache_line_size interrupt_pin msix_interrupts primary 65 65 revid subclass_code subsys_vendor_id ··· 111 111 # echo 0x080A > functions/pci_epf_vntb/func1/pci_epf_vntb.0/vntb_pid 112 112 # echo 0x10 > functions/pci_epf_vntb/func1/pci_epf_vntb.0/vbus_number 113 113 114 - Binding pci-epf-ntb Device to EP Controller 114 + Binding pci-epf-vntb Device to EP Controller 115 115 -------------------------------------------- 116 116 117 117 NTB function device should be attached to PCI endpoint controllers 118 118 connected to the host. 119 119 120 - # ln -s controllers/5f010000.pcie_ep functions/pci-epf-ntb/func1/primary 120 + # ln -s controllers/5f010000.pcie_ep functions/pci_epf_vntb/func1/primary 121 121 122 122 Once the above step is completed, the PCI endpoint controllers are ready to 123 123 establish a link with the host. ··· 139 139 ------------------------- 140 140 141 141 Note that the devices listed here correspond to the values populated in 142 - "Creating pci-epf-ntb Device" section above:: 142 + "Creating pci-epf-vntb Device" section above:: 143 143 144 144 # lspci 145 145 00:00.0 PCI bridge: Freescale Semiconductor Inc Device 0000 (rev 01) ··· 152 152 ----------------------------------------- 153 153 154 154 Note that the devices listed here correspond to the values populated in 155 - "Creating pci-epf-ntb Device" section above:: 155 + "Creating pci-epf-vntb Device" section above:: 156 156 157 157 # lspci 158 158 10:00.0 Unassigned class [ffff]: Dawicontrol Computersysteme GmbH Device 1234 (rev ff)
+9 -14
drivers/pci/endpoint/pci-ep-cfs.c
··· 23 23 struct config_group group; 24 24 struct config_group primary_epc_group; 25 25 struct config_group secondary_epc_group; 26 - struct delayed_work cfs_work; 27 26 struct pci_epf *epf; 28 27 int index; 29 28 }; ··· 68 69 return 0; 69 70 } 70 71 71 - static void pci_secondary_epc_epf_unlink(struct config_item *epc_item, 72 - struct config_item *epf_item) 72 + static void pci_secondary_epc_epf_unlink(struct config_item *epf_item, 73 + struct config_item *epc_item) 73 74 { 74 75 struct pci_epf_group *epf_group = to_pci_epf_group(epf_item->ci_parent); 75 76 struct pci_epc_group *epc_group = to_pci_epc_group(epc_item); ··· 102 103 secondary_epc_group = &epf_group->secondary_epc_group; 103 104 config_group_init_type_name(secondary_epc_group, "secondary", 104 105 &pci_secondary_epc_type); 105 - configfs_register_group(&epf_group->group, secondary_epc_group); 106 + configfs_add_default_group(secondary_epc_group, &epf_group->group); 106 107 107 108 return secondary_epc_group; 108 109 } ··· 132 133 return 0; 133 134 } 134 135 135 - static void pci_primary_epc_epf_unlink(struct config_item *epc_item, 136 - struct config_item *epf_item) 136 + static void pci_primary_epc_epf_unlink(struct config_item *epf_item, 137 + struct config_item *epc_item) 137 138 { 138 139 struct pci_epf_group *epf_group = to_pci_epf_group(epf_item->ci_parent); 139 140 struct pci_epc_group *epc_group = to_pci_epc_group(epc_item); ··· 165 166 166 167 config_group_init_type_name(primary_epc_group, "primary", 167 168 &pci_primary_epc_type); 168 - configfs_register_group(&epf_group->group, primary_epc_group); 169 + configfs_add_default_group(primary_epc_group, &epf_group->group); 169 170 170 171 return primary_epc_group; 171 172 } ··· 569 570 return; 570 571 } 571 572 572 - configfs_register_group(&epf_group->group, group); 573 + configfs_add_default_group(group, &epf_group->group); 573 574 } 574 575 575 - static void pci_epf_cfs_work(struct work_struct *work) 576 + static void pci_epf_cfs_add_sub_groups(struct pci_epf_group *epf_group) 576 577 { 577 - struct pci_epf_group *epf_group; 578 578 struct config_group *group; 579 579 580 - epf_group = container_of(work, struct pci_epf_group, cfs_work.work); 581 580 group = pci_ep_cfs_add_primary_group(epf_group); 582 581 if (IS_ERR(group)) { 583 582 pr_err("failed to create 'primary' EPC interface\n"); ··· 634 637 635 638 kfree(epf_name); 636 639 637 - INIT_DELAYED_WORK(&epf_group->cfs_work, pci_epf_cfs_work); 638 - queue_delayed_work(system_wq, &epf_group->cfs_work, 639 - msecs_to_jiffies(1)); 640 + pci_epf_cfs_add_sub_groups(epf_group); 640 641 641 642 return &epf_group->group; 642 643