Lines Matching full:window
104 /* Default DMA window table is at index 0, while DDW at 1. SR-IOV in iommu_pseries_free_group()
379 /* Dynamic DMA Window support */
394 /* prevents races between memory on/offline and window creation */
396 /* protects initializing window twice for same device */
643 /* Calculate amount of DMA window per slot. Each window must be in pci_dma_bus_setup_pSeries()
650 /* No ISA/IDE - just set window size and return */ in pci_dma_bus_setup_pSeries()
655 pr_debug("No ISA/IDE, window size is 0x%llx\n", in pci_dma_bus_setup_pSeries()
683 pr_debug("ISA/IDE, window size is 0x%llx\n", pci->phb->dma_window_size); in pci_dma_bus_setup_pSeries()
723 * Find nearest ibm,dma-window (default DMA window) or direct DMA window or
724 * dynamic 64bit DMA window, walking up the device tree.
732 dw = of_get_property(dn, "ibm,dma-window", NULL); in pci_dma_find()
764 pr_debug(" no ibm,dma-window property !\n"); in pci_dma_bus_setup_pSeriesLP()
799 * the window sizes already. in pci_dma_dev_setup_pSeries()
850 pr_warn("%pOF failed to clear tces in window.\n", in clean_dma_window()
853 pr_debug("%pOF successfully cleared tces in window.\n", in clean_dma_window()
858 * Call only if DMA window is clean.
866 pr_warn("%pOF: failed to remove DMA window: rtas returned " in __remove_dma_window()
867 "%d to ibm,remove-pe-dma-window(%x) %llx\n", in __remove_dma_window()
870 pr_debug("%pOF: successfully removed DMA window: rtas returned " in __remove_dma_window()
871 "%d to ibm,remove-pe-dma-window(%x) %llx\n", in __remove_dma_window()
912 pr_warn("%pOF: failed to remove DMA window property: %d\n", in remove_ddw()
919 struct dma_win *window; in find_existing_ddw() local
924 /* check if we already created a window and dupe that config if so */ in find_existing_ddw()
925 list_for_each_entry(window, &dma_win_list, list) { in find_existing_ddw()
926 if (window->device == pdn) { in find_existing_ddw()
927 dma64 = window->prop; in find_existing_ddw()
942 struct dma_win *window; in ddw_list_new_entry() local
944 window = kzalloc(sizeof(*window), GFP_KERNEL); in ddw_list_new_entry()
945 if (!window) in ddw_list_new_entry()
948 window->device = pdn; in ddw_list_new_entry()
949 window->prop = dma64; in ddw_list_new_entry()
950 window->direct = false; in ddw_list_new_entry()
952 return window; in ddw_list_new_entry()
959 struct dma_win *window; in find_existing_ddw_windows_named() local
969 window = ddw_list_new_entry(pdn, dma64); in find_existing_ddw_windows_named()
970 if (!window) { in find_existing_ddw_windows_named()
976 list_add(&window->list, &dma_win_list); in find_existing_ddw_windows_named()
1051 * Get the config address and phb buid of the PE window. in query_ddw()
1054 * dma-window property in query_ddw()
1099 * Get the config address and phb buid of the PE window. in create_ddw()
1102 * dma-window property in create_ddw()
1116 "ibm,create-pe-dma-window(%x) %x %x %x %x %x returned %d " in create_ddw()
1153 * That rtas-call can be used to restore the default DMA window for the device.
1181 /* Return largest page shift based on "IO Page Sizes" output of ibm,query-pe-dma-window. */
1195 * On LoPAR, ibm,query-pe-dma-window outputs "IO Page Sizes" using a bit field: in iommu_get_page_shift()
1244 * Future: also check if we can remap the base window for our base page size
1259 struct dma_win *window; in enable_ddw() local
1281 * DMA window again, as it will race with in-flight operations in enable_ddw()
1292 * ibm,query-pe-dma-window in enable_ddw()
1293 * ibm,create-pe-dma-window in enable_ddw()
1294 * ibm,remove-pe-dma-window in enable_ddw()
1304 * Query if there is a second window of size to map the in enable_ddw()
1315 * If there is no window available, remove the default DMA window, in enable_ddw()
1317 * new DDW window. in enable_ddw()
1324 /* DDW + IOMMU on single window may fail if there is any allocation */ in enable_ddw()
1330 default_win = of_find_property(pdn, "ibm,dma-window", NULL); in enable_ddw()
1341 /* Query again, to check if the window is available */ in enable_ddw()
1411 dev_err(&dev->dev, "unable to add DMA window property for %pOF: %d", in enable_ddw()
1416 window = ddw_list_new_entry(pdn, win64->value); in enable_ddw()
1417 if (!window) in enable_ddw()
1421 window->direct = true; in enable_ddw()
1427 dev_info(&dev->dev, "failed to map DMA window for %pOF: %d\n", in enable_ddw()
1439 window->direct = false; in enable_ddw()
1452 /* New table for using DDW instead of the default DMA window */ in enable_ddw()
1474 dev_info(&dev->dev, "Removed default DMA window for %pOF\n", pdn); in enable_ddw()
1478 list_add(&window->list, &dma_win_list); in enable_ddw()
1485 kfree(window); in enable_ddw()
1513 * If we have persistent memory and the window size is only as big in enable_ddw()
1514 * as RAM, then we failed to create a window to cover persistent in enable_ddw()
1533 * contain the dma-window properties per-device and not necessarily in pci_dma_dev_setup_pSeriesLP()
1535 * either hit a dma-window property, OR find a parent with a table in pci_dma_dev_setup_pSeriesLP()
1544 "no DMA window found for pci dev=%s dn=%pOF\n", in pci_dma_dev_setup_pSeriesLP()
1562 pr_debug(" found DMA window, table: %p\n", pci->table_group); in pci_dma_dev_setup_pSeriesLP()
1573 /* only attempt to use a new window if 64-bit DMA is requested */ in iommu_bypass_supported_pSeriesLP()
1580 * the device tree might contain the dma-window properties in iommu_bypass_supported_pSeriesLP()
1582 * search upwards in the tree until we either hit a dma-window in iommu_bypass_supported_pSeriesLP()
1595 struct dma_win *window; in iommu_mem_notifier() local
1602 list_for_each_entry(window, &dma_win_list, list) { in iommu_mem_notifier()
1603 if (window->direct) { in iommu_mem_notifier()
1605 arg->nr_pages, window->prop); in iommu_mem_notifier()
1614 list_for_each_entry(window, &dma_win_list, list) { in iommu_mem_notifier()
1615 if (window->direct) { in iommu_mem_notifier()
1617 arg->nr_pages, window->prop); in iommu_mem_notifier()
1642 struct dma_win *window; in iommu_reconfig_notifier() local
1661 list_for_each_entry(window, &dma_win_list, list) { in iommu_reconfig_notifier()
1662 if (window->device == np) { in iommu_reconfig_notifier()
1663 list_del(&window->list); in iommu_reconfig_notifier()
1664 kfree(window); in iommu_reconfig_notifier()