Received: by 10.213.65.68 with SMTP id h4csp1488589imn; Thu, 15 Mar 2018 00:37:35 -0700 (PDT) X-Google-Smtp-Source: AG47ELuIsj1+qJkS4UOfEDA9l6tiZyTvhd5pMcOMQI71Qf4RO+ddZ9PG3+D0Iild6KplH7e0t+bA X-Received: by 2002:a17:902:2e43:: with SMTP id q61-v6mr6888731plb.404.1521099455544; Thu, 15 Mar 2018 00:37:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521099455; cv=none; d=google.com; s=arc-20160816; b=RDtXCJtGepRUKImP0rKL0RcDcrXv8lzvBOUVaeBl/fivA9mxaNt/wfxYlCPqLjr5lN uhuGzuexuN8ZnkN1BLwNpPCoFFQT9gizV+hfDoRqvj8Tv72Hibe6wn/T6vlna1/5lKo1 D2FVb2Vbn+QE17VUY9/Qd/dbsCs6touRE4a4YrGYb4Vz26yg4FukdBZ4sz3SZT9NScTx 7R0ymTj/jufapftMnVx4Bbqu+fuWGVp5VKQvv3lXx4eb9DFuxmJ9oWHMR4LW29bps2fr w0e4VxOR3pJ2zyqT77crMo8RlyIGEAR0VDfh5I1aaHK1MoL/WUgGcpeDEonDb6uZ6Ub5 neRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from :arc-authentication-results; bh=X5MUZWFbSKJdeU84I/zrnSs3bxqL+lSVNRu21CIkxW8=; b=xdckcUvlHgQAREc+sPG7BduIIJ26zAZC19asOsfTOw9s/haXSLiSVSnqSli08bMGFm kfhPCOyfIHKvGc3u5ycYGINZGr4E3TcvE+NxGuYMKYrQew7TFMMu1SyUi7w8dzQr9Gg/ a7ZEsfr9uaWxc/n/q4bWES3Ny54c3uiBtrX5xA+zDxoipXIEst0+/RjNfJBcW4YXc6dj 9OxO0ULxDGv+NdsEYP7EoRb2KDMwOBInqgT+rgoOGOJzdBth5xUOPbBJ0SOpvUD5/vRn og+iu0rCm5dZyiOhD7gv8ZhhjAM9Xiv9dk4bjj9YW+PTax3mxLhWP0WehV+evDh1PPxi zesA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a6-v6si845599pls.469.2018.03.15.00.37.20; Thu, 15 Mar 2018 00:37:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751988AbeCOHgc convert rfc822-to-8bit (ORCPT + 99 others); Thu, 15 Mar 2018 03:36:32 -0400 Received: from esa4.microchip.iphmx.com ([68.232.154.123]:9315 "EHLO esa4.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751653AbeCOHga (ORCPT ); Thu, 15 Mar 2018 03:36:30 -0400 X-IronPort-AV: E=Sophos;i="5.48,308,1517900400"; d="scan'208";a="12107666" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa4.microchip.iphmx.com with ESMTP/TLS/AES128-SHA; 15 Mar 2018 00:36:30 -0700 Received: from CHN-SV-EXMX03.mchp-main.com ([fe80::58f5:b949:4b1:3df4]) by CHN-SV-EXCH01.mchp-main.com ([fe80::9840:ffdf:ec5:1335%29]) with mapi id 14.03.0352.000; Thu, 15 Mar 2018 00:36:29 -0700 From: To: , CC: , , , , , Subject: RE: [PATCH] lan78xx: Connect phy early Thread-Topic: [PATCH] lan78xx: Connect phy early Thread-Index: AQHTu6RtRKCcnT2O9k2lhCneqxr8AaPQ3VhQ Date: Thu, 15 Mar 2018 07:36:29 +0000 Message-ID: References: <20180314145456.69029-1-agraf@suse.de> In-Reply-To: <20180314145456.69029-1-agraf@suse.de> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.10.76.4] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Alexander, Thanks for the patch. > @@ -2575,13 +2571,7 @@ static int lan78xx_stop(struct net_device *net) > if (timer_pending(&dev->stat_monitor)) > del_timer_sync(&dev->stat_monitor); > > - phy_unregister_fixup_for_uid(PHY_KSZ9031RNX, 0xfffffff0); > - phy_unregister_fixup_for_uid(PHY_LAN8835, 0xfffffff0); > - > phy_stop(net->phydev); > - phy_disconnect(net->phydev); > - > - net->phydev = NULL; > > clear_bit(EVENT_DEV_OPEN, &dev->flags); > netif_stop_queue(net); Please do add valid "phydev" check before phy_stop, since "phy_disconnect" should be called before "unregister_netdev" + if (net->phydev) phy_stop(net->phydev); > @@ -3481,6 +3471,11 @@ static void lan78xx_disconnect(struct > usb_interface *intf) > net = dev->net; > unregister_netdev(net); > > + phy_unregister_fixup_for_uid(PHY_KSZ9031RNX, 0xfffffff0); > + phy_unregister_fixup_for_uid(PHY_LAN8835, 0xfffffff0); > + > + phy_disconnect(net->phydev); > + > cancel_delayed_work_sync(&dev->wq); > > usb_scuttle_anchored_urbs(&dev->deferred); Please move "unregister_netdev" after "phy_disconnect", otherwise "phy_disconnect" will fail while we disconnect USB. > @@ -3634,6 +3629,10 @@ static int lan78xx_probe(struct usb_interface > *intf, > pm_runtime_set_autosuspend_delay(&udev->dev, > DEFAULT_AUTOSUSPEND_DELAY); > > + ret = lan78xx_phy_init(dev); > + if (ret < 0) > + return ret; > + > return 0; > > out3: > -- > 2.12.3 We should "goto out4" instead of "return" upon "lan78xx_phy_init" fail + out4: + unregister_netdev(netdev); In addition to current changes, you might have to take care of the following. In function "lan78xx_reset_resume" - lan78xx_phy_init(dev); + phy_start(dev->net->phydev); Thanks, Sd.Nisar