Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3426663ybc; Thu, 14 Nov 2019 08:58:26 -0800 (PST) X-Google-Smtp-Source: APXvYqztQo/hv5eh16gxxx9mMa7XUbHRIMDHTgTPmQWA5W8UR3jRgdJo/ovk2joI/44T68/WvMX2 X-Received: by 2002:a50:8dc9:: with SMTP id s9mr2411141edh.155.1573750704994; Thu, 14 Nov 2019 08:58:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573750704; cv=none; d=google.com; s=arc-20160816; b=j++QKe6rrjb8ktMmI33XWJnfsApK6MWUaz3dJ2t8zbbEaUdV8ZQfpvG0IzRkS+K/Un /S2EddQFq5oEmZWUJZSZwSHHabHUP0JWLuGRsOISju70N/mTttDJr5pZ/eN4loScrc2f r1jyuljcf+siPBxsp1qeinF0MTILP0hOz5H8quoBTFE4+G3ikn8BYjc8XS/+34mdsmMk d9nRgVtJ9Pp+zNiWI5htZUr1Vbsxk7UxbaPlpWVrEVMfAI/AQsOfN5R/VRlqqTl2qGzi gdP1lkqdN3GTmn/zJo6gTvnyK7+0wPpuaQHb2W1MvEmEVsxtV7zt3fBP1CbXAs0zs3A9 RWFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=LEt7mE3NlmcSAYBrfWxXnm5oc1z08XQBzX7blFZW3YM=; b=RBA3WVpHR0HI6FPkyJgT+PNsL+9ICM5YyWvk29phlFZzbRGi3U2YZpu9ovbX5Hg7ag WO6x3eJlHXpXA1Z4hOUezxRchizzvMI6Mpfg3P9uw6WfzUZfkTvL0BtRTA6qZH7MAvfP Ar8WeYpJrP0Oe++uVnzIjFccLdzvi2a3Y/jrMkY/wFeJA7/hlvD1MWcFDkq4Bd4OuHzj vFjHpRD8E+QAzgNER/SsrkcI5nq2VsP9Up9RqXKH1D/Ns1BPDwXnEShpG7taEI4EkQt6 NpcA5HLFecw7LTXO7QyMXI6+Uk5I0WS+l5SQSdJjtY0k34LHWKsjI2xiS0IBGSXgdU+0 3TnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=Ln3NbCfy; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w21si3622144eja.324.2019.11.14.08.57.58; Thu, 14 Nov 2019 08:58:24 -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; dkim=pass header.i=@ziepe.ca header.s=google header.b=Ln3NbCfy; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726930AbfKNQ4b (ORCPT + 99 others); Thu, 14 Nov 2019 11:56:31 -0500 Received: from mail-qk1-f193.google.com ([209.85.222.193]:39289 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726597AbfKNQ4b (ORCPT ); Thu, 14 Nov 2019 11:56:31 -0500 Received: by mail-qk1-f193.google.com with SMTP id 15so5579074qkh.6 for ; Thu, 14 Nov 2019 08:56:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=LEt7mE3NlmcSAYBrfWxXnm5oc1z08XQBzX7blFZW3YM=; b=Ln3NbCfyyphUGctMBJPN1Evy417y1ng2dQdPseF+6NAmTNHhXfiLYSSYq8f06fkIpr MbyAqVa5yVDn1Cu9ukeg2CoNrPRQP9jzws0w8malWAqGe345/FP/lZpuk7iQUDYHchJY obluI9BCLAoJA5ics3DqOTe07uO7+JAxpLKiwmxZwLycwfNbH3AmvCw9ZBvyfjRX8OJX 7eSKd3mbJRSBEUlhAzO3E2p4I+oa/lF6OFHqXrdXT279oiut1So/+fshDGXK+/P6L8QA wgWNz9l1LcJwow1YGMIYM9kqKI7o6rRlJ1nCUUiNWmTAYyKkfMdBCBxNfKJoLGQ4ZEKZ TgZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=LEt7mE3NlmcSAYBrfWxXnm5oc1z08XQBzX7blFZW3YM=; b=ukLCXdR5r7TCtpGWx8XBqBNuNehgXwJ7s6shx9WCGd1WWTQLrnL/rnY1VsY7q/uVsf TEs70YSQCb8t9M7ahqDrkVIrZeokyP7Z8En+uvIoXGgkDSisHbFPQS9U1Mc57vWDcDUO 4+3C9xAE2oJlxHhmN0pXS7Vm65kzBNVSfLmARgXyULUlUF7d9+kdDCwpEgUWld6FBuA0 v1Z5FjQ+I6C85eovwD42vseE+Q+xtfnPHrJFRm/O6yS6U2ytpFEAqNy4MNFRh1Fo1hyw te0CzqyUVHgGJdpIHyAWBXB+myEIjcUP0qQPqr6jZEaYF0CXt6vRnj44mMgTLuofUYUU d5sQ== X-Gm-Message-State: APjAAAVKJv/l56+GySF4uAF64qd6f9yTSSjeHyjgweQs9f58np+GgFiX yW51KV4/mZmnAJdofDPzv/ot9ZM1wGo= X-Received: by 2002:a37:6189:: with SMTP id v131mr7847602qkb.489.1573750590124; Thu, 14 Nov 2019 08:56:30 -0800 (PST) Received: from ziepe.ca (hlfxns017vw-142-162-113-180.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.162.113.180]) by smtp.gmail.com with ESMTPSA id 27sm3554067qtu.71.2019.11.14.08.56.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 14 Nov 2019 08:56:29 -0800 (PST) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1iVIQ1-00044H-Av; Thu, 14 Nov 2019 12:56:29 -0400 Date: Thu, 14 Nov 2019 12:56:29 -0400 From: Jason Gunthorpe To: Jarkko Sakkinen Cc: Jerry Snitselaar , linux-integrity , Peter Huewe , Linux List Kernel Mailing , linux-stable@vger.kernel.org, Christian Bundy Subject: Re: [PATCH] tpm_tis: turn on TPM before calling tpm_get_timeouts Message-ID: <20191114165629.GC26068@ziepe.ca> References: <20191111233418.17676-1-jsnitsel@redhat.com> <20191112200328.GA11213@linux.intel.com> <20191112202623.GB5584@ziepe.ca> <20191114165357.GA11107@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191114165357.GA11107@linux.intel.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 14, 2019 at 06:55:06PM +0200, Jarkko Sakkinen wrote: > > Would it function with the timeout values set at the beginning of > > tpm_tis_core_init (max values)? > > tpm_get_timeouts() should be replaced with: > > if (tpm_chip_start()) { > dev_err(dev, "Could not get TPM timeouts and durations\n"); > rc = -ENODEV; > goto out_err; > } > > tpm_stop_chip(chip); > > tpm_get_timeouts() is called by tpm_auto_startup(). Also the function > should be moved to tpm_chip.c and converted to a static function so > that it won't be called from random cal sites like above. Careful, the design here was to allow a driver to do only get_timeouts, then additional setup work, then do auto_startup() Forcing a driver to do auto_startup too early may not be good. Jason