Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3475577pxj; Mon, 7 Jun 2021 11:32:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnezedNwU8+rIZTym/+xPfiLVc0ldyeUQ4Mo1csrZEHfeuzE4we25UCkqKV4WXpiZ3sQM6 X-Received: by 2002:a17:906:a850:: with SMTP id dx16mr12312248ejb.333.1623090750269; Mon, 07 Jun 2021 11:32:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623090750; cv=none; d=google.com; s=arc-20160816; b=doExJbFA9cHByF85gIdeos1nQnWd3T0MQtajRsfeQEeLJMrBjsRdA5QE5QwZeFsBzC ULY1tlfGFEl6Wxcy9/GQ1qI4XocH0rWIY6c7utASjRo0jT75HZRY3etaas6njuQRpjyY q2+pC7Xe/wzt7kI+Le4opmzZPy4yKtVM9r6b+WmVc9YjkFhOHO9PXVLVtkT79h1P2yUw jNazpBk/vVXHf1iEJNt5tinSGV/VFmhR4AYFhaWmKPuAfswjUdeeCfRX3YuvIlWUmA3s 9lFj4XnELuKq9YIeCuVj4VLv3eoUe1PdeXBsWOGirbw+3IyeWmJVEtWOj4TQircgwQ2n VDKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=AhzE1rpQlSHIE8bCJXrU4rG5e4ydMMnMZwxwvjbVNdQ=; b=aiCI3DNRG7z7+QwJZFw7OsNTELEsIv9g9WazEy0p0VTrYmj0bWzksd4L5zp0YUmzl0 1V3XU3thSjBr0ben87Y+2f5RYmQ15oReajfw/DsnU193HpfFRH/Q2LTACiEr+18nM1IF L+nZsKv9lbRJUA/cmDMiebF5v1Cz6uKp19vMYgYjXczKnt0xUutwoEKuDnebvgegGrmN K1Os5Bh/DHJ0dTRtKluODRRGnGS6ZlGVhHgUYn8xk8u4YHI2kN2EwesKkXnbJVtOkpWV ioTJo9+u3/OcFJl6p5Qar+QO5le+oDpOesuT6pK88kyhr4MPIcjzIr/nWn5ofPMjuRuj fC9w== 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=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 8si5685948ejq.15.2021.06.07.11.32.06; Mon, 07 Jun 2021 11:32:30 -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=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230432AbhFGSaI (ORCPT + 99 others); Mon, 7 Jun 2021 14:30:08 -0400 Received: from foss.arm.com ([217.140.110.172]:39934 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230253AbhFGSaH (ORCPT ); Mon, 7 Jun 2021 14:30:07 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EBA6912FC; Mon, 7 Jun 2021 11:28:15 -0700 (PDT) Received: from bogus (unknown [10.57.73.170]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9E3F83F73D; Mon, 7 Jun 2021 11:28:13 -0700 (PDT) Date: Mon, 7 Jun 2021 19:27:54 +0100 From: Sudeep Holla To: Cristian Marussi Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, james.quinlan@broadcom.com, Jonathan.Cameron@Huawei.com, f.fainelli@gmail.com, etienne.carriere@linaro.org, vincent.guittot@linaro.org, souvik.chakravarty@arm.com Subject: Re: [RFC PATCH 01/10] firmware: arm_scmi: Reset properly xfer SCMI status Message-ID: <20210607182754.3wsmhc2t5mh36ycm@bogus> References: <20210606221232.33768-1-cristian.marussi@arm.com> <20210606221232.33768-2-cristian.marussi@arm.com> <20210607173809.et6fzayvubsosvso@bogus> <20210607180137.GB40811@e120937-lin> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210607180137.GB40811@e120937-lin> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 07, 2021 at 07:01:37PM +0100, Cristian Marussi wrote: > On Mon, Jun 07, 2021 at 06:38:09PM +0100, Sudeep Holla wrote: > > On Sun, Jun 06, 2021 at 11:12:23PM +0100, Cristian Marussi wrote: > > > When an SCMI command transfer fails due to some protocol issue an SCMI > > > error code is reported inside the SCMI message payload itself and it is > > > then retrieved and transcribed by the specific transport layer into the > > > xfer.hdr.status field by transport specific .fetch_response(). > > > > > > The core SCMI transport layer never explicitly reset xfer.hdr.status, > > > so when an xfer is reused, if a transport misbehaved in handling such > > > status field, we risk to see an invalid ghost error code. > > > > > > Reset xfer.hdr.status to SCMI_SUCCESS right before each transfer is > > > started. > > > > > > > Any particular reason why it can't be part of xfer_get_init which has other > > initialisations ? If none, please move it there. > > > > Well it was there initially then I moved it here. > > The reason is mostly the same as the reason for the other patch in this > series that adds a reinit_completion() in this same point: the core does > not forbid to reuse an xfer multiple times, once obtained with xfer_get() > or xfer_get_init(), and indeed some protocols do such a thing: they > implements such do_xfer looping and bails out on error. > Makes sense. But it is okay to retain xfer->transfer_id for every transfer in such a loop ? > In the way that it is implemented now in protocols poses no problem > indeed because the do_xfer loop bails out on error and the xfer is put, > but as soon as some protocol is implemented that violates this common > practice and it just keeps on reuse an xfer after an error fo other > do_xfers() this breaks...so it seemed more defensive to just reinit the > completion and the status before each send. Fair enough. But they use it to send same message I guess, may be if it gave error or something ? I would like to really know such a sequence instead of assisting that ????. -- Regards, Sudeep