From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Hellstrom Subject: Re: [PATCH 04/12] drm/ttm: use ttm put pages function to properly restore cache attribute Date: Tue, 08 Nov 2011 08:57:34 +0100 Message-ID: <4EB8E0EE.4060004@vmware.com> References: <1320709232-29477-1-git-send-email-j.glisse@gmail.com> <1320709232-29477-5-git-send-email-j.glisse@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from smtp-outbound-2.vmware.com (smtp-outbound-2.vmware.com [65.115.85.73]) by gabe.freedesktop.org (Postfix) with ESMTP id 8951C9ECD8 for ; Tue, 8 Nov 2011 00:00:08 -0800 (PST) In-Reply-To: <1320709232-29477-5-git-send-email-j.glisse@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: j.glisse@gmail.com Cc: Jerome Glisse , dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org Reviewed-by: Thomas Hellstrom On 11/08/2011 12:40 AM, j.glisse@gmail.com wrote: > From: Jerome Glisse > > 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 > --- > drivers/gpu/drm/ttm/ttm_tt.c | 5 ++++- > 1 files changed, 4 insertions(+), 1 deletions(-) > > diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c > index 8b7a6d0..3fb4c6d 100644 > --- a/drivers/gpu/drm/ttm/ttm_tt.c > +++ b/drivers/gpu/drm/ttm/ttm_tt.c > @@ -89,7 +89,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; > } > >