From patchwork Fri Jul 29 02:59:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Pronin X-Patchwork-Id: 9251923 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BCDCA60757 for ; Fri, 29 Jul 2016 02:59:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ADE2F27F88 for ; Fri, 29 Jul 2016 02:59:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A252027F8F; Fri, 29 Jul 2016 02:59:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3CE3627F88 for ; Fri, 29 Jul 2016 02:59:26 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=sfs-ml-2.v29.ch3.sourceforge.com) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1bSy1C-0005bk-HP; Fri, 29 Jul 2016 02:59:22 +0000 Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1bSy1B-0005bf-Dw for tpmdd-devel@lists.sourceforge.net; Fri, 29 Jul 2016 02:59:21 +0000 Received-SPF: pass (sog-mx-2.v43.ch3.sourceforge.com: domain of chromium.org designates 209.85.220.46 as permitted sender) client-ip=209.85.220.46; envelope-from=apronin@chromium.org; helo=mail-pa0-f46.google.com; Received: from mail-pa0-f46.google.com ([209.85.220.46]) by sog-mx-2.v43.ch3.sourceforge.com with esmtps (TLSv1:AES128-SHA:128) (Exim 4.76) id 1bSy1A-0003OL-DV for tpmdd-devel@lists.sourceforge.net; Fri, 29 Jul 2016 02:59:21 +0000 Received: by mail-pa0-f46.google.com with SMTP id fi15so26618166pac.1 for ; Thu, 28 Jul 2016 19:59:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=LtwJhIQB42lLBE889rSzefpwB1F4B4oLyuNOtKeQjRU=; b=GnrKONo3H1BrToz6dLdZ3XdqfSnFVZYXvH7ImzLOodkxB/gCyMXNc9Ve2+voev3rn4 +utfBOvjgYk6D8COBKg8XBZdTEwyLX2gMtoEZljyzY9gRHimqwi1qvZW3JfXaM04BbxW H9QhHg08KrlRV1PydmWFP0PYBSC7MH2IylJccg5A35hISI3ZpUXZHP1xqqQ8Rys0Uu9m SBci3CYR8FmeXUjCfJjR+P42wGy2rg507AMpOB99pJaCZNbbRzjLDWLs9qMWWf3q7lxb uZh4YfddJSrKuUZgEWhktQphPwbAHTbEnQMngU2X1Ido45rRb7/fQPivh+QdZRyKmJLP MyOg== X-Gm-Message-State: AEkoouv8yPSr7hkhS0nPTqaJdoFUeayowvMzyor77kAZen0IMwdE1RFan8xpoD8c3MP70MOt X-Received: by 10.66.124.136 with SMTP id mi8mr64403331pab.26.1469761154783; Thu, 28 Jul 2016 19:59:14 -0700 (PDT) Received: from apronin0.mtv.corp.google.com ([172.22.64.136]) by smtp.gmail.com with ESMTPSA id p67sm20257233pfg.22.2016.07.28.19.59.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 Jul 2016 19:59:14 -0700 (PDT) From: Andrey Pronin To: Jarkko Sakkinen 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 X-Headers-End: 1bSy1A-0003OL-DV Cc: Christophe Ricard , linux-kernel@vger.kernel.org, tpmdd-devel@lists.sourceforge.net, dtor@chromium.org Subject: [tpmdd-devel] [PATCH] tpm: fix cacheline alignment for DMA-able buffers X-BeenThere: tpmdd-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Tpm Device Driver maintainance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: tpmdd-devel-bounces@lists.sourceforge.net X-Virus-Scanned: ClamAV using ClamSMTP 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)