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=-6.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED 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 7D61EC43381 for ; Sun, 24 Mar 2019 00:59:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1F772217D8 for ; Sun, 24 Mar 2019 00:59:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XgIuCOaf" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727919AbfCXA7b (ORCPT ); Sat, 23 Mar 2019 20:59:31 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:35055 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727625AbfCXA7b (ORCPT ); Sat, 23 Mar 2019 20:59:31 -0400 Received: by mail-pg1-f196.google.com with SMTP id g8so4001321pgf.2 for ; Sat, 23 Mar 2019 17:59:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:openpgp:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=Tn5MWhNlrQsHhUcZKpLzujcGl63E+YI992YH/SAVPYc=; b=XgIuCOaf+a+ykxrt1vr0ls49ngSqw2kZKlwFuhkDhQjypBjOFLrp4euuw8WuVtvTtC 9ow5mdFOXNr5ETNotecoVoBu5VztgVuM5+g+1zL1mDrXnPA4SOqxTKSibg8kfEfvgvjd IZ23oKS73Xshv1Fd33VMKOOhbaRxS/TB74ozg+z8THiJS+Av3FK15BgRrpyN2+IP8puf PqE17578GuxsOkYm3adT3A14MV25D7HlWtPbgecyxONKUJkZy1W8aL0mFzn/DL3E0ycL mg2XgklG+iuuzGL1gXhzmoLz0rB4jEViiH3nNLJD7BSm+u0IqgGxE1eP9u/0ENl1YI/u n1Ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Tn5MWhNlrQsHhUcZKpLzujcGl63E+YI992YH/SAVPYc=; b=L2Db2EEYOptz1B2wGqju8zJwr/Oi7/r/4ZFMUWVlMCZ7WdVR9BA8p9R+Cjjv04NUJb RGwxj4GGP8GBIJWzatgkHnum5MDepJ4uXhJJ1zUxjehbXW7Z25txgyWk58Sc57b18qmI g4HShMJ2N49ZnwyLTNI1MWclMqMCZh3eF7KBunTU7iDVUnD550bEHaESx514TOPI4rPn 2xgsoZcg1au+vHGi6GBatVWX0IRRjC5Aoi7srIpirPSsj2bW+ZRicoRByuyu+DGUIIpp tlhNfDz/L6lTeFSLoNePF8pD0CdsVLTz4BHebtpvRemh8Kv9o5CHwx9ulu1gmMvvOcxn Jv6A== X-Gm-Message-State: APjAAAXD6dmrNPpcycU+afY7jD8j2dfsRliKC664x0etTz+2C6YsNs8I xopMcVI3D4Uj7jdfZRe8XC4= X-Google-Smtp-Source: APXvYqz+zX75iQ+Srie/GMAg3MpjAxZI8syk4jXlQuUldRiWQ5czqS0dXotEhiag5sipTzGxiFGXbA== X-Received: by 2002:a63:4346:: with SMTP id q67mr16145062pga.92.1553389170806; Sat, 23 Mar 2019 17:59:30 -0700 (PDT) Received: from [192.168.1.3] (ip68-101-123-102.oc.oc.cox.net. [68.101.123.102]) by smtp.gmail.com with ESMTPSA id u11sm13779592pfh.23.2019.03.23.17.59.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 23 Mar 2019 17:59:29 -0700 (PDT) Subject: Re: [PATCH net] net: phy: don't clear BMCR in genphy_soft_reset To: Heiner Kallweit , Andrew Lunn , David Miller Cc: "netdev@vger.kernel.org" , Phil Reid , liweihang References: <58079905-c107-6b41-ce04-3d88ef00d70b@gmail.com> From: Florian Fainelli Openpgp: preference=signencrypt Message-ID: <871d452d-6e3f-d3ad-6434-e4b552ca37d5@gmail.com> Date: Sat, 23 Mar 2019 17:59:26 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.0 MIME-Version: 1.0 In-Reply-To: <58079905-c107-6b41-ce04-3d88ef00d70b@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 3/22/2019 12:00 PM, Heiner Kallweit wrote: > So far we effectively clear the BMCR register. Some PHY's can deal > with this (e.g. because they reset BMCR to a default as part of a > soft-reset) whilst on others this causes issues because e.g. the > autoneg bit is cleared. Marvell is an example, see also thread [0]. > So let's be a little bit more gentle and leave all bits we're not > interested in as-is. This change is needed for PHY drivers to > properly deal with the original patch. > > [0] https://marc.info/?t=155264050700001&r=1&w=2 > > Fixes: 6e2d85ec0559 ("net: phy: Stop with excessive soft reset") > Tested-by: Phil Reid > Tested-by: liweihang > Signed-off-by: Heiner Kallweit Reviewed-by: Florian Fainelli Thanks for investigating and coming up with a fix for this! > --- > drivers/net/phy/phy_device.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c > index 49fdd1ee7..77068c545 100644 > --- a/drivers/net/phy/phy_device.c > +++ b/drivers/net/phy/phy_device.c > @@ -1831,7 +1831,7 @@ int genphy_soft_reset(struct phy_device *phydev) > { > int ret; > > - ret = phy_write(phydev, MII_BMCR, BMCR_RESET); > + ret = phy_set_bits(phydev, MII_BMCR, BMCR_RESET); > if (ret < 0) > return ret; > > -- Florian