Message ID | 20221207135922.314827-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 q4csp199729wrr; Wed, 7 Dec 2022 06:04:05 -0800 (PST) X-Google-Smtp-Source: AA0mqf7OhvNYlPahz7PBKrk36L+I1ewRtKFHSa37pD0eI9GFKuTOS2r1lzSu70djTv9LS4U8qziU X-Received: by 2002:a17:90b:3d83:b0:219:e761:9604 with SMTP id pq3-20020a17090b3d8300b00219e7619604mr12321004pjb.85.1670421845490; Wed, 07 Dec 2022 06:04:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670421845; cv=none; d=google.com; s=arc-20160816; b=IA7BcKAoy8qC3nADU381D9OwQgpv1BS7KjY4lHwow3h7izs3tI4Ur5AB0yCfh58zkC Jod9tBsU+trD2lzdkwr/Kw3B7Zir8xQtM87XyQVxq0HAaTnRUO0C3j8dU3Kw0OLIrHeb shzkK7eeYZRE5uYxuot70eh0/fq0jjWRBtokAKf4BIcaSJd/6JAoaAq/ukrSx45zz/95 3ZG+rNYUaaHi1Z6IPgYl7XREBec9yISQ+QcdLkLv/6PqY/AyizltzOAAwY1NMhQ9oIZn Rs74f1szlupfLYgwFfJoB+ofDMjXRSbdN8IPitKvX78SK8au+XSVnIMGtunqDPo6wG8O y/Vw== 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=9qzjJqhRbd7WQ4NJO5tO8jZvOkII4hk1EVHsUTMW3vw=; b=vLZ2QmKdiAG+NGei97YeWLo97boiY62+M/o8URzczzvuYZAMF06PY0HLBoZKIABQXF 5OgQm4TD5o3sdneenm2q/2Qm6U7na7Prl4R2sVz9LT/DfESTh1cXnEuvVUGGbP+n1FxX Mg70mJ+HoARCC3b9f2OufGVpNbDKjGRBaKTChXNrIeJvp2doB0IHjEhrq9UIqyKk14mw ii2HHpvYp/1TnhnObTPv/g5VGrX2PwetLoHyJf0NcbYYTifLEC3WCkpBY2cYUppBirzY v0+0whkNdUHTHh7vRaEFcfsvxW4IPwEO6LljLw+FLtrzUMPl9TAdupdf2E1RCSU972bw mqXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LL2DHlQE; 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 j14-20020a056a00130e00b0056e48944895si21232320pfu.317.2022.12.07.06.03.37; Wed, 07 Dec 2022 06:04:05 -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=LL2DHlQE; 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 S229931AbiLGOAE (ORCPT <rfc822;b08248@gmail.com> + 99 others); Wed, 7 Dec 2022 09:00:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230081AbiLGN7i (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 7 Dec 2022 08:59:38 -0500 Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 487DEA452 for <linux-kernel@vger.kernel.org>; Wed, 7 Dec 2022 05:59:36 -0800 (PST) Received: by mail-pf1-x42e.google.com with SMTP id 65so4850215pfx.9 for <linux-kernel@vger.kernel.org>; Wed, 07 Dec 2022 05:59:36 -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=9qzjJqhRbd7WQ4NJO5tO8jZvOkII4hk1EVHsUTMW3vw=; b=LL2DHlQERrB8h3H6WtB4mA+079B71Iz3/+GN4SxQn4vKfgHGxTOJ+lMTsePmtgdGJq XAE+aDM+uTO8IpudWEGKSIPnYOCBQdI+KOiks6CLrV+Y1a/XCHqP3HDZWd0k1jlBO/xX lVeXXNyUv3yrSkbqyyD0XkbQCOre9Z9m13kHcGLQgxsF4emkgI46vFY0EPqPsZmVCNK/ qhdodfFhQvW2dzyEf9OyiL8v8n+sAP6QEpit1rySYfFdoJGFDdEWonVYjT75M+yXccbU DIZGYa6rZrZFfHj4U7nA0/hJUWIMCLRFYtQ7JgUdzZ34C0+frCkQHP2zwKeB9T2I5jbT G2+g== 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=9qzjJqhRbd7WQ4NJO5tO8jZvOkII4hk1EVHsUTMW3vw=; b=qLH1/O9b+29n+AF7RBQcdQrMERSiM1pFCCnPs9J0Yc12ghm1AdIiLJhmo4qx7af8Ig ja810VYbQkTDImgKNQqvTFbCdNqdF+0l59gJJlWNiHYWNix/1yemLsKy9VkD5dHKfK5J wiYpTVU46uHVmJ8B2NZVlt1GBDvsZpPt5Vu7k1AdVvovzzaRxHL4QdSYQXMqzcxg/ZQ5 Qw4ejKpRx3Pc3GY+d2fuV3rpps0ddAZ5ZkGythOISUWQiLahJ4/fi4zCyhVv3vTIE/qW mdS89nrJ2ci160kOygxT9q4MJi3QeBbhc9HZGxfDcLoOxGOjLzRS6Hg+ssG7TB1DqEVq svdA== X-Gm-Message-State: ANoB5pkhDS/bqa08rP2eWf/YNILvRpbkCuC3wWOf9iOp+lsSUgE2UBKM SM0sabhvk0ZxeWYrPB0HtiTn X-Received: by 2002:a63:2154:0:b0:477:b650:494b with SMTP id s20-20020a632154000000b00477b650494bmr62341263pgm.434.1670421575614; Wed, 07 Dec 2022 05:59:35 -0800 (PST) Received: from localhost.localdomain ([117.216.123.5]) by smtp.gmail.com with ESMTPSA id c18-20020a170902d49200b00186b69157ecsm14720160plg.202.2022.12.07.05.59.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Dec 2022 05:59:34 -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, Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> Subject: [PATCH 00/12] Qcom: LLCC/EDAC: Fix base address used for LLCC banks Date: Wed, 7 Dec 2022 19:29:09 +0530 Message-Id: <20221207135922.314827-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?1751564256836145356?= |
Series |
Qcom: LLCC/EDAC: Fix base address used for LLCC banks
|
|
Message
Manivannan Sadhasivam
Dec. 7, 2022, 1:59 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 Manivannan Sadhasivam (12): 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: Fix the base addresses of LLCC banks 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: Fix the base addresses of LLCC banks qcom: llcc/edac: Fix the base address used for accessing LLCC banks .../bindings/arm/msm/qcom,llcc.yaml | 128 ++++++++++++++++-- arch/arm64/boot/dts/qcom/sc7180.dtsi | 2 +- arch/arm64/boot/dts/qcom/sc7280.dtsi | 5 +- arch/arm64/boot/dts/qcom/sc8280xp.dtsi | 10 +- arch/arm64/boot/dts/qcom/sdm845.dtsi | 7 +- arch/arm64/boot/dts/qcom/sm6350.dtsi | 2 +- arch/arm64/boot/dts/qcom/sm8150.dtsi | 7 +- arch/arm64/boot/dts/qcom/sm8250.dtsi | 7 +- arch/arm64/boot/dts/qcom/sm8350.dtsi | 7 +- arch/arm64/boot/dts/qcom/sm8450.dtsi | 7 +- drivers/edac/qcom_edac.c | 14 +- drivers/soc/qcom/llcc-qcom.c | 64 +++++---- include/linux/soc/qcom/llcc-qcom.h | 4 +- 13 files changed, 197 insertions(+), 67 deletions(-)
Comments
Hi Manivannan, On Wed Dec 7, 2022 at 2:59 PM CET, 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. If you can tell me *how* I can test it, I'd be happy to test the series on sm6350, like how to trigger the EDAC IRQ. So far without any extra patches I don't even see the driver probing, with this in kconfig +CONFIG_EDAC=y +CONFIG_EDAC_QCOM=y I do have /sys/bus/platform/drivers/qcom_llcc_edac at runtime but nothing in there (except bind, uevent and unbind), and also nothing interesting in dmesg with "llcc", with edac there's just this message: [ 0.064800] EDAC MC: Ver: 3.0.0 From what I'm seeing now the edac driver is only registered if the interrupt is specified but it doesn't seem like sm6350 (=lagoon) has this irq? Downstream dts is just this: cache-controller@9200000 { compatible = "lagoon-llcc-v1"; reg = <0x9200000 0x50000> , <0x9600000 0x50000>; reg-names = "llcc_base", "llcc_broadcast_base"; cap-based-alloc-and-pwr-collapse; }; From looking at the downstream code, perhaps it's using the polling mode there? /* Request for ecc irq */ ecc_irq = llcc_driv_data->ecc_irq; if (ecc_irq < 0) { dev_info(dev, "No ECC IRQ; defaulting to polling mode\n"); Let me know what you think. Regards Luca > > Thanks, > Mani > > Manivannan Sadhasivam (12): > 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: Fix the base addresses of LLCC banks > 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: Fix the base addresses of LLCC banks > qcom: llcc/edac: Fix the base address used for accessing LLCC banks > > .../bindings/arm/msm/qcom,llcc.yaml | 128 ++++++++++++++++-- > arch/arm64/boot/dts/qcom/sc7180.dtsi | 2 +- > arch/arm64/boot/dts/qcom/sc7280.dtsi | 5 +- > arch/arm64/boot/dts/qcom/sc8280xp.dtsi | 10 +- > arch/arm64/boot/dts/qcom/sdm845.dtsi | 7 +- > arch/arm64/boot/dts/qcom/sm6350.dtsi | 2 +- > arch/arm64/boot/dts/qcom/sm8150.dtsi | 7 +- > arch/arm64/boot/dts/qcom/sm8250.dtsi | 7 +- > arch/arm64/boot/dts/qcom/sm8350.dtsi | 7 +- > arch/arm64/boot/dts/qcom/sm8450.dtsi | 7 +- > drivers/edac/qcom_edac.c | 14 +- > drivers/soc/qcom/llcc-qcom.c | 64 +++++---- > include/linux/soc/qcom/llcc-qcom.h | 4 +- > 13 files changed, 197 insertions(+), 67 deletions(-) > > -- > 2.25.1
Hi Luca, On Thu, Dec 08, 2022 at 10:16:27AM +0100, Luca Weiss wrote: > Hi Manivannan, > > On Wed Dec 7, 2022 at 2:59 PM CET, 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. > > If you can tell me *how* I can test it, I'd be happy to test the series > on sm6350, like how to trigger the EDAC IRQ. > I suppose there is no manual way to trigger EDAC IRQ on Qcom platforms. For testing the series, I manually called the EDAC IRQ handler to verify that it doesn't crash reading the registers. > So far without any extra patches I don't even see the driver probing, > with this in kconfig > > +CONFIG_EDAC=y > +CONFIG_EDAC_QCOM=y > > I do have /sys/bus/platform/drivers/qcom_llcc_edac at runtime but > nothing in there (except bind, uevent and unbind), and also nothing > interesting in dmesg with "llcc", with edac there's just this message: > > [ 0.064800] EDAC MC: Ver: 3.0.0 > > From what I'm seeing now the edac driver is only registered if the > interrupt is specified but it doesn't seem like sm6350 (=lagoon) has > this irq? Downstream dts is just this: > Right. The upstream EDAC driver only works in IRQ mode. So you need the interrupts property in LLCC devicetree node for probing. > cache-controller@9200000 { > compatible = "lagoon-llcc-v1"; > reg = <0x9200000 0x50000> , <0x9600000 0x50000>; > reg-names = "llcc_base", "llcc_broadcast_base"; > cap-based-alloc-and-pwr-collapse; > }; > > From looking at the downstream code, perhaps it's using the polling mode > there? > > /* Request for ecc irq */ > ecc_irq = llcc_driv_data->ecc_irq; > if (ecc_irq < 0) { > dev_info(dev, "No ECC IRQ; defaulting to polling mode\n"); > In the next version, I will add polling support so that you can test the series on your platform without any hacks. Thanks, Mani > Let me know what you think. > > Regards > Luca > > > > > Thanks, > > Mani > > > > Manivannan Sadhasivam (12): > > 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: Fix the base addresses of LLCC banks > > 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: Fix the base addresses of LLCC banks > > qcom: llcc/edac: Fix the base address used for accessing LLCC banks > > > > .../bindings/arm/msm/qcom,llcc.yaml | 128 ++++++++++++++++-- > > arch/arm64/boot/dts/qcom/sc7180.dtsi | 2 +- > > arch/arm64/boot/dts/qcom/sc7280.dtsi | 5 +- > > arch/arm64/boot/dts/qcom/sc8280xp.dtsi | 10 +- > > arch/arm64/boot/dts/qcom/sdm845.dtsi | 7 +- > > arch/arm64/boot/dts/qcom/sm6350.dtsi | 2 +- > > arch/arm64/boot/dts/qcom/sm8150.dtsi | 7 +- > > arch/arm64/boot/dts/qcom/sm8250.dtsi | 7 +- > > arch/arm64/boot/dts/qcom/sm8350.dtsi | 7 +- > > arch/arm64/boot/dts/qcom/sm8450.dtsi | 7 +- > > drivers/edac/qcom_edac.c | 14 +- > > drivers/soc/qcom/llcc-qcom.c | 64 +++++---- > > include/linux/soc/qcom/llcc-qcom.h | 4 +- > > 13 files changed, 197 insertions(+), 67 deletions(-) > > > > -- > > 2.25.1 >