Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3423507ybb; Tue, 31 Mar 2020 05:06:47 -0700 (PDT) X-Google-Smtp-Source: ADFU+vurl5Uw96GeinbqtTuEmLOaEUp6tzTHEceGAt7+LFZ4/utV1HqXYidgsjW+oMEdnKi77ATB X-Received: by 2002:aca:4843:: with SMTP id v64mr1746769oia.13.1585656407625; Tue, 31 Mar 2020 05:06:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585656407; cv=none; d=google.com; s=arc-20160816; b=BvgNRrqzG89PP62XtqNL2gSTw3Nlf6hPALNhE24SjwlK/xTvBJKbruizIPiS5w9rJ8 xSu9/W6w/nHkEtuaV1GAMr4Pf1pVtKIBw5MQJKvXLdJRWJhm2Smtcm7q1nF+KTpLKnFQ ubUZdJdDE6MJxQVZ4znA2zhp+Sxq/AM5e320iQk7eqG1Ii3QXOTmyWE/v/fJCvNAefPZ eMr7vEDvcRyJbiaDAHRMi6XIuU+KwA587bRwwN9AWDwJxI+fXIf1iaZZQjGd7o05ABXM u/FmwhyrgeIiaU+IirrrnlobCIjnAwa2LCgbUwBbHDAK+Yc5FfsqT9OjvLmO1ifhLUPD Oo+A== 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=BD18w/JO6ZiORCECcPUdAx22WZidbHdIiG4i37XEYtA=; b=f9riYAtNE339Nkv0AdHg3ouLb5J6DFl2GgdCmVeV/eMSkW+kX/jUOz72MjFnvAcLfI ntOsCmJfRle1XLVAzcbXkxrUTpdBGr+CiU96MGuT7IeeaTgplh44MTOmmQBE0RGo4cuG YVdEJz3u99b+4kUkI2X7246lr8Ub8Z5Ku9aWfO3APWGOlk40oVpazDPUPQMf67kxJAdh 8Mf28LiSQ27q0Wn87CeaekrekbubKlBV+dKpLoAAPFe5My6cQBIeuadB5b6I/KPdE9wN 141SXhvy4X8sWtWR4TTmkCOhML/2WmT4q0l30CAG3DQQsetEI4lbWsgCe0udNWqGaNnf +/Rg== 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 r5si4720824otq.184.2020.03.31.05.06.32; Tue, 31 Mar 2020 05:06:47 -0700 (PDT) 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 S1730464AbgCaMEe (ORCPT + 99 others); Tue, 31 Mar 2020 08:04:34 -0400 Received: from mga01.intel.com ([192.55.52.88]:3992 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730343AbgCaMEe (ORCPT ); Tue, 31 Mar 2020 08:04:34 -0400 IronPort-SDR: 8QlVzJmy3OinDRgfR/cmPLHanxkLLnY+OXwrDSxuMkJ1IpB2o6EB6pAMvkpF1jhoZUokh6zN8D zAbDlAxpGjLg== 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; 31 Mar 2020 05:04:33 -0700 IronPort-SDR: 8jl0lvYsbmsqMEXaBWfMO2XgkrGQ8/WLqMPFlBqryMdC5PajiPwPT+KZkGPKKKYrHOimzKU4qQ hWR3x6t5sxyQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,327,1580803200"; d="scan'208";a="328061507" Received: from tking1-mobl2.ger.corp.intel.com (HELO localhost) ([10.252.59.94]) by orsmga001.jf.intel.com with ESMTP; 31 Mar 2020 05:04:21 -0700 Date: Tue, 31 Mar 2020 15:04:20 +0300 From: Jarkko Sakkinen To: amirmizi6@gmail.com Cc: Eyal.Cohen@nuvoton.com, oshrialkoby85@gmail.com, alexander.steffen@infineon.com, robh+dt@kernel.org, mark.rutland@arm.com, peterhuewe@gmx.de, 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 v4 1/7] tpm: tpm_tis: Make implementation of read16 read32 write32 optional Message-ID: <20200331120405.GF8295@linux.intel.com> References: <20200331113207.107080-1-amirmizi6@gmail.com> <20200331113207.107080-2-amirmizi6@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200331113207.107080-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 Tue, Mar 31, 2020 at 02:32:01PM +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. So using ioread16/ioread32/iowrite32 turn into a > straightforward pointer dereference. > Every other driver require more complicated operations to read more than 1 > byte at a time and will just fall back to read_bytes/write_bytes. > Therefore, move this common code out of tpm_tis_spi into tpm_tis_core, so > that it is automatically used 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 /Jarkko