From patchwork Wed Aug 7 20:24:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 2840492 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 1FED6BF535 for ; Wed, 7 Aug 2013 20:28:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4D73B20497 for ; Wed, 7 Aug 2013 20:28:33 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 2B0382048E for ; Wed, 7 Aug 2013 20:28:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 16F15E7205 for ; Wed, 7 Aug 2013 13:28:32 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-ea0-f178.google.com (mail-ea0-f178.google.com [209.85.215.178]) by gabe.freedesktop.org (Postfix) with ESMTP id 340A5E6ADB for ; Wed, 7 Aug 2013 13:24:35 -0700 (PDT) Received: by mail-ea0-f178.google.com with SMTP id a15so1067067eae.9 for ; Wed, 07 Aug 2013 13:24:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id; bh=nAEP6u1nb1xlTnj95XrtYY0350fkkwu/E+cifkycgfM=; b=d6m6DQBYyLgUMJ2cUZjfnNh9et75HYJC5yySHVdKhiHXOGRZMkujz7l/rKYVEqJeyl 09oGBW1ktdgH9sYhYOFy9jplHltMExjrx70oJMAB2FLNOvay47BEKdFXOX96i3rDpdqw qWYEF7A6hB8JBj6jkOyUL+JOHvLi6fUBqSaXk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=nAEP6u1nb1xlTnj95XrtYY0350fkkwu/E+cifkycgfM=; b=gj/r5EWwaDqTthSlSy9AwC9OteOC1Vm/wGmyS6i77naywNpIQ/wc0A1opS5lbZN7eX WP5GiJ3rzs3u0UtbeTliGTLShC3iqWIAQ2HmkSbPxggBz/BTOS+KBLmzpnNj/MMvc7Ub 5iztOmJ740KHpE/Lt/p49Fe0q4rPQJkwtMY3hlU7jU8x8fjsXS4gpqS5mR/TREiCTQEo qRNFe0j0oiz8xvrvHgILd9uHDuHi/1atKiqPbr2jp7ecVChNtApb+q8GCFSz/9uhSKFi hA5uSPpXbSTkopWPe1ItGmURm1q/voO6kAjNKVTY0y5zFfZp+TYTvbgzNBgBa5fqmItX SRhQ== X-Gm-Message-State: ALoCoQl01gWEt1LvJH1GOvwgqmbOXAFlHjw1wflcECiR0jydTNhepHQH5i3w4i4tFguLLaM+WsLu X-Received: by 10.14.175.129 with SMTP id z1mr4662002eel.69.1375907075104; Wed, 07 Aug 2013 13:24:35 -0700 (PDT) Received: from phenom.ffwll.local (178-83-130-250.dynamic.hispeed.ch. [178.83.130.250]) by mx.google.com with ESMTPSA id bp43sm12713331eeb.4.2013.08.07.13.24.33 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 07 Aug 2013 13:24:33 -0700 (PDT) From: Daniel Vetter To: Intel Graphics Development Date: Wed, 7 Aug 2013 22:24:38 +0200 Message-Id: <1375907078-3474-1-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.8.3.2 Cc: Daniel Vetter , Rob Clark Subject: [Intel-gfx] [PATCH] 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=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, 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 In truly crazy circumstances shmem might give us the wrong type of page. So be a bit paranoid and double check this. Cc: Rob Clark References: http://lkml.org/lkml/2011/7/11/238 Signed-off-by: Daniel Vetter --- 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 8508b3d..55fdd20 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -1827,6 +1827,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())