From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752187AbcG2C7R (ORCPT ); Thu, 28 Jul 2016 22:59:17 -0400 Received: from mail-pa0-f50.google.com ([209.85.220.50]:35428 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751472AbcG2C7P (ORCPT ); Thu, 28 Jul 2016 22:59:15 -0400 From: Andrey Pronin To: Jarkko Sakkinen Cc: Peter Huewe , Marcel Selhorst , Jason Gunthorpe , Christophe Ricard , tpmdd-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, dtor@chromium.org, Andrey Pronin Subject: [PATCH] tpm: fix cacheline alignment for DMA-able buffers Date: Thu, 28 Jul 2016 19:59:13 -0700 Message-Id: <1469761153-85576-1-git-send-email-apronin@chromium.org> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Annotate buffers used in spi transactions as ____cacheline_aligned to use in DMA transfers. Signed-off-by: Andrey Pronin --- drivers/char/tpm/st33zp24/spi.c | 4 ++-- drivers/char/tpm/tpm_tis_spi.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/char/tpm/st33zp24/spi.c b/drivers/char/tpm/st33zp24/spi.c index 9f5a011..0e9aad9 100644 --- a/drivers/char/tpm/st33zp24/spi.c +++ b/drivers/char/tpm/st33zp24/spi.c @@ -70,8 +70,8 @@ struct st33zp24_spi_phy { struct spi_device *spi_device; - u8 tx_buf[ST33ZP24_SPI_BUFFER_SIZE]; - u8 rx_buf[ST33ZP24_SPI_BUFFER_SIZE]; + u8 tx_buf[ST33ZP24_SPI_BUFFER_SIZE] ____cacheline_aligned; + u8 rx_buf[ST33ZP24_SPI_BUFFER_SIZE] ____cacheline_aligned; int io_lpcpd; int latency; diff --git a/drivers/char/tpm/tpm_tis_spi.c b/drivers/char/tpm/tpm_tis_spi.c index dbaad9c..58d7758 100644 --- a/drivers/char/tpm/tpm_tis_spi.c +++ b/drivers/char/tpm/tpm_tis_spi.c @@ -48,8 +48,8 @@ struct tpm_tis_spi_phy { struct tpm_tis_data priv; struct spi_device *spi_device; - u8 tx_buf[MAX_SPI_FRAMESIZE + 4]; - u8 rx_buf[MAX_SPI_FRAMESIZE + 4]; + u8 tx_buf[MAX_SPI_FRAMESIZE + 4] ____cacheline_aligned; + u8 rx_buf[MAX_SPI_FRAMESIZE + 4] ____cacheline_aligned; }; static inline struct tpm_tis_spi_phy *to_tpm_tis_spi_phy(struct tpm_tis_data *data) -- 2.6.6