How to interpret this warning? INFO: possible circular locking dependency detected - linux-kernel

I found this info/warning message after resuming from suspend.
INFO: possible circular locking dependency detected
Could somebody show me how to read and interpret the info message? And, any suggestion how to Thanks for any help. A beginner here... :)
[ 131.399069] Restarting tasks ... done.
[ 131.409640] PM: suspend exit 1970-01-13 21:48:39.838845730 UTC
[ 131.449011] ------------[ cut here ]------------
[ 131.449759]
[ 131.449768] ======================================================
[ 131.449777] [ INFO: possible circular locking dependency detected ]
[ 131.449789] 3.10.37+ #1 Not tainted
[ 131.449797] -------------------------------------------------------
[ 131.449807] swapper/2/0 is trying to acquire lock:
[ 131.449859] (&port_lock_key){-.-...}, at: [<c036a6dc>] serial8250_console_write+0x108/0x134
[ 131.449866]
[ 131.449866] but task is already holding lock:
[ 131.449905] (&(&pool->lock)->rlock){-.-...}, at: [<c004b1bc>] __queue_work+0x16c/0x500
[ 131.449913]
[ 131.449913] which lock already depends on the new lock.
[ 131.449920] the existing dependency chain (in reverse order) is:
[ 131.449951]
[ 131.449951] -> #2 (&(&pool->lock)->rlock){-.-...}:
[ 131.449975] [<c0099c08>] validate_chain.isra.33+0xe60/0x12b4
[ 131.449993] [<c009c944>] __lock_acquire+0x3f4/0xc28
[ 131.450012] [<c009d8a0>] lock_acquire+0xbc/0x254
[ 131.450031] [<c08973d4>] _raw_spin_lock+0x4c/0x5c
[ 131.450049] [<c004b1bc>] __queue_work+0x16c/0x500
[ 131.450067] [<c004b5d0>] queue_work_on+0x80/0x84
[ 131.450087] [<c03c062c>] rpm_idle+0xe4/0x41c
[ 131.450105] [<c03c09e4>] __pm_runtime_idle+0x80/0xb4
[ 131.450124] [<c03b49f4>] driver_probe_device+0x114/0x388
[ 131.450142] [<c03b4d60>] __driver_attach+0xa4/0xa8
[ 131.450160] [<c03b28e4>] bus_for_each_dev+0x70/0xa4
[ 131.450177] [<c03b43a4>] driver_attach+0x2c/0x30
[ 131.450194] [<c03b3f38>] bus_add_driver+0x1f0/0x294
[ 131.450212] [<c03b5440>] driver_register+0x88/0x150
[ 131.450230] [<c03b68d8>] platform_driver_register+0x60/0x68
[ 131.450252] [<c0c5ce3c>] b_phy_init+0x24/0x28
[ 131.450271] [<c00087d4>] do_one_initcall+0xe8/0x19c
[ 131.450291] [<c0c2ac84>] kernel_init_freeable+0x148/0x1e8
[ 131.450312] [<c08812b8>] kernel_init+0x20/0x170
[ 131.450331] [<c000eda8>] ret_from_fork+0x14/0x20
[ 131.450362]
[ 131.450362] -> #1 (&(&dev->power.lock)->rlock){-.-...}:
[ 131.450382] [<c0099c08>] validate_chain.isra.33+0xe60/0x12b4
[ 131.450400] [<c009c944>] __lock_acquire+0x3f4/0xc28
[ 131.450418] [<c009d8a0>] lock_acquire+0xbc/0x254
[ 131.450436] [<c0897558>] _raw_spin_lock_irqsave+0x58/0x6c
[ 131.450454] [<c03c128c>] __pm_runtime_resume+0x60/0x9c
[ 131.450474] [<c036d060>] b16550_serial_out+0x30/0x6c
[ 131.450492] [<c0369b50>] serial8250_set_mctrl+0x6c/0x70
[ 131.450510] [<c0367400>] uart_add_one_port+0x300/0x418
[ 131.450528] [<c036af38>] serial8250_register_8250_port+0x244/0x300
[ 131.450546] [<c036d538>] dw8250_probe+0x240/0x5ac
[ 131.450565] [<c03b61ac>] platform_drv_probe+0x24/0x28
[ 131.450582] [<c03b4a28>] driver_probe_device+0x148/0x388
[ 131.450600] [<c03b4d60>] __driver_attach+0xa4/0xa8
[ 131.450617] [<c03b28e4>] bus_for_each_dev+0x70/0xa4
[ 131.450635] [<c03b43a4>] driver_attach+0x2c/0x30
[ 131.450652] [<c03b3f38>] bus_add_driver+0x1f0/0x294
[ 131.450669] [<c03b5440>] driver_register+0x88/0x150
[ 131.450688] [<c03b68d8>] platform_driver_register+0x60/0x68
[ 131.450708] [<c0c57f98>] dw8250_platform_driver_init+0x18/0x1c
[ 131.450726] [<c00087d4>] do_one_initcall+0xe8/0x19c
[ 131.450744] [<c0c2ac84>] kernel_init_freeable+0x148/0x1e8
[ 131.450763] [<c08812b8>] kernel_init+0x20/0x170
[ 131.450781] [<c000eda8>] ret_from_fork+0x14/0x20
[ 131.450812]
[ 131.450812] -> #0 (&port_lock_key){-.-...}:
[ 131.450831] [<c0887d90>] print_circular_bug+0x7c/0x310
[ 131.450850] [<c0099eb0>] validate_chain.isra.33+0x1108/0x12b4
[ 131.450869] [<c009c944>] __lock_acquire+0x3f4/0xc28
[ 131.450887] [<c009d8a0>] lock_acquire+0xbc/0x254
[ 131.450904] [<c08973d4>] _raw_spin_lock+0x4c/0x5c
[ 131.450923] [<c036a6dc>] serial8250_console_write+0x108/0x134
[ 131.450943] [<c002a0c8>] call_console_drivers.constprop.16+0x100/0x23c
[ 131.450960] [<c002a8e8>] console_unlock+0x41c/0x490
[ 131.450977] [<c002ab70>] vprintk_emit+0x214/0x604
[ 131.450995] [<c0886fc0>] printk+0x44/0x4c
[ 131.451016] [<c002845c>] warn_slowpath_common+0x34/0x7c
[ 131.451034] [<c0028560>] warn_slowpath_null+0x2c/0x34
[ 131.451052] [<c004b03c>] insert_work+0xa8/0xbc
[ 131.451070] [<c004b1a4>] __queue_work+0x154/0x500
[ 131.451089] [<c004b5fc>] delayed_work_timer_fn+0x28/0x2c
[ 131.451107] [<c003a414>] call_timer_fn+0x90/0x3a0
[ 131.451124] [<c003abf4>] run_timer_softirq+0x154/0x380
[ 131.451144] [<c0031fa4>] __do_softirq+0x170/0x4ec
[ 131.451161] [<c0032410>] do_softirq+0x7c/0x80
[ 131.451178] [<c0032774>] irq_exit+0xbc/0xf0
[ 131.451196] [<c00152e4>] handle_IPI+0xb4/0x488
[ 131.451213] [<c0008670>] gic_handle_irq+0x68/0x6c
[ 131.451231] [<c0898304>] __irq_svc+0x44/0x78
[ 131.451253] [<c05961b0>] bl_enter_powerdown+0x90/0xf0
[ 131.451271] [<c05941ec>] cpuidle_enter_state+0x4c/0x104
[ 131.451289] [<c0594394>] cpuidle_idle_call+0xf0/0x478
[ 131.451307] [<c000fc6c>] arch_cpu_idle+0x18/0x4c
[ 131.451327] [<c008a38c>] cpu_startup_entry+0x158/0x454
[ 131.451348] [<c0882e08>] secondary_start_kernel+0x13c/0x148
[ 131.451366] [<500081ec>] 0x500081ec
[ 131.451374]
[ 131.451374] other info that might help us debug this:
[ 131.451374]
[ 131.451419] Chain exists of:
[ 131.451419] &port_lock_key --> &(&dev->power.lock)->rlock --> &(&pool->lock)->rlock
[ 131.451419]
[ 131.451426] Possible unsafe locking scenario:
[ 131.451426]
[ 131.451433] CPU0 CPU1
[ 131.451440] ---- ----
[ 131.451458] lock(&(&pool->lock)->rlock);
[ 131.451478] lock(&(&dev->power.lock)->rlock);
[ 131.451497] lock(&(&pool->lock)->rlock);
[ 131.451515] lock(&port_lock_key);
[ 131.451522]
[ 131.451522] *** DEADLOCK ***
[ 131.451522]
[ 131.451532] 3 locks held by swapper/2/0:
[ 131.451575] #0: ((&(work)->timer)){..-...}, at: [<c003a384>] call_timer_fn+0x0/0x3a0
[ 131.451618] #1: (&(&pool->lock)->rlock){-.-...}, at: [<c004b1bc>] __queue_work+0x16c/0x500
[ 131.451660] #2: (console_lock){+.+.+.}, at: [<c002ab34>] vprintk_emit+0x1d8/0x604
[ 131.451667]

Whenever you acquire a new lock, Lockdep checks the list of locks the current process is previously holding, to warn about any deadlock scenarios.
I suspect that this is a case of acquiring locks in A->B and B->A order resulting in deadlock.
In this case Lock A is (&pool->lock)->rlock,
and B is lock (&dev->power.lock)->rlock.
You can tell Lockdep to treat two different locks as the same, by setting the same class in lockdep_set_class(). In the call trace for (&(&dev->power.lock)->rlock), in function uart_add_one_port,
lockdep_set_class(&uport->lock, &port_lock_key);
We can also see that port->rlock acquired in serial8250_console_write, is also set to the same class.
lockdep_set_class(&port->lock, &port_lock_key);
Thus Lockdep treats port->lock and uport->lock as the same lock(B), and complains that the locks A and B are taken in reverse order.
The solution would be to modify your code to take these 2 locks in the same order always.

Related

Linux RTC PCF85063A issue after suspend/resume

I am trying to use the PCF85063A RTC device on a Toradex Colibry i.MX7D processor.
Used Setup:
Colibri iMX7D 1 GB V1.1A
Kernel 5.4.161-5.6.0-devel+git.0f0011824921
For this, I created an own DTS file. Here’s the relevant DTS change:
&i2c4 {
status = "okay";
/* PCF85063A real time clock on carrier board */
pcf_rtc: pcf85063a#51 {
compatible = "nxp,pcf85063a";
reg = <0x51>;
interrupt-parent = <&gpio1>;
interrupts = <1 IRQ_TYPE_EDGE_FALLING>;
wakeup-source;
};
};
I enabled the driver in the kernel configuration, recompiled the kernel and modules and deployed them.
CONFIG_RTC_DRV_PCF85063=y
The output of dmesg after booting the system is as follows, which looks good to me at first glance:
~$ dmesg | grep rtc
[ 1.071396] rtc-pcf85063 3-0051: wake irq already initialized
[ 1.293186] rtc rtc0: failed to enable irq wake
[ 1.303787] rtc-pcf85063 3-0051: registered as rtc0
[ 1.309405] snvs_rtc 30370000.snvs:snvs-rtc-lp: registered as rtc1
[ 1.757462] rtc-pcf85063 3-0051: setting system clock to 2022-11-28T15:33:09 UTC (1669649589)
But one block within dmesg output makes me think that something is wrong initialized:
[ 1.056406] ------------[ cut here ]------------
[ 1.061047] WARNING: CPU: 0 PID: 1 at drivers/base/power/wakeirq.c:30 dev_pm_attach_wake_irq.constprop.0+0xd0/0xd4
[ 1.071396] rtc-pcf85063 3-0051: wake irq already initialized
[ 1.077140] Modules linked in:
[ 1.080203] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.4.161-5.6.0-devel+git.0f0011824921 #1
[ 1.088726] Hardware name: Freescale i.MX7 Dual (Device Tree)
[ 1.094495] [<8010eaf8>] (unwind_backtrace) from [<8010bb1c>] (show_stack+0x10/0x14)
[ 1.102248] [<8010bb1c>] (show_stack) from [<80914d84>] (dump_stack+0x90/0xa4)
[ 1.109480] [<80914d84>] (dump_stack) from [<8090c38c>] (__warn+0xbc/0xd8)
[ 1.116363] [<8090c38c>] (__warn) from [<8090c42c>] (warn_slowpath_fmt+0x84/0x98)
[ 1.123856] [<8090c42c>] (warn_slowpath_fmt) from [<8058b538>] (dev_pm_attach_wake_irq.constprop.0+0xd0/0xd4)
[ 1.133780] [<8058b538>] (dev_pm_attach_wake_irq.constprop.0) from [<8058b688>] (dev_pm_set_wake_irq+0x40/0x70)
[ 1.143879] [<8058b688>] (dev_pm_set_wake_irq) from [<8065d670>] (pcf85063_probe+0x204/0x2f4)
[ 1.152414] [<8065d670>] (pcf85063_probe) from [<8065ed90>] (i2c_device_probe+0xac/0x2c4)
[ 1.160601] [<8065ed90>] (i2c_device_probe) from [<8057e950>] (really_probe+0x24c/0x488)
[ 1.168701] [<8057e950>] (really_probe) from [<8057ed54>] (driver_probe_device+0x78/0x1c4)
[ 1.176974] [<8057ed54>] (driver_probe_device) from [<8057f100>] (device_driver_attach+0x58/0x60)
[ 1.185854] [<8057f100>] (device_driver_attach) from [<8057f1bc>] (__driver_attach+0xb4/0x154)
[ 1.194473] [<8057f1bc>] (__driver_attach) from [<8057cad8>] (bus_for_each_dev+0x64/0x90)
[ 1.202659] [<8057cad8>] (bus_for_each_dev) from [<8057db18>] (bus_add_driver+0x16c/0x208)
[ 1.210931] [<8057db18>] (bus_add_driver) from [<8057fa34>] (driver_register+0x74/0x108)
[ 1.219029] [<8057fa34>] (driver_register) from [<8065f68c>] (i2c_register_driver+0x3c/0xac)
[ 1.227474] [<8065f68c>] (i2c_register_driver) from [<80102670>] (do_one_initcall+0x44/0x194)
[ 1.236009] [<80102670>] (do_one_initcall) from [<80e00e64>] (kernel_init_freeable+0x148/0x1e4)
[ 1.244716] [<80e00e64>] (kernel_init_freeable) from [<80914f2c>] (kernel_init+0x8/0x110)
[ 1.252900] [<80914f2c>] (kernel_init) from [<801010e8>] (ret_from_fork+0x14/0x2c)
[ 1.260469] Exception stack(0xb0093fb0 to 0xb0093ff8)
[ 1.265525] 3fa0: 00000000 00000000 00000000 00000000
[ 1.273707] 3fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 1.281888] 3fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[ 1.288511] ---[ end trace 2ff9b5ad99dcb9b6 ]---
[ 1.293186] rtc rtc0: failed to enable irq wake
[ 1.303787] rtc-pcf85063 3-0051: registered as rtc0
[ 1.309405] snvs_rtc 30370000.snvs:snvs-rtc-lp: registered as rtc1
[ 1.315738] i2c /dev entries driver
Then, when using the RTC device several times, everything looks good.
~$ echo +10 > /sys/class/rtc/rtc0/wakealarm
I can see, that changes to the alarm are reflected in the corresponding registers (it works as expected).
~$ i2cdump -f -y -r 0x0-0xf 3 0x51 b
0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
00: 00 00 00 00 40 36 15 28 01 11 22 40 36 15 28 80 ....#6?(??"#6?(?
I can repeat this commands as much as I like… …but when I enter the suspend mode, the behavior changes!
~$ echo +10 > /sys/class/rtc/rtc0/wakealarm
~$ systemctl suspend
After the 10s, the system resumes. But now, I am no more able to activate a new alarm:
~$ echo +10 > /sys/class/rtc/rtc0/wakealarm
-sh: echo: write error: Permission denied
And dumping i2c device looks very strange…
~$ i2cdump -f -y -r 0x0-0xf 3 0x51 b
0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
00: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
…and the output of dmesg is as follows (there seems to be an exception with the RTC driver):
--- snip ---
[ 287.991068] OOM killer enabled.
[ 287.994212] Restarting tasks ...
[ 288.018896] usbmisc_imx 30b10200.usbmisc: vbus is error [ 288.027546] usbmisc_imx 30b10200.usbmisc: Error occurs during detection: -22 [ 288.040850] done.
[ 288.045136] PM: suspend exit
[ 288.188113] irq 66: nobody cared (try booting with the "irqpoll" option)
[ 288.194832] CPU: 0 PID: 1 Comm: systemd Tainted: G W O 5.4.161-5.6.0-devel+git.0f0011824921 #1
[ 288.204571] Hardware name: Freescale i.MX7 Dual (Device Tree) [ 288.210341] [<8010eaf8>] (unwind_backtrace) from [<8010bb1c>] (show_stack+0x10/0x14) [ 288.218092] [<8010bb1c>] (show_stack) from [<80914d84>] (dump_stack+0x90/0xa4) [ 288.225320] [<80914d84>] (dump_stack) from [<8090ca54>] (__report_bad_irq+0x3c/0xc0) [ 288.233071] [<8090ca54>] (__report_bad_irq) from [<8016ea20>] (note_interrupt+0x264/0x2b0) [ 288.241341] [<8016ea20>] (note_interrupt) from [<8016b728>] (handle_irq_event_percpu+0x58/0x64)
[ 288.250045] [<8016b728>] (handle_irq_event_percpu) from [<8016b778>] (handle_irq_event+0x44/0x68) [ 288.258921] [<8016b778>] (handle_irq_event) from [<8016f468>] (handle_level_irq+0xb4/0x140) [ 288.267278] [<8016f468>] (handle_level_irq) from [<8016a868>] (generic_handle_irq+0x24/0x34) [ 288.275723] [<8016a868>] (generic_handle_irq) from [<80518614>] (mxc_gpio_irq_handler+0x48/0x164) [ 288.284603] [<80518614>] (mxc_gpio_irq_handler) from [<80519214>] (mx3_gpio_irq_handler+0x60/0xac) [ 288.293567] [<80519214>] (mx3_gpio_irq_handler) from [<8016a868>] (generic_handle_irq+0x24/0x34) [ 288.302355] [<8016a868>] (generic_handle_irq) from [<8016ae6c>] (__handle_domain_irq+0x5c/0xb0) [ 288.311058] [<8016ae6c>] (__handle_domain_irq) from [<80506fbc>] (gic_handle_irq+0x4c/0x90) [ 288.319413] [<80506fbc>] (gic_handle_irq) from [<80101e10>] (__irq_usr+0x50/0x80) [ 288.326895] Exception stack(0xb0093fb0 to 0xb0093ff8)
[ 288.331950] 3fa0: 00832870 76f699cc 0000006f 0000006f
[ 288.340131] 3fc0: 00832848 008191c8 80000000 fffffffa 007ff6d8 007ff6d8 7ed5aa4c 76f699cc [ 288.348310] 3fe0: 76fb6d6c 7ed5a9f0 76f1b4ad 76ce70a0 600f0030 ffffffff [ 288.354922] handlers:
[ 288.357200] [<e0ffacc5>] irq_default_primary_handler threaded [<c40163d5>] pcf85063_rtc_handle_irq [ 288.366168] Disabling IRQ #66 [ 288.434623] systemd-journald[171]: Successfully sent stream file descriptor to service manager.
--- snip ---
Can anyone help me to get the external RTC running also after a suspend/resume change? Any help would be greatly appreciated.
Cheers
Update:
I am aware that both the internal (snvs_rtc) and external (PCF85063) RTCs are used. It would be enough to use only the external RTC, but I have not managed to disable it. When it is disabled, the system no longer boots and this last dmesg message appears:
[ OK ] Mounted /var/volatile.
Starting Load/Save Random Seed...
[ 6.396724] systemd-journald[173]: Successfully sent stream file descriptor to service manager.
[ OK ] Started udev Kernel Device Manager.
[ OK ] Started Load/Save Random Seed.
I have disabled it with following code in the DTS:
&snvs_rtc {
status = "disabled";
};
This part from dmesg you claim is good is actually not:
[ 1.071396] rtc-pcf85063 3-0051: wake irq already initialized
[ 1.293186] rtc rtc0: failed to enable irq wake
Which is the warning splat you get in the full dmesg.
Are you sure about the RTC interrupt being connected on gpio1 1? It seems this GPIO is already used as a wakeup interrupt by another driver.
Note that the wakeup-source; property is not needed when you have an interrupt defined.

Grok pattern for data separated by pipe with whitespaces and optional values in it

I have a textfile/logfile in which the values are separated by a pipe symbol. "|" with multiple whitespaces.
Also I just wanted to try it without gsub.
An example is below,
Does anyone know how to write a GROK pattern to extract it for logstash? as I am very new to it. Thanks in advance
5000| | |applicationLog |ClientLog |SystemLog |Green | |2014-01-07 11:58:48.76948 |12345 (0x1224)|1) Error 2)Sample Log | Configuration Manager
Since the number of | are inconsistent between different words, you can match it with .*? and extract rest of the data as predefined grok pattern
%{NUMBER:num}.*?%{WORD:2nd}.*?%{WORD:3rd}.*?%{WORD:4th}.*?%{WORD:5th}.*?%{TIMESTAMP_ISO8601}
which will give you,
{
"num": [
[
"5000"
]
],
"BASE10NUM": [
[
"5000"
]
],
"2nd": [
[
"applicationLog"
]
],
"3rd": [
[
"ClientLog"
]
],
"4th": [
[
"SystemLog"
]
],
"5th": [
[
"Green"
]
],
"TIMESTAMP_ISO8601": [
[
"2014-01-07 11:58:48.76948"
]
],
"YEAR": [
[
"2014"
]
],
"MONTHNUM": [
[
"01"
]
],
"MONTHDAY": [
[
"07"
]
],
"HOUR": [
[
"11",
null
]
],
"MINUTE": [
[
"58",
null
]
],
"SECOND": [
[
"48.76948"
]
],
"ISO8601_TIMEZONE": [
[
null
]
]
}
You can test it at online grok debugger.
Since you are new to grok you might want to read, grok filter plugin basics
If you can, I'd suggest you to also have a look in dissect filter which is faster and efficient than grok,
The Dissect filter is a kind of split operation. Unlike a regular
split operation where one delimiter is applied to the whole string,
this operation applies a set of delimiters to a string value. Dissect
does not use regular expressions and is very fast. However, if the
structure of your text varies from line to line then Grok is more
suitable. There is a hybrid case where Dissect can be used to
de-structure the section of the line that is reliably repeated and
then Grok can be used on the remaining field values with more regex
predictability and less overall work to do.

tegrahost_v2: Stat for tegra186-quill-p3310-1000-c03-00-base.dtb failed

I've built an image for Jetson TX2 module using yocto. Everything when fine for few days but now I get this error when I try to flash the device.
Welcome to Tegra Flash
version 1.0.0
Type ? or help for help and q or quit to exit
Use ! to execute system commands
[ 0.0008 ] tegrasign_v2 --key None --getmode mode.txt
[ 0.0016 ] Assuming zero filled SBK key
[ 0.0016 ]
[ 0.0016 ] Generating RCM messages
[ 0.0023 ] tegrarcm_v2 --listrcm rcm_list.xml --chip 0x18 --download rcm mb1_recovery_prod.bin 0 0
[ 0.0030 ] RCM 0 is saved as rcm_0.rcm
[ 0.0033 ] RCM 1 is saved as rcm_1.rcm
[ 0.0033 ] List of rcm files are saved in rcm_list.xml
[ 0.0033 ]
[ 0.0033 ] Signing RCM messages
[ 0.0040 ] tegrasign_v2 --key None --list rcm_list.xml --pubkeyhash pub_key.key
[ 0.0046 ] Assuming zero filled SBK key
[ 0.0076 ]
[ 0.0076 ] Copying signature to RCM mesages
[ 0.0083 ] tegrarcm_v2 --chip 0x18 --updatesig rcm_list_signed.xml
[ 0.0093 ]
[ 0.0093 ] Parsing partition layout
[ 0.0100 ] tegraparser_v2 --pt flash.xml.tmp
[ 0.0109 ]
[ 0.0109 ] Creating list of images to be signed
[ 0.0116 ] tegrahost_v2 --chip 0x18 --partitionlayout flash.xml.bin --list images_list.xml zerosbk
[ 0.0124 ] Stat for tegra186-quill-p3310-1000-c03-00-base.dtb failed
[ 0.0161 ]
Error: Return value 4
Command tegrahost_v2 --chip 0x18 --partitionlayout flash.xml.bin --list images_list.xml zerosbk
Does this error ring a bell to anyone?
I am able to flash the board with JetPack.
Thanks,
-Damien
Just in case you never figured this out, it looks like
[ 0.0124 ] Stat for tegra186-quill-p3310-1000-c03-00-base.dtb failed
is the real error. Fix that and you should be good.

parsing command line output on Windows command line batch file

I have this command that scan a file and returns a summary.
For example on running this command
omsCmdLineUtil.exe process C:\test.exe Default
the result output is:
Ticket:[ 2214271306 ]
Process Details
---------------
File: [ C:\test.exe ]
MD5: [ D41D8CD98F00B204E9800998ECF8427E ]
SHA1: [ DA39A3EE5E6B4B0D3255BFEF95601890AFD80709 ]
SHA256: [ E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855 ]
File Size: [ 0 bytes ]
File Type Category: [ O ]
File Type: [ - ]
File Type Description: [ empty ]
[ Clean ] Ahnlab scan engine [ 1 ms ]
[ Clean ] ClamAV scan engine [ 1 ms ]
[ Clean ] BitDefender scan engine [ 1 ms ]
[ Clean ] Avira scan engine [ 1 ms ]
[ Clean ] Quick Heal scan engine [ 1 ms ]
[ Clean ] ThreatTrack scan engine [ 1 ms ]
[ Clean ] ESET scan engine [ 1 ms ]
[ Clean ] Total Defense scan engine [ 1 ms ]
Scan Completion
---------------
[ Clean ]
Ticket: [ 2214271306 ]
File path: C:\test.exe
Scan time: 1 ms [12/20/2015 13:00:06:791]
Process Completion
------------------
Ticket: [ 2214271306 ]
User agent: Default
Profile: Default
Result: [ Allowed ]
File processed: C:\test.exe
I want to create a batch file that parses this result by searching for the output line Result:, check if it's [ Allowed ] or [ Blocked ] and return 0 for allowed and 1 for blocked.
I tried something like this, but its not really working:
omsCmdLineUtil.exe process C:\test.exe Default | set ts = findstr /C:"Result: [ Allowed ]"
if %ts% == "Result: [ Allowed ]" return 0
else return 1
Which modification on code is necessary to get the expected result?
there is no return in Batch. I think, you want exit /b <errorlevel>
omsCmdLineUtil.exe process C:\test.exe Default | find "Result: [ Allowed ]" >nul && Exit /b 0 || Exit /b 1
Instead of Exit 0 you can of Course also use set ts=0 and use that. Or use echo instead.
Some explanations:
>nul redirects the output to nirvana, keeping your screen clean.
&& acts as "If previous command was successfull, then..." (string was found)
|| acts as "if previous command was not successfull, then...` (string was not found)
I prefer using find when possible because of it's simpler syntax, but of course findstr /C:"Result: [ Allowed ]"will also work

Handling 4-block oriented matrix product and inversion in Maxima

I am concerned in finding symbolic solutions and expansion to matrix products and inversions. Actually, it is something I would like to define by myself. I will explain myself.
I want to create a "mathematical" object that i will call B4MAT which represents a square matrix whose elements are 4 square half-sized matrices. So I want to define the product between two B4MAT giving me back another B4MAT whose components are calculated by applying product rules, but among matrices, not scalars.
Furthermore, and this is a very important point, consider Blockwise Inversion of a matrix. I want to define inversion of a B4MAT as an operation returning me another B4MAT whose elements are calculated using the blockwise inversion algorithm in the link.
How to achieve this in Maxima?
Thankyou
For the first half of your question, you just need to change matrix_element_mult to non-commutative multiplication and then use a matrix whose elements are the blocks you want. For example:
Maxima branch_5_27_base_248_ge261c5e http://maxima.sourceforge.net
using Lisp SBCL 1.0.57.0.debian
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) A: matrix([1,2],[3,4])$ B: matrix([2,1],[3,4])$
(%i3) matrix([A,B], [B,A]);
*** output flushed ***
(%i4) C: matrix([A,B], [B,A]);
[ [ 1 2 ] [ 2 1 ] ]
[ [ ] [ ] ]
[ [ 3 4 ] [ 3 4 ] ]
(%o4) [ ]
[ [ 2 1 ] [ 1 2 ] ]
[ [ ] [ ] ]
[ [ 3 4 ] [ 3 4 ] ]
(%i5) C . C;
[ [ 5 5 ] [ 4 4 ] ]
[ [ ] [ ] ]
[ [ 18 32 ] [ 18 32 ] ]
(%o5) [ ]
[ [ 4 4 ] [ 5 5 ] ]
[ [ ] [ ] ]
[ [ 18 32 ] [ 18 32 ] ]
(%i6) matrix_element_mult: ".";
(%o6) .
(%i7) C . C;
[ [ 14 16 ] [ 13 17 ] ]
[ [ ] [ ] ]
[ [ 33 41 ] [ 33 41 ] ]
(%o7) [ ]
[ [ 13 17 ] [ 14 16 ] ]
[ [ ] [ ] ]
[ [ 33 41 ] [ 33 41 ] ]
I think you have to code up the inversion formula yourself though (don't forget you can get at the blocks with expressions like "C[1][2]" (for the top right corner) etc.

Resources