PCI: endpoint: Replace spinlock with mutex

The pci_epc_ops is not intended to be invoked from interrupt context.
Hence replace spin_lock_irqsave and spin_unlock_irqrestore with
mutex_lock and mutex_unlock respectively.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
This commit is contained in:
Kishon Vijay Abraham I
2020-02-24 15:23:35 +05:30
committed by Lorenzo Pieralisi
parent 5779dd0a7d
commit 3d3248dbd0
2 changed files with 34 additions and 54 deletions

View File

@@ -88,7 +88,7 @@ struct pci_epc_mem {
* @mem: address space of the endpoint controller
* @max_functions: max number of functions that can be configured in this EPC
* @group: configfs group representing the PCI EPC device
* @lock: spinlock to protect pci_epc ops
* @lock: mutex to protect pci_epc ops
* @notifier: used to notify EPF of any EPC events (like linkup)
*/
struct pci_epc {
@@ -98,8 +98,8 @@ struct pci_epc {
struct pci_epc_mem *mem;
u8 max_functions;
struct config_group *group;
/* spinlock to protect against concurrent access of EP controller */
spinlock_t lock;
/* mutex to protect against concurrent access of EP controller */
struct mutex lock;
struct atomic_notifier_head notifier;
};