Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp95610ybt; Tue, 16 Jun 2020 17:42:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXcHFjYpF0VEzzWkNJg9HN3YzjDVcsrdlm+42NKUCzP9DDdcXVWmypQ+itorVUEg8ZW34Q X-Received: by 2002:a50:f9cc:: with SMTP id a12mr5068220edq.227.1592354526201; Tue, 16 Jun 2020 17:42:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592354526; cv=none; d=google.com; s=arc-20160816; b=HkIYZ023GezHPEur8Go9TiSITI5U3ko9QrydhRyySQ7txGSubJd4LoJ0mcIXRqrbVe F462fvCR/Pl1iRpBvShc45/lCEM5BNPunkvLHdHUC+K96zGTS+ojdIQUnzoarGEOtYHI GtCf76rMvoQK3guNooYXbDpLaGGCl1uPKg/TwUXRYBFEpGRGko9Y0BlvjopKRcHGW2uL xYF23XWNt+LBYLpI1V/V3H2RLEwG3zDE+vUT5NpGZOmn+w1znVGUTyAs6w67u21xfSQR mPk/FiyZGrcrcyZBPpIrMDs9NUbSFc2XRk7ykjmnr7jOoLrZiVyFaeY8pFIPcVqTnJ4g uTsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=pJraOkCRxUlSval5OQEQpwyI4EdQqyeGXBapbFvKSOw=; b=dU3dJAxVDyEcIg5QieoT8GocWCQH1HwlaHrS9hcpJQPH16ombMertyNtIvh1uH+yjq D1MxWK3gNPT4tuQOdGK1wIqAHkue+7Bq6tmtJD/XU7axQO1j9Wk3FnmAFT8tMhW63U88 +0IEw+HDXaz1npdzCQZtPBeHth/c3LsE1+vwcFIiiePJVJOOmPm2qh+Ji775CQI0yA+p 1X8rxCc8UrCdDOFb3R1rnmDQMLFxKqjT0bW16YVzvLGnIF0Qzwge60YlzB4xOFensXc6 apZQFpEn9uvnxbP4xtzNjSeIaYHSureRCh2jzvqaRkTd5SjMwFDz9n/VZFlCvW6GvnX4 D/hg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id de16si10550023edb.30.2020.06.16.17.41.43; Tue, 16 Jun 2020 17:42:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1726629AbgFQAhk (ORCPT + 99 others); Tue, 16 Jun 2020 20:37:40 -0400 Received: from mga01.intel.com ([192.55.52.88]:35560 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725894AbgFQAhi (ORCPT ); Tue, 16 Jun 2020 20:37:38 -0400 IronPort-SDR: 6btyEopYtcWhQIIfwVIMkuBwT0xT1Xt3erNtWipWo7a+2XBgHYk4xefjBwHFOLrP0gUmqkU/54 5g0L3LU3TqSQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2020 17:37:37 -0700 IronPort-SDR: lODsoQHi8rVMcS8JBOZM22ZQFpr+o4U38aSiRKsTumXaHJosXss88z+9i8pLOq+lgsd28ULTQN e1b3CvWqFPDw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,520,1583222400"; d="scan'208";a="351914039" Received: from mjlewis-mobl1.ger.corp.intel.com (HELO localhost) ([10.252.33.151]) by orsmga001.jf.intel.com with ESMTP; 16 Jun 2020 17:37:27 -0700 Date: Wed, 17 Jun 2020 03:37:26 +0300 From: Jarkko Sakkinen To: amirmizi6@gmail.com Cc: Eyal.Cohen@nuvoton.com, oshrialkoby85@gmail.com, alexander.steffen@infineon.com, robh+dt@kernel.org, peterhuewe@gmx.de, christophe-h.richard@st.com, jgg@ziepe.ca, arnd@arndb.de, gregkh@linuxfoundation.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-integrity@vger.kernel.org, oshri.alkoby@nuvoton.com, tmaimon77@gmail.com, gcwilson@us.ibm.com, kgoldman@us.ibm.com, Dan.Morav@nuvoton.com, oren.tanami@nuvoton.com, shmulik.hager@nuvoton.com, amir.mizinski@nuvoton.com Subject: Re: [PATCH v10 1/8] tpm: Make read{16, 32}() and write32() in tpm_tis_phy_ops optional Message-ID: <20200617003726.GA3646@linux.intel.com> References: <20200604134713.157951-1-amirmizi6@gmail.com> <20200604134713.157951-2-amirmizi6@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200604134713.157951-2-amirmizi6@gmail.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 04, 2020 at 04:47:06PM +0300, amirmizi6@gmail.com wrote: > From: Amir Mizinski > > Only tpm_tis can use memory-mapped I/O, which is truly mapped into > the kernel's memory space. Therefore, using ioread16/ioread32/iowrite32 > turns into a straightforward pointer dereference. > Every other driver requires more complicated operations to read more than > one byte at a time and will just fall back to read_bytes/write_bytes. > Therefore, move this common code out of tpm_tis_spi and into tpm_tis_core > so that it is used automatically when low-level drivers do not implement > the specialized methods. > > Co-developed-by: Alexander Steffen > Signed-off-by: Alexander Steffen > Signed-off-by: Amir Mizinski Reviewed-by: Jarkko Sakkinen Tested-by: Jarkko Sakkinen I tested this with my T480 ThinkPad, which has Infineon SLB 9670 TPM chip according to TPM_PT_VENDOR_STRING_* [*] [*] tpm2_getcap properties-fixed from tpm2-tools package to fetch this information. /Jarkko