mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 09:04:39 +02:00
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
This commit is contained in:
commit
4021a9df0a
|
|
@ -52,14 +52,14 @@ pci-epf-vntb device, the following commands can be used::
|
|||
# cd /sys/kernel/config/pci_ep/
|
||||
# mkdir functions/pci_epf_vntb/func1
|
||||
|
||||
The "mkdir func1" above creates the pci-epf-ntb function device that will
|
||||
The "mkdir func1" above creates the pci-epf-vntb function device that will
|
||||
be probed by pci_epf_vntb driver.
|
||||
|
||||
The PCI endpoint framework populates the directory with the following
|
||||
configurable fields::
|
||||
|
||||
# ls functions/pci_epf_ntb/func1
|
||||
baseclass_code deviceid msi_interrupts pci-epf-ntb.0
|
||||
# ls functions/pci_epf_vntb/func1
|
||||
baseclass_code deviceid msi_interrupts pci-epf-vntb.0
|
||||
progif_code secondary subsys_id vendorid
|
||||
cache_line_size interrupt_pin msix_interrupts primary
|
||||
revid subclass_code subsys_vendor_id
|
||||
|
|
@ -111,13 +111,13 @@ A sample configuration for virtual NTB driver for virtual PCI bus::
|
|||
# echo 0x080A > functions/pci_epf_vntb/func1/pci_epf_vntb.0/vntb_pid
|
||||
# echo 0x10 > functions/pci_epf_vntb/func1/pci_epf_vntb.0/vbus_number
|
||||
|
||||
Binding pci-epf-ntb Device to EP Controller
|
||||
Binding pci-epf-vntb Device to EP Controller
|
||||
--------------------------------------------
|
||||
|
||||
NTB function device should be attached to PCI endpoint controllers
|
||||
connected to the host.
|
||||
|
||||
# ln -s controllers/5f010000.pcie_ep functions/pci-epf-ntb/func1/primary
|
||||
# ln -s controllers/5f010000.pcie_ep functions/pci_epf_vntb/func1/primary
|
||||
|
||||
Once the above step is completed, the PCI endpoint controllers are ready to
|
||||
establish a link with the host.
|
||||
|
|
@ -139,7 +139,7 @@ lspci Output at Host side
|
|||
-------------------------
|
||||
|
||||
Note that the devices listed here correspond to the values populated in
|
||||
"Creating pci-epf-ntb Device" section above::
|
||||
"Creating pci-epf-vntb Device" section above::
|
||||
|
||||
# lspci
|
||||
00:00.0 PCI bridge: Freescale Semiconductor Inc Device 0000 (rev 01)
|
||||
|
|
@ -152,7 +152,7 @@ lspci Output at EP Side / Virtual PCI bus
|
|||
-----------------------------------------
|
||||
|
||||
Note that the devices listed here correspond to the values populated in
|
||||
"Creating pci-epf-ntb Device" section above::
|
||||
"Creating pci-epf-vntb Device" section above::
|
||||
|
||||
# lspci
|
||||
10:00.0 Unassigned class [ffff]: Dawicontrol Computersysteme GmbH Device 1234 (rev ff)
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ struct pci_epf_group {
|
|||
struct config_group group;
|
||||
struct config_group primary_epc_group;
|
||||
struct config_group secondary_epc_group;
|
||||
struct delayed_work cfs_work;
|
||||
struct pci_epf *epf;
|
||||
int index;
|
||||
};
|
||||
|
|
@ -69,8 +68,8 @@ static int pci_secondary_epc_epf_link(struct config_item *epf_item,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void pci_secondary_epc_epf_unlink(struct config_item *epc_item,
|
||||
struct config_item *epf_item)
|
||||
static void pci_secondary_epc_epf_unlink(struct config_item *epf_item,
|
||||
struct config_item *epc_item)
|
||||
{
|
||||
struct pci_epf_group *epf_group = to_pci_epf_group(epf_item->ci_parent);
|
||||
struct pci_epc_group *epc_group = to_pci_epc_group(epc_item);
|
||||
|
|
@ -103,7 +102,7 @@ static struct config_group
|
|||
secondary_epc_group = &epf_group->secondary_epc_group;
|
||||
config_group_init_type_name(secondary_epc_group, "secondary",
|
||||
&pci_secondary_epc_type);
|
||||
configfs_register_group(&epf_group->group, secondary_epc_group);
|
||||
configfs_add_default_group(secondary_epc_group, &epf_group->group);
|
||||
|
||||
return secondary_epc_group;
|
||||
}
|
||||
|
|
@ -133,8 +132,8 @@ static int pci_primary_epc_epf_link(struct config_item *epf_item,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void pci_primary_epc_epf_unlink(struct config_item *epc_item,
|
||||
struct config_item *epf_item)
|
||||
static void pci_primary_epc_epf_unlink(struct config_item *epf_item,
|
||||
struct config_item *epc_item)
|
||||
{
|
||||
struct pci_epf_group *epf_group = to_pci_epf_group(epf_item->ci_parent);
|
||||
struct pci_epc_group *epc_group = to_pci_epc_group(epc_item);
|
||||
|
|
@ -166,7 +165,7 @@ static struct config_group
|
|||
|
||||
config_group_init_type_name(primary_epc_group, "primary",
|
||||
&pci_primary_epc_type);
|
||||
configfs_register_group(&epf_group->group, primary_epc_group);
|
||||
configfs_add_default_group(primary_epc_group, &epf_group->group);
|
||||
|
||||
return primary_epc_group;
|
||||
}
|
||||
|
|
@ -570,15 +569,13 @@ static void pci_ep_cfs_add_type_group(struct pci_epf_group *epf_group)
|
|||
return;
|
||||
}
|
||||
|
||||
configfs_register_group(&epf_group->group, group);
|
||||
configfs_add_default_group(group, &epf_group->group);
|
||||
}
|
||||
|
||||
static void pci_epf_cfs_work(struct work_struct *work)
|
||||
static void pci_epf_cfs_add_sub_groups(struct pci_epf_group *epf_group)
|
||||
{
|
||||
struct pci_epf_group *epf_group;
|
||||
struct config_group *group;
|
||||
|
||||
epf_group = container_of(work, struct pci_epf_group, cfs_work.work);
|
||||
group = pci_ep_cfs_add_primary_group(epf_group);
|
||||
if (IS_ERR(group)) {
|
||||
pr_err("failed to create 'primary' EPC interface\n");
|
||||
|
|
@ -637,9 +634,7 @@ static struct config_group *pci_epf_make(struct config_group *group,
|
|||
|
||||
kfree(epf_name);
|
||||
|
||||
INIT_DELAYED_WORK(&epf_group->cfs_work, pci_epf_cfs_work);
|
||||
queue_delayed_work(system_wq, &epf_group->cfs_work,
|
||||
msecs_to_jiffies(1));
|
||||
pci_epf_cfs_add_sub_groups(epf_group);
|
||||
|
||||
return &epf_group->group;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user