Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2744844pxp; Mon, 14 Mar 2022 04:10:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxBuTRMfxrGEwlJpPgu8kcqrWdc6PlcQ5IbfLLliySqFBOd8et2DW8Ms58AhSeKW/MJUJFs X-Received: by 2002:a05:6402:34d6:b0:416:c66d:96b4 with SMTP id w22-20020a05640234d600b00416c66d96b4mr16347392edc.65.1647256211827; Mon, 14 Mar 2022 04:10:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647256211; cv=none; d=google.com; s=arc-20160816; b=eNILsNXarjyLIfs6kI0NkYmnYEjpmKEaPu0dqdyrCh78PXxGrtU9wspF1Cc33hVKVz aAMnPAZYVrWfEA/f6qUvoN0CPhrOcx53SGEX/xhxGzgtPMKYsHphi7B7p63St+8oIr5B Psf7acKeIS7fjas5pU3WcAW/yir8RwuBEWXkJirCJA0x7TVxsyqEhJO1BPuijV77Q1WD Q6I/oK8mshLMI2VfzUJbCbamQyiNOBrbDchLvVQNxUObztp/Ye5GuDm9adHzCFNKNOv9 qvFzuTZpSssX35FYLf4zwCJNlOsLsOTlsN2NIM4R763E70xe80Z+S7Jyv8mtBaRDN6rX PvKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Bg2tizYqINxLaPAUtFWgOMe6U6P8VVtNtHhthzp+bNk=; b=XERd1/4V2NywQ6rcq+DW+C8M7wM82rDbdkb3TKwgUnr3tZeDagp05M0siNAQkHG8B2 6FOyvHsAgOYnCaB2uyxJu24vm4SAAK5IY4H2OLyCPbXf+CdWNs3dNPjocBtLiZUiEtW0 KMj3Prm4t90duKDlhKzzIX/YRv/oeVJCI9Ro/eL8fDiBVkFGNmfgOl8LO2O2GFhbYsb/ rFWXspQDw7xavkXCXLPpbqijXSAnle6IwNA2yrWDceLhhp/BK6iRYUASE8K2ls/76/Th MZ6pSLqyPYUnzge/LmgLKp+s2jlD3x2BkHSYojMme4kaAju0B70E9psrQx35GGZsglJe nRfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=NfkG+SyI; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q12-20020a056402518c00b00418977a239dsi132068edd.556.2022.03.14.04.09.33; Mon, 14 Mar 2022 04:10:11 -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=@gmail.com header.s=20210112 header.b=NfkG+SyI; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236182AbiCNFeJ (ORCPT + 99 others); Mon, 14 Mar 2022 01:34:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235332AbiCNFeE (ORCPT ); Mon, 14 Mar 2022 01:34:04 -0400 Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F31412721; Sun, 13 Mar 2022 22:32:53 -0700 (PDT) Received: by mail-lj1-x236.google.com with SMTP id q5so20191067ljb.11; Sun, 13 Mar 2022 22:32:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=Bg2tizYqINxLaPAUtFWgOMe6U6P8VVtNtHhthzp+bNk=; b=NfkG+SyIm8tCL/zOPwO1KnVTPxiHAE3v9/ysLSapqVw7bkxmxOhB2gmvGoQj1D55wT yP9JUSKVbEKu1IcCLpsl4a+l/rLJ1YZzTI4MOUwTJZjsZEMlpQ4FDi1/k74Ny59szLHe 4GnDZcPErTJ6simgZ2+qeplpmZJQ3FoRm034iGgtalMdQC6mZ5G3p509KKto2DlrjNAs /HemlPuaWhrk7KnKhasu3Fi8CpJMQQoX4+wK6rTItWoHpum3eLd+MefoRUIOwnYtRhFI rixVSeJvqDJoMYq53sw+LBv/EFOcKZPnWCcrUsAGEzWGDheT2jBgW17SNFhWP5yE9QcV YYAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=Bg2tizYqINxLaPAUtFWgOMe6U6P8VVtNtHhthzp+bNk=; b=nkJZdqVSpD6zKw554f6Wpjvl6VB+M/YLLaeyFQDTr79u5vAB+hxrXBweW2tXUTp7Gc ebuwtGKy+hGppORI4ctJNex7SdX1n1KY0IQLCIpqGIBjFznK30LEMgNVNQzvtn43VMw6 iNsn+ysHRv3idPKowKTsKXlPTxWKBmBHMHltfXllbxnWyVglmePCCLaVrzpSflWnbZze hS/irNMEtItbXcaW2CITDZP/jFhqjx/fHSbESLnJJhkwCnhrINxmnvILv614Ze6Vy75y Lh0lqiYXuTuc2txO3iyqmos01nE0iHOm0drafrSEBtJrh0q3MKBJuAWqlZQ+O9TOYcDl SS3w== X-Gm-Message-State: AOAM531LMEMoWb7hdbfmtHO3Zvb2rKyAA5AtXPbWyOcB9aQOwTJgBfIc nYr6TTlqg0x00PW/XHOq0DsWs7SY4kkxzLrYt9k= X-Received: by 2002:a2e:5009:0:b0:247:d738:3e8e with SMTP id e9-20020a2e5009000000b00247d7383e8emr13197832ljb.281.1647235972025; Sun, 13 Mar 2022 22:32:52 -0700 (PDT) MIME-Version: 1.0 References: <20220311014245.4612-1-ctcchien@nuvoton.com> <20220311014245.4612-4-ctcchien@nuvoton.com> <1f5e1e49-4ab0-5e06-fa8f-2a11b0fd1df9@canonical.com> In-Reply-To: <1f5e1e49-4ab0-5e06-fa8f-2a11b0fd1df9@canonical.com> From: Medad Young Date: Mon, 14 Mar 2022 13:32:40 +0800 Message-ID: Subject: Re: [PATCH v3 3/3] EDAC: nuvoton: Add NPCM memory controller driver To: Krzysztof Kozlowski Cc: rric@kernel.org, james.morse@arm.com, tony.luck@intel.com, mchehab@kernel.org, bp@alien8.de, robh+dt@kernel.org, Benjamin Fair , Nancy Yuen , Patrick Venture , KWLIU@nuvoton.com, YSCHU@nuvoton.com, JJLIU0@nuvoton.com, KFTING , avifishman70@gmail.com, tmaimon77@gmail.com, tali.perry1@gmail.com, ctcchien@nuvoton.com, linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, openbmc@lists.ozlabs.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Krzysztof Kozlowski =E6=96=BC 2022=E5= =B9=B43=E6=9C=8811=E6=97=A5 =E9=80=B1=E4=BA=94 =E4=B8=8B=E5=8D=885:15=E5=AF=AB=E9=81=93=EF=BC=9A > > On 11/03/2022 02:42, Medad CChien wrote: > > Add support for Nuvoton NPCM SoC. > > > > Signed-off-by: Medad CChien > > --- > > drivers/edac/Kconfig | 9 + > > drivers/edac/Makefile | 1 + > > drivers/edac/npcm_edac.c | 714 +++++++++++++++++++++++++++++++++++++++ > > 3 files changed, 724 insertions(+) > > create mode 100644 drivers/edac/npcm_edac.c > > > > diff --git a/drivers/edac/Kconfig b/drivers/edac/Kconfig > > index 58ab63642e72..757e1d160640 100644 > > --- a/drivers/edac/Kconfig > > +++ b/drivers/edac/Kconfig > > @@ -539,4 +539,13 @@ config EDAC_DMC520 > > Support for error detection and correction on the > > SoCs with ARM DMC-520 DRAM controller. > > > > +config EDAC_NPCM > > + tristate "Nuvoton NPCM DDR Memory Controller" > > + depends on ARCH_NPCM > > || COMPILE_TEST > (and test if it compiles) > > (...) > > > + > > +MODULE_DEVICE_TABLE(of, npcm_edac_of_match); > > + > > +static int npcm_edac_mc_probe(struct platform_device *pdev) > > +{ > > + const struct npcm_edac_platform_data *npcm_chip; > > + struct device *dev =3D &pdev->dev; > > + struct edac_mc_layer layers[1]; > > + const struct of_device_id *id; > > + struct priv_data *priv_data; > > + struct mem_ctl_info *mci; > > + struct resource *res; > > + void __iomem *reg; > > + int ret =3D -ENODEV; > > + int irq; > > + > > + id =3D of_match_device(npcm_edac_of_match, &pdev->dev); > > + if (!id) > > + return -ENODEV; > > Why do you need it? How such case is even possible? this driver is used for two nuvoton SOCs, one is NPCM845 and the other is NPCM750 > > > + > > + npcm_chip =3D of_device_get_match_data(&pdev->dev); > > + if (!npcm_chip) > > + return -ENODEV; > > I wonder, how is it possible to have here NULL? > > Best regards, > Krzysztof