Received: by 2002:a17:90a:9307:0:0:0:0 with SMTP id p7csp3967598pjo; Tue, 3 Mar 2020 10:14:43 -0800 (PST) X-Google-Smtp-Source: ADFU+vvdyQ8Q2etqk9BnufplDBdGU2u8FVyiUYfy/cuYzyhF4GdWhy8Pu/KDsY5Y8jhqAXRZnlvr X-Received: by 2002:a05:6830:1e37:: with SMTP id t23mr4531506otr.16.1583259283371; Tue, 03 Mar 2020 10:14:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583259283; cv=none; d=google.com; s=arc-20160816; b=mabL3XhNPcL8rZEbgG5zndWmKcsfs2MdR5q9ZDgP/lJitj6vEXy1zy/PmR0mvd1/tC nqR+2ncWtvhXmf530ZHFugPATWa8TkD9BpI1Xa3Iiffw6VLZS4igA65fogY0KE9JdgUD jCfL1QFNnxdwuKX77bNpkEV6VMnCa/7DukOc6zJ07fXsyf0OfAdHgbEkPsieFyPJe9vz ii+wtt+GT+SM14u/hRbo5rAfN0zFofQQHmlMAYSkz2BoBekLyIWthCXmxqnEIf2hpjd1 RyY2zEKHiE/rsJXFtk3lbzzyOUG17Twmq8O/tzSi/EdRyH6kNzr8/gZbtscXR34adETO RVlw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=aHHP0Fyc4uMS48ZmaoJ0hKSbB1BIT1ObmgwtklIqgNA=; b=dGSeGPs960c/3K70JgpCdHJRrEem4kMOxk4I9lgxzyTHgvEsi1d17eMFWl3zv0I4ze PAiAzoQd4cBZQwwUEgkz7Pk6BPuYW0WZbadVTNp2AOTqGnHET4fMyABtGYWznKrfkAgq ATSNPbwA4Re34yV/7lSDsTihmB1QLtAdhjZxtS2UiEgOG0ZYSzbrx1TJdLpzWxA3GOkj FJlUGuXCq5ksaOk2HH2c9k0NM140WGmbbhAqJouIShwQjQRfu7eEj/pBEfo5vV4JTS6M lmKkf39sLkbj3k7jKvry84vJHlorrDUOLQUWVUzvnsz/g/sWjmgjt3tblOQihoLHLza8 Bacg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Uk2Tuz8A; 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 z13si7958868oic.70.2020.03.03.10.14.31; Tue, 03 Mar 2020 10:14:43 -0800 (PST) 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=@kernel.org header.s=default header.b=Uk2Tuz8A; 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 S1731021AbgCCRp4 (ORCPT + 99 others); Tue, 3 Mar 2020 12:45:56 -0500 Received: from mail.kernel.org ([198.145.29.99]:52162 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731014AbgCCRpw (ORCPT ); Tue, 3 Mar 2020 12:45:52 -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 0A4BD2146E; Tue, 3 Mar 2020 17:45:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583257552; bh=YMgHlrtuiwKldkGHm/KTntARREeMaVQs7JX9vfA0P9U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Uk2Tuz8AlMV4T4dl8o/kvL4Uosh8qggTYhK5Pa/O31w3GAr9FrRTVJ8LiZLaoDUQ3 ovpADg16jQ6aPV1/VKBg44KSMaTTmFZWNSJwTbzrI8HmKe+C8Ke6ztXYpHdsirXrXE 5VyLZeV50VoiflD9/hLnBmrxraH+rApStQm7jRyI= 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.5 004/176] net: macb: ensure interface is not suspended on at91rm9200 Date: Tue, 3 Mar 2020 18:41:08 +0100 Message-Id: <20200303174305.086161039@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200303174304.593872177@linuxfoundation.org> References: <20200303174304.593872177@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 @@ -3751,6 +3751,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)); @@ -3815,7 +3819,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 */