From patchwork Sat Mar 8 01:13:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kelley, Sean V" X-Patchwork-Id: 3796191 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 652B6BF540 for ; Sat, 8 Mar 2014 01:13:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6DFB320304 for ; Sat, 8 Mar 2014 01:13:17 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 53781202F2 for ; Sat, 8 Mar 2014 01:13:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B5507FAE67; Fri, 7 Mar 2014 17:13:14 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id 59B28FAE67 for ; Fri, 7 Mar 2014 17:13:12 -0800 (PST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 07 Mar 2014 17:13:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,611,1389772800"; d="scan'208";a="468723966" Received: from tallgrass.jf.intel.com ([10.7.197.82]) by orsmga001.jf.intel.com with ESMTP; 07 Mar 2014 17:13:07 -0800 From: Sean V Kelley To: intel-gfx@lists.freedesktop.org Date: Fri, 7 Mar 2014 17:13:51 -0800 Message-Id: <1394241231-17242-1-git-send-email-sean.v.kelley@intel.com> X-Mailer: git-send-email 1.9.0 Cc: Sean V Kelley , Fei Jiang , Alan Cox Subject: [Intel-gfx] [PATCH] drm/i915: fix vxd392 memory corruption on VLV and >4GB 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@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, 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 On VLV systems addressing 4GB of memory or greater, memory corruption was seen when initializing and attempting to render VP8 hardware decode surfaces using the VXD392 HW IP block. The VXD MMU has a limitation to addressing only 32bits. On 64bit kernel and user space builds this can cause problems for use of that IP block. When 2G memory is inserted, fw buffer pfn was at 0x5f62b, which is below 4GB. While for 4GB of memory the fw buffer pfn was 0x162ea9 with a physical address at 0x162ea9000, above 4GB. So although the memory is 4GB in the test hardware (Bayleybay CRB), a large physical region (for example 3G-4G) can be occupied by onboard system resources. Enabling ZONE_DMA32 and setting the correct mask DMA for this device resolves the issue kernel side. Cc: Jesse Barnes Cc: Alan Cox Cc: Fei Jiang Signed-off-by: Sean V Kelley --- drivers/gpu/drm/i915/i915_dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index e4d2b9f..b8c6efc 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c @@ -1636,7 +1636,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) * behaviour if any general state is accessed within a page above 4GB, * which also needs to be handled carefully. */ - if (IS_BROADWATER(dev) || IS_CRESTLINE(dev)) + if (IS_BROADWATER(dev) || IS_CRESTLINE(dev) || IS_VALLEYVIEW(dev)) dma_set_coherent_mask(&dev->pdev->dev, DMA_BIT_MASK(32)); aperture_size = dev_priv->gtt.mappable_end;