Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp556427pxb; Thu, 26 Aug 2021 09:03:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzUsAGZQxJzFtfzjwDzji6yxuZf4qk3LAjTA6PAI4FU8QFF6/GL5YCydpZtHCq/Q9l7Bxzs X-Received: by 2002:a17:906:4c89:: with SMTP id q9mr5092419eju.118.1629993827380; Thu, 26 Aug 2021 09:03:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629993827; cv=none; d=google.com; s=arc-20160816; b=0Tz4Mw7rFOHCgFolUxJ7kouiFjTmtJaSqhcJPNF7Y3mAplShLc/7MfCJNMikX4ZsjS TH8bJLzPszI3Ntfupv3e4AJo0OcvcgGTmMLW0d3Sn0rfQT6kCRzmwIogiLCdUx7shPsB XwRZytdZlDPlhKRLlqRmBVxgg/fevQX10vyKhyDAk0y5sWJvTh0dGQnTRJ5kPLRn4HqH 6gjdc24vPIfjDxEYp6Ci0U8Y89HAFHSjFQObP5TgmycMJM9H6A/Z7xQyYnAFSqf5Nk6H fzHZrqlbHi9bgDIJAuEzbfos0+xAQ3hVCZbtvQnKhr6qFzDjtecb7RJ8WM3v+ewzvkUO ck5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=ZnGe1nVJ1CjSDZDcZI0kLv7JieGOOXz8IXiGfM2vWOg=; b=yIpvamqck7xtPore5RsosO4NLVeAjo61zF38FbsLZ452BzdrsV0ZsHvRKTLyWOFrU5 swOvlb8N9Nc/vdqEcGyUNeo6mt/CR91+bcVZ8pjm5f3VAGFlUjB8lTl9h8GBt7rx+jCl ay2QJ5AnU1FoZ+5cJ+DRpfZAlVZYRh59VypCA1ZEBPzVbnEgU29Ut4coep7jFE0BPaVw uPi1HeB0K1pFfs3zhpCPvJ2ObN0JrdXn7lAafm3EI+uZcK35i+8WOcNXoJ3NfVn+FD+8 aYdX+/MjJqeIFFeCTpBN7/SgU16JZk17AHMtng6oaJIk68aL90iE7opiQdYDK8rCZG3H F+Zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kapsi.fi header.s=20161220 header.b=vCwqW1gA; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x5si2970408ejf.530.2021.08.26.09.02.58; Thu, 26 Aug 2021 09:03:47 -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; dkim=fail header.i=@kapsi.fi header.s=20161220 header.b=vCwqW1gA; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242960AbhHZP6W (ORCPT + 99 others); Thu, 26 Aug 2021 11:58:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234972AbhHZP6V (ORCPT ); Thu, 26 Aug 2021 11:58:21 -0400 Received: from mail.kapsi.fi (mail.kapsi.fi [IPv6:2001:67c:1be8::25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8159C061757; Thu, 26 Aug 2021 08:57:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kapsi.fi; s=20161220; h=MIME-Version:Content-Transfer-Encoding:Content-Type:References :In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=ZnGe1nVJ1CjSDZDcZI0kLv7JieGOOXz8IXiGfM2vWOg=; b=vCwqW1gApWpdGNv1xOnZEngggZ tapUoSvNGbDkeiGebQoMw5auiTyvm1Bf+8L2tTnwQUrcU9hKH9zEpThL0jphg8B4cCVg1zRpn3zsK e5RriResuYJf+iIpnb5blFK2vNvMK/WGSq9P0ANhriDGHHVS+92EV54qoDWipGXG7oj4VMmV6L0j0 3Srwy3i36F8r1cam65UIgDSl3AoNAl0XSs8bwCENdQMYq6+oRVl5NpDz8AKgqlt1r6DrlqXhbGHK9 r/p/K5srrlj0pNAQ6iQGKjMhirW7YXhDGurLKyyUk2JT1qOVWEMr2HteoAnKECnf8dOdltGtSPx+p y6tQ1MDQ==; Received: from 83-245-197-237.elisa-laajakaista.fi ([83.245.197.237] helo=localhost) by mail.kapsi.fi with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1mJHkX-0006ux-Oe; Thu, 26 Aug 2021 18:57:05 +0300 Message-ID: <284e47260b22b8f308a1efa6754845329f6c89a5.camel@iki.fi> Subject: Re: [PATCH v13 1/7] tpm: Make read{16, 32}() and write32() in tpm_tis_phy_ops optional From: Jarkko Sakkinen To: amirmizi6@gmail.com, Eyal.Cohen@nuvoton.com, jarkko.sakkinen@linux.intel.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, benoit.houyere@st.com, eajames@linux.ibm.com, joel@jms.id.au Cc: 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 Date: Thu, 26 Aug 2021 18:57:04 +0300 In-Reply-To: <20210826111908.117278-2-amirmizi6@gmail.com> References: <20210826111908.117278-1-amirmizi6@gmail.com> <20210826111908.117278-2-amirmizi6@gmail.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.36.5-0ubuntu1 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 83.245.197.237 X-SA-Exim-Mail-From: jarkko.sakkinen@iki.fi X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2021-08-26 at 14:19 +0300, amirmizi6@gmail.com wrote: > From: Amir Mizinski >=20 > 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. s/Every other driver/Some drivers, such as tpm_tis_spi,/g. > 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. This does not really explain why you are moving the code. You are moving it so that you don't have to reimplement things both in SPI and I2C drivers? Perhaps: "Re-implement tpm_tis_{read, write}_{16, 32}, so that they check if implementations for {read, write}_{16, 32} in tpm_tis_phys_ops exist, and if not, fallback to {read, write}_bytes()." > Co-developed-by: Alexander Steffen > Signed-off-by: Alexander Steffen > Signed-off-by: Amir Mizinski > Reviewed-by: Jarkko Sakkinen > Tested-by: Jarkko Sakkinen Since there's been a while, it'd be better if you dropped my tags. I consider them as expired by now. Please do this for all patches. /Jarkko