linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Jurgen Lambrecht <J.Lambrecht@TELEVIC.com>
To: Leonard Crestez <leonard.crestez@nxp.com>
Cc: Aisheng Dong <aisheng.dong@nxp.com>,
	Robin Gong <yibin.gong@nxp.com>, dl-linux-imx <linux-imx@nxp.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: FYI: imx-sdma firmware is not compatible with SLUB slab allocator
Date: Wed, 28 Aug 2019 09:26:53 +0000	[thread overview]
Message-ID: <7282882c-1c79-9685-4bfe-80195976c8d6@televic.com> (raw)
In-Reply-To: <VI1PR04MB7023FB06F79F31334905D34EEEA00@VI1PR04MB7023.eurprd04.prod.outlook.com>

On 8/27/19 5:04 PM, Leonard Crestez wrote:
> CAUTION: This Email originated from outside Televic. Do not click links or open attachments unless you recognize the sender and know the content is safe.
>
>
> On 27.08.2019 16:35, Jurgen Lambrecht wrote:
>> We are updating our kernel on our custom board with an iMX6UL from 3.14
>> to 4.19, and when loading linux-firmware/imx/sdma/sdma-imx6q.bin v3.5
>> the kernel hangs when booting, only "Starting kernel ..." is printed (by
>> uBoot I think).
> If you enable "earlycon" you should be able to see an useful error
> message from crashes in early boot.
>
> Enabling earlycon is board-specific: if you have a correct
> /chosen/stdout-path reference in dts just adding "earlycon" to kernel
> cmdline should work otherwise you can specify
> earlycon=ec_imx6q,0x202000,115200 with the exact address depending on
> which uart is console on your board.

OK, thanks. First time I hear of earlycon.

But as I thought (because of logs with other kernel versions) the kernel 
just hangs when loading the sdma driver.
Now it is v3.5, but I also tried v3.3 a few weeks ago.

This is the last kernel log (below the full log):

[    2.312336] imx-sdma 20ec000.sdma: loaded firmware 3.5

About the DT config, I enabled sdma on all that I found: standard dtsi 
only has sdma enabled for SAI. But the freescale 4.1 kernel has more: I 
also enabled sdma for ecspi1 to ecspi4, uart1 to uart8.
But as a test I have also removed all sdma entries from DT, and still it 
hangs.

With enabling I mean add 2 lines, e.g. for sai1 in imx6ul.dtsi:

                     dmas = <&sdma 35 24 0>, <&sdma 36 24 0>;
                     dma-names = "rx", "tx";

>
>> When I remove the sdma bin (built-in the kernel via EXTRA_FIRMWARE),
>> then it boots.
>>
>> I found that the slab allocator (menu config -> General setup -> Choose
>> SLAB allocator) is the culprit: when using imx_v6_v7_defconfig the
>> kernel boots, but not with our config (based on a tiny config I think).
>> And the config that makes the difference is the slab allocator: with
>> SLUB or SLAB the kernel (with sdma bin) boots, but not with SLOB.
>>
>> I don't know how to force selecting SLUB in Kconfig when selecting
>> IMX_SDMA, but anyhow first this issue must be confirmed on other
>> processors from the iMX family.
> If there's an incompatibility between SLOB and sdma then it's sounds
> like a bug which should be fixed, not worked around via kconfig.
I agree, but it is closed source, so nothing to do about it (except 
mailing nxp).
That is why I posted this, to hope to get tips like yours.
>
> I tried to enable EXTRA_FIRMWARE on v4.19.68 and imx6ul-14x14-evk booted
> worked fine for me with these changes:
> diff --git arch/arm/configs/imx_v6_v7_defconfig
> arch/arm/configs/imx_v6_v7_defconfig
> index 7f524cee1357..cedd4d2e0e02 100644
> --- arch/arm/configs/imx_v6_v7_defconfig
> +++ arch/arm/configs/imx_v6_v7_defconfig
> @@ -11,8 +11,8 @@ CONFIG_RELAY=y
>    CONFIG_BLK_DEV_INITRD=y
>    CONFIG_EXPERT=y
>    CONFIG_PERF_EVENTS=y
> -# CONFIG_SLUB_DEBUG is not set
>    # CONFIG_COMPAT_BRK is not set
> +CONFIG_SLOB=y
>    CONFIG_ARCH_MULTI_V6=y
>    CONFIG_ARCH_MXC=y
>    CONFIG_MACH_MX31LILLY=y
> @@ -90,6 +90,10 @@ CONFIG_RFKILL_INPUT=y
>    CONFIG_DEVTMPFS=y
>    CONFIG_DEVTMPFS_MOUNT=y
>    # CONFIG_STANDALONE is not set
> +CONFIG_EXTRA_FIRMWARE="imx/sdma/sdma-imx6q.bin"
> +CONFIG_EXTRA_FIRMWARE_DIR="../linux-firmware"

Can you please check your boot log if you see that line "imx-sdma 
20ec000.sdma: loaded firmware 3.5" ? Else it is not loaded.

If you load the imx-sdma driver as a module I believe you have to put 
the firmware sdma-imx6q.bin in the RFS on /lib/firmware/imx/sdma/ 
instead of building it into the kernel image.

> +CONFIG_FW_LOADER_USER_HELPER=y
> +CONFIG_FW_LOADER_USER_HELPER_FALLBACK=y
those are not really needed
>    CONFIG_CMA_SIZE_MBYTES=64
>    CONFIG_IMX_WEIM=y
>    CONFIG_CONNECTOR=y
>
> Please try to get a stack dump with earlycon.

So no stack dump, it just hangs:

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.19.56-00374-gcda746ffc0d9-dirty 
(lambrecht@jl-lx-tra) (gcc version 4.9.3 (GCC)) #25 Wed Aug 28 10:49:44 
CEST 2019
[    0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), 
cr=10c53c7d
[    0.000000] CPU: div instructions available: patching division code
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing 
instruction cache
[    0.000000] OF: fdt: Machine model: iMX6ul 33.96.7949 (PEI-SP)
[    0.000000] earlycon: ec_imx6q0 at MMIO 0x02020000 (options '')
[    0.000000] bootconsole [ec_imx6q0] enabled
[    0.000000] Memory policy: Data cache writeback
[    0.000000] cma: Reserved 64 MiB at 0x9b400000
[    0.000000] CPU: All CPU(s) started in SVC mode.
[    0.000000] random: get_random_bytes called from 
start_kernel+0x8c/0x47c with crng_init=0
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 130048
[    0.000000] Kernel command line: version=DEV_33967972_1-04-01 
console=ttymxc0,115200 ubi.mtd=0 root=ubi0:rootfsB rootfstype=ubifs 
mtdparts=gpmi-nand:-(nandflash) earlycon
[    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 
bytes)
[    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 
bytes)
[    0.000000] Memory: 434544K/524288K available (7168K kernel code, 
558K rwdata, 2068K rodata, 1024K init, 7590K bss, 24208K reserved, 
65536K cma-reserved, 0K highmem)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
[    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
[    0.000000]     vmalloc : 0xe0800000 - 0xff800000   ( 496 MB)
[    0.000000]     lowmem  : 0xc0000000 - 0xe0000000   ( 512 MB)
[    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
[    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
[    0.000000]       .text : 0x(ptrval) - 0x(ptrval)   (8160 kB)
[    0.000000]       .init : 0x(ptrval) - 0x(ptrval)   (1024 kB)
[    0.000000]       .data : 0x(ptrval) - 0x(ptrval)   ( 559 kB)
[    0.000000]        .bss : 0x(ptrval) - 0x(ptrval)   (7591 kB)
[    0.000000] Running RCU self tests
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] Switching to timer-based delay loop, resolution 41ns
[    0.000020] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps 
every 89478484971ns
[    0.007848] clocksource: mxc_timer1: mask: 0xffffffff max_cycles: 
0xffffffff, max_idle_ns: 79635851949 ns
[    0.019941] Console: colour dummy device 80x30
[    0.021842] Lock dependency validator: Copyright (c) 2006 Red Hat, 
Inc., Ingo Molnar
[    0.029870] ... MAX_LOCKDEP_SUBCLASSES:  8
[    0.033667] ... MAX_LOCK_DEPTH:          48
[    0.037840] ... MAX_LOCKDEP_KEYS:        8191
[    0.042288] ... CLASSHASH_SIZE:          4096
[    0.046538] ... MAX_LOCKDEP_ENTRIES:     32768
[    0.050975] ... MAX_LOCKDEP_CHAINS:      65536
[    0.055500] ... CHAINHASH_SIZE:          32768
[    0.059851]  memory used by lock dependency info: 4655 kB
[    0.065244]  per task-struct memory footprint: 1536 bytes
[    0.070822] Calibrating delay loop (skipped), value calculated using 
timer frequency.. 48.00 BogoMIPS (lpj=240000)
[    0.081099] pid_max: default: 32768 minimum: 301
[    0.086321] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.092363] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 
bytes)
[    0.104414] CPU: Testing write buffer coherency: ok
[    0.112690] Setting up static identity map for 0x80100000 - 0x80100078
[    0.123963] devtmpfs: initialized
[    0.272880] VFP support v0.3: implementor 41 architecture 2 part 30 
variant 7 rev 5
[    0.281104] clocksource: jiffies: mask: 0xffffffff max_cycles: 
0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.288416] futex hash table entries: 256 (order: 1, 11264 bytes)
[    0.300366] pinctrl core: initialized pinctrl subsystem
[    0.319160] NET: Registered protocol family 16
[    0.333165] DMA: preallocated 256 KiB pool for atomic coherent 
allocations
[    0.355397] cpuidle: using governor menu
[    0.436775] vdd3p0: supplied by regulator-dummy
[    0.446444] cpu: supplied by regulator-dummy
[    0.455657] vddsoc: supplied by regulator-dummy
[    0.556952] No ATAGs?
[    0.572146] imx6ul-pinctrl 20e0000.iomuxc: initialized IMX pinctrl driver
[    0.908280] mxs-dma 1804000.dma-apbh: initialized
[    0.945421] i2c i2c-2: IMX I2C adapter registered
[    0.949403] i2c i2c-2: can't use DMA, using PIO instead.
[    0.970338] i2c i2c-1: IMX I2C adapter registered
[    0.972345] i2c i2c-1: can't use DMA, using PIO instead.
[    0.991751] i2c i2c-0: IMX I2C adapter registered
[    0.993758] i2c i2c-0: can't use DMA, using PIO instead.
[    1.006680] i2c i2c-3: IMX I2C adapter registered
[    1.008683] i2c i2c-3: can't use DMA, using PIO instead.
[    1.015674] pps_core: LinuxPPS API ver. 1 registered
[    1.018866] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 
Rodolfo Giometti <giometti@linux.it>
[    1.028470] PTP clock support registered
[    1.038288] Advanced Linux Sound Architecture Driver Initialized.
[    1.058453] clocksource: Switched to clocksource mxc_timer1
[    2.111494] NET: Registered protocol family 2
[    2.120322] tcp_listen_portaddr_hash hash table entries: 256 (order: 
1, 10240 bytes)
[    2.125441] TCP established hash table entries: 4096 (order: 2, 16384 
bytes)
[    2.132796] TCP bind hash table entries: 4096 (order: 5, 147456 bytes)
[    2.140593] TCP: Hash tables configured (established 4096 bind 4096)
[    2.148435] UDP hash table entries: 256 (order: 2, 20480 bytes)
[    2.152078] UDP-Lite hash table entries: 256 (order: 2, 20480 bytes)
[    2.161791] NET: Registered protocol family 1
[    2.173419] RPC: Registered named UNIX socket transport module.
[    2.176626] RPC: Registered udp transport module.
[    2.181521] RPC: Registered tcp transport module.
[    2.186009] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    2.214905] workingset: timestamp_bits=30 max_order=17 bucket_order=0
[    2.234013] NFS: Registering the id_resolver key type
[    2.236776] Key type id_resolver registered
[    2.240861] Key type id_legacy registered
[    2.246822] fuse init (API version 7.27)
[    2.289930] io scheduler noop registered (default)
[    2.312336] imx-sdma 20ec000.sdma: loaded firmware 3.5


Kind regards,

Jürgen

>
> --
> Regards,
> Leonard
>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2019-08-28  9:27 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-27 13:35 FYI: imx-sdma firmware is not compatible with SLUB slab allocator Jurgen Lambrecht
2019-08-27 15:04 ` Leonard Crestez
2019-08-28  9:26   ` Jurgen Lambrecht [this message]
2019-08-28 14:05     ` Robin Gong
2019-08-29  6:23       ` Jurgen Lambrecht
2019-09-03  5:57         ` Robin Gong
2019-09-03 14:32           ` Jurgen Lambrecht
2019-09-03 14:48             ` Leonard Crestez
2019-09-04 14:26               ` Jurgen Lambrecht
2019-09-12  6:33                 ` Uwe Kleine-König
2019-09-12  2:06             ` Robin Gong
2019-09-12  9:45               ` Jurgen Lambrecht
2019-09-12 12:12                 ` Jurgen Lambrecht
2019-09-12 14:19                   ` Robin Gong
2019-09-12 14:40                     ` Russell King - ARM Linux admin
2019-09-12 14:47                       ` Robin Gong

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=7282882c-1c79-9685-4bfe-80195976c8d6@televic.com \
    --to=j.lambrecht@televic.com \
    --cc=aisheng.dong@nxp.com \
    --cc=leonard.crestez@nxp.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=yibin.gong@nxp.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;
as well as URLs for NNTP newsgroup(s).