Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1220338pxv; Thu, 1 Jul 2021 21:18:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxmzp6HbbMR8gcPy8exKTyvGhxXahRnuaMZNj6swS+kCrTJDsCNPWewqKSBdCijC91efjFn X-Received: by 2002:a05:6402:1c11:: with SMTP id ck17mr4119870edb.370.1625199490064; Thu, 01 Jul 2021 21:18:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625199490; cv=none; d=google.com; s=arc-20160816; b=fEfscX4fWwHpzNh6iDaYuWtLtCLsLIdji5nr4WU7JktQO3RD7rRq7FMU+zar64RoVD t0Emn7o9yeWcuJtCu2P72Syxr9PDipxuk790puUuFJxxwYO6IFgjqRtRsSE6H8Fo5uro WH5vQxKVYVKUVJwEX/O8YTwFaLkxrRV/SIO//elfK2FWJZ/MnSCZTzcZfwG4MCHEljU0 PmeU3ZCdyU9T3Q6TC6brdnE55BStzOxHz2RXC9EJoZ2Aa+5l1vDs34rcI8od2nE4SOKo Nu8XpkV/eqHQGR72zpWg5kt8/rW37JypWdZgWSSj5Sit+V8VU39iPPoYAbNRwB7p8aUt /2qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=fl+J4VZRZRMzAYz9FIO5LAFaAMcrdPMRNwh8Cq9jvm8=; b=nZS67mtsFkqv7D/fx8cY1X22zbxXJ/NKLisQXleTzXcAdRgPqCayQCeMV6YyPfuvP0 2hAOeGC1osrD2cOuVBZIA6ugxzcW6sXgeRjgpu6D0dnqGL9l7Ftu/IcVGUNZcjLG0rIe FuZDH2E5iP43tIrdU7heGqV3EDFWSnQUDH3TASclQIClUzPGmpb3VorIQav6jY1tsyK1 gOHGs4SjS9y5LesO+TuMDjMQm72S8Hyf7zYPaztWgJnThCECEHpcIBCnycjarjDy7omq SJZQIEOUhS1GlKKLqnwE/UBieAxgfNPQmDSqTeOyt+f0q1qvVT6NDKqayCiG22Hoth50 lctg== 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 b10si1876670eds.570.2021.07.01.21.17.45; Thu, 01 Jul 2021 21:18:10 -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 S234853AbhGBD4e (ORCPT + 99 others); Thu, 1 Jul 2021 23:56:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234758AbhGBD4a (ORCPT ); Thu, 1 Jul 2021 23:56:30 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0D52C061762 for ; Thu, 1 Jul 2021 20:53:58 -0700 (PDT) Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lzAFL-00021A-VA; Fri, 02 Jul 2021 05:53:43 +0200 Received: from ore by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1lzAFI-0002yt-Au; Fri, 02 Jul 2021 05:53:40 +0200 Date: Fri, 2 Jul 2021 05:53:40 +0200 From: Oleksij Rempel To: Florian Fainelli Cc: "David S. Miller" , Jakub Kicinski , Andrew Lunn , Heiner Kallweit , Russell King , Marek Szyprowski , kernel@pengutronix.de, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH net-next v1 1/1] net: usb: asix: ax88772: suspend PHY on driver probe Message-ID: <20210702035340.sdoc5dqpuo4cgsqe@pengutronix.de> References: <20210629044305.32322-1-o.rempel@pengutronix.de> <931f10ca-2d81-8264-950c-8d29c18a7b35@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <931f10ca-2d81-8264-950c-8d29c18a7b35@gmail.com> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 05:41:20 up 211 days, 17:47, 35 users, load average: 0.00, 0.04, 0.00 User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 01, 2021 at 12:01:04PM -0700, Florian Fainelli wrote: > On 6/28/21 9:43 PM, Oleksij Rempel wrote: > > After probe/bind sequence is the PHY in active state, even if interface > > is stopped. As result, on some systems like Samsung Exynos5250 SoC based Arndale > > board, the ASIX PHY will be able to negotiate the link but fail to > > transmit the data. > > > > To handle it, suspend the PHY on probe. > > Very unusual, could not the PHY be attached/connected to a ndo_open() > time like what most drivers do? May be this can be done to. But, should not the PHY be in the same state after phy_connect() and after phy_stop()? Currently, phy_connect() and phy_start() resume the PHY. The phy_stop() is suspending it. Since the driver calls phy_connect(), phy_start() and phy_stop(), the resume/suspend state is out of balance. In case some one will add for example something like regulator_enable/disable callbacks in to phydev->syspend/resume callbacks, this would never work. So, the question is, should phy_connect() put the PHY back in to suspend mode? Or should the MAC driver take care of this? > > > > Fixes: e532a096be0e ("net: usb: asix: ax88772: add phylib support") > > Signed-off-by: Oleksij Rempel > > Reported-by: Marek Szyprowski > > Tested-by: Marek Szyprowski > > --- > > drivers/net/usb/asix_devices.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/drivers/net/usb/asix_devices.c b/drivers/net/usb/asix_devices.c > > index aec97b021a73..2c115216420a 100644 > > --- a/drivers/net/usb/asix_devices.c > > +++ b/drivers/net/usb/asix_devices.c > > @@ -701,6 +701,7 @@ static int ax88772_init_phy(struct usbnet *dev) > > return ret; > > } > > > > + phy_suspend(priv->phydev); > > priv->phydev->mac_managed_pm = 1; > > > > phy_attached_info(priv->phydev); > > > > > -- > Florian > Regards, Oleksij -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |