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()
790 * state, firmware may not provide ibm,dma-window property at the time in pci_dma_bus_setup_pSeriesLP()
795 pr_debug(" no ibm,dma-window property !\n"); in pci_dma_bus_setup_pSeriesLP()
815 /* Only for normal boot with default window. Doesn't matter even in pci_dma_bus_setup_pSeriesLP()
843 * the window sizes already. in pci_dma_dev_setup_pSeries()
894 pr_warn("%pOF failed to clear tces in window.\n", in clean_dma_window()
897 pr_debug("%pOF successfully cleared tces in window.\n", in clean_dma_window()
902 * Call only if DMA window is clean.
910 pr_warn("%pOF: failed to remove DMA window: rtas returned " in __remove_dma_window()
911 "%d to ibm,remove-pe-dma-window(%x) %llx\n", in __remove_dma_window()
914 pr_debug("%pOF: successfully removed DMA window: rtas returned " in __remove_dma_window()
915 "%d to ibm,remove-pe-dma-window(%x) %llx\n", in __remove_dma_window()
956 pr_warn("%pOF: failed to remove DMA window property: %d\n", in remove_ddw()
964 struct dma_win *window; in find_existing_ddw() local
969 /* check if we already created a window and dupe that config if so */ in find_existing_ddw()
970 list_for_each_entry(window, &dma_win_list, list) { in find_existing_ddw()
971 if (window->device == pdn) { in find_existing_ddw()
972 dma64 = window->prop; in find_existing_ddw()
975 *direct_mapping = window->direct; in find_existing_ddw()
988 struct dma_win *window; in ddw_list_new_entry() local
990 window = kzalloc(sizeof(*window), GFP_KERNEL); in ddw_list_new_entry()
991 if (!window) in ddw_list_new_entry()
994 window->device = pdn; in ddw_list_new_entry()
995 window->prop = dma64; in ddw_list_new_entry()
996 window->direct = false; in ddw_list_new_entry()
998 return window; in ddw_list_new_entry()
1005 struct dma_win *window; in find_existing_ddw_windows_named() local
1019 * set window->direct = false. in find_existing_ddw_windows_named()
1021 window = ddw_list_new_entry(pdn, dma64); in find_existing_ddw_windows_named()
1022 if (!window) { in find_existing_ddw_windows_named()
1028 list_add(&window->list, &dma_win_list); in find_existing_ddw_windows_named()
1103 * Get the config address and phb buid of the PE window. in query_ddw()
1106 * dma-window property in query_ddw()
1151 * Get the config address and phb buid of the PE window. in create_ddw()
1154 * dma-window property in create_ddw()
1168 "ibm,create-pe-dma-window(%x) %x %x %x %x %x returned %d " in create_ddw()
1201 * That rtas-call can be used to restore the default DMA window for the device.
1229 /* Return largest page shift based on "IO Page Sizes" output of ibm,query-pe-dma-window. */
1243 * On LoPAR, ibm,query-pe-dma-window outputs "IO Page Sizes" using a bit field: in iommu_get_page_shift()
1292 * Future: also check if we can remap the base window for our base page size
1307 struct dma_win *window; in enable_ddw() local
1327 * DMA window again, as it will race with in-flight operations in enable_ddw()
1338 * ibm,query-pe-dma-window in enable_ddw()
1339 * ibm,create-pe-dma-window in enable_ddw()
1340 * ibm,remove-pe-dma-window in enable_ddw()
1350 * Query if there is a second window of size to map the in enable_ddw()
1361 * If there is no window available, remove the default DMA window, in enable_ddw()
1363 * new DDW window. in enable_ddw()
1370 /* DDW + IOMMU on single window may fail if there is any allocation */ in enable_ddw()
1376 default_win = of_find_property(pdn, "ibm,dma-window", NULL); in enable_ddw()
1387 /* Query again, to check if the window is available */ in enable_ddw()
1457 dev_err(&dev->dev, "unable to add DMA window property for %pOF: %d", in enable_ddw()
1462 window = ddw_list_new_entry(pdn, win64->value); in enable_ddw()
1463 if (!window) in enable_ddw()
1467 window->direct = true; in enable_ddw()
1473 dev_info(&dev->dev, "failed to map DMA window for %pOF: %d\n", in enable_ddw()
1485 window->direct = false; in enable_ddw()
1498 /* New table for using DDW instead of the default DMA window */ in enable_ddw()
1520 dev_info(&dev->dev, "Removed default DMA window for %pOF\n", pdn); in enable_ddw()
1524 list_add(&window->list, &dma_win_list); in enable_ddw()
1531 kfree(window); in enable_ddw()
1559 * If we have persistent memory and the window size is only as big in enable_ddw()
1560 * as RAM, then we failed to create a window to cover persistent in enable_ddw()
1579 * contain the dma-window properties per-device and not necessarily in pci_dma_dev_setup_pSeriesLP()
1581 * either hit a dma-window property, OR find a parent with a table in pci_dma_dev_setup_pSeriesLP()
1590 "no DMA window found for pci dev=%s dn=%pOF\n", in pci_dma_dev_setup_pSeriesLP()
1608 /* Only for normal boot with default window. Doesn't matter even in pci_dma_dev_setup_pSeriesLP()
1620 pr_debug(" found DMA window, table: %p\n", pci->table_group); in pci_dma_dev_setup_pSeriesLP()
1631 /* only attempt to use a new window if 64-bit DMA is requested */ in iommu_bypass_supported_pSeriesLP()
1638 * the device tree might contain the dma-window properties in iommu_bypass_supported_pSeriesLP()
1640 * search upwards in the tree until we either hit a dma-window in iommu_bypass_supported_pSeriesLP()
1653 struct dma_win *window; in iommu_mem_notifier() local
1665 list_for_each_entry(window, &dma_win_list, list) { in iommu_mem_notifier()
1666 if (window->direct && (arg->start_pfn << PAGE_SHIFT) < in iommu_mem_notifier()
1669 arg->nr_pages, window->prop); in iommu_mem_notifier()
1678 list_for_each_entry(window, &dma_win_list, list) { in iommu_mem_notifier()
1679 if (window->direct && (arg->start_pfn << PAGE_SHIFT) < in iommu_mem_notifier()
1682 arg->nr_pages, window->prop); in iommu_mem_notifier()
1707 struct dma_win *window; in iommu_reconfig_notifier() local
1726 list_for_each_entry(window, &dma_win_list, list) { in iommu_reconfig_notifier()
1727 if (window->device == np) { in iommu_reconfig_notifier()
1728 list_del(&window->list); in iommu_reconfig_notifier()
1729 kfree(window); in iommu_reconfig_notifier()