mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Robert Jarzmik <robert.jarzmik@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
	barebox@lists.infradead.org,
	Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Subject: Re: [PATCH 00/17] Armada 370/XP NAND driver
Date: Tue, 13 Oct 2015 12:54:28 +0200	[thread overview]
Message-ID: <20151013105428.GJ7858@pengutronix.de> (raw)
In-Reply-To: <87wpur3ves.fsf@belgarion.home>

On Tue, Oct 13, 2015 at 12:38:51PM +0200, Robert Jarzmik wrote:
> Sascha Hauer <s.hauer@pengutronix.de> writes:
> 
> > In your temporary patch you have:
> >
> >> @@ -67,6 +71,9 @@ static int zylonite_devices_init(void)
> >>  			   &smsc91x_pdata);
> >>  	add_generic_device("mrvl_nand", DEVICE_ID_DYNAMIC, NULL,
> >>  			   0x43100000, 0x1000, IORESOURCE_MEM, &nand_pdata);
> >> +	clk = clk_get_sys("nand", NULL);
> >> +	if (!IS_ERR(clk))
> >> +		clkdev_add_physbase(clk, 0x43100000, NULL);
> >
> > Could it be that you register the clk lookup after the nand driver is probed? This
> > hunk should be moved before the nand device registration.
> That's what I had thought, but changing the order gave me a panic, so I didn't
> push forward.
> 
> This is what I had, decoded in [1].
> 
> Cheers.
> 
> --
> Robert
> 
> [1] My backtrace with the inversion :
> 
> barebox@Zylonite:/ bootm /mnt/tftp/barebox.bin
> bootm /mnt/tftp/barebox.bin
> netconsole: netconsole initialized with 255.255.255.255:6662
> eth0: 100Mbps full duplex link detected
> DHCP client bound to address 192.168.1.232
> 
> Loading ARM barebox image '/mnt/tftp/barebox.bin'
> commandline: ram=64M console=ttyS0,115200   mtdparts=pxa3xx_nand-0:128k@0(TIMH)ro,128k@128k(OBMI)ro,768k@256k(barebox),256k@1024k(barebox-env),12M@1280k(kernel),38016k@13568k(root)
> arch_number: 1233
> netconsole: port not set
> netconsole: registered as netconsole-1
> smc91c111 smc91c1110: chip is revision= 9, version= 2
> mdio_bus: miibus0: probed
> eth0: got preset MAC address: 00:0e:0c:a7:26:f7
> zylonite_devices_init(): clk = 83703328
> alloc_nand_resource(): clk_get() -> 83703328
> unable to handle NULL pointer dereference at address 0x00000004
> pc : [<83f15b9c>]    lr : [<83f15b90>]
> sp : 83fffed0  ip : 000001b0  fp : 00000000
> r10: 00000002  r9 : 83706888  r8 : 83f8c88c
> r7 : 00000000  r6 : 00000000  r5 : 83706948  r4 : 00000000
> r3 : 83706888  r2 : 43100000  r1 : 83f60783  r0 : 00000000
> Flags: nZCv  IRQs off  FIQs off  Mode SVC_32
> (mrvl_nand_probe+0x1ac/0x650) from device_probe (/drivers/base/driver.c:93)
> (device_probe+0x30/0xb8) from match.part.3 (/drivers/base/driver.c:153)
> (match.part.3+0x44/0x54) from register_device (/drivers/base/driver.c:192)
> (register_device+0x120/0x15c) from add_generic_device (/drivers/base/resource.c:84)
> (add_generic_device+0x3c/0x48) from zylonite_devices_init (/arch/arm/boards/zylonite/board.c:78)
> (zylonite_devices_init+0x9c/0x108) from start_barebox (/common/startup.c:101)
> (start_barebox+0x30/0xe8) from __start (/arch/arm/cpu/start.c:142)
> (__start+0x124/0x13c) from 0x8386c290
> 
> (unwind_backtrace+0x0/0x90) from panic (/common/misc.c:209)
> (panic+0x28/0x38) from do_exception (/arch/arm/cpu/interrupts.c:85)
> (do_exception+0x10/0x14) from do_data_abort (/arch/arm/cpu/interrupts.c:139)
> (do_data_abort+0x2c/0x38) from do_abort_6 (:?)
> ### ERROR ### Please RESET the board ###
> 
> And a special gift :
> rj@belgarion:~/mio_linux/barebox$ addr2line -i -e barebox 0x83f15b9c
> /home/rj/mio_linux/barebox/drivers/mtd/nand/nand_mrvl_nfc.c:1172
> /home/rj/mio_linux/barebox/drivers/mtd/nand/nand_mrvl_nfc.c:1202

This seems to be in mrvl_nand_probe_dt() and we are probing without
device tree here, right?

We have:

	struct device_node *np = host->dev->device_node;
	const struct of_device_id *match =
		of_match_node(mrvl_nand_dt_ids, np);
	const struct mrvl_nand_variant *variant = match->data;

of_match_node() is a static inline wrapper returning NULL, so next line
we dereference a NULL pointer.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2015-10-13 10:54 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-08 22:06 Sebastian Hesselbarth
2015-10-08 22:06 ` [PATCH 01/17] arm: pxa: Prepare for NAND clkdev lookup on PXA3xx Sebastian Hesselbarth
2015-10-09 19:11   ` Robert Jarzmik
2015-10-09 19:13     ` Robert Jarzmik
2015-10-10  8:34   ` Robert Jarzmik
2015-10-08 22:06 ` [PATCH 02/17] mtd: nand_mrvl_nfc: Use common clock for core clock Sebastian Hesselbarth
2015-10-10  8:35   ` Robert Jarzmik
2015-10-08 22:06 ` [PATCH 03/17] mtd: nand: Clarify Marvell Orion Kconfig prompt Sebastian Hesselbarth
2015-10-08 22:06 ` [PATCH 04/17] arm: pxa: Remove pxa_get_nandclk() Sebastian Hesselbarth
2015-10-10  8:35   ` Robert Jarzmik
2015-10-08 22:06 ` [PATCH 05/17] mtd: nand_mrvl_nfc: Remove keep_config Sebastian Hesselbarth
2015-10-09 19:16   ` Robert Jarzmik
2015-10-09 19:32     ` Sebastian Hesselbarth
2015-10-09 21:14       ` Robert Jarzmik
2015-10-08 22:06 ` [PATCH 06/17] mtd: nand_mrvl_nfc: Clear OOB data with 0xff instead of 0x00 Sebastian Hesselbarth
2015-10-10  8:38   ` Robert Jarzmik
2015-10-08 22:06 ` [PATCH 07/17] mtd: nand_mrvl_nfc: Use Auto Read Status on program/erase Sebastian Hesselbarth
2015-10-10  8:44   ` Robert Jarzmik
2015-10-10  9:36     ` Sebastian Hesselbarth
2015-10-10  9:49       ` Robert Jarzmik
2015-10-08 22:06 ` [PATCH 08/17] mtd: nand_mrvl_nfc: Fix num-cs property parsing Sebastian Hesselbarth
2015-10-08 22:06 ` [PATCH 09/17] mtd: nand_mrvl_nfc: Get ecc parameters from DT Sebastian Hesselbarth
2015-10-11 20:39   ` Robert Jarzmik
2015-10-12  6:28     ` Sascha Hauer
2015-10-12  7:32       ` Sebastian Hesselbarth
2015-10-08 22:06 ` [PATCH 10/17] mtd: nand_mrvl_nfc: Prepare for different HW ECC strengths Sebastian Hesselbarth
2015-10-08 22:06 ` [PATCH 11/17] mtd: nand_mrvl_nfc: Add hwflags to distinguish different HW versions Sebastian Hesselbarth
2015-10-12  6:33   ` Sascha Hauer
2015-10-08 22:06 ` [PATCH 12/17] mtd: nand_mrvl_nfc: Add support for 4bit BCH HW ECC Sebastian Hesselbarth
2015-10-08 22:06 ` [PATCH 13/17] mtd: nand_mrvl_nfc: Add support for 8bit " Sebastian Hesselbarth
2015-10-08 22:06 ` [PATCH 14/17] mtd: nand_mrvl_nfc: Add support for HW BCH ECC Sebastian Hesselbarth
2015-10-08 22:06 ` [PATCH 15/17] mtd: nand_mrvl_nfc: Add support for NDCB3 register Sebastian Hesselbarth
2015-10-10  8:48   ` Robert Jarzmik
2015-10-10 17:17     ` Sebastian Hesselbarth
2015-10-08 22:06 ` [PATCH 16/17] mtd: nand_mrvl_nfc: Add support for Marvell Armada 370/XP Sebastian Hesselbarth
2015-10-10  8:48   ` Robert Jarzmik
2015-10-08 22:06 ` [PATCH 17/17] mtd: nand_mrvl_nfc: Add optimized timings for Samsung K9K8G08U Sebastian Hesselbarth
2015-10-12 10:38 ` [PATCH 00/17] Armada 370/XP NAND driver Robert Jarzmik
2015-10-12 18:41   ` Sebastian Hesselbarth
2015-10-12 19:16     ` Robert Jarzmik
2015-10-12 19:59       ` Sebastian Hesselbarth
2015-10-13  9:35         ` Robert Jarzmik
2015-10-13  9:53           ` Sebastian Hesselbarth
2015-10-13 10:27             ` Sascha Hauer
2015-10-13 10:38               ` Robert Jarzmik
2015-10-13 10:54                 ` Sascha Hauer [this message]
2015-10-15 21:17                 ` Sebastian Hesselbarth
2015-10-16 18:40                   ` Robert Jarzmik
2015-10-16 19:32                     ` Sebastian Hesselbarth
2015-10-20 19:25                     ` Robert Jarzmik
2015-11-19 23:16                       ` Sebastian Hesselbarth
2015-11-20  7:18                         ` Robert Jarzmik
2015-10-12 17:55 ` [PATCH] of: mtd: Import of_get_nand_ecc_{step_size, strength} from Linux Sebastian Hesselbarth

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=20151013105428.GJ7858@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=ezequiel@vanguardiasur.com.ar \
    --cc=robert.jarzmik@free.fr \
    --cc=thomas.petazzoni@free-electrons.com \
    /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