From patchwork Tue Oct 20 15:06:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 288263 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=-13.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 808F9C388F2 for ; Tue, 20 Oct 2020 15:06:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3584E22265 for ; Tue, 20 Oct 2020 15:06:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603206386; bh=P59ZBcgLP9CaPsjS1lVVy9tVYMSJ5YRBakB2YG0Mwu8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=ueY5BKe07qSJsAXG6xHDsm1gvpsuZFcYXf0dmJMHl4kLuXG6QhJY1Efqhn8UNv9F4 57Pc6QRiyfEh3Dwab9D+/2vV4wBiEglJQ6ZPAD3XHiyJtUVnUQWM7ki86ChhdsrtWS bjfxe5lyBCaLjvV1xtO5Qi/qs8exF0vk5SP8Y7sM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2408439AbgJTPGZ (ORCPT ); Tue, 20 Oct 2020 11:06:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:38784 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727760AbgJTPGY (ORCPT ); Tue, 20 Oct 2020 11:06:24 -0400 Received: from dellmb.labs.office.nic.cz (nat-1.nic.cz [217.31.205.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1972F22258; Tue, 20 Oct 2020 15:06:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603206384; bh=P59ZBcgLP9CaPsjS1lVVy9tVYMSJ5YRBakB2YG0Mwu8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2MAw9KgdqLL6Mi1UCm+lBlGpgCeLX1bKhAS3/MOPg+RPvmbMjGNJx3NY/gz0/MAjH 4doU2NzkTUK+5r02YLcTo8w2pJGFWWMiAeW63D8eEdhhA4VNvNToUNAXi7tfMkEUtM S3ax1PQc8fAWOwkbr5VrYAUFDFbAG8Ue9vMHh9UI= From: =?utf-8?q?Marek_Beh=C3=BAn?= To: Russell King - ARM Linux admin Cc: netdev@vger.kernel.org, Andrew Lunn , =?utf-8?q?Marek_?= =?utf-8?b?QmVow7pu?= Subject: [PATCH russell-kings-net-queue v2 3/3] net: phylink: don't fail attaching phy on 1000base-x/2500base-x mode Date: Tue, 20 Oct 2020 17:06:15 +0200 Message-Id: <20201020150615.11969-4-kabel@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201020150615.11969-1-kabel@kernel.org> References: <20201020150615.11969-1-kabel@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Some SFPs may contain an internal PHY which may in some cases want to connect with the host interface in 1000base-x/2500base-x mode. Do not fail if such PHY is being attached in one of these PHY interface modes. Signed-off-by: Marek BehĂșn --- drivers/net/phy/phylink.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index 6680de39e338..37b40db04526 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -1017,9 +1017,7 @@ static int phylink_bringup_phy(struct phylink *pl, struct phy_device *phy, static int phylink_attach_phy(struct phylink *pl, struct phy_device *phy, phy_interface_t interface) { - if (WARN_ON(pl->cfg_link_an_mode == MLO_AN_FIXED || - (pl->cfg_link_an_mode == MLO_AN_INBAND && - phy_interface_mode_is_8023z(interface)))) + if (WARN_ON(pl->cfg_link_an_mode == MLO_AN_FIXED)) return -EINVAL; if (pl->phydev)