Received: by 2002:ab2:7a55:0:b0:1f4:4a7d:290d with SMTP id u21csp501239lqp; Thu, 4 Apr 2024 23:12:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWV0+Jfn54v1bytmzxlgr3S9rjEAvJXusE3B6+PRhVcqUkVRipzg3uUrUkUevNYFM9WLjfnII/lQ5kZPQxdQqUvNA2cB6dH4jDAZCaAFQ== X-Google-Smtp-Source: AGHT+IEn4/avmy9z+whaaZEd1ByN5sME76HEA7T0wINO9E3/NPpddjV8CgVd7jQly2Gvb0yT7IuS X-Received: by 2002:a05:6358:7b91:b0:17f:58a1:12ef with SMTP id n17-20020a0563587b9100b0017f58a112efmr718253rwg.4.1712297558839; Thu, 04 Apr 2024 23:12:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712297558; cv=pass; d=google.com; s=arc-20160816; b=ylM5C33PCcEWWvRSLP0xisEhH859j36T4vlfrNsILnhetSDQPWA9MnkBmfqaLIYdNx oTvPqO6RCxizWD5ebLNhytWfEhk9/XkgnpEJonnEO5z0EFmpU3XROupNNpXckjZ0m7vn JeM4BNct7KcP9ovub5HNFk/aykTYtMV4zIrvrD+2P0Dxvj11TLLjHHKmkKNswBcnFT/W fb0pPZfPRJYjy5UAl3WkychtaauQinheM878BHbGqMWVnnobfelOHfe1boN95NEddo05 1KS5faQ08pbJKT2M34JcyjzP/jE8Avex1MOxzopcDgrNChQDLnvvsorGtfyb6CQYprxY F3Lg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=5q3zd5E/6R1QVeji5djwTwQZyfcCs8b1Manxa1AHPpQ=; fh=1YNwm5KBWetjB3qGkhgLqh/dZnCTsWuqRk83JW6hjgE=; b=HdBeTwCkHyYSe73Q5T8qXfXCeNsZwW92pLht9Lisd35grw0uW8XTfYaHIrB55OZFM4 INo0mQntv1V9X7Pq30azrKehiwUfJ9k3eZFv7j9ated2/yr/HsZAP9yT+3eHkyYwtG6/ DAJ08v2IhPImiJC/oZW5+iZYJxE9oDJMu6BkSwveyJLi+A/QUfUe9ZlV+VveFuB/G3nY X29rPePEl176BOpYWjtLAu0MbRb6pmrhUhyU/wGMKqc5NtPylt96umEajL+6P0hT+hZQ YjDREuHsUaw7S+oKGniVDbaWcjGg/qj7oUvGoBZOO5V2pK/ZIZZ+dYL4lSfMOrCC97WO p7yA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WQCiKTp4; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-132445-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-132445-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id r33-20020a635d21000000b005f0a5133dd6si800783pgb.300.2024.04.04.23.12.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 23:12:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-132445-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WQCiKTp4; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-132445-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-132445-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 99949B25668 for ; Fri, 5 Apr 2024 06:10:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DBF09374D3; Fri, 5 Apr 2024 06:08:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WQCiKTp4" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F0DEB364D6; Fri, 5 Apr 2024 06:08:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712297336; cv=none; b=TpPviBoU9Q89P1Le2SG9nETm1eAh1Jdp1MDWf69a31bJLlB9aZ6qzH16Fn16wxlxCjW3pd7tw3atvWSG2kS6QKPrYu30b3OMJJx0/41z6io3R6wcVa91ETE04Pry50HZfKJESEDJ0/FZ6RHfRxR6BWTlqTvObJ/QJc+dNx/QGxk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712297336; c=relaxed/simple; bh=wKzRdXC2CGMBk+yjNkNCtzVfVM9PNiFuCla4o//SuBU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iH6ENtrZyvsB4DJjXclKFhREWjqumeId628n11zab2Sr7NQ59rsGtmfefqCAczGr3ybtaUBfihE0YPl/GetvQj8oim/ETTAU4k03kbsRO1GldW8AT7SdaVm7vrbg3k1uDPpgknQf34O4i1ByFSXPvZf/aiDNXyIDF+4hXzX/5+I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WQCiKTp4; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8ADCDC433F1; Fri, 5 Apr 2024 06:08:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712297335; bh=wKzRdXC2CGMBk+yjNkNCtzVfVM9PNiFuCla4o//SuBU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WQCiKTp4Nx5eAhn9e8KYYeoAJkkurUKLeQbIsyUmIAA5EK+V+p/eaDqVnXQhVTcVi m3d/M7VivYlVryTTiKPr/DAsW6TVMBChauCYc5Azo2BUcRBpAh97VU0ist5CAM1n+O z4ybF+GlHxZbwqJG+9/DVAXtbKaLzpeZrz0xlXa9wKaw16eDawY22eA0VKDMX9tldx rsCVnZ6smPbm/5wmIbRnqGXhV4CM/H+HzHZrHMF6gkNVfd+HTWEgTqNF+VXIDVAHLb HFf9YW4TGZQujv/6CjmoszOJ8fO9yV+yVbUQZvK7dwCSjPXqrHUPHATCOtjk46yc+z jh4bHsraiAnkQ== From: "Jiri Slaby (SUSE)" To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, "Jiri Slaby (SUSE)" Subject: [PATCH 09/15] tty: 8250_dma: use dmaengine_prep_slave_sg() Date: Fri, 5 Apr 2024 08:08:20 +0200 Message-ID: <20240405060826.2521-10-jirislaby@kernel.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240405060826.2521-1-jirislaby@kernel.org> References: <20240405060826.2521-1-jirislaby@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This is a preparatory for the serial-to-kfifo switch. kfifo understands only scatter-gatter approach, so switch to that. No functional change intended, it's just dmaengine_prep_slave_single() inline expanded. Signed-off-by: Jiri Slaby (SUSE) --- drivers/tty/serial/8250/8250_dma.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/8250/8250_dma.c b/drivers/tty/serial/8250/8250_dma.c index 8b30ca8fdd3f..8b2c3f478b17 100644 --- a/drivers/tty/serial/8250/8250_dma.c +++ b/drivers/tty/serial/8250/8250_dma.c @@ -89,6 +89,7 @@ int serial8250_tx_dma(struct uart_8250_port *p) struct circ_buf *xmit = &p->port.state->xmit; struct dma_async_tx_descriptor *desc; struct uart_port *up = &p->port; + struct scatterlist sg; int ret; if (dma->tx_running) { @@ -111,10 +112,13 @@ int serial8250_tx_dma(struct uart_8250_port *p) serial8250_do_prepare_tx_dma(p); - desc = dmaengine_prep_slave_single(dma->txchan, - dma->tx_addr + xmit->tail, - dma->tx_size, DMA_MEM_TO_DEV, - DMA_PREP_INTERRUPT | DMA_CTRL_ACK); + sg_init_table(&sg, 1); + sg_dma_address(&sg) = dma->tx_addr + xmit->tail; + sg_dma_len(&sg) = dma->tx_size; + + desc = dmaengine_prep_slave_sg(dma->txchan, &sg, 1, + DMA_MEM_TO_DEV, + DMA_PREP_INTERRUPT | DMA_CTRL_ACK); if (!desc) { ret = -EBUSY; goto err; -- 2.44.0