Commit 9e70485
net: fec: Fix phy_device lookup for phy_reset_after_clk_enable()
[ Upstream commit 64a632d ]
The phy_reset_after_clk_enable() is always called with ndev->phydev,
however that pointer may be NULL even though the PHY device instance
already exists and is sufficient to perform the PHY reset.
This condition happens in fec_open(), where the clock must be enabled
first, then the PHY must be reset, and then the PHY IDs can be read
out of the PHY.
If the PHY still is not bound to the MAC, but there is OF PHY node
and a matching PHY device instance already, use the OF PHY node to
obtain the PHY device instance, and then use that PHY device instance
when triggering the PHY reset.
Fixes: 1b0a83a ("net: fec: add phy_reset_after_clk_enable() support")
Signed-off-by: Marek Vasut <[email protected]>
Cc: Christoph Niedermaier <[email protected]>
Cc: David S. Miller <[email protected]>
Cc: NXP Linux Team <[email protected]>
Cc: Richard Leitner <[email protected]>
Cc: Shawn Guo <[email protected]>
Signed-off-by: Jakub Kicinski <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>1 parent 0b41975 commit 9e70485
1 file changed
+23
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1945 | 1945 | | |
1946 | 1946 | | |
1947 | 1947 | | |
| 1948 | + | |
| 1949 | + | |
| 1950 | + | |
| 1951 | + | |
| 1952 | + | |
| 1953 | + | |
| 1954 | + | |
| 1955 | + | |
| 1956 | + | |
| 1957 | + | |
| 1958 | + | |
| 1959 | + | |
| 1960 | + | |
| 1961 | + | |
| 1962 | + | |
| 1963 | + | |
| 1964 | + | |
| 1965 | + | |
| 1966 | + | |
| 1967 | + | |
| 1968 | + | |
1948 | 1969 | | |
1949 | 1970 | | |
1950 | 1971 | | |
| |||
1971 | 1992 | | |
1972 | 1993 | | |
1973 | 1994 | | |
1974 | | - | |
| 1995 | + | |
1975 | 1996 | | |
1976 | 1997 | | |
1977 | 1998 | | |
| |||
2991 | 3012 | | |
2992 | 3013 | | |
2993 | 3014 | | |
2994 | | - | |
| 3015 | + | |
2995 | 3016 | | |
2996 | 3017 | | |
2997 | 3018 | | |
| |||
0 commit comments