Message ID | 20221212123311.146261-1-manivannan.sadhasivam@linaro.org |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2215823wrr; Mon, 12 Dec 2022 04:35:09 -0800 (PST) X-Google-Smtp-Source: AA0mqf4pmGxvAEe3oey152Qj8sMATirzJJraJfLnJF4fiPz4S1Tpv3VCjbweRKZ9YQetKa6cjfAY X-Received: by 2002:a17:907:765a:b0:7c0:e305:a282 with SMTP id kj26-20020a170907765a00b007c0e305a282mr12948397ejc.59.1670848509619; Mon, 12 Dec 2022 04:35:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670848509; cv=none; d=google.com; s=arc-20160816; b=hZ0FmKiAy1RXInkkJSd84waON28oBPVbGc+rsnIUw7XaX87OqMzBj2tr74wzDKG/yl 78aJ1AH4BvT/rEUL+IlLwQti7JxxPkO4KL3lBpWTp33BHU4gRktPKO851bct935abHgs iJMZ1MrxxG1SZMo3uJC+DwQJnFUdKNp6uxE33DFSo+Yj7ctUsYUZNDWaAF5zEctENNJR sXXu4iwMkAHQCig2FgEb+nE0QzlQXcJU2h9jNtndjKywnraZaVASXb1L0Ye0ExV6u8e2 mi4b96RMNn0MTrloxBjCXFUpm9bduro/JS3evY532WHSbd07XhWJJVve9vIzrpN9ZzjA /QPQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=iGi/0ZZ+vc4iAtcuWt8z9nWG7TbhSoTIkcPUXrevRhg=; b=zMTi+nmItNlSHEByKOLjt3ZMGAGwTsvjao5RRWUU0OamwtQAa24TSFaersosCgmzz5 jX9aAQThgLngBswquUY35fdYnSMxGRMTk2v6b3Iho2M+HDA38fJ2KwWmlmEkqsfF2KIs EzXQU0UxCYO142e3LLWjgm4jm6xd9Hv1fI86AjomjsfMMd/vBlnZN7O6on82OWqVFlvp 5tg/mXVbdXx20ljbCOiTkNZuowO8VC+H5TMVL3aR3KEX2jhmHJvvP7nNtPI3eNQfTRGC 99Ih3ct+HSDnIMGgQyshTusd4ZD4tS5D8fwppIQWQkXVdZnibJ/slJctK6bQdNyKoNl4 NStA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=S0YmWiQ5; 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 hs8-20020a1709073e8800b007c163a17f44si4053804ejc.995.2022.12.12.04.34.46; Mon, 12 Dec 2022 04:35:09 -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=@linaro.org header.s=google header.b=S0YmWiQ5; 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 S232157AbiLLMdt (ORCPT <rfc822;jeantsuru.cumc.mandola@gmail.com> + 99 others); Mon, 12 Dec 2022 07:33:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232187AbiLLMdW (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 12 Dec 2022 07:33:22 -0500 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C6EF10FED for <linux-kernel@vger.kernel.org>; Mon, 12 Dec 2022 04:33:21 -0800 (PST) Received: by mail-pl1-x632.google.com with SMTP id a9so11911146pld.7 for <linux-kernel@vger.kernel.org>; Mon, 12 Dec 2022 04:33:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=iGi/0ZZ+vc4iAtcuWt8z9nWG7TbhSoTIkcPUXrevRhg=; b=S0YmWiQ5kBfkN9C3UpzdcfTJZbyqaeWyCehKwvetGznDI982bAfbU+TlbBOLkrwoiH wkv98IXhSJcagT5xDXRDTn4he3qqUUoZcpszeIlzwSE4KmLqM5vx+ZYgl9WmwYYS/x9Z g6ReqxkIXK0B4zVNryiiNhZs2DfL26V3AYXbpGqvlZr+zjTc8nJYbgAhlQyG9HHZJRCD GeTLSgr/CuchT5qeGDewKyo3TVt2K0sgcJDo4CZFjFQeYpXDXHXhe5ccbLWUJMSNBbL3 3B6/qXDrVu/SaprLSY/YXUZp+l87GasVlVfHCjofZaLQMrvsbfHpVoMHstO40BK4Hhzl ertA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=iGi/0ZZ+vc4iAtcuWt8z9nWG7TbhSoTIkcPUXrevRhg=; b=THrujtZ2sJkIv9l9i6rqC1F7Ws85s0jCG1HyCFDNhDARp+DU1QYdXpXyVIVSZb7WtG xLmkaZ1kDQXJQ6aq1dQdIEsSJzS5Wsz5VxMJxsjL00S5yHyDihpmBiI0JcPocRXx3Eyc RiCs3f9I1AMfGmgFcnnfY+K6w4yYv1aMIgUWKz9Zn4WpEUhh3teRNq+WqvusRbkFyup7 zx2RUn/cK4Aq7Xjo5pHAYDy2OjbzgK/8qVYUPIiCal4l1Jhr+TkxajOHIirgStB3WGzQ 2IECa/Xps+TkE1GnNXSCOTLr0uMn6yXLd25O0FjY2Ge9bSa9Cw+jSSF/7GxFQHH1U/5z Ns9Q== X-Gm-Message-State: ANoB5plw4BZBIPfx/EWSDRgbOve6XyXOXYePptfsH9GDCq71d9akmSzN 0TJ/Si4v7hvrdXNtW2aLjy32 X-Received: by 2002:a17:903:40d1:b0:189:dedd:a4da with SMTP id t17-20020a17090340d100b00189dedda4damr19024132pld.34.1670848400473; Mon, 12 Dec 2022 04:33:20 -0800 (PST) Received: from localhost.localdomain ([220.158.159.33]) by smtp.gmail.com with ESMTPSA id j14-20020a170902da8e00b00189c93ce5easm6252557plx.166.2022.12.12.04.33.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Dec 2022 04:33:19 -0800 (PST) From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> To: andersson@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, bp@alien8.de, tony.luck@intel.com Cc: quic_saipraka@quicinc.com, 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, Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Subject: [PATCH v2 00/13] Qcom: LLCC/EDAC: Fix base address used for LLCC banks Date: Mon, 12 Dec 2022 18:02:58 +0530 Message-Id: <20221212123311.146261-1-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751564256836145356?= X-GMAIL-MSGID: =?utf-8?q?1752011646738198904?= |
Series |
Qcom: LLCC/EDAC: Fix base address used for LLCC banks
|
|
Message
Manivannan Sadhasivam
Dec. 12, 2022, 12:32 p.m. UTC
The Qualcomm LLCC/EDAC drivers were using a fixed register stride for accessing the (Control and Status Regsiters) CSRs of each LLCC bank. This offset only works for some SoCs like SDM845 for which driver support was initially added. But the later SoCs use different register stride that vary between the banks with holes in-between. So it is not possible to use a single register stride for accessing the CSRs of each bank. By doing so could result in a crash with the current drivers. So far this crash is not reported since EDAC_QCOM driver is not enabled in ARM64 defconfig and no one tested the driver extensively by triggering the EDAC IRQ (that's where each bank CSRs are accessed). For fixing this issue, let's obtain the base address of each LLCC bank from devicetree and get rid of the fixed stride. This series affects multiple platforms but I have only tested this on SM8250 and SM8450. Testing on other platforms is welcomed. Thanks, Mani Changes in v2: * Removed reg-names property and used index of reg property to parse LLCC bank base address (Bjorn) * Collected Ack from Sai for binding * Added a new patch for polling mode (Luca) * Renamed subject of patches targeting SC7180 and SM6350 Manivannan Sadhasivam (13): dt-bindings: arm: msm: Update the maintainers for LLCC dt-bindings: arm: msm: Fix register regions used for LLCC banks arm64: dts: qcom: sdm845: Fix the base addresses of LLCC banks arm64: dts: qcom: sc7180: Remove reg-names property from LLCC node arm64: dts: qcom: sc7280: Fix the base addresses of LLCC banks arm64: dts: qcom: sc8280xp: Fix the base addresses of LLCC banks arm64: dts: qcom: sm8150: Fix the base addresses of LLCC banks arm64: dts: qcom: sm8250: Fix the base addresses of LLCC banks arm64: dts: qcom: sm8350: Fix the base addresses of LLCC banks arm64: dts: qcom: sm8450: Fix the base addresses of LLCC banks arm64: dts: qcom: sm6350: Remove reg-names property from LLCC node qcom: llcc/edac: Fix the base address used for accessing LLCC banks qcom: llcc/edac: Support polling mode for ECC handling .../bindings/arm/msm/qcom,llcc.yaml | 100 +++++++++++++++--- arch/arm64/boot/dts/qcom/sc7180.dtsi | 1 - arch/arm64/boot/dts/qcom/sc7280.dtsi | 4 +- arch/arm64/boot/dts/qcom/sc8280xp.dtsi | 7 +- arch/arm64/boot/dts/qcom/sdm845.dtsi | 5 +- arch/arm64/boot/dts/qcom/sm6350.dtsi | 1 - arch/arm64/boot/dts/qcom/sm8150.dtsi | 5 +- arch/arm64/boot/dts/qcom/sm8250.dtsi | 5 +- arch/arm64/boot/dts/qcom/sm8350.dtsi | 5 +- arch/arm64/boot/dts/qcom/sm8450.dtsi | 5 +- drivers/edac/qcom_edac.c | 51 +++++---- drivers/soc/qcom/llcc-qcom.c | 85 ++++++++------- include/linux/soc/qcom/llcc-qcom.h | 6 +- 13 files changed, 186 insertions(+), 94 deletions(-)
Comments
On Mon, Dec 12, 2022 at 06:02:58PM +0530, Manivannan Sadhasivam wrote: > The Qualcomm LLCC/EDAC drivers were using a fixed register stride for > accessing the (Control and Status Regsiters) CSRs of each LLCC bank. > This offset only works for some SoCs like SDM845 for which driver support > was initially added. > > But the later SoCs use different register stride that vary between the > banks with holes in-between. So it is not possible to use a single register > stride for accessing the CSRs of each bank. By doing so could result in a > crash with the current drivers. So far this crash is not reported since > EDAC_QCOM driver is not enabled in ARM64 defconfig and no one tested the > driver extensively by triggering the EDAC IRQ (that's where each bank > CSRs are accessed). > > For fixing this issue, let's obtain the base address of each LLCC bank from > devicetree and get rid of the fixed stride. > > This series affects multiple platforms but I have only tested this on > SM8250 and SM8450. Testing on other platforms is welcomed. > Tested-by: Andrew Halaney <ahalaney@redhat.com> # sa8540p-ride I took this for a quick spin on the qdrive3 I've got access to without any issue: [root@localhost ~]# modprobe qcom_edac [root@localhost ~]# dmesg | grep -i edac [ 0.620723] EDAC MC: Ver: 3.0.0 [ 1.165417] ghes_edac: GHES probing device list is empty [ 594.688103] EDAC DEVICE0: Giving out device to module qcom_llcc_edac controller llcc: DEV qcom_llcc_edac (INTERRUPT) [root@localhost ~]# cat /proc/interrupts | grep ecc 174: 0 0 0 0 0 0 0 0 GICv3 614 Level llcc_ecc [root@localhost ~]# Potentially stupid question, but are users expected to manually load the driver as I did? I don't see how it would be loaded automatically in the current state, but thought it was funny that I needed to modprobe myself. Please let me know if you want me to do any more further testing! Thanks, Andrew
On Mon, Dec 12, 2022 at 01:23:40PM -0600, Andrew Halaney wrote: > On Mon, Dec 12, 2022 at 06:02:58PM +0530, Manivannan Sadhasivam wrote: > > The Qualcomm LLCC/EDAC drivers were using a fixed register stride for > > accessing the (Control and Status Regsiters) CSRs of each LLCC bank. > > This offset only works for some SoCs like SDM845 for which driver support > > was initially added. > > > > But the later SoCs use different register stride that vary between the > > banks with holes in-between. So it is not possible to use a single register > > stride for accessing the CSRs of each bank. By doing so could result in a > > crash with the current drivers. So far this crash is not reported since > > EDAC_QCOM driver is not enabled in ARM64 defconfig and no one tested the > > driver extensively by triggering the EDAC IRQ (that's where each bank > > CSRs are accessed). > > > > For fixing this issue, let's obtain the base address of each LLCC bank from > > devicetree and get rid of the fixed stride. > > > > This series affects multiple platforms but I have only tested this on > > SM8250 and SM8450. Testing on other platforms is welcomed. > > > > Tested-by: Andrew Halaney <ahalaney@redhat.com> # sa8540p-ride > Thanks! > I took this for a quick spin on the qdrive3 I've got access to without > any issue: > > [root@localhost ~]# modprobe qcom_edac > [root@localhost ~]# dmesg | grep -i edac > [ 0.620723] EDAC MC: Ver: 3.0.0 > [ 1.165417] ghes_edac: GHES probing device list is empty > [ 594.688103] EDAC DEVICE0: Giving out device to module qcom_llcc_edac controller llcc: DEV qcom_llcc_edac (INTERRUPT) > [root@localhost ~]# cat /proc/interrupts | grep ecc > 174: 0 0 0 0 0 0 0 0 GICv3 614 Level llcc_ecc > [root@localhost ~]# > > Potentially stupid question, but are users expected to manually load the > driver as I did? I don't see how it would be loaded automatically in the > current state, but thought it was funny that I needed to modprobe > myself. > > Please let me know if you want me to do any more further testing! > Well, I always ended up using the driver as a built-in. I do make it module for build test but never really used it as a module, so didn't catch this issue. This is due to the module alias not exported by the qcom_edac driver. Below diff allows kernel to autoload it: diff --git a/drivers/edac/qcom_edac.c b/drivers/edac/qcom_edac.c index f7afb5375293..13919d01c22d 100644 --- a/drivers/edac/qcom_edac.c +++ b/drivers/edac/qcom_edac.c @@ -419,3 +419,4 @@ module_platform_driver(qcom_llcc_edac_driver); MODULE_DESCRIPTION("QCOM EDAC driver"); MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("platform:qcom_llcc_edac"); Please test and let me know. I will add this as a new patch in next version. Thanks, Mani > Thanks, > Andrew >
On Tue, Dec 13, 2022 at 10:58:02AM +0530, Manivannan Sadhasivam wrote: > On Mon, Dec 12, 2022 at 01:23:40PM -0600, Andrew Halaney wrote: > > On Mon, Dec 12, 2022 at 06:02:58PM +0530, Manivannan Sadhasivam wrote: > > > The Qualcomm LLCC/EDAC drivers were using a fixed register stride for > > > accessing the (Control and Status Regsiters) CSRs of each LLCC bank. > > > This offset only works for some SoCs like SDM845 for which driver support > > > was initially added. > > > > > > But the later SoCs use different register stride that vary between the > > > banks with holes in-between. So it is not possible to use a single register > > > stride for accessing the CSRs of each bank. By doing so could result in a > > > crash with the current drivers. So far this crash is not reported since > > > EDAC_QCOM driver is not enabled in ARM64 defconfig and no one tested the > > > driver extensively by triggering the EDAC IRQ (that's where each bank > > > CSRs are accessed). > > > > > > For fixing this issue, let's obtain the base address of each LLCC bank from > > > devicetree and get rid of the fixed stride. > > > > > > This series affects multiple platforms but I have only tested this on > > > SM8250 and SM8450. Testing on other platforms is welcomed. > > > > > > > Tested-by: Andrew Halaney <ahalaney@redhat.com> # sa8540p-ride > > > > Thanks! > > > I took this for a quick spin on the qdrive3 I've got access to without > > any issue: > > > > [root@localhost ~]# modprobe qcom_edac > > [root@localhost ~]# dmesg | grep -i edac > > [ 0.620723] EDAC MC: Ver: 3.0.0 > > [ 1.165417] ghes_edac: GHES probing device list is empty > > [ 594.688103] EDAC DEVICE0: Giving out device to module qcom_llcc_edac controller llcc: DEV qcom_llcc_edac (INTERRUPT) > > [root@localhost ~]# cat /proc/interrupts | grep ecc > > 174: 0 0 0 0 0 0 0 0 GICv3 614 Level llcc_ecc > > [root@localhost ~]# > > > > Potentially stupid question, but are users expected to manually load the > > driver as I did? I don't see how it would be loaded automatically in the > > current state, but thought it was funny that I needed to modprobe > > myself. > > > > Please let me know if you want me to do any more further testing! > > > > Well, I always ended up using the driver as a built-in. I do make it module for > build test but never really used it as a module, so didn't catch this issue. > > This is due to the module alias not exported by the qcom_edac driver. Below > diff allows kernel to autoload it: > > diff --git a/drivers/edac/qcom_edac.c b/drivers/edac/qcom_edac.c > index f7afb5375293..13919d01c22d 100644 > --- a/drivers/edac/qcom_edac.c > +++ b/drivers/edac/qcom_edac.c > @@ -419,3 +419,4 @@ module_platform_driver(qcom_llcc_edac_driver); > > MODULE_DESCRIPTION("QCOM EDAC driver"); > MODULE_LICENSE("GPL v2"); > +MODULE_ALIAS("platform:qcom_llcc_edac"); > > Please test and let me know. I will add this as a new patch in next version. > Thanks Mani, that gets things working for me. For that patch: Reviewed-by: Andrew Halaney <ahalaney@redhat.com> Tested-by: Andrew Halaney <ahalaney@redhat.com> My personal opinion, but that probably deserves a Fixes: tag too!
On 13/12/2022 06:28, Manivannan Sadhasivam wrote: > On Mon, Dec 12, 2022 at 01:23:40PM -0600, Andrew Halaney wrote: >> On Mon, Dec 12, 2022 at 06:02:58PM +0530, Manivannan Sadhasivam wrote: >>> The Qualcomm LLCC/EDAC drivers were using a fixed register stride for >>> accessing the (Control and Status Regsiters) CSRs of each LLCC bank. >>> This offset only works for some SoCs like SDM845 for which driver support >>> was initially added. >>> >>> But the later SoCs use different register stride that vary between the >>> banks with holes in-between. So it is not possible to use a single register >>> stride for accessing the CSRs of each bank. By doing so could result in a >>> crash with the current drivers. So far this crash is not reported since >>> EDAC_QCOM driver is not enabled in ARM64 defconfig and no one tested the >>> driver extensively by triggering the EDAC IRQ (that's where each bank >>> CSRs are accessed). >>> >>> For fixing this issue, let's obtain the base address of each LLCC bank from >>> devicetree and get rid of the fixed stride. >>> >>> This series affects multiple platforms but I have only tested this on >>> SM8250 and SM8450. Testing on other platforms is welcomed. >>> >> >> Tested-by: Andrew Halaney <ahalaney@redhat.com> # sa8540p-ride >> > > Thanks! > >> I took this for a quick spin on the qdrive3 I've got access to without >> any issue: >> >> [root@localhost ~]# modprobe qcom_edac >> [root@localhost ~]# dmesg | grep -i edac >> [ 0.620723] EDAC MC: Ver: 3.0.0 >> [ 1.165417] ghes_edac: GHES probing device list is empty >> [ 594.688103] EDAC DEVICE0: Giving out device to module qcom_llcc_edac controller llcc: DEV qcom_llcc_edac (INTERRUPT) >> [root@localhost ~]# cat /proc/interrupts | grep ecc >> 174: 0 0 0 0 0 0 0 0 GICv3 614 Level llcc_ecc >> [root@localhost ~]# >> >> Potentially stupid question, but are users expected to manually load the >> driver as I did? I don't see how it would be loaded automatically in the >> current state, but thought it was funny that I needed to modprobe >> myself. >> >> Please let me know if you want me to do any more further testing! >> > > Well, I always ended up using the driver as a built-in. I do make it module for > build test but never really used it as a module, so didn't catch this issue. > > This is due to the module alias not exported by the qcom_edac driver. Below > diff allows kernel to autoload it: > > diff --git a/drivers/edac/qcom_edac.c b/drivers/edac/qcom_edac.c > index f7afb5375293..13919d01c22d 100644 > --- a/drivers/edac/qcom_edac.c > +++ b/drivers/edac/qcom_edac.c > @@ -419,3 +419,4 @@ module_platform_driver(qcom_llcc_edac_driver); > > MODULE_DESCRIPTION("QCOM EDAC driver"); > MODULE_LICENSE("GPL v2"); > +MODULE_ALIAS("platform:qcom_llcc_edac"); While this is a way to fix it, but instead of creating aliases for wrong names, either a correct name should be used or driver should receive ID table. Best regards, Krzysztof
On Tue, Dec 13, 2022 at 05:54:56PM +0100, Krzysztof Kozlowski wrote: > On 13/12/2022 06:28, Manivannan Sadhasivam wrote: > > On Mon, Dec 12, 2022 at 01:23:40PM -0600, Andrew Halaney wrote: > >> On Mon, Dec 12, 2022 at 06:02:58PM +0530, Manivannan Sadhasivam wrote: > >>> The Qualcomm LLCC/EDAC drivers were using a fixed register stride for > >>> accessing the (Control and Status Regsiters) CSRs of each LLCC bank. > >>> This offset only works for some SoCs like SDM845 for which driver support > >>> was initially added. > >>> > >>> But the later SoCs use different register stride that vary between the > >>> banks with holes in-between. So it is not possible to use a single register > >>> stride for accessing the CSRs of each bank. By doing so could result in a > >>> crash with the current drivers. So far this crash is not reported since > >>> EDAC_QCOM driver is not enabled in ARM64 defconfig and no one tested the > >>> driver extensively by triggering the EDAC IRQ (that's where each bank > >>> CSRs are accessed). > >>> > >>> For fixing this issue, let's obtain the base address of each LLCC bank from > >>> devicetree and get rid of the fixed stride. > >>> > >>> This series affects multiple platforms but I have only tested this on > >>> SM8250 and SM8450. Testing on other platforms is welcomed. > >>> > >> > >> Tested-by: Andrew Halaney <ahalaney@redhat.com> # sa8540p-ride > >> > > > > Thanks! > > > >> I took this for a quick spin on the qdrive3 I've got access to without > >> any issue: > >> > >> [root@localhost ~]# modprobe qcom_edac > >> [root@localhost ~]# dmesg | grep -i edac > >> [ 0.620723] EDAC MC: Ver: 3.0.0 > >> [ 1.165417] ghes_edac: GHES probing device list is empty > >> [ 594.688103] EDAC DEVICE0: Giving out device to module qcom_llcc_edac controller llcc: DEV qcom_llcc_edac (INTERRUPT) > >> [root@localhost ~]# cat /proc/interrupts | grep ecc > >> 174: 0 0 0 0 0 0 0 0 GICv3 614 Level llcc_ecc > >> [root@localhost ~]# > >> > >> Potentially stupid question, but are users expected to manually load the > >> driver as I did? I don't see how it would be loaded automatically in the > >> current state, but thought it was funny that I needed to modprobe > >> myself. > >> > >> Please let me know if you want me to do any more further testing! > >> > > > > Well, I always ended up using the driver as a built-in. I do make it module for > > build test but never really used it as a module, so didn't catch this issue. > > > > This is due to the module alias not exported by the qcom_edac driver. Below > > diff allows kernel to autoload it: > > > > diff --git a/drivers/edac/qcom_edac.c b/drivers/edac/qcom_edac.c > > index f7afb5375293..13919d01c22d 100644 > > --- a/drivers/edac/qcom_edac.c > > +++ b/drivers/edac/qcom_edac.c > > @@ -419,3 +419,4 @@ module_platform_driver(qcom_llcc_edac_driver); > > > > MODULE_DESCRIPTION("QCOM EDAC driver"); > > MODULE_LICENSE("GPL v2"); > > +MODULE_ALIAS("platform:qcom_llcc_edac"); > > While this is a way to fix it, but instead of creating aliases for wrong > names, either a correct name should be used or driver should receive ID > table. > I'm not sure how you'd fix it with a _correct_ name here. Also, the id table is an overkill since there is only one driver that is making use of it. And moreover, there is no definite ID to use. Thanks, Mani > Best regards, > Krzysztof >
On 13/12/2022 18:57, Manivannan Sadhasivam wrote: > On Tue, Dec 13, 2022 at 05:54:56PM +0100, Krzysztof Kozlowski wrote: >> On 13/12/2022 06:28, Manivannan Sadhasivam wrote: >>> On Mon, Dec 12, 2022 at 01:23:40PM -0600, Andrew Halaney wrote: >>>> On Mon, Dec 12, 2022 at 06:02:58PM +0530, Manivannan Sadhasivam wrote: >>>>> The Qualcomm LLCC/EDAC drivers were using a fixed register stride for >>>>> accessing the (Control and Status Regsiters) CSRs of each LLCC bank. >>>>> This offset only works for some SoCs like SDM845 for which driver support >>>>> was initially added. >>>>> >>>>> But the later SoCs use different register stride that vary between the >>>>> banks with holes in-between. So it is not possible to use a single register >>>>> stride for accessing the CSRs of each bank. By doing so could result in a >>>>> crash with the current drivers. So far this crash is not reported since >>>>> EDAC_QCOM driver is not enabled in ARM64 defconfig and no one tested the >>>>> driver extensively by triggering the EDAC IRQ (that's where each bank >>>>> CSRs are accessed). >>>>> >>>>> For fixing this issue, let's obtain the base address of each LLCC bank from >>>>> devicetree and get rid of the fixed stride. >>>>> >>>>> This series affects multiple platforms but I have only tested this on >>>>> SM8250 and SM8450. Testing on other platforms is welcomed. >>>>> >>>> >>>> Tested-by: Andrew Halaney <ahalaney@redhat.com> # sa8540p-ride >>>> >>> >>> Thanks! >>> >>>> I took this for a quick spin on the qdrive3 I've got access to without >>>> any issue: >>>> >>>> [root@localhost ~]# modprobe qcom_edac >>>> [root@localhost ~]# dmesg | grep -i edac >>>> [ 0.620723] EDAC MC: Ver: 3.0.0 >>>> [ 1.165417] ghes_edac: GHES probing device list is empty >>>> [ 594.688103] EDAC DEVICE0: Giving out device to module qcom_llcc_edac controller llcc: DEV qcom_llcc_edac (INTERRUPT) >>>> [root@localhost ~]# cat /proc/interrupts | grep ecc >>>> 174: 0 0 0 0 0 0 0 0 GICv3 614 Level llcc_ecc >>>> [root@localhost ~]# >>>> >>>> Potentially stupid question, but are users expected to manually load the >>>> driver as I did? I don't see how it would be loaded automatically in the >>>> current state, but thought it was funny that I needed to modprobe >>>> myself. >>>> >>>> Please let me know if you want me to do any more further testing! >>>> >>> >>> Well, I always ended up using the driver as a built-in. I do make it module for >>> build test but never really used it as a module, so didn't catch this issue. >>> >>> This is due to the module alias not exported by the qcom_edac driver. Below >>> diff allows kernel to autoload it: >>> >>> diff --git a/drivers/edac/qcom_edac.c b/drivers/edac/qcom_edac.c >>> index f7afb5375293..13919d01c22d 100644 >>> --- a/drivers/edac/qcom_edac.c >>> +++ b/drivers/edac/qcom_edac.c >>> @@ -419,3 +419,4 @@ module_platform_driver(qcom_llcc_edac_driver); >>> >>> MODULE_DESCRIPTION("QCOM EDAC driver"); >>> MODULE_LICENSE("GPL v2"); >>> +MODULE_ALIAS("platform:qcom_llcc_edac"); >> >> While this is a way to fix it, but instead of creating aliases for wrong >> names, either a correct name should be used or driver should receive ID >> table. >> > > I'm not sure how you'd fix it with a _correct_ name here. Hm, I assumed that it would be enough if driver name would match device name. Currently these two are not in sync. Maybe it's not enough when built as module? > Also, the id table is > an overkill since there is only one driver that is making use of it. And > moreover, there is no definite ID to use. Every driver with a single device support has usually ID table and it's not a problem... Best regards, Krzysztof
On Tue, Dec 13, 2022 at 07:47:17PM +0100, Krzysztof Kozlowski wrote: > On 13/12/2022 18:57, Manivannan Sadhasivam wrote: > > On Tue, Dec 13, 2022 at 05:54:56PM +0100, Krzysztof Kozlowski wrote: > >> On 13/12/2022 06:28, Manivannan Sadhasivam wrote: > >>> On Mon, Dec 12, 2022 at 01:23:40PM -0600, Andrew Halaney wrote: > >>>> On Mon, Dec 12, 2022 at 06:02:58PM +0530, Manivannan Sadhasivam wrote: > >>>>> The Qualcomm LLCC/EDAC drivers were using a fixed register stride for > >>>>> accessing the (Control and Status Regsiters) CSRs of each LLCC bank. > >>>>> This offset only works for some SoCs like SDM845 for which driver support > >>>>> was initially added. > >>>>> > >>>>> But the later SoCs use different register stride that vary between the > >>>>> banks with holes in-between. So it is not possible to use a single register > >>>>> stride for accessing the CSRs of each bank. By doing so could result in a > >>>>> crash with the current drivers. So far this crash is not reported since > >>>>> EDAC_QCOM driver is not enabled in ARM64 defconfig and no one tested the > >>>>> driver extensively by triggering the EDAC IRQ (that's where each bank > >>>>> CSRs are accessed). > >>>>> > >>>>> For fixing this issue, let's obtain the base address of each LLCC bank from > >>>>> devicetree and get rid of the fixed stride. > >>>>> > >>>>> This series affects multiple platforms but I have only tested this on > >>>>> SM8250 and SM8450. Testing on other platforms is welcomed. > >>>>> > >>>> > >>>> Tested-by: Andrew Halaney <ahalaney@redhat.com> # sa8540p-ride > >>>> > >>> > >>> Thanks! > >>> > >>>> I took this for a quick spin on the qdrive3 I've got access to without > >>>> any issue: > >>>> > >>>> [root@localhost ~]# modprobe qcom_edac > >>>> [root@localhost ~]# dmesg | grep -i edac > >>>> [ 0.620723] EDAC MC: Ver: 3.0.0 > >>>> [ 1.165417] ghes_edac: GHES probing device list is empty > >>>> [ 594.688103] EDAC DEVICE0: Giving out device to module qcom_llcc_edac controller llcc: DEV qcom_llcc_edac (INTERRUPT) > >>>> [root@localhost ~]# cat /proc/interrupts | grep ecc > >>>> 174: 0 0 0 0 0 0 0 0 GICv3 614 Level llcc_ecc > >>>> [root@localhost ~]# > >>>> > >>>> Potentially stupid question, but are users expected to manually load the > >>>> driver as I did? I don't see how it would be loaded automatically in the > >>>> current state, but thought it was funny that I needed to modprobe > >>>> myself. > >>>> > >>>> Please let me know if you want me to do any more further testing! > >>>> > >>> > >>> Well, I always ended up using the driver as a built-in. I do make it module for > >>> build test but never really used it as a module, so didn't catch this issue. > >>> > >>> This is due to the module alias not exported by the qcom_edac driver. Below > >>> diff allows kernel to autoload it: > >>> > >>> diff --git a/drivers/edac/qcom_edac.c b/drivers/edac/qcom_edac.c > >>> index f7afb5375293..13919d01c22d 100644 > >>> --- a/drivers/edac/qcom_edac.c > >>> +++ b/drivers/edac/qcom_edac.c > >>> @@ -419,3 +419,4 @@ module_platform_driver(qcom_llcc_edac_driver); > >>> > >>> MODULE_DESCRIPTION("QCOM EDAC driver"); > >>> MODULE_LICENSE("GPL v2"); > >>> +MODULE_ALIAS("platform:qcom_llcc_edac"); > >> > >> While this is a way to fix it, but instead of creating aliases for wrong > >> names, either a correct name should be used or driver should receive ID > >> table. > >> > > > > I'm not sure how you'd fix it with a _correct_ name here. > > Hm, I assumed that it would be enough if driver name would match device > name. Currently these two are not in sync. Maybe it's not enough when > built as module? > Right, for module it is not enough and that's why we need id_table/alias. > > Also, the id table is > > an overkill since there is only one driver that is making use of it. And > > moreover, there is no definite ID to use. > > Every driver with a single device support has usually ID table and it's > not a problem... > Are you referring to OF/ACPI ID table? Or something else? Thanks, Mani > Best regards, > Krzysztof >
On 19/12/2022 14:50, Manivannan Sadhasivam wrote: > >>> Also, the id table is >>> an overkill since there is only one driver that is making use of it. And >>> moreover, there is no definite ID to use. >> >> Every driver with a single device support has usually ID table and it's >> not a problem... >> > > Are you referring to OF/ACPI ID table? Or something else? No, I refer to the driver ID table (I2C, platform whatever the driver is). Best regards, Krzysztof
On Mon, Dec 19, 2022 at 03:11:36PM +0100, Krzysztof Kozlowski wrote: > On 19/12/2022 14:50, Manivannan Sadhasivam wrote: > > > >>> Also, the id table is > >>> an overkill since there is only one driver that is making use of it. And > >>> moreover, there is no definite ID to use. > >> > >> Every driver with a single device support has usually ID table and it's > >> not a problem... > >> > > > > Are you referring to OF/ACPI ID table? Or something else? > > No, I refer to the driver ID table (I2C, platform whatever the driver is). > Yeah, that's what I wanted to avoid here. The ID table makes sense if you have a bus like I2C or a separate subsystem but here LLCC is an individual driver. So creating a separate ID table is an overkill IMO. Thanks, Mani > Best regards, > Krzysztof >
On 19/12/2022 15:16, Manivannan Sadhasivam wrote: > On Mon, Dec 19, 2022 at 03:11:36PM +0100, Krzysztof Kozlowski wrote: >> On 19/12/2022 14:50, Manivannan Sadhasivam wrote: >>> >>>>> Also, the id table is >>>>> an overkill since there is only one driver that is making use of it. And >>>>> moreover, there is no definite ID to use. >>>> >>>> Every driver with a single device support has usually ID table and it's >>>> not a problem... >>>> >>> >>> Are you referring to OF/ACPI ID table? Or something else? >> >> No, I refer to the driver ID table (I2C, platform whatever the driver is). >> > > Yeah, that's what I wanted to avoid here. The ID table makes sense if you have > a bus like I2C or a separate subsystem but here LLCC is an individual driver. > So creating a separate ID table is an overkill IMO. Why this is an overkill? Just few lines and many, many drivers have it. Even duplicated (for legacy reasons) with OF tables. ALIAS is not the way to go around ID table because essentially you are re-implementing it. Best regards, Krzysztof
On Mon, 19 Dec 2022 at 16:17, Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> wrote: > > On Mon, Dec 19, 2022 at 03:11:36PM +0100, Krzysztof Kozlowski wrote: > > On 19/12/2022 14:50, Manivannan Sadhasivam wrote: > > > > > >>> Also, the id table is > > >>> an overkill since there is only one driver that is making use of it. And > > >>> moreover, there is no definite ID to use. > > >> > > >> Every driver with a single device support has usually ID table and it's > > >> not a problem... > > >> > > > > > > Are you referring to OF/ACPI ID table? Or something else? > > > > No, I refer to the driver ID table (I2C, platform whatever the driver is). > > > > Yeah, that's what I wanted to avoid here. The ID table makes sense if you have > a bus like I2C or a separate subsystem but here LLCC is an individual driver. > So creating a separate ID table is an overkill IMO. Well, struct platform_device_id is used quite a lot together with the MODULE_DEVICE_TABLE(platform, _ids); On the other hand: $ git grep MODULE_ALIAS.*platform: | wc -l 1308 $ git grep MODULE_DEVICE_TABLE.*platform | wc -l 236
On Mon, Dec 19, 2022 at 06:49:39PM +0200, Dmitry Baryshkov wrote: > On Mon, 19 Dec 2022 at 16:17, Manivannan Sadhasivam > <manivannan.sadhasivam@linaro.org> wrote: > > > > On Mon, Dec 19, 2022 at 03:11:36PM +0100, Krzysztof Kozlowski wrote: > > > On 19/12/2022 14:50, Manivannan Sadhasivam wrote: > > > > > > > >>> Also, the id table is > > > >>> an overkill since there is only one driver that is making use of it. And > > > >>> moreover, there is no definite ID to use. > > > >> > > > >> Every driver with a single device support has usually ID table and it's > > > >> not a problem... > > > >> > > > > > > > > Are you referring to OF/ACPI ID table? Or something else? > > > > > > No, I refer to the driver ID table (I2C, platform whatever the driver is). > > > > > > > Yeah, that's what I wanted to avoid here. The ID table makes sense if you have > > a bus like I2C or a separate subsystem but here LLCC is an individual driver. > > So creating a separate ID table is an overkill IMO. > > Well, struct platform_device_id is used quite a lot together with the > MODULE_DEVICE_TABLE(platform, _ids); > > On the other hand: > > $ git grep MODULE_ALIAS.*platform: | wc -l > 1308 > $ git grep MODULE_DEVICE_TABLE.*platform | wc -l > 236 > Hmm. I think I will just go with platform_device_id in the next version. Thanks, Mani > -- > With best wishes > Dmitry
Hi Andrew, On Mon, Dec 12, 2022 at 01:23:40PM -0600, Andrew Halaney wrote: > On Mon, Dec 12, 2022 at 06:02:58PM +0530, Manivannan Sadhasivam wrote: > > The Qualcomm LLCC/EDAC drivers were using a fixed register stride for > > accessing the (Control and Status Regsiters) CSRs of each LLCC bank. > > This offset only works for some SoCs like SDM845 for which driver support > > was initially added. > > > > But the later SoCs use different register stride that vary between the > > banks with holes in-between. So it is not possible to use a single register > > stride for accessing the CSRs of each bank. By doing so could result in a > > crash with the current drivers. So far this crash is not reported since > > EDAC_QCOM driver is not enabled in ARM64 defconfig and no one tested the > > driver extensively by triggering the EDAC IRQ (that's where each bank > > CSRs are accessed). > > > > For fixing this issue, let's obtain the base address of each LLCC bank from > > devicetree and get rid of the fixed stride. > > > > This series affects multiple platforms but I have only tested this on > > SM8250 and SM8450. Testing on other platforms is welcomed. > > > > Tested-by: Andrew Halaney <ahalaney@redhat.com> # sa8540p-ride > I dropped your tested-by tag in v3 as some of the patch content have been changed. Please test v3 and share your feedback. Thanks, Mani > I took this for a quick spin on the qdrive3 I've got access to without > any issue: > > [root@localhost ~]# modprobe qcom_edac > [root@localhost ~]# dmesg | grep -i edac > [ 0.620723] EDAC MC: Ver: 3.0.0 > [ 1.165417] ghes_edac: GHES probing device list is empty > [ 594.688103] EDAC DEVICE0: Giving out device to module qcom_llcc_edac controller llcc: DEV qcom_llcc_edac (INTERRUPT) > [root@localhost ~]# cat /proc/interrupts | grep ecc > 174: 0 0 0 0 0 0 0 0 GICv3 614 Level llcc_ecc > [root@localhost ~]# > > Potentially stupid question, but are users expected to manually load the > driver as I did? I don't see how it would be loaded automatically in the > current state, but thought it was funny that I needed to modprobe > myself. > > Please let me know if you want me to do any more further testing! > > Thanks, > Andrew >