From: Andrew Lunn <andrew@lunn.ch>
To: Paul Burton <paul.burton@mips.com>
Cc: netdev@vger.kernel.org, "David S . Miller" <davem@davemloft.net>
Subject: Re: [PATCH v7 09/11] net: pch_gbe: Convert to mdiobus and phylib
Date: Wed, 27 Jun 2018 19:51:44 +0200 [thread overview]
Message-ID: <20180627175144.GG885@lunn.ch> (raw)
In-Reply-To: <20180627000612.27263-10-paul.burton@mips.com>
> @@ -5,7 +5,8 @@
> config PCH_GBE
> tristate "OKI SEMICONDUCTOR IOH(ML7223/ML7831) GbE"
> depends on PCI && (X86_32 || COMPILE_TEST)
> - select MII
> + select PHYLIB
> + imply AT803X_PHY if X86_32
> select PTP_1588_CLOCK_PCH
> select NET_PTP_CLASSIFY
That is unusual. I don't think any other MAC driver does this.
If the AT803X driver is not available, it will fall back to the
generic PHY driver. That means RGMII delays will not get set
correctly, no interrupts, no wol, and no workaround for the 8030.
Are any of these relevant to your board?
> @@ -197,16 +151,14 @@ static void pch_gbe_get_regs(struct net_device *netdev,
> struct pch_gbe_hw *hw = &adapter->hw;
> struct pci_dev *pdev = adapter->pdev;
> u32 *regs_buff = p;
> - u16 i, tmp;
> + u16 i;
>
> regs->version = 0x1000000 | (__u32)pdev->revision << 16 | pdev->device;
> for (i = 0; i < PCH_GBE_MAC_REGS_LEN; i++)
> *regs_buff++ = ioread32(&hw->reg->INT_ST + i);
> /* PHY register */
> - for (i = 0; i < PCH_GBE_PHY_REGS_LEN; i++) {
> - pch_gbe_phy_read_reg_miic(&adapter->hw, i, &tmp);
> - *regs_buff++ = tmp;
> - }
> + for (i = 0; i < PCH_GBE_PHY_REGS_LEN; i++)
> + *regs_buff++ = phy_read(adapter->phydev, i);
> }
In general, that is not safe. Some PHYs have pages, and you have no
idea what page is currently selected. If you don't need it, i would
drop this. There are other ways to get access to phy registers, like
miitool, which should do a better job.
Andrew
next prev parent reply other threads:[~2018-06-27 17:51 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-27 0:06 [PATCH v7 00/11] net: pch_gbe: Fixes, conversion to phylib, enable for MIPS Paul Burton
2018-06-27 0:06 ` [PATCH v7 01/11] net: pch_gbe: Remove unused struct pch_gbe_adapter fields Paul Burton
2018-06-27 0:06 ` [PATCH v7 02/11] net: pch_gbe: Mask spare MAC addresses all at once Paul Burton
2018-06-27 0:06 ` [PATCH v7 03/11] net: pch_gbe: Probe PHY ID & initialize only once Paul Burton
2018-06-27 17:21 ` Andrew Lunn
2018-06-27 17:31 ` Paul Burton
2018-06-27 17:33 ` Andrew Lunn
2018-06-28 7:47 ` Andrew Lunn
2018-06-27 0:06 ` [PATCH v7 04/11] net: pch_gbe: Remove irq_sem Paul Burton
2018-06-27 0:06 ` [PATCH v7 05/11] net: pch_gbe: Move pch_gbe_watchdog lower in pch_gbe_main.c Paul Burton
2018-06-27 17:23 ` Andrew Lunn
2018-06-27 0:06 ` [PATCH v7 06/11] net: pch_gbe: Only enable MAC when PHY link is active Paul Burton
2018-06-27 17:30 ` Andrew Lunn
2018-06-27 17:54 ` Paul Burton
2018-06-28 7:36 ` Andrew Lunn
2018-06-27 17:54 ` Florian Fainelli
2018-06-27 18:15 ` Paul Burton
2018-06-27 0:06 ` [PATCH v7 07/11] net: pch_gbe: Remove AR8031 PHY hibernation disable Paul Burton
2018-06-27 17:30 ` Andrew Lunn
2018-06-27 0:06 ` [PATCH v7 08/11] net: pch_gbe: Clean up resets Paul Burton
2018-06-27 0:06 ` [PATCH v7 09/11] net: pch_gbe: Convert to mdiobus and phylib Paul Burton
2018-06-27 17:51 ` Andrew Lunn [this message]
2018-06-27 18:09 ` Paul Burton
2018-06-28 7:44 ` Andrew Lunn
2018-06-27 0:06 ` [PATCH v7 10/11] ptp: pch: Allow build on MIPS platforms Paul Burton
2018-06-27 17:53 ` Andrew Lunn
2018-06-27 0:06 ` [PATCH v7 11/11] net: pch_gbe: " Paul Burton
2018-06-27 17:54 ` Andrew Lunn
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180627175144.GG885@lunn.ch \
--to=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=paul.burton@mips.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).