Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp836556ybi; Fri, 12 Jul 2019 05:28:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqyHlZUknsdhfQWr5mkupWsA6jkluGgZb8MdIijJMfpd2tX0GzzxktbcDEjHtqhkR/W/RxPa X-Received: by 2002:a63:f304:: with SMTP id l4mr10489859pgh.66.1562934488442; Fri, 12 Jul 2019 05:28:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562934488; cv=none; d=google.com; s=arc-20160816; b=EUPLflj8He7I1QmAnUwwx0DwhINyKSvXiJox6hfdRDb7cpBUqpAqGY8KIHYZ3rVAVl +l5bCzp3PMauBVOfEYPyC63PLlMYsZEtnyDvUH7JR8N2H+eAiaaMKo4zneXJMebNRa0j 6V9Ca+XcPojffr0kk6euOYgeEb8KAXdzg0MEohpd8jglenbdPKuJX5Xp+H4gqBO8o7r3 FWZ1fM8UlyuFEHlNaLyhU8c4ovpoD/tVJvDSkQwLlQTnwRjyeS9WX7vF5jh4MZGGnBIQ 0AJkp9djjzpGHC7uVD/Mz7+TsvCK3y6pXWaqXpMu052wYzVA0FH2Kf5sR4pqPEtSeVl1 B8wA== 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=MOFLuMFm2BakB8SzFfFGP580viQRcp/CbzuAY+arcdg=; b=AgOU+u27RXUZVEH8sHFrdLrGKR/JTwJwA/mzhPa16b5stvMbZNeV4XY+A0Pr8bJAOI TCaUwXV7NsQ1Lnj50fidCf3LUGuwhF3hZk0QKx8GzkVnL2Y7QAHr8rdA5hUm56O8v3tt o3UzEV0VIGFClUl1qx1wvnMCpuP0iXYPnPzoZrhmrtVmUUJElxbjmnSlFn0j9Ic2xIQb GG5oNfQEPyjcjOg0FXcYF9fxTX76pgisiLrY1P4RVwkx+hpTI813HbILadeqnoQud9fr 7c7ZdUdF7VuTdkcV9wOe6iWRz+ENyv3khFPRHCt6VWzLWqIs9nbR/YtMWk8t4VZ8puUW yRvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XiJGjxKj; 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 z25si7861879pgk.415.2019.07.12.05.27.52; Fri, 12 Jul 2019 05:28:08 -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=XiJGjxKj; 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 S1728193AbfGLM0x (ORCPT + 99 others); Fri, 12 Jul 2019 08:26:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:38518 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728030AbfGLM0u (ORCPT ); Fri, 12 Jul 2019 08:26:50 -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 798E22166E; Fri, 12 Jul 2019 12:26:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562934410; bh=5gkJJ5R8e4wrPwmocAUVJJYM+67wBshn7GOo+aQGpTs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XiJGjxKjo1ZCcNr6cxS5xbTxv7cw0JZyiILyviv85rEXc4EbzW53x9lkXnWwVSyiM sbGRYqvT3YTMWkRnxBT1DIQ5fmTvA4DUbsJUov+9iS6z9nVV51g53QhhfikEV70pWC O3V9iWyS3vnZ3b7LFmcGUXg/p8Ic5/n3vUcC/bCM= 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 5.1 046/138] drm/vmwgfx: Honor the sg list segment size limitation Date: Fri, 12 Jul 2019 14:18:30 +0200 Message-Id: <20190712121630.435232349@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190712121628.731888964@linuxfoundation.org> References: <20190712121628.731888964@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 a3357ff7540d..97adee1f0575 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c @@ -454,11 +454,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