Bug 259282 - dwc(4) doesn't release resources if phy reset fails
Summary: dwc(4) doesn't release resources if phy reset fails
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
Depends on:
Reported: 2021-10-19 18:24 UTC by Nick Reilly
Modified: 2021-10-19 18:48 UTC (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Nick Reilly 2021-10-19 18:24:25 UTC
if_dwc.c beginning line 1611 in main:

	if (bus_alloc_resources(dev, dwc_spec, sc->res)) {
		device_printf(dev, "could not allocate resources\n");
		return (ENXIO);

	/* Read MAC before reset */
	dwc_get_hwaddr(sc, macaddr);

	/* Reset the PHY if needed */
	if (dwc_reset(dev) != 0) {
		device_printf(dev, "Can't reset the PHY\n");
		return (ENXIO);

If the reset of the PHY fails then the resources are not released.