freebsd-src/sys/dev/dpaa2
Bjoern A. Zeeb 964b3408fa dpaa2: defer link_state updates until we are up
dpaa2_ni_media_change() was called in early setup stages, before we
were fully setup.  That lead to internal driver state being all synched
and fine but hardware state was lost/never setup corrently.

Introduce dpaa2_ni_media_change_locked() so we can avoid reccursive
locking and call "dpaa2_ni_media_change()" instead of mii_mediachg()
as the latter does not setup our state there either.

In order for this all to work, call if_setdrvflagbits() just before
rather than after the above.

Also remove an unecessary direct call to dpaa2_ni_miibus_statchg()
which mii_mediachg() will trigger anyway.

This all fixes a problem [1] that one had to lose the link (either
unplugging/replugging the cable or using ifconfig media none;
ifconfig media auto) to re-trigger the all updates and get the
full state programmed when hardware expected.

MFC after:	3 days
GH-Issue:	https://github.com/mcusim/freebsd-src/issues/21 [1]
Reviewed by:	dsl, dch
Differential Revision: https://reviews.freebsd.org/D42643
2023-11-17 12:20:03 +00:00
..
dpaa2_bp.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
dpaa2_bp.h dpaa2: Avoid dpaa2_cmd race conditions 2023-04-19 17:39:05 +02:00
dpaa2_buf.c dpaa2: Clean up channels in separate tasks 2023-08-20 10:17:26 +02:00
dpaa2_buf.h dpaa2: Clean up channels in separate tasks 2023-08-20 10:17:26 +02:00
dpaa2_channel.c dpaa2: Clean up channels in separate tasks 2023-08-20 10:17:26 +02:00
dpaa2_channel.h dpaa2: Clean up channels in separate tasks 2023-08-20 10:17:26 +02:00
dpaa2_cmd_if.m
dpaa2_con.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
dpaa2_con.h dpaa2: Avoid dpaa2_cmd race conditions 2023-04-19 17:39:05 +02:00
dpaa2_console.c dpaa2: add console support for FDT based systems 2023-04-20 18:59:03 +00:00
dpaa2_io.c dpaa2: Clean up channels in separate tasks 2023-08-20 10:17:26 +02:00
dpaa2_io.h dpaa2: Clean up channels in separate tasks 2023-08-20 10:17:26 +02:00
dpaa2_mac.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
dpaa2_mac.h dpaa2: Avoid dpaa2_cmd race conditions 2023-04-19 17:39:05 +02:00
dpaa2_mc.c dpaa2: Clean up channels in separate tasks 2023-08-20 10:17:26 +02:00
dpaa2_mc.h
dpaa2_mc_acpi.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
dpaa2_mc_fdt.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
dpaa2_mc_if.m
dpaa2_mcp.c dpaa2: Clean up channels in separate tasks 2023-08-20 10:17:26 +02:00
dpaa2_mcp.h dpaa2: Clean up channels in separate tasks 2023-08-20 10:17:26 +02:00
dpaa2_ni.c dpaa2: defer link_state updates until we are up 2023-11-17 12:20:03 +00:00
dpaa2_ni.h dpaa2: Clean up channels in separate tasks 2023-08-20 10:17:26 +02:00
dpaa2_ni_dpkg.h
dpaa2_rc.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
dpaa2_swp.c dpaa2: Clean up channels in separate tasks 2023-08-20 10:17:26 +02:00
dpaa2_swp.h dpaa2: Clean up channels in separate tasks 2023-08-20 10:17:26 +02:00
dpaa2_swp_if.m
dpaa2_types.c dpaa2: Clean up channels in separate tasks 2023-08-20 10:17:26 +02:00
dpaa2_types.h dpaa2: Clean up channels in separate tasks 2023-08-20 10:17:26 +02:00
memac_mdio.h
memac_mdio_acpi.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
memac_mdio_common.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
memac_mdio_fdt.c sys: Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:36 -06:00
memac_mdio_if.m sys: Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:54:58 -06:00