Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3785158ybi; Mon, 29 Jul 2019 12:34:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqys00C9I6wVTWE+GEdAYbHQe6Ub+WOsct1Rh9rIfrthfp6o9c1AyBRmcKjDjftYzCgYDO6x X-Received: by 2002:a17:90a:9505:: with SMTP id t5mr112509367pjo.96.1564428871089; Mon, 29 Jul 2019 12:34:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564428871; cv=none; d=google.com; s=arc-20160816; b=krc8ywyXXuO7N7XpmRI/OPRhlmE/PePX7UzliuYsz+PLV59a963ItPN6+0vHjk6PZ2 h6p2nIN9yjv0JhqVkir6gvsrWTUl6Uv9bRKc29qQKt0AkHe+10vGrr2WcqqOG5/pgEw0 f2auS+hEMOf4TBnnf8E7R8GQ4WdwO5UOuzng/K8uLzBaJGoPrcmLFKKXAQp9Y5/S2Cmm ZT2l8qJRqtRkwbicVqJutyF+anP9IafnANBkkP9xlguBOde/B4cNgpZxBEXVvvHFP0FQ eO/lMCKykKs79B0e9WAgsnNxNeSh6ysOik7Zvh7YaSkjl3eKz8rFvCIL1DehxmueCx6g Rvqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=qMfKR5qi4LXGcAEQGfFJwJlVQwhr1sXTXqLtuyYFZP0=; b=TsTFjH59CDywOfZtjh9fnzuY2D/JF/w5dsYutN8weouiLqZ25BI5GYrXIeWZa4N5S1 1q/nfoPjBC4eu7cqckHf9SjlwMIsSVHtKDy/1zOJ7if1bs+ItErnAnPILRBRmGpctjkF F/CfNZDKXUUlCGkf/ElefpvAS4h4lfjZ4wo8LKRS1wZeGT60Kt+aRwmZTvcc8Z5kL7HI dCUkqn7Qalj3K2x9cwhnuZ5W9EwtgRZArROeZ6XJ7CaQecoGJF1x1kMWnTVBKNZD1pvD yC+u2x4yfetXB/LnGTgJ3zmspO+ueDnGzLVRU6haDxn+j9XpWfWOZqG/sy0tQpH9hPOR kgRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GE0zLtLt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w10si6233111pgs.529.2019.07.29.12.34.16; Mon, 29 Jul 2019 12:34:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GE0zLtLt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727219AbfG2TbJ (ORCPT + 99 others); Mon, 29 Jul 2019 15:31:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:43660 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387892AbfG2Ta6 (ORCPT ); Mon, 29 Jul 2019 15:30:58 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DAD8621655; Mon, 29 Jul 2019 19:30:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564428657; bh=fU3UnuMBjDgUm7hIGIcuYB2m6R+nbC4p4CIJ7XixsRA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GE0zLtLtHpjhyz4y8vwLkqABmBMjlq1Z9LRyi7wiCVLXU1bJgh7nHunStdke62a3H FEfy9RubqS8F24vOYLL73VMFcXBdb/VD7jjecqWwN71lJp8fAIz12/rW1K3SOBZ8jb d5dJE4cN6T2ie6471cOpHAson8bnSbXareBZ1iO8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Josua Mayer , Andrew Lunn , "David S. Miller" , Sasha Levin Subject: [PATCH 4.14 105/293] net: mvmdio: defer probe of orion-mdio if a clock is not ready Date: Mon, 29 Jul 2019 21:19:56 +0200 Message-Id: <20190729190832.698874728@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190820.321094988@linuxfoundation.org> References: <20190729190820.321094988@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 433a06d7d74e677c40b1148c70c48677ff62fb6b ] Defer probing of the orion-mdio interface when getting a clock returns EPROBE_DEFER. This avoids locking up the Armada 8k SoC when mdio is used before all clocks have been enabled. Signed-off-by: Josua Mayer Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/marvell/mvmdio.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/ethernet/marvell/mvmdio.c b/drivers/net/ethernet/marvell/mvmdio.c index 0495487f7b42..c8e3c1119313 100644 --- a/drivers/net/ethernet/marvell/mvmdio.c +++ b/drivers/net/ethernet/marvell/mvmdio.c @@ -321,6 +321,10 @@ static int orion_mdio_probe(struct platform_device *pdev) for (i = 0; i < ARRAY_SIZE(dev->clk); i++) { dev->clk[i] = of_clk_get(pdev->dev.of_node, i); + if (PTR_ERR(dev->clk[i]) == -EPROBE_DEFER) { + ret = -EPROBE_DEFER; + goto out_clk; + } if (IS_ERR(dev->clk[i])) break; clk_prepare_enable(dev->clk[i]); @@ -365,6 +369,7 @@ static int orion_mdio_probe(struct platform_device *pdev) if (dev->err_interrupt > 0) writel(0, dev->regs + MVMDIO_ERR_INT_MASK); +out_clk: for (i = 0; i < ARRAY_SIZE(dev->clk); i++) { if (IS_ERR(dev->clk[i])) break; -- 2.20.1