Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'drm-fixes-2019-08-24' of git://anongit.freedesktop.org/drm/drm

Pull more drm fixes from Dave Airlie:
"Although the tree built for me fine on arm here, it appears either
header cleanups in next or some kconfig combo it breaks, so this
contains a fix to mediatek to include dma-mapping.h explicitly.

There was also one nouveau fix that came in late that I was going to
leave until next week, but since I was sending this I thought it may
as well be in here:

mediatek:
- fix build in some cases

nouveau:
- fix hang with i2c and mst docks"

* tag 'drm-fixes-2019-08-24' of git://anongit.freedesktop.org/drm/drm:
drm/mediatek: include dma-mapping header
drm/nouveau: Don't retry infinitely when receiving no data on i2c over AUX

+18 -7
+1
drivers/gpu/drm/mediatek/mtk_drm_drv.c
··· 17 17 #include <linux/of_address.h> 18 18 #include <linux/of_platform.h> 19 19 #include <linux/pm_runtime.h> 20 + #include <linux/dma-mapping.h> 20 21 21 22 #include "mtk_drm_crtc.h" 22 23 #include "mtk_drm_ddp.h"
+17 -7
drivers/gpu/drm/nouveau/nvkm/subdev/i2c/aux.c
··· 40 40 u8 *ptr = msg->buf; 41 41 42 42 while (remaining) { 43 - u8 cnt = (remaining > 16) ? 16 : remaining; 44 - u8 cmd; 43 + u8 cnt, retries, cmd; 45 44 46 45 if (msg->flags & I2C_M_RD) 47 46 cmd = 1; ··· 50 51 if (mcnt || remaining > 16) 51 52 cmd |= 4; /* MOT */ 52 53 53 - ret = aux->func->xfer(aux, true, cmd, msg->addr, ptr, &cnt); 54 - if (ret < 0) { 55 - nvkm_i2c_aux_release(aux); 56 - return ret; 54 + for (retries = 0, cnt = 0; 55 + retries < 32 && !cnt; 56 + retries++) { 57 + cnt = min_t(u8, remaining, 16); 58 + ret = aux->func->xfer(aux, true, cmd, 59 + msg->addr, ptr, &cnt); 60 + if (ret < 0) 61 + goto out; 62 + } 63 + if (!cnt) { 64 + AUX_TRACE(aux, "no data after 32 retries"); 65 + ret = -EIO; 66 + goto out; 57 67 } 58 68 59 69 ptr += cnt; ··· 72 64 msg++; 73 65 } 74 66 67 + ret = num; 68 + out: 75 69 nvkm_i2c_aux_release(aux); 76 - return num; 70 + return ret; 77 71 } 78 72 79 73 static u32