From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37135C3F2D1 for ; Tue, 3 Mar 2020 17:52:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 14453206D5 for ; Tue, 3 Mar 2020 17:52:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583257950; bh=jlZAQx8FT/1sYWWq280Z70i7ND/ZD6aGEztd1x8wfUk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=SF2yNOLGHpc+8+tQI9vu8Wfp2U1C7/k8qocDLrDkvPRfcPjr9Xo3EgIDoabhATwT8 q761tH/Xaq0krxTLyZB8ZtwxpqlDVaGW9FnN9a5mo0n6mMGTDLp9179sjLVlM2xbkf +pWAmkdgU8YeigUMWhQFJP1gBOTwkbKzgACHYHL8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732165AbgCCRw2 (ORCPT ); Tue, 3 Mar 2020 12:52:28 -0500 Received: from mail.kernel.org ([198.145.29.99]:60844 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732153AbgCCRw1 (ORCPT ); Tue, 3 Mar 2020 12:52:27 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E97B8206D5; Tue, 3 Mar 2020 17:52:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583257946; bh=jlZAQx8FT/1sYWWq280Z70i7ND/ZD6aGEztd1x8wfUk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ppJia0nEccWiN1iS/vVjHSfbQTwpjiy8iAuefOGeE2TjDLZTNvv/cGK7s/Z3AUeZS DofHbAlz6p1FkFcploEJWU1GTvorgScXfj0Z8LkrQqUm4zgVCXdr49HrnJ307HSyyK HYcXmQkmb+/y6ICS866WvI1li0KahyFYkU8mIz2c= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alexandre Belloni , Claudiu Beznea , Nicolas Ferre , "David S. Miller" Subject: [PATCH 5.4 005/152] net: macb: ensure interface is not suspended on at91rm9200 Date: Tue, 3 Mar 2020 18:41:43 +0100 Message-Id: <20200303174303.112368405@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200303174302.523080016@linuxfoundation.org> References: <20200303174302.523080016@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexandre Belloni [ Upstream commit e6a41c23df0d5da01540d2abef41591589c0b4be ] Because of autosuspend, at91ether_start is called with clocks disabled. Ensure that pm_runtime doesn't suspend the interface as soon as it is opened as there is no pm_runtime support is the other relevant parts of the platform support for at91rm9200. Fixes: d54f89af6cc4 ("net: macb: Add pm runtime support") Signed-off-by: Alexandre Belloni Reviewed-by: Claudiu Beznea Acked-by: Nicolas Ferre Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/cadence/macb_main.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -3690,6 +3690,10 @@ static int at91ether_open(struct net_dev u32 ctl; int ret; + ret = pm_runtime_get_sync(&lp->pdev->dev); + if (ret < 0) + return ret; + /* Clear internal statistics */ ctl = macb_readl(lp, NCR); macb_writel(lp, NCR, ctl | MACB_BIT(CLRSTAT)); @@ -3750,7 +3754,7 @@ static int at91ether_close(struct net_de q->rx_buffers, q->rx_buffers_dma); q->rx_buffers = NULL; - return 0; + return pm_runtime_put(&lp->pdev->dev); } /* Transmit packet */