From patchwork Fri May 31 19:42:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13682072 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AB18BC25B75 for ; Fri, 31 May 2024 19:47:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8EA33917PRok0k5lW2LqjoecNva0aeDcag9sG9PWTpw=; b=dHPDwcsh6/Vz2P EVXAG+LvshrlbNAT5kGpdMNGDnasLnpjxCEm/VApjfWbycI7W/uvf3v/FhYd4MUtGpNFsm4uq3Ko+ cCzS3HIYO1HXBW+4ME3Bvm6tJmTBiFlk5x4U5TG1CktiRE0DjAy/rdEVV41veghsdEbNqkNztN+VM /gIaNOOuDgnYTSqGzxQyyI+zVYKwMIxqVq87Jt04znFUiuWXLuzeHUnGguRdD2k73oQpPoRtLMQX4 lLcY/cI076Sdikau3MgDHZ+yAJJrTqvmFEOziK4xGs3VMHYZepqcoP1SS4R2AiugLXMISpwerl9G6 SEeW2TULHpv7lIeKFNfQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sD8E6-0000000BISc-03Fl; Fri, 31 May 2024 19:47:46 +0000 Received: from mgamail.intel.com ([192.198.163.8]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sD8Du-0000000BIOe-1swj for linux-arm-kernel@lists.infradead.org; Fri, 31 May 2024 19:47:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717184854; x=1748720854; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Dw73VBHvLlwJ5WnmcM+Jwh7n02iOvg6za1jV+ImKLH4=; b=DIjHp/xRrIpISTChamaEZRTseU4u5ru48MTtUntrnC4hXBPZLAt7dIrr AysEoeCj1+gzlg5Sps9/nSGW+GfajiU4A8fi+YqBLIi2OC35lPrlamBDg R11IUI/fARYBqJwx5LYzumtBu87mHN3CvL4QjaqRYGal0a72Gg09MRnU/ m/K2Gd6LZjCc4HFODvgiqvm/eKt5L0Es2dVBArbEmvIFHFob9NZbfj0PW 0fhywrjtKPKfrmUZ92Zt+gmJ+dMpLSIKGTK3lHalbAelFizhunfwKLZWE iKG/uqUwmdBWR+DaLXcja3tl/eAltXHPR7RwqdnfHMET1xfZDQCFLI3Cp g==; X-CSE-ConnectionGUID: ww1toHYDTJ6EJcHdOlg3YA== X-CSE-MsgGUID: owsVep7uSpmeqfXPW3nxlA== X-IronPort-AV: E=McAfee;i="6600,9927,11089"; a="31274002" X-IronPort-AV: E=Sophos;i="6.08,205,1712646000"; d="scan'208";a="31274002" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2024 12:47:30 -0700 X-CSE-ConnectionGUID: FTqvYBkEQNiQnSDTHsQIDQ== X-CSE-MsgGUID: F5BHzt2kRPyb0EUKNBFClg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,205,1712646000"; d="scan'208";a="41179049" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa005.jf.intel.com with ESMTP; 31 May 2024 12:47:27 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 013B7136; Fri, 31 May 2024 22:47:24 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Mark Brown , Yang Yingliang , Christophe JAILLET , Thangaraj Samynathan , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org Cc: Serge Semin , Daniel Mack , Haojian Zhuang , Robert Jarzmik , =?utf-8?q?N=C3=ADcolas_F_=2E_R_=2E?= =?utf-8?q?_A_=2E_Prado?= , Neil Armstrong Subject: [PATCH v1 1/8] spi: Introduce internal spi_xfer_is_dma_mapped() helper Date: Fri, 31 May 2024 22:42:33 +0300 Message-ID: <20240531194723.1761567-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20240531194723.1761567-1-andriy.shevchenko@linux.intel.com> References: <20240531194723.1761567-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240531_124734_632245_A6EC9358 X-CRM114-Status: GOOD ( 10.10 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org There are few drivers that use the same pattern to check if the transfer is DMA mapped or not. Provide a helper. Signed-off-by: Andy Shevchenko Reviewed-by: Bryan O'Donoghue --- drivers/spi/internals.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/spi/internals.h b/drivers/spi/internals.h index 4a28a8395552..47a87c2a6979 100644 --- a/drivers/spi/internals.h +++ b/drivers/spi/internals.h @@ -40,4 +40,12 @@ static inline void spi_unmap_buf(struct spi_controller *ctlr, } #endif /* CONFIG_HAS_DMA */ +static inline bool spi_xfer_is_dma_mapped(struct spi_controller *ctlr, + struct spi_device *spi, + struct spi_transfer *xfer) +{ + return ctlr->can_dma && ctlr->can_dma(ctlr, spi, xfer) && + ctlr->cur_msg_mapped; +} + #endif /* __LINUX_SPI_INTERNALS_H */ From patchwork Fri May 31 19:42:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13682071 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7EB64C25B75 for ; Fri, 31 May 2024 19:47:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zH7IRP9QpyXlCCJRCEBxGZSm5dWJlNDbkEgxcmAp6Xo=; b=UF23lwIuk8eFYB 5llXKwFXOIUfj2DF9s880Eu1GGNbudQBI2hHOcXAd1AxOagGKlY9cVDFeuKCW/jLT0SCNt9+0LegE PHOVtYTKS/UzN4mD9O2rQJ2SlREM1cNUauGO9wRQkHYXbKBbKViUijwJrSgsxwpBoQS5Gg8eXBPxD zm+VkG6dsnPlH5B8AKWr9+VirqzJsCuBWoExxbQWrXo8LciskeCLVEsoalgDocfoyTIWl3NoPftoz uiGOds0xgNG/ANdcKs+IE/j4NL5+UwNHgL7ysLFnGDlDBpR/ok1OaCAXTvoEqhg5PPzGquuqNU0OC P4boyIMPUAAamNS7SsaA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sD8E0-0000000BIR7-0VVT; Fri, 31 May 2024 19:47:40 +0000 Received: from mgamail.intel.com ([192.198.163.7]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sD8Du-0000000BIOt-1t7f for linux-arm-kernel@lists.infradead.org; Fri, 31 May 2024 19:47:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717184855; x=1748720855; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=h+TKuS+Kdb3EPN8yAMusweqbJNDGlVqQOxmyBy/mh6A=; b=RiiH/wTB5pdkP/SimkbFPjaWMRCMU0m7d46CyQ9YO+ReZwlyi4KBbdP+ HNZtGWn6KxAluZIzwHM37MHSRik5KJU4sRL+Jik+DAwsvE8jaV6OetACo FemHZPCgIs12bmfOrQ4wProst9mzImFy7g/oR3VW1pTLJYYulW+4vRTXy ux2uXs0JtFivP47zEuzr3IttTNeEi1rSxGkf/46sLBBFRcxGa7v8nhzMs NNXVGV48YAgq29p3NJhdZXlDCl+r/mJcMsfUHetBIPbFt+RBkFD9NZrp8 7xpb4ec9aiprTors3EceJgHD3729M1dbGioj1jmOIhLbw2KLhsaX2DHNH Q==; X-CSE-ConnectionGUID: w1USwMviRzmUtPwExBW6Lw== X-CSE-MsgGUID: RF6FTT6UQ0C9ysFwjdkyfw== X-IronPort-AV: E=McAfee;i="6600,9927,11089"; a="39144642" X-IronPort-AV: E=Sophos;i="6.08,205,1712646000"; d="scan'208";a="39144642" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2024 12:47:29 -0700 X-CSE-ConnectionGUID: wmQx8GSBSMyebRW4k5MCGA== X-CSE-MsgGUID: BrgdulQQRBK5Wbl/9p+0fQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,205,1712646000"; d="scan'208";a="67452621" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa001.fm.intel.com with ESMTP; 31 May 2024 12:47:26 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 1639641D; Fri, 31 May 2024 22:47:25 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Mark Brown , Yang Yingliang , Christophe JAILLET , Thangaraj Samynathan , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org Cc: Serge Semin , Daniel Mack , Haojian Zhuang , Robert Jarzmik , =?utf-8?q?N=C3=ADcolas_F_=2E_R_=2E?= =?utf-8?q?_A_=2E_Prado?= , Neil Armstrong Subject: [PATCH v1 2/8] spi: dw: Use new spi_xfer_is_dma_mapped() helper Date: Fri, 31 May 2024 22:42:34 +0300 Message-ID: <20240531194723.1761567-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20240531194723.1761567-1-andriy.shevchenko@linux.intel.com> References: <20240531194723.1761567-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240531_124734_628084_06E7DBD0 X-CRM114-Status: GOOD ( 12.54 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Replace a few lines of code by calling a spi_xfer_is_dma_mapped() helper. Signed-off-by: Andy Shevchenko Reviewed-by: Serge Semin --- drivers/spi/spi-dw-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-dw-core.c b/drivers/spi/spi-dw-core.c index ddfdb903047a..431788dd848c 100644 --- a/drivers/spi/spi-dw-core.c +++ b/drivers/spi/spi-dw-core.c @@ -19,6 +19,7 @@ #include #include +#include "internals.h" #include "spi-dw.h" #ifdef CONFIG_DEBUG_FS @@ -438,8 +439,7 @@ static int dw_spi_transfer_one(struct spi_controller *host, transfer->effective_speed_hz = dws->current_freq; /* Check if current transfer is a DMA transaction */ - if (host->can_dma && host->can_dma(host, spi, transfer)) - dws->dma_mapped = host->cur_msg_mapped; + dws->dma_mapped = spi_xfer_is_dma_mapped(host, spi, transfer); /* For poll mode just disable all interrupts */ dw_spi_mask_intr(dws, 0xff); From patchwork Fri May 31 19:42:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13682073 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 37B4BC27C50 for ; Fri, 31 May 2024 19:48:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=omUsI/pm2VsoWa9x4UKgjjzl/kpwTavH+ylrAYHJQY0=; b=m3K67ppGq7JZYF qBF7hGrItXoZSsifrVl5oBanfscWSW8K5vtgV+1rwRVcm6n0PC457S4subYgi51ni/oOKnMuG0CkX FzFbdGnPRACvCuxSeWLp4MoYtKGoXolQmcavmeBtLvQbwxZUHrHG7Zjb4L602K72HVwJszGFhMVVO rwmzGjcldaAOygCPQe3IkHIZOx2efjYJKqYP21H5Ra2kc32j7ulLcpLH6LP9/Ws689UGcOYjsaLJ5 gFiDxEOKr8lzO8ogzAcAWdOKHOrmRNfcUrdzU2TdD1QD3gBUbQA9E4+wBMcuKE0PEABfLWJcUHo8b YyJ3ICLgzx0lWNWN/TXg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sD8E8-0000000BITN-2LlL; Fri, 31 May 2024 19:47:48 +0000 Received: from mgamail.intel.com ([192.198.163.7]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sD8Dw-0000000BIOt-1ouf for linux-arm-kernel@lists.infradead.org; Fri, 31 May 2024 19:47:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717184857; x=1748720857; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=NPol/R/h+TdNNpLaDetGmpColwfnbBnkxBZCvk+JrSg=; b=X+rCaItkrYfiOHCt8WTBRt/gLF/DfSiDltQWeyK7rqqnyWH/f47j1TE6 sR0yHrgzEu31q5dmC9c6Q0FFNvb4vtPfABhr+21HiPh8FdmloP3HuEIDf +dkUK0nDEh+GVBqGXyzBT2fqaGJKcAB0ZRFSDyS6pQmAOq/1IuUMgqnLz MuxGZdbJ0XFM0tW+u6aFl8MgJVzfGmXmPt0aJRK6mQpo6bD/YrraNnbq3 OOPGu7JuEBTf88i4s3l+LTs8HyMxTPUz3OTixB4jOOI/mHgXcSnYrGbS3 oGxsM19QueB52+HsNyXrBx3ySUnMO70BQWoCEHIrmddj5o4GeORQEf/Vr Q==; X-CSE-ConnectionGUID: MvdGg7p8SgORLOCHTB6zcQ== X-CSE-MsgGUID: 0s0DSWeZTaqRD8PQ/a5CBw== X-IronPort-AV: E=McAfee;i="6600,9927,11089"; a="39144654" X-IronPort-AV: E=Sophos;i="6.08,205,1712646000"; d="scan'208";a="39144654" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2024 12:47:30 -0700 X-CSE-ConnectionGUID: 48QEDkXyQ/mungdUvq7PWg== X-CSE-MsgGUID: 4vLsBDPPRN+K8D49bPj6sw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,205,1712646000"; d="scan'208";a="67452619" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa001.fm.intel.com with ESMTP; 31 May 2024 12:47:26 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 2015E650; Fri, 31 May 2024 22:47:25 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Mark Brown , Yang Yingliang , Christophe JAILLET , Thangaraj Samynathan , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org Cc: Serge Semin , Daniel Mack , Haojian Zhuang , Robert Jarzmik , =?utf-8?q?N=C3=ADcolas_F_=2E_R_=2E?= =?utf-8?q?_A_=2E_Prado?= , Neil Armstrong Subject: [PATCH v1 3/8] spi: ingenic: Use new spi_xfer_is_dma_mapped() helper Date: Fri, 31 May 2024 22:42:35 +0300 Message-ID: <20240531194723.1761567-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20240531194723.1761567-1-andriy.shevchenko@linux.intel.com> References: <20240531194723.1761567-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240531_124736_512611_2A272AAA X-CRM114-Status: GOOD ( 13.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Replace a few lines of code by calling a spi_xfer_is_dma_mapped() helper. Signed-off-by: Andy Shevchenko --- drivers/spi/spi-ingenic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-ingenic.c b/drivers/spi/spi-ingenic.c index 003a6d21c4c3..318b0768701e 100644 --- a/drivers/spi/spi-ingenic.c +++ b/drivers/spi/spi-ingenic.c @@ -16,6 +16,7 @@ #include #include #include +#include "internals.h" #define REG_SSIDR 0x0 #define REG_SSICR0 0x4 @@ -242,11 +243,10 @@ static int spi_ingenic_transfer_one(struct spi_controller *ctlr, { struct ingenic_spi *priv = spi_controller_get_devdata(ctlr); unsigned int bits = xfer->bits_per_word ?: spi->bits_per_word; - bool can_dma = ctlr->can_dma && ctlr->can_dma(ctlr, spi, xfer); spi_ingenic_prepare_transfer(priv, spi, xfer); - if (ctlr->cur_msg_mapped && can_dma) + if (spi_xfer_is_dma_mapped(ctlr, spi, xfer)) return spi_ingenic_dma_tx(ctlr, xfer, bits); if (bits > 16) From patchwork Fri May 31 19:42:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13682076 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7D1D0C25B75 for ; Fri, 31 May 2024 19:48:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=aFo2Oqq/9ERmd8B7KQwn/XlB/m2Vp/6L9at5MEbVxVk=; b=gYs8S2bwZqozYn mAC2AsDO9Nvsi6XFYVtJ8DcwczXm546jPhgysM+2STX7h7gT39HryvI/JHZxV3mwX6PBHqZ3pgEDR PgOSAYd1yc6IzAJtJ1hqm7YnbiLVQau66BHu/AWKpTPEh//TaL16yiQ0UaEgSHE5aGuZDfVbjfoTf t7SO3w89v5sL+GuA9y5b3NjrEJ5KArEFDH4rOIMIolatCgV7Y/g22DQjMcx9dq/fnSXnfmfnJwduw 1pyciaOVE9OEJtCT8f7DQJlfdV7X9Y8scmXQlYit5kbWwL4RIvJrR5luzEk0ZaRuq3JXGifP+Cxei YXQRXnST1gl0W88v7tkg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sD8E9-0000000BIUZ-31nR; Fri, 31 May 2024 19:47:49 +0000 Received: from mgamail.intel.com ([192.198.163.7]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sD8Dw-0000000BIPs-2YH0 for linux-arm-kernel@lists.infradead.org; Fri, 31 May 2024 19:47:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717184857; x=1748720857; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=m6PMMUoDxsMJTLuxxmK/JswtaHUXsRGOeRWlSpgoV5M=; b=bzGOqV6OHvEztBW929gIqbBQ/XdJm4Y6WXgQHnAkjU208ucSBFRh7JoO 5D2RThvVVpf+LRTMobXYTmUHO/7tUopQRzpykhFi2Z2nxh44MEz4qpeIo /B3K72jQ594ckBWYgNcc9rxdOscrU3zTGciXK7s3Dku30nCbAysUdNfHw Ht2BUqck/0OlL5G7QzJPMzyLiWmbyGfQZl1hhkTpr8gODIuwRS0og8D6m /IAi9WHAWNY/1S3F7N4hkfp7KKvniSWxrM9wYEVA2L24KOr3bdmq5BUbk Zb06NIXkIXx21jFkG5fGFPPjJerddxuEXRGTNd/6+3T9eVP4OUk+Ax9qq g==; X-CSE-ConnectionGUID: iBE19M6mRji551EnoYSNGQ== X-CSE-MsgGUID: e7t+kCQcSMWS2YW6uga1Fg== X-IronPort-AV: E=McAfee;i="6600,9927,11089"; a="39144665" X-IronPort-AV: E=Sophos;i="6.08,205,1712646000"; d="scan'208";a="39144665" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2024 12:47:30 -0700 X-CSE-ConnectionGUID: hnQdOcRDTgGX5Z0NhqkDKg== X-CSE-MsgGUID: dlchLsbuS/6MVxz8w1FczA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,205,1712646000"; d="scan'208";a="67452620" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa001.fm.intel.com with ESMTP; 31 May 2024 12:47:26 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 2CF12668; Fri, 31 May 2024 22:47:25 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Mark Brown , Yang Yingliang , Christophe JAILLET , Thangaraj Samynathan , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org Cc: Serge Semin , Daniel Mack , Haojian Zhuang , Robert Jarzmik , =?utf-8?q?N=C3=ADcolas_F_=2E_R_=2E?= =?utf-8?q?_A_=2E_Prado?= , Neil Armstrong Subject: [PATCH v1 4/8] spi: omap2-mcspi: Use new spi_xfer_is_dma_mapped() helper Date: Fri, 31 May 2024 22:42:36 +0300 Message-ID: <20240531194723.1761567-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20240531194723.1761567-1-andriy.shevchenko@linux.intel.com> References: <20240531194723.1761567-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240531_124737_054998_5B33D66C X-CRM114-Status: GOOD ( 10.73 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Replace a few lines of code by calling a spi_xfer_is_dma_mapped() helper. Signed-off-by: Andy Shevchenko --- drivers/spi/spi-omap2-mcspi.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c index 7e3083b83534..b624cc472857 100644 --- a/drivers/spi/spi-omap2-mcspi.c +++ b/drivers/spi/spi-omap2-mcspi.c @@ -27,6 +27,8 @@ #include +#include "internals.h" + #include #define OMAP2_MCSPI_MAX_FREQ 48000000 @@ -1208,8 +1210,7 @@ static int omap2_mcspi_transfer_one(struct spi_controller *ctlr, unsigned count; if ((mcspi_dma->dma_rx && mcspi_dma->dma_tx) && - ctlr->cur_msg_mapped && - ctlr->can_dma(ctlr, spi, t)) + spi_xfer_is_dma_mapped(ctlr, spi, t)) omap2_mcspi_set_fifo(spi, t, 1); omap2_mcspi_set_enable(spi, 1); @@ -1220,8 +1221,7 @@ static int omap2_mcspi_transfer_one(struct spi_controller *ctlr, + OMAP2_MCSPI_TX0); if ((mcspi_dma->dma_rx && mcspi_dma->dma_tx) && - ctlr->cur_msg_mapped && - ctlr->can_dma(ctlr, spi, t)) + spi_xfer_is_dma_mapped(ctlr, spi, t)) count = omap2_mcspi_txrx_dma(spi, t); else count = omap2_mcspi_txrx_pio(spi, t); From patchwork Fri May 31 19:42:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13682075 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B7129C27C50 for ; Fri, 31 May 2024 19:48:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=lUWAH8wlRj80ze15wvsFhmpIUdhT04Bw9mfNmmLTJ/g=; b=qxvq1HSIbZadFL fsR7y42zZgrQ0SbtBZafNm23TLZKGdmykZPK4/bhnVYONtk4LAZJjuQK6fq/5FPSPcipPMVojVxWs AOLUfzeM20DOSxyj7QFFDRju4Xp1EURJWFvFYmiDOMiYyB4gjEcuJEiOIxrS//qjv+aLOXrAjjTjV txt91LRpZzPqdNeIBBaL9Zqe8XuscptDb2kdpdyxcRidCylF9De5xTor/oaItGOA8GP9G6jzztWyS 3i7fq1eVDjJDcI/+/LBmX9pKuqiFbrDptmKjdNmi1q4H1qG/bHkcVhAN8yKB+wZguNxf0a9+E4KnD w8uBK79b1OkNOMgl3OtA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sD8EB-0000000BIVa-0j6m; Fri, 31 May 2024 19:47:51 +0000 Received: from mgamail.intel.com ([192.198.163.7]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sD8Dx-0000000BIOc-1StI for linux-arm-kernel@lists.infradead.org; Fri, 31 May 2024 19:47:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717184857; x=1748720857; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=u6yy5HS9GWcxuh4VW7Sd1i06Xno0PecsrxtOQkR0GKk=; b=j2Q+3PnQVN1FqiyAuy3Do74uNbxBQhoue0V4lt77A+K8s+jsw7PLQdxc rTOiH601oLCbAPGjdYzsoHegpcGN7v06WMzn5oyxnVxPyJOHghffCWN3R E7Up2I70MUGkK/muRWBzRbLyUbjesc/OXSIRi/bN4l9IqfIcwxgYsyZVZ PiCkogyED8iiZ4rChK6KlZFXZe5FxYN0fXSDw0xdDme13RsL5x62XCNR5 HYwJna3Is/VoMD0lDZWTDAeZaz5q7ugxoLwr5q+4AGsSxH0+nAA0HRl6R h7OsQWQUFgG4StZGzwjuXrOnUflLKt+NBj+9FIDuvyUqX/aDqImTa9F59 A==; X-CSE-ConnectionGUID: MZnAsZ8VQZ2WLJzsG0JCEg== X-CSE-MsgGUID: eMcoSR3DSTKLY1msEi7yDg== X-IronPort-AV: E=McAfee;i="6600,9927,11089"; a="39144685" X-IronPort-AV: E=Sophos;i="6.08,205,1712646000"; d="scan'208";a="39144685" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2024 12:47:34 -0700 X-CSE-ConnectionGUID: +smJlGlEQgC0zD0PglNuGQ== X-CSE-MsgGUID: ztqxSOKHSeaBviE9im6WJw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,205,1712646000"; d="scan'208";a="67452630" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa001.fm.intel.com with ESMTP; 31 May 2024 12:47:30 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 3B1FA679; Fri, 31 May 2024 22:47:25 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Mark Brown , Yang Yingliang , Christophe JAILLET , Thangaraj Samynathan , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org Cc: Serge Semin , Daniel Mack , Haojian Zhuang , Robert Jarzmik , =?utf-8?q?N=C3=ADcolas_F_=2E_R_=2E?= =?utf-8?q?_A_=2E_Prado?= , Neil Armstrong Subject: [PATCH v1 5/8] spi: pxa2xx: Use new spi_xfer_is_dma_mapped() helper Date: Fri, 31 May 2024 22:42:37 +0300 Message-ID: <20240531194723.1761567-6-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20240531194723.1761567-1-andriy.shevchenko@linux.intel.com> References: <20240531194723.1761567-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240531_124737_443381_C473771A X-CRM114-Status: GOOD ( 11.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Replace a few lines of code by calling a spi_xfer_is_dma_mapped() helper. Signed-off-by: Andy Shevchenko --- drivers/spi/spi-pxa2xx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index 1fb30201459f..16b96eb176cd 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -26,6 +26,7 @@ #include +#include "internals.h" #include "spi-pxa2xx.h" #define TIMOUT_DFLT 1000 @@ -993,11 +994,8 @@ static int pxa2xx_spi_transfer_one(struct spi_controller *controller, } dma_thresh = SSCR1_RxTresh(RX_THRESH_DFLT) | SSCR1_TxTresh(TX_THRESH_DFLT); - dma_mapped = controller->can_dma && - controller->can_dma(controller, spi, transfer) && - controller->cur_msg_mapped; + dma_mapped = spi_xfer_is_dma_mapped(controller, spi, transfer); if (dma_mapped) { - /* Ensure we have the correct interrupt handler */ drv_data->transfer_handler = pxa2xx_spi_dma_transfer; From patchwork Fri May 31 19:42:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13682078 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 96B7AC25B75 for ; Fri, 31 May 2024 19:48:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=4QgoeAi/61teo9fU0Q0DsirUUdMlbzWFIh7w7iSDP+s=; b=eQabFtwAQCCt+O r6ZvPoimt/+zeDF/9oTACf2Hilh7WjZHT/qKmPXi6TQBEAXwgMtoMSWDrcvu+1hrD6FKYXTHc5Nl+ PXbZLAOZWqqRpfisI/vWATGWZ1bcYnU1+2FAiAbBWOSZTlaFDuTbagvsyWTC2iSjvmKZ3GPlYYoP/ NzcztF/kAmJhWxRkBrSUIAqfqOI12Yga+3hUS0fUXoaDVwP/sKm0k1zpXc4VmksYFS8uSnIRVfJTr D9nugLU9qDAVwDhYVhagRwoNDv1ZyNAvaAscxusZc7f9SROSFW/TByuLsVH2S9KMomN6xZLPy+eyq BnEI+nKdMEPwB5k+hOoA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sD8EC-0000000BIWR-36Gh; Fri, 31 May 2024 19:47:52 +0000 Received: from mgamail.intel.com ([192.198.163.7]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sD8Dx-0000000BIOt-3jke for linux-arm-kernel@lists.infradead.org; Fri, 31 May 2024 19:47:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717184858; x=1748720858; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/9eJLkmp3LgLhh+fMgJbD6pR0R5JNL/+VIoLm5XWU7o=; b=jZOXJ4y22njtZ2ZxC7qSlzUR8X4UPX45TmyRZyhRAn3nn1o9wAMBC0mm o5xZ34/M9NwIEfgGhwpHfPChdVwmJovdk9mObysu92ZgCMkllW+l2C0mp 8bSImEucEfgc7Ud5cGvfSTEJm44tthsNmchXDZXAfZFzZlYA0UMulJaxJ TakCvG7QrppAJHEFrOr1iQOc9CeidXTMvVG5VKymaTjwCOwmWKDTmGpbO 2FYHyCn3kk7aSMD5z641yV3BRHgqfRtUW+NZQpRs4uof5LmxFIXACo0rY fao0FG1M+Q/rJYe0LxW0/Y7IfNFY39UET7M7C6rD7iGHwUn1xXSN6LQK+ g==; X-CSE-ConnectionGUID: AzfUVJAgSyWYB/kH+gCPTA== X-CSE-MsgGUID: qhkijx/OQc+bNftrh1kDLg== X-IronPort-AV: E=McAfee;i="6600,9927,11089"; a="39144696" X-IronPort-AV: E=Sophos;i="6.08,205,1712646000"; d="scan'208";a="39144696" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2024 12:47:34 -0700 X-CSE-ConnectionGUID: OzG7PVx1Sj6oa374KfTxyw== X-CSE-MsgGUID: w7sprX4/QRubzrJxN+DHJg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,205,1712646000"; d="scan'208";a="67452631" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa001.fm.intel.com with ESMTP; 31 May 2024 12:47:30 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 440BE3B3; Fri, 31 May 2024 22:47:25 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Mark Brown , Yang Yingliang , Christophe JAILLET , Thangaraj Samynathan , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org Cc: Serge Semin , Daniel Mack , Haojian Zhuang , Robert Jarzmik , =?utf-8?q?N=C3=ADcolas_F_=2E_R_=2E?= =?utf-8?q?_A_=2E_Prado?= , Neil Armstrong Subject: [PATCH v1 6/8] spi: pci1xxxx: Use new spi_xfer_is_dma_mapped() helper Date: Fri, 31 May 2024 22:42:38 +0300 Message-ID: <20240531194723.1761567-7-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20240531194723.1761567-1-andriy.shevchenko@linux.intel.com> References: <20240531194723.1761567-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240531_124737_964608_ABEE9884 X-CRM114-Status: GOOD ( 12.56 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Replace a few lines of code by calling a spi_xfer_is_dma_mapped() helper. Signed-off-by: Andy Shevchenko --- drivers/spi/spi-pci1xxxx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-pci1xxxx.c b/drivers/spi/spi-pci1xxxx.c index cc18d320370f..fc98979eba48 100644 --- a/drivers/spi/spi-pci1xxxx.c +++ b/drivers/spi/spi-pci1xxxx.c @@ -6,6 +6,7 @@ #include +#include #include #include #include @@ -15,7 +16,7 @@ #include #include #include -#include +#include "internals.h" #define DRV_NAME "spi-pci1xxxx" @@ -567,7 +568,7 @@ static int pci1xxxx_spi_transfer_with_dma(struct spi_controller *spi_ctlr, static int pci1xxxx_spi_transfer_one(struct spi_controller *spi_ctlr, struct spi_device *spi, struct spi_transfer *xfer) { - if (spi_ctlr->can_dma(spi_ctlr, spi, xfer) && spi_ctlr->cur_msg_mapped) + if (spi_xfer_is_dma_mapped(spi_ctlr, spi, xfer)) return pci1xxxx_spi_transfer_with_dma(spi_ctlr, spi, xfer); else return pci1xxxx_spi_transfer_with_io(spi_ctlr, spi, xfer); From patchwork Fri May 31 19:42:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13682077 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5833CC27C4F for ; Fri, 31 May 2024 19:48:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8LlpTtCRydtDSIOoGl+yBpS9JidgVdAIHjmX4bYb/X4=; b=nQLqssAmHyBbMe RIh0SPdMLIY1sWZCuEq94IstD3SuyEmLhv89SvKkv/aHKgWxwpk7c/Xc6oyb4iL92RF9KvP5iJGxN rbLKJMdAxCRL7l5XUMpMxTuhq5JUmGSvQvXVZhlyLd74Gy17Xjni8PvSUHq9+JiysQZ9nKeEtpXYT g7keKL9RC7jwoNOEOPvoTZoKVSgMRK0Dhf4Wgd1gmAv5tGckuscHr1HC8WfwyPL9yfieB4p5X/+ak bfqhJqhdPo6TL2zwuzdyoiAGhEf3S2X0O4hmaJmCV+DdGDRzHfEeqhqWB2sS4pFZ3D08lcr1k5ooU htywjE/0ShdotDbzkbIA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sD8EE-0000000BIXf-1ImF; Fri, 31 May 2024 19:47:54 +0000 Received: from mgamail.intel.com ([192.198.163.7]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sD8Dy-0000000BIPs-1aDO for linux-arm-kernel@lists.infradead.org; Fri, 31 May 2024 19:47:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717184858; x=1748720858; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=V8BjWKXND1DprtSPvDdNYQPO5LtJssRIUnnGwI0067k=; b=GNtqa/ayQTRAITiceijvc98BT4OzBvIpqxAllM15ILSsZVkXz6w2h7je QDIZm8CEOVdaw84OoW+jrKOHDZDYV6v9g5NqM/aX0V6Av8L33rYNaq9kG EIgOnmuhVX6Wto+88yMtsu2gZa5XjboJ/rSnHmPYtOLEjCWXAhh0oKzYz 02Fofqee4f9bmJryIBN7FDq0GkqPXpmZBBp89bAKGyv2pgLPahRBx5uos pOBBz2FnYIE/8wGshQclA+SGYEwOGPlkscSti4h0e3HI2/I6gwDn03ZIQ 4ksQsRsZradbeECjHP2xcUIo7kGL22Ukc2VR+4SxvwLQFmr3PNNtjdsE/ A==; X-CSE-ConnectionGUID: ro7w4vrCSN2tSg9jR7Ca7A== X-CSE-MsgGUID: Xdf9cCJeRIqxEVf/vKT0zw== X-IronPort-AV: E=McAfee;i="6600,9927,11089"; a="39144709" X-IronPort-AV: E=Sophos;i="6.08,205,1712646000"; d="scan'208";a="39144709" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2024 12:47:34 -0700 X-CSE-ConnectionGUID: 1A16O+DhRjmT9I//t+XD+Q== X-CSE-MsgGUID: oI9PyvAUSjmVJuk2u7GBNg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,205,1712646000"; d="scan'208";a="67452633" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa001.fm.intel.com with ESMTP; 31 May 2024 12:47:30 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 5206E6AB; Fri, 31 May 2024 22:47:25 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Mark Brown , Yang Yingliang , Christophe JAILLET , Thangaraj Samynathan , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org Cc: Serge Semin , Daniel Mack , Haojian Zhuang , Robert Jarzmik , =?utf-8?q?N=C3=ADcolas_F_=2E_R_=2E?= =?utf-8?q?_A_=2E_Prado?= , Neil Armstrong Subject: [PATCH v1 7/8] spi: qup: Use new spi_xfer_is_dma_mapped() helper Date: Fri, 31 May 2024 22:42:39 +0300 Message-ID: <20240531194723.1761567-8-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20240531194723.1761567-1-andriy.shevchenko@linux.intel.com> References: <20240531194723.1761567-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240531_124738_464577_77FCF7E9 X-CRM114-Status: GOOD ( 11.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Replace a few lines of code by calling a spi_xfer_is_dma_mapped() helper. Signed-off-by: Andy Shevchenko Reviewed-by: Bryan O'Donoghue --- drivers/spi/spi-qup.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/spi/spi-qup.c b/drivers/spi/spi-qup.c index 2af63040ac6e..06da4aa7eeb7 100644 --- a/drivers/spi/spi-qup.c +++ b/drivers/spi/spi-qup.c @@ -5,6 +5,8 @@ #include #include +#include +#include #include #include #include @@ -16,8 +18,7 @@ #include #include #include -#include -#include +#include "internals.h" #define QUP_CONFIG 0x0000 #define QUP_STATE 0x0004 @@ -709,9 +710,7 @@ static int spi_qup_io_prep(struct spi_device *spi, struct spi_transfer *xfer) if (controller->n_words <= (controller->in_fifo_sz / sizeof(u32))) controller->mode = QUP_IO_M_MODE_FIFO; - else if (spi->controller->can_dma && - spi->controller->can_dma(spi->controller, spi, xfer) && - spi->controller->cur_msg_mapped) + else if (spi_xfer_is_dma_mapped(spi->controller, spi, xfer)) controller->mode = QUP_IO_M_MODE_BAM; else controller->mode = QUP_IO_M_MODE_BLOCK; From patchwork Fri May 31 19:42:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13682079 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 01E08C25B75 for ; Fri, 31 May 2024 19:48:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=79xCfUJ57uyBwZtboTw1FgP4E1vSekHNop/VL7uXFPI=; b=EIhcf1goutY2Gi XTaIuCXIZUnfznZM/FuR27mghgD2WtW9iGWW+vI30Hml/SgjnuAje/h4u93jrTYtiHjobCzzTOoOH Ra5K3KS9ilrbjNoTmti0/U0WT+/wLXC+nZEquxFj3sj3GMtMkOccyipmln08TU8jwBD5ndWEK9YvR RpkZlt2vp8KFC9Sx/reKE5eBwhYYtcsb+WgMMPfjDEXcjBf8JkK5SvOUc6gjBVdoVUuarD4D7c29L IjgXjkip8/e/eCEi8LUHBlswDs3yA3JGvf4pqjPPDSEKPwRvYD9TzuVhjMCo/DNPs6BJfx/FKmcil XbEixjLAQ3YF6t9gJvPg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sD8EI-0000000BIcA-2gfK; Fri, 31 May 2024 19:47:58 +0000 Received: from mgamail.intel.com ([192.198.163.7]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sD8Dy-0000000BIOc-3ACf for linux-arm-kernel@lists.infradead.org; Fri, 31 May 2024 19:47:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717184859; x=1748720859; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+Kmjinln59NpN7Q278lsMn6Hoz1SKSjg7Oeoq61MfdQ=; b=Qw+ucppuGXKav0kNKFvE2tAdgbrwpop5WAl4E6yIGp8hIsRACg1Knhce nrQ5TKRw+586y6B5PziVNwNSSoOqPgwFy7B382gnKa/fNY4Ue3Mos/AnR m22hUM4ibGT8RcyHbgwWtfvhFk8HWdt7/o7uHnomPPd2Cavc8Upn7fBR7 5hdrlCJAcIJkq1ZyDw4uGw8yPJKO3Pv69ed5ctH1XiudOcUe03orUFzeV lmrj+QlJ4kGMqLlviBrqnswtoXkJXGVI0i+vjoYtXFMoWGBy7LVBmBQQ/ vR3SlmygMBhGvEj0BrDDJvz2+ay/2vW8Sl+KSqXl+ff2ZrejJ7u5rdJoi A==; X-CSE-ConnectionGUID: q0ng+6mzQfKzUjehhC0A+A== X-CSE-MsgGUID: d6Tsa3BoRfq7gE6aYqyRQg== X-IronPort-AV: E=McAfee;i="6600,9927,11089"; a="39144713" X-IronPort-AV: E=Sophos;i="6.08,205,1712646000"; d="scan'208";a="39144713" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2024 12:47:34 -0700 X-CSE-ConnectionGUID: hw1ymnlbQK28Dn858UKVUg== X-CSE-MsgGUID: 3XTF4lsMS1inXn9dTvNUbw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,205,1712646000"; d="scan'208";a="67452632" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa001.fm.intel.com with ESMTP; 31 May 2024 12:47:30 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 5F60E6CB; Fri, 31 May 2024 22:47:25 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Mark Brown , Yang Yingliang , Christophe JAILLET , Thangaraj Samynathan , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org Cc: Serge Semin , Daniel Mack , Haojian Zhuang , Robert Jarzmik , =?utf-8?q?N=C3=ADcolas_F_=2E_R_=2E?= =?utf-8?q?_A_=2E_Prado?= , Neil Armstrong Subject: [PATCH v1 8/8] spi: Rework per message DMA mapped flag to be per transfer Date: Fri, 31 May 2024 22:42:40 +0300 Message-ID: <20240531194723.1761567-9-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20240531194723.1761567-1-andriy.shevchenko@linux.intel.com> References: <20240531194723.1761567-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240531_124738_890709_7D02257B X-CRM114-Status: GOOD ( 21.55 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The granularity of DMA mappings is transfer and moreover, the direction is also important as it can be unidirect. The current cur_msg_mapped flag doesn't fit well the DMA mapping and syncing calls and we have tons of checks around on top of it. So, instead of doing that rework the code to use per transfer per direction flag to show if it's DMA mapped or not. Signed-off-by: Andy Shevchenko --- drivers/spi/internals.h | 2 +- drivers/spi/spi.c | 73 +++++++++++++++-------------------------- include/linux/spi/spi.h | 11 ++++--- 3 files changed, 35 insertions(+), 51 deletions(-) diff --git a/drivers/spi/internals.h b/drivers/spi/internals.h index 47a87c2a6979..1f459b895891 100644 --- a/drivers/spi/internals.h +++ b/drivers/spi/internals.h @@ -45,7 +45,7 @@ static inline bool spi_xfer_is_dma_mapped(struct spi_controller *ctlr, struct spi_transfer *xfer) { return ctlr->can_dma && ctlr->can_dma(ctlr, spi, xfer) && - ctlr->cur_msg_mapped; + (xfer->tx_sg_mapped || xfer->rx_sg_mapped); } #endif /* __LINUX_SPI_INTERNALS_H */ diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index c1e8cde426e5..9721adf048b5 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -1220,11 +1220,6 @@ void spi_unmap_buf(struct spi_controller *ctlr, struct device *dev, spi_unmap_buf_attrs(ctlr, dev, sgt, dir, 0); } -/* Dummy SG for unidirect transfers */ -static struct scatterlist dummy_sg = { - .page_link = SG_END, -}; - static int __spi_map_msg(struct spi_controller *ctlr, struct spi_message *msg) { struct device *tx_dev, *rx_dev; @@ -1263,8 +1258,8 @@ static int __spi_map_msg(struct spi_controller *ctlr, struct spi_message *msg) attrs); if (ret != 0) return ret; - } else { - xfer->tx_sg.sgl = &dummy_sg; + + xfer->tx_sg_mapped = true; } if (xfer->rx_buf != NULL) { @@ -1278,8 +1273,8 @@ static int __spi_map_msg(struct spi_controller *ctlr, struct spi_message *msg) return ret; } - } else { - xfer->rx_sg.sgl = &dummy_sg; + + xfer->rx_sg_mapped = true; } } /* No transfer has been mapped, bail out with success */ @@ -1288,7 +1283,6 @@ static int __spi_map_msg(struct spi_controller *ctlr, struct spi_message *msg) ctlr->cur_rx_dma_dev = rx_dev; ctlr->cur_tx_dma_dev = tx_dev; - ctlr->cur_msg_mapped = true; return 0; } @@ -1299,57 +1293,46 @@ static int __spi_unmap_msg(struct spi_controller *ctlr, struct spi_message *msg) struct device *tx_dev = ctlr->cur_tx_dma_dev; struct spi_transfer *xfer; - if (!ctlr->cur_msg_mapped || !ctlr->can_dma) - return 0; - list_for_each_entry(xfer, &msg->transfers, transfer_list) { /* The sync has already been done after each transfer. */ unsigned long attrs = DMA_ATTR_SKIP_CPU_SYNC; - if (!ctlr->can_dma(ctlr, msg->spi, xfer)) - continue; + if (xfer->rx_sg_mapped) + spi_unmap_buf_attrs(ctlr, rx_dev, &xfer->rx_sg, + DMA_FROM_DEVICE, attrs); + xfer->rx_sg_mapped = false; - spi_unmap_buf_attrs(ctlr, rx_dev, &xfer->rx_sg, - DMA_FROM_DEVICE, attrs); - spi_unmap_buf_attrs(ctlr, tx_dev, &xfer->tx_sg, - DMA_TO_DEVICE, attrs); + if (xfer->tx_sg_mapped) + spi_unmap_buf_attrs(ctlr, tx_dev, &xfer->tx_sg, + DMA_TO_DEVICE, attrs); + xfer->tx_sg_mapped = false; } - ctlr->cur_msg_mapped = false; - return 0; } -static void spi_dma_sync_for_device(struct spi_controller *ctlr, struct spi_message *msg, +static void spi_dma_sync_for_device(struct spi_controller *ctlr, struct spi_transfer *xfer) { struct device *rx_dev = ctlr->cur_rx_dma_dev; struct device *tx_dev = ctlr->cur_tx_dma_dev; - if (!ctlr->cur_msg_mapped) - return; - - if (!ctlr->can_dma(ctlr, msg->spi, xfer)) - return; - - dma_sync_sgtable_for_device(tx_dev, &xfer->tx_sg, DMA_TO_DEVICE); - dma_sync_sgtable_for_device(rx_dev, &xfer->rx_sg, DMA_FROM_DEVICE); + if (xfer->tx_sg_mapped) + dma_sync_sgtable_for_device(tx_dev, &xfer->tx_sg, DMA_TO_DEVICE); + if (xfer->rx_sg_mapped) + dma_sync_sgtable_for_device(rx_dev, &xfer->rx_sg, DMA_FROM_DEVICE); } -static void spi_dma_sync_for_cpu(struct spi_controller *ctlr, struct spi_message *msg, +static void spi_dma_sync_for_cpu(struct spi_controller *ctlr, struct spi_transfer *xfer) { struct device *rx_dev = ctlr->cur_rx_dma_dev; struct device *tx_dev = ctlr->cur_tx_dma_dev; - if (!ctlr->cur_msg_mapped) - return; - - if (!ctlr->can_dma(ctlr, msg->spi, xfer)) - return; - - dma_sync_sgtable_for_cpu(rx_dev, &xfer->rx_sg, DMA_FROM_DEVICE); - dma_sync_sgtable_for_cpu(tx_dev, &xfer->tx_sg, DMA_TO_DEVICE); + if (xfer->rx_sg_mapped) + dma_sync_sgtable_for_cpu(rx_dev, &xfer->rx_sg, DMA_FROM_DEVICE); + if (xfer->tx_sg_mapped) + dma_sync_sgtable_for_cpu(tx_dev, &xfer->tx_sg, DMA_TO_DEVICE); } #else /* !CONFIG_HAS_DMA */ static inline int __spi_map_msg(struct spi_controller *ctlr, @@ -1365,13 +1348,11 @@ static inline int __spi_unmap_msg(struct spi_controller *ctlr, } static void spi_dma_sync_for_device(struct spi_controller *ctrl, - struct spi_message *msg, struct spi_transfer *xfer) { } static void spi_dma_sync_for_cpu(struct spi_controller *ctrl, - struct spi_message *msg, struct spi_transfer *xfer) { } @@ -1643,13 +1624,13 @@ static int spi_transfer_one_message(struct spi_controller *ctlr, reinit_completion(&ctlr->xfer_completion); fallback_pio: - spi_dma_sync_for_device(ctlr, msg, xfer); + spi_dma_sync_for_device(ctlr, xfer); ret = ctlr->transfer_one(ctlr, msg->spi, xfer); if (ret < 0) { - spi_dma_sync_for_cpu(ctlr, msg, xfer); + spi_dma_sync_for_cpu(ctlr, xfer); - if (ctlr->cur_msg_mapped && - (xfer->error & SPI_TRANS_FAIL_NO_START)) { + if ((xfer->tx_sg_mapped || xfer->rx_sg_mapped) && + (xfer->error & SPI_TRANS_FAIL_NO_START)) { __spi_unmap_msg(ctlr, msg); ctlr->fallback = true; xfer->error &= ~SPI_TRANS_FAIL_NO_START; @@ -1671,7 +1652,7 @@ static int spi_transfer_one_message(struct spi_controller *ctlr, msg->status = ret; } - spi_dma_sync_for_cpu(ctlr, msg, xfer); + spi_dma_sync_for_cpu(ctlr, xfer); } else { if (xfer->len) dev_err(&msg->spi->dev, diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index eec7199bcda5..ea54ab10b914 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h @@ -448,7 +448,6 @@ extern struct spi_device *spi_new_ancillary_device(struct spi_device *spi, u8 ch * @cur_msg_need_completion: Flag used internally to opportunistically skip * the @cur_msg_completion. This flag is used to signal the context that * is running spi_finalize_current_message() that it needs to complete() - * @cur_msg_mapped: message has been mapped for DMA * @fallback: fallback to PIO if DMA transfer return failure with * SPI_TRANS_FAIL_NO_START. * @last_cs_mode_high: was (mode & SPI_CS_HIGH) true on the last call to set_cs. @@ -709,7 +708,6 @@ struct spi_controller { bool running; bool rt; bool auto_runtime_pm; - bool cur_msg_mapped; bool fallback; bool last_cs_mode_high; s8 last_cs[SPI_CS_CNT_MAX]; @@ -982,6 +980,8 @@ struct spi_res { * transfer this transfer. Set to 0 if the SPI bus driver does * not support it. * @transfer_list: transfers are sequenced through @spi_message.transfers + * @tx_sg_mapped: If true, the @tx_sg is mapped for DMA + * @rx_sg_mapped: If true, the @rx_sg is mapped for DMA * @tx_sg: Scatterlist for transmit, currently not for client use * @rx_sg: Scatterlist for receive, currently not for client use * @ptp_sts_word_pre: The word (subject to bits_per_word semantics) offset @@ -1078,10 +1078,13 @@ struct spi_transfer { #define SPI_TRANS_FAIL_IO BIT(1) u16 error; - dma_addr_t tx_dma; - dma_addr_t rx_dma; + bool tx_sg_mapped; + bool rx_sg_mapped; + struct sg_table tx_sg; struct sg_table rx_sg; + dma_addr_t tx_dma; + dma_addr_t rx_dma; unsigned dummy_data:1; unsigned cs_off:1;