Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2595487rwb; Mon, 7 Nov 2022 15:29:03 -0800 (PST) X-Google-Smtp-Source: AMsMyM7183DDfvgfGSS13OAvPG17sY4Y78Qrvp9HxUaKjNXzvatAtXpEFdXm8xSNq7Bt2ptgCLPB X-Received: by 2002:a63:1411:0:b0:46f:c464:e165 with SMTP id u17-20020a631411000000b0046fc464e165mr36566134pgl.600.1667863743499; Mon, 07 Nov 2022 15:29:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667863743; cv=none; d=google.com; s=arc-20160816; b=kYiXZM0cTeBJazYsOx3hM9euhFMtEvjHMjo9lhrWdu/QmeUsoMAKbolm/H+iFcLjNn LuoBl+Ju8/oHVcCziDOx9yKXnSblRv9WDOJxwoV73cL+b2d/kdY9QLx7mtbthxyNW14O FOiTe6KxYOIAgxHMrrz/itJxO3SYzfwKwTgyzWp/oRCLqxXYdNOnzjKfPRiczi9W5I/F LQGRKFBElgKRHREHE7yTRckvfiuvJg8OCbInonQjVU+jWs3p+wcRfpcp7POcZ1IGQDq9 6kTkrIio7vLvZu9jXq5tT65YcvM4CwbjgOskjHHWY1WqTTY7birDcyahkuGzK60xfsr7 1qRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=wiBJXtTLLUG2NXhmkzcHuFFXxX0k5YNIVLIKIAjsBMU=; b=g0kYz+Ch+1I1FL63LR3HkIBLaXG/mwh9CJ8z6CcmuiW6dIngLeP7c/Roclsi7XE6pT 0zCopQnHxZqWWj6mYroeak/OOPXSmJlvkEW9KmyZ1RZvhn8kjzq+Ys+BgTq556XrV1S2 ehqxQkRuZUu66OiI/QfBmr95tgBqYjv9qco57ySjOiZ2i0vuZGEpP+bedpFpGM1mbMVn 3CAbm4wS/FEwdbTKefYbdJEhNF45omyL3GaZtuE8fdOLlHAddpGmjbY/Q5EACUv8RF5T +HlSK8Dyisx/Biu0EyA5ca3n+TJrjB8Hdz8FWVZcMm0poiJi6MrAQ+c8kJG+80gZC2JX CnXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=SIC4Vk8z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j17-20020a170903029100b001867a6a1791si12001609plr.426.2022.11.07.15.28.50; Mon, 07 Nov 2022 15:29:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=SIC4Vk8z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232707AbiKGWyt (ORCPT + 91 others); Mon, 7 Nov 2022 17:54:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232425AbiKGWyq (ORCPT ); Mon, 7 Nov 2022 17:54:46 -0500 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A7AC2935D; Mon, 7 Nov 2022 14:54:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667861686; x=1699397686; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=pUDmXJ81hZPKLSigWUAhVkXDqINWawcz+Tl9WL2UD/A=; b=SIC4Vk8zY3jQAK/+DRD1DbmCEvgHhRvqROTgK/w4O8GI9uazRezPI05y zc9o/G8O4SZ+wX9mdEd7/eWOwSrDfWLDfYhWFyqnG8QgDc9FzJeE/O0Gd G6rLGZCWe+cm6eV/a0Ep730lQHnxGFA1xxeZNbL7ucL9JxkPQP1N7i2ip 1H5fyD20KnhQXDliKwbaAuL+eeIcK9VXFa2mJCq9v7WN/vlobu6QBnhHS ltJNIymTZEXVr6o6cdu7e7bxXmVmp3vmbUkA7dUO3yYWHK+PW332Lk+i1 6YbMRPapMTIAk/Ew87czt7fdMAkP1jgD9SFmomlPjLKOubYbZe1rtLjKw w==; X-IronPort-AV: E=McAfee;i="6500,9779,10524"; a="293911822" X-IronPort-AV: E=Sophos;i="5.96,145,1665471600"; d="scan'208";a="293911822" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Nov 2022 14:54:45 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10524"; a="811012955" X-IronPort-AV: E=Sophos;i="5.96,145,1665471600"; d="scan'208";a="811012955" Received: from jithujos.sc.intel.com ([172.25.103.66]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Nov 2022 14:54:45 -0800 From: Jithu Joseph To: hdegoede@redhat.com, markgross@kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, gregkh@linuxfoundation.org, jithu.joseph@intel.com, ashok.raj@intel.com, tony.luck@intel.com, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, patches@lists.linux.dev, ravi.v.shankar@intel.com, thiago.macieira@intel.com, athenas.jimenez.gonzalez@intel.com, sohil.mehta@intel.com Subject: [PATCH v2 02/14] platform/x86/intel/ifs: return a more appropriate Error code Date: Mon, 7 Nov 2022 14:53:11 -0800 Message-Id: <20221107225323.2733518-3-jithu.joseph@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221107225323.2733518-1-jithu.joseph@intel.com> References: <20221021203413.1220137-1-jithu.joseph@intel.com> <20221107225323.2733518-1-jithu.joseph@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org scan_chunks_sanity_check() returns -ENOMEM if it encounters an error while copying IFS test image from memory to Secure Memory. Return -EIO in this scenario, as it is more appropriate. Reviewed-by: Tony Luck Signed-off-by: Jithu Joseph --- drivers/platform/x86/intel/ifs/load.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/platform/x86/intel/ifs/load.c b/drivers/platform/x86/intel/ifs/load.c index d056617ddc85..89ce265887ea 100644 --- a/drivers/platform/x86/intel/ifs/load.c +++ b/drivers/platform/x86/intel/ifs/load.c @@ -157,8 +157,10 @@ static int scan_chunks_sanity_check(struct device *dev) INIT_WORK(&local_work.w, copy_hashes_authenticate_chunks); schedule_work_on(cpu, &local_work.w); wait_for_completion(&ifs_done); - if (ifsd->loading_error) + if (ifsd->loading_error) { + ret = -EIO; goto out; + } package_authenticated[curr_pkg] = 1; } ret = 0; -- 2.25.1