From patchwork Mon Sep 23 20:33:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rodrigo Vivi X-Patchwork-Id: 2929801 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 72BCCBFF05 for ; Mon, 23 Sep 2013 20:34:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 283C52039F for ; Mon, 23 Sep 2013 20:34:53 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 4BD482039B for ; Mon, 23 Sep 2013 20:34:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1CA18E7319 for ; Mon, 23 Sep 2013 13:34:52 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-yh0-f53.google.com (mail-yh0-f53.google.com [209.85.213.53]) by gabe.freedesktop.org (Postfix) with ESMTP id 4345AE6727 for ; Mon, 23 Sep 2013 13:33:42 -0700 (PDT) Received: by mail-yh0-f53.google.com with SMTP id b20so1590788yha.26 for ; Mon, 23 Sep 2013 13:33:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=1rbpDY9eRITjvZYrFTpXv+0/qpAFzOYNT5IwDUERTbc=; b=wlmPKyf56Yru27nrfoFJyHHktZvjqtT5NVQmbd8zMhFdV3VfgHMpMwpTgHEtSTV6Sc RK1KcDdCBsftPyZ5ZoJTGH6fEFGRNYxsIySPMw4YkRE984uMFnEYBy73RbeEt0YZhLvo mfuHLN2NmxCYaUrLnMv+xwNrxcNTKgNChBGjg5s8AeC8l3OqpddEwWMA4S3BBcXBfyh9 OdDGM4w0mJwUO8b1ip9Jqgy10aYnBGhJ2ltL5IManaEuKq5gsGSVU5fIiuXAtStCjMSV N1O33pNzTeFzpQg2sE3GtALnRcze4DoXYzg1xA1uzTEvLI2MKiEFWUwxreC3use2Lw01 3eUg== X-Received: by 10.236.146.41 with SMTP id q29mr3522yhj.178.1379968421778; Mon, 23 Sep 2013 13:33:41 -0700 (PDT) Received: from localhost.localdomain ([186.204.164.107]) by mx.google.com with ESMTPSA id v96sm38875107yhp.3.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 23 Sep 2013 13:33:41 -0700 (PDT) From: Rodrigo Vivi To: intel-gfx@lists.freedesktop.org Date: Mon, 23 Sep 2013 17:33:18 -0300 Message-Id: <1379968410-14428-2-git-send-email-rodrigo.vivi@gmail.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1379968410-14428-1-git-send-email-rodrigo.vivi@gmail.com> References: <1379968410-14428-1-git-send-email-rodrigo.vivi@gmail.com> Cc: Daniel Vetter Subject: [Intel-gfx] [PATCH 01/13] drm/i915: check that the i965g/gm 4G limit is really obeyed X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Daniel Vetter In truly crazy circumstances shmem might give us the wrong type of page. So be a bit paranoid and double check this. Reviewer: Damien Lespiau Cc: Rob Clark References: http://lkml.org/lkml/2011/7/11/238 Signed-off-by: Daniel Vetter Signed-off-by: Rodrigo Vivi --- drivers/gpu/drm/i915/i915_gem.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index c12f44a..d68cc5c 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -1857,6 +1857,9 @@ i915_gem_object_get_pages_gtt(struct drm_i915_gem_object *obj) sg->length += PAGE_SIZE; } last_pfn = page_to_pfn(page); + + /* Check that the i965g/gm workaround works. */ + WARN_ON((gfp & __GFP_DMA32) && (last_pfn >= 0x00100000UL)); } #ifdef CONFIG_SWIOTLB if (!swiotlb_nr_tbl())