From patchwork Thu Jan 17 11:05:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Shimoda X-Patchwork-Id: 10767917 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8A79D14E5 for ; Thu, 17 Jan 2019 11:08:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A5132A476 for ; Thu, 17 Jan 2019 11:08:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6EF082AC72; Thu, 17 Jan 2019 11:08:12 +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.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 3F5562B512 for ; Thu, 17 Jan 2019 11:08:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728260AbfAQLIG (ORCPT ); Thu, 17 Jan 2019 06:08:06 -0500 Received: from relmlor2.renesas.com ([210.160.252.172]:15966 "EHLO relmlie6.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725990AbfAQLIF (ORCPT ); Thu, 17 Jan 2019 06:08:05 -0500 X-IronPort-AV: E=Sophos;i="5.56,488,1539615600"; d="scan'208";a="5246345" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 17 Jan 2019 20:08:03 +0900 Received: from localhost.localdomain (unknown [10.166.17.210]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id BDCB944A15F3; Thu, 17 Jan 2019 20:08:03 +0900 (JST) From: Yoshihiro Shimoda To: andrew@lunn.ch, f.fainelli@gmail.com, davem@davemloft.net Cc: netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org, devicetree@vger.kernel.org, Yoshihiro Shimoda Subject: [PATCH v3/RFT 0/2] net: phy: assert the phy reset during suspended if phy is not attached Date: Thu, 17 Jan 2019 20:05:07 +0900 Message-Id: <1547723109-28792-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> X-Mailer: git-send-email 1.9.1 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 This patch series is for R-Car Gen3 Salvator-XS boards. If we do the following method, the phy cannot link up correctly. 1) Kernel boots by using initramfs. --> No open the nic, so phy_device_register() and phy_probe() deasserts the reset. 2) Kernel enters the suspend. --> So, keep the reset signal as deassert. --> On R-Car Salvator-XS board, unfortunately, the board power is turned off. 3) Kernel returns from suspend. 4) ifconfig eth0 up --> Then, since edge signal of the reset doesn't happen, it cannot link up. 5) ifconfig eth0 down 6) ifconfig eth0 up --> In this case, it can link up. Changes from v2: - Rebase on the latest net-next. - More generic code instead of micrel phy only code (https://www.spinics.net/lists/netdev/msg540462.html). So, I marked this patch series as RFT. Changes from v1 (as RFC): - No remove the current code of phy_device.c to avoid any side effects. - Fix the mdio_bus_phy_resume() in phy_device.c. - Add toggling the phy reset in micrel.c if the PHY is not attached. Yoshihiro Shimoda (2): net: phy: Fix not to call phy_resume() if PHY is not attached net: phy: assert the phy reset during suspended if phy is not attached drivers/net/phy/phy_device.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-)