From patchwork Wed Oct 28 22:14:24 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: 311328 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,URIBL_BLOCKED,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 C6BE8C4363A for ; Wed, 28 Oct 2020 22:14:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7BC2224171 for ; Wed, 28 Oct 2020 22:14:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603923279; bh=/Y1YcgJEnITrM+UgkNFYD7JnHEHOoxCPlRY/J1OzAZA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Y+JdoUPQ1Da6hTWouGoJiYeyR64Finoj22WRsm8ZTmYyIKGH5OQRPGCFlwI14zqPz NQt0/Hi97OBIXZ3Rt8PLluv1FLkBMCHU8mjN+gQS5hb1r5BvSJTOijP43dRNpTSIDi +hmx6xo2+ze/pJCQcUpjvH9bi1eCPcGCjLNZKcCY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731245AbgJ1WOi (ORCPT ); Wed, 28 Oct 2020 18:14:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:58110 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731223AbgJ1WOg (ORCPT ); Wed, 28 Oct 2020 18:14:36 -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 67F2324743; Wed, 28 Oct 2020 22:14:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603923275; bh=/Y1YcgJEnITrM+UgkNFYD7JnHEHOoxCPlRY/J1OzAZA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DeznzlD0RfhA9GQvgUcCKGZa9hAxHYxcYwK0X8TDO4mdq4CQKeavFb+kkAlktY1Sf NjX6L4L/Trvho+ZrVozSX9vcF96BofpIi/Z7vU764Wk5Nt0jk5eLFfxY+YQV66HfzD aNIe0APoXJhrftTqiM7D8R4kafGq4HXE2QtSzhxE= From: =?utf-8?q?Marek_Beh=C3=BAn?= To: netdev@vger.kernel.org Cc: davem@davemloft.net, =?utf-8?q?Marek_Beh=C3=BAn?= , Andrew Lunn , Russell King Subject: [PATCH net-next 2/5] net: phylink: allow attaching phy for SFP modules on 802.3z mode Date: Wed, 28 Oct 2020 23:14:24 +0100 Message-Id: <20201028221427.22968-3-kabel@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201028221427.22968-1-kabel@kernel.org> References: <20201028221427.22968-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 Cc: Andrew Lunn Cc: Russell King --- drivers/net/phy/phylink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c index 5d8c015bc9f2..52954f12ca5e 100644 --- a/drivers/net/phy/phylink.c +++ b/drivers/net/phy/phylink.c @@ -1018,7 +1018,7 @@ static int phylink_attach_phy(struct phylink *pl, struct phy_device *phy, { 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)))) + phy_interface_mode_is_8023z(interface) && !pl->sfp_bus))) return -EINVAL; if (pl->phydev)