Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3134494ybi; Thu, 18 Jul 2019 21:42:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqxecoUsuDkf9x40rTD3q1c9tUT8qosDyrG0WPK/gl04/dELvws0xci88j2QSxVI1Ge6Cdu/ X-Received: by 2002:a17:90b:d8b:: with SMTP id bg11mr55350539pjb.30.1563511340181; Thu, 18 Jul 2019 21:42:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563511340; cv=none; d=google.com; s=arc-20160816; b=AjriGWeyPMCcF9i8Zgn2bcj9G7yVgET5g6PUgcBwrCpMaWsXcvOpAAT8v6uKzlq6x/ MNR0RQhOEOskN9UBa8pELHLjF7GmgfIHgEhKLvQPL1iUmvUzGzS9VR/YiuyeG8obdOe3 Hh4x8ChQJIysJz0kGPoTkruyaxzNQis/U0taLQlM033u9U/0swL5wdmhY3MuLZESRPTb 2tUwHewPFqgIBUnOX6NLZHFo7HICuSmfcUhH+QXPMcdf0WZQ2uCzv9k88o35snX2UYF9 Ff/NT3gIl1GdL8FD+Z32s1OoTzEyEi7v1fEwQjcj+EuqN8ZZYnZi34lMtWhq3yonuBqp 6Unw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Bg9opqPInxCDdq1K0baoMhyWazu5GHpqwVCPWmmS/oc=; b=IxyIXmeMaghLvnJlD/K2+dDUlRp+YWY5n4I1ZkDNycxDoSLgCSPOLzZHOgo1fbRGtz OukSuipCjbJsiZHj3/xBsJx1Sf4HcTPwBuSaxTbPLjKhlbsROpK9QLWA/E2ECkUdAIn1 95WgUl03PYFqQ3inJZO/ksYYh7OEb7juGo+mAlmHwxCtDjrS2+PLeJbAX6puj0/F1NYC zmQ26Vy/lwR4d2nGlv2Ia2tTlKxm4YYPYgo1jywgyqhXwiqkO8mWjjov6orBLkh6TW92 90w7jTaSEB0F587OnOIaPMy53FI8zyqc/9Cx5ZBoXdW0icWTDZMwKGXHhf+24sY8utGW /GCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VlaiSkmG; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o21si225099pll.169.2019.07.18.21.42.04; Thu, 18 Jul 2019 21:42:20 -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=@kernel.org header.s=default header.b=VlaiSkmG; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728031AbfGSD6Z (ORCPT + 99 others); Thu, 18 Jul 2019 23:58:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:57660 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727891AbfGSD6V (ORCPT ); Thu, 18 Jul 2019 23:58:21 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5D51721855; Fri, 19 Jul 2019 03:58:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563508701; bh=A8V1gvm+yaht1CTUyJ/J+QZqRvGR/yXURvSy6UwnNUc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VlaiSkmGPPBkB1SzAYxXkk6pDs/G0SZZXYxPab2j1TSRBEI01Q1eSH0Fv1mvqSAX5 y8Gfamd5N3cRDIE3TDxs7WdRz8kA0zCpR//MNxuNGVDAIUp9XmwfsaoccTpDahRNz8 KpKPj3cq8FVTB/E041J8sd0ONAqQP/vQT0TUZoDM= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Thierry Reding , Sasha Levin , dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org Subject: [PATCH AUTOSEL 5.2 040/171] gpu: host1x: Increase maximum DMA segment size Date: Thu, 18 Jul 2019 23:54:31 -0400 Message-Id: <20190719035643.14300-40-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190719035643.14300-1-sashal@kernel.org> References: <20190719035643.14300-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Thierry Reding [ Upstream commit 1e390478cfb527e34c9ab89ba57212cb05c33c51 ] Recent versions of the DMA API debug code have started to warn about violations of the maximum DMA segment size. This is because the segment size defaults to 64 KiB, which can easily be exceeded in large buffer allocations such as used in DRM/KMS for framebuffers. Technically the Tegra SMMU and ARM SMMU don't have a maximum segment size (they map individual pages irrespective of whether they are contiguous or not), so the choice of 4 MiB is a bit arbitrary here. The maximum segment size is a 32-bit unsigned integer, though, so we can't set it to the correct maximum size, which would be the size of the aperture. Signed-off-by: Thierry Reding Signed-off-by: Sasha Levin --- drivers/gpu/host1x/bus.c | 3 +++ include/linux/host1x.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/drivers/gpu/host1x/bus.c b/drivers/gpu/host1x/bus.c index 9797ccb0a073..6387302c1245 100644 --- a/drivers/gpu/host1x/bus.c +++ b/drivers/gpu/host1x/bus.c @@ -414,6 +414,9 @@ static int host1x_device_add(struct host1x *host1x, of_dma_configure(&device->dev, host1x->dev->of_node, true); + device->dev.dma_parms = &device->dma_parms; + dma_set_max_seg_size(&device->dev, SZ_4M); + err = host1x_device_parse_dt(device, driver); if (err < 0) { kfree(device); diff --git a/include/linux/host1x.h b/include/linux/host1x.h index cfff30b9a62e..e6eea45e1154 100644 --- a/include/linux/host1x.h +++ b/include/linux/host1x.h @@ -297,6 +297,8 @@ struct host1x_device { struct list_head clients; bool registered; + + struct device_dma_parameters dma_parms; }; static inline struct host1x_device *to_host1x_device(struct device *dev) -- 2.20.1