Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1426116ybt; Thu, 25 Jun 2020 05:59:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyNcNCDYQ06Q1tNtnqUB3w/ksgvg4QiouY3uFMN6wTR401cdlMgrGaGHaFCWJGoEx/8G9D5 X-Received: by 2002:a17:906:c451:: with SMTP id ck17mr6446051ejb.80.1593089988207; Thu, 25 Jun 2020 05:59:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593089988; cv=none; d=google.com; s=arc-20160816; b=eviWJW9EK/jpGvLzBhdGrIj8PGQzWW8pw1QSsS6hPB0BL0+MUWF+dzDBuhWY3YjIuw xuC9fCCaci0Rs+t+cfC80xsTolKgZ+ZT9WSJAgYaod3Roq6MYXxb/uQydbew3mcQH9Ov lTM8ZDLxevkJbRONGGom8V5wzj2cxO+RmnUA/smGi5zgWPdjgGsI0GzX+nXHk6JMu6ks sDL64zJbd8rPndt0VQWEBD6abG7vYYQxHpNwTv4v+bzTnDAD2FFznw3pnp/zP9Ib6v6E qE3uaibZQyDrJV+OTV+7TRCvfjB3ywHfc+/y8JjfxJ6gVmVYd4SGsenrJLxnCuhEk4xj /PfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:message-id:subject:cc:to:from:date; bh=4yXU1w7H8gaP74AafGsew/Defzs0h/wu0m69Y8NS+nA=; b=KjZIC+i2wogtu8yMfwoFJbytjVjsYiuPvojve22RAanTW+yQ/6j2pJkP8C9kfNjiH4 rgi4Rn9BtyrNsEHQsYas/L0zl50aKoT70fmUELCd34QUy5fLFeywcmXheXFn3BbeKnNY 8UytsCEXzqghMWQq2sRz2XuY0ZHfqKnJV1XMmZpDM58jO5U58L32viIPdP0sGGE1ka3W HKWnqtsrHSaBJ8JfbMNecjkEH5+fIM6CEPyr10n0oUh+k6rqxHzZB7AsI0JPkUe0c4aR gs5i6Q9vW3zbrWtVt8F8PH8FxT62zQJGeFITG0IImNWo876llnmnb7JF970BBRHx6+zU lG2A== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z20si9633542ejb.342.2020.06.25.05.59.24; Thu, 25 Jun 2020 05:59:48 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404761AbgFYM6i convert rfc822-to-8bit (ORCPT + 99 others); Thu, 25 Jun 2020 08:58:38 -0400 Received: from smtprelay08.ispgateway.de ([134.119.228.98]:28265 "EHLO smtprelay08.ispgateway.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404650AbgFYM6i (ORCPT ); Thu, 25 Jun 2020 08:58:38 -0400 X-Greylist: delayed 2034 seconds by postgrey-1.27 at vger.kernel.org; Thu, 25 Jun 2020 08:58:36 EDT Received: from [89.1.81.74] (helo=ipc1.ka-ro) by smtprelay08.ispgateway.de with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) (envelope-from ) id 1joQvk-0003Qs-9b; Thu, 25 Jun 2020 14:24:36 +0200 Date: Thu, 25 Jun 2020 14:24:35 +0200 From: Lothar =?UTF-8?B?V2HDn21hbm4=?= To: Dan Murphy Cc: Sriram Dash , Wolfgang Grandegger , Marc Kleine-Budde , "David S. Miller" , Jakub Kicinski , linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH BUGFIX] can: m_can: make m_can driver work with sleep state pinconfig Message-ID: <20200625142435.50371e2f@ipc1.ka-ro> Organization: Ka-Ro electronics GmbH MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT X-Df-Sender: bHdAa2Fyby1lbGVjdHJvbmljcy5kb21haW5mYWN0b3J5LWt1bmRlLmRl Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, When trying to use the m_can driver on an stm32mp15 based system, I found that I could not send or receive any data. Analyzing the pinctrl registers revealed, that the pins were configured for sleep state even when the can interfaces were in use. Looking at the m_can_platform.c driver I found that: commit f524f829b75a ("can: m_can: Create a m_can platform framework") introduced a call to m_can_class_suspend() in the m_can_runtime_suspend() function which wasn't there in the original code and which causes the pins used by the controller to be configured for sleep state. commit 0704c5743694 ("can: m_can_platform: remove unnecessary m_can_class_resume() call") already removed a bogus call to m_can_class_resume() from the m_can_runtime_resume() function, but failed to remove the matching call to m_can_class_suspend() from the m_can_runtime_suspend() function. Removing the bogus call to m_can_class_suspend() in the m_can_runtime_suspend() function fixes this. Fixes: f524f829b75a ("can: m_can: Create a m_can platform framework") Fixes: 0704c5743694 ("can: m_can_platform: remove unnecessary m_can_class_resume() call") Signed-off-by: Lothar Waßmann --- drivers/net/can/m_can/m_can_platform.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/can/m_can/m_can_platform.c b/drivers/net/can/m_can/m_can_platform.c index 38ea5e600fb8..e6d0cb9ee02f 100644 --- a/drivers/net/can/m_can/m_can_platform.c +++ b/drivers/net/can/m_can/m_can_platform.c @@ -144,8 +144,6 @@ static int __maybe_unused m_can_runtime_suspend(struct device *dev) struct net_device *ndev = dev_get_drvdata(dev); struct m_can_classdev *mcan_class = netdev_priv(ndev); - m_can_class_suspend(dev); - clk_disable_unprepare(mcan_class->cclk); clk_disable_unprepare(mcan_class->hclk); -- 2.11.0 -- ___________________________________________________________ Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10 Geschäftsführer: Matthias Kaussen Handelsregistereintrag: Amtsgericht Aachen, HRB 4996 www.karo-electronics.de | info@karo-electronics.de ___________________________________________________________