[net-next: PATCH 08/12] ACPI: scan: prevent double enumeration of MDIO bus children
From: Marcin Wojtas
Date: Mon Jun 20 2022 - 11:13:08 EST
The MDIO bus is responsible for probing and registering its respective
children, such as PHYs or other kind of devices.
It is required that ACPI scan code should not enumerate such
devices, leaving this task for the generic MDIO bus routines,
which are initiated by the controller driver.
This patch prevents unwanted enumeration of the devices by setting
'enumeration_by_parent' flag, depending on whether their parent
device is a member of a known list of MDIO controllers. For now,
the Marvell MDIO controllers' IDs are added.
Signed-off-by: Marcin Wojtas <mw@xxxxxxxxxxxx>
---
drivers/acpi/scan.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 762b61f67e6c..d703c35dc218 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -1716,6 +1716,18 @@ static bool acpi_is_indirect_io_slave(struct acpi_device *device)
return parent && !acpi_match_device_ids(parent, indirect_io_hosts);
}
+static bool acpi_is_mdio_child(struct acpi_device *device)
+{
+ struct acpi_device *parent = device->parent;
+ static const struct acpi_device_id mdio_controllers[] = {
+ {"MRVL0100", 0},
+ {"MRVL0101", 0},
+ {}
+ };
+
+ return parent && !acpi_match_device_ids(parent, mdio_controllers);
+}
+
static bool acpi_device_enumeration_by_parent(struct acpi_device *device)
{
struct list_head resource_list;
@@ -1756,6 +1768,9 @@ static bool acpi_device_enumeration_by_parent(struct acpi_device *device)
if (acpi_is_indirect_io_slave(device))
return true;
+ if (acpi_is_mdio_child(device))
+ return true;
+
/* Macs use device properties in lieu of _CRS resources */
if (x86_apple_machine &&
(fwnode_property_present(&device->fwnode, "spiSclkPeriod") ||
--
2.29.0