]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - rpmsg/rpmsg.git/commit
Revert "remoteproc: Modify recovery path to use rproc_{start,stop}()"
authorSuman Anna <s-anna@ti.com>
Sat, 9 Mar 2019 16:44:05 +0000 (11:44 -0500)
committerSuman Anna <s-anna@ti.com>
Mon, 11 Mar 2019 16:53:57 +0000 (11:53 -0500)
commit344028330ccef94440b2fc1c771d487c5b413dba
tree62bd6bfc2d64229d1b0fec7cdb4fd6c759ca808a
parent7517114b4facdc9ca80e27c30dfc6ef8a1f165f4
Revert "remoteproc: Modify recovery path to use rproc_{start,stop}()"

This reverts commit 7e83cab824a86704cdbd7735c19d34e0ce423dc5.

The commit 7e83cab824a8 ("remoteproc: Modify recovery path to use
rproc_{start,stop}()") has modified the rproc_trigger_recovery()
function to leverage rproc_stop() and rproc_start() functions
introduced in commit 1efa30d0895e ("remoteproc: Introduce
rproc_{start,stop}() functions") in place of the previous usage
of rproc_shutdown() and rproc_boot() functions. These new functions
execute only a portion of the previous functions, and are primarily
designed to optimize the allocation of memory resources. They do
not handle other resources like virtio devices and the resetting
of any IOMMUs. The new functions also do not re-initialize the
memory used by the firmware image sections during recovery. This
results in a kernel crash like below when performing error recovery
on remoteprocs using both MMUs and virtio devices like the OMAP
remoteproc driver.

  omap-iommu 55082000.mmu: 55082000.mmu: version 2.1
  omap-iommu 55082000.mmu: iommu fault: da 0x8004cc60 flags 0x0
  remoteproc remoteproc1: crash detected in 55020000.ipu: type mmufault
  omap-iommu 55082000.mmu: 55082000.mmu: errs:0x00000002 da:0x8004cc60 pgd:0x63ed70cb *pgd:px95f00002
  remoteproc remoteproc1: handling crash #1 in 55020000.ipu
  remoteproc remoteproc1: recovering 55020000.ipu
  omap-rproc 55020000.ipu: omap rproc 55020000.ipu crashed
  remoteproc remoteproc1: stopped remote processor 55020000.ipu
  kobject (44f48dcd): tried to init an initialized object, something is seriously wrong.
  CPU: 0 PID: 23 Comm: kworker/0:1 Not tainted 4.19.0-00420-gd9f97bb86434 #658
  Hardware name: Generic DRA74X (Flattened Device Tree)
  Workqueue: events rproc_crash_handler_work [remoteproc]
  [<c0114224>] (unwind_backtrace) from [<c010e618>] (show_stack+0x10/0x14)
  [<c010e618>] (show_stack) from [<c09585c8>] (dump_stack+0xb0/0xe8)
  [<c09585c8>] (dump_stack) from [<c095cec0>] (kobject_init+0x78/0x94)
  [<c095cec0>] (kobject_init) from [<c06224bc>] (device_initialize+0x20/0xf0)
  [<c06224bc>] (device_initialize) from [<bf0003d4>] (register_virtio_device+0x1c/0x110 [virtio])
  [<bf0003d4>] (register_virtio_device [virtio]) from [<bf02bf34>] (rproc_add_virtio_dev+0x44/0xa0 [remoteproc])
  [<bf02bf34>] (rproc_add_virtio_dev [remoteproc]) from [<bf028744>] (rproc_start+0x1c8/0x264 [remoteproc])
  [<bf028744>] (rproc_start [remoteproc]) from [<bf02acac>] (rproc_trigger_recovery+0x28c/0x2dc [remoteproc])
  [<bf02acac>] (rproc_trigger_recovery [remoteproc]) from [<c015d438>] (process_one_work+0x2ac/0x788)
  [<c015d438>] (process_one_work) from [<c015d940>] (worker_thread+0x2c/0x584)
  [<c015d940>] (worker_thread) from [<c0164648>] (kthread+0x140/0x15c)
  [<c0164648>] (kthread) from [<c01010b4>] (ret_from_fork+0x14/0x20)
  ... exception stack dump ...
  virtio_rpmsg_bus virtio1: rpmsg host is online
  driver_bound: device virtio1 already bound
  remoteproc remoteproc1: registered virtio1 (type 7)
  remoteproc remoteproc1: remote processor 55020000.ipu is now up
  Unable to handle kernel NULL pointer dereference at virtual address 00000004

Revert the above commit to fix/restore the error recovery functionality.
This patch is a custom revert of the above commit, accounting for some
additional changes done in commit 2666ca9197e3 ("remoteproc: Add remote
processor coredump support"). The coredump function is invoked in
rproc_stop() now.

Signed-off-by: Suman Anna <s-anna@ti.com>
drivers/remoteproc/remoteproc_core.c