Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp4824847ybc; Fri, 15 Nov 2019 10:38:39 -0800 (PST) X-Google-Smtp-Source: APXvYqxUkh7ChBfGy38AI/ccTzQ/jk4bd8K0eKFr1uvW9y4o3kIeVb4yOX2QwSlrbND3YlwUhasf X-Received: by 2002:a1c:7507:: with SMTP id o7mr15760937wmc.163.1573843119172; Fri, 15 Nov 2019 10:38:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573843119; cv=none; d=google.com; s=arc-20160816; b=T4x4iDEK/cgQSU3cxSCC+6mQrjHOHZuswaFokqmDz/rz1X46j2tE/L3LJ1k1PKkOYO ssJI1GJ56pTIoupa3M0fw3v3e7zmRSHA75XmeDuF99ANjvdto2SsKUuKUNYRzeDu/6hk U+EvuqaKhiEz409t4mtgCU6kjt/BazW/gFCb2MCXlNv7INGgTEsa52m2d44E0CRGTFaH dhUjaWDrm4NFItiyJnsLOPm+qG0yz2hBtXWViCr2LPvpw6G4pwuHFyMUhzRXDXcqFPY9 w454DTUVXjl9ZksF5wrtSZs42WhekaUjU5K4ZOXw0RqT5xqOET3NlaBli3fWPSvisM8/ Uwaw== 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=PmhmT2/lpw5E3a3t/TqBOzoCn7nixan0CEkVXorZZoM=; b=QZ/K9831LeGsw6n0yrYAl09ER6lztgwQKwZl4YPgKb9TnrBcSnt7oUYwilsloh6w68 wzYVmYxba2UnfYEuOT1KJp1Jv5R73uTTz++MdtBye96f4oeirZxxyD5Acy0QZmQPADuP 4qs8LmFyWqilj4+SCmnTZrzMLvT0+WqT0mDS5slcI+rxAgY3lPlqNwz18kxebTVGHMAT Me5tVDx+JWEY5nsLYRxLKEeac5asnvEHQgtq82sWHk/DVRjS0uN4xq3hpqSW5k5DmAPX 4wWZvOPAX9Vpx0x3iWFCtv4aA9THTdIgURLkGb29dwKTSWpeA7V9gbEpSOAnQkfyM7NA 1A1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=joAezW7g; 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 f12si6156152edy.41.2019.11.15.10.38.13; Fri, 15 Nov 2019 10:38:39 -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=joAezW7g; 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 S1726640AbfKOSgY (ORCPT + 99 others); Fri, 15 Nov 2019 13:36:24 -0500 Received: from mail-qt1-f195.google.com ([209.85.160.195]:36409 "EHLO mail-qt1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726549AbfKOSgY (ORCPT ); Fri, 15 Nov 2019 13:36:24 -0500 Received: by mail-qt1-f195.google.com with SMTP id y10so11826901qto.3 for ; Fri, 15 Nov 2019 10:36:23 -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=PmhmT2/lpw5E3a3t/TqBOzoCn7nixan0CEkVXorZZoM=; b=joAezW7gib3gJoviK/Y6NKyx+9IWZH+xyHyWf3myiIVDpMlilJ0CwDnlYBR4o0RjPo NSQnJw886okNTsJdX0C/Lcp9H3V+x5hBVzkfoqVChaPOFFtJM5JfKSkpkttB7yMZRxH4 U7TtYu0skLt5GrBe8zee9Nka6um/nQKYVV9ZreH0QXBn/SwmUreqIx4JjfhnUqisWmuq N4EqgfM516CcLVvzEsPi78q36GIaz68LYPkTiqM5AqXxYIb2bk63Og3gxH6WWGSnaFGu wnPuk7sIo8Oq7dAKqwr66KTNEjp1JA3e4HK9odU/4FG8v6m6bStTF3XIJeQlIu21faZ3 3cOA== 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=PmhmT2/lpw5E3a3t/TqBOzoCn7nixan0CEkVXorZZoM=; b=b2Lmp+6BGjos+pZM4JN4z1FjhEJMODm9W2M8vLZgMJLFx/38aR8ZBXsohqzgIfu5te 4V9U2LvdoaLUcfgPUoin4MBJTtdziHNY7+8Ou7YAxHmn618b6FMXLdKtXM5ruZWCkK8k 4N4SDj9oXgj/0200JfIhDIhJoh+Fk9hRpl7s7hoadNJBUT2oIWq8HDZLGkRmIGuAvCyc a5KxcvlCIvbUs7Z3j6ijELyMtxqQpTyj6qz4sJyaoFOchCn6Jm6rPKFaTCaooliGgCdd oDVd0UmECKEqPG8p/+YowClHFFXQFgo0PkxyFnkhJ6G2CIWxFo7yE3i/LCH+IfjX5mr8 KwXA== X-Gm-Message-State: APjAAAXU4KiuoQ4yyeBWPGGKymoBlXi4L93tbu7cnZUiDJvftFP643lx vwaprjDyPZNkyWo0ObUCK+UcRg== X-Received: by 2002:ac8:382e:: with SMTP id q43mr15186871qtb.326.1573842983013; Fri, 15 Nov 2019 10:36:23 -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 b54sm5808220qta.38.2019.11.15.10.36.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Nov 2019 10:36:22 -0800 (PST) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1iVgSD-0007Hb-64; Fri, 15 Nov 2019 14:36:21 -0400 Date: Fri, 15 Nov 2019 14:36:21 -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: <20191115183621.GD4055@ziepe.ca> References: <20191111233418.17676-1-jsnitsel@redhat.com> <20191112200328.GA11213@linux.intel.com> <20191112202623.GB5584@ziepe.ca> <20191114165357.GA11107@linux.intel.com> <20191114165629.GC26068@ziepe.ca> <20191115174329.GA22029@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191115174329.GA22029@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 Fri, Nov 15, 2019 at 07:43:29PM +0200, Jarkko Sakkinen wrote: > On Thu, Nov 14, 2019 at 12:56:29PM -0400, Jason Gunthorpe wrote: > > 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. > > All drivers always do it anyway because all drivers always call > tpm_chip_register(). But chip_register is after the driver has done it's setup and after it may have called get_timeouts auto_setup should not be moved to before chip_register() Jason