From patchwork Sat Feb 18 15:27:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 654768 Delivered-To: patch@linaro.org Received: by 2002:adf:9bcd:0:0:0:0:0 with SMTP id e13csp513953wrc; Sat, 18 Feb 2023 07:28:30 -0800 (PST) X-Google-Smtp-Source: AK7set+j8OwriQGqysoeuCRAS65TxhlfVb894hvC8Mb/bW+VjCFbNuz6qhOP8v5a/9wzeXAV07Xi X-Received: by 2002:a05:6870:3453:b0:16d:e230:6a31 with SMTP id i19-20020a056870345300b0016de2306a31mr1861798oah.38.1676734110791; Sat, 18 Feb 2023 07:28:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676734110; cv=none; d=google.com; s=arc-20160816; b=PfTYsy9Cas/+zLMe6DkBbkxIyXqGydU+OolXbhHxGUbyvY9L2gIw2o/H8w/p6Z7Yr8 7EX2yGKGRRYDsZE+PH38iSyPjH71Ei/C5/akhY1JLyzTO0ZZ+OGXGVl5L8hGANsxta3e oUaq2IIzo2rcNBsLYKs9nv596al+tbRQl48ahZOPgBx0tyy0r+BhgzmTuSsDdi5jL2V0 t4RL35u/Q8FkaZ7vU1DxTvFQgHrf/Pih6GJ3h3cqeyRMwzW66Etcj6KWXZTYYDXdNeT9 Znm07pQJSyMH4iAg5iDIhlITjt5fyhCVpqSUzAt7GMxiNb0+MVs3ik9TlGTRq1r6UJX6 nvlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8OkxJHbX+T2iVU6hunqM7iY8vnuuWA0CPrZQ67p0HxE=; b=t8/UJdKVb9CUQ6ahXm2Nm+69TQA7MWseGkOGM4V8EBJ9PFHibalN+8kK08WKHywIUb p2jrGOxwD10qIyIBIC4wbJ0u/XD0BwQdEE475ixn/IzjyNVH5Q+8P9C21njY4iqBfnID HZMoucLjC05zcKQ+/JDtoppxLFAAElW6T5Eo24iW34pDV2DOhJ1mhR4/JFP5ILyDwzNe jMNpaPPe7Zb8iOP9fW6FPxtssHaPDb8XrSPv0QaDcolaRZCVvsrm3JvVjXX9vFP5nwbb OlC1o2f9K0OXEMXOzUgu+HGQD/DqKl+5pzq0if6wOgPgYNDnIIO9J1i1h5Y/3yAq9ovn oyZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Sd/lbB26"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id gf4-20020a056870660400b00132eefebdc4si10542042oab.11.2023.02.18.07.28.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Feb 2023 07:28:30 -0800 (PST) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Sd/lbB26"; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D70E385A3C; Sat, 18 Feb 2023 16:28:12 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="Sd/lbB26"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 42E2C85A3C; Sat, 18 Feb 2023 16:27:58 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 14D1285A25 for ; Sat, 18 Feb 2023 16:27:55 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ilias.apalodimas@linaro.org Received: by mail-ed1-x535.google.com with SMTP id i28so2974467eda.8 for ; Sat, 18 Feb 2023 07:27:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8OkxJHbX+T2iVU6hunqM7iY8vnuuWA0CPrZQ67p0HxE=; b=Sd/lbB26oGtBS1GfD03jd13bBsWpyl4knOaRrfSLayRuRb1cierVzsJTfT5dT2d90+ 2Y4qs8PHfQE4Fg3xomCfS5cOCYANeyGIv/JMKaj8EFjimcwj8UZwwS3a5imCZ4jDREeT 8ZvM+UgHkffDQzgEwSdhpye35t5PmOpgY3WKUyEOc63Jg9XGNBkuXMLztGOHb+2TXD3N fKoqdDpc3AUzwbAFH5yUE6p84PUb6ITIQ3wxZXqAKhbxmEM3fww2+wBjnm+A4r8otnTy h8jfOjnJeOL9xG17TV4TyQ7mbshhU01ZCmalw11N1CWP/WpA1mN3A4ynJX2HhG/EM3eF PfZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8OkxJHbX+T2iVU6hunqM7iY8vnuuWA0CPrZQ67p0HxE=; b=g2Xz0WcmEjlq8cxgkmlOiq4ZSi9pk83v7CYl6nM6YTk7MHxaorXcoRFK+1OzWBho5L 6/zW1IuiV6v2+CunjTDkMhuYM8m6SMnpNlga3fp/srgyzMkKpMoZ6VT5eioCiZRq93gQ YE77pCG3JgBFrKM5R5PLGQ5C1KlgWa2W/0lzmI8RURTYrqSPKgJT/b0cuw2HeNgjNnU2 IBF8fgaRLDoNQEKQMG8VXQrCwQneEabV2MMTb2fsBTeTkAMmYA3w1iK/j9SWowvR+1Gg AWSqLfGwxvN+LgSiNs3ceixORCmZb7P+xuZ9F9IhCLmLl3Jtzat/Hfd+Smi5ZD7ocxnq aVCg== X-Gm-Message-State: AO0yUKVonEedDZzsVX523CxhhZYMV/sCcJS91U5f7HiXkME9GKAs/owM blIksLatFE1OVpmYze+fKlkTJsu24TovSDv/ X-Received: by 2002:a17:907:ea2:b0:88d:33fe:3306 with SMTP id ho34-20020a1709070ea200b0088d33fe3306mr3635325ejc.31.1676734074693; Sat, 18 Feb 2023 07:27:54 -0800 (PST) Received: from localhost.localdomain ([2a02:85f:fc09:d5bf:82f9:4e04:7bf7:880c]) by smtp.gmail.com with ESMTPSA id ce25-20020a170906b25900b008b05b21e8aesm3512759ejb.172.2023.02.18.07.27.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Feb 2023 07:27:54 -0800 (PST) From: Ilias Apalodimas To: u-boot@lists.denx.de Cc: eajames@linux.ibm.com, Ilias Apalodimas , Heinrich Schuchardt , Simon Glass , Sughosh Ganu Subject: [PATCH 3/4 v4] tpm: sandbox: Change the return code when device is already open Date: Sat, 18 Feb 2023 17:27:40 +0200 Message-Id: <20230218152741.528191-3-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230218152741.528191-1-ilias.apalodimas@linaro.org> References: <20230218152741.528191-1-ilias.apalodimas@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean All the TPM drivers as well as out TCG TIS API for a TPM2.0 device return -EBUSY if the device has already been opened. Adjust the sandbox TPM do return the same error code. Signed-off-by: Ilias Apalodimas Reviewed-by: Simon Glass --- Changes since v3: - New patch. Required for [4/4] drivers/tpm/tpm2_tis_sandbox.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.39.2 diff --git a/drivers/tpm/tpm2_tis_sandbox.c b/drivers/tpm/tpm2_tis_sandbox.c index dd94bdc31fb7..e4004cfcca33 100644 --- a/drivers/tpm/tpm2_tis_sandbox.c +++ b/drivers/tpm/tpm2_tis_sandbox.c @@ -810,7 +810,7 @@ static int sandbox_tpm2_open(struct udevice *dev) struct sandbox_tpm2 *tpm = dev_get_priv(dev); if (tpm->init_done) - return -EIO; + return -EBUSY; tpm->init_done = true;