Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3207551pxb; Mon, 9 Nov 2020 05:36:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJwZO9/8FlCOugqnZJQyD7QsVPFEmLgnt0jp4rByURiUWsOLvAUPpmKHBC0Jj0sRDNWLEa++ X-Received: by 2002:a17:906:fcdb:: with SMTP id qx27mr15285801ejb.470.1604929016175; Mon, 09 Nov 2020 05:36:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604929016; cv=none; d=google.com; s=arc-20160816; b=d1m8X2AgowZrZHYD3XRVIoEUw20mpcvJqj2/LxfL4J7NhH8oDqufhqP3aegHrVB52T JIB+XjR4N8v5J42/yZQ+KGNlK7IXYc74SX3SgSR5TOqa9g5hCnVsqLTibP60jdfVt982 IjiVkCySKN/PFJQjiK5UaX/lzL/SGWCssV4TImkSZpiGGfBPx4vMbVx4ry1fq61NJg5X 5vqCTgaHwK5bHBkUGAzREWaPAif4MIId5SHzyutiSaaBEhA7vKPU6+tr9Z0ENJAFOs7G a6As6sGWXblgli4IAjzKk+xDauNk3EdDmEbrFdkNDSISoBngEJchwCdXyZsLm+a0Fs5D f5PQ== 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=vng//OqheY0/S7k+AuGCNb0BYfhdVyF8nlbqnurThoA=; b=xyVWZCIHCvho+7VSdTi5u402bgoArxbpwsbQ0yA/wdPkLZDG6AKFaK6B8I5sl3uMOO LixHcHBnJuy4HRHLknAFPVgAK11sh9jvbzsulgFbmsB8YkWZLoQ1Ry+BVVu4mi5vFN8W 21hQtjg1LBLqud/u+qIMWnem8Ff4LzWgJCVyxbQ4Te83Ow3HbWZTJgWbpHBKlnaMuvgd 1EHYcKes8OpULpZ6WRggu61OlMEjPDEYABPfHxOL4CGb1NmNubgr+i9R/3JY9mPvZacu YTX2/ZmLpfHn3IaomuxKhLPd701Z1EqKI5rwwzlKGHCKWCLVRudl8VHeHkWIpbCpHbIk /lLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HlJ5m1Ik; 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 hr40si1550655ejc.353.2020.11.09.05.36.33; Mon, 09 Nov 2020 05:36:56 -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=HlJ5m1Ik; 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 S1730860AbgKINF1 (ORCPT + 99 others); Mon, 9 Nov 2020 08:05:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:57140 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730404AbgKIND6 (ORCPT ); Mon, 9 Nov 2020 08:03:58 -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 5FBF220789; Mon, 9 Nov 2020 13:03:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604927038; bh=+UAb6Q8UZdnojKcXbm3v29wGBw8dVGH9x1xn4P2U6aw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HlJ5m1Ik9MC8TzCmt1j0+ScpTwUmogxpw1rVnpH7NNehEWUkltS62wMZ4Gv1N7pLb Nk1OLEMn1/ZQqlKG1jmH/1UH++GoAy874d7mf7zv1TNS+aAn9l50YOZ8WeSen/YWx9 BnQHBHb/65iNvnCTgAvLlo7TQhSvlB5XeOZsfUqE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alexander Sverdlin Subject: [PATCH 4.9 090/117] staging: octeon: repair "fixed-link" support Date: Mon, 9 Nov 2020 13:55:16 +0100 Message-Id: <20201109125029.964154797@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201109125025.630721781@linuxfoundation.org> References: <20201109125025.630721781@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 @@ -155,12 +155,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 @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -880,6 +881,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) {