From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F3BCEC433F5 for ; Fri, 13 May 2022 18:30:31 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 414A383B48; Fri, 13 May 2022 20:30:20 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=ibm.com header.i=@ibm.com header.b="g8qe6oPA"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E8C5C82A57; Fri, 13 May 2022 20:30:13 +0200 (CEST) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6C4EC839B9 for ; Fri, 13 May 2022 20:30:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=eajames@linux.ibm.com Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 24DFfvHU031947; Fri, 13 May 2022 18:30:07 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=KbZJ5JUANetDuVWVNY6aGwNzWeNVuNXqJ5k20EQqerY=; b=g8qe6oPA7S0VdHKTLGvayARAKJFXJl+hhwyVoqkFyO/5hA9k/aE9kt4BSH+40krJuVkP BNHsk6XVJms4wzb7p9JCPrIYk8ZSNzITZ3evTuKK2mVLb94JVMvGGITCPeo3267k2mO0 cpHmWawcvyqpNr9jbejiKThazONoSz/8CV2JdVDSrEqjpjR9iI4QLe6IE+XWldcuhiGp sW2HmGJHGvYZwzqJzNOLjf9/2xxGq3CI0gA/+jTJFysMVnRV55ABRXfCgw+vsz/LJbgM ckvltnevDl0KAar/+J9d/guauPFMUYLgGCMggFxqryyGs7elC9eBdiEAqr7VZ0xcUExp rw== Received: from ppma03wdc.us.ibm.com (ba.79.3fa9.ip4.static.sl-reverse.com [169.63.121.186]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3g1t6qu3c8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 13 May 2022 18:30:07 +0000 Received: from pps.filterd (ppma03wdc.us.ibm.com [127.0.0.1]) by ppma03wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 24DIRHon023450; Fri, 13 May 2022 18:30:06 GMT Received: from b01cxnp22035.gho.pok.ibm.com (b01cxnp22035.gho.pok.ibm.com [9.57.198.25]) by ppma03wdc.us.ibm.com with ESMTP id 3fwgda4604-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 13 May 2022 18:30:06 +0000 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 24DIU5JK19268034 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 13 May 2022 18:30:05 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9CF2AAC06A; Fri, 13 May 2022 18:30:05 +0000 (GMT) Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2B212AC05B; Fri, 13 May 2022 18:30:05 +0000 (GMT) Received: from v0005c16.aus.stglabs.ibm.com (unknown [9.163.1.123]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP; Fri, 13 May 2022 18:30:05 +0000 (GMT) From: Eddie James To: u-boot@lists.denx.de Cc: ilias.apalodimas@linaro.org, Eddie James Subject: [PATCH 1/2] tpm: core: Set timeouts before requesting locality Date: Fri, 13 May 2022 13:29:59 -0500 Message-Id: <20220513183000.47392-2-eajames@linux.ibm.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220513183000.47392-1-eajames@linux.ibm.com> References: <20220513183000.47392-1-eajames@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: BYvyQPJrbGUsLUJ0dDBougjGFCxy3I1e X-Proofpoint-GUID: BYvyQPJrbGUsLUJ0dDBougjGFCxy3I1e X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-05-13_09,2022-05-13_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 lowpriorityscore=0 malwarescore=0 suspectscore=0 adultscore=0 bulkscore=0 mlxlogscore=969 clxscore=1015 priorityscore=1501 phishscore=0 spamscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2205130075 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean Requesting the locality uses the timeout values, so they need to be set beforehand. Signed-off-by: Eddie James --- drivers/tpm/tpm2_tis_core.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/tpm/tpm2_tis_core.c b/drivers/tpm/tpm2_tis_core.c index 51392c4584..985a816219 100644 --- a/drivers/tpm/tpm2_tis_core.c +++ b/drivers/tpm/tpm2_tis_core.c @@ -433,15 +433,16 @@ int tpm_tis_init(struct udevice *dev) log_err("Driver bug. No bus ops defined\n"); return -1; } - ret = tpm_tis_request_locality(dev, 0); - if (ret) - return ret; chip->timeout_a = TIS_SHORT_TIMEOUT_MS; chip->timeout_b = TIS_LONG_TIMEOUT_MS; chip->timeout_c = TIS_SHORT_TIMEOUT_MS; chip->timeout_d = TIS_SHORT_TIMEOUT_MS; + ret = tpm_tis_request_locality(dev, 0); + if (ret) + return ret; + /* Disable interrupts */ phy_ops->read32(dev, TPM_INT_ENABLE(chip->locality), &tmp); tmp |= TPM_INTF_CMD_READY_INT | TPM_INTF_LOCALITY_CHANGE_INT | -- 2.27.0