Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2965960iog; Mon, 20 Jun 2022 08:24:39 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t716ICXuNKDoyvs8LZk73jTPz4oPphwZJpSqC4aCFVgqk5jSC1eneMk20EyrftI7AyJwgk X-Received: by 2002:a05:6a00:2342:b0:51c:441:1575 with SMTP id j2-20020a056a00234200b0051c04411575mr25160155pfj.28.1655738679307; Mon, 20 Jun 2022 08:24:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655738679; cv=none; d=google.com; s=arc-20160816; b=ANCeGLwmSu/FlrwUjL4HHj+g/Y5R+tjFz/56HydiUiepuu57iy8d3kiM8GXsMJhEhy NeVD7Z+ZUNZAJnj4dkDZyQ/dvqSODPlJBJ9IBm1M0eWdRJPHMMjC7S1/30+bVSK5CeRk avoA3gh2NXfpJ1D/UD+YkaKr9mXqkT01PYi8Bus1kH1JeNNojGpSarQpqRoxgqRqI7jD L80fRnQV6725eKkD6lHpau5nP/W1ZqbkoudYGGoyAn1pE1dssvoTHZi+e4WyVwp1hHKF YfPMhmMH+x6TrmIQcfGpaXFoHaY/ewhnZdVOKIl5iiD9zzPsULDIdBKHv9L9eVTGqK+S uc4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=RDW0iKUe4rl0AxxyRpSUfzqnbvrj0hO4TPTr9mwh6kI=; b=s2kjkKQADwCZn6yMynVSKjXLJdRfKinugLZfeUtvuBkYnJ6uHXLQpM/pPV2dPMl75/ b4SeUNwpJosEg5ohN7/eeWsY297j9ND29ZMBbedDkYpNu4NiolkDi3MJU8SJTNMvi1ds PULfoLF6JmvQQs4nBvIi98mkSlxwVzNhRnhGvAQ1aHB3B3mpa/kEt+eU3WKJrHgbUUGu umfQdkZhUGGSr+/W7uSWtI95MD4GCix4MI1Jfb+hleGoKF1/02q9d7UcuJPi685vU/Zt BDwxQLjvllN9BtdxA2r7njt7ZZ+oK6m56MgMuZVUVT70/dPjOKH0p48BtPMTQOcO+do1 VRqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@semihalf.com header.s=google header.b=FEg3yuw9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e1-20020a63db01000000b003f25a28a4afsi16312077pgg.241.2022.06.20.08.24.27; Mon, 20 Jun 2022 08:24:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@semihalf.com header.s=google header.b=FEg3yuw9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243727AbiFTPNE (ORCPT + 99 others); Mon, 20 Jun 2022 11:13:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242154AbiFTPMP (ORCPT ); Mon, 20 Jun 2022 11:12:15 -0400 Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FEB164CE for ; Mon, 20 Jun 2022 08:02:55 -0700 (PDT) Received: by mail-lj1-x230.google.com with SMTP id k20so5834326ljg.2 for ; Mon, 20 Jun 2022 08:02:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RDW0iKUe4rl0AxxyRpSUfzqnbvrj0hO4TPTr9mwh6kI=; b=FEg3yuw9zuj0apotExwlLW1q5suVP6iGt/1G6WRjuwHmcCvuxI1Tsf0SZ2F8Cn+q2t mx4RPLR22FvnM7Q+zZurckshwY6mIap7dqn2mGeElD5DaJdpjkZT/WFzsUjq7GGitpBT YB3asvifr/wTkfhr0F6EFymDcrS9lx+famqRA53ZoPQJDNrECye82zNCvZ/ifwz2S+uV 1Z8u/fhSkEBWPMruUTO5XOWnFFrcYbR6EaVbuu8zAPTJdP/2CxT8AiliZoFLiBoCuWDG 0It84USVCUeZopmhbdIUswnZvu25VRiydCuJ2tNC1BfVu1ScHheK7q3/OsO65eqXy8h2 MEpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RDW0iKUe4rl0AxxyRpSUfzqnbvrj0hO4TPTr9mwh6kI=; b=JLnxuH19yfI7o+tDy/fHxAFp1yOOpZGGv0IvAUK1aabHJnjm8YW6squd0r9NZkXSz0 KWxFbQoEG+uVxh9N13DEvcyLfhKAtj3zHf9PYDrigIjvBB/6ivucPir9pIv57BpIi/pD 0WKQcYGwXUnOR2WjAMVkLl6R/nDLx8V5lWoRns1i+oD+v617UH6GVC5McTry6j1XmMdn 3l1iKwJRNh0nvZmK4wcrC0hKxL4Kj0oOUG2qmkHYTQ28hV+ChcPfVMhSMsI/hHBJcSh4 lykD8EuTLsSbhGVnpwR1ps3BE9GxFPQkvZt5812UNY2lp2v0m0UDChMDFy67m921zNHK CP7g== X-Gm-Message-State: AJIora+YlQAD+oO7AsZXfSWu1zYVq/wQq1+t5giJWIO+ewv87oOR/BE2 LFsGAwEJonNXXDRtG3pUQ4uggaegndMjFA== X-Received: by 2002:a2e:b0ce:0:b0:25a:6ad3:1ee7 with SMTP id g14-20020a2eb0ce000000b0025a6ad31ee7mr3842974ljl.1.1655737373671; Mon, 20 Jun 2022 08:02:53 -0700 (PDT) Received: from gilgamesh.lab.semihalf.net ([83.142.187.85]) by smtp.gmail.com with ESMTPSA id e19-20020a05651236d300b0047f79f7758asm17564lfs.22.2022.06.20.08.02.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jun 2022 08:02:53 -0700 (PDT) From: Marcin Wojtas To: linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, netdev@vger.kernel.org Cc: rafael@kernel.org, andriy.shevchenko@linux.intel.com, lenb@kernel.org, andrew@lunn.ch, vivien.didelot@gmail.com, f.fainelli@gmail.com, olteanv@gmail.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux@armlinux.org.uk, hkallweit1@gmail.com, gjb@semihalf.com, mw@semihalf.com, jaz@semihalf.com, tn@semihalf.com, Samer.El-Haj-Mahmoud@arm.com, upstream@semihalf.com Subject: [net-next: PATCH 08/12] ACPI: scan: prevent double enumeration of MDIO bus children Date: Mon, 20 Jun 2022 17:02:21 +0200 Message-Id: <20220620150225.1307946-9-mw@semihalf.com> X-Mailer: git-send-email 2.29.0 In-Reply-To: <20220620150225.1307946-1-mw@semihalf.com> References: <20220620150225.1307946-1-mw@semihalf.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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