From patchwork Tue Mar 14 05:37:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manivannan Sadhasivam X-Patchwork-Id: 69316 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp1591226wrd; Mon, 13 Mar 2023 23:17:49 -0700 (PDT) X-Google-Smtp-Source: AK7set8qYmKbG4youAVLIYdaUmWAdR7VPGzoUIiCb7xsDHvr4GMahPz3PpC2gG4M5LUZDArMPqgy X-Received: by 2002:a17:902:ab4b:b0:19f:9414:97be with SMTP id ij11-20020a170902ab4b00b0019f941497bemr6360897plb.9.1678774668852; Mon, 13 Mar 2023 23:17:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678774668; cv=none; d=google.com; s=arc-20160816; b=0jxhltUSvD56csI9pilA6ixpOSI/hDyvl71kZygBGPmZH/QLlDhbde+KIs3+XjylrG Qh5ebP+OE3rqjFM7TQUZoTdeIWRE7Na/Mc87cD5+YSZ62ayw80g9SlnPaBiGjloTvtdF vP1erooAG9DjnJKhR0frk3rxccR9lZt6QhcTqr6Q4FS4rO1m5PBmRW5lbqelZ1ts75/5 EGRcHYUqA8KJ1JKWITwhM5PI79MUpb8HDobZA65JUWw/lmt/itzLUwVEAX39h01IVWnu yzYk0PaDfKd4HwBokSQry7VhovrpFAFLnoeGzSNP40dgqz/tfEgVy+8PNzDjXnSi98pE BWVA== 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=HbWxcznp0VOg1xe9D7780m5fL2MnhbImn1BuxXG45M8=; b=jqBk6ZnR2HXGylMied98XjiGuNBDs8e2jYEMgFDlhYYFGNlJrxJZhqrc1E2cwJiMUd UypmDJpSwAIyvoJeZ7xvur18CSk7cb/sLD19bppyF+4Xn7S1cGmXoDLyd529hFJeB9uT fusYwsbgR95Cvveg/2Pmp1WLcMb8maRlvac7Z007mbCWglccZ309o6qAkctjhgZCrdZu fXQxvPfuPS+4tpVLYoQ7YCNclDLwqvIbRHhIUEt5DQU7J2XFiicHnO9Fj3cECabyYlJB uOJBwWu1d8GXXy0dNAUJm39faelo45ZFOu8ASAiISTxUdkhlzHLAiDX/7SuM2h4UqfXy HS3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="f/YuqB9V"; 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=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id li6-20020a170903294600b001a04bd0a85dsi1545137plb.474.2023.03.13.23.17.34; Mon, 13 Mar 2023 23:17:48 -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=@linaro.org header.s=google header.b="f/YuqB9V"; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230187AbjCNFjR (ORCPT + 99 others); Tue, 14 Mar 2023 01:39:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230182AbjCNFjE (ORCPT ); Tue, 14 Mar 2023 01:39:04 -0400 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5194A88D81 for ; Mon, 13 Mar 2023 22:38:41 -0700 (PDT) Received: by mail-pj1-x102e.google.com with SMTP id nn12so14281787pjb.5 for ; Mon, 13 Mar 2023 22:38:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1678772321; 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=HbWxcznp0VOg1xe9D7780m5fL2MnhbImn1BuxXG45M8=; b=f/YuqB9VIVepKA5532aWKRLA3ZbUAfvr/OSkm/1RU/RhHYbq/uRfIben/ZZd4SMu8g dFcAnVt6j0yuSjD+Z1t97ZJdmvuarnaCAbTdtRVs9yc8ls6RCArnqUeEhwtUu3LddfyL 3Wr/l3R/dXpJNNxsQDkJ/Jc+Pxrv3YWmlayyGYv+5XiFZV+iq7lzR12QVGJxS2dhbUvn cAfOEkXUyq2sn43d/T8ToV/YsfEmIV7JGvCBXFAykCf5CqiL8OnjXyXU6HtOqd8VkHpW jZBn8yxmaVtF4rKQZjU0mxwoubSnJmJwKwXCocr9adTVQeajNCrp+iIgVwaqPSCPRKtv V/Zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678772321; 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=HbWxcznp0VOg1xe9D7780m5fL2MnhbImn1BuxXG45M8=; b=Cs0w0shBE61JkAWux7LpQ8Tqfexivhf8HQHxqE/x3otdZdEnDzGzH3IuElsHCTVM/t BAkVzK2ffLXSndSua0Ct3MSPgMfViH+x5cj+XM3ngeacvD0VXsNpqAbRy8w6tpxogA2Y GnArlktP0ozykUR81uzIpbVvA7fKnOZYCXLu8xYPfWezpTr6t/Vz6SJDYs1KVGAsnl4B p8NlOkQdb6ZNrMRXJ7T5LqHF5WyWKEszZ6RoGHWi+Wwi4LaXSt3i6IZB/VCNxkscpkCG I61j4Ynw9V4GfZbZiEXyynV4VM2LZvQUj1zCKQCyqgTwUxDlZLVosFu3W3JRt4GIkV6J w9IQ== X-Gm-Message-State: AO0yUKWbxmQx5zFUr/pD1ltGSB/ZsuA9fnD1Z6ewgBGaobjisNfnLbOK GPaPz/KIhUKg65twS9DwD5dA X-Received: by 2002:a05:6a20:734e:b0:cc:50cd:e0d7 with SMTP id v14-20020a056a20734e00b000cc50cde0d7mr37105440pzc.52.1678772320993; Mon, 13 Mar 2023 22:38:40 -0700 (PDT) Received: from localhost.localdomain ([117.217.177.49]) by smtp.gmail.com with ESMTPSA id n126-20020a634084000000b005034a46fbf7sm675093pga.28.2023.03.13.22.38.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Mar 2023 22:38:40 -0700 (PDT) From: Manivannan Sadhasivam To: andersson@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, bp@alien8.de, tony.luck@intel.com Cc: konrad.dybcio@linaro.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, james.morse@arm.com, mchehab@kernel.org, rric@kernel.org, linux-edac@vger.kernel.org, quic_ppareek@quicinc.com, luca.weiss@fairphone.com, ahalaney@redhat.com, steev@kali.org, Manivannan Sadhasivam , stable@vger.kernel.org Subject: [PATCH v7 13/13] soc: qcom: llcc: Do not create EDAC platform device on SDM845 Date: Tue, 14 Mar 2023 11:07:25 +0530 Message-Id: <20230314053725.13623-14-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230314053725.13623-1-manivannan.sadhasivam@linaro.org> References: <20230314053725.13623-1-manivannan.sadhasivam@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760322827223739752?= X-GMAIL-MSGID: =?utf-8?q?1760322827223739752?= The platforms based on SDM845 SoC locks the access to EDAC registers in the bootloader. So probing the EDAC driver will result in a crash. Hence, disable the creation of EDAC platform device on all SDM845 devices. The issue has been observed on Lenovo Yoga C630 and DB845c. While at it, also sort the members of `struct qcom_llcc_config` to avoid any holes in-between. Cc: # 5.10 Reported-by: Steev Klimaszewski Signed-off-by: Manivannan Sadhasivam --- drivers/soc/qcom/llcc-qcom.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/soc/qcom/llcc-qcom.c b/drivers/soc/qcom/llcc-qcom.c index 72f3f2a9aaa0..a5140f19f200 100644 --- a/drivers/soc/qcom/llcc-qcom.c +++ b/drivers/soc/qcom/llcc-qcom.c @@ -120,10 +120,11 @@ struct llcc_slice_config { struct qcom_llcc_config { const struct llcc_slice_config *sct_data; - int size; - bool need_llcc_cfg; const u32 *reg_offset; const struct llcc_edac_reg_offset *edac_reg_offset; + int size; + bool need_llcc_cfg; + bool no_edac; }; enum llcc_reg_offset { @@ -452,6 +453,7 @@ static const struct qcom_llcc_config sdm845_cfg = { .need_llcc_cfg = false, .reg_offset = llcc_v1_reg_offset, .edac_reg_offset = &llcc_v1_edac_reg_offset, + .no_edac = true, }; static const struct qcom_llcc_config sm6350_cfg = { @@ -1011,7 +1013,14 @@ static int qcom_llcc_probe(struct platform_device *pdev) goto err; drv_data->ecc_irq = platform_get_irq_optional(pdev, 0); - if (drv_data->ecc_irq >= 0) { + + /* + * On some platforms, the access to EDAC registers will be locked by + * the bootloader. So probing the EDAC driver will result in a crash. + * Hence, disable the creation of EDAC platform device for the + * problematic platforms. + */ + if (!cfg->no_edac) { llcc_edac = platform_device_register_data(&pdev->dev, "qcom_llcc_edac", -1, drv_data, sizeof(*drv_data));