Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3445291imm; Tue, 29 May 2018 07:23:32 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIDF/1IQIZHpBWfrHOjuXf6lSya/omhur3h5cBG2LU3mt8mNEP+GEOOsKZdJpHz7G6n730i X-Received: by 2002:a62:49d4:: with SMTP id r81-v6mr12367520pfi.146.1527603811922; Tue, 29 May 2018 07:23:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527603811; cv=none; d=google.com; s=arc-20160816; b=Sf9QAfLVYOHLpQm+ORlkxp0lsWDEhVTrjf0JFAk2NCjUz5dy6hoWLLn5B7QMNCTh3E ip6PO/y2IivQ/o+cNUBA8VdKXI9VEcsVyjRIpNJ5gUxQ3iocCHu2aa2gpaIrnzBjIwFl GhvHftqWVbaHrAhj7sjqgO12WobliRBoNok0EtfIOjBE6HBrS8V5YBGxVQf1IfuIRMMl Ys0vnDWJtSl9rK5Y/NkBweb3otg8Un4m4txLUHsZXLMmERzZFc+Ic1ErynZnrLE7Lp7E hZ91+kPYer8sTlZSvoaV4gvckjyDGB4Us8owQnu6YFoS7p+GRiJPCApb0+l1JYdaZVi2 2hEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:dkim-signature:arc-authentication-results; bh=MCXKioiYa5QYG0v/K70KVERm0lne5w5pI8irm/Gd234=; b=ZdoLFT6MvgYG3ckOgS3BcLLbqAkJZ2mRZkDwmb2auDvk/rxp4NEhLyFO2DMdiEQb6y NpnD2q65IxXwkAAzUcjqmJ940u7EqKUWdvd5Fy3yZnB2rbpYm4IhRaYsujgEqZI+V8IH 907y/cBwGTdzBJiVKj8LHFAvrWhMeLEQrnDwpLocFnUG9mndkQBinKmSyY8ZrcJD3W10 isz+MMeyxGZ5qISN720FOl3+LpRyFSv6usouU0SFQjPRUyJp7eNDokx3s0JRDtift2KJ C2KbwIxjquEYD+lDiDa9r6CjufMZNjhwqHQW83y2tSG+t7Hqk99pEVTHGWTKPPbL3Bz9 2q3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=cspigPs8; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z14-v6si25572903pgv.514.2018.05.29.07.22.47; Tue, 29 May 2018 07:23:31 -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; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=cspigPs8; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934860AbeE2OSP (ORCPT + 99 others); Tue, 29 May 2018 10:18:15 -0400 Received: from fllnx210.ext.ti.com ([198.47.19.17]:61563 "EHLO fllnx210.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934158AbeE2OSM (ORCPT ); Tue, 29 May 2018 10:18:12 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by fllnx210.ext.ti.com (8.15.1/8.15.1) with ESMTP id w4TEI7vY030412; Tue, 29 May 2018 09:18:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1527603487; bh=MCXKioiYa5QYG0v/K70KVERm0lne5w5pI8irm/Gd234=; h=From:To:CC:Subject:Date; b=cspigPs8S0ByLZOo99xRScTezxoy/ZHLHADRui/vi7YjIMSCHfCCxrNgFrGEyYFZu BIxBef65GhN9CiL3u4wGddu9K11N+jgJCY9/5cZjPc+ZVXOV2ez7Zs+uXKHNpo0n0j Oz/u6zOOByQHJqZU0kDgE90Xkr16EPQ8gidrYV0I= Received: from DLEE108.ent.ti.com (dlee108.ent.ti.com [157.170.170.38]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w4TEI7uN030843; Tue, 29 May 2018 09:18:07 -0500 Received: from DLEE115.ent.ti.com (157.170.170.26) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Tue, 29 May 2018 09:18:06 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Tue, 29 May 2018 09:18:06 -0500 Received: from a0230074-OptiPlex-7010.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w4TEI3oN024493; Tue, 29 May 2018 09:18:04 -0500 From: Faiz Abbas To: , , , CC: , , Subject: [PATCH] can: m_can: Move acessing of message ram to after clocks are enabled Date: Tue, 29 May 2018 19:49:40 +0530 Message-ID: <20180529141940.1682-1-faiz_abbas@ti.com> X-Mailer: git-send-email 2.17.0 MIME-Version: 1.0 Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org MCAN message ram should only be accessed once clocks are enabled. Therefore, move the call to parse/init the message ram to after clocks are enabled. Signed-off-by: Faiz Abbas --- drivers/net/can/m_can/m_can.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c index b397a33f3d32..a9fbf81ac3d4 100644 --- a/drivers/net/can/m_can/m_can.c +++ b/drivers/net/can/m_can/m_can.c @@ -1642,8 +1642,6 @@ static int m_can_plat_probe(struct platform_device *pdev) priv->can.clock.freq = clk_get_rate(cclk); priv->mram_base = mram_addr; - m_can_of_parse_mram(priv, mram_config_vals); - platform_set_drvdata(pdev, dev); SET_NETDEV_DEV(dev, &pdev->dev); @@ -1666,6 +1664,8 @@ static int m_can_plat_probe(struct platform_device *pdev) goto clk_disable; } + m_can_of_parse_mram(priv, mram_config_vals); + devm_can_led_init(dev); of_can_transceiver(dev); @@ -1715,8 +1715,6 @@ static __maybe_unused int m_can_resume(struct device *dev) pinctrl_pm_select_default_state(dev); - m_can_init_ram(priv); - priv->can.state = CAN_STATE_ERROR_ACTIVE; if (netif_running(ndev)) { @@ -1726,6 +1724,7 @@ static __maybe_unused int m_can_resume(struct device *dev) if (ret) return ret; + m_can_init_ram(priv); m_can_start(ndev); netif_device_attach(ndev); netif_start_queue(ndev); -- 2.17.0