Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp934900imm; Thu, 4 Oct 2018 05:53:10 -0700 (PDT) X-Google-Smtp-Source: ACcGV61n5vc0k/eiA4lttv8Z7eXwAtwARALEIFyCTLUfGV2+s3gjdYC8+UG9PxWGvf4He64SR2lm X-Received: by 2002:a63:2ad4:: with SMTP id q203-v6mr5464284pgq.356.1538657590171; Thu, 04 Oct 2018 05:53:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538657590; cv=none; d=google.com; s=arc-20160816; b=Q5e0stOQD1uRZ64o96ZmUVrzql7UFvCuZbDFzc78t373FScoPRTsFoGaZ+ACeoOzIu BRMPEaMBEcz77/5xRjAA5saIJ9YBLW5qtj2R4qdpM6AhUIVLbjqFZCTqVT+EwnPjjQvg vJ0D8rFRLE0MJJ++pFfPHyEkDO2zQi6c4MSWZnhAnpTDa5JvcyHQznaiimfzbZQco9um OOdqtmpPXJju9V7I2OwqIYQoPxEg7KrGPz6ZDogxzBxivZ+1xC7f5Knr95Idv5XvRe6e 8lMSGr11aAvjnvHPJwUEP5u3/3h77WCsbS+UOV0e3vEcoY+glA3bAvksjykvIfK8K0Zm WicQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=0pCgcISZscRjG2fvdRG9Axy460Qz4beF+nqI7AK4RBI=; b=Z07KdYbcbFRy7d3r0tej4WznAAa8ZEosj3Xs/8S57w3OLJ3Hs0tk16BogUMPhbBMyx WX7iR+kIqzi+FbC1Flo3mj4RbACNJVAb6ye5J0yhy3LlA3ssJW0++sNtuxIt7EXSq/hK K+VwBPpg0Wky3wJYxVOFHDhvln3mIiLUzjFHMqaaOVEw+imHBtv9azm/owtxabfwovDa WYn9ZWT72AUnANhn7vb96VzrZR8YvaeciCsMONi/EnUtNwCjYtB7Ceg/xbgtsU4KNgix B1X9rpvALhRWoNJmOQwBEeM7+8i4px6q821CXzhYiiE6xDOfuHb2U16CH6llARSkrOmA 1twQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f88-v6si5744585pfh.33.2018.10.04.05.52.54; Thu, 04 Oct 2018 05:53:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727394AbeJDToL (ORCPT + 99 others); Thu, 4 Oct 2018 15:44:11 -0400 Received: from mail.bootlin.com ([62.4.15.54]:37506 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727264AbeJDToK (ORCPT ); Thu, 4 Oct 2018 15:44:10 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id D9162208C2; Thu, 4 Oct 2018 14:50:58 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost.localdomain (AAubervilliers-681-1-28-153.w90-88.abo.wanadoo.fr [90.88.148.153]) by mail.bootlin.com (Postfix) with ESMTPSA id 99E90206A1; Thu, 4 Oct 2018 14:50:48 +0200 (CEST) From: Quentin Schulz To: davem@davemloft.net, andrew@lunn.ch, f.fainelli@gmail.com Cc: allan.nielsen@microchip.com, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, thomas.petazzoni@bootlin.com, alexandre.belloni@bootlin.com, Quentin Schulz Subject: [PATCH net-next v2 0/6] net: phy: mscc: various improvements to Microsemi PHY driver Date: Thu, 4 Oct 2018 14:47:22 +0200 Message-Id: <20181004124728.9821-1-quentin.schulz@bootlin.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The Microsemi PHYs have multiple banks of registers (called pages). Registers can only be accessed from one page, if we need a register from another page, we need to switch the page and the registers of all other pages are not accessible anymore. Basically, to read register 5 from page 0, 1, 2, etc., you do the same phy_read(phydev, 5); but you need to set the desired page beforehand. In order to guarantee that two concurrent functions do not change the page, we need to do some locking per page. This can be achieved with the use of phy_select_page and phy_restore_page functions but phy_write/read calls in-between those two functions shall be replaced by their lock-free alternative __phy_write/read. The Microsemi PHYs have several counters so let's make them available as PHY statistics. The VSC 8530/31/40/41 also need to update their EEE init sequence in order to avoid packet losses and improve performance. This patch series also makes some minor cosmetic changes to the driver. Thanks, Quentin v2: - add patch to migrate MSCC driver to use phy_restore/select_page, - migrate all patches from v1 to use those two functions, - put the multiple lines of constants writes in an array and iterate over it to write the values, - add reviewed-bys, Quentin Schulz (4): net: phy: mscc: migrate to phy_select/restore_page functions net: phy: mscc: remove unneeded parenthesis net: phy: mscc: shorten `x != 0` condition to `x` net: phy: mscc: remove unneeded temporary variable Raju Lakkaraju (2): net: phy: mscc: add ethtool statistics counters net: phy: mscc: Add EEE init sequence drivers/net/phy/mscc.c | 360 ++++++++++++++++++++++++++++++++--------- 1 file changed, 282 insertions(+), 78 deletions(-) -- 2.17.1