Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'iommu-fixes-v4.6-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu

Pull IOMMU fixes from Joerg Roedel:

- compile-time fixes (warnings and failures)

- a bug in iommu core code which could cause the group->domain pointer
to be falsly cleared

- fix in scatterlist handling of the ARM common DMA-API code

- stall detection fix for the Rockchip IOMMU driver

* tag 'iommu-fixes-v4.6-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
iommu/vt-d: Silence an uninitialized variable warning
iommu/rockchip: Fix "is stall active" check
iommu: Don't overwrite domain pointer when there is no default_domain
iommu/dma: Restore scatterlist offsets correctly
iommu: provide of_xlate pointer unconditionally

+9 -10
+2 -2
drivers/iommu/dma-iommu.c
··· 403 403 unsigned int s_length = sg_dma_len(s); 404 404 unsigned int s_dma_len = s->length; 405 405 406 - s->offset = s_offset; 406 + s->offset += s_offset; 407 407 s->length = s_length; 408 408 sg_dma_address(s) = dma_addr + s_offset; 409 409 dma_addr += s_dma_len; ··· 422 422 423 423 for_each_sg(sg, s, nents, i) { 424 424 if (sg_dma_address(s) != DMA_ERROR_CODE) 425 - s->offset = sg_dma_address(s); 425 + s->offset += sg_dma_address(s); 426 426 if (sg_dma_len(s)) 427 427 s->length = sg_dma_len(s); 428 428 sg_dma_address(s) = DMA_ERROR_CODE;
+1 -1
drivers/iommu/intel-iommu.c
··· 2458 2458 } 2459 2459 2460 2460 /* register PCI DMA alias device */ 2461 - if (req_id != dma_alias && dev_is_pci(dev)) { 2461 + if (dev_is_pci(dev) && req_id != dma_alias) { 2462 2462 tmp = dmar_insert_one_dev_info(iommu, PCI_BUS_NUM(dma_alias), 2463 2463 dma_alias & 0xff, NULL, domain); 2464 2464
+2 -1
drivers/iommu/iommu.c
··· 848 848 if (!group->default_domain) { 849 849 group->default_domain = __iommu_domain_alloc(dev->bus, 850 850 IOMMU_DOMAIN_DMA); 851 - group->domain = group->default_domain; 851 + if (!group->domain) 852 + group->domain = group->default_domain; 852 853 } 853 854 854 855 ret = iommu_group_add_device(group, dev);
+4 -4
drivers/iommu/rockchip-iommu.c
··· 315 315 int i; 316 316 317 317 for (i = 0; i < iommu->num_mmu; i++) 318 - active &= rk_iommu_read(iommu->bases[i], RK_MMU_STATUS) & 319 - RK_MMU_STATUS_STALL_ACTIVE; 318 + active &= !!(rk_iommu_read(iommu->bases[i], RK_MMU_STATUS) & 319 + RK_MMU_STATUS_STALL_ACTIVE); 320 320 321 321 return active; 322 322 } ··· 327 327 int i; 328 328 329 329 for (i = 0; i < iommu->num_mmu; i++) 330 - enable &= rk_iommu_read(iommu->bases[i], RK_MMU_STATUS) & 331 - RK_MMU_STATUS_PAGING_ENABLED; 330 + enable &= !!(rk_iommu_read(iommu->bases[i], RK_MMU_STATUS) & 331 + RK_MMU_STATUS_PAGING_ENABLED); 332 332 333 333 return enable; 334 334 }
-2
include/linux/iommu.h
··· 195 195 /* Get the number of windows per domain */ 196 196 u32 (*domain_get_windows)(struct iommu_domain *domain); 197 197 198 - #ifdef CONFIG_OF_IOMMU 199 198 int (*of_xlate)(struct device *dev, struct of_phandle_args *args); 200 - #endif 201 199 202 200 unsigned long pgsize_bitmap; 203 201 void *priv;