From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752000AbdHaRIO (ORCPT ); Thu, 31 Aug 2017 13:08:14 -0400 Received: from smtp2.infineon.com ([217.10.52.18]:51075 "EHLO smtp2.infineon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751437AbdHaRIN (ORCPT ); Thu, 31 Aug 2017 13:08:13 -0400 X-Greylist: delayed 575 seconds by postgrey-1.27 at vger.kernel.org; Thu, 31 Aug 2017 13:08:13 EDT X-SBRS: None From: Alexander Steffen To: , , CC: , , Alexander Steffen Subject: [PATCH RESEND v3 0/2] tpm_tis_spi: Use DMA-safe memory Date: Thu, 31 Aug 2017 18:58:17 +0200 Message-ID: <20170831165819.13544-1-Alexander.Steffen@infineon.com> X-Mailer: git-send-email 2.11.1.windows.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.29.170.103] X-ClientProxiedBy: MUCSE601.infineon.com (172.23.7.102) To MUCSE603.infineon.com (172.23.7.104) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The documentation says that DMA-safe memory is required for SPI transfers. The I/O buffers passed in by the caller can be allocated anywhere, including on the stack, which is not DMA-safe. So the data needs to be copied to separate, DMA-safe buffers. We did not see any DMA-related issues on our test systems, even without DMA-safe buffers. But this might simply be due to the fact that the SPI transfer size is rather small, so our systems do not bother to set up DMA transfers. Other systems might do so. v2: - Updated commit message with more explanations. v3: - Split into two patches, one for making the buffers DMA-safe and another for using only a single buffer. Alexander Steffen (2): tpm_tis_spi: Use DMA-safe memory for SPI transfers tpm_tis_spi: Use a single buffer for SPI transfers drivers/char/tpm/tpm_tis_spi.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) -- 2.7.4