Lines Matching defs:window

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