From patchwork Tue Nov 13 18:31:55 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Morton X-Patchwork-Id: 1739031 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 580F33FC64 for ; Wed, 14 Nov 2012 07:10:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 465A09F695 for ; Tue, 13 Nov 2012 23:10:41 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 419 seconds by postgrey-1.32 at gabe; Tue, 13 Nov 2012 10:39:01 PST Received: from na3sys009aog111.obsmtp.com (na3sys009aog111.obsmtp.com [74.125.149.205]) by gabe.freedesktop.org (Postfix) with ESMTP id E24D69E960 for ; Tue, 13 Nov 2012 10:39:01 -0800 (PST) Received: from mail-lb0-f197.google.com ([209.85.217.197]) (using TLSv1) by na3sys009aob111.postini.com ([74.125.148.12]) with SMTP ID DSNKUKKTxVzFxvCNUwAinjO/vpwOo6TD9i9c@postini.com; Tue, 13 Nov 2012 10:39:02 PST Received: by mail-lb0-f197.google.com with SMTP id gg13so1928940lbb.0 for ; Tue, 13 Nov 2012 10:39:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:subject:message-id:organization:x-mailer:mime-version :content-type:content-transfer-encoding:x-gm-message-state; bh=DxK59zyzkhKhYcCcYgGY/Mwz7sZPaLuTna/SsixCW1A=; b=VW1eZOtVnMOnU+3vcJ/tAdaaAbajo/uQ8Ps04IceuFBxs6TEMQ053N5O3boTSwxmvp Xi8jBsslSD8EjJIwJmE0aFNObtPxnqDL3htANEX2WpmDvkWTd67MiKEqIM4N7aJWSUoL qe9viok2iyWXl4d4Qo8FlP92p3yIlrV+hPBQ9uHnYkfun/SNVqJUPS7u7wyFc9tIfWvV EfVrLHaU8zAH401U0eX4T1pfaYQ0Qax4S0fBRIdS1tDcMKlS0lSCuWqprUXFg4H5G96b 77+DQq5kju2FjQyBTbTYKoaqudvcpq0JfUkk++PPLg4kTjKBNokRcyuFZ4dELPdJBu8V EkVA== Received: by 10.112.104.2 with SMTP id ga2mr9740186lbb.48.1352831520282; Tue, 13 Nov 2012 10:32:00 -0800 (PST) Received: by 10.112.104.2 with SMTP id ga2mr9740179lbb.48.1352831519977; Tue, 13 Nov 2012 10:31:59 -0800 (PST) Received: from sd070 (hel-gw.movial.com. [62.236.91.16]) by mx.google.com with ESMTPS id fm6sm2927398lbb.17.2012.11.13.10.31.58 (version=SSLv3 cipher=OTHER); Tue, 13 Nov 2012 10:31:59 -0800 (PST) Date: Tue, 13 Nov 2012 20:31:55 +0200 From: Jonathan Morton To: dri-devel@lists.freedesktop.org Subject: [PATCH] ttm_get_pages() will OOPS with highmem allocation Message-ID: <20121113203155.0c1880d9@sd070> Organization: Movial CT X-Mailer: Claws Mail 3.7.9 (GTK+ 2.24.6; x86_64-pc-linux-gnu) Mime-Version: 1.0 X-Gm-Message-State: ALoCoQn90oV8C36w6DHwE+J/1tZYg8OJRfA34x/kkDSz60cAsmHh8Bsf3VyY/8yXodJ+ra0pFc4RwNY0S6sWUeHm386Hy7flMFXAnIdHeympe44jw/tlVEchuYhg087WGyG76VR/8WKP175OMwHmC2hfALBfeINyXUvAgAaG6b5aSPok+hIHBXcICxfBiWwfFmGZEBn1BQ3D X-Mailman-Approved-At: Tue, 13 Nov 2012 23:07:30 -0800 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Reposting from this kernel bug: https://bugzilla.kernel.org/show_bug.cgi?id=50241 I've tested the patch and it solves a highly repeatable OOPS with the CedarView driver that I'm porting. From 3552913d3a1c2d3c4ce158e91dc18cd12b522cb2 Mon Sep 17 00:00:00 2001 From: Yakui Zhao Date: Tue, 7 Feb 2012 15:33:13 -0500 Subject: [PATCH] Clear the ttm page allocated from high memory zone correctly The TTM page can be allocated from high memory. In such case it is wrong to use the page_address(page) as the virtual address for the high memory page. Signed-off-by: Zhao Yakui Reviewed-by: Thomas Hellstrom --- drivers/gpu/drm/ttm/ttm_page_alloc.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c index d948575..df976d9 100644 --- a/drivers/gpu/drm/ttm/ttm_page_alloc.c +++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c @@ -708,7 +708,10 @@ int ttm_get_pages(struct list_head *pages, int flags, /* clear the pages coming from the pool if requested */ if (flags & TTM_PAGE_FLAG_ZERO_ALLOC) { list_for_each_entry(p, pages, lru) { - clear_page(page_address(p)); + if (PageHighMem(p)) + clear_highpage(p); + else + clear_page(page_address(p)); } }