Bug 280770 - mii_fdt_lookup_phy not checking common subnode name
Summary: mii_fdt_lookup_phy not checking common subnode name
Status: In Progress
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 13.3-STABLE
Hardware: Any Any
: --- Affects Some People
Assignee: Mark Johnston
URL:
Keywords: vendor
Depends on:
Blocks:
 
Reported: 2024-08-12 13:02 UTC by Mike Belanger
Modified: 2024-11-19 21:21 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Belanger 2024-08-12 13:02:07 UTC
The following is in mii_fdt_lookup_phy:
	/*
	 * Now handle the "switch" case.
	 * Search "ports" subnode for nodes that describe a switch port
	 * including a PHY xref.
	 * Since we have multiple candidates select one based on PHY address.
	 */
	ports = ofw_bus_find_child(node, "ports");
	if (ports <= 0)
		return (-1);

The subnode name "ethernet-ports" is more commonly used.  The code should add an extra attempt with the "ethernet-ports" subnode name.  e.g.

	/*
	 * Now handle the "switch" case.
	 * Search "ports" subnode for nodes that describe a switch port
	 * including a PHY xref.
	 * Since we have multiple candidates select one based on PHY address.
	 */
	ports = ofw_bus_find_child(node, "ports");
	if (ports <= 0)
		ports = ofw_bus_find_child(node, "ethernet-ports");
	if (ports <= 0)
		return (-1);
Comment 1 commit-hook freebsd_committer freebsd_triage 2024-11-19 21:19:11 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=d6b692835e52d85441dfdd20a01c12e17cb50914

commit d6b692835e52d85441dfdd20a01c12e17cb50914
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2024-11-19 21:05:19 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2024-11-19 21:05:19 +0000

    mii_fdt: Search for the "ethernet-ports" subnode

    This is a more common name for the parent of the port nodes.

    PR:             280770
    MFC after:      2 weeks
    Reported by:    Mike Belanger <mibelanger@qnx.com>

 sys/dev/mii/mii_fdt.c | 2 ++
 1 file changed, 2 insertions(+)