From: Ben Hutchings Date: Wed, 12 Jun 2013 17:09:08 +0000 (+0100) Subject: sfc: Improve test for IOMMU in use X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=636d73da27e83ce4882f8823f79063bb37980961;p=linux-beck.git sfc: Improve test for IOMMU in use The device::iommu_group field may be set even if no IOMMU is in use. iommu_present() is still a better indicator, although it doesn't tell us whether *our* device is affected. Reported-by: Alex Williamson Signed-off-by: Ben Hutchings --- diff --git a/drivers/net/ethernet/sfc/rx.c b/drivers/net/ethernet/sfc/rx.c index 5c45118cc03a..65646cd7af8e 100644 --- a/drivers/net/ethernet/sfc/rx.c +++ b/drivers/net/ethernet/sfc/rx.c @@ -677,7 +677,7 @@ static void efx_init_rx_recycle_ring(struct efx_nic *efx, #ifdef CONFIG_PPC64 bufs_in_recycle_ring = EFX_RECYCLE_RING_SIZE_IOMMU; #else - if (efx->pci_dev->dev.iommu_group) + if (iommu_present(&pci_bus_type)) bufs_in_recycle_ring = EFX_RECYCLE_RING_SIZE_IOMMU; else bufs_in_recycle_ring = EFX_RECYCLE_RING_SIZE_NOIOMMU;