[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201404241428.10248.arnd@arndb.de>
Date: Thu, 24 Apr 2014 14:28:09 +0200
From: Arnd Bergmann <arnd@...db.de>
To: zhangfei <zhangfei.gao@...aro.org>
Cc: linux-arm-kernel@...ts.infradead.org,
Sergei Shtylyov <sergei.shtylyov@...entembedded.com>,
Florian Fainelli <f.fainelli@...il.com>,
Mark Rutland <mark.rutland@....com>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
Russell King <linux@....linux.org.uk>,
Eric Dumazet <eric.dumazet@...il.com>,
netdev <netdev@...r.kernel.org>, xuwei5@...ilicon.com,
David Laight <David.Laight@...lab.com>,
David Miller <davem@...emloft.net>
Subject: Re: [PATCH v8 2/3] net: hisilicon: new hip04 MDIO driver
On Tuesday 22 April 2014, zhangfei wrote:
> On 04/22/2014 10:30 PM, Arnd Bergmann wrote:
> > On Tuesday 22 April 2014, zhangfei wrote:
> >> On 04/22/2014 04:22 PM, Arnd Bergmann wrote:
> > But it means that the hip04_mdio driver potentially won't work if connected
> > to something other than a Marvell PHY.
> >
> > I noticed that the marvell_of_reg_init() does this at init time:
> >
> > saved_page = phy_read(phydev, MII_MARVELL_PHY_PAGE);
> > ... /* perform init */
> > if (page_changed)
> > phy_write(phydev, MII_MARVELL_PHY_PAGE, saved_page);
> >
> > Is this a bug? Maybe it should always set page 0 when leaving
> > this function.
> >
> It is correct behavior return to the original page.
>
> First get_phy_id, then match driver according to the id, then operation
> in the specific driver have the chance to run, including
> marvell_of_reg_init etc.
>
> Just unlucky the default value of PHY_PAGE after power on is not 0.
Ok, so it's actually not possible to detect this case prior to having
to work around it.
How about adding a DT property as a flag to tell the driver whether
to set the page to zero or not? That would let the driver work
with different types of PHY implementations, or skip the code if
there is firmware that can already set it up to page zero.
Arnd
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists