[PATCH v2] nitro_enclaves: Set Bus Master for the NE PCI device

From: Longpeng(Mike)
Date: Sun Jun 20 2021 - 21:04:10 EST


Enable Bus Master for the NE PCI device, according to the PCI spec
for submitting memory or I/O requests:

Master Enable – Controls the ability of a PCI Express
Endpoint to issue Memory and I/O Read/Write Requests, and
the ability of a Root or Switch Port to forward Memory and
I/O Read/Write Requests in the Upstream direction

Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
Cc: Andra Paraschiv <andraprs@xxxxxxxxxx>
Cc: Alexandru Vasile <lexnv@xxxxxxxxxx>
Cc: Alexandru Ciobotaru <alcioa@xxxxxxxxxx>
Signed-off-by: Longpeng(Mike) <longpeng2@xxxxxxxxxx>
---
Changes since v1:
- update the commit message. [Andra]
---
drivers/virt/nitro_enclaves/ne_pci_dev.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/virt/nitro_enclaves/ne_pci_dev.c b/drivers/virt/nitro_enclaves/ne_pci_dev.c
index b9c1de4..143207e 100644
--- a/drivers/virt/nitro_enclaves/ne_pci_dev.c
+++ b/drivers/virt/nitro_enclaves/ne_pci_dev.c
@@ -480,6 +480,8 @@ static int ne_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
goto free_ne_pci_dev;
}

+ pci_set_master(pdev);
+
rc = pci_request_regions_exclusive(pdev, "nitro_enclaves");
if (rc < 0) {
dev_err(&pdev->dev, "Error in pci request regions [rc=%d]\n", rc);
--
1.8.3.1