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 'powerpc-5.15-6' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

Pull powerpc fixes from Michael Ellerman:
"Three commits fixing some issues introduced with the recent IOMMU
changes we merged.

Thanks to Alexey Kardashevskiy"

* tag 'powerpc-5.15-6' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
powerpc/pseries/iommu: Create huge DMA window if no MMIO32 is present
powerpc/pseries/iommu: Check if the default window in use before removing it
powerpc/pseries/iommu: Use correct vfree for it_map

+14 -13
+14 -13
arch/powerpc/platforms/pseries/iommu.c
··· 1302 1302 struct property *default_win; 1303 1303 int reset_win_ext; 1304 1304 1305 + /* DDW + IOMMU on single window may fail if there is any allocation */ 1306 + if (iommu_table_in_use(tbl)) { 1307 + dev_warn(&dev->dev, "current IOMMU table in use, can't be replaced.\n"); 1308 + goto out_failed; 1309 + } 1310 + 1305 1311 default_win = of_find_property(pdn, "ibm,dma-window", NULL); 1306 1312 if (!default_win) 1307 1313 goto out_failed; ··· 1362 1356 query.largest_available_block, 1363 1357 1ULL << page_shift); 1364 1358 1365 - /* DDW + IOMMU on single window may fail if there is any allocation */ 1366 - if (default_win_removed && iommu_table_in_use(tbl)) { 1367 - dev_dbg(&dev->dev, "current IOMMU table in use, can't be replaced.\n"); 1368 - goto out_failed; 1369 - } 1370 - 1371 1359 len = order_base_2(query.largest_available_block << page_shift); 1372 1360 win_name = DMA64_PROPNAME; 1373 1361 } else { ··· 1411 1411 } else { 1412 1412 struct iommu_table *newtbl; 1413 1413 int i; 1414 + unsigned long start = 0, end = 0; 1414 1415 1415 1416 for (i = 0; i < ARRAY_SIZE(pci->phb->mem_resources); i++) { 1416 1417 const unsigned long mask = IORESOURCE_MEM_64 | IORESOURCE_MEM; 1417 1418 1418 1419 /* Look for MMIO32 */ 1419 - if ((pci->phb->mem_resources[i].flags & mask) == IORESOURCE_MEM) 1420 + if ((pci->phb->mem_resources[i].flags & mask) == IORESOURCE_MEM) { 1421 + start = pci->phb->mem_resources[i].start; 1422 + end = pci->phb->mem_resources[i].end; 1420 1423 break; 1424 + } 1421 1425 } 1422 - 1423 - if (i == ARRAY_SIZE(pci->phb->mem_resources)) 1424 - goto out_del_list; 1425 1426 1426 1427 /* New table for using DDW instead of the default DMA window */ 1427 1428 newtbl = iommu_pseries_alloc_table(pci->phb->node); ··· 1433 1432 1434 1433 iommu_table_setparms_common(newtbl, pci->phb->bus->number, create.liobn, win_addr, 1435 1434 1UL << len, page_shift, NULL, &iommu_table_lpar_multi_ops); 1436 - iommu_init_table(newtbl, pci->phb->node, pci->phb->mem_resources[i].start, 1437 - pci->phb->mem_resources[i].end); 1435 + iommu_init_table(newtbl, pci->phb->node, start, end); 1438 1436 1439 1437 pci->table_group->tables[1] = newtbl; 1440 1438 1441 1439 /* Keep default DMA window stuct if removed */ 1442 1440 if (default_win_removed) { 1443 1441 tbl->it_size = 0; 1444 - kfree(tbl->it_map); 1442 + vfree(tbl->it_map); 1443 + tbl->it_map = NULL; 1445 1444 } 1446 1445 1447 1446 set_iommu_table_base(&dev->dev, newtbl);