Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1499066pxj; Fri, 4 Jun 2021 16:42:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw0t7hnxfxzfBTNEtdYZqCW4TnSKIdwrmfEtbVNi5xtxZiI5pZa65499hLLK4F3EabwtvTY X-Received: by 2002:a05:6402:220e:: with SMTP id cq14mr7433328edb.57.1622850169447; Fri, 04 Jun 2021 16:42:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622850169; cv=none; d=google.com; s=arc-20160816; b=JrVCsxz23d8Y9/jT/tu8Ck/mNLUIcYMY4ThwWXd33od77YUIafsB7Resl+8QAN4I+9 ZcJ9A5tqpkiKH66SkpYonN0Ji2VTTIHqnGMtT2Afvc8tBpVOuTGbsEqrUWaxOzeB9f6C s1GWSySUa7jNhUYVBi8zzg3PETNZhXOGLElB2EdzwDfP3n6Fhd8b0iQhEvGyJ0nVQIE0 8YusxwhiDNSDzVinqTWv17FDvmJuUclT2ZUfOTQvph6svJpkiJhRoEadrI53EtMqndDw vKgEH/VwcqfHjzEZOzLXfzPKFEGC0k5IiZHKWv3073LVtL6ndd75J4Gp3Nxk+/Dar6zi f1qQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=teq76F1L+vznO9dqAxiuiuGN4JsSwry7FJ5qogca0Mc=; b=yWh22PfTODry15K7VhcStQuDTRs/8ett/q2QbuvWk9ZNn8hdOkdwkz6iVDlFuinXdG zfZFZBvs6xgyCBSOGDLPDyvbAw+RvGEWxgGNXAbWvQ+sjCo003tzOiy5qFRuUsXsTc+8 hVUXvkQxLPufqNkNJj2lWxF3m2GwV5ln8srRGzBUkajQO4U5g/mPOkVVy17em7Y8diE6 Y7Sv0ZfP0j/x2Roez9dffmwT291h2nQxbIIsmd+SP3Ic3tlDRRijEexaRbWJvTUp4QTF 4bI1ektDfRRI+lWfPzN97ReYipp92ruT912LB8hbisHLPDeIYJIm9JhZgcv/+fA/c11r gywA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=lYBFk45n; 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 e21si5770119ejl.255.2021.06.04.16.42.25; Fri, 04 Jun 2021 16:42:49 -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; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=lYBFk45n; 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 S230214AbhFDXnI (ORCPT + 99 others); Fri, 4 Jun 2021 19:43:08 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:46442 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229847AbhFDXnI (ORCPT ); Fri, 4 Jun 2021 19:43:08 -0400 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=teq76F1L+vznO9dqAxiuiuGN4JsSwry7FJ5qogca0Mc=; b=lYBFk45noY7CbcsbIsOxD1/iPw elbOkYUn/juRIzIbjNoRQ9MrvIVpfoemozWdO3SLgVGGVxLpM6jdZsA576iMy/+yiCx/NW7zKm8wx enMcB3LfbmwCjIFxTmuY/j8zqrZAnOHEs5gQP7AIRQhR5ySfJSFKOaW6m0hoX2XSs1Ao=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1lpJRD-007sRw-D7; Sat, 05 Jun 2021 01:41:15 +0200 Date: Sat, 5 Jun 2021 01:41:15 +0200 From: Andrew Lunn To: Oleksij Rempel Cc: "David S. Miller" , Jakub Kicinski , Heiner Kallweit , Russell King , kernel@pengutronix.de, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH net-next v1 7/7] usbnet: run unbind() before unregister_netdev() Message-ID: References: <20210604134244.2467-1-o.rempel@pengutronix.de> <20210604134244.2467-8-o.rempel@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210604134244.2467-8-o.rempel@pengutronix.de> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 04, 2021 at 03:42:44PM +0200, Oleksij Rempel wrote: > unbind() is the proper place to disconnect PHY, but it will fail if > netdev is already unregistered. O.K, this partially answers the question i was about to ask for the previous patch. void phy_start(struct phy_device *phydev) { mutex_lock(&phydev->lock); if (phydev->state != PHY_READY && phydev->state != PHY_HALTED) { WARN(1, "called from state %s\n", phy_state_to_str(phydev->state)); goto out; } By skipping phy_error(), phydev->state is not set to PHY_HALTED. So if you try to start the phy again, without disconnecting it, it looks like there could be a problem. But with this patch, i assume the PHY will always be disconnected and later reconnected when the device is replugged. Andrew