Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1821930imm; Mon, 3 Sep 2018 10:18:52 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYVe4J26WbCAXuP3gCS/4l8BUAxkH6Ez9Yd80gku7hCC6ueUEB5Aq6G/n5n34KIKi+vj4lh X-Received: by 2002:a63:1e0b:: with SMTP id e11-v6mr12727460pge.44.1535995132500; Mon, 03 Sep 2018 10:18:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535995132; cv=none; d=google.com; s=arc-20160816; b=vNNwaO4YJysYtUrL7AXSJg+YiGsvbOvoTTw9j74sn5nHGvYDq339JT400/dfQZQErl YLZLd/Yu71NhgPWRQPCoZx2URgw6lU1onI3VQUbsxWgzmwvXSGTME0Xea2xrdYvHIqJD +FNQsWPgRWqjWTFmPRRMENMo7r6NFDBwZzpkiNEPtrny4UPDs8vClDPL2wMIR2W6tGxr L/vrd03grhHTorJDht6p8G85/oT4S+Xs9chDDuzb4YAWLYDOg/m80wmgQ0kVpdR9Qcg6 Vpb/NESyJXmggbSvlL2JVZr6gvkzdmam4MkmAiKTHojYFbFzOnr3/uq7XfkkANy6EbWI hPYQ== 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=L5EC5RwyaBjZVP5cyhNAUg2zjmo6DgTlaUiGCrqdCHw=; b=mJDWjfP4d9fW/nuZjpBq9RJTlpqpOt74A4iWPzV3FjWyQFZvGzzUem7nZZCDW26yYn 8zHC9NTJAlOQJeq4AqCUtb0u4Cwy+uySksPVoUechJYY/tkRP7vnaQ8qpd+BlDeMjXw9 fRvUazdBuiYy6xNoeFKr7mFYu8c4nLsOLY+bBMPxF8ADUTvntp1kqWSCfy8k0xKJY/kV nqz3W9U8sjWqRvrnJMqHIWbQBX8srzxs6HvXA7MoEk4yGSCs50XuQlP6+uxilxuYTDSO 78nTblFe+8BD3jD+W2ypOh0HQ04z5iqt5msUW7otHAZnn2+5t8ol75pTVXRxsoyy44os QWKA== 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 e67-v6si17935442plb.272.2018.09.03.10.18.37; Mon, 03 Sep 2018 10:18:52 -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 S1730121AbeICViP (ORCPT + 99 others); Mon, 3 Sep 2018 17:38:15 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:42720 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728774AbeICViO (ORCPT ); Mon, 3 Sep 2018 17:38:14 -0400 Received: from localhost (ip-213-127-74-90.ip.prioritytelecom.net [213.127.74.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 55A5ED13; Mon, 3 Sep 2018 17:17:10 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Faiz Abbas , Marc Kleine-Budde , Sasha Levin Subject: [PATCH 4.14 040/165] can: m_can: Move accessing of message ram to after clocks are enabled Date: Mon, 3 Sep 2018 18:55:26 +0200 Message-Id: <20180903165657.110812303@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180903165655.003605184@linuxfoundation.org> References: <20180903165655.003605184@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.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Faiz Abbas [ Upstream commit 54e4a0c486041dc1c20593d997fafd67089e8408 ] 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 Signed-off-by: Marc Kleine-Budde Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/can/m_can/m_can.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) --- a/drivers/net/can/m_can/m_can.c +++ b/drivers/net/can/m_can/m_can.c @@ -1637,8 +1637,6 @@ static int m_can_plat_probe(struct platf 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); @@ -1649,6 +1647,8 @@ static int m_can_plat_probe(struct platf goto failed_free_dev; } + m_can_of_parse_mram(priv, mram_config_vals); + devm_can_led_init(dev); dev_info(&pdev->dev, "%s device registered (irq=%d, version=%d)\n", @@ -1698,8 +1698,6 @@ static __maybe_unused int m_can_resume(s pinctrl_pm_select_default_state(dev); - m_can_init_ram(priv); - priv->can.state = CAN_STATE_ERROR_ACTIVE; if (netif_running(ndev)) { @@ -1709,6 +1707,7 @@ static __maybe_unused int m_can_resume(s if (ret) return ret; + m_can_init_ram(priv); m_can_start(ndev); netif_device_attach(ndev); netif_start_queue(ndev);