Received: by 10.223.185.116 with SMTP id b49csp6549117wrg; Wed, 28 Feb 2018 11:20:07 -0800 (PST) X-Google-Smtp-Source: AH8x225cYSE9cTmg6DuqKBx/tCQTUhJWMprUMx8Ep798AGcT9OKFvsQvkrM45Bh25Em4RzRE07Jw X-Received: by 10.99.177.6 with SMTP id r6mr14869916pgf.76.1519845607190; Wed, 28 Feb 2018 11:20:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519845607; cv=none; d=google.com; s=arc-20160816; b=JIl55ATeR8ZQ1my/B9yMBlQAsq0aYQVspLcHP+ew96mwgd9Ml5kNR9GJneNXbP1SXT U+pDdlW8KGM3uklpkjev7QBHxdh7ai4IkahgHkXXaQd8EAsK3Wcf8ic4gzj7QLY/+LSR YlIcnQ3BmUI46hqyPpz2Q6WZZSiAePPL7LsALcliZDl6dVruq8qVgH1QfmtHSll/FCSb kHrSJz9aaTvXZ/53XJr7TN2HPz9v/vXn0vD0X5938vIGPzAH8lhDCI1ssnCqAoa1M3uQ kWaIy4UUwaZ9lOOOsnbn77LvIDLBQvIJHSWTS6wvI8Jpc8+CQ54PMALbgnv52fDyxiIE UuBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=p7puJuf/0MringsDY98z7fBYgI67llMHKycOj48kWmg=; b=fkNnm8//C8GgW8eWZnInPIg9lObbDJs58xch92lDIW/5/YsNgN/jqGKBmlQblmGAFi gTaSEa2q4SUbM7ohbO4pQEhsxIhyCTusTn3PkbldAx+QB+yVF5v30Jb0DhC5asRufhk4 bH3F4PGQHd0aV8TNual9V6YKb6ucdwPDLDe70F1LV8f9Zf0HIpd0RTGi7GGAp9LHUJ4y Ug4KEc02vx7Q6yRVBPI9O1Gy2gwyEbilAaJgfrUcmRFcSdJdWMSBV26hcWCvRl8gmtYx ZJTvg+4XsCXyGSMBDZCd2hksQi9zlKLwle/bk+WMMgnLBXiZFjeYqV/oZjPYrmbYugcY Ssjw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s3-v6si1700497plb.4.2018.02.28.11.19.52; Wed, 28 Feb 2018 11:20:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933537AbeB1TSs (ORCPT + 99 others); Wed, 28 Feb 2018 14:18:48 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:38818 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932780AbeB1TSp (ORCPT ); Wed, 28 Feb 2018 14:18:45 -0500 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w1SJEUOv054120 for ; Wed, 28 Feb 2018 14:18:44 -0500 Received: from e06smtp13.uk.ibm.com (e06smtp13.uk.ibm.com [195.75.94.109]) by mx0b-001b2d01.pphosted.com with ESMTP id 2ge29x0e52-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 28 Feb 2018 14:18:44 -0500 Received: from localhost by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 28 Feb 2018 19:18:42 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 28 Feb 2018 19:18:40 -0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w1SJIdrK51904574; Wed, 28 Feb 2018 19:18:39 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5DAF611C052; Wed, 28 Feb 2018 19:11:32 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 425E911C04C; Wed, 28 Feb 2018 19:11:31 +0000 (GMT) Received: from localhost.endicott.ibm.com (unknown [9.60.15.245]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 28 Feb 2018 19:11:31 +0000 (GMT) From: Nayna Jain To: linux-integrity@vger.kernel.org Cc: zohar@linux.vnet.ibm.com, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, peterhuewe@gmx.de, jarkko.sakkinen@linux.intel.com, tpmdd@selhorst.net, jgunthorpe@obsidianresearch.com, patrickc@us.ibm.com, Nayna Jain Subject: [PATCH 1/3] tpm: move TPM_POLL_SLEEP from tpm_tis_core.c to tpm.h Date: Wed, 28 Feb 2018 14:18:26 -0500 X-Mailer: git-send-email 2.13.3 X-TM-AS-GCONF: 00 x-cbid: 18022819-0012-0000-0000-000005B71DDE X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18022819-0013-0000-0000-000019331EFF Message-Id: <20180228191828.20056-1-nayna@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-02-28_11:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1802280234 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch moves TPM_POLL_SLEEP from tpm_tis_core.c to tpm.h, renaming it to TPM_TIMEOUT_POLL, to follow the existing enum naming conventions. Signed-off-by: Nayna Jain --- drivers/char/tpm/tpm.h | 3 ++- drivers/char/tpm/tpm_tis_core.c | 10 ++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h index f895fba4e20d..7e797377e1eb 100644 --- a/drivers/char/tpm/tpm.h +++ b/drivers/char/tpm/tpm.h @@ -53,7 +53,8 @@ enum tpm_const { enum tpm_timeout { TPM_TIMEOUT = 5, /* msecs */ TPM_TIMEOUT_RETRY = 100, /* msecs */ - TPM_TIMEOUT_RANGE_US = 300 /* usecs */ + TPM_TIMEOUT_RANGE_US = 300, /* usecs */ + TPM_TIMEOUT_POLL = 1 /* msecs */ }; /* TPM addresses */ diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c index 183a5f54d875..dc474e7244a6 100644 --- a/drivers/char/tpm/tpm_tis_core.c +++ b/drivers/char/tpm/tpm_tis_core.c @@ -31,12 +31,6 @@ #include "tpm.h" #include "tpm_tis_core.h" -/* This is a polling delay to check for status and burstcount. - * As per ddwg input, expectation is that status check and burstcount - * check should return within few usecs. - */ -#define TPM_POLL_SLEEP 1 /* msec */ - static void tpm_tis_clkrun_enable(struct tpm_chip *chip, bool value); static bool wait_for_tpm_stat_cond(struct tpm_chip *chip, u8 mask, @@ -90,7 +84,7 @@ static int wait_for_tpm_stat(struct tpm_chip *chip, u8 mask, } } else { do { - tpm_msleep(TPM_POLL_SLEEP); + tpm_msleep(TPM_TIMEOUT_POLL); status = chip->ops->status(chip); if ((status & mask) == mask) return 0; @@ -232,7 +226,7 @@ static int get_burstcount(struct tpm_chip *chip) burstcnt = (value >> 8) & 0xFFFF; if (burstcnt) return burstcnt; - tpm_msleep(TPM_POLL_SLEEP); + tpm_msleep(TPM_TIMEOUT_POLL); } while (time_before(jiffies, stop)); return -EBUSY; } -- 2.13.3