Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp852549ybi; Fri, 12 Jul 2019 05:43:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqwDRjq2F6QN71wZi1f2Dg6/nHE2xWUZs/Dagy0B4mREckJtjEqMKgsLtKjpYHjDkqWqkxKz X-Received: by 2002:a63:79ca:: with SMTP id u193mr10625403pgc.91.1562935422725; Fri, 12 Jul 2019 05:43:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562935422; cv=none; d=google.com; s=arc-20160816; b=YsaLo13SWr8UjVO+VpLny6e4nBsah0YDF4jom1SzpzEwaubtHGnl/JIOSmz5Kyd6F4 3EJlG0fF6tnplcZSzgxA4mkCNfjSk3aL/Y/THC86AkG3rT6ofu3aKk0Y4y3IJcd28to4 nkbp/qNdb8tKsDMTv3FMY04Ur0Kiu/z8FCJIccrzYDVVWiX+4LYmTX9cyUlnFfTdqQa9 GQP6jLgbmakQ0UefZolnls31t4/gCTy50mY2CxVh4ayB3muFowgMLPE5N3pXOAWnZqIf se2OeXpb7RE94DW0EW10TKEdsz+cmw3D9D50PfB2nJfRr6BqTsA7lklPQaLfDgb7BuYn l1sw== 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=syfcoZeqYuxLi2P0sBEtizfjsEpVJqKyh/UH8UupUdU=; b=PjDmf7P2ZxnOfGQej053Y9HeQio9clSalTfcnM+QA9cRKf6qOLlG50KMkoQV5Y4ERi rDZYwTVqoR3h5P1xTvpZZwptm9HzsM3hhxMTdllGGLi9+ASMvuUVg7JtE3HX8hKMd1LK bKqG34yJdZyOkVpmSkE7yy7T66hIuiagUZkse9OLysL00kCL9+cNFvcalMiDxIAtQW0E IHzsSy/YcW/X6Ok71mR3xxx8X+7M+/l6vbP49ZEePBiwhQXf2cnmeQ9uyFnu8Y6cBKaM 9AYWmX+6Y6mcy7w7MKQ/FpZAdg/NuTZKtFW+b9CJ1xSbpUZb8p8wHZE0qo68WFuCzfUm mmfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Fl8w3hEZ; 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 z26si7491027pgv.462.2019.07.12.05.43.27; Fri, 12 Jul 2019 05:43:42 -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=Fl8w3hEZ; 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 S1727792AbfGLMmW (ORCPT + 99 others); Fri, 12 Jul 2019 08:42:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:54274 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727428AbfGLMUq (ORCPT ); Fri, 12 Jul 2019 08:20:46 -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 F05F5208E4; Fri, 12 Jul 2019 12:20:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562934045; bh=8/Qz2aX3souvgmyffd9xNLg5D2ae/5yYYya+OBpprt0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Fl8w3hEZonKQR3SM1q7tyyLu6MYw6WcKEoXqs6Hejmqi9ACMLzKu4fZQr3Phfulto PMRRxhNYqcm1QZHcDzxs13QD2R3kpBkMf/sBZB+BIa7QjlFMEE9WUpWww/7TIgR3Qi 4iccRz8htoRi3YmZLVJXwAbASwazTgI/7NYxxOOM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thomas Hellstrom , Deepak Rawat , Sasha Levin Subject: [PATCH 4.19 28/91] drm/vmwgfx: Honor the sg list segment size limitation Date: Fri, 12 Jul 2019 14:18:31 +0200 Message-Id: <20190712121622.896948621@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190712121621.422224300@linuxfoundation.org> References: <20190712121621.422224300@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 bde15555ba61c7f664f40fd3c6fdbdb63f784c9b ] When building sg tables, honor the device sg list segment size limitation. Signed-off-by: Thomas Hellstrom Reviewed-by: Deepak Rawat Signed-off-by: Sasha Levin --- drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c index 31786b200afc..f388ad51e72b 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c @@ -448,11 +448,11 @@ static int vmw_ttm_map_dma(struct vmw_ttm_tt *vmw_tt) if (unlikely(ret != 0)) return ret; - ret = sg_alloc_table_from_pages(&vmw_tt->sgt, vsgt->pages, - vsgt->num_pages, 0, - (unsigned long) - vsgt->num_pages << PAGE_SHIFT, - GFP_KERNEL); + ret = __sg_alloc_table_from_pages + (&vmw_tt->sgt, vsgt->pages, vsgt->num_pages, 0, + (unsigned long) vsgt->num_pages << PAGE_SHIFT, + dma_get_max_seg_size(dev_priv->dev->dev), + GFP_KERNEL); if (unlikely(ret != 0)) goto out_sg_alloc_fail; -- 2.20.1