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 X-Spam-Level: X-Spam-Status: No, score=-3.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7F5FDC433E0 for ; Thu, 21 May 2020 15:19:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4317B20748 for ; Thu, 21 May 2020 15:19:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="4mbZlUQ6" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728303AbgEUPTU (ORCPT ); Thu, 21 May 2020 11:19:20 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:43080 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727898AbgEUPTU (ORCPT ); Thu, 21 May 2020 11:19:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=d4prlpe44iogc1YJ0dGlOCAaKDbp1fDXGQHsv13/mEA=; b=4mbZlUQ6qe7SgCuyqRbgqLgcmF MXZwmtOmPpn2Uk8jvHlBUDdbA1LUXY3M18m/jTKL8xTdPXX/KGDzPUWyx1JtGNlhfKEz0W2Fl3Euw Jd3XwQqALPHXyogcgDGnQSkBTSLDfanvVdshPffk6v3cmoDflvWnhnQnTj6+VhIh2FPc=; Received: from andrew by vps0.lunn.ch with local (Exim 4.93) (envelope-from ) id 1jbmya-002upw-29; Thu, 21 May 2020 17:19:16 +0200 Date: Thu, 21 May 2020 17:19:16 +0200 From: Andrew Lunn To: Daniel =?iso-8859-1?Q?Gonz=E1lez?= Cabanelas Cc: netdev@vger.kernel.org, davem@davemloft.net, thomas.petazzoni@bootlin.com, Russell King Subject: Re: [PATCH] net: mvneta: only do WoL speed down if the PHY is valid Message-ID: <20200521151916.GC677363@lunn.ch> References: <3268996.Ej3Lftc7GC@tool> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3268996.Ej3Lftc7GC@tool> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org > drivers/net/ethernet/marvell/mvneta.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c > index 41d2a0eac..f9170bc93 100644 > --- a/drivers/net/ethernet/marvell/mvneta.c > +++ b/drivers/net/ethernet/marvell/mvneta.c > @@ -3567,8 +3567,9 @@ static void mvneta_start_dev(struct mvneta_port *pp) > > phylink_start(pp->phylink); > > - /* We may have called phy_speed_down before */ > - phy_speed_up(pp->dev->phydev); > + if(pp->dev->phydev) > + /* We may have called phy_speed_down before */ > + phy_speed_up(pp->dev->phydev); I don't think it is as simple as this. You should not really be mixing phy_ and phylink_ calls within one driver. You might of noticed there are no other phy_ calls in this driver. So ideally you want to add phylink_ calls which do the right thing. Andrew