From patchwork Mon May 27 16:14:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herve Codina X-Patchwork-Id: 13675604 X-Patchwork-Delegate: kuba@kernel.org Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) (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 8E949169387; Mon, 27 May 2024 16:15:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.199 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716826514; cv=none; b=HBHQcKCHVy+myPxVSFxWOqLJBAHJu8SPWPToPtzNs0msFWcpwgxosZNj7gE7FLSarL5a9hcZndQjJamQvv0T7WjovTHTY3nEjp7dERd05gudVOf2fFNVylbIKnDdi13YUpn4q+4bDxo0AqoIesiriJBTuS6oRFpVu2xd1HlxCrA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716826514; c=relaxed/simple; bh=7biFMyr8CXy0R1UVAUiDgnLTqYU6ZUjkIFA6XHx8ITY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=V8VJ5NYpgaCl8t3tUoHktzoGSHWdzjG83vWiqzrBPq2woHxDSo6vWUZxPqnEjsStIt7oWXyhuohe9YOGU7mJ5noL1nUgfFE+eZ1cf7VQmrZoAZEl+MQxHr5gxlEQ69rkfu1QtGrOsvTMx7hvwlen6d6w/zQnT9FfnvmNAL09uXc= 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=nRG74e6A; arc=none smtp.client-ip=217.70.183.199 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="nRG74e6A" Received: by mail.gandi.net (Postfix) with ESMTPA id E9899FF80C; Mon, 27 May 2024 16:15:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1716826511; 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=C0FElzUrrqTg+6Zrh4rlEJ/rv8Dcx7Vbub0Y2cEk6FE=; b=nRG74e6ADGPIgwQsZuZBPe2LcWBuaXAzegAM7AbrhXlZhxCR880uyAgg/LWEAxtQpaMRmE AQqGHgGFzWjTc6p2gKF1Iaz1tIPSpYJjQDvQDTa08KCTB82evOwKwFxsQhGn2LHimY6Pot dWuga1MB+Dc00u7OKeXCacQQOqOOLOYWWKs1uwwDD6w7GMynB9tFljHGdHiWZFKa0XZ2gK pqAvbGL59bvXUHBIH4bxYe2sm+fj3RpXGgZaZ6frFHlmaxkw4gOqSYbKsjJuz1hQbOUX6p 178Afcvx1Hz6ie/kn6DykBmZQBr+6SFaxhSHJB45DFaZCXgHrD4ZpzafnzJovA== From: Herve Codina To: Simon Horman , Sai Krishna Gajula , 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 v2 07/19] net: mdio: mscc-miim: Handle the switch reset Date: Mon, 27 May 2024 18:14:34 +0200 Message-ID: <20240527161450.326615-8-herve.codina@bootlin.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240527161450.326615-1-herve.codina@bootlin.com> References: <20240527161450.326615-1-herve.codina@bootlin.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-GND-Sasl: herve.codina@bootlin.com X-Patchwork-Delegate: kuba@kernel.org 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 Reviewed-by: Andrew Lunn --- 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..62c47e0dd142 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) @@ -271,10 +272,17 @@ static int mscc_miim_probe(struct platform_device *pdev) struct device_node *np = pdev->dev.of_node; struct regmap *mii_regmap, *phy_regmap; struct device *dev = &pdev->dev; + struct reset_control *reset; 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))