Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1023161imm; Tue, 3 Jul 2018 04:17:55 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJCOwLDdf9dvCAJ+cqM/P6NbUQj/I4L8O1os7hmKJOK8acCA78a2AgROmRxvDO6z73puM8v X-Received: by 2002:a63:ad07:: with SMTP id g7-v6mr24997247pgf.19.1530616675837; Tue, 03 Jul 2018 04:17:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530616675; cv=none; d=google.com; s=arc-20160816; b=yXJPyYw4lmdkQPS+RZMItWp/bGqfo07wm6LsRs4SrLRy4JWcxnwnKPm1kKr8BUQFO2 2pfKRUr3YivEI35qZgM8YoRj7q8Ud/7o8l1jhXrJgN6rdsXjCxhe8wM8ZAWoH9np+2cp +ZJlvmFaTrWU45ZhfdWO0tN3NgMBqF1+tBLFbrjkjsjDq5oKPpjqeAl1UtSIt2tcvFVM alU+e14HuBYSUDO15a3fpcoF4fAZo5fo9u5ka/zZal1IrqpzxuewhgbgiRbBA16jTr/f /lhdfy51dY5BNcoyCqSokN0Nac3FHRJgqZaWcWCY1ifi1Hk3SvYfHRoK+ddLZtT2tXTv AySg== 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=Xowt0NvKxuoYviv3Im9vDqOwJcJgbcZg2wbC6XamJZg=; b=PLvBJ9QZOmLJ/3l1FDSOS+JXpofNtXrOPQ+ldRhSLg7E2LNRYpsVDCyXW3f/Peizk7 J61vGAyT8qiYx9Z8GLlcL1EJ3TtbPvwVk0M8UYSKwjKuKucKSM8kEqPvoepoSccFVIVk 8hf0oBi8NWxoRamom7dC98KA03Px0oS99iLXbEG/IPPjD34xMp+T4+BGKJ81k3U+gP9D dWsslQPDPJSuYqIVGqIDuDGZ9ofMnzMK9Zn5tUUy9t5Agb7E6s3nmOPvqie1Equr9P+3 yEbUBqnUYp1z0dH8+hZRxl7Y0aecEIPNbY6H7IisEKfHbOFeLtRCTcsUR+BVBl06WV+0 f0+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=WuSi3afr; 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 f90-v6si922643plf.390.2018.07.03.04.17.41; Tue, 03 Jul 2018 04:17:55 -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=WuSi3afr; 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 S1753248AbeGCLP1 (ORCPT + 99 others); Tue, 3 Jul 2018 07:15:27 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:52552 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752552AbeGCLPY (ORCPT ); Tue, 3 Jul 2018 07:15:24 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id w63BFJeC091956; Tue, 3 Jul 2018 06:15:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1530616519; bh=Xowt0NvKxuoYviv3Im9vDqOwJcJgbcZg2wbC6XamJZg=; h=From:To:CC:Subject:Date; b=WuSi3afrvIdurpUTgLOxc0oYPiv/7mKmuZDN1ecwA8tzLmVQgQWUSRIjDsSgSqaYU jX0j5mNdyb6HQBy+prAGtDr5M1OA6cZm621cTIgK7cg6Y4nBrFRcfdSkBM6K967ygz bGB7XONi90/5NW8NBbzrByLBpm1P4GKQQDbuk4UM= Received: from DLEE115.ent.ti.com (dlee115.ent.ti.com [157.170.170.26]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w63BFJNc011625; Tue, 3 Jul 2018 06:15:19 -0500 Received: from DLEE113.ent.ti.com (157.170.170.24) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Tue, 3 Jul 2018 06:15:19 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Tue, 3 Jul 2018 06:15:19 -0500 Received: from a0230074-OptiPlex-7010.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id w63BFGrZ004157; Tue, 3 Jul 2018 06:15:17 -0500 From: Faiz Abbas To: , , , CC: , , , Subject: [PATCH v2] can: m_can: Move accessing of message ram to after clocks are enabled Date: Tue, 3 Jul 2018 16:47:10 +0530 Message-ID: <20180703111710.27084-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 --- Changes in v2: rebased to latest mainline 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 ac4c6dc2f8c8..04c48371ab2a 100644 --- a/drivers/net/can/m_can/m_can.c +++ b/drivers/net/can/m_can/m_can.c @@ -1644,8 +1644,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); @@ -1668,6 +1666,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