Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp206019rwi; Wed, 12 Oct 2022 18:44:02 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5LwLslR/Ucn2wYsHwmwes3xUgmyGQnw3NmGg6ib677x7IxSywoDQ/gQt1WCD9kI+ekku+R X-Received: by 2002:a05:6a00:847:b0:563:b593:b685 with SMTP id q7-20020a056a00084700b00563b593b685mr11343019pfk.75.1665625441874; Wed, 12 Oct 2022 18:44:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665625441; cv=none; d=google.com; s=arc-20160816; b=iBGBCIw3iBmhukvbIMYzsDEc8GhuE2/jh6YW5TkkmNksiMC+u5/WkgGVz8lhMGWegD UXHrM9oLSW+fVo7H2bDexAJfqKPckn4oBUMM6K0l0sr9XhPFEhnpyDA6XSu5EEiSB955 J+9QfvNRmxGs7xvczAQDwMo+swHKz+sku6JjlafpYH79xqOemAQY2EzCQ2g5ExqGr6/l nXn3YvektYZY4+BHJw5zTt/8FyI/EYYadrq/r2Gsywjln5cC/CUJQSyspZr2xAPzUMcU 8JY//P/ozTqS/wXn0xb5A5VEdWRSAChuvs0ZJbq0ZU2DBJQ3wa3WnnBSv54qFY4NsOYL pWrg== 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=3gtjURYu7rsRc7FtYvWpvVXzgrynYF+rjvYJy0TG8QA=; b=U9z14eUpKPE3/DP8a9Y15zdN3ELgHOhNeTXPK+HZvYRPN4Kfcl3Ho6+7wyvrzpmGDS w9v3b8jBstgKgOcheZgljhxRnsE6QXao8EPq1z+T1VX/9qnCLmmvnFZLpxz333t4wUXX QWr1U1Fr49H9wPr45JOhUwYIqMZf4ngbVw/k0+8tm3haIotCYwHeIarmFXfpKPL8x/ID 2ZLTeirtBGQQeB1OPkq6YnxsIc5LpYIvlVCNWXs6AJXWqiagV4ssevRcPzV+OzCvA8Ii ksEt00EkXZn2hBxkatmxRpTcno8z4wj3Odg93Jl+3qIKwmJW7DdaKd0J5qtPbK3johID P8mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=p8sl+MpR; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q18-20020a170902bd9200b00176d347e9aesi16762959pls.366.2022.10.12.18.43.50; Wed, 12 Oct 2022 18:44:01 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b=p8sl+MpR; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230078AbiJMASt (ORCPT + 99 others); Wed, 12 Oct 2022 20:18:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39174 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229927AbiJMAR7 (ORCPT ); Wed, 12 Oct 2022 20:17:59 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E7B618C970; Wed, 12 Oct 2022 17:17:12 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EA160616BC; Thu, 13 Oct 2022 00:16:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 381D3C43143; Thu, 13 Oct 2022 00:16:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665620219; bh=T7hqFLPNw77WgL9BSH5WpcQeDhmXrL3N8oRc5R7W9+Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p8sl+MpR5s70hIBobyi9KhqJN9YjGkUc97fZwtiCnKQFBrlRbNjPYoR4zIQrIsanK PCOLKA298KbJ160CNQh8iGJm0DCDlMXaPqLMpAIKcoFFHbMdjNb5Zrz0TUISFfJy+y Eilvxi56zbWEscqDCiZRpNT7WLTECX5eZGNFAKrofwYJr7Qbn8pHIgIeDN+y7tWwXH XkOK3/MGAUHauBp2/NgeMlMb0MsnO3QM9S2GKaomQQkivLj+T4POd4+uHjKf+ecUo5 P0W/0+/OivW44y9hBTcY6V9b74ZIldF/h5Zrw7ty3rzo9U/jLdvc7T4PeUIEgGpDcg eN2LomMfjGx7g== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Ofir Bitton , Oded Gabbay , Sasha Levin , gregkh@linuxfoundation.org, osharabi@habana.ai, ttayar@habana.ai, fkassabri@habana.ai, dliberman@habana.ai, rkatta@habana.ai Subject: [PATCH AUTOSEL 6.0 25/67] habanalabs: ignore EEPROM errors during boot Date: Wed, 12 Oct 2022 20:15:06 -0400 Message-Id: <20221013001554.1892206-25-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221013001554.1892206-1-sashal@kernel.org> References: <20221013001554.1892206-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 From: Ofir Bitton [ Upstream commit d155df4f628a5312a485235aa8cc5ba78e11ea65 ] EEPROM errors reported by firmware are basically warnings and should not fail the boot process. Signed-off-by: Ofir Bitton Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay Signed-off-by: Sasha Levin --- drivers/misc/habanalabs/common/firmware_if.c | 9 +++++++++ drivers/misc/habanalabs/include/common/hl_boot_if.h | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/drivers/misc/habanalabs/common/firmware_if.c b/drivers/misc/habanalabs/common/firmware_if.c index 608ca67527a5..4a3350ee87d3 100644 --- a/drivers/misc/habanalabs/common/firmware_if.c +++ b/drivers/misc/habanalabs/common/firmware_if.c @@ -581,6 +581,15 @@ static bool fw_report_boot_dev0(struct hl_device *hdev, u32 err_val, dev_dbg(hdev->dev, "Device status0 %#x\n", sts_val); /* All warnings should go here in order not to reach the unknown error validation */ + if (err_val & CPU_BOOT_ERR0_EEPROM_FAIL) { + dev_warn(hdev->dev, + "Device boot warning - EEPROM failure detected, default settings applied\n"); + /* This is a warning so we don't want it to disable the + * device + */ + err_val &= ~CPU_BOOT_ERR0_EEPROM_FAIL; + } + if (err_val & CPU_BOOT_ERR0_DRAM_SKIPPED) { dev_warn(hdev->dev, "Device boot warning - Skipped DRAM initialization\n"); diff --git a/drivers/misc/habanalabs/include/common/hl_boot_if.h b/drivers/misc/habanalabs/include/common/hl_boot_if.h index a3594119bc51..3e705355c9cc 100644 --- a/drivers/misc/habanalabs/include/common/hl_boot_if.h +++ b/drivers/misc/habanalabs/include/common/hl_boot_if.h @@ -34,6 +34,7 @@ enum cpu_boot_err { CPU_BOOT_ERR_BINNING_FAIL = 19, CPU_BOOT_ERR_TPM_FAIL = 20, CPU_BOOT_ERR_TMP_THRESH_INIT_FAIL = 21, + CPU_BOOT_ERR_EEPROM_FAIL = 22, CPU_BOOT_ERR_ENABLED = 31, CPU_BOOT_ERR_SCND_EN = 63, CPU_BOOT_ERR_LAST = 64 /* we have 2 registers of 32 bits */ @@ -115,6 +116,9 @@ enum cpu_boot_err { * CPU_BOOT_ERR0_TMP_THRESH_INIT_FAIL Failed to set threshold for tmperature * sensor. * + * CPU_BOOT_ERR_EEPROM_FAIL Failed reading EEPROM data. Defaults + * are used. + * * CPU_BOOT_ERR0_ENABLED Error registers enabled. * This is a main indication that the * running FW populates the error @@ -139,6 +143,7 @@ enum cpu_boot_err { #define CPU_BOOT_ERR0_BINNING_FAIL (1 << CPU_BOOT_ERR_BINNING_FAIL) #define CPU_BOOT_ERR0_TPM_FAIL (1 << CPU_BOOT_ERR_TPM_FAIL) #define CPU_BOOT_ERR0_TMP_THRESH_INIT_FAIL (1 << CPU_BOOT_ERR_TMP_THRESH_INIT_FAIL) +#define CPU_BOOT_ERR0_EEPROM_FAIL (1 << CPU_BOOT_ERR_EEPROM_FAIL) #define CPU_BOOT_ERR0_ENABLED (1 << CPU_BOOT_ERR_ENABLED) #define CPU_BOOT_ERR1_ENABLED (1 << CPU_BOOT_ERR_ENABLED) -- 2.35.1