]> git.baikalelectronics.ru Git - kernel.git/commit
PCI: endpoint: Fix for concurrent memory allocation in OB address region
authorKishon Vijay Abraham I <kishon@ti.com>
Mon, 24 Feb 2020 09:53:36 +0000 (15:23 +0530)
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Mon, 24 Feb 2020 10:13:48 +0000 (10:13 +0000)
commit6ffaf3fb6d5204d23f22f6e57333dc2760fb514f
tree507d2a04ccefe9eb00f775f9fd408ba966a0f57e
parentacb7c5b5a2c56b7d9c7a2e80d21e9d27a38ef0c9
PCI: endpoint: Fix for concurrent memory allocation in OB address region

pci-epc-mem uses a bitmap to manage the Endpoint outbound (OB) address
region. This address region will be shared by multiple endpoint
functions (in the case of multi function endpoint) and it has to be
protected from concurrent access to avoid updating an inconsistent state.

Use a mutex to protect bitmap updates to prevent the memory
allocation API from returning incorrect addresses.

Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: stable@vger.kernel.org # v4.14+
drivers/pci/endpoint/pci-epc-mem.c
include/linux/pci-epc.h