Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp827296ybi; Thu, 30 May 2019 07:22:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqwBlAzttY3nauBlcpHyAupC+Ick7RZZwJODBCP1X6h1DuiJdsAb1oax5piXxkQ/Wv7qZ/P7 X-Received: by 2002:a17:90a:d14c:: with SMTP id t12mr3989784pjw.120.1559226135062; Thu, 30 May 2019 07:22:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559226135; cv=none; d=google.com; s=arc-20160816; b=j5xCvhCsbbEbqemn/bbRW/BwuazrAf5puPGQ19YmCzG/BvYi9ketwdkyxpK9Hsy/y1 8X7p1F14lPUeSA/KR8eMjp6MNxCjRqU8W0FdOwdrp7r7yiQVoxTDYCEBPnFYd5VlPazD jqywV3DXqqQ1MuhCNxwWvx2eSLpmwbHjfddxMw9xPRE3/gRkwIKv8Oqe4YgfnSVceYg1 nreAeBg46UowVsGiZmKH2svTX9XsG+HJmLR1/SWg44/+mDhpL/Bik66mPRFoLlCMd1oP +kLqNx90xPDvpY6OW7DaT98+zBt6FR1s5GoD0bm2/MDfPm8/H0bqA09FpMjNahYeyhE2 Yo6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=nplyWAFTVorj0kYUidyzBAbgSjWphtLEdcbXumYhc1U=; b=FjrqmJaK2G2AQPkgpNz9FlHB/1QD94MSymNDdFvacS8muF5jOKhs+fGNm70kXELfsU qK6KAun5Y5Ry7+lFl9hXioKWCyU43ipCrzFiq/D232vyI6yIwW4qaVMVqe8zb4W5x178 T78L86Ca0wPr+Ar8i9+3gDAgmRABv2vi/eEUYwUaeb2mjRlaLQTg53vBC8z9z8B+q013 6tU4NnfQvzsqpRjCr1rmDlhh8H9loo+usaZRMimhRWYYQjGPQsTwH5o/xWb3KBC5I97n 0/ZEBF8q8o4dMN3mX4PPAfg1Ku7yzpFwiXx9ZOXw2V5UGA45NsVRhY1w7arzN5v4z2Qm pK8w== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o12si3284197pgp.96.2019.05.30.07.21.57; Thu, 30 May 2019 07:22:15 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727395AbfE3OUY (ORCPT + 99 others); Thu, 30 May 2019 10:20:24 -0400 Received: from inva020.nxp.com ([92.121.34.13]:49024 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726498AbfE3OT5 (ORCPT ); Thu, 30 May 2019 10:19:57 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 63FE91A0179; Thu, 30 May 2019 16:19:55 +0200 (CEST) Received: from inva024.eu-rdc02.nxp.com (inva024.eu-rdc02.nxp.com [134.27.226.22]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 57C171A016B; Thu, 30 May 2019 16:19:55 +0200 (CEST) Received: from fsr-ub1864-101.ea.freescale.net (fsr-ub1864-101.ea.freescale.net [10.171.82.13]) by inva024.eu-rdc02.nxp.com (Postfix) with ESMTP id C38CA2026B; Thu, 30 May 2019 16:19:54 +0200 (CEST) From: laurentiu.tudor@nxp.com To: netdev@vger.kernel.org, madalin.bucur@nxp.com, roy.pledge@nxp.com, camelia.groza@nxp.com, leoyang.li@nxp.com Cc: Joakim.Tjernlund@infinera.com, davem@davemloft.net, iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Laurentiu Tudor Subject: [PATCH v3 3/6] dpaa_eth: defer probing after qbman Date: Thu, 30 May 2019 17:19:48 +0300 Message-Id: <20190530141951.6704-4-laurentiu.tudor@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190530141951.6704-1-laurentiu.tudor@nxp.com> References: <20190530141951.6704-1-laurentiu.tudor@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Laurentiu Tudor Enabling SMMU altered the order of device probing causing the dpaa1 ethernet driver to get probed before qbman and causing a boot crash. Add predictability in the probing order by deferring the ethernet driver probe after qbman and portals by using the recently introduced qbman APIs. Signed-off-by: Laurentiu Tudor Acked-by: Madalin Bucur --- .../net/ethernet/freescale/dpaa/dpaa_eth.c | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c index d3f2408dc9e8..975f307f0caa 100644 --- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c @@ -2774,6 +2774,37 @@ static int dpaa_eth_probe(struct platform_device *pdev) int err = 0, i, channel; struct device *dev; + err = bman_is_probed(); + if (!err) + return -EPROBE_DEFER; + if (err < 0) { + dev_err(&pdev->dev, "failing probe due to bman probe error\n"); + return -ENODEV; + } + err = qman_is_probed(); + if (!err) + return -EPROBE_DEFER; + if (err < 0) { + dev_err(&pdev->dev, "failing probe due to qman probe error\n"); + return -ENODEV; + } + err = bman_portals_probed(); + if (!err) + return -EPROBE_DEFER; + if (err < 0) { + dev_err(&pdev->dev, + "failing probe due to bman portals probe error\n"); + return -ENODEV; + } + err = qman_portals_probed(); + if (!err) + return -EPROBE_DEFER; + if (err < 0) { + dev_err(&pdev->dev, + "failing probe due to qman portals probe error\n"); + return -ENODEV; + } + /* device used for DMA mapping */ dev = pdev->dev.parent; err = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(40)); -- 2.17.1