Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp4767843ybc; Fri, 15 Nov 2019 09:45:01 -0800 (PST) X-Google-Smtp-Source: APXvYqyYlnqkX4Eo7beHUGbrQofllnW28TirY1qyjPeBC4+x7/JVea8kOsm7JpCLPV7oZjSsdt0f X-Received: by 2002:a17:906:f259:: with SMTP id gy25mr2362356ejb.297.1573839901338; Fri, 15 Nov 2019 09:45:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573839901; cv=none; d=google.com; s=arc-20160816; b=kNl5/gltRywDyN/fRCye44bd0NKzg/SP5Ut07rf3ka+xX4fU/m4Xx22gMFcB2Q5Luc 9i10aFqQijO343Al6LZhWxYKrpNEplsggtZs6GBDfVNy9mXaV9sHz07FfZ4KZKyM0rNV sKHtfBE4PEbozPyAi4otTR/o8GqZ+LxGjNm3UE3w0mrGQ6u5bCs0VXFhiRxpy9lL0ljh qgMSwCqtsN+oyuvJl/IcZqokjoaH8sV03eCnoUPsukHUJEol+FKznZOKo3X1ijK6hy7K PcVwhWtfZPhvja49H5S4m8OQC4UgfkTDCvNFt9acJKbBgvmHxTL4i2qXQH6W6ICq0XfI dQ7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=TKpUglFPs4e5hSvIolC43mVewxG5cdTt/oXKOvoI8ns=; b=vqV29BNLOyLEItrNiyClDwo9COaTpmuqT0VQxmHwT9BzMdg5cnAG92Te+ivyVdmD78 fK0lIwGqPMrk7tfnTy49ZIX3FuZpIUnv+hhUxbF/ZfGRSL2PP0yhDyY9jrkrTyc9LxnT /El+BHMcNVmqvNBtWEUXjRMljuSXw5qw5M+UeIgFiMmWxLA0DVx60ueJfORREfgCLEO5 bixRWInmbtwN4VBSng/la23rAvSlgEl5W/ebNnznBGjvlPB/39lhhpIKxorx50gZ5cmm 7t678Vwt2k0vdKJwIjfP8WoPoKHM7eSfiVXOGddRyT+DNwneI07RVwwXEyA50ZjGrK6e itRw== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f11si6063783ejr.10.2019.11.15.09.44.36; Fri, 15 Nov 2019 09:45:01 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726466AbfKORng (ORCPT + 99 others); Fri, 15 Nov 2019 12:43:36 -0500 Received: from mga14.intel.com ([192.55.52.115]:15679 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725848AbfKORng (ORCPT ); Fri, 15 Nov 2019 12:43:36 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Nov 2019 09:43:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,309,1569308400"; d="scan'208";a="199269947" Received: from sgaffney-mobl3.amr.corp.intel.com (HELO localhost) ([10.252.4.81]) by orsmga008.jf.intel.com with ESMTP; 15 Nov 2019 09:43:31 -0800 Date: Fri, 15 Nov 2019 19:43:29 +0200 From: Jarkko Sakkinen To: Jason Gunthorpe 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: <20191115174329.GA22029@linux.intel.com> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191114165629.GC26068@ziepe.ca> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) 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 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(). /Jarkko