Lines Matching refs: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
790 * state, firmware may not provide ibm,dma-window property at the time
795 pr_debug(" no ibm,dma-window property !\n");
815 /* Only for normal boot with default window. Doesn't matter even
843 * the window sizes already.
894 pr_warn("%pOF failed to clear tces in window.\n",
897 pr_debug("%pOF successfully cleared tces in window.\n",
902 * Call only if DMA window is clean.
910 pr_warn("%pOF: failed to remove DMA window: rtas returned "
911 "%d to ibm,remove-pe-dma-window(%x) %llx\n",
914 pr_debug("%pOF: successfully removed DMA window: rtas returned "
915 "%d to ibm,remove-pe-dma-window(%x) %llx\n",
956 pr_warn("%pOF: failed to remove DMA window property: %d\n",
964 struct dma_win *window;
969 /* check if we already created a window and dupe that config if so */
970 list_for_each_entry(window, &dma_win_list, list) {
971 if (window->device == pdn) {
972 dma64 = window->prop;
975 *direct_mapping = window->direct;
988 struct dma_win *window;
990 window = kzalloc(sizeof(*window), GFP_KERNEL);
991 if (!window)
994 window->device = pdn;
995 window->prop = dma64;
996 window->direct = false;
998 return window;
1005 struct dma_win *window;
1019 * set window->direct = false.
1021 window = ddw_list_new_entry(pdn, dma64);
1022 if (!window) {
1028 list_add(&window->list, &dma_win_list);
1103 * Get the config address and phb buid of the PE window.
1106 * dma-window property
1151 * Get the config address and phb buid of the PE window.
1154 * dma-window property
1168 "ibm,create-pe-dma-window(%x) %x %x %x %x %x returned %d "
1205 * That rtas-call can be used to restore the default DMA window for the device.
1233 /* Return largest page shift based on "IO Page Sizes" output of ibm,query-pe-dma-window. */
1247 * On LoPAR, ibm,query-pe-dma-window outputs "IO Page Sizes" using a bit field:
1296 * Future: also check if we can remap the base window for our base page size
1311 struct dma_win *window;
1331 * DMA window again, as it will race with in-flight operations
1342 * ibm,query-pe-dma-window
1343 * ibm,create-pe-dma-window
1344 * ibm,remove-pe-dma-window
1354 * Query if there is a second window of size to map the
1365 * If there is no window available, remove the default DMA window,
1367 * new DDW window.
1374 /* DDW + IOMMU on single window may fail if there is any allocation */
1380 default_win = of_find_property(pdn, "ibm,dma-window", NULL);
1391 /* Query again, to check if the window is available */
1461 dev_err(&dev->dev, "unable to add DMA window property for %pOF: %d",
1466 window = ddw_list_new_entry(pdn, win64->value);
1467 if (!window)
1471 window->direct = true;
1477 dev_info(&dev->dev, "failed to map DMA window for %pOF: %d\n",
1489 window->direct = false;
1502 /* New table for using DDW instead of the default DMA window */
1524 dev_info(&dev->dev, "Removed default DMA window for %pOF\n", pdn);
1528 list_add(&window->list, &dma_win_list);
1535 kfree(window);
1563 * If we have persistent memory and the window size is only as big
1564 * as RAM, then we failed to create a window to cover persistent
1583 * contain the dma-window properties per-device and not necessarily
1585 * either hit a dma-window property, OR find a parent with a table
1594 "no DMA window found for pci dev=%s dn=%pOF\n",
1612 /* Only for normal boot with default window. Doesn't matter even
1624 pr_debug(" found DMA window, table: %p\n", pci->table_group);
1635 /* only attempt to use a new window if 64-bit DMA is requested */
1642 * the device tree might contain the dma-window properties
1644 * search upwards in the tree until we either hit a dma-window
1657 struct dma_win *window;
1664 list_for_each_entry(window, &dma_win_list, list) {
1665 if (window->direct) {
1667 arg->nr_pages, window->prop);
1676 list_for_each_entry(window, &dma_win_list, list) {
1677 if (window->direct) {
1679 arg->nr_pages, window->prop);
1704 struct dma_win *window;
1723 list_for_each_entry(window, &dma_win_list, list) {
1724 if (window->device == np) {
1725 list_del(&window->list);
1726 kfree(window);