Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9933841ybi; Wed, 24 Jul 2019 12:35:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqyYsFTr8/e7KoqWQMOE26aLLxHmJ7Jw8RcxRCaOO7ezs2reTi9UnfisY8wstpdh6t8qYnG3 X-Received: by 2002:a17:902:82c4:: with SMTP id u4mr87294122plz.196.1563996936112; Wed, 24 Jul 2019 12:35:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563996936; cv=none; d=google.com; s=arc-20160816; b=zz/28YLaxcPQS7QUvrC62QAxTRrGNT8oJAD1amNuuoYbBsvAYrJxsMDJuxlSiqjG+f M4ky3KQmMZfwmGKY/ll4I5YKdqbFfksDBFx76jNM6w3jlwbJQq2OjzYACHKioh150+dJ w4wWEeWNq7MtzHvdofveXS6XBC/IBCH/7tYn8K4/wFNZBxp427CIeyUhpF7Qfu4Vc2RP TIq0IfMyjQsPk4pgDobktG/1M/YQh0PG7Msp/zgX4aFIr5z4c/YI8DC7zV9ZLgVQt7h1 qhmx9uBS/zbFP3mgsNvRfSRCnDM10EDKYelIKspts4hLHt1AFILo3AgnR3MHDBVuThdx BQXw== 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=rMw4Vyx1One4ONCB+OZ8cyVmJCX0oQRhS/2Rm1Zyo40=; b=M3a0rTDje9ZyOcBk3kMQHzTDzDAz3V0B79mRSjZO5HDApy2p+1R7+NoXaauc4IZCnD 6Z6JR+KYsKhaXms9GpsRM6mMqv5bHgALCZ8Nt7a2VwcebkqiafaJ2pKEI4gL7c+z5PXd 1ZeYksOuPxGb4xFAy1ta9quK4OVz2tjmMdanVkRAA+6qk/OFAujbHjUfpNeH3Sbvvw90 AhnI7l0SSQw8Ga7hVXljcgx7s9bP231Wm6YSJiQkOr4P1V6abiP2ra8ovkdfsTI9xJnI 0/NugBOyLF9x7p1kYJNWoiCN3taFLHWFX7Z6KJCZoWZgB6GreJdwASnACCchHp9c8D2d cbqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1HikBzr5; 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 u2si14899607pgm.242.2019.07.24.12.35.21; Wed, 24 Jul 2019 12:35:36 -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=1HikBzr5; 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 S1728467AbfGXTe3 (ORCPT + 99 others); Wed, 24 Jul 2019 15:34:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:56892 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388095AbfGXTe3 (ORCPT ); Wed, 24 Jul 2019 15:34:29 -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 CFE7520659; Wed, 24 Jul 2019 19:34:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563996868; bh=9g7CCjjavbfNXhLex0hZ7r+JBm+d9AM+T5LNW3TD2NM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1HikBzr5sWOn58vKv8Yzjf+iUUf1guoRpAKi18WT2h5cw/W9aoXIvyJFMQNJNmlXN 31j/FJP5lGXoPPTS3yMGuS5nJ6f1d/y+uHO9DyejEmfD1/jWVgkRgKyZtzlvs3dtOD 41yYTrhBMGqjKtcwOMrg/24hqsTqR30AU5YDyWAY= 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 5.2 243/413] net: mvmdio: defer probe of orion-mdio if a clock is not ready Date: Wed, 24 Jul 2019 21:18:54 +0200 Message-Id: <20190724191752.806971039@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191735.096702571@linuxfoundation.org> References: <20190724191735.096702571@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 c5dac6bd2be4..903836e334d8 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]); @@ -362,6 +366,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