Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1475886pxb; Fri, 22 Jan 2021 17:39:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJxrSEmsTFnemR10R6hxvvqj6MTrmQadAbBzBUiDImtjuZj5WJZXoboXzKjaMYIzhrQIo+Ku X-Received: by 2002:aa7:cf8d:: with SMTP id z13mr5165581edx.119.1611365978340; Fri, 22 Jan 2021 17:39:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611365978; cv=none; d=google.com; s=arc-20160816; b=wMf4vkQuv2WTWHDa1JaN7xqxWj6QrWpXycj7TDcigfRboi1UcfVOc1l28wjdJuwzNJ 3fmN+QmaOfNQ1xfxzZzMM6hyfA4kgYgshf+SYPWx5dIxwJLvNeZ7qlUgM6rh9+Hcv1Y1 NWj0f2nIe6bMPrqL2rEQMKM3LnP6D3/hvO4/USRRQcL6WlMM9jyYe1VxFy16VGy5u/Zb 4uqekztjehtnZXaG3vEVQUXO/cG0XdD8EvrF19NWFesNTRoooIXeDf0x8S3oMhB7NoOR ieCv/Ao94XhL4t8oSgOEHWvkuhndlYWcvDp9AY7q/K1uA/XKpdLdqr/mUS4ZL/bfCSaO szQA== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=9AbYYTNhHkJQA3gEjxtmyDkRhR6Ewa4yefhdaKIo0kQ=; b=w2k45PQAiUn3N4jRoY3elEyD9PTZoqkGxrajWEnIKxK7M7B1FM06ZYOG2U5Y9YwCP7 VW/u6DTTgnOJ8lezfDW5ZMZkPKq9Xv8HfWxj+kj0BbEXFr5ml5Kn3WIIPImf8uEj3eFL xgfFDy7ApQ29k9CBpsCmbYw8vEEBQlfYBaqlcXuSPXpyxFXAr5ziBxConhuPIsABV5AB qNdTW9uyZb1gbYFaD2HiPSjsT6v9rJzwjTacxMgPe5UuKgEoUt3JRMNvh5eX6IggHoMD FCk5rEcjZSair1Uh9QVcm7mhdVp+82+oacrfSsb54DzEz45oC+/d8/7gSfOuDA22vpnU O+lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OtJjDBi9; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gb7si3736009ejc.286.2021.01.22.17.39.14; Fri, 22 Jan 2021 17:39:38 -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=k20201202 header.b=OtJjDBi9; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726411AbhAWBh3 (ORCPT + 99 others); Fri, 22 Jan 2021 20:37:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:56778 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726059AbhAWBhO (ORCPT ); Fri, 22 Jan 2021 20:37:14 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 625FF23B55; Sat, 23 Jan 2021 01:36:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1611365793; bh=kZIXz5RL0YNBD+BfkX8CUOfgUtS7jsLyaO6rWl6A9T4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=OtJjDBi9fyNQWx5MffCII2uFS+7W5aNO6478BdWACi16iZX1i21Ny5Y08ZBpaSTsV 0uPt/v8xgp05HGBhFGna/l/bKKySt+UBzsTcgXeqyBp+3i0/ELepfDAfJ52FTeiJKC 8dLq4gj8iLAxqycDH4KPfdzr0pDsftvwYAekAFK/6qPwaEpJQ7P9WObttlSno6aP4f 59N1OTt9AMWAwHAokk1PkRM3WulGYVHmYGqm8RYBcabRu9U8gZbYhDp1d3go+9KrYC jMX1ycC68iFKvPAldeiN9XcAzIWoIR34WRDBwSZHbPBh7AsNjEA2lRgnF3LSm+U7nH LBloYRfy885Cg== Date: Fri, 22 Jan 2021 17:36:32 -0800 From: Jakub Kicinski To: Laurent Badel Cc: Fugang Duan , "David S . Miller" , Liam Girdwood , Mark Brown , , Subject: Re: [PATCH net 1/1] net: fec: Fix temporary RMII clock reset on link up Message-ID: <20210122173632.25db0d09@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <20210122151347.30417-2-laurentbadel@eaton.com> References: <20210122151347.30417-1-laurentbadel@eaton.com> <20210122151347.30417-2-laurentbadel@eaton.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 22 Jan 2021 16:13:47 +0100 Laurent Badel wrote: > =EF=BB=BFfec_restart() does a hard reset of the MAC module when the link = status > changes to up. This temporarily resets the R_CNTRL register which controls > the MII mode of the ENET_OUT clock. In the case of RMII, the clock > frequency momentarily drops from 50MHz to 25MHz until the register is > reconfigured. Some link partners do not tolerate this glitch and > invalidate the link causing failure to establish a stable link when using > PHY polling mode. Since as per IEEE802.11 the criteria for link validity= =20 > are PHY-specific, what the partner should tolerate cannot be assumed, so= =20 > avoid resetting the MII clock by using software reset instead of hardware= =20 > reset when the link is up. This is generally relevant only if the SoC=20 > provides the clock to an external PHY and the PHY is configured for RMII. > static const struct fec_devinfo fec_imx6q_info =3D { > @@ -953,7 +954,8 @@ fec_restart(struct net_device *ndev) > * For i.MX6SX SOC, enet use AXI bus, we use disable MAC > * instead of reset MAC itself. > */ > - if (fep->quirks & FEC_QUIRK_HAS_AVB) { > + if (fep->quirks & FEC_QUIRK_HAS_AVB || > + (fep->quirks & FEC_QUIRK_NO_HARD_RESET) && fep->link) { > writel(0, fep->hwp + FEC_ECNTRL); > } else { > writel(1, fep->hwp + FEC_ECNTRL); drivers/net/ethernet/freescale/fec_main.c: In function =E2=80=98fec_restart= =E2=80=99: drivers/net/ethernet/freescale/fec_main.c:958:46: warning: suggest parenthe= ses around =E2=80=98&&=E2=80=99 within =E2=80=98||=E2=80=99 [-Wparentheses] 958 | (fep->quirks & FEC_QUIRK_NO_HARD_RESET) && fep->link) { | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~