From patchwork Fri Nov 16 17:19:01 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Morton X-Patchwork-Id: 1763461 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id CE9CCDFF38 for ; Mon, 19 Nov 2012 08:27:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C3EC8E6076 for ; Mon, 19 Nov 2012 00:27:36 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from na3sys009aog126.obsmtp.com (na3sys009aog126.obsmtp.com [74.125.149.155]) by gabe.freedesktop.org (Postfix) with ESMTP id 5097DE5DE8 for ; Fri, 16 Nov 2012 09:19:09 -0800 (PST) Received: from mail-wi0-f197.google.com ([209.85.212.197]) (using TLSv1) by na3sys009aob126.postini.com ([74.125.148.12]) with SMTP ID DSNKUKZ1jPf1K/joG+IkBcj/ooDA6M3oz5rj@postini.com; Fri, 16 Nov 2012 09:19:09 PST Received: by mail-wi0-f197.google.com with SMTP id hm6so289955wib.0 for ; Fri, 16 Nov 2012 09:19:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:cc:subject:message-id:organization:x-mailer :mime-version:content-type:content-transfer-encoding :x-gm-message-state; bh=TbRyGeZABAAGj6QtRFh9Z7iamN1OO+3Oe1YGx02yLt8=; b=iAm7s3RsxY2ttGj2Qmdre6i5dVZyqlm0NCQ5PZnspMiW2POiNCDYV2hnRcWTugj3Ei BNpXJT2F7Xx+mqyyrt+86mPDyGRnpPjmuCgZf63/n4hzDlke1T8x2hPzIa178YEdMMlz JA6GuiN1OZTzP/bJH8BhHeAZGT2fIvc0o0Zr0XYa+03Ao/uiEA0POqI/QJ8lweq2+x/J kzCECAW0aiworJZz4QwSile/C3OBJK9qoWzVsibAvMT0V1FPJmUUuM7YsN+q6v6C+EUP zQcDXzlZQI53V727GGdS7CNi1iF9iBWYWmj7HPY2+QU5v2285bjq/ZafW7YJ10XnqXan 6efA== Received: by 10.152.48.111 with SMTP id k15mr4902584lan.17.1353086347022; Fri, 16 Nov 2012 09:19:07 -0800 (PST) Received: by 10.152.48.111 with SMTP id k15mr4902576lan.17.1353086346807; Fri, 16 Nov 2012 09:19:06 -0800 (PST) Received: from sd070 (hel-gw.movial.com. [62.236.91.16]) by mx.google.com with ESMTPS id fp7sm809701lab.4.2012.11.16.09.19.05 (version=SSLv3 cipher=OTHER); Fri, 16 Nov 2012 09:19:06 -0800 (PST) Date: Fri, 16 Nov 2012 19:19:01 +0200 From: Jonathan Morton To: dri-devel@lists.freedesktop.org Subject: Re: [PATCH] ttm_get_pages() will OOPS with highmem allocation Message-ID: <20121116191901.22b3e11c@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: ALoCoQkFxt5AWRHnKwv0P/qimw1wwrvpnNQIP5Xnb+zTcp26e9IVc9e73D+U+dMtyFJ9TrLDSG0J1o+uDXtS3sI/mtDqBl88s7Y8g4zmfEAlXORj5I5GW7n9Pksps4fiZFyTU61zX8rmkWNH9VAjm751GKRNbV78lHFh2RZGhMJnfmrZMKQczEQ1JIsKAL0AtdoeUQ3qlsus X-Mailman-Approved-At: Mon, 19 Nov 2012 00:17:20 -0800 Cc: stable@vger.kernel.org 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. Reviewed-by: Thomas Hellstrom 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 --- 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)); } }