Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6931994rwb; Mon, 12 Dec 2022 08:05:01 -0800 (PST) X-Google-Smtp-Source: AA0mqf6oAAIYRmU7NOV3g6DNGebIO7r32zkr21mbHVVVTIkSweNqAGgJhaAkPDCd0iUy4/wJiLXm X-Received: by 2002:a17:907:1627:b0:7c1:413d:5b0 with SMTP id hb39-20020a170907162700b007c1413d05b0mr16069373ejc.47.1670861101582; Mon, 12 Dec 2022 08:05:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670861101; cv=none; d=google.com; s=arc-20160816; b=xP1QvbA+IkRW5buZ8lNcr2wF9+Ew50dLEu0ryiF/MgdypRsbw8Zd/LMm1EyikTPXZ1 aj8XLWo8XZqtZGkCa9bVriyXJNfi/sr067gHR5xnjyRndReko2ETtGaykipKpZt0WseJ qCyTsuZe67FLsr2cfC10IKt7dio/tJwmvn/Czyg1husu00Mgow7NPUmYLEy1A833VDJ7 LaUT1NXDqmR1Y4PkG0nOn0rS5y05DtCYI75lD+tgIKd0Ya0HBtukSSXRgmAz/28TiwTi 3y8k4uzfpezmKqVPkRLKn0rDO+lEWhlLzGVE6IaQnfW4X2cfpzMH26Bk+OdGDd6Uc0Hz 1rvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:references:to:from:subject:cc :message-id:date:content-transfer-encoding:mime-version :dkim-signature; bh=sU26h7ISGDjyHbgt2m+/ybACjVhO2GW4px5ta3RiyaE=; b=xtkLF6tUQCo/0otcZaU9Qcwn++E5Xx8OiuBVpmpCLZAH69ZsB9LYZoKmJ4aLlrQDqr BcPbFGkxyWIuPiaYQ27xg8tJOX1qgLxV2LF6zFUIhAVJSzrvS/5P7InV4+5K7uPTH6JZ /1rpQ/BylFnR0UUnhYijDO3EW2wFrwAcihSlv4AnAwsUmu9BGHDTtg2I9uq7RQ8B01pE p4n9cvCrmZQMuICf6P9i7lThUFtXQXXkyGlzreAl10dNOElDbhXlZwZqSGGViDnekzIa zQ3x8gzf7Igm5rxeeM0Ydy+OIZ8pbVDbMFYiR/qKis9jsnOXMJAU5EKy896dTiSo5SsV dgfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fairphone.com header.s=fair header.b=36SO6GMz; 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=fairphone.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ht18-20020a170907609200b007bdd38a5d5asi6014182ejc.636.2022.12.12.08.04.42; Mon, 12 Dec 2022 08:05:01 -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=@fairphone.com header.s=fair header.b=36SO6GMz; 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=fairphone.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232592AbiLLPxz (ORCPT + 74 others); Mon, 12 Dec 2022 10:53:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232488AbiLLPxw (ORCPT ); Mon, 12 Dec 2022 10:53:52 -0500 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B864AE48 for ; Mon, 12 Dec 2022 07:53:51 -0800 (PST) Received: by mail-ej1-x633.google.com with SMTP id kw15so29128299ejc.10 for ; Mon, 12 Dec 2022 07:53:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fairphone.com; s=fair; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=sU26h7ISGDjyHbgt2m+/ybACjVhO2GW4px5ta3RiyaE=; b=36SO6GMz7L4vPlYlmziJri1BXEmxrk9bMJFdxWwfMpKw+n4X/jkbFndih2YeTWTIS3 jlYRQrOMtG+doRt7bI/dquqhUjgv8zrSGpor9dW9N4SPiWv+uje5+f5Ue51gBR2kcpbX AZkbP829krC+hiJS6BVC2OMVdIDN2zRdk91lVUEuUXR4FjlqkpTnNrLlyjyetPcYZZlj kjW6HGGXLFox1QFJ1Q27QUwO0mm/kxEcbocXir1Ilp0Jq/nnC904Qg/igWQz/pazRjLJ lBoOIxq+ikg5ozXHChl01vIbq3EgBpKezsWoxHYo4bngJa2pXmva1PW5kdFZ9erkAaxF +Ycw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-transfer-encoding:mime-version:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=sU26h7ISGDjyHbgt2m+/ybACjVhO2GW4px5ta3RiyaE=; b=IVJBCtaFMVWNaUprLiSLORevXft5U9DdWAofnHpkNQwuOZ7m0t4PHYiijNVrrHzwZy OICptTIcwA1pRMd6s4tUd1Z1JxjVUcSXQU6Ti2SHKZ0IwWGmBO79L8XJ2Uc9AwO1wj0U e9Uc1Hz45Bxd1jtJ4eadyOEMuIAycTAlAqsc2y7t6LL/1wt6WugUEdcTYgA7RxBqeXeb UwnCMhlZhX52iVRQEXGI1GAmPt04ZVwA8HWnATjf+8g7XhRHkBYXRpPs+8ooEvJLkwpD BXduQ4JPslwuOEIauKB4bLo/DXA582exn4VG22RoNjUHJZkeeqqk4/GU0bpKJ5x1CwvX 3RyA== X-Gm-Message-State: ANoB5ploRSPbjEDCY5Ck79398xiFuyHR1TJMrmgRHtIJnd8uYZSmTwtN 92U8ZjipXq9SSTR/aZGKFO7leg== X-Received: by 2002:a17:907:d049:b0:7c1:5467:39af with SMTP id vb9-20020a170907d04900b007c1546739afmr8795295ejc.37.1670860429931; Mon, 12 Dec 2022 07:53:49 -0800 (PST) Received: from localhost (144-178-202-138.static.ef-service.nl. [144.178.202.138]) by smtp.gmail.com with ESMTPSA id 13-20020a170906300d00b00741a251d9e8sm3487278ejz.171.2022.12.12.07.53.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 12 Dec 2022 07:53:49 -0800 (PST) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Mon, 12 Dec 2022 16:53:49 +0100 Message-Id: Cc: , , , , , , , , Subject: Re: [PATCH v2 13/13] qcom: llcc/edac: Support polling mode for ECC handling From: "Luca Weiss" To: "Manivannan Sadhasivam" , , , , , X-Mailer: aerc 0.13.0 References: <20221212123311.146261-1-manivannan.sadhasivam@linaro.org> <20221212123311.146261-14-manivannan.sadhasivam@linaro.org> In-Reply-To: <20221212123311.146261-14-manivannan.sadhasivam@linaro.org> 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: X-Mailing-List: linux-kernel@vger.kernel.org Hi Manivannan, On Mon Dec 12, 2022 at 1:33 PM CET, Manivannan Sadhasivam wrote: > Not all Qcom platforms support IRQ mode for ECC handling. For those > platforms, the current EDAC driver will not be probed due to missing ECC > IRQ in devicetree. > > So add support for polling mode so that the EDAC driver can be used on al= l > Qcom platforms supporting LLCC. > > The polling delay of 5000ms is chosed based on Qcom downstream/vendor > driver. I think it does work for me on SM6350, I get this in dmesg: [ 0.054608] EDAC MC: Ver: 3.0.0 [ 0.273913] EDAC DEVICE0: Giving out device to module qcom_llcc_edac con= troller llcc: DEV qcom_llcc_edac (POLLED) What I've noticed though is that the 5000ms poll you defined in the driver doesn't seem to be reflected at runtime? Or am I looking at different things? / # cat /sys/devices/system/edac/qcom-llcc/poll_msec=20 1000 Regards Luca > > Reported-by: Luca Weiss > Signed-off-by: Manivannan Sadhasivam > --- > drivers/edac/qcom_edac.c | 37 +++++++++++++++++++++++++----------- > drivers/soc/qcom/llcc-qcom.c | 13 ++++++------- > 2 files changed, 32 insertions(+), 18 deletions(-) > > diff --git a/drivers/edac/qcom_edac.c b/drivers/edac/qcom_edac.c > index 5be93577fc03..f7afb5375293 100644 > --- a/drivers/edac/qcom_edac.c > +++ b/drivers/edac/qcom_edac.c > @@ -76,6 +76,8 @@ > #define DRP0_INTERRUPT_ENABLE BIT(6) > #define SB_DB_DRP_INTERRUPT_ENABLE 0x3 > =20 > +#define ECC_POLL_MSEC 5000 > + > enum { > LLCC_DRAM_CE =3D 0, > LLCC_DRAM_UE, > @@ -283,8 +285,7 @@ dump_syn_reg(struct edac_device_ctl_info *edev_ctl, i= nt err_type, u32 bank) > return ret; > } > =20 > -static irqreturn_t > -llcc_ecc_irq_handler(int irq, void *edev_ctl) > +static irqreturn_t llcc_ecc_irq_handler(int irq, void *edev_ctl) > { > struct edac_device_ctl_info *edac_dev_ctl =3D edev_ctl; > struct llcc_drv_data *drv =3D edac_dev_ctl->pvt_info; > @@ -328,6 +329,11 @@ llcc_ecc_irq_handler(int irq, void *edev_ctl) > return irq_rc; > } > =20 > +static void llcc_ecc_check(struct edac_device_ctl_info *edev_ctl) > +{ > + llcc_ecc_irq_handler(0, edev_ctl); > +} > + > static int qcom_llcc_edac_probe(struct platform_device *pdev) > { > struct llcc_drv_data *llcc_driv_data =3D pdev->dev.platform_data; > @@ -356,22 +362,31 @@ static int qcom_llcc_edac_probe(struct platform_dev= ice *pdev) > edev_ctl->panic_on_ue =3D LLCC_ERP_PANIC_ON_UE; > edev_ctl->pvt_info =3D llcc_driv_data; > =20 > + /* Check if LLCC driver has passed ECC IRQ */ > + ecc_irq =3D llcc_driv_data->ecc_irq; > + if (ecc_irq > 0) { > + /* Use interrupt mode if IRQ is available */ > + edac_op_state =3D EDAC_OPSTATE_INT; > + } else { > + /* Fall back to polling mode otherwise */ > + edac_op_state =3D EDAC_OPSTATE_POLL; > + edev_ctl->poll_msec =3D ECC_POLL_MSEC; > + edev_ctl->edac_check =3D llcc_ecc_check; > + } > + > rc =3D edac_device_add_device(edev_ctl); > if (rc) > goto out_mem; > =20 > platform_set_drvdata(pdev, edev_ctl); > =20 > - /* Request for ecc irq */ > - ecc_irq =3D llcc_driv_data->ecc_irq; > - if (ecc_irq < 0) { > - rc =3D -ENODEV; > - goto out_dev; > - } > - rc =3D devm_request_irq(dev, ecc_irq, llcc_ecc_irq_handler, > + /* Request ECC IRQ if available */ > + if (ecc_irq > 0) { > + rc =3D devm_request_irq(dev, ecc_irq, llcc_ecc_irq_handler, > IRQF_TRIGGER_HIGH, "llcc_ecc", edev_ctl); > - if (rc) > - goto out_dev; > + if (rc) > + goto out_dev; > + } > =20 > return rc; > =20 > diff --git a/drivers/soc/qcom/llcc-qcom.c b/drivers/soc/qcom/llcc-qcom.c > index a29f22dad7fa..e044e6756415 100644 > --- a/drivers/soc/qcom/llcc-qcom.c > +++ b/drivers/soc/qcom/llcc-qcom.c > @@ -1011,13 +1011,12 @@ static int qcom_llcc_probe(struct platform_device= *pdev) > goto err; > =20 > drv_data->ecc_irq =3D platform_get_irq_optional(pdev, 0); > - if (drv_data->ecc_irq >=3D 0) { > - llcc_edac =3D platform_device_register_data(&pdev->dev, > - "qcom_llcc_edac", -1, drv_data, > - sizeof(*drv_data)); > - if (IS_ERR(llcc_edac)) > - dev_err(dev, "Failed to register llcc edac driver\n"); > - } > + > + llcc_edac =3D platform_device_register_data(&pdev->dev, > + "qcom_llcc_edac", -1, drv_data, > + sizeof(*drv_data)); > + if (IS_ERR(llcc_edac)) > + dev_err(dev, "Failed to register llcc edac driver\n"); > =20 > return 0; > err: > --=20 > 2.25.1