From patchwork Thu Jan 12 22:04:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Maciej S. Szmigiero" X-Patchwork-Id: 714676 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 ozlabs.org (Postfix) with ESMTPS id 3v00D820hVz9t2g for ; Fri, 13 Jan 2017 09:04:40 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=sfs-ml-4.v29.ch3.sourceforge.com) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1cRnU3-0003Hm-E2; Thu, 12 Jan 2017 22:04:35 +0000 Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1cRnU1-0003Hf-Do for tpmdd-devel@lists.sourceforge.net; Thu, 12 Jan 2017 22:04:33 +0000 X-ACL-Warn: Received: from vps-vb.mhejs.net ([37.28.154.113]) by sog-mx-2.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) id 1cRnTx-0005Dn-D3 for tpmdd-devel@lists.sourceforge.net; Thu, 12 Jan 2017 22:04:33 +0000 Received: by vps-vb.mhejs.net with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.87) (envelope-from ) id 1cRnTh-000297-2F; Thu, 12 Jan 2017 23:04:13 +0100 From: "Maciej S. Szmigiero" To: tpmdd-devel@lists.sourceforge.net Message-ID: <36b62240-e8c8-9cef-2052-e4e33a617bcf@maciej.szmigiero.name> Date: Thu, 12 Jan 2017 23:04:11 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 MIME-Version: 1.0 X-Spam-Score: 0.0 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. X-Headers-End: 1cRnTx-0005Dn-D3 Cc: Christophe Ricard , linux-kernel Subject: [tpmdd-devel] [PATCH] tpm_tis: rename TPM_TIS_ITPM_POSSIBLE to TPM_TIS_ITPM_WORKAROUND 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: , Errors-To: tpmdd-devel-bounces@lists.sourceforge.net Rename TPM_TIS_ITPM_POSSIBLE to TPM_TIS_ITPM_WORKAROUND since it gives a better idea what this flag actually does. Suggested-by: Jason Gunthorpe Signed-off-by: Maciej S. Szmigiero Reviewed-by: Jarkko Sakkinen --- This needs "tpm_tis: fix iTPM probe via probe_itpm() function" applied first. drivers/char/tpm/tpm_tis.c | 2 +- drivers/char/tpm/tpm_tis_core.c | 8 ++++---- drivers/char/tpm/tpm_tis_core.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) ------------------------------------------------------------------------------ Developer Access Program for Intel Xeon Phi Processors Access to Intel Xeon Phi processor-based developer platforms. With one year of Intel Parallel Studio XE. Training and support from Colfax. Order your platform today. http://sdm.link/xeonphi diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c index 0127af130cb1..7912dadc39be 100644 --- a/drivers/char/tpm/tpm_tis.c +++ b/drivers/char/tpm/tpm_tis.c @@ -159,7 +159,7 @@ static int tpm_tis_init(struct device *dev, struct tpm_info *tpm_info, irq = tpm_info->irq; if (itpm) - phy->priv.flags |= TPM_TIS_ITPM_POSSIBLE; + phy->priv.flags |= TPM_TIS_ITPM_WORKAROUND; return tpm_tis_core_init(dev, &phy->priv, irq, &tpm_tcg, acpi_dev_handle); diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c index 401f1228547c..b6d2a6d474d2 100644 --- a/drivers/char/tpm/tpm_tis_core.c +++ b/drivers/char/tpm/tpm_tis_core.c @@ -264,7 +264,7 @@ static int tpm_tis_send_data(struct tpm_chip *chip, u8 *buf, size_t len) struct tpm_tis_data *priv = dev_get_drvdata(&chip->dev); int rc, status, burstcnt; size_t count = 0; - bool itpm = priv->flags & TPM_TIS_ITPM_POSSIBLE; + bool itpm = priv->flags & TPM_TIS_ITPM_WORKAROUND; if (request_locality(chip, 0) < 0) return -EBUSY; @@ -467,7 +467,7 @@ static int probe_itpm(struct tpm_chip *chip) size_t len = sizeof(cmd_getticks); u16 vendor; - if (priv->flags & TPM_TIS_ITPM_POSSIBLE) + if (priv->flags & TPM_TIS_ITPM_WORKAROUND) return 0; rc = tpm_tis_read16(priv, TPM_DID_VID(0), &vendor); @@ -485,13 +485,13 @@ static int probe_itpm(struct tpm_chip *chip) tpm_tis_ready(chip); release_locality(chip, priv->locality, 0); - priv->flags |= TPM_TIS_ITPM_POSSIBLE; + priv->flags |= TPM_TIS_ITPM_WORKAROUND; rc = tpm_tis_send_data(chip, cmd_getticks, len); if (rc == 0) dev_info(&chip->dev, "Detected an iTPM.\n"); else { - priv->flags &= ~TPM_TIS_ITPM_POSSIBLE; + priv->flags &= ~TPM_TIS_ITPM_WORKAROUND; rc = -EFAULT; } diff --git a/drivers/char/tpm/tpm_tis_core.h b/drivers/char/tpm/tpm_tis_core.h index 9191aabbf9c2..e2212f021a02 100644 --- a/drivers/char/tpm/tpm_tis_core.h +++ b/drivers/char/tpm/tpm_tis_core.h @@ -80,7 +80,7 @@ enum tis_defaults { #define TPM_RID(l) (0x0F04 | ((l) << 12)) enum tpm_tis_flags { - TPM_TIS_ITPM_POSSIBLE = BIT(0), + TPM_TIS_ITPM_WORKAROUND = BIT(0), }; struct tpm_tis_data {