Lines Matching full:window

358 /* Dynamic DMA Window support */
373 /* prevents races between memory on/offline and window creation */
375 /* protects initializing window twice for same device */
377 #define DIRECT64_PROPNAME "linux,direct64-ddr-window-info"
378 #define DMA64_PROPNAME "linux,dma64-ddr-window-info"
624 /* Calculate amount of DMA window per slot. Each window must be in pci_dma_bus_setup_pSeries()
631 /* No ISA/IDE - just set window size and return */ in pci_dma_bus_setup_pSeries()
636 pr_debug("No ISA/IDE, window size is 0x%llx\n", in pci_dma_bus_setup_pSeries()
664 pr_debug("ISA/IDE, window size is 0x%llx\n", pci->phb->dma_window_size); in pci_dma_bus_setup_pSeries()
717 * Find nearest ibm,dma-window (default DMA window), walking up the in pci_dma_bus_setup_pSeriesLP()
721 dma_window = of_get_property(pdn, "ibm,dma-window", NULL); in pci_dma_bus_setup_pSeriesLP()
727 pr_debug(" no ibm,dma-window property !\n"); in pci_dma_bus_setup_pSeriesLP()
762 * the window sizes already. in pci_dma_dev_setup_pSeries()
813 pr_warn("%pOF failed to clear tces in window.\n", in clean_dma_window()
816 pr_debug("%pOF successfully cleared tces in window.\n", in clean_dma_window()
821 * Call only if DMA window is clean.
829 pr_warn("%pOF: failed to remove DMA window: rtas returned " in __remove_dma_window()
830 "%d to ibm,remove-pe-dma-window(%x) %llx\n", in __remove_dma_window()
833 pr_debug("%pOF: successfully removed DMA window: rtas returned " in __remove_dma_window()
834 "%d to ibm,remove-pe-dma-window(%x) %llx\n", in __remove_dma_window()
875 pr_warn("%pOF: failed to remove DMA window property: %d\n", in remove_ddw()
882 struct dma_win *window; in find_existing_ddw() local
887 /* check if we already created a window and dupe that config if so */ in find_existing_ddw()
888 list_for_each_entry(window, &dma_win_list, list) { in find_existing_ddw()
889 if (window->device == pdn) { in find_existing_ddw()
890 dma64 = window->prop; in find_existing_ddw()
905 struct dma_win *window; in ddw_list_new_entry() local
907 window = kzalloc(sizeof(*window), GFP_KERNEL); in ddw_list_new_entry()
908 if (!window) in ddw_list_new_entry()
911 window->device = pdn; in ddw_list_new_entry()
912 window->prop = dma64; in ddw_list_new_entry()
914 return window; in ddw_list_new_entry()
921 struct dma_win *window; in find_existing_ddw_windows_named() local
931 window = ddw_list_new_entry(pdn, dma64); in find_existing_ddw_windows_named()
932 if (!window) in find_existing_ddw_windows_named()
936 list_add(&window->list, &dma_win_list); in find_existing_ddw_windows_named()
1011 * Get the config address and phb buid of the PE window. in query_ddw()
1014 * dma-window property in query_ddw()
1057 * Get the config address and phb buid of the PE window. in create_ddw()
1060 * dma-window property in create_ddw()
1074 "ibm,create-pe-dma-window(%x) %x %x %x %x %x returned %d " in create_ddw()
1098 * for the huge DMA window as MAX_PHYSMEM_BITS. in ddw_memory_hotplug_max()
1131 * That rtas-call can be used to restore the default DMA window for the device.
1159 /* Return largest page shift based on "IO Page Sizes" output of ibm,query-pe-dma-window. */
1172 * On LoPAR, ibm,query-pe-dma-window outputs "IO Page Sizes" using a bit field: in iommu_get_page_shift()
1222 * Future: also check if we can remap the base window for our base page size
1237 struct dma_win *window; in enable_ddw() local
1261 * DMA window again, as it will race with in-flight operations in enable_ddw()
1272 * ibm,query-pe-dma-window in enable_ddw()
1273 * ibm,create-pe-dma-window in enable_ddw()
1274 * ibm,remove-pe-dma-window in enable_ddw()
1284 * Query if there is a second window of size to map the in enable_ddw()
1295 * If there is no window available, remove the default DMA window, in enable_ddw()
1297 * new DDW window. in enable_ddw()
1305 /* DDW + IOMMU on single window may fail if there is any allocation */ in enable_ddw()
1311 default_win = of_find_property(pdn, "ibm,dma-window", NULL); in enable_ddw()
1322 /* Query again, to check if the window is available */ in enable_ddw()
1390 dev_err(&dev->dev, "unable to add DMA window property for %pOF: %d", in enable_ddw()
1395 window = ddw_list_new_entry(pdn, win64->value); in enable_ddw()
1396 if (!window) in enable_ddw()
1404 dev_info(&dev->dev, "failed to map DMA window for %pOF: %d\n", in enable_ddw()
1427 /* New table for using DDW instead of the default DMA window */ in enable_ddw()
1440 /* Keep default DMA window stuct if removed */ in enable_ddw()
1451 list_add(&window->list, &dma_win_list); in enable_ddw()
1459 kfree(window); in enable_ddw()
1487 * If we have persistent memory and the window size is only as big in enable_ddw()
1488 * as RAM, then we failed to create a window to cover persistent in enable_ddw()
1507 * contain the dma-window properties per-device and not necessarily in pci_dma_dev_setup_pSeriesLP()
1509 * either hit a dma-window property, OR find a parent with a table in pci_dma_dev_setup_pSeriesLP()
1517 dma_window = of_get_property(pdn, "ibm,dma-window", NULL); in pci_dma_dev_setup_pSeriesLP()
1524 "no DMA window found for pci dev=%s dn=%pOF\n", in pci_dma_dev_setup_pSeriesLP()
1542 pr_debug(" found DMA window, table: %p\n", pci->table_group); in pci_dma_dev_setup_pSeriesLP()
1554 /* only attempt to use a new window if 64-bit DMA is requested */ in iommu_bypass_supported_pSeriesLP()
1561 * the device tree might contain the dma-window properties in iommu_bypass_supported_pSeriesLP()
1563 * search upwards in the tree until we either hit a dma-window in iommu_bypass_supported_pSeriesLP()
1568 dma_window = of_get_property(pdn, "ibm,dma-window", NULL); in iommu_bypass_supported_pSeriesLP()
1582 struct dma_win *window; in iommu_mem_notifier() local
1589 list_for_each_entry(window, &dma_win_list, list) { in iommu_mem_notifier()
1591 arg->nr_pages, window->prop); in iommu_mem_notifier()
1599 list_for_each_entry(window, &dma_win_list, list) { in iommu_mem_notifier()
1601 arg->nr_pages, window->prop); in iommu_mem_notifier()
1625 struct dma_win *window; in iommu_reconfig_notifier() local
1644 list_for_each_entry(window, &dma_win_list, list) { in iommu_reconfig_notifier()
1645 if (window->device == np) { in iommu_reconfig_notifier()
1646 list_del(&window->list); in iommu_reconfig_notifier()
1647 kfree(window); in iommu_reconfig_notifier()