From: Jerome Glisse Date: Thu, 3 Nov 2011 05:22:39 +0000 (-0400) Subject: drm/ttm: use ttm put pages function to properly restore cache attribute X-Git-Tag: upstream/snapshot3+hdmi~8389^2~88^2~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5e2656804a34f58c2bf557465ab77f8a26a500eb;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git drm/ttm: use ttm put pages function to properly restore cache attribute On failure we need to make sure the page we free has wb cache attribute. Do this pas call the proper ttm page helper function. Signed-off-by: Jerome Glisse Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Thomas Hellstrom --- diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c index f0c5ffd..90527a2 100644 --- a/drivers/gpu/drm/ttm/ttm_tt.c +++ b/drivers/gpu/drm/ttm/ttm_tt.c @@ -90,7 +90,10 @@ static struct page *__ttm_tt_get_page(struct ttm_tt *ttm, int index) } return p; out_err: - put_page(p); + INIT_LIST_HEAD(&h); + list_add(&p->lru, &h); + ttm_put_pages(&h, 1, ttm->page_flags, + ttm->caching_state, &ttm->dma_address[index]); return NULL; }