Skip to contentSkip to conversation

nitro_enclaves: Set Bus Master for the NE PCI device

PATCH In review Longpeng(Mike) 2 participants 2 messages Jun 21, 2021 Nitro enclaves (ne)

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 nitro_enclaves: Set Bus Master for the NE PCI device

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 <[email protected]>
Cc Andra Paraschiv <[email protected]>
Cc Alexandru Vasile <[email protected]>
Cc Alexandru Ciobotaru <[email protected]>

---
Changes since v1:
- update the commit message. [Andra]

---
 drivers/virt/nitro_enclaves/ne_pci_dev.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/virt/nitro_enclaves/ne_pci_dev.c +2 -0
index b9c1de4..143207e 100644
@@ -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);
Signature · 1 line
1.8.3.1
Reviewed-by on v2 1/1
#1 lore raw
Quoted 34 lines · Longpeng(Mike)

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 <[email protected]>
Cc Andra Paraschiv <[email protected]>
Cc Alexandru Vasile <[email protected]>
Cc Alexandru Ciobotaru <[email protected]>

---
Changes since v1:
- update the commit message. [Andra]

---
  drivers/virt/nitro_enclaves/ne_pci_dev.c | 2 ++
  1 file changed, 2 insertions(+)
drivers/virt/nitro_enclaves/ne_pci_dev.c +2 -1
index b9c1de4..143207e 100644
@@ -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);
--
Quoted 2 lines

1.8.3.1

Thank you.

Andra

Amazon Development Center (Romania) S.R.L. registered office: 27A Sf. Lazar Street, UBC5, floor 2, Iasi, Iasi County, 700045, Romania. Registered in Romania. Registration number J22/2621/2005.