Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp805285pxb; Tue, 3 Nov 2020 13:02:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJwxNA/ksAtHYkUe9iS8x5HiOo8al0Nbh7YJSqqW3OtXNbAaxc4PavBaVez/wEm9AjxbP6Vj X-Received: by 2002:a17:906:2490:: with SMTP id e16mr21467991ejb.17.1604437359035; Tue, 03 Nov 2020 13:02:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604437359; cv=none; d=google.com; s=arc-20160816; b=x8heSOg6jyqjTE5g0qj1W9aGOXlkHl5RpYblsqXXCzBTg5so0JyGmdWYzRkZPBjIaQ xEHLlUV/f5EBDowb16FYFxj1q+O2Oh8+021hnipJoCllBgcj0jhxyo7u5qH+ipfHGZd5 kr4QCUafQP/w2ZxkWeQST/CcSdJX6xGU8FSVL1J80vVQPMPn/b3VRH1rZihcX37QiwGa ck96v66T6iXUZQ0rFaQ14wrZ6HZlxrORoF7m0wzUraLpxgjmqcvUpWupR4fgbe5moxci y1ytb1/zV7xFwrfMZUHI9hsoXrGsJl3LTWMUyYr+g8ZGH1xC+J70Mz4BPL+b8arWP/h7 rJ7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7mM90JPlcdXscSkNEGaVz77OY7gk3g4Ds6o5K8EJiSE=; b=qggZj3A73IYatzkLerCQrRmqzPNxwfjgCK29Y7KREUK48JXBpOfLex8VNfGOsgyHq2 K1BQeN8bVy7B9f/eGeDqfhuREBhv1w5FdsrTHpxQmt9GNTvWc3721DUY+1V/OzuwQdYu 9mfSjj6cpLUvOczRrNJ8SCbImb8lnaGQ1XBQqV44ryHtr7Cyz7WuKmCPE1HKwmpqJiTy 4osIfshSS+yFOYapnQavXMJY9YMCJQV7QAlvP2VF46AW64YMfMiG9ydSOIgCqN1UuFkX 58dEOK01l4lANYmdtHAxlbb+B1P6/fvg7BzzaPgqdMhy0/Jh+ZzHMolHmUndc3VTgyX2 c0Ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=P4G9YvYf; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z11si1510934edr.547.2020.11.03.13.02.14; Tue, 03 Nov 2020 13:02:39 -0800 (PST) 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=@kernel.org header.s=default header.b=P4G9YvYf; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731785AbgKCVAz (ORCPT + 99 others); Tue, 3 Nov 2020 16:00:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:36990 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733299AbgKCVAw (ORCPT ); Tue, 3 Nov 2020 16:00:52 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EE4F6223C6; Tue, 3 Nov 2020 21:00:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604437252; bh=Xp+s0qFGDYIdDukD8ju0XndnfYTbUFMFkrWTjs2Lafg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P4G9YvYfJWXZutRT6wU4QQVSW6dgq832QwRMlqtF8c8ytYJZLFK0S/6F7H/6hGrqM QIFxNPHvjHCLYku3eRmcIILVqdpQfAGkX+SkOW2sgDk9GL9sloICMKqLE7doCTMPYN RZ2sNgYkGcKkpPH2aQB3St+jKqZ9CNTDaKB2BEyc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alexander Sverdlin Subject: [PATCH 5.4 212/214] staging: octeon: repair "fixed-link" support Date: Tue, 3 Nov 2020 21:37:40 +0100 Message-Id: <20201103203310.458025442@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201103203249.448706377@linuxfoundation.org> References: <20201103203249.448706377@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexander Sverdlin commit 179f5dc36b0a1aa31538d7d8823deb65c39847b3 upstream. The PHYs must be registered once in device probe function, not in device open callback because it's only possible to register them once. Fixes: a25e278020bf ("staging: octeon: support fixed-link phys") Signed-off-by: Alexander Sverdlin Cc: stable Link: https://lore.kernel.org/r/20201016101858.11374-1-alexander.sverdlin@nokia.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/octeon/ethernet-mdio.c | 6 ------ drivers/staging/octeon/ethernet.c | 9 +++++++++ 2 files changed, 9 insertions(+), 6 deletions(-) --- a/drivers/staging/octeon/ethernet-mdio.c +++ b/drivers/staging/octeon/ethernet-mdio.c @@ -147,12 +147,6 @@ int cvm_oct_phy_setup_device(struct net_ phy_node = of_parse_phandle(priv->of_node, "phy-handle", 0); if (!phy_node && of_phy_is_fixed_link(priv->of_node)) { - int rc; - - rc = of_phy_register_fixed_link(priv->of_node); - if (rc) - return rc; - phy_node = of_node_get(priv->of_node); } if (!phy_node) --- a/drivers/staging/octeon/ethernet.c +++ b/drivers/staging/octeon/ethernet.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -894,6 +895,14 @@ static int cvm_oct_probe(struct platform break; } + if (priv->of_node && of_phy_is_fixed_link(priv->of_node)) { + if (of_phy_register_fixed_link(priv->of_node)) { + netdev_err(dev, "Failed to register fixed link for interface %d, port %d\n", + interface, priv->port); + dev->netdev_ops = NULL; + } + } + if (!dev->netdev_ops) { free_netdev(dev); } else if (register_netdev(dev) < 0) {