habanalabs/gaudi: always use single-msi mode
authorOded Gabbay <ogabbay@kernel.org>
Mon, 8 Mar 2021 16:06:57 +0000 (18:06 +0200)
committerOded Gabbay <ogabbay@kernel.org>
Fri, 9 Apr 2021 11:09:23 +0000 (14:09 +0300)
The device can get into deadlock in case it use indirect mode for MSI
interrupts (multi-msi) and have hard-reset during interrupt storm.

To prevent that, always use direct mode which means single-msi mode.

The F/W will prevent the host from writing to the indirect MSI
registers to prevent any malicious user from causing this scenario.

Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/misc/habanalabs/gaudi/gaudi.c

index 099c51350be64935a787a6611b4b0f3d887f0028..0bcee675e1db0a6d434204e5b2a30e8824fe0e2d 100644 (file)
@@ -1766,8 +1766,7 @@ static int gaudi_enable_msi(struct hl_device *hdev)
        if (gaudi->hw_cap_initialized & HW_CAP_MSI)
                return 0;
 
-       rc = pci_alloc_irq_vectors(hdev->pdev, 1, GAUDI_MSI_ENTRIES,
-                                       PCI_IRQ_MSI);
+       rc = pci_alloc_irq_vectors(hdev->pdev, 1, 1, PCI_IRQ_MSI);
        if (rc < 0) {
                dev_err(hdev->dev, "MSI: Failed to enable support %d\n", rc);
                return rc;