From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Lunn Subject: Re: [PATCH net-next] net: phy: improve handling link_change_notify callback Date: Mon, 4 Mar 2019 21:06:30 +0100 Message-ID: <20190304200630.GJ26378@lunn.ch> References: <411b1c33-a245-0706-8afd-c4bea1b90f68@gmail.com> <20190304.113025.1437399524067140375.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20190304.113025.1437399524067140375.davem@davemloft.net> Sender: netdev-owner@vger.kernel.org To: David Miller Cc: hkallweit1@gmail.com, f.fainelli@gmail.com, heiko@sntech.de, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org List-Id: linux-rockchip.vger.kernel.org On Mon, Mar 04, 2019 at 11:30:25AM -0800, David Miller wrote: > From: Heiner Kallweit > Date: Sun, 3 Mar 2019 19:58:57 +0100 > > > Currently the Phy driver's link_change_notify callback is called > > whenever the state machine is run (every second if polling), no matter > > whether the state changed or not. This isn't needed and may confuse > > users considering the name of the callback. Therefore let's change > > the behavior and call this callback only in case of an actual > > state change. > > > > This requires changes to the at803x and rockchip drivers. > > at803x can be simplified so that it reacts on a state change to > > PHY_NOLINK only. > > The rockchip driver can also be much simplified. We simply re-init > > the AFE/DSP registers whenever we change to PHY_RUNNING and speed > > is 100Mbps. This causes very small overhead because we do this even > > if the speed was 100Mbps already. But this is neglectable and > > I think justified by the much simpler code. > > > > Changes are compile-tested only. > > > > Signed-off-by: Heiner Kallweit > > Someone please review this. Hi David We should probably wait for a Tested-by: from Daniel Mack and David Wu , or equivalent. Andrew From mboxrd@z Thu Jan 1 00:00:00 1970 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=-5.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT 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 3503AC43381 for ; Mon, 4 Mar 2019 20:06:48 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 023C220830 for ; Mon, 4 Mar 2019 20:06:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="lLraIeda"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="DiF3jJQf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 023C220830 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lunn.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/VQqBsY/+xfPCxZ2G8oIphiaJo06d/h3hSsyw0U61HU=; b=lLraIedaHJb78X STWDN13WFBqtTUSdO1Ck0AUyBImmEOM6C6/vlFOjhROrMfke0NR+UA8ubwuzkSMfbjotsZm6UVpKI rPsjhBa1nTIkFy20N3Cx4uxbf4Im0Nydkrh4SVv+SSHaDYE1yTbxhUYkha99XD0pCv0YKc/Loq5SI gQBd8ndhX6EYVMOhVR3OG/aG2kwfLvGhoprGLqejq2w+erSWNdUVyyhPCI9kJMiCaESkIMJCJe4gM QAUz7MD0+0i+6nQqT6cCuQrTk+ozuo3+Xubcbyf2qPP6X9Fipvplkp08gQ3HacnxkhnX26iQBDsBI XEBUZhdtPvD+U1eiT5Hg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h0trF-0002Xv-DB; Mon, 04 Mar 2019 20:06:41 +0000 Received: from vps0.lunn.ch ([185.16.172.187]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h0trB-0002XI-JB; Mon, 04 Mar 2019 20:06:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; 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=jqLuwWmOLNqkA7rjp6OiQUqpqAUdWKb1pXVWX3Z9rQw=; b=DiF3jJQf7z9wNKadPRY6Kcq3HN cGg4JTJ2DfzDv82efstZmezV262CLV/vjhXJngnDn79dAIoHp31LckN8rWab4RXOCPkDvLAlCjy81 EXEtJtJHHyb2aBni0XbyjbQ1DzxNQOAnHy7TnlYRvQsm1b+sVcvyhA9l5DiB6odaWSrw=; Received: from andrew by vps0.lunn.ch with local (Exim 4.89) (envelope-from ) id 1h0tr4-0007iS-Vg; Mon, 04 Mar 2019 21:06:30 +0100 Date: Mon, 4 Mar 2019 21:06:30 +0100 From: Andrew Lunn To: David Miller Subject: Re: [PATCH net-next] net: phy: improve handling link_change_notify callback Message-ID: <20190304200630.GJ26378@lunn.ch> References: <411b1c33-a245-0706-8afd-c4bea1b90f68@gmail.com> <20190304.113025.1437399524067140375.davem@davemloft.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190304.113025.1437399524067140375.davem@davemloft.net> User-Agent: Mutt/1.5.23 (2014-03-12) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190304_120637_776094_B409B7C5 X-CRM114-Status: GOOD ( 16.30 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: f.fainelli@gmail.com, heiko@sntech.de, netdev@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, hkallweit1@gmail.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Mar 04, 2019 at 11:30:25AM -0800, David Miller wrote: > From: Heiner Kallweit > Date: Sun, 3 Mar 2019 19:58:57 +0100 > > > Currently the Phy driver's link_change_notify callback is called > > whenever the state machine is run (every second if polling), no matter > > whether the state changed or not. This isn't needed and may confuse > > users considering the name of the callback. Therefore let's change > > the behavior and call this callback only in case of an actual > > state change. > > > > This requires changes to the at803x and rockchip drivers. > > at803x can be simplified so that it reacts on a state change to > > PHY_NOLINK only. > > The rockchip driver can also be much simplified. We simply re-init > > the AFE/DSP registers whenever we change to PHY_RUNNING and speed > > is 100Mbps. This causes very small overhead because we do this even > > if the speed was 100Mbps already. But this is neglectable and > > I think justified by the much simpler code. > > > > Changes are compile-tested only. > > > > Signed-off-by: Heiner Kallweit > > Someone please review this. Hi David We should probably wait for a Tested-by: from Daniel Mack and David Wu , or equivalent. Andrew _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel