Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp815310pxu; Sun, 25 Oct 2020 18:15:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLoT+Sk1anB/naSMxeU65+6goq8tndoAInSZLj2Hu+0aofiUQiExe8xrFdkrctDpoc+dZS X-Received: by 2002:a17:906:b293:: with SMTP id q19mr11809508ejz.13.1603674906564; Sun, 25 Oct 2020 18:15:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603674906; cv=none; d=google.com; s=arc-20160816; b=ahNJuxQHId0tefhGz/V4Ma+0/FrDOTPc99yuU2BGksxijhphKPdsQDIXxkkt9YyuWB NTjnzw7BNpkbFzh7oZH1QoY0D+z4y+bEQlLV1DS2pwi6Jhazul5WJzus8obqCddARlHu DN3HkdVevG/ppKrkwHd/9zoYNK2ggDMfmziCPm6MCU4hhF2gi25wuztBtQAqxtjeSRSY Mf4Fr9no4s+u4nNGq8Be6SLxRopn2yo9msl89NeK+YtryeCwcxwKA93iwp4yVQXPPITi WChlPDKg+FhO7aGDuaVLWL0kDbnyy9T7TtZRSbSRtD87VSJigYsM4j1bgXDGPXMcgViB nfCw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Fg4He703fmuSrlVAk0wJsvaFKAB74pGCCwxOoopIZEI=; b=SzpqLZMnV7libEsnI5Q1BG4u0flOPzuD5/ENlWHC2aZwYB1H03Sl4FZH2t59JWIcGN bQibWVKQmEvVuhq35JwUzzPURX6wpa8y86tHc6cUQfGMhwhTY6Yuo7sS5l7eyRlsnTaG tnGP3dAKnkF6GG2ZqwsGwF6yU0/azWYNTSvRckKCHBmd2LMG88NcZiQDRTxA99YZETfn vhQvHZrxumeIlG8ht8wLTF8vvpXS87iqWoQpLWVNvjAoAWcjhYzjmU6Yo7vVElQZ/Xgx LA2vj0aO70UPByahB5B2SM5VTpVbw2eehH6lxsTa6eQ5aS00xB24Dv2xolqWiF8IYKT9 O54A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=VHEUlUYQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e12si6115635ejd.673.2020.10.25.18.14.43; Sun, 25 Oct 2020 18:15:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=VHEUlUYQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1419420AbgJYWTJ (ORCPT + 99 others); Sun, 25 Oct 2020 18:19:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1419326AbgJYWS3 (ORCPT ); Sun, 25 Oct 2020 18:18:29 -0400 Received: from mail-lf1-x143.google.com (mail-lf1-x143.google.com [IPv6:2a00:1450:4864:20::143]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA7BFC061755; Sun, 25 Oct 2020 15:18:28 -0700 (PDT) Received: by mail-lf1-x143.google.com with SMTP id b1so9400734lfp.11; Sun, 25 Oct 2020 15:18:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Fg4He703fmuSrlVAk0wJsvaFKAB74pGCCwxOoopIZEI=; b=VHEUlUYQ3XWj/2jC60Lr+VJjNgxo+pNKDO0JPR3z+WLZtsgVdYcM5RybqQaEoh988G /qTG5bBtU4uflVAnLbI6pcVQIS6t+0SjL0hJklMEz7xvVJyoJ9i4rbGxP9b6qX+NZOgH 8a4VBert2XPVYEjKOv4z1y5Y54h4BwZ5OTT00RkVRKnkZgYqFocpof5zWvYhs+3ERofF jfOs7gvKJXoCCeiyGpvq2SxSo7sydDyevCF0CMo8wLAOa1jl7aJGX8AjqdaL/SA5vzk2 InDFnV1NHEdEuoH9NnZDIl3UYfS/YSn59Bpzj3KMKBAlYP+7Pqr9Q6yIGC2btjhlRCPe JRkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Fg4He703fmuSrlVAk0wJsvaFKAB74pGCCwxOoopIZEI=; b=dN2gzB47usMnbNDREJelhzDe/QmjQFWBM2WFC9LEcKXlJBaSMPuGz6rl2c8eltANWq b/50RJx2sQZcpZSw12KgQi3P+zSQwptz6aIH7RR8ay3aR/3gKtfo9Ut3ydRegcWPWU+u 2bdwBvT3k6B6yibaFiZ+xOtFtHidQlCQMRxmCehDYSsGCEDkB6SQuyxik6O5EcPmmYBU QJ2dNJxESZ6T1IuPcfML+7IldrkkskfB+CEI4MwtOLVXWm9X3fwdA/7iRvvx4dgIBbLW MI9MAkwB0nqpw3HO6BRsLDo6QJ1popV8i2P7Y3fLtb1tJqXqUyDA3VZwjUBaRT6JFr5Z pCcg== X-Gm-Message-State: AOAM531fq7s7Ojz06fIt5qlfmIq0wPibGW61rTrjJ/i8OBNuiA1udxLc MTI4kD5LwXxWpuKE5MoXxsc= X-Received: by 2002:a05:6512:2029:: with SMTP id s9mr3782053lfs.273.1603664307205; Sun, 25 Oct 2020 15:18:27 -0700 (PDT) Received: from localhost.localdomain (109-252-193-186.dynamic.spd-mgts.ru. [109.252.193.186]) by smtp.gmail.com with ESMTPSA id k13sm932423ljh.136.2020.10.25.15.18.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Oct 2020 15:18:26 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Georgi Djakov , Rob Herring , Michael Turquette , Stephen Boyd , Peter De Schrijver , MyungJoo Ham , Kyungmin Park , Chanwoo Choi , Mikko Perttunen , Viresh Kumar , Peter Geis , Nicolas Chauvet , Krzysztof Kozlowski Cc: linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org Subject: [PATCH v6 34/52] memory: tegra20-emc: Don't parse emc-stats node Date: Mon, 26 Oct 2020 01:17:17 +0300 Message-Id: <20201025221735.3062-35-digetx@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201025221735.3062-1-digetx@gmail.com> References: <20201025221735.3062-1-digetx@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org EMC device-tree node now contains new emc-stats sub-node which needs to be skipped when timing nodes are parsed by EMC driver, otherwise driver will try to parse the emc-stats as a timing node and will error out. Signed-off-by: Dmitry Osipenko --- drivers/memory/tegra/tegra20-emc.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/memory/tegra/tegra20-emc.c b/drivers/memory/tegra/tegra20-emc.c index 69ccb3fe5b0b..27242659dfd6 100644 --- a/drivers/memory/tegra/tegra20-emc.c +++ b/drivers/memory/tegra/tegra20-emc.c @@ -349,7 +349,10 @@ static int tegra_emc_load_timings_from_dt(struct tegra_emc *emc, int child_count; int err; - child_count = of_get_child_count(node); + child = of_find_node_by_name(node, "emc-stats"); + of_node_put(child); + + child_count = of_get_child_count(node) - (child ? 1 : 0); if (!child_count) { dev_err(emc->dev, "no memory timings in DT node: %pOF\n", node); return -EINVAL; @@ -364,6 +367,9 @@ static int tegra_emc_load_timings_from_dt(struct tegra_emc *emc, timing = emc->timings; for_each_child_of_node(node, child) { + if (of_device_is_compatible(child, "nvidia,tegra20-emc-statistics")) + continue; + err = load_one_timing_from_dt(emc, timing++, child); if (err) { of_node_put(child); @@ -391,7 +397,11 @@ tegra_emc_find_node_by_ram_code(struct device *dev) u32 value, ram_code; int err; - if (of_get_child_count(dev->of_node) == 0) { + /* old device-trees don't have emc-stats node */ + np = of_find_node_by_name(dev->of_node, "emc-stats"); + of_node_put(np); + + if (of_get_child_count(dev->of_node) == (np ? 1 : 0)) { dev_info(dev, "device-tree doesn't have memory timings\n"); return NULL; } -- 2.27.0