Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161071AbcKOXPH (ORCPT ); Tue, 15 Nov 2016 18:15:07 -0500 Received: from mout.gmx.net ([212.227.17.20]:50524 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030242AbcKOXPE (ORCPT ); Tue, 15 Nov 2016 18:15:04 -0500 Subject: Re: [net-next 1/2] net: ethernet: slicoss: add slicoss gigabit ethernet driver To: Andrew Lunn References: <1479012453-19410-1-git-send-email-LinoSanfilippo@gmx.de> <1479012453-19410-2-git-send-email-LinoSanfilippo@gmx.de> <20161113195544.GA18258@lunn.ch> <69558f55-824a-7063-d9b3-ccc0a6113b87@gmx.de> <4450caf4-e1cf-5187-1337-c46b81b08708@gmail.com> <0d1b4dee-11bb-3605-699c-ea417484cb68@gmx.de> <20161115215907.GF23231@lunn.ch> <86165d2b-f9d5-a380-9bb0-f77c12691eb6@gmx.de> <41c0c732-0935-1625-b88d-c084e5000a6c@gmail.com> <20161115230317.GG23231@lunn.ch> Cc: Florian Fainelli , davem@davemloft.net, charrer@alacritech.com, liodot@gmail.com, gregkh@linuxfoundation.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org From: Lino Sanfilippo Message-ID: <46664e87-da42-ece8-43b9-094d2b24e1e4@gmx.de> Date: Wed, 16 Nov 2016 00:14:44 +0100 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20161115230317.GG23231@lunn.ch> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:SMYSo7htid3rCKDe6ce4cnvPltX43o3yva5skFXtT0PMYc9kjVL q152QxBAuVfV67pWi9egzcNic8dMQJcYJ6pw84qbPvyok/cX+LWchTcCk883TmgeJ3G32MH UYhhXXpLFG7jobKrQ8+cYZTVp7b9gWQDdOeRX82uOOSBCEu18WReOQYUHvUlxchAT5R/6WU H2dNyMsFDfbdOvCwrwavg== X-UI-Out-Filterresults: notjunk:1;V01:K0:eTd1RT6n9os=:Zlxskj9oZaggdd5/i0UeJe fudytpyGcCqWcelY4/UgB48p5Qk2Xld4GFM6dUpfP5NV7pzomi37M/yuDwPwrnAn3Ud3UQwEo mvuipP5HmqPGNTULVhO+IXGPWQ1PAf+/fDP59Blb9wlapIqNylihTQlwsEWVAliMW23vlCGuS KS6v80DAvq0Q5cY2B3rpaYoagmTS3/kf+meOhHh6PIWEVUAd5OZMJYpRcnU0hJG0ReyoHKjmw /iZhQYllbOUFNJpKMmJThrNLe0yXgZVzU4v7dlmZSjTl9SgjOlW23KvxHOCPKApGzXgE7j1Ax DShQoGPbC9sF1k1X5dQfVEkjZP3W16NTgVywkO/rg1GJFiT997UQV7kKfl0oDXqldBux04QeA st9y6nHfLdumyy1vWkvEvC+AYeBUwMgTRH7+0N48pSntyXqmKdy3GX6uD7pR2BE9U0j7Qjde0 SXitBN66QdAdeh4/tli7YVAop0J1nAU3dUJkXnwWOyfzZL+sqztTJtzbv3hko1fL/2YkK11Wn WsFguaOr9wBBDbV9Hh7MxkIAYimcNCA6fHzAF/rP0I8Ogm2AUWPy0FZlE98RqZxiQO87vYDok DmE1Y2uOPW9jWHj+NJugEj647gdTv7i8WmjKhJzF3RfQ+A3d9UkhH56ut4sGDsnCbSOByWRXo hHyl2gCjmH2SJke5o+h3Uw2XA5f2yfonx2s/gumiptJrnLPNLgyptia+CTXize6+IR36hIXTd FBFGg/JGH51FRADKYWrxNqisBvNRrbg+3UYo2Xr/KA3KvN9OFlF9yB5/u00R2s+/7bxaCy6Tl r9rHwdY Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1120 Lines: 27 On 16.11.2016 00:03, Andrew Lunn wrote: >> >>>>> + val = MII_BMCR << 16 | SLIC_PCR_AUTONEG | >> >>>>> + SLIC_PCR_AUTONEG_RST; >> >>>>> + slic_write(sdev, SLIC_REG_WPHY, val); > >> Thats essentially what I meant by setting a flag in the irq handler. The mdio >> function would have to check somehow if the irq has been fired (be it by means >> of a flag or a completion that is set by the irq handler and checked by the >> mdio function). So I agree that it should work (if reading via the AP command >> is actually possible). > > It seems odd you have a nice simple way to do writes, but reads are > very complex. There might be a simple read method hiding somewhere. > > Andrew > I agree, it IS odd :). But concerning reading the phy this is all I can see in the original source code: http://lxr.free-electrons.com/source/drivers/staging/slicoss/slichw.h#L516 I strongly suspect that "RPHY" stand for "read phy". The only one who may know for sure if there is another/better way is Christopher Harrer. He is also on CC but I am not sure if he actually follows this discussion. Lino