Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp895747pxb; Tue, 1 Feb 2022 12:40:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJy2OsDdJ1lcVjA4qpBzoRgtGO0xO4AzTNwl9y8AfpdHfnPsjuV8ffQeUVaie5jtcWnz+Ewl X-Received: by 2002:a17:902:c40b:: with SMTP id k11mr27031836plk.94.1643748010902; Tue, 01 Feb 2022 12:40:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643748010; cv=none; d=google.com; s=arc-20160816; b=coIDsJoCTIl7y3ij8YoPiyjd9x95AHsEZZtv2mxKGdWWgrx+8Uxp3OplxoL5FEdM3M 6OSEozsadPELpAEfljYQoCqzNi1bRht07yxZkLItn07bDTDwAALkyCrzfUBjAxU1k3hQ z1gdGkZxkctPNb/ZI0iCFJ5Ywe6FKuC6sZ3Lg/Fcv+bIZqSt9gernPsg+wFZjA2hDoyE lHcMTab1Wvc5PAQZxjMCCxZa6bRSO++YrgW0a8s28xvadlwd9KLEb7Ku2PmXqCs7wznE RdcSZCfayAlafdwaxeY151xbSY9+Qj6OaLvaXmJxiIL7b3TLV1GJL7BmW4kMPHQVko5U KHyQ== 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=rh3zzrjG4eJ4zkltSxTz4v948/fJYDk5vDVefUcxqXg=; b=saazKwR+qnZatEjGrrncv1C7rKTTrh191QpdskpK0u4tOGmYdGHuVOQB8F/PG3fSQ2 vsHKjIjJkxfaZWuljEtvJthahjTdTq65VKgBsLgAz4SSqpMT5AAcB7FwBsO1FXeX+U5z xV9JxssNBkquvwcHHPZpvU7V8hEJDq+gCLQ4V4VfXVkxaZllYdzYgUMnjyKoXVHvKBYP JoSJQzODloIoUt5Xs1b/rGdH+Va9WVdNZnIjFbPaHN9vbiBBJwV8EtTivVbmsPjNS5oZ tBrkkUFpfLNRyWAcXVK3YtJyFDhuZU8gud/+35DEw0EF+hY2aayFWIoXKqoqEtrgnD0I x8UA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@earth.li header.s=the header.b=ABwLh8yi; 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 mu14si3766525pjb.118.2022.02.01.12.39.58; Tue, 01 Feb 2022 12:40:10 -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=fail header.i=@earth.li header.s=the header.b=ABwLh8yi; 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 S1378383AbiAaN44 (ORCPT + 99 others); Mon, 31 Jan 2022 08:56:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348874AbiAaN4w (ORCPT ); Mon, 31 Jan 2022 08:56:52 -0500 Received: from the.earth.li (the.earth.li [IPv6:2a00:1098:86:4d:c0ff:ee:15:900d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42A0DC061714; Mon, 31 Jan 2022 05:56:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=earth.li; s=the; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject: Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=rh3zzrjG4eJ4zkltSxTz4v948/fJYDk5vDVefUcxqXg=; b=ABwLh8yiWuo+TYuERG9ne33ID5 ksC/jxl5wpEwaODztO3KksEZC3vQl86EWJsshXS8ALGQ5K5eTCZGAu5XABSJsmcgVNHGLDOi2XRYZ mUDpO/GCDAScx33uZACIK3OItyizI+1NwvlyxrE8cpaJKp9hZdbvsRTs+77kQCgI2q4oRz7ibk/zg 9enGMBBytBUgoSmso6Pudw750dktfu8IZg0SNm+SsfQJLvGBCggI+e6YBqVjJ66dXUflF3pUiLc2d 8+JirNc+0vkuSCP4GVen3AQWkKWCtUOnet1ZiIB9oA/MmK0LofxmilfOXGEqC9ANRhJlqkOEicZkq +1Mr3nDg==; Received: from noodles by the.earth.li with local (Exim 4.94.2) (envelope-from ) id 1nEXAf-00B0KI-AV; Mon, 31 Jan 2022 13:56:41 +0000 Date: Mon, 31 Jan 2022 13:56:41 +0000 From: Jonathan McDowell To: Andrew Lunn , Heiner Kallweit , Russell King , David Miller , Jakub Kicinski , Luo Jie Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Robert Marko Subject: [PATCH net v2] net: phy: Fix qca8081 with speeds lower than 2.5Gb/s Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A typo in qca808x_read_status means we try to set SMII mode on the port rather than SGMII when the link speed is not 2.5Gb/s. This results in no traffic due to the mismatch in configuration between the phy and the mac. v2: Only change interface mode when the link is up Fixes: 79c7bc0521545 ("net: phy: add qca8081 read_status") Cc: stable@vger.kernel.org Signed-off-by: Jonathan McDowell --- drivers/net/phy/at803x.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c index 5b6c0d120e09..29aa811af430 100644 --- a/drivers/net/phy/at803x.c +++ b/drivers/net/phy/at803x.c @@ -1688,19 +1688,19 @@ static int qca808x_read_status(struct phy_device *phydev) if (ret < 0) return ret; - if (phydev->link && phydev->speed == SPEED_2500) - phydev->interface = PHY_INTERFACE_MODE_2500BASEX; - else - phydev->interface = PHY_INTERFACE_MODE_SMII; - - /* generate seed as a lower random value to make PHY linked as SLAVE easily, - * except for master/slave configuration fault detected. - * the reason for not putting this code into the function link_change_notify is - * the corner case where the link partner is also the qca8081 PHY and the seed - * value is configured as the same value, the link can't be up and no link change - * occurs. - */ - if (!phydev->link) { + if (phydev->link) { + if (phydev->speed == SPEED_2500) + phydev->interface = PHY_INTERFACE_MODE_2500BASEX; + else + phydev->interface = PHY_INTERFACE_MODE_SGMII; + } else { + /* generate seed as a lower random value to make PHY linked as SLAVE easily, + * except for master/slave configuration fault detected. + * the reason for not putting this code into the function link_change_notify is + * the corner case where the link partner is also the qca8081 PHY and the seed + * value is configured as the same value, the link can't be up and no link change + * occurs. + */ if (phydev->master_slave_state == MASTER_SLAVE_STATE_ERR) { qca808x_phy_ms_seed_enable(phydev, false); } else { -- 2.30.2