Index: include/stdio.h =================================================================== RCS file: /cvsroot/src/include/stdio.h,v retrieving revision 1.97 diff -p -u -u -r1.97 stdio.h --- include/stdio.h 17 Mar 2016 00:42:49 -0000 1.97 +++ include/stdio.h 25 Sep 2019 07:31:23 -0000 @@ -193,7 +193,7 @@ __END_DECLS /* System V/ANSI C; this is the wrong way to do this, do *not* use these. */ #if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE) -#define P_tmpdir "/var/tmp/" +#define P_tmpdir "/tmp/" #endif #define L_tmpnam 1024 /* XXX must be == PATH_MAX */ /* Always ensure that this is consistent with */ Index: sys/external/bsd/common/include/linux/slab.h =================================================================== RCS file: /cvsroot/src/sys/external/bsd/common/include/linux/slab.h,v retrieving revision 1.1 diff -p -u -u -r1.1 slab.h --- sys/external/bsd/common/include/linux/slab.h 27 Aug 2018 15:45:06 -0000 1.1 +++ sys/external/bsd/common/include/linux/slab.h 25 Sep 2019 07:31:24 -0000 @@ -73,7 +73,6 @@ linux_gfp_to_malloc(gfp_t gfp) if (ISSET(gfp, __GFP_WAIT)) { flags |= M_WAITOK; - gfp &= ~__GFP_WAIT; } else { flags |= M_NOWAIT; } Index: sys/external/bsd/drm2/dist/drm/ttm/ttm_bo.c =================================================================== RCS file: /cvsroot/src/sys/external/bsd/drm2/dist/drm/ttm/ttm_bo.c,v retrieving revision 1.15 diff -p -u -u -r1.15 ttm_bo.c --- sys/external/bsd/drm2/dist/drm/ttm/ttm_bo.c 2 Feb 2019 21:46:27 -0000 1.15 +++ sys/external/bsd/drm2/dist/drm/ttm/ttm_bo.c 25 Sep 2019 07:31:24 -0000 @@ -276,6 +276,7 @@ static int ttm_bo_add_ttm(struct ttm_buf case ttm_bo_type_kernel: bo->ttm = bdev->driver->ttm_tt_create(bdev, bo->num_pages << PAGE_SHIFT, page_flags, glob->dummy_read_page); +if (bo->ttm == NULL) printk(KERN_ERR "%s:%d driver->ttm_tt_create failed\n", __func__, __LINE__); if (unlikely(bo->ttm == NULL)) ret = -ENOMEM; break; @@ -284,6 +285,7 @@ static int ttm_bo_add_ttm(struct ttm_buf page_flags | TTM_PAGE_FLAG_SG, glob->dummy_read_page); if (unlikely(bo->ttm == NULL)) { +if (ret) printk(KERN_ERR "%s:%d driver->ttm_tt_create failed\n", __func__, __LINE__); ret = -ENOMEM; break; } @@ -1027,6 +1029,7 @@ static int ttm_bo_move_buffer(struct ttm * instead of doing it here. */ ret = ttm_bo_wait(bo, false, interruptible, no_wait_gpu); +if (ret) printk(KERN_ERR "%s:%d ttm_bo_wait failed: %d\n", __func__, __LINE__, ret); if (ret) return ret; mem.num_pages = bo->num_pages; @@ -1040,10 +1043,12 @@ static int ttm_bo_move_buffer(struct ttm */ ret = ttm_bo_mem_space(bo, placement, &mem, interruptible, no_wait_gpu); +if (ret) printk(KERN_ERR "%s:%d ttm_bo_mem_space failed: %d\n", __func__, __LINE__, ret); if (ret) goto out_unlock; ret = ttm_bo_handle_move_mem(bo, &mem, false, interruptible, no_wait_gpu); +if (ret) printk(KERN_ERR "%s:%d ttm_bo_handle_move_mem failed: %d\n", __func__, __LINE__, ret); out_unlock: if (ret && mem.mm_node) ttm_bo_mem_put(bo, &mem); @@ -1101,6 +1106,7 @@ int ttm_bo_validate(struct ttm_buffer_ob if (!ttm_bo_mem_compat(placement, &bo->mem, &new_flags)) { ret = ttm_bo_move_buffer(bo, placement, interruptible, no_wait_gpu); +if (ret) printk(KERN_ERR "%s:%d ttm_bo_mem_compat failed: %d\n", __func__, __LINE__, ret); if (ret) return ret; } else { @@ -1116,6 +1122,7 @@ int ttm_bo_validate(struct ttm_buffer_ob */ if (bo->mem.mem_type == TTM_PL_SYSTEM && bo->ttm == NULL) { ret = ttm_bo_add_ttm(bo, true); +if (ret) printk(KERN_ERR "%s:%d ttm_bo_add_ttm failed: %d\n", __func__, __LINE__, ret); if (ret) return ret; } @@ -1219,6 +1226,7 @@ int ttm_bo_init(struct ttm_bo_device *bd bo->type == ttm_bo_type_sg) ret = drm_vma_offset_add(&bdev->vma_manager, &bo->vma_node, bo->mem.num_pages); +if (ret) printk(KERN_ERR "%s:%d ttm_bo_init failed: %d\n", __func__, __LINE__, ret); /* passed reservation objects should already be locked, * since otherwise lockdep will be angered in radeon. @@ -1229,7 +1237,10 @@ int ttm_bo_init(struct ttm_bo_device *bd } if (likely(!ret)) +{ ret = ttm_bo_validate(bo, placement, interruptible, false); +if (ret) printk(KERN_ERR "%s:%d ttm_bo_validate failed: %d\n", __func__, __LINE__, ret); +} if (!resv) ttm_bo_unreserve(bo); Index: sys/external/bsd/drm2/dist/drm/ttm/ttm_memory.c =================================================================== RCS file: /cvsroot/src/sys/external/bsd/drm2/dist/drm/ttm/ttm_memory.c,v retrieving revision 1.4 diff -p -u -u -r1.4 ttm_memory.c --- sys/external/bsd/drm2/dist/drm/ttm/ttm_memory.c 27 Aug 2018 14:41:10 -0000 1.4 +++ sys/external/bsd/drm2/dist/drm/ttm/ttm_memory.c 25 Sep 2019 07:31:24 -0000 @@ -568,8 +568,17 @@ static int ttm_mem_global_alloc_zone(str != 0)) { if (no_wait) return -ENOMEM; - if (unlikely(count-- == 0)) - return -ENOMEM; + if (unlikely(count-- == 0)) { + if (interruptible) { + interruptible = false; + kpause("ttmgaz", true, 1, NULL); + count = TTM_MEMORY_ALLOC_RETRIES; + } else { + printk(KERN_ERR "%s:%d No memory\n", + __func__, __LINE__); + return -ENOMEM; + } + } ttm_shrink(glob, false, memory + (memory >> 2) + 16); }