<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/include/linux/mdio.h, branch v6.8.6</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v6.8.6</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v6.8.6'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2023-12-01T07:11:21Z</updated>
<entry>
<title>net: phy: mdio_device: Reset device only when necessary</title>
<updated>2023-12-01T07:11:21Z</updated>
<author>
<name>Andrew Halaney</name>
<email>ahalaney@redhat.com</email>
</author>
<published>2023-11-27T21:41:10Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=df16c1c51d8166958f533c0c886766f7ee9dd50f'/>
<id>urn:sha1:df16c1c51d8166958f533c0c886766f7ee9dd50f</id>
<content type='text'>
Currently the phy reset sequence is as shown below for a
devicetree described mdio phy on boot:

1. Assert the phy_device's reset as part of registering
2. Deassert the phy_device's reset as part of registering
3. Deassert the phy_device's reset as part of phy_probe
4. Deassert the phy_device's reset as part of phy_hw_init

The extra two deasserts include waiting the deassert delay afterwards,
which is adding unnecessary delay.

This applies to both possible types of resets (reset controller
reference and a reset gpio) that can be used.

Here's some snipped tracing output using the following command line
params "trace_event=gpio:* trace_options=stacktrace" illustrating
the reset handling and where its coming from:

    /* Assert */
       systemd-udevd-283     [002] .....     6.780434: gpio_value: 544 set 0
       systemd-udevd-283     [002] .....     6.783849: &lt;stack trace&gt;
     =&gt; gpiod_set_raw_value_commit
     =&gt; gpiod_set_value_nocheck
     =&gt; gpiod_set_value_cansleep
     =&gt; mdio_device_reset
     =&gt; mdiobus_register_device
     =&gt; phy_device_register
     =&gt; fwnode_mdiobus_phy_device_register
     =&gt; fwnode_mdiobus_register_phy
     =&gt; __of_mdiobus_register
     =&gt; stmmac_mdio_register
     =&gt; stmmac_dvr_probe
     =&gt; stmmac_pltfr_probe
     =&gt; devm_stmmac_pltfr_probe
     =&gt; qcom_ethqos_probe
     =&gt; platform_probe

    /* Deassert */
       systemd-udevd-283     [002] .....     6.802480: gpio_value: 544 set 1
       systemd-udevd-283     [002] .....     6.805886: &lt;stack trace&gt;
     =&gt; gpiod_set_raw_value_commit
     =&gt; gpiod_set_value_nocheck
     =&gt; gpiod_set_value_cansleep
     =&gt; mdio_device_reset
     =&gt; phy_device_register
     =&gt; fwnode_mdiobus_phy_device_register
     =&gt; fwnode_mdiobus_register_phy
     =&gt; __of_mdiobus_register
     =&gt; stmmac_mdio_register
     =&gt; stmmac_dvr_probe
     =&gt; stmmac_pltfr_probe
     =&gt; devm_stmmac_pltfr_probe
     =&gt; qcom_ethqos_probe
     =&gt; platform_probe

    /* Deassert */
       systemd-udevd-283     [002] .....     6.882601: gpio_value: 544 set 1
       systemd-udevd-283     [002] .....     6.886014: &lt;stack trace&gt;
     =&gt; gpiod_set_raw_value_commit
     =&gt; gpiod_set_value_nocheck
     =&gt; gpiod_set_value_cansleep
     =&gt; mdio_device_reset
     =&gt; phy_probe
     =&gt; really_probe
     =&gt; __driver_probe_device
     =&gt; driver_probe_device
     =&gt; __device_attach_driver
     =&gt; bus_for_each_drv
     =&gt; __device_attach
     =&gt; device_initial_probe
     =&gt; bus_probe_device
     =&gt; device_add
     =&gt; phy_device_register
     =&gt; fwnode_mdiobus_phy_device_register
     =&gt; fwnode_mdiobus_register_phy
     =&gt; __of_mdiobus_register
     =&gt; stmmac_mdio_register
     =&gt; stmmac_dvr_probe
     =&gt; stmmac_pltfr_probe
     =&gt; devm_stmmac_pltfr_probe
     =&gt; qcom_ethqos_probe
     =&gt; platform_probe

    /* Deassert */
      NetworkManager-477     [000] .....     7.023144: gpio_value: 544 set 1
      NetworkManager-477     [000] .....     7.026596: &lt;stack trace&gt;
     =&gt; gpiod_set_raw_value_commit
     =&gt; gpiod_set_value_nocheck
     =&gt; gpiod_set_value_cansleep
     =&gt; mdio_device_reset
     =&gt; phy_init_hw
     =&gt; phy_attach_direct
     =&gt; phylink_fwnode_phy_connect
     =&gt; __stmmac_open
     =&gt; stmmac_open

There's a lot of paths where the device is getting its reset
asserted and deasserted. Let's track the state and only actually
do the assert/deassert when it changes.

Reported-by: Sagar Cheluvegowda &lt;quic_scheluve@quicinc.com&gt;
Signed-off-by: Andrew Halaney &lt;ahalaney@redhat.com&gt;
Reviewed-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Link: https://lore.kernel.org/r/20231127-net-phy-reset-once-v2-1-448e8658779e@redhat.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: mdio: fix typo in header</title>
<updated>2023-11-13T11:02:30Z</updated>
<author>
<name>Marek Behún</name>
<email>kabel@kernel.org</email>
</author>
<published>2023-11-10T12:05:46Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=438cbcdf105d84449fceb39a2d0e16d0ec20708f'/>
<id>urn:sha1:438cbcdf105d84449fceb39a2d0e16d0ec20708f</id>
<content type='text'>
The quotes symbol in
  "EEE "link partner ability 1
should be at the end of the register name
  "EEE link partner ability 1"

Signed-off-by: Marek Behún &lt;kabel@kernel.org&gt;
Reviewed-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: mdio: add unlocked mdiobus and mdiodev bus accessors</title>
<updated>2023-07-14T07:51:48Z</updated>
<author>
<name>Russell King (Oracle)</name>
<email>rmk+kernel@armlinux.org.uk</email>
</author>
<published>2023-07-13T08:42:22Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e6a45700e7e19b1c945ee56feab429ff8489370b'/>
<id>urn:sha1:e6a45700e7e19b1c945ee56feab429ff8489370b</id>
<content type='text'>
Add the following unlocked accessors to complete the set:
__mdiobus_modify()
__mdiodev_read()
__mdiodev_write()
__mdiodev_modify()
__mdiodev_modify_changed()
which we will need for Marvell DSA PCS conversion.

Reviewed-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Signed-off-by: Russell King (Oracle) &lt;rmk+kernel@armlinux.org.uk&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: mdio: add mdio_device_get() and mdio_device_put()</title>
<updated>2023-05-30T04:46:53Z</updated>
<author>
<name>Russell King (Oracle)</name>
<email>rmk+kernel@armlinux.org.uk</email>
</author>
<published>2023-05-26T10:14:24Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c4933fa88a68c69205753601044949d516c4db10'/>
<id>urn:sha1:c4933fa88a68c69205753601044949d516c4db10</id>
<content type='text'>
Add two new operations for a mdio device to manage the refcount on the
underlying struct device. This will be used by mdio PCS drivers to
simplify the creation and destruction handling, making it easier for
users to get it correct.

Signed-off-by: Russell King (Oracle) &lt;rmk+kernel@armlinux.org.uk&gt;
Reviewed-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: mdio: add clause 73 to ethtool conversion helper</title>
<updated>2023-05-24T16:13:22Z</updated>
<author>
<name>Russell King (Oracle)</name>
<email>rmk+kernel@armlinux.org.uk</email>
</author>
<published>2023-05-23T10:15:48Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e9261467ae86a6544bb602a55a1eab52696e71e3'/>
<id>urn:sha1:e9261467ae86a6544bb602a55a1eab52696e71e3</id>
<content type='text'>
Add a helper to convert a clause 73 advertisement to an ethtool bitmap.

Reviewed-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Signed-off-by: Russell King (Oracle) &lt;rmk+kernel@armlinux.org.uk&gt;
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: phy: add genphy_c45_ethtool_get/set_eee() support</title>
<updated>2023-02-13T11:12:31Z</updated>
<author>
<name>Oleksij Rempel</name>
<email>o.rempel@pengutronix.de</email>
</author>
<published>2023-02-11T07:41:09Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=022c3f87f88e2d68e90be7687d981c9cb893a3b1'/>
<id>urn:sha1:022c3f87f88e2d68e90be7687d981c9cb893a3b1</id>
<content type='text'>
Add replacement for phy_ethtool_get/set_eee() functions.

Current phy_ethtool_get/set_eee() implementation is great and it is
possible to make it even better:
- this functionality is for devices implementing parts of IEEE 802.3
  specification beyond Clause 22. The better place for this code is
  phy-c45.c
- currently it is able to do read/write operations on PHYs with
  different abilities to not existing registers. It is better to
  use stored supported_eee abilities to avoid false read/write
  operations.
- the eee_active detection will provide wrong results on not supported
  link modes. It is better to validate speed/duplex properties against
  supported EEE link modes.
- it is able to support only limited amount of link modes. We have more
  EEE link modes...

By refactoring this code I address most of this point except of the last
one. Adding additional EEE link modes will need more work.

Signed-off-by: Oleksij Rempel &lt;o.rempel@pengutronix.de&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: phy: add genphy_c45_read_eee_abilities() function</title>
<updated>2023-02-13T11:12:31Z</updated>
<author>
<name>Oleksij Rempel</name>
<email>o.rempel@pengutronix.de</email>
</author>
<published>2023-02-11T07:41:06Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=14e47d1fb8f9596acc90a06a66808657a9c512b5'/>
<id>urn:sha1:14e47d1fb8f9596acc90a06a66808657a9c512b5</id>
<content type='text'>
Add generic function for EEE abilities defined by IEEE 802.3
specification. For now following registers are supported:
- IEEE 802.3-2018 45.2.3.10 EEE control and capability 1 (Register 3.20)
- IEEE 802.3cg-2019 45.2.1.186b 10BASE-T1L PMA status register
  (Register 1.2295)

Since I was not able to find any flag signaling support of these
registers, we should detect link mode abilities first and then based on
these abilities doing EEE link modes detection.

Results of EEE ability detection will be stored into new variable
phydev-&gt;supported_eee.

Signed-off-by: Oleksij Rempel &lt;o.rempel@pengutronix.de&gt;
Reviewed-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: mdio: Remove support for building C45 muxed addresses</title>
<updated>2023-01-21T02:12:46Z</updated>
<author>
<name>Andrew Lunn</name>
<email>andrew@lunn.ch</email>
</author>
<published>2023-01-19T13:07:00Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=99d5fe9c7f3d0b349676984beda4bad109bf10b8'/>
<id>urn:sha1:99d5fe9c7f3d0b349676984beda4bad109bf10b8</id>
<content type='text'>
The old way of performing a C45 bus transfer created a special
register value and passed it to the MDIO bus driver, in the hope it
would see the MII_ADDR_C45 bit set, and perform a C45 transfer. Now
that there is a clear separation of C22 and C45, this scheme is no
longer used. Remove all the #defines and helpers, to prevent any code
being added which tries to use it.

Signed-off-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Signed-off-by: Michael Walle &lt;michael@walle.cc&gt;
Reviewed-by: Russell King (Oracle) &lt;rmk+kernel@armlinux.org.uk&gt;
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: mdio: add mdiobus_c45_read/write_nested helpers</title>
<updated>2023-01-10T23:53:37Z</updated>
<author>
<name>Andrew Lunn</name>
<email>andrew@lunn.ch</email>
</author>
<published>2023-01-09T15:30:50Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=1d914d51f03cbbbda3c34c675e49392ce60c1c33'/>
<id>urn:sha1:1d914d51f03cbbbda3c34c675e49392ce60c1c33</id>
<content type='text'>
Some DSA devices pass through PHY access to the MDIO bus the switch is
on. Add C45 versions of the current C22 helpers for nested accesses to
MDIO busses, so that C22 and C45 can be separated in these DSA
drivers.

Signed-off-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Signed-off-by: Michael Walle &lt;michael@walle.cc&gt;
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: mdio: Move mdiobus_c45_addr() next to users</title>
<updated>2023-01-10T23:53:36Z</updated>
<author>
<name>Andrew Lunn</name>
<email>andrew@lunn.ch</email>
</author>
<published>2023-01-09T15:30:45Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ce30fa56cbf09ab6b28170ced689c3cfd329e979'/>
<id>urn:sha1:ce30fa56cbf09ab6b28170ced689c3cfd329e979</id>
<content type='text'>
Now that mdiobus_c45_addr() is only used within the MDIO code during
fallback, move the function next to its only users. This function
should not be used any more in drivers, the c45 helpers should be used
in its place, so hiding it away will prevent any new users from being
added.

Signed-off-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Signed-off-by: Michael Walle &lt;michael@walle.cc&gt;
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
</feed>
