Karol Herbst
2015-Nov-14 19:18 UTC
[Nouveau] [PATCH] pmu: use nvkm_msec instead of do while
I hit this while loop in an error state of the gpu Signed-off-by: Karol Herbst <nouveau at karolherbst.de> --- drm/nouveau/nvkm/subdev/pmu/base.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drm/nouveau/nvkm/subdev/pmu/base.c b/drm/nouveau/nvkm/subdev/pmu/base.c index fafbe2a..398b6a8 100644 --- a/drm/nouveau/nvkm/subdev/pmu/base.c +++ b/drm/nouveau/nvkm/subdev/pmu/base.c @@ -106,9 +106,15 @@ nvkm_pmu_send(struct nvkm_pmu *pmu, u32 reply[2], } /* acquire data segment access */ - do { + nvkm_wr32(device, 0x10a580, 0x00000001); + if (nvkm_msec(device, 2000, + if (nvkm_rd32(device, 0x10a580) == 0x00000001) + break; nvkm_wr32(device, 0x10a580, 0x00000001); - } while (nvkm_rd32(device, 0x10a580) != 0x00000001); + ) < 0) { + mutex_unlock(&subdev->mutex); + return -EBUSY; + } /* write the packet */ nvkm_wr32(device, 0x10a1c0, 0x01000000 | (((addr & 0x07) << 4) + -- 2.6.3
Reasonably Related Threads
- [PATCH v2] pmu: use nvkm_msec instead of do while
- [PATCH v2] pmu: use nvkm_msec instead of do while
- [PATCH v2] pmu: fix queued messages while getting no IRQ
- [PATCH v3] pmu: fix queued messages while getting no IRQ
- [PATCH] pmu: fix queued messages while getting no IRQ