From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE227C5DF63 for ; Wed, 6 Nov 2019 14:57:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A47E8217F4 for ; Wed, 6 Nov 2019 14:57:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573052276; bh=fLx+rR+O1M/G3s+LeNAjqQyKfbb66KfBaaPibvTMyWU=; h=Subject:To:From:Date:List-ID:From; b=XRvE/SDs0nw071ef9lkKPSH1W6fvihEc00hEO5QMDR7t+DXPUXlsCKX0urNquyHJF wceMkl1MnikttihPD6CDg7RVM9YHaHQC3mAd9tJ7xRgZltJoJvtc4kLz04CLZdSqPQ gucPHyw7COXPIUtnlkdePaIgC7uCFJrd0VD521CM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727275AbfKFO54 (ORCPT ); Wed, 6 Nov 2019 09:57:56 -0500 Received: from mail.kernel.org ([198.145.29.99]:35240 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727231AbfKFO54 (ORCPT ); Wed, 6 Nov 2019 09:57:56 -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 C1585217F5; Wed, 6 Nov 2019 14:57:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573052275; bh=fLx+rR+O1M/G3s+LeNAjqQyKfbb66KfBaaPibvTMyWU=; h=Subject:To:From:Date:From; b=dTOI0UpIi2Rd3iszDI9bdWxKt9Vnm14g/E7Hm0Nohj7SyAEOkEAsxd1cC1ObbnvRb LzemZNG7bUQt43k7fNXVOIfq0eEQPAQGzurdL37wgPcQc8xh6NxiekFBocUnCovZf/ LirwxXKRUsFiF08uF927qnn+9ujXqE4Nw526R5WI= Subject: patch "tty: serial: fsl_lpuart: use the sg count from dma_map_sg" added to tty-next To: peng.fan@nxp.com, gregkh@linuxfoundation.org, stable@vger.kernel.org From: Date: Wed, 06 Nov 2019 15:57:34 +0100 Message-ID: <15730522547629@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org This is a note to let you know that I've just added the patch titled tty: serial: fsl_lpuart: use the sg count from dma_map_sg to my tty git tree which can be found at git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git in the tty-next branch. The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.) The patch will also be merged in the next major kernel release during the merge window. If you have any questions about this process, please let me know. >From 487ee861de176090b055eba5b252b56a3b9973d6 Mon Sep 17 00:00:00 2001 From: Peng Fan Date: Tue, 5 Nov 2019 05:51:10 +0000 Subject: tty: serial: fsl_lpuart: use the sg count from dma_map_sg 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". When enabling iommu for lpuart + edma, iommu framework may concatenate two sgs into one. Fixes: 6250cc30c4c4e ("tty: serial: fsl_lpuart: Use scatter/gather DMA for Tx") Cc: Signed-off-by: Peng Fan Link: https://lore.kernel.org/r/1572932977-17866-1-git-send-email-peng.fan@nxp.com Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/fsl_lpuart.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c index 22df5f8f48b6..4e128d19e0ad 100644 --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c @@ -437,8 +437,8 @@ static void lpuart_dma_tx(struct lpuart_port *sport) } sport->dma_tx_desc = dmaengine_prep_slave_sg(sport->dma_tx_chan, sgl, - sport->dma_tx_nents, - DMA_MEM_TO_DEV, DMA_PREP_INTERRUPT); + ret, DMA_MEM_TO_DEV, + DMA_PREP_INTERRUPT); if (!sport->dma_tx_desc) { dma_unmap_sg(dev, sgl, sport->dma_tx_nents, DMA_TO_DEVICE); dev_err(dev, "Cannot prepare TX slave DMA!\n"); -- 2.23.0