From patchwork Thu Jan 4 14:16:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christian_K=C3=B6nig?= X-Patchwork-Id: 10144781 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 89BCD60329 for ; Thu, 4 Jan 2018 14:16:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 73BB22869C for ; Thu, 4 Jan 2018 14:16:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 66C1E286A1; Thu, 4 Jan 2018 14:16:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 538972869C for ; Thu, 4 Jan 2018 14:16:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2F2FF6E143; Thu, 4 Jan 2018 14:16:08 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id E50B36E143 for ; Thu, 4 Jan 2018 14:16:06 +0000 (UTC) Received: by mail-wm0-x243.google.com with SMTP id g75so3796202wme.0 for ; Thu, 04 Jan 2018 06:16:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=wUc4OY25XRZa8GSSxJ7/ypsVTZadjtEPlCrAjUpteP4=; b=Kge+ud2cIKWk0KzLvCML5wOoQVxNaWizNf4SfTG9G4K3AdEFERjvf60+RWoV2dtEHK FNzT8UhWN7+QgfK5zfDf82zdEFvEwG1j5CXEtzErDZJEY5OSuShLw7UU9WSQEr4mmbDD iDf+JckdQ/kYQyEddTW6CfSNWitvDl7Xh93UZs7LEc08mvQ/L0bYzOEr86RbzF6Sf1J5 I1OFEb+wrbLHK03DWygZkB6ad2D+n4yuBCNMIX+cw3jl/53cGL0XLD6dMXUNX520A2OK D0eo/7rhcmfSPkzbgp7q0iKerYJii1h8A8E1IdsJzPdm8b2shJhDp/TeCgztA5fvgGvz 9LTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=wUc4OY25XRZa8GSSxJ7/ypsVTZadjtEPlCrAjUpteP4=; b=s5DSgxV+9lG8ZNxl+Kvz+YyDMsgWB4d6nmaoucS2yxICL8M/bmeJcYOznW24usIx7j vYp8GkS0c8urfOUNAXHTqjvHhKq8s9diR3PDPkIzV1LKcxcrEPjVMLlF91TEisuPpktt i+F/WaRBQv1IwrbzuGP87GtECsYkzzY65BW/JwFxmkRDoKIeDuimABO/3EiZkzcAAPEY URSpFWyX9Z0NaEgrFxjJWICYwy+lynrZISdIzSrTVvfzwrAf+q+nmRgDbrA2SQf9WrC5 STwxMmVXK7uPBbUGIutiR0reEuk7lqngFVlLhF8Hf6LFX9AXP/dOQMm62tr9Cdje4QVy fEPw== X-Gm-Message-State: AKGB3mKlrUPmxtH6pBnsx8LGFFO1YCJq3364Op2BKSXoq3WdmYkjfQO2 kQPIDcL9kzHaup4shcwd4DNn6w== X-Google-Smtp-Source: ACJfBovYs9LcsyQC5vQRVpdDOUlkvJ3G53qUgL7h1hUzqMMM8vBmagXzvpR0VTqG628lRQZT73m3bg== X-Received: by 10.28.178.135 with SMTP id b129mr3929855wmf.103.1515075365215; Thu, 04 Jan 2018 06:16:05 -0800 (PST) Received: from localhost.localdomain ([2a02:908:1251:8fc0:7912:afc3:7abb:bda7]) by smtp.gmail.com with ESMTPSA id z62sm3595123wrb.67.2018.01.04.06.16.04 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Jan 2018 06:16:04 -0800 (PST) From: "=?UTF-8?q?Christian=20K=C3=B6nig?=" X-Google-Original-From: =?UTF-8?q?Christian=20K=C3=B6nig?= To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/ttm: specify DMA_ATTR_NO_WARN for huge page pools Date: Thu, 4 Jan 2018 15:16:01 +0100 Message-Id: <20180104141601.28555-1-christian.koenig@amd.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Suppress warning messages when allocating huge pages fails since we can always fall back to normal pages. Signed-off-by: Christian König Acked-by: Alex Deucher --- drivers/gpu/drm/ttm/ttm_page_alloc_dma.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c index 3ac53918881e..4c659405a008 100644 --- a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c +++ b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c @@ -333,14 +333,18 @@ static void __ttm_dma_free_page(struct dma_pool *pool, struct dma_page *d_page) static struct dma_page *__ttm_dma_alloc_page(struct dma_pool *pool) { struct dma_page *d_page; + unsigned long attrs = 0; void *vaddr; d_page = kmalloc(sizeof(struct dma_page), GFP_KERNEL); if (!d_page) return NULL; - vaddr = dma_alloc_coherent(pool->dev, pool->size, &d_page->dma, - pool->gfp_flags); + if (pool->type & IS_HUGE) + attrs = DMA_ATTR_NO_WARN; + + vaddr = dma_alloc_attrs(pool->dev, pool->size, &d_page->dma, + pool->gfp_flags, attrs); if (vaddr) { if (is_vmalloc_addr(vaddr)) d_page->p = vmalloc_to_page(vaddr);