[PATCH 2/9] nitro_enclaves: Set Bus Master for the NE PCI device

Tim Gardner tim.gardner at canonical.com
Thu Dec 2 13:46:15 UTC 2021


From: "Longpeng(Mike)" <longpeng2 at huawei.com>

BugLink: https://bugs.launchpad.net/bugs/1951873

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: Andra Paraschiv <andraprs at amazon.com>
Cc: Alexandru Vasile <lexnv at amazon.com>
Cc: Alexandru Ciobotaru <alcioa at amazon.com>
Reviewed-by: Andra Paraschiv <andraprs at amazon.com>
Signed-off-by: Longpeng(Mike) <longpeng2 at huawei.com>
Link: https://lore.kernel.org/r/20210621004046.1419-1-longpeng2@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
(cherry picked from commit d874742f6a734c73c22235f9d56b8f10bcf17c5f)
Signed-off-by: Tim Gardner <tim.gardner at canonical.com>
---
 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 b9c1de41e300..143207e9b969 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);
-- 
2.34.1




More information about the kernel-team mailing list