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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87D99C433F5 for ; Tue, 14 Dec 2021 18:55:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237199AbhLNSzK (ORCPT ); Tue, 14 Dec 2021 13:55:10 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:54936 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229441AbhLNSzK (ORCPT ); Tue, 14 Dec 2021 13:55:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=xI0do2HFpY4bOgtySrFnnpUGU3UNw1oNzn3oDrvpjSo=; b=00sXeakN5qQx7sYRkgCBzuISFH vrpaugQ4HLeOpWk7mPZBjLjQeUY5sEe8SUM6Zk6c4eNfq2fXMynsmc7VUQxwOUEcm6va4zlQvSLoP CzD92tW/EVVxtQfifVSmUpZYvkRS2mNA6yWFI9AsWten9OjcK0KAXVovZQifzIVhUyN4=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1mxCww-00GYVJ-TU; Tue, 14 Dec 2021 19:54:54 +0100 Date: Tue, 14 Dec 2021 19:54:54 +0100 From: Andrew Lunn To: Philippe Schenker Cc: netdev@vger.kernel.org, Joakim Zhang , "David S . Miller" , Russell King , Heiner Kallweit , Francesco Dolcini , Jakub Kicinski , Fabio Estevam , Fugang Duan , linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next 3/3] net: fec: reset phy on resume after power-up Message-ID: References: <20211214121638.138784-1-philippe.schenker@toradex.com> <20211214121638.138784-4-philippe.schenker@toradex.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211214121638.138784-4-philippe.schenker@toradex.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Tue, Dec 14, 2021 at 01:16:38PM +0100, Philippe Schenker wrote: > Reset the eth PHY after resume in case the power was switched off > during suspend, this is required by some PHYs if the reset signal > is controlled by software. > > Signed-off-by: Philippe Schenker > > --- > > drivers/net/ethernet/freescale/fec_main.c | 1 + Hi Philippe What i don't particularly like about this is that the MAC driver is doing it. Meaning if this PHY is used with any other MAC, the same code needs adding there. Is there a way we can put this into phylib? Maybe as part of phy_init_hw()? Humm, actually, thinking aloud: int phy_init_hw(struct phy_device *phydev) { int ret = 0; /* Deassert the reset signal */ phy_device_reset(phydev, 0); So maybe in the phy driver, add a suspend handler, which asserts the reset. This call here will take it out of reset, so applying the reset you need? Andrew