Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1877456lqa; Tue, 30 Apr 2024 01:41:25 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX8Zdsqfog9CIfvPVbohZJXrMmuU/kHrSp+8X5EM4r0RilgZ31Cw9VMiqT9RCgy030vevfQ4Kab8AxDgQQ9hiRa/6Dhu0QHoMH4lk05Dg== X-Google-Smtp-Source: AGHT+IFFBb6em0cRwyfjCE04ggQxPQBYSoZsDa/DZv1D19YvHAmO+8DrN4zFsYEEYujJm/WstDfw X-Received: by 2002:ad4:5ec6:0:b0:6a0:c931:d08e with SMTP id jm6-20020ad45ec6000000b006a0c931d08emr1982568qvb.30.1714466484820; Tue, 30 Apr 2024 01:41:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714466484; cv=pass; d=google.com; s=arc-20160816; b=vdnbv5uryK8ohMB/qClXWxublpSz+hPKBQ5PWgPjqXe/EV5YF8W1BrH5tsHHskbOWP r98MQAX8S34uOXW/EN/KepwBrqfzzDyWD9qHH3YlQutSIZzepwSZN4RzPHPI/Hn/V1D7 TY+HFhLTy8wITJ4fu3fZDedNUoFMYn5+kqM+5A4zO/2VED/cbqo4JfbnHilrWbrL99S8 Ftjr5fU41KXJRxxolPRVVN8kc2ERVwAiZs1RSIfVha1Xhw5/YRnadk+koLKhJC3HL+4v F1pIzwjd0WqiqvybNdPTWHNb9gmuC96AZvs7YYwGImhbOttVlJL1qofoSuthHCM187/H pVfg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=dJSqGEJGADbhF8fZ9qZ11gAumSDZqofEqkJWMC7XU28=; fh=wLJMNfcbOxpEep4AozbD3QJkKmGbYz7NO97H9PCORXg=; b=nWq8UG3R82PjuE8Yl+3ktVcIKzFvyH7G3UrhCCucImGW6bMAmP9SJO2gxa6vywiUjz 7EbwngeKD0UVV9ZpiqpK+j9ICF+g2yWGhxQTm0A7FxOokBkUqq+J8texpoXmB8mnnyjK eb+h6UU1sn8TyyiC2x4n3WUDMNem6l3RyfeRbtDrNj7GAb9hxzn+X+ryVzZJ0dnrXUu1 F4xwg0s0AZHyGJBCEB9UvORQu4T0HH070gYTNHvBw0OXlckNF/IegXZRPDbzkHReHklc eCSucseema6LD2cBa9JpuwL5eHAIAk7kRpIHKYv33kQCJZai7hOz6t/xqq5gTgKliYys NZoQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=PkKYwEje; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-163557-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163557-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id jz10-20020a0562140e6a00b006a0d71437f6si2443057qvb.535.2024.04.30.01.41.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 01:41:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-163557-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=PkKYwEje; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-163557-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163557-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 620FB1C22B2B for ; Tue, 30 Apr 2024 08:41:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CCAB3199EA6; Tue, 30 Apr 2024 08:39:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="PkKYwEje" Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F01A9146D60; Tue, 30 Apr 2024 08:39:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.200 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714466364; cv=none; b=SLUZQNMxMmiW9N7M7KCyQTWtQPTvOMtkOC+GLo/K3h084DJXiRoF/O1ylGw99SY1zRgvKz7HiPNyBrA691LIiqEmUuD4KxRUG2O8eGyLAePGa7TqZgTJ4AD2ZUixn7g1hvaPCEN3rqcGVzyIHB3SAuD/uh7iveIvtcg6tZ72wwo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714466364; c=relaxed/simple; bh=UkUmDmxYo9Z/orbhrhvuP0Jxzv03WEWdvOtiwQ6A4GA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=O3MxDiaV+FiO8Wfs7ZtsmC3A8WqBzmuTAXAUGei/JpyOdB6b5vlbNfM2omKhuUTuDUY15aXljZSdExmhrjV9CXus0VUUGV1SqTCG4zFhY4syiXcvAt34Z3ZC5OVyunl3uxsBC+Otc+TJRm1CjtWGN+q+1vajF22OMM48Fc51+Ik= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=PkKYwEje; arc=none smtp.client-ip=217.70.183.200 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPA id BB5E320015; Tue, 30 Apr 2024 08:39:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1714466360; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dJSqGEJGADbhF8fZ9qZ11gAumSDZqofEqkJWMC7XU28=; b=PkKYwEjepQFKsmPU6ES8oP7VCvNCO36bwkdceo9QDNFq/F7RZ3nr1wEqVMQXpLNRsfS8bd cziQpMvEEs/fkqqFQOdR6e68ArlctCWQB9WEpulWhkT6eVQOzmEe6bzKt0jSQoW3s6eRlq tenycx1I7v3xqyhPDekJWpV8ny+LFellPQStsWMbmexdypZw5VkNzsdpg9cxHNQY7WjyAA qDxU7JA8FCyv5rt3jo5PFEuL/OjqoSibtnRLJTCIUpEH/cWz075udAmO4FrGSZFM8ShcZE 9i/ubSDBuQuKESoZ6SPibEipQ6xeCEEHBF8x7i51AzUs7UCl/H0+dzJ/m5HEfw== From: Herve Codina To: Herve Codina , Thomas Gleixner , Rob Herring , Krzysztof Kozlowski , Conor Dooley , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Lee Jones , Arnd Bergmann , Horatiu Vultur , UNGLinuxDriver@microchip.com, Andrew Lunn , Heiner Kallweit , Russell King , Saravana Kannan , Bjorn Helgaas , Philipp Zabel , Lars Povlsen , Steen Hegelund , Daniel Machon , Alexandre Belloni Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, netdev@vger.kernel.org, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Allan Nielsen , Steen Hegelund , Luca Ceresoli , Thomas Petazzoni Subject: [PATCH 07/17] net: mdio: mscc-miim: Handle the switch reset Date: Tue, 30 Apr 2024 10:37:16 +0200 Message-ID: <20240430083730.134918-8-herve.codina@bootlin.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240430083730.134918-1-herve.codina@bootlin.com> References: <20240430083730.134918-1-herve.codina@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-GND-Sasl: herve.codina@bootlin.com The mscc-miim device can be impacted by the switch reset, at least when this device is part of the LAN966x PCI device. Handle this newly added (optional) resets property. Signed-off-by: Herve Codina --- drivers/net/mdio/mdio-mscc-miim.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/mdio/mdio-mscc-miim.c b/drivers/net/mdio/mdio-mscc-miim.c index c29377c85307..6a6c1768f533 100644 --- a/drivers/net/mdio/mdio-mscc-miim.c +++ b/drivers/net/mdio/mdio-mscc-miim.c @@ -19,6 +19,7 @@ #include #include #include +#include #define MSCC_MIIM_REG_STATUS 0x0 #define MSCC_MIIM_STATUS_STAT_PENDING BIT(2) @@ -270,11 +271,18 @@ static int mscc_miim_probe(struct platform_device *pdev) { struct device_node *np = pdev->dev.of_node; struct regmap *mii_regmap, *phy_regmap; + struct reset_control *reset; struct device *dev = &pdev->dev; struct mscc_miim_dev *miim; struct mii_bus *bus; int ret; + reset = devm_reset_control_get_optional_shared(dev, "switch"); + if (IS_ERR(reset)) + return dev_err_probe(dev, PTR_ERR(reset), "Failed to get reset\n"); + + reset_control_reset(reset); + mii_regmap = ocelot_regmap_from_resource(pdev, 0, &mscc_miim_regmap_config); if (IS_ERR(mii_regmap)) -- 2.44.0