<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/include/linux/mdio.h, branch v6.12.80</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.80</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.12.80'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2025-06-19T13:31:54+00:00</updated>
<entry>
<title>net: phy: fix up const issues in to_mdio_device() and to_phy_device()</title>
<updated>2025-06-19T13:31:54+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2025-05-22T11:21:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=f15ed37dd3af84964666793a6098fa866e5f4a4a'/>
<id>urn:sha1:f15ed37dd3af84964666793a6098fa866e5f4a4a</id>
<content type='text'>
[ Upstream commit e9cb929670a1e98b592b30f03f06e9e20110f318 ]

Both to_mdio_device() and to_phy_device() "throw away" the const pointer
attribute passed to them and return a non-const pointer, which generally
is not a good thing overall.  Fix this up by using container_of_const()
which was designed for this very problem.

Cc: Alexander Lobakin &lt;alobakin@pm.me&gt;
Cc: Andrew Lunn &lt;andrew@lunn.ch&gt;
Cc: Heiner Kallweit &lt;hkallweit1@gmail.com&gt;
Cc: Russell King &lt;linux@armlinux.org.uk&gt;
Fixes: 7eab14de73a8 ("mdio, phy: fix -Wshadow warnings triggered by nested container_of()")
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Link: https://patch.msgid.link/2025052246-conduit-glory-8fc9@gregkh
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>driver core: have match() callback in struct bus_type take a const *</title>
<updated>2024-07-03T13:16:54+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2024-07-01T12:07:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d69d804845985c29ab5be5a4b3b1f4787893daf8'/>
<id>urn:sha1:d69d804845985c29ab5be5a4b3b1f4787893daf8</id>
<content type='text'>
In the match() callback, the struct device_driver * should not be
changed, so change the function callback to be a const *.  This is one
step of many towards making the driver core safe to have struct
device_driver in read-only memory.

Because the match() callback is in all busses, all busses are modified
to handle this properly.  This does entail switching some container_of()
calls to container_of_const() to properly handle the constant *.

For some busses, like PCI and USB and HV, the const * is cast away in
the match callback as those busses do want to modify those structures at
this point in time (they have a local lock in the driver structure.)
That will have to be changed in the future if they wish to have their
struct device * in read-only-memory.

Cc: Rafael J. Wysocki &lt;rafael@kernel.org&gt;
Reviewed-by: Alex Elder &lt;elder@kernel.org&gt;
Acked-by: Sumit Garg &lt;sumit.garg@linaro.org&gt;
Link: https://lore.kernel.org/r/2024070136-wrongdoer-busily-01e8@gregkh
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>net: phy: Support 100/1000BT1 linkmode advertisements</title>
<updated>2024-02-21T22:56:58+00:00</updated>
<author>
<name>Dimitri Fedrau</name>
<email>dima.fedrau@gmail.com</email>
</author>
<published>2024-02-18T07:57:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ac0c530619cefa68fba816dabbcf6f4ffbf60c3d'/>
<id>urn:sha1:ac0c530619cefa68fba816dabbcf6f4ffbf60c3d</id>
<content type='text'>
Extend helper functions mii_t1_adv_m_mod_linkmode_t and
linkmode_adv_to_mii_t1_adv_m_t to support 100BT1 and 1000BT1 linkmode
advertisements.

Reviewed-by: Andrew Lunn &lt;andrew@lunn.ch&gt;
Signed-off-by: Dimitri Fedrau &lt;dima.fedrau@gmail.com&gt;
Link: https://lore.kernel.org/r/20240218075753.18067-3-dima.fedrau@gmail.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>net: mdio: add helpers for accessing the EEE CAP2 registers</title>
<updated>2024-02-17T18:45:06+00:00</updated>
<author>
<name>Heiner Kallweit</name>
<email>hkallweit1@gmail.com</email>
</author>
<published>2024-02-14T20:16:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=80e4021c25d8c1ddae0dd655ed5f6b1e938dd79b'/>
<id>urn:sha1:80e4021c25d8c1ddae0dd655ed5f6b1e938dd79b</id>
<content type='text'>
This adds helpers for accessing the EEE CAP2 registers.
For now only 2500baseT and 5000baseT modes are supported.

Signed-off-by: Heiner Kallweit &lt;hkallweit1@gmail.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>net: phy: mdio_device: Reset device only when necessary</title>
<updated>2023-12-01T07:11:21+00:00</updated>
<author>
<name>Andrew Halaney</name>
<email>ahalaney@redhat.com</email>
</author>
<published>2023-11-27T21:41:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/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:30+00:00</updated>
<author>
<name>Marek Behún</name>
<email>kabel@kernel.org</email>
</author>
<published>2023-11-10T12:05:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/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:48+00:00</updated>
<author>
<name>Russell King (Oracle)</name>
<email>rmk+kernel@armlinux.org.uk</email>
</author>
<published>2023-07-13T08:42:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/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:53+00:00</updated>
<author>
<name>Russell King (Oracle)</name>
<email>rmk+kernel@armlinux.org.uk</email>
</author>
<published>2023-05-26T10:14:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/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:22+00:00</updated>
<author>
<name>Russell King (Oracle)</name>
<email>rmk+kernel@armlinux.org.uk</email>
</author>
<published>2023-05-23T10:15:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/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:31+00:00</updated>
<author>
<name>Oleksij Rempel</name>
<email>o.rempel@pengutronix.de</email>
</author>
<published>2023-02-11T07:41:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/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>
</feed>
