Received: by 2002:ab2:23c8:0:b0:1f2:fdbc:cb93 with SMTP id a8csp55814lqe; Tue, 26 Mar 2024 20:35:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWmiTmbzDdnuQvIw1WWNK0rzXCqSOBi6S2girFIbObH7Z9ffrLdfmnVCpkVT7/kSIpBoCuTBeb2Pcxq6yi7JdowkhYUZgIXUIUE29Ua/w== X-Google-Smtp-Source: AGHT+IE4SaRYNoaFdf2bj7CVis3nham/Up+T8iiy79luWTALV0vMjzSBE61AB5ijcWOuFhNWTq3M X-Received: by 2002:ac8:5ac1:0:b0:42e:f5bd:b30c with SMTP id d1-20020ac85ac1000000b0042ef5bdb30cmr13552378qtd.57.1711510513977; Tue, 26 Mar 2024 20:35:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711510513; cv=pass; d=google.com; s=arc-20160816; b=bvhLLNypas1EKQSfoV4BTgYjOEmGUs2AdY9r6tIAXtUHtDfOm7FqnQP0nXqDFh8kjT 1w+D+7ArwUA8wBgtr/3f919ZbNxLJqjRroOaGv/qbfjB65QGXbTLkjbpWRZopOqlt/Hb yOWBapF+ToyQP2WSZ69SJ2zyKd4yRoe46wtkzbE+TitwodCkx0h/5cXH1sPQgxJcS5Xu yn+TRdE5alnl4fRf8pSJbtRSwa5kYOM1mGsPEhFFz1j1KFQjBcsfZunEYv6LAqtVBVGB 0oGsIiIYEJz0OplSi4odra52j7dYOVYiXRurJC+0e2AdwkdKy9GFsfp1nMfltLFdz8/m UydQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:dlp-filter:cms-type:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter; bh=4vLIx4cKbVxH4k3P7I50/kDpmxK4TCaZJ+e8oBu8dro=; fh=qjTvvVAfR5+N+KsuIURkjdAGSAg1BelW2GbMVxNvo+Y=; b=uL0BqWyHOcF24Q37vacuTv/UESabvHEV5k+k0Bx5ODZ5Q2gqT03Ka+7c2vqtHNA9D3 DtdZhKX63vSwHtTJ+cnCb75SvMn+JJ3NOkhUCJg73ak/bspcsxQdtxcUP6L6dJLIpm42 25o8fjNTRkW1OdGYplw0UEyjNK/dc4YCvfFXPbZb1XVSDMSmestViyD/jw/ST5b6jJId MVDwW3L3AGRZU2Mtmh4/Kr35CORI57bzhm579gf+azCOXC6bGT+Vjrqxq5dlTlI4MKUz 6yrqUgcTw2Q9Kpu0mTq5zSLblXL/15ld8Pvp3fzgd28eZkatbx0LzzszfV/uje/PaZ3L vW5w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=iZi6g87e; arc=pass (i=1 spf=pass spfdomain=samsung.com dkim=pass dkdomain=samsung.com dmarc=pass fromdomain=samsung.com); spf=pass (google.com: domain of linux-kernel+bounces-120264-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-120264-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id i14-20020ac85c0e000000b00431618eb506si4416752qti.722.2024.03.26.20.35.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 20:35:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-120264-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=iZi6g87e; arc=pass (i=1 spf=pass spfdomain=samsung.com dkim=pass dkdomain=samsung.com dmarc=pass fromdomain=samsung.com); spf=pass (google.com: domain of linux-kernel+bounces-120264-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-120264-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id A511A1C2360D for ; Wed, 27 Mar 2024 03:35:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0CC9322626; Wed, 27 Mar 2024 03:35:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="iZi6g87e" Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) (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 00A58380 for ; Wed, 27 Mar 2024 03:35:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.33 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711510507; cv=none; b=RnTKSZY3h2+Uj+PSOqK4RTOHUGazJxTivRaK8d464kmmVAc2n5QsVlYSpbILaiPNxlDkbr5mKsjAjOhZuPQuhjbpMeTzb5MpbJTwaiEXwoEzb9EpdDyDnT2m17GUcm3eZJ3Ycfu2R+vaYsbiVOF+GgVZkiVCxmKVsfqQBuzngfM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711510507; c=relaxed/simple; bh=yE4PMETRYM/2rpfGQXheo9i6JB20t0k0UI0M+ZWUews=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: References; b=GgPA5SH9SBj9V+t0KqoELlODwnWGy6VKZ2Wi0HAIJgJF0FxJCpQcam15mWIGmxYvxC0pRYvqv1mbviGwgReGo53T7GgNg5210REO8J32IoqJ+2F5TbooGrmEcwyoKJWaXvb6pwQT0HB2RJU8DOIeq+eHJaoq9dkmXbF5+vIV4WM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=iZi6g87e; arc=none smtp.client-ip=203.254.224.33 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Received: from epcas2p4.samsung.com (unknown [182.195.41.56]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20240327033502epoutp03e89f9005433181a7a21c82ba89642d59~AgbvzUGAb2505925059epoutp03M for ; Wed, 27 Mar 2024 03:35:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20240327033502epoutp03e89f9005433181a7a21c82ba89642d59~AgbvzUGAb2505925059epoutp03M DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1711510502; bh=4vLIx4cKbVxH4k3P7I50/kDpmxK4TCaZJ+e8oBu8dro=; h=From:To:Cc:Subject:Date:References:From; b=iZi6g87ey5by0Q6f2un91DzAOAAfMvHjRGZCsxE1TmoJXggJhp+xFVKk5RZItBwZU DyJF0p3hWBKAq/h7c+eKdkZwHnwLVnMC7DYuC2f2aCII8zqW5Yzg0fUipBSnn0EYFW 0jtAQbF6Rf94YufEyE+ZZFnTHg+Q1STnr1NvPBdM= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas2p4.samsung.com (KnoxPortal) with ESMTP id 20240327033502epcas2p4835a84a54f1999514440b7d361df4a41~AgbvcJbu02511025110epcas2p40; Wed, 27 Mar 2024 03:35:02 +0000 (GMT) Received: from epsmges2p2.samsung.com (unknown [182.195.36.91]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4V4C3T3MMwz4x9QH; Wed, 27 Mar 2024 03:35:01 +0000 (GMT) Received: from epcas2p1.samsung.com ( [182.195.41.53]) by epsmges2p2.samsung.com (Symantec Messaging Gateway) with SMTP id 0B.EA.09639.5E393066; Wed, 27 Mar 2024 12:35:01 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p2.samsung.com (KnoxPortal) with ESMTPA id 20240327033501epcas2p2bbe21301da5584f7f3a073c51a363c00~AgbuWqU8y1245812458epcas2p2F; Wed, 27 Mar 2024 03:35:01 +0000 (GMT) Received: from epsmgmcp1.samsung.com (unknown [182.195.42.82]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20240327033501epsmtrp2cac592103009f2358a153ff29e04f89b~AgbuV7hV42125621256epsmtrp2k; Wed, 27 Mar 2024 03:35:01 +0000 (GMT) X-AuditID: b6c32a46-8ddfa700000025a7-2f-660393e5a775 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgmcp1.samsung.com (Symantec Messaging Gateway) with SMTP id 82.91.19234.4E393066; Wed, 27 Mar 2024 12:35:01 +0900 (KST) Received: from localhost.localdomain (unknown [10.229.9.55]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20240327033500epsmtip10f06e521fafec7b31e710706bda00497~AgbuMrnZD0139001390epsmtip1B; Wed, 27 Mar 2024 03:35:00 +0000 (GMT) From: Jaewon Kim To: Andi Shyti , Mark Brown , Krzysztof Kozlowski , Alim Akhtar Cc: linux-spi@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Jaewon Kim Subject: [PATCH] spi: s3c64xx: Use DMA mode from fifo size Date: Wed, 27 Mar 2024 12:30:41 +0900 Message-ID: <20240327033041.83625-1-jaewon02.kim@samsung.com> X-Mailer: git-send-email 2.43.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupkk+LIzCtJLcpLzFFi42LZdljTVPfpZOY0g5VLxCwezNvGZnH/awej xdSHT9gsdjQcYbXY+3oru8Wmx9dYLS7vmsNmMeP8PiaLxo832R04PTat6mTzuHNtD5vH5iX1 Hn1bVjF6fN4kF8AalW2TkZqYklqkkJqXnJ+SmZduq+QdHO8cb2pmYKhraGlhrqSQl5ibaqvk 4hOg65aZA3SPkkJZYk4pUCggsbhYSd/Opii/tCRVISO/uMRWKbUgJafAvECvODG3uDQvXS8v tcTK0MDAyBSoMCE7487VG0wFZ7krWt9NY2tg3MDZxcjJISFgInGm7y5zFyMXh5DADkaJr5cP sUA4nxgllre9YYVzZn4/zgbTMmfDdEaIxE5Gibt39kP1f2SUeHh0DQtIFZuAtsT39YvB2kUE VjBKbLvwAWwws8B6Rol1F74wgVQJC1hJfFu8gBXEZhFQlZi9YQqQzcHBK2ArsfxdNcQ6eYm7 Z2Yxg9i8AoISJ2c+AVvADBRv3jobbLOEwC12ibPtDxghGlwktvx5DXWrsMSr41vYIWwpic/v 9kLF8yXarpyBitdIbFxwCarXXmLRmZ/sIDcwC2hKrN+lD2JKCChLHLkFtZZPouPwX3aIMK9E R5sQRKOaxP2p56CGy0hMOrKSCcL2kGhpnApmCwnESqz/9419AqP8LCTPzELyzCyEvQsYmVcx iqUWFOempxYbFRjBYzU5P3cTIzhNarntYJzy9oPeIUYmDsZDjBIczEoivC1fGNKEeFMSK6tS i/Lji0pzUosPMZoCQ3cis5Rocj4wUeeVxBuaWBqYmJkZmhuZGpgrifPea52bIiSQnliSmp2a WpBaBNPHxMEp1cC0uv5Ws7NSW0VP5tqpfP6TXh9Vzug2zJohe5H1zecpridXMVz6ZVB1rVhr arFFaX0A+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OCreWfd+KbkllTnFp6FrjImdnO9W1evOXVw doY8xxP5Cqk1N58pfJZZfY3B6XzUAevyi8arNx49vueA2RtFDgm184f3PDELSLlT7dZy7d3r k8v0Xy1aHntyjvok6/Oz6zol3j/1m16rl6ukxFKckWioxVxUnAgAnZWtWsgCAAA= X-CMS-MailID: 20240327033501epcas2p2bbe21301da5584f7f3a073c51a363c00 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20240327033501epcas2p2bbe21301da5584f7f3a073c51a363c00 References: The SPI data size is smaller than FIFO, it operates in PIO mode, and if it is larger than FIFO mode, DMA mode is selected. If the data size is the same as the FIFO size, it operates in PIO mode and data is separated into two transfer. In order to prevent, DMA mode must be used from the case of FIFO and data size. Fixes: 1ee806718d5e ("spi: s3c64xx: support interrupt based pio mode") Signed-off-by: Jaewon Kim --- drivers/spi/spi-s3c64xx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 9fcbe040cb2f..81ed5fddf83e 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -430,7 +430,7 @@ static bool s3c64xx_spi_can_dma(struct spi_controller *host, struct s3c64xx_spi_driver_data *sdd = spi_controller_get_devdata(host); if (sdd->rx_dma.ch && sdd->tx_dma.ch) - return xfer->len > sdd->fifo_depth; + return xfer->len >= sdd->fifo_depth; return false; } @@ -826,11 +826,11 @@ static int s3c64xx_spi_transfer_one(struct spi_controller *host, return status; } - if (!is_polling(sdd) && (xfer->len > fifo_len) && + if (!is_polling(sdd) && xfer->len >= fifo_len && sdd->rx_dma.ch && sdd->tx_dma.ch) { use_dma = 1; - } else if (xfer->len >= fifo_len) { + } else if (xfer->len > fifo_len) { tx_buf = xfer->tx_buf; rx_buf = xfer->rx_buf; origin_len = xfer->len; -- 2.43.2