Patch "ACPI: VIOT: Initialize the correct IOMMU fwspec" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    ACPI: VIOT: Initialize the correct IOMMU fwspec

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     acpi-viot-initialize-the-correct-iommu-fwspec.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 6abfe52e493c34316f447daa6df224b2b2646d37
Author: Jean-Philippe Brucker <jean-philippe@xxxxxxxxxx>
Date:   Mon Mar 20 18:05:29 2023 +0000

    ACPI: VIOT: Initialize the correct IOMMU fwspec
    
    [ Upstream commit 47d26684185d09e083669bbbd0c465ab3493a51f ]
    
    When setting up DMA for a PCI device, we need to initialize its
    iommu_fwspec with all possible alias RIDs (such as PCI bridges). To do
    this we use pci_for_each_dma_alias() which calls
    viot_pci_dev_iommu_init(). This function incorrectly initializes the
    fwspec of the bridge instead of the device being configured. Fix it by
    passing the original device as context to pci_for_each_dma_alias().
    
    Fixes: 3cf485540e7b ("ACPI: Add driver for the VIOT table")
    Link: https://lore.kernel.org/all/Y8qzOKm6kvhGWG1T@myrica
    Reported-by: Eric Auger <eric.auger@xxxxxxxxxx>
    Signed-off-by: Jean-Philippe Brucker <jean-philippe@xxxxxxxxxx>
    Reviewed-by: Eric Auger <eric.auger@xxxxxxxxxx>
    Tested-by: Eric Auger <eric.auger@xxxxxxxxxx>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/acpi/viot.c b/drivers/acpi/viot.c
index 647f11cf165d7..fe4b66dae01b5 100644
--- a/drivers/acpi/viot.c
+++ b/drivers/acpi/viot.c
@@ -329,6 +329,7 @@ static int viot_pci_dev_iommu_init(struct pci_dev *pdev, u16 dev_id, void *data)
 {
 	u32 epid;
 	struct viot_endpoint *ep;
+	struct device *aliased_dev = data;
 	u32 domain_nr = pci_domain_nr(pdev->bus);
 
 	list_for_each_entry(ep, &viot_pci_ranges, list) {
@@ -339,7 +340,7 @@ static int viot_pci_dev_iommu_init(struct pci_dev *pdev, u16 dev_id, void *data)
 			epid = ((domain_nr - ep->segment_start) << 16) +
 				dev_id - ep->bdf_start + ep->endpoint_id;
 
-			return viot_dev_iommu_init(&pdev->dev, ep->viommu,
+			return viot_dev_iommu_init(aliased_dev, ep->viommu,
 						   epid);
 		}
 	}
@@ -373,7 +374,7 @@ int viot_iommu_configure(struct device *dev)
 {
 	if (dev_is_pci(dev))
 		return pci_for_each_dma_alias(to_pci_dev(dev),
-					      viot_pci_dev_iommu_init, NULL);
+					      viot_pci_dev_iommu_init, dev);
 	else if (dev_is_platform(dev))
 		return viot_mmio_dev_iommu_init(to_platform_device(dev));
 	return -ENODEV;



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux