Received: by 10.192.165.156 with SMTP id m28csp1238017imm; Wed, 11 Apr 2018 15:14:48 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/obXO0uvQpDhHa8PxkyjmIS4cQu5KqIirI4MB7s8QOHA/mOs40hsbC7IGU2OEh2wwBiwHQ X-Received: by 10.99.115.14 with SMTP id o14mr4796354pgc.121.1523484888171; Wed, 11 Apr 2018 15:14:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523484888; cv=none; d=google.com; s=arc-20160816; b=Hy3wojuKVNLZRI69W3f7KJI/e3eycWOrdXwZBKgsOX+D0xibib2JrslYLHv4B6qFVc 75vYLMF/ivWoyjuRkq1THLFj/MIMn41ApZA4F/Ko9Kb2T5TTZjq4L9rE6OR0F2r94e6z 4UxB66z/CpCQSdG8zbcNYbLwv/QsI3+lw05oZZ6FKzqNuBxvmu5zeQ9UuekG/iD16RkD y3mphosfuExSx1JC1Ef4udTH1uR7mIA0Hq9UBsV8kOAdP5LaujWYY6vInt5ZjaSmaMsj N4GpflNDUDVZqKaHSSvzfC0B1BhxdTo8vpqIGY/UCycdvV01MQYLVxItoiOX/ZJs0RXx SAQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dmarc-filter:dkim-signature :dkim-signature:arc-authentication-results; bh=EeWT0BAqVojnZSHNyw5iPDqcPwHEhknIZ/0vY/Yppik=; b=aDzPTBZaYptLrFVGhPL9Xrm2x5LWJcBN3nZtXh3M5s6xgny4GU3j1SD5u3+vKwKmXN 9ZchCquF8TFtCWSteF5JIfuYUxSy0YKZZhT10Oa1u1NB4kT1EvOaKm11IiyeDTayqGmI hrMPKhnu2OsWGsMiL0kqQ75QMwVMp4vBkBd1XYu4bTqUfRMGv+QgixupM4oZNQ4y5Azc hts+KJlyMxF0W44CSBb/Sp2Uxv7NQu8/LjuGZR4AyyLnMj8O+almDyK18GwB0qEKnn91 AnLgStgywvo6iUBMjkeRJ6N4zMcFcI8d2DY5+7ApLh9vQZoR1dMcbNh5PdV7KmHb/d7D 4KGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=kDVLSbaI; dkim=pass header.i=@codeaurora.org header.s=default header.b=UqFajLt4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l5-v6si2127908pls.144.2018.04.11.15.14.11; Wed, 11 Apr 2018 15:14:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=kDVLSbaI; dkim=pass header.i=@codeaurora.org header.s=default header.b=UqFajLt4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752091AbeDKWLd (ORCPT + 99 others); Wed, 11 Apr 2018 18:11:33 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:55034 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751680AbeDKWLb (ORCPT ); Wed, 11 Apr 2018 18:11:31 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 43D5560C55; Wed, 11 Apr 2018 22:11:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1523484691; bh=l0zxObLyq3YAsL45jMFX0t9REcqCtnJt3C0zjTM6SBQ=; h=From:To:Cc:Subject:Date:From; b=kDVLSbaI6xFuOzvaDTUBmGmDDuryJCHW+iQ1MyZJEioVN7sAUZZnbSUPA/6NhfK7D aUWLKWswWgpNxcWMBQF6sXy1PZy0/gO8dAwlwIXP+RTuwro43tnWt27fz8v0lSZ+I4 iajP6KWDRInzgacL+VfZyPRltmXUL3xYKNJ9AFBI= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from drakthul.qualcomm.com (global_nat1_iad_fw.qualcomm.com [129.46.232.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: okaya@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 1CE3660386; Wed, 11 Apr 2018 22:11:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1523484690; bh=l0zxObLyq3YAsL45jMFX0t9REcqCtnJt3C0zjTM6SBQ=; h=From:To:Cc:Subject:Date:From; b=UqFajLt4O47uGZ0TeNthasuAEIrcDbPHB2dG2AjsldqzVDsuDzbY0SCBZ+5PDuJVF m+cXG+DkF2fnyU8ht1pSmVXAAD705f2ADIop1A8S0pb3hDm/VslLt2I9HfU8BLY+ka 9eGCT2WCm3UM40SzAEUEY/qk2576D9NQ4xQiKOSA= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 1CE3660386 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=okaya@codeaurora.org From: Sinan Kaya To: amd-gfx@lists.freedesktop.org, sulrich@codeaurora.org, timur@codeaurora.org Cc: linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sinan Kaya , Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , "David (ChunMing) Zhou" , David Airlie , Monk Liu , Harry Wentland , Pixel Ding , Horace Chen , dri-devel@lists.freedesktop.org (open list:DRM DRIVERS), linux-kernel@vger.kernel.org (open list) Subject: [PATCH V3] drm/amdgpu: limit DMA size to PAGE_SIZE for scatter-gather buffers Date: Wed, 11 Apr 2018 18:11:22 -0400 Message-Id: <1523484684-10426-1-git-send-email-okaya@codeaurora.org> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Code is expecing to observe the same number of buffers returned from dma_map_sg() function compared to sg_alloc_table_from_pages(). This doesn't hold true universally especially for systems with IOMMU. The hardware actually needs the dma_address on a page by page basis. Joining multiple consecutive pages into one entry is just additional overhead which we don't need. Signed-off-by: Sinan Kaya --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index af1b879..91abe1a 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -1948,6 +1948,9 @@ int amdgpu_device_init(struct amdgpu_device *adev, /* init the mode config */ drm_mode_config_init(adev->ddev); + /* limit scatter-gather buffer size to PAGE_SIZE */ + dma_set_max_seg_size(adev->dev, PAGE_SIZE); + r = amdgpu_device_ip_init(adev); if (r) { /* failed in exclusive mode due to timeout */ -- 2.7.4