lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220620150225.1307946-9-mw@semihalf.com>
Date:   Mon, 20 Jun 2022 17:02:21 +0200
From:   Marcin Wojtas <mw@...ihalf.com>
To:     linux-kernel@...r.kernel.org, linux-acpi@...r.kernel.org,
        netdev@...r.kernel.org
Cc:     rafael@...nel.org, andriy.shevchenko@...ux.intel.com,
        lenb@...nel.org, andrew@...n.ch, vivien.didelot@...il.com,
        f.fainelli@...il.com, olteanv@...il.com, davem@...emloft.net,
        edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
        linux@...linux.org.uk, hkallweit1@...il.com, gjb@...ihalf.com,
        mw@...ihalf.com, jaz@...ihalf.com, tn@...ihalf.com,
        Samer.El-Haj-Mahmoud@....com, upstream@...ihalf.com
Subject: [net-next: PATCH 08/12] ACPI: scan: prevent double enumeration of MDIO bus children

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@...ihalf.com>
---
 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ