From patchwork Tue Apr 17 08:50:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 10344571 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E74C060542 for ; Tue, 17 Apr 2018 08:50:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D8AD328A04 for ; Tue, 17 Apr 2018 08:50:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CD92028A0B; Tue, 17 Apr 2018 08:50:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7392B28A04 for ; Tue, 17 Apr 2018 08:50:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752116AbeDQIu5 (ORCPT ); Tue, 17 Apr 2018 04:50:57 -0400 Received: from kirsty.vergenet.net ([202.4.237.240]:46723 "EHLO kirsty.vergenet.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752166AbeDQIux (ORCPT ); Tue, 17 Apr 2018 04:50:53 -0400 Received: from penelope.horms.nl (unknown [217.111.208.18]) by kirsty.vergenet.net (Postfix) with ESMTPA id 7D34B25BE0C; Tue, 17 Apr 2018 18:50:45 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=verge.net.au; s=mail; t=1523955045; bh=V+w94JPzB/Wo1gkFqFUV5LTfldka5dXyVbeM9s/x7rY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RRXM4oj7kdwYPdP8sVVn16bwXUmKJDgm+EBbu5+eTVTcuBFllopbtntMm1+BVQPMd XfEjScEz+XTj5v7BCh1KkETqeHC1L+X6uDLcHXvAs34BSb68QAF2NpH0BXONmFsWDO d6O5XbGPwOE/oXVtE3OVDlOh/itUQOlwziPYYmvo= Received: by penelope.horms.nl (Postfix, from userid 7100) id 837E5E21AFD; Tue, 17 Apr 2018 10:50:43 +0200 (CEST) From: Simon Horman To: Sergei Shtylyov Cc: Magnus Damm , netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Wolfram Sang , Kazuya Mizuguchi , Simon Horman Subject: [PATCH/RFC net-next 2/5] ravb: correct ptp does failure after suspend and resume Date: Tue, 17 Apr 2018 10:50:27 +0200 Message-Id: <20180417085030.32650-3-horms+renesas@verge.net.au> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180417085030.32650-1-horms+renesas@verge.net.au> References: <20180417085030.32650-1-horms+renesas@verge.net.au> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Kazuya Mizuguchi This patch fixes the problem that ptp4l command does not work after suspend and resume. Add the initial setting in ravb_suspend() and ravb_resume(), because ptp does not work. Fixes: a0d2f20650e8 ("Renesas Ethernet AVB PTP clock driver") Signed-off-by: Kazuya Mizuguchi Signed-off-by: Simon Horman Reviewed-by: Sergei Shtylyov --- drivers/net/ethernet/renesas/ravb_main.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index b311b1ac1286..dbde3d11458b 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -2295,6 +2295,9 @@ static int __maybe_unused ravb_suspend(struct device *dev) else ret = ravb_close(ndev); + if (priv->chip_id != RCAR_GEN2) + ravb_ptp_stop(ndev); + return ret; } @@ -2302,6 +2305,7 @@ static int __maybe_unused ravb_resume(struct device *dev) { struct net_device *ndev = dev_get_drvdata(dev); struct ravb_private *priv = netdev_priv(ndev); + struct platform_device *pdev = priv->pdev; int ret = 0; /* If WoL is enabled set reset mode to rearm the WoL logic */ @@ -2330,6 +2334,9 @@ static int __maybe_unused ravb_resume(struct device *dev) /* Restore descriptor base address table */ ravb_write(ndev, priv->desc_bat_dma, DBAT); + if (priv->chip_id != RCAR_GEN2) + ravb_ptp_init(ndev, pdev); + if (netif_running(ndev)) { if (priv->wol_enabled) { ret = ravb_wol_restore(ndev);