mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
Revert "PCI: endpoint: Use a separate lock for protecting epc->pci_epf list"
This reverts commit9102582762which is commitd6dd5bafaaupstream. It breaks the Android kernel abi and can be brought back in the future in an abi-safe way if it is really needed. Bug: 161946584 Change-Id: I9446f192e30f403cb3e9ea377f566e076aa73604 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
@@ -613,7 +613,7 @@ int pci_epc_add_epf(struct pci_epc *epc, struct pci_epf *epf,
|
|||||||
if (type == SECONDARY_INTERFACE && epf->sec_epc)
|
if (type == SECONDARY_INTERFACE && epf->sec_epc)
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
|
|
||||||
mutex_lock(&epc->list_lock);
|
mutex_lock(&epc->lock);
|
||||||
func_no = find_first_zero_bit(&epc->function_num_map,
|
func_no = find_first_zero_bit(&epc->function_num_map,
|
||||||
BITS_PER_LONG);
|
BITS_PER_LONG);
|
||||||
if (func_no >= BITS_PER_LONG) {
|
if (func_no >= BITS_PER_LONG) {
|
||||||
@@ -640,7 +640,7 @@ int pci_epc_add_epf(struct pci_epc *epc, struct pci_epf *epf,
|
|||||||
|
|
||||||
list_add_tail(list, &epc->pci_epf);
|
list_add_tail(list, &epc->pci_epf);
|
||||||
ret:
|
ret:
|
||||||
mutex_unlock(&epc->list_lock);
|
mutex_unlock(&epc->lock);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -672,11 +672,11 @@ void pci_epc_remove_epf(struct pci_epc *epc, struct pci_epf *epf,
|
|||||||
list = &epf->sec_epc_list;
|
list = &epf->sec_epc_list;
|
||||||
}
|
}
|
||||||
|
|
||||||
mutex_lock(&epc->list_lock);
|
mutex_lock(&epc->lock);
|
||||||
clear_bit(func_no, &epc->function_num_map);
|
clear_bit(func_no, &epc->function_num_map);
|
||||||
list_del(list);
|
list_del(list);
|
||||||
epf->epc = NULL;
|
epf->epc = NULL;
|
||||||
mutex_unlock(&epc->list_lock);
|
mutex_unlock(&epc->lock);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(pci_epc_remove_epf);
|
EXPORT_SYMBOL_GPL(pci_epc_remove_epf);
|
||||||
|
|
||||||
@@ -773,7 +773,6 @@ __pci_epc_create(struct device *dev, const struct pci_epc_ops *ops,
|
|||||||
}
|
}
|
||||||
|
|
||||||
mutex_init(&epc->lock);
|
mutex_init(&epc->lock);
|
||||||
mutex_init(&epc->list_lock);
|
|
||||||
INIT_LIST_HEAD(&epc->pci_epf);
|
INIT_LIST_HEAD(&epc->pci_epf);
|
||||||
ATOMIC_INIT_NOTIFIER_HEAD(&epc->notifier);
|
ATOMIC_INIT_NOTIFIER_HEAD(&epc->notifier);
|
||||||
|
|
||||||
|
|||||||
@@ -122,7 +122,6 @@ struct pci_epc_mem {
|
|||||||
* struct pci_epc - represents the PCI EPC device
|
* struct pci_epc - represents the PCI EPC device
|
||||||
* @dev: PCI EPC device
|
* @dev: PCI EPC device
|
||||||
* @pci_epf: list of endpoint functions present in this EPC device
|
* @pci_epf: list of endpoint functions present in this EPC device
|
||||||
* list_lock: Mutex for protecting pci_epf list
|
|
||||||
* @ops: function pointers for performing endpoint operations
|
* @ops: function pointers for performing endpoint operations
|
||||||
* @windows: array of address space of the endpoint controller
|
* @windows: array of address space of the endpoint controller
|
||||||
* @mem: first window of the endpoint controller, which corresponds to
|
* @mem: first window of the endpoint controller, which corresponds to
|
||||||
@@ -140,7 +139,6 @@ struct pci_epc_mem {
|
|||||||
struct pci_epc {
|
struct pci_epc {
|
||||||
struct device dev;
|
struct device dev;
|
||||||
struct list_head pci_epf;
|
struct list_head pci_epf;
|
||||||
struct mutex list_lock;
|
|
||||||
const struct pci_epc_ops *ops;
|
const struct pci_epc_ops *ops;
|
||||||
struct pci_epc_mem **windows;
|
struct pci_epc_mem **windows;
|
||||||
struct pci_epc_mem *mem;
|
struct pci_epc_mem *mem;
|
||||||
|
|||||||
Reference in New Issue
Block a user