Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3796714ybi; Mon, 29 Jul 2019 12:48:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqxSYMI7XGjMldz6WBsYh8ERU4mihghuAGyFFaAKJ3+jJjDq4/Lajp+dfz3lWiMwPZ0sm6Ab X-Received: by 2002:a17:902:9b94:: with SMTP id y20mr111461404plp.260.1564429712375; Mon, 29 Jul 2019 12:48:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564429712; cv=none; d=google.com; s=arc-20160816; b=pLAbyHuUiMMpbbzjIiu2IfdDp05Mxsfpj8mwtu8WaQooglsAeClSWWZXGCzL2zoebZ xFI+rlsXjgtI1vtsOxdsBxmbox3CZjBCyPZoWTWi/RKwm+C42e0ikKo6Ulii0a5DeaST F2Ieiu31eKODTUi/xpSxApYHKf3uOp2Cw+OvLyiC59ZMmGszHAvMIKgSXRTcl7hTKESB pbXQkpacyXzf6i5ObAFJ5JQQIMEp0oyZY+gaXrq5CVsGa7bFUfBR1atos5zm1PWi+Ty2 u9jnrAbDswsoPCEdPpDzK9NjHOXYVpkt4qMSMozcsQeN6kvbvQHX2KYv9wFcQ/vSA46O YdtA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=fRpxi6H1rxe61y4e+qjn6mduzsIEJMhmVqo/oJT8GWc=; b=dPWAxwbXjQ15vgPQdAqkXUHyaUVsim1b7mjpIp3n2kgago3h+Wc3wkJeTKXWlJH+5h HcElHdoWnp/mpcKVTnuh1+P3Nu6C83G0OLWnx7t0+ZMuqYrtYmK8cfzkPvOy+T/VSv/9 7P9IzHal6BWp0gEKmu04Kh27/IUgqjeQaiNQ97du7K72vPTLTO4hjCqCgE4DarRbXcdh 6ZH41pAjGZprAQO21vuhOvZzzIMKHdQCLXtIdt/AuFcMvKD9X5+/IPs0qQ4KfzI7I8H0 WaieVCXNOkRDAd2QBuJIdFaXN0/DVo7PaZj9e5PkZcm/cD7owM9eP/fw9HYTJbO1B5Hk zV3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VqpMr7gM; 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 u126si16536349pgc.418.2019.07.29.12.48.17; Mon, 29 Jul 2019 12:48:32 -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=VqpMr7gM; 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 S2390286AbfG2TrC (ORCPT + 99 others); Mon, 29 Jul 2019 15:47:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:36526 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389901AbfG2TrA (ORCPT ); Mon, 29 Jul 2019 15:47:00 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8D5B52054F; Mon, 29 Jul 2019 19:46:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564429620; bh=P5U4o4WKb59SFHAyXNC8P7Bgk1YTKDn1oZLBMjNrS4M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VqpMr7gMLzylUgEzNJAHYQaky555sq131mvKcOMFt+oiikv/Sp4KDIhF7hWgeIR8A jvF8PtR8eKgWC5NuexgQFpDVlsdN+MBx530dxz/k+jTvOaTnuMODI9g7KVG68uf+3z 9RkWyxON+ogI/r6JKbDsTtEbJPdn6mTH1SxG3M4s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thierry Reding , Sasha Levin Subject: [PATCH 5.2 042/215] gpu: host1x: Increase maximum DMA segment size Date: Mon, 29 Jul 2019 21:20:38 +0200 Message-Id: <20190729190747.812253328@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190739.971253303@linuxfoundation.org> References: <20190729190739.971253303@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ 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