From patchwork Tue Apr 30 08:37:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herve Codina X-Patchwork-Id: 13648636 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B16F7C4345F for ; Tue, 30 Apr 2024 09:45:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5e1kXzcsDKx/Yo4ITXpy+3wx9nAXvPNQZ1BIvnEpzY4=; b=QRQYSA+thfYXUB SR6YMrrPkT9vX7rVZvOqtrDfRijBCpn0FwLnrPAobd+uTMBClylbCyZCNl8+4LfLGkTdJs60BERR8 SJUH8GcvZheoRvI6ZTP6kE50/HwD9M+yzCmepzn05xRdpEE1Nef9yz/Bdbgmn0WMMqXjwOiu+7t8Z Efp0LDiBmgPiM2DCOcSC56P+7PuYx1ihIiskD8zSEolsdqAHz7NY8TpejE6ch6CPS1juuoJDjyT8+ lg2k1qNUUtYKBZqVjcv+r0xt5EOcXgjCW9c84tQiv6Lgp3poVBAkC5iaxTOhYZE5AQImKuYSXZ0yU QqZ7684XgqPr3lYHB6NQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1k3J-00000005tGz-0jvr; Tue, 30 Apr 2024 09:45:33 +0000 Received: from relay7-d.mail.gandi.net ([2001:4b98:dc4:8::227]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1j1F-00000005dNh-3GP4 for linux-arm-kernel@lists.infradead.org; Tue, 30 Apr 2024 08:39:23 +0000 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> MIME-Version: 1.0 X-GND-Sasl: herve.codina@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240430_013922_069642_9F99808F X-CRM114-Status: GOOD ( 12.97 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 --- 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))