Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2708334imj; Mon, 11 Feb 2019 07:18:44 -0800 (PST) X-Google-Smtp-Source: AHgI3IaFwtvsy/K/jN+cQlOW+9fTtmqu4QnC5ct4gcwsMALuPP/DZzgSKbaLhPLMPqaK8H2RGcTL X-Received: by 2002:a17:902:6941:: with SMTP id k1mr15352297plt.195.1549898324008; Mon, 11 Feb 2019 07:18:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549898323; cv=none; d=google.com; s=arc-20160816; b=Hur6a9tGMEXOypNaU/fs5pQbRVqPdZxYZKCcscbvFd9dUI0yJghqCHyvV5lFP7g39+ I7oCvWDoBuzznwuHCavrOxa9MZscJ5utztD9+ev6LNYfqJpwUHGCx1vJAH+FChp/RScs LMfAEYfjgCZDKsfNusL//dUAdttS3DAJWEkSlRNaDEy3NQFd98+vB3PTmc/GSbjdGj0M YboITqnB6ahPasjE9rWHNCmY0sQ2DDoLi39WSpvJCX7fSU+P23RELycEtxRrySnl7oma jWCH6yoWxRZ5yJn+i/JjM7x06myt0Dg7mP1Ci0FUoTbASrUseRi66RTDklRCRBDUIIDh 2Uag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject:dkim-signature; bh=EF82SpIFDY9ndSWnS+/mPJ0HJe5HDv95GECCAo0C+bw=; b=ksItmTr3sM3w30SUdk/Qd2S378Q2iXLiHDlRKk4djOkiEs1I/1GVTxndu/H6HO7O4S 5uyHkyK7ExPwu6w1ZCrUX9Z/tLUgmMJEmNbJj/WN7sm7PmAgsrWx8jaW6nW2kvJ7AqLQ oOWT1noCGOr84V7kVK2rLGaqHCUORbLGpsNFawSxh9OXjMMz47YESZYQ3b5y/G1UTay/ KUuppSPUv/H2w7UD8yrImW+4LebhJEcAoPrjLiDAUf8+TG/pOLyv2kmXvZJ+9r60HPFr PNf1glTsqJrpsKcnUVOEFYvUY+XVp6mbxyQnQHOLzlkdZp5aBP0wpjscCNXypyXpUXK+ kLhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infineon.com header.s=IFXMAIL header.b=Tx8E4U1I; 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=infineon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i90si11030722pli.135.2019.02.11.07.18.25; Mon, 11 Feb 2019 07:18:43 -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=fail header.i=@infineon.com header.s=IFXMAIL header.b=Tx8E4U1I; 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=infineon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390939AbfBKPR2 (ORCPT + 99 others); Mon, 11 Feb 2019 10:17:28 -0500 Received: from smtp2.infineon.com ([217.10.52.18]:46699 "EHLO smtp2.infineon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391098AbfBKPF4 (ORCPT ); Mon, 11 Feb 2019 10:05:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=infineon.com; i=@infineon.com; q=dns/txt; s=IFXMAIL; t=1549897555; x=1581433555; h=subject:to:cc:references:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=yV8Bbok3J6t0HsHnKNBRCm3adtM8CO1UJUDJN+aJGU0=; b=Tx8E4U1IMV1qIyjCZ07v0Ij4F83G9XmSqwxiEHn8zK7urm75mqLGglQI YRPNLhuHeV+y9wFsCvZFfb/ciyQ91EdCtueildFmmrP4ypaVORuskCfpd P7RBcv25t+g0WIV2+m6LsfQjuylT846A4jw1IgKgN6yBASMMRk1cdh7i7 w=; X-SBRS: None X-IronPort-AV: E=McAfee;i="5900,7806,9163"; a="100302449" X-IronPort-AV: E=Sophos;i="5.58,358,1544482800"; d="scan'208";a="100302449" Received: from unknown (HELO mucxv001.muc.infineon.com) ([172.23.11.16]) by smtp2.infineon.com with ESMTP/TLS/AES256-GCM-SHA384; 11 Feb 2019 16:05:53 +0100 Received: from MUCSE708.infineon.com (MUCSE708.infineon.com [172.23.7.82]) by mucxv001.muc.infineon.com (Postfix) with ESMTPS; Mon, 11 Feb 2019 16:05:53 +0100 (CET) Received: from [10.154.32.30] (172.23.8.247) by MUCSE708.infineon.com (172.23.7.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1531.3; Mon, 11 Feb 2019 16:05:52 +0100 Subject: Re: [PATCH v4 1/2] tpm: Unify the send callback behaviour To: Jarkko Sakkinen , Stefan Berger CC: , , , Peter Huewe , Jason Gunthorpe , Stefan Berger , References: <20190208180857.12330-1-jarkko.sakkinen@linux.intel.com> <20190208180857.12330-2-jarkko.sakkinen@linux.intel.com> <4072b2b6-0f95-be50-0772-7e2869c2c24e@linux.ibm.com> <20190208190057.GA3439@linux.intel.com> From: Alexander Steffen Message-ID: <2849751f-ff26-193e-f15e-4d7d5f8525a7@infineon.com> Date: Mon, 11 Feb 2019 16:05:39 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: <20190208190057.GA3439@linux.intel.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [172.23.8.247] X-ClientProxiedBy: MUCSE705.infineon.com (172.23.7.79) To MUCSE708.infineon.com (172.23.7.82) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08.02.2019 20:00, Jarkko Sakkinen wrote: > On Fri, Feb 08, 2019 at 01:12:34PM -0500, Stefan Berger wrote: >> On 2/8/19 1:08 PM, Jarkko Sakkinen wrote: >>> The send() callback should never return length as it does not in every >>> driver except tpm_crb in the success case. The reason is that the main >>> transmit functionality only cares about whether the transmit was >>> successful or not and ignores the count completely. >>> >>> Cc: stable@vger.kernel.org >>> Signed-off-by: Jarkko Sakkinen >> >> Reviewed-by: Stefan Berger >> >> Let me know when you put it into your tree, I'll give it a spin while I am >> at it. :-) > > Thank you Stefan! I also add your suggested-by to the first commit > because you pointed out the problem. > > It all looks now legit, but just in case I'll add a check for the return > value to tpm_try_transmit() and a warning if it is not zero in the > success case (and after that zeroing of rc). > > That check can be removed when I do v5.3 pull request. That should > enough window to catch any potential issues and check will ensure that > kernel won't fail even there was something forgotten. > > Alexander, I'll push this version now to the master and next with the > additional check described in this commit, but will add your tags > after you have time to test. I ran all tests again and everything works now as expected :) Tested-by: Alexander Steffen Alexander