Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8506773ybl; Thu, 16 Jan 2020 18:20:37 -0800 (PST) X-Google-Smtp-Source: APXvYqxOyDap8y2flFRNpKG4YbOO896aE+flg4elUNA1To/TADDRf+Vemv3q/GLMv3DXzV1KheRk X-Received: by 2002:a9d:12cf:: with SMTP id g73mr4364615otg.329.1579227637515; Thu, 16 Jan 2020 18:20:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579227637; cv=none; d=google.com; s=arc-20160816; b=Ezcei/NkaX/7xJq3fyD1Gbm9G9kbzrw/MLKHNAVBkyut63axoH2tjw4YTqTqd/kVnR /+bvexD04bP22dEDM5tEWH576AiWzkzhaW5PRXWNtyU/Wpd/wKQwPDDrhhtyhE71h7gW wyz2skS5Bon8yH/11ldjUJacPXTSKKbGANEaIUD6tL2dvkrAByLvA7JcEkh4s0eevUDO Kof2p48PFjficoMSBsOUG1ci40GElNTto24dQbdYj7455V37jRRM+PrnnlRxKS1ImQyl 63WNPu2eR1icTi8VXrdQ+dG0B+ffU46Nu9b8sPSkAMBwZ68A3xsJxCX8jcxBx397G9En ArMA== 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=R7TUKGm/lZJArOGRUB4IajcnHr/iIxWkmMMQ+Uuwx2o=; b=Ecr6ZxSNjH4XdClP2gRxJVmt/2Pmud2nrYcXDp54hukJoWPF+gZIYEDHiAfU+5kj9F 713D/g7nDsQq86GcaFfNF6djVentmdRLZYPF4eQMww/3xdbZeWWyDkqq7LoFwxTHNyw/ 5osLIc2sZQr3JqfsOgqewD3eTBBgDKtHNqc+B0zzoCxCWPhZZKoliUuO2kZr1dnJG7pd hS9twuGJ28yzW8DGog5GvEogJ0gPFKIqBauH4FG/nU14qHGMYb6gO45gyxBEygbO2Dyy LTj8a5FEX38mu04sgAzpWJy3846vJi6NSMUQ3cAZfUz6PMhSRITPX5UgBaHqggS2bT76 lpWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="j6G/ogJe"; 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 v23si13740029otk.321.2020.01.16.18.20.25; Thu, 16 Jan 2020 18:20:37 -0800 (PST) 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="j6G/ogJe"; 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 S1729693AbgAPXZq (ORCPT + 99 others); Thu, 16 Jan 2020 18:25:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:55180 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391172AbgAPXZa (ORCPT ); Thu, 16 Jan 2020 18:25:30 -0500 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 8208E20684; Thu, 16 Jan 2020 23:25:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579217130; bh=XTqnGcvS7WqidMv0v2cIiMxDnZKfcC1Qt09ZYW3LVyI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j6G/ogJep6UaLYWsGSKMThzcxzwUQi5kst2XQSM5ypK4seGj3XpnEvYahDbp7Lr9L lZuUvyUg+hr1jiJ9ptAO8FkWz9O+sU8UBndHWnUoYbvIaGzdzbkviljbiSVctlWiWv vf3zbV+T5/58uJHhKnX/jElAWBPYY2QH2sGebFnw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peng Fan Subject: [PATCH 5.4 143/203] tty: serial: imx: use the sg count from dma_map_sg Date: Fri, 17 Jan 2020 00:17:40 +0100 Message-Id: <20200116231757.466034926@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200116231745.218684830@linuxfoundation.org> References: <20200116231745.218684830@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 From: Peng Fan commit 596fd8dffb745afcebc0ec6968e17fe29f02044c upstream. The dmaengine_prep_slave_sg needs to use sg count returned by dma_map_sg, not use sport->dma_tx_nents, because the return value of dma_map_sg is not always same with "nents". Fixes: b4cdc8f61beb ("serial: imx: add DMA support for imx6q") Signed-off-by: Peng Fan Link: https://lore.kernel.org/r/1573108875-26530-1-git-send-email-peng.fan@nxp.com Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/imx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -619,7 +619,7 @@ static void imx_uart_dma_tx(struct imx_p dev_err(dev, "DMA mapping error for TX.\n"); return; } - desc = dmaengine_prep_slave_sg(chan, sgl, sport->dma_tx_nents, + desc = dmaengine_prep_slave_sg(chan, sgl, ret, DMA_MEM_TO_DEV, DMA_PREP_INTERRUPT); if (!desc) { dma_unmap_sg(dev, sgl, sport->dma_tx_nents,