linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: laurentiu.tudor@nxp.com
To: devicetree@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Cc: roy.pledge@nxp.com, madalin.bucur@nxp.com, davem@davemloft.net,
	shawnguo@kernel.org, leoyang.li@nxp.com, robin.murphy@arm.com,
	bharat.bhushan@nxp.com, Laurentiu Tudor <laurentiu.tudor@nxp.com>
Subject: [PATCH v2 06/22] soc/fsl/qman_portals: defer probe after qman's probe
Date: Wed, 26 Sep 2018 16:22:31 +0300	[thread overview]
Message-ID: <20180926132247.10971-7-laurentiu.tudor@nxp.com> (raw)
In-Reply-To: <20180926132247.10971-1-laurentiu.tudor@nxp.com>

From: Laurentiu Tudor <laurentiu.tudor@nxp.com>

Defer probe of qman portals after qman probing. This fixes the crash
below, seen on NXP LS1043A SoCs:

Unable to handle kernel NULL pointer dereference at virtual address
0000000000000004
Mem abort info:
  ESR = 0x96000004
  Exception class = DABT (current EL), IL = 32 bits
  SET = 0, FnV = 0
  EA = 0, S1PTW = 0
Data abort info:
  ISV = 0, ISS = 0x00000004
  CM = 0, WnR = 0
[0000000000000004] user address but active_mm is swapper
Internal error: Oops: 96000004 [#1] PREEMPT SMP
Modules linked in:
CPU: 0 PID: 1 Comm: swapper/0 Not tainted
4.18.0-rc1-next-20180622-00200-g986f5c179185 #9
Hardware name: LS1043A RDB Board (DT)
pstate: 80000005 (Nzcv daif -PAN -UAO)
pc : qman_set_sdest+0x74/0xa0
lr : qman_portal_probe+0x22c/0x470
sp : ffff00000803bbc0
x29: ffff00000803bbc0 x28: 0000000000000000
x27: ffff0000090c1b88 x26: ffff00000927cb68
x25: ffff00000927c000 x24: ffff00000927cb60
x23: 0000000000000000 x22: 0000000000000000
x21: ffff0000090e9000 x20: ffff800073b5c810
x19: ffff800027401298 x18: ffffffffffffffff
x17: 0000000000000001 x16: 0000000000000000
x15: ffff0000090e96c8 x14: ffff80002740138a
x13: ffff0000090f2000 x12: 0000000000000030
x11: ffff000008f25000 x10: 0000000000000000
x9 : ffff80007bdfd2c0 x8 : 0000000000004000
x7 : ffff80007393cc18 x6 : 0040000000000001
x5 : 0000000000000000 x4 : ffffffffffffffff
x3 : 0000000000000004 x2 : ffff00000927c900
x1 : 0000000000000000 x0 : 0000000000000004
Process swapper/0 (pid: 1, stack limit = 0x(____ptrval____))
Call trace:
 qman_set_sdest+0x74/0xa0
 platform_drv_probe+0x50/0xa8
 driver_probe_device+0x214/0x2f8
 __driver_attach+0xd8/0xe0
 bus_for_each_dev+0x68/0xc8
 driver_attach+0x20/0x28
 bus_add_driver+0x108/0x228
 driver_register+0x60/0x110
 __platform_driver_register+0x40/0x48
 qman_portal_driver_init+0x20/0x84
 do_one_initcall+0x58/0x168
 kernel_init_freeable+0x184/0x22c
 kernel_init+0x10/0x108
 ret_from_fork+0x10/0x18
Code: f9400443 11001000 927e4800 8b000063 (b9400063)
---[ end trace 4f6d50489ecfb930 ]---
Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
---
 drivers/soc/fsl/qbman/qman_portal.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/soc/fsl/qbman/qman_portal.c b/drivers/soc/fsl/qbman/qman_portal.c
index 6d9da3b1b5ad..eef93cab84f1 100644
--- a/drivers/soc/fsl/qbman/qman_portal.c
+++ b/drivers/soc/fsl/qbman/qman_portal.c
@@ -229,6 +229,14 @@ static int qman_portal_probe(struct platform_device *pdev)
 	int irq, cpu, err;
 	u32 val;
 
+	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;
+	}
+
 	pcfg = devm_kmalloc(dev, sizeof(*pcfg), GFP_KERNEL);
 	if (!pcfg)
 		return -ENOMEM;
-- 
2.17.1


  parent reply	other threads:[~2018-09-26 13:22 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-26 13:22 [PATCH v2 00/22] SMMU enablement for NXP LS1043A and LS1046A laurentiu.tudor
2018-09-26 13:22 ` [PATCH v2 01/22] soc/fsl/qman: fixup liodns only on ppc targets laurentiu.tudor
2018-09-26 13:22 ` [PATCH v2 02/22] soc/fsl/bman: map FBPR area in the iommu laurentiu.tudor
2018-09-26 13:22 ` [PATCH v2 03/22] soc/fsl/qman: map FQD and PFDR areas " laurentiu.tudor
2018-09-26 13:22 ` [PATCH v2 04/22] soc/fsl/qman-portal: map CENA area " laurentiu.tudor
2018-09-26 13:22 ` [PATCH v2 05/22] soc/fsl/qbman: add APIs to retrieve the probing status laurentiu.tudor
2018-09-27 20:37   ` Li Yang
2018-09-26 13:22 ` laurentiu.tudor [this message]
2018-09-27 20:37   ` [PATCH v2 06/22] soc/fsl/qman_portals: defer probe after qman's probe Li Yang
2018-09-26 13:22 ` [PATCH v2 07/22] soc/fsl/bman_portals: defer probe after bman's probe laurentiu.tudor
2018-09-27 20:40   ` Li Yang
2018-09-26 13:22 ` [PATCH v2 08/22] soc/fsl/qbman_portals: add APIs to retrieve the probing status laurentiu.tudor
2018-09-27 20:03   ` Li Yang
2018-10-03 10:50     ` Laurentiu Tudor
2018-10-03 12:27       ` Robin Murphy
2018-09-26 13:22 ` [PATCH v2 09/22] fsl/fman: backup and restore ICID registers laurentiu.tudor
2018-09-26 13:22 ` [PATCH v2 10/22] fsl/fman: add API to get the device behind a fman port laurentiu.tudor
2018-09-26 13:22 ` [PATCH v2 11/22] dpaa_eth: defer probing after qbman laurentiu.tudor
2018-09-26 13:22 ` [PATCH v2 12/22] dpaa_eth: base dma mappings on the fman rx port laurentiu.tudor
2018-09-26 13:22 ` [PATCH v2 13/22] dpaa_eth: fix iova handling for contiguous frames laurentiu.tudor
2018-09-26 13:22 ` [PATCH v2 14/22] dpaa_eth: fix iova handling for sg frames laurentiu.tudor
2018-09-26 13:22 ` [PATCH v2 15/22] dpaa_eth: fix SG frame cleanup laurentiu.tudor
2018-09-26 13:22 ` [PATCH v2 16/22] arm64: dts: ls1046a: add smmu node laurentiu.tudor
2018-09-26 13:22 ` [PATCH v2 17/22] arm64: dts: ls1043a: " laurentiu.tudor
2018-09-26 13:22 ` [PATCH v2 18/22] arm64: dts: ls104xa: set mask to drop TBU ID from StreamID laurentiu.tudor
2018-09-26 13:22 ` [PATCH v2 19/22] arm64: dts: ls104x: add missing dma ranges property laurentiu.tudor
2018-09-26 13:22 ` [PATCH v2 20/22] arm64: dts: ls104x: add iommu-map to pci controllers laurentiu.tudor
2018-09-26 13:22 ` [PATCH v2 21/22] arm64: dts: ls104x: make dma-coherent global to the SoC laurentiu.tudor
2018-09-26 13:22 ` [PATCH v2 22/22] arm64: dts: ls104x: use a pseudo-bus to constrain usb dma size laurentiu.tudor
2018-09-27 13:39 ` [PATCH v2 00/22] SMMU enablement for NXP LS1043A and LS1046A Madalin-cristian Bucur

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180926132247.10971-7-laurentiu.tudor@nxp.com \
    --to=laurentiu.tudor@nxp.com \
    --cc=bharat.bhushan@nxp.com \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=leoyang.li@nxp.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=madalin.bucur@nxp.com \
    --cc=netdev@vger.kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=roy.pledge@nxp.com \
    --cc=shawnguo@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).