summaryrefslogtreecommitdiff
path: root/drivers/iommu
diff options
context:
space:
mode:
authorVarun Sethi <Varun.Sethi@freescale.com>2014-05-12 09:52:05 (GMT)
committerJose Rivera <German.Rivera@freescale.com>2014-05-12 15:01:59 (GMT)
commitc0f9157e5a4258caebb673cf3519965d131940f6 (patch)
tree23300bffb10c722d06447b853b682879bb6ee904 /drivers/iommu
parent90a10eadd810121e9a4dca811b9ca232937e9ff2 (diff)
downloadlinux-fsl-qoriq-c0f9157e5a4258caebb673cf3519965d131940f6.tar.xz
iommu/fsl: Use pci_clear_master to disable device bus master capability.
Initially we were disabling the bus master capability by writing to the PCI configuration space. We were not clearing the "is_busmaster" flag. As a result when the device was assgined back to host, the bus master capability of the pci bridge (to which the device was connected) were not getting enabled. Once the device was assigned back to host, device was facing DMA issues. Now, we are using the pci_clear_master for disabling device bus master capability. This routine clears the device bus master capability by accessing the device configuration space and also clears the "is_busmaster" flag. Signed-off-by: Varun Sethi <Varun.Sethi@freescale.com> Change-Id: Icda6f5551d8da43bec8f2b657846b7e3f9474290 Reviewed-on: http://git.am.freescale.net:8181/12224 Reviewed-by: Stuart Yoder <stuart.yoder@freescale.com> Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Jose Rivera <German.Rivera@freescale.com>
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/fsl_pamu_domain.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domain.c
index 7b54922..360fbc4 100644
--- a/drivers/iommu/fsl_pamu_domain.c
+++ b/drivers/iommu/fsl_pamu_domain.c
@@ -373,15 +373,9 @@ static void disable_device_dma(struct device_domain_info *info,
#ifdef CONFIG_PCI
if (info->dev->bus == &pci_bus_type) {
struct pci_dev *pdev = NULL;
- u16 pci_command;
pdev = to_pci_dev(info->dev);
- pci_read_config_word(pdev, PCI_COMMAND, &pci_command);
- /* disable device bus master capability */
- if (pci_command & PCI_COMMAND_MASTER) {
- pci_command &= ~PCI_COMMAND_MASTER;
- pci_write_config_word(pdev, PCI_COMMAND, pci_command);
- }
+ pci_clear_master(pdev);
}
#endif