Received: by 10.213.65.68 with SMTP id h4csp1764634imn; Mon, 19 Mar 2018 12:37:03 -0700 (PDT) X-Google-Smtp-Source: AG47ELslJ9vEj9CZWUubFD3BHS53T+yYY5a0/oSaEdvqv6vmWHS52XlcbDCYihNDL3ohNUjfhCIG X-Received: by 10.99.152.10 with SMTP id q10mr10037613pgd.62.1521488223400; Mon, 19 Mar 2018 12:37:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521488223; cv=none; d=google.com; s=arc-20160816; b=a4FX/FXLzsQEpIjgKUe8Y2Hn5PDGausJ97pEXBl3S/A27eQheZhnSSpTqZn+mxWkAc y1EojeBOXWuRQ1RdW/XOow2BpKYxQw9mDFmFXdPupF/Bkavh9qlE/wm2Mmk46SzBZkYU 6Aiyj0nuDjWj0JGr61djtuFwlxqa9U7D4c+Cx0Xlr6r35Ke35BAq5Qt4gwLDon5x/8iR RQtrDXcZsP07uC2F50jZyJs+qlZn09iR5ItS1TR5zhtEOMvVGW/Y+CTHtf80TaDG//K9 PNZ/2eCDFfmvG9DgDgOLg+WUvuzfw8urkKTWFo+tG78VY8RK+qrBJSrmp/Yb5NMz6Nkj 0EQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=D/neUQz4H+XneK3fuw9+g9WPJDdpmIul8lb/ZsG9c1k=; b=sCHAG0D3KIxZ5sSOeRVZX4znPWabAcmLbwM/qDdrvjqZRYnhNdm5BbeFP295EUNFIU +JirGY4ievy4+/vFK427XJj4y8JPBz4qiNWZ8xtHAhNS6WAQaqB2Thbf9CW1JC1Y50rM /KBr/HddhPiifRblrEScGlGZIVdbPHRBvddvNOYU9FMDFzyaDw1CsvcPGkO6EFme1TXU 9AT/z8yzlCvMR0RCXeIXzz51xI9hqEb26Mh6uZ/K3F4lvds3csN3Q708Eni7sMM3uOZu OWB7GtLiCpbQX065aYDS/BF2WtknUttjl3lgymCo6YbdwUvySxavrqjkpQS8IuMaPMPV +ueg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c1-v6si547466pla.34.2018.03.19.12.36.49; Mon, 19 Mar 2018 12:37:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936050AbeCSTeK (ORCPT + 99 others); Mon, 19 Mar 2018 15:34:10 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:48716 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S969372AbeCSSWz (ORCPT ); Mon, 19 Mar 2018 14:22:55 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id D88AB12A2; Mon, 19 Mar 2018 18:22:53 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thor Thayer , linux-edac , Borislav Petkov , Sasha Levin Subject: [PATCH 4.9 113/241] EDAC, altera: Fix peripheral warnings for Cyclone5 Date: Mon, 19 Mar 2018 19:06:18 +0100 Message-Id: <20180319180755.884323785@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319180751.172155436@linuxfoundation.org> References: <20180319180751.172155436@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Thor Thayer [ Upstream commit 25b223ddfe2a557307c05fe673e09d94ae950877 ] The peripherals' RAS functionality only exist on the Arria10 SoCFPGA. The Cyclone5 initialization generates EDAC warnings when the peripherals aren't found in the device tree. Fix by checking for Arria10 in the init functions. Signed-off-by: Thor Thayer Cc: linux-edac Link: http://lkml.kernel.org/r/1491415262-5018-1-git-send-email-thor.thayer@linux.intel.com Signed-off-by: Borislav Petkov Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/edac/altera_edac.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) --- a/drivers/edac/altera_edac.c +++ b/drivers/edac/altera_edac.c @@ -1020,13 +1020,23 @@ out: return ret; } +static int socfpga_is_a10(void) +{ + return of_machine_is_compatible("altr,socfpga-arria10"); +} + static int validate_parent_available(struct device_node *np); static const struct of_device_id altr_edac_a10_device_of_match[]; static int __init __maybe_unused altr_init_a10_ecc_device_type(char *compat) { int irq; - struct device_node *child, *np = of_find_compatible_node(NULL, NULL, - "altr,socfpga-a10-ecc-manager"); + struct device_node *child, *np; + + if (!socfpga_is_a10()) + return -ENODEV; + + np = of_find_compatible_node(NULL, NULL, + "altr,socfpga-a10-ecc-manager"); if (!np) { edac_printk(KERN_ERR, EDAC_DEVICE, "ECC Manager not found\n"); return -ENODEV; @@ -1542,8 +1552,12 @@ static const struct edac_device_prv_data static int __init socfpga_init_sdmmc_ecc(void) { int rc = -ENODEV; - struct device_node *child = of_find_compatible_node(NULL, NULL, - "altr,socfpga-sdmmc-ecc"); + struct device_node *child; + + if (!socfpga_is_a10()) + return -ENODEV; + + child = of_find_compatible_node(NULL, NULL, "altr,socfpga-sdmmc-ecc"); if (!child) { edac_printk(KERN_WARNING, EDAC_DEVICE, "SDMMC node not found\n"); return -ENODEV;