Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2155722lqb; Mon, 27 May 2024 09:30:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUbQv1nVxcMTbh8PhRFVM+RRcwNRiHdgs16++XCb9yZb1d1tRPQ6TG494wWHTqRn6YCCnYxh3UtYALglx3MRDfGLynI+dSKEcT4tv5U+w== X-Google-Smtp-Source: AGHT+IF/iheDFM7XJEckfVVuuz9QCiA3R9kiRsiuA0a58FJ6eJEN0F7C2qC28IFO3u8WqBkTRdn9 X-Received: by 2002:a17:902:f54b:b0:1f4:b7ff:ac4f with SMTP id d9443c01a7336-1f4b7ffb0camr12149135ad.50.1716827450902; Mon, 27 May 2024 09:30:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716827450; cv=pass; d=google.com; s=arc-20160816; b=jdnKnJcnYYap3Q+waWKX27+JopPWOXwkz7PQTMDo3Qrvb7Hu374UD/QWOrQoSfHmHx ISFxKs303OJY8+0tPeNw/EorpTDLFf8m1mEu2TZjxL6NWYLMmHYubLLq6gUy2MUgz9aQ tjhDu5MUmw3OEimf983044X1GRDQtIgWAQFbZivIE+O7rlYhTJVgcGNZJtuvRUItAIiv pyZBTwcFn+my6m4eA3KiNHr84VL9FxxHHxS/VYhOFxL7dSLD5AOvjfCIb6K1beIB6cfs l6OQvFZBJw2h7GjFNsLYfVOf9MYdMExZ0VK0FflMWxmV9t9Pec9qBXn+rOQZza2NRlB1 ViaA== 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=C0FElzUrrqTg+6Zrh4rlEJ/rv8Dcx7Vbub0Y2cEk6FE=; fh=3YQ9Wn9iIS51y8NrdlOvPTQ4lFTakVN5LX1zxHYgQ/4=; b=I/L4c/chnuNeoay9MNqebQcD9qPZaWDsIy6+L4pU6pFeTnLgQ8WOFGd92K/uJVHB3g 0KQ4Flx8FZK/L5RZLit43FrgEJIZivMeJrYQ5M2NqPfYHJnR2rjHghwT0OK1dC77tKL2 fcqa01AG05OqYPGYwAvQSvVvN6wWSUsclMPym3QshZ7ordja1OOUq6+0GJNP9HdB/BkA vP5ml6sNbH6Uq3E5rzHmqL43yd4LP4aQpsr5i91jIQlkcOYcvNRiYGQ5Wfui37E2RJCi Gnw95Jy58cjSd7Hl6Mnegh0HOWe0oj75iEO3mUgsJT7BLA1qxFYWzWfcpB8wqeUx30Qr jF7A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=nRG74e6A; 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-191218-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191218-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1f47bde552bsi35125875ad.355.2024.05.27.09.30.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 09:30:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-191218-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=nRG74e6A; 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-191218-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-191218-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 7D3B8286EE0 for ; Mon, 27 May 2024 16:23:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8551616A368; Mon, 27 May 2024 16:15:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="nRG74e6A" 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 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: 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..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)) -- 2.45.0