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 */
620 /* Calculate amount of DMA window per slot. Each window must be in pci_dma_bus_setup_pSeries()
627 /* No ISA/IDE - just set window size and return */ in pci_dma_bus_setup_pSeries()
632 pr_debug("No ISA/IDE, window size is 0x%llx\n", in pci_dma_bus_setup_pSeries()
660 pr_debug("ISA/IDE, window size is 0x%llx\n", pci->phb->dma_window_size); in pci_dma_bus_setup_pSeries()
700 * Find nearest ibm,dma-window (default DMA window) or direct DMA window or
701 * dynamic 64bit DMA window, walking up the device tree.
712 default_prop = of_get_property(dn, "ibm,dma-window", NULL); in pci_dma_find()
730 /* At least found default window, which is the case for normal boot */ in pci_dma_find()
735 /* For PCI devices there will always be a DMA window, either on the device in pci_dma_find()
740 /* caller doesn't want to get DMA window property */ in pci_dma_find()
744 /* parse DMA window property. During normal system boot, only default in pci_dma_find()
745 * DMA window is passed in OF. But, for kdump, a dedicated adapter might in pci_dma_find()
747 * over default window. in pci_dma_find()
785 /* In PPC architecture, there will always be DMA window on bus or one of the in pci_dma_bus_setup_pSeriesLP()
786 * parent bus. During reboot, there will be ibm,dma-window property to in pci_dma_bus_setup_pSeriesLP()
787 * define DMA window. For kdump, there will at least be default window or DDW in pci_dma_bus_setup_pSeriesLP()
807 /* Only for normal boot with default window. Doesn't matter even in pci_dma_bus_setup_pSeriesLP()
835 * the window sizes already. in pci_dma_dev_setup_pSeries()
886 pr_warn("%pOF failed to clear tces in window.\n", in clean_dma_window()
889 pr_debug("%pOF successfully cleared tces in window.\n", in clean_dma_window()
894 * Call only if DMA window is clean.
902 pr_warn("%pOF: failed to remove DMA window: rtas returned " in __remove_dma_window()
903 "%d to ibm,remove-pe-dma-window(%x) %llx\n", in __remove_dma_window()
906 pr_debug("%pOF: successfully removed DMA window: rtas returned " in __remove_dma_window()
907 "%d to ibm,remove-pe-dma-window(%x) %llx\n", in __remove_dma_window()
948 pr_warn("%pOF: failed to remove DMA window property: %d\n", in remove_ddw()
956 struct dma_win *window; in find_existing_ddw() local
961 /* check if we already created a window and dupe that config if so */ in find_existing_ddw()
962 list_for_each_entry(window, &dma_win_list, list) { in find_existing_ddw()
963 if (window->device == pdn) { in find_existing_ddw()
964 dma64 = window->prop; in find_existing_ddw()
967 *direct_mapping = window->direct; in find_existing_ddw()
980 struct dma_win *window; in ddw_list_new_entry() local
982 window = kzalloc(sizeof(*window), GFP_KERNEL); in ddw_list_new_entry()
983 if (!window) in ddw_list_new_entry()
986 window->device = pdn; in ddw_list_new_entry()
987 window->prop = dma64; in ddw_list_new_entry()
988 window->direct = false; in ddw_list_new_entry()
990 return window; in ddw_list_new_entry()
997 struct dma_win *window; in find_existing_ddw_windows_named() local
1011 * set window->direct = false. in find_existing_ddw_windows_named()
1013 window = ddw_list_new_entry(pdn, dma64); in find_existing_ddw_windows_named()
1014 if (!window) { in find_existing_ddw_windows_named()
1020 list_add(&window->list, &dma_win_list); in find_existing_ddw_windows_named()
1095 * Get the config address and phb buid of the PE window. in query_ddw()
1098 * dma-window property in query_ddw()
1143 * Get the config address and phb buid of the PE window. in create_ddw()
1146 * dma-window property in create_ddw()
1160 "ibm,create-pe-dma-window(%x) %x %x %x %x %x returned %d " in create_ddw()
1197 * That rtas-call can be used to restore the default DMA window for the device.
1225 /* Return largest page shift based on "IO Page Sizes" output of ibm,query-pe-dma-window. */
1239 * On LoPAR, ibm,query-pe-dma-window outputs "IO Page Sizes" using a bit field: in iommu_get_page_shift()
1288 * Future: also check if we can remap the base window for our base page size
1303 struct dma_win *window; in enable_ddw() local
1323 * DMA window again, as it will race with in-flight operations in enable_ddw()
1334 * ibm,query-pe-dma-window in enable_ddw()
1335 * ibm,create-pe-dma-window in enable_ddw()
1336 * ibm,remove-pe-dma-window in enable_ddw()
1346 * Query if there is a second window of size to map the in enable_ddw()
1357 * If there is no window available, remove the default DMA window, in enable_ddw()
1359 * new DDW window. in enable_ddw()
1366 /* DDW + IOMMU on single window may fail if there is any allocation */ in enable_ddw()
1372 default_win = of_find_property(pdn, "ibm,dma-window", NULL); in enable_ddw()
1383 /* Query again, to check if the window is available */ in enable_ddw()
1453 dev_err(&dev->dev, "unable to add DMA window property for %pOF: %d", in enable_ddw()
1458 window = ddw_list_new_entry(pdn, win64->value); in enable_ddw()
1459 if (!window) in enable_ddw()
1463 window->direct = true; in enable_ddw()
1469 dev_info(&dev->dev, "failed to map DMA window for %pOF: %d\n", in enable_ddw()
1481 window->direct = false; in enable_ddw()
1494 /* New table for using DDW instead of the default DMA window */ in enable_ddw()
1516 dev_info(&dev->dev, "Removed default DMA window for %pOF\n", pdn); in enable_ddw()
1520 list_add(&window->list, &dma_win_list); in enable_ddw()
1527 kfree(window); in enable_ddw()
1555 * If we have persistent memory and the window size is only as big in enable_ddw()
1556 * as RAM, then we failed to create a window to cover persistent in enable_ddw()
1575 * contain the dma-window properties per-device and not necessarily in pci_dma_dev_setup_pSeriesLP()
1577 * either hit a dma-window property, OR find a parent with a table in pci_dma_dev_setup_pSeriesLP()
1586 "no DMA window found for pci dev=%s dn=%pOF\n", in pci_dma_dev_setup_pSeriesLP()
1604 /* Only for normal boot with default window. Doesn't matter even in pci_dma_dev_setup_pSeriesLP()
1616 pr_debug(" found DMA window, table: %p\n", pci->table_group); in pci_dma_dev_setup_pSeriesLP()
1627 /* only attempt to use a new window if 64-bit DMA is requested */ in iommu_bypass_supported_pSeriesLP()
1634 * the device tree might contain the dma-window properties in iommu_bypass_supported_pSeriesLP()
1636 * search upwards in the tree until we either hit a dma-window in iommu_bypass_supported_pSeriesLP()
1649 struct dma_win *window; in iommu_mem_notifier() local
1656 list_for_each_entry(window, &dma_win_list, list) { in iommu_mem_notifier()
1657 if (window->direct) { in iommu_mem_notifier()
1659 arg->nr_pages, window->prop); in iommu_mem_notifier()
1668 list_for_each_entry(window, &dma_win_list, list) { in iommu_mem_notifier()
1669 if (window->direct) { in iommu_mem_notifier()
1671 arg->nr_pages, window->prop); in iommu_mem_notifier()
1696 struct dma_win *window; in iommu_reconfig_notifier() local
1715 list_for_each_entry(window, &dma_win_list, list) { in iommu_reconfig_notifier()
1716 if (window->device == np) { in iommu_reconfig_notifier()
1717 list_del(&window->list); in iommu_reconfig_notifier()
1718 kfree(window); in iommu_reconfig_notifier()