It is not preferable to have the allocated pages for carveout
memories freed before they are unmapped. The code that deals
with the cleanup of carveout memories is therefore moved after
the corresponding mapping entries were cleaned up.
This is mostly a no-op since the remote processors are already
stopped when the cleanup function is called, but this will make
the cleanup code follow the exact reverse path of allocation.
Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
This patch fixes relevant checkpatch errors and warnings
in the remoteproc source files.
Signed-off-by: Suman Anna <s-anna@ti.com>
[drop 80-char-lines checkpatch fixes and update commit log accordingly]
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Set 'ret' to -EINVAL when needed, so a sensible return value
is returned on errors.
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
[fix additional instances of this bug as well, update commit log]
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
The mailbox hardware (in OMAP) uses a queued mailbox interrupt
mechanism that provides a communication channel between processors
through a set of registers and their associated interrupt signals
by sending and receiving messages.
The OMAP mailbox framework/driver code is moved to be under
drivers/mailbox, in preparation for adapting to a common mailbox
driver framework. This allows the build for OMAP mailbox to be
enabled (it was disabled during the multi-platform support).
As part of the migration from plat and mach code:
- Kconfig symbols have been renamed to build OMAP1 or OMAP2+ drivers.
- mailbox.h under plat-omap/plat/include has been split into a public
and private header files. The public header has only the API related
functions and types.
- The module name mailbox.ko from plat-omap is changed to
omap-mailbox.ko
- The module name mailbox_mach.ko from mach-omapX is changed as
mailbox_omap1.ko for OMAP1
mailbox_omap2.ko for OMAP2+
Cc: Tony Lindgren <tony@atomide.com>
[gregkh@linuxfoundation.org: ack for staging part]
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Omar Ramirez Luna <omar.ramirez@copitl.com>
Signed-off-by: Suman Anna <s-anna@ti.com>
- Some refactoring, cleanups and small improvements
from Sjur Brændeland. The improvements are mainly
about better supporting varios virtio properties
(such as virtio's config space, status and features).
I now see that I messed up while commiting one of Sjur's
patches and erroneously put myself as the author, as well
as letting a nasty typo sneak in. I will not fix this in
order to avoid rebasing the patches. Sjur - sorry!
- A new remoteproc driver for OMAP-L13x (technically a
DaVinci platform) from Robert Tivy.
- Extend OMAP support to OMAP5 as well, from Vincent Stehlé.
- Fix Kconfig VIRTUALIZATION dependency, from Suman Anna
(a non-critical fix which arrived late during the rc cycle).
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iQIcBAABAgAGBQJRiPCwAAoJELLolMlTRIoMRoQP/ivAF3r9jPaMizky82T0mDs0
kUPz6sz0zwb412h/IVtCo0ChJ1Jv4rVgo5u4klzDS5wfOutRiwDFIa8ZQF484nRb
gTIFHtqy+xk82aHAR9PWi2G3QWJ9hplZ7m52aaOIG7E6BaY3EfWL7fnt5QGBAb/O
vcR3rrj7QNQcB963PQl7cYWSX966ipzfX1g7VxFk/Ah8m9rjQp0xZgg3a5svGmq7
5iQcdxiXm63RAfgN9kbZrxWjX5/7m1N1WOfK5CE1H2jnGObttNdhN5xr7Ky5TXyN
sVJvoVhIbylSzDVl/LH6v/V9T/is+VCZOPs+erXVGv2vGctNY5Cs+RAVPF4bz4UC
R9/LDRbdZtbvcKo0TiPAjsIN3t+Rg1EDBnjOImi5kN5bYASpfcoRE0hpicL51S01
HzdT5+k3Xo5RS0EWakITc1ecc+7kfMVjLjn59/Im+bWVGhv2Lzq1pCFQ+XAcfvL9
FrQCGYCn8QZFWBHgeDRzg1ysK4hDNPo1UkEbLTTXjFcaMLeMczSSRagCi4Fk2RjL
QYmtDzKbm7Tc03Yi6ac7A8I2lgeQRsXNENLxtTtONu9rNKf4O0Of86KCLhtUtDqb
6SUxn2ZvG+maXwyrqbIjak+CKphimOnOEEIxur3viuKLs4sM8yuZCzU+v56bPbdb
Pqcdo7VOhqAwTBoW3NUp
=IUfO
-----END PGP SIGNATURE-----
Merge tag 'remoteproc-3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/ohad/remoteproc
Pull remoteproc update from Ohad Ben-Cohen:
- Some refactoring, cleanups and small improvements from Sjur
Brændeland. The improvements are mainly about better supporting
varios virtio properties (such as virtio's config space, status and
features). I now see that I messed up while commiting one of Sjur's
patches and erroneously put myself as the author, as well as letting
a nasty typo sneak in. I will not fix this in order to avoid
rebasing the patches. Sjur - sorry!
- A new remoteproc driver for OMAP-L13x (technically a DaVinci
platform) from Robert Tivy.
- Extend OMAP support to OMAP5 as well, from Vincent Stehlé.
- Fix Kconfig VIRTUALIZATION dependency, from Suman Anna (a
non-critical fix which arrived late during the rc cycle).
* tag 'remoteproc-3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/ohad/remoteproc:
remoteproc: fix kconfig dependencies for VIRTIO
remoteproc/davinci: add a remoteproc driver for OMAP-L13x DSP
remoteproc: support default firmware name in rproc_alloc()
remoteproc/omap: support OMAP5 too
remoteproc: set vring addresses in resource table
remoteproc: support virtio config space.
remoteproc: perserve resource table data
remoteproc: calculate max_notifyid by counting vrings
remoteproc: code cleanup of resource parsing
remoteproc: parse STE-firmware and find resource table address
remoteproc: add find_loaded_rsc_table firmware ops
remoteproc: refactor rproc_elf_find_rsc_table()
Fix typo in printk and comments within various drivers.
Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Adding a new remoteproc driver for OMAP-L13x DSP
Signed-off-by: Robert Tivy <rtivy@ti.com>
[removed 'EXPERIMENTAL' and fixed some indentation issues]
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
If rproc_alloc isn't given a firmware name, look for a default
one using the "rproc-%s-fw" template.
Signed-off-by: Robert Tivy <rtivy@ti.com>
[add commit log, document change, use snprintf, minor style change]
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
This allows building remoteproc on OMAP5 too.
Signed-off-by: Vincent Stehlé <v-stehle@ti.com>
[edit commit log]
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Set the vring addresses in the resource table so that
the remote device can read the actual addresses used.
Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Acked-by: Ido Yariv <ido@wizery.com>
[rebase]
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Support virtio configuration space and device status. The virtio
device can now access the resource table in shared memory.
Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Acked-by: Ido Yariv <ido@wizery.com>
[rebase and style changes]
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Copy resource table from first to second firmware loading.
After firmware is loaded to memory, update the vdevs resource
pointer to the resource table kept in device memory.
Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Acked-by: Ido Yariv <ido@wizery.com>
[rebase, terminology and style changes]
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Parse the STE firmware and scan the TOC-table to find the address
of the loaded resource table.
Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
[rebase patch; update terminology]
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Add function find_loaded_rsc_table to firmware ops. This function
returns the location of the resource table in shared memory
after loading.
Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Acked-by: Ido Yariv <ido@wizery.com>
[align function name with existing terminology, update commit log]
[document new function, rebase patch, small cleanups]
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Refactor rproc_elf_find_rsc_table() and split out the scanning
for the section header named resource table. This is done to
prepare for loading firmware once.
Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Acked-by: Ido Yariv <ido@wizery.com>
[small function name change to make the code easier to read]
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Remove the vdev entry from the list before freeing it,
otherwise rproc->vdevs will explode.
Cc: stable@vger.kernel.org
Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Acked-by: Ido Yariv <ido@wizery.com>
[edit subject, minor commit log edit, cc stable]
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
The new idr_alloc interface returns the allocated id back
on success, so fix the error path to check for negative
values. This was missed out in the newer idr interface
adoption patch, 15fc611 "remoteproc: convert to idr_alloc()".
Signed-off-by: Suman Anna <s-anna@ti.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Convert to the much saner new idr interface.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Ohad Ben-Cohen <ohad@wizery.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
idr_destroy() can destroy idr by itself and idr_remove_all() is being
deprecated. Drop its usage.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Ohad Ben-Cohen <ohad@wizery.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Cheers,
Rusty.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iQIcBAABAgAGBQJRLEkHAAoJENkgDmzRrbjx6K0P/3o9/iW5hkOPYpu+KV2nr0wG
6RG0uu0DCOb/tckigYwnn5PkS7UEcJu6kDypnEgXfhcNhYiBjoGIAUEQ2jBYyzQm
IYc4oZhxDdqigJL/FHi2zL50mkWacTdBK83udxim3eRkgW9ysBRoBFwqMruVyhZv
474KGS4PNT8pHDOCAlrRS1I9oW2pYTuUidN+SnfVJ8gFSkH0tuHEGoJeGrtDa010
XkiWqiTJq6pDHTM5f4Wwp/WNQ21UNDBlvRahg0nqTZXicQsvujV0Tdb+EnAfXwa+
bssqvO4X2WqlraVK1TJteufhcdhUgt/I1+45p9eLZvOXizk7EBKxFWynE7C878GV
dhpz8i4mc+u6aJlGoHzwvKah0zhwDtqWdbDS+LNQjRmjMK9v45ttoisU+iR1GjLt
JpDVg73K315aWJ9RLsYu7mvZ8JY+qRFkwXqX3lZd+GdohY0DSmGMxMqJG93sLBYi
42vyHMaBd1JY0rDVqpfzlmjnSxX+k05uB0GYB3fO0CXbPxmfXtRKz7/5wpSz0Up+
nTCs6Xa7t5jtG9qpC4cKxyEDEwB9M6SSxi+lhrIBkeDqlFwXAv1Fean4jqqhtFwr
HO6i1mYgy0xCVY7EmequVyWlH6/B5GVB2xTMQuAz3f8pKm+XUr6C/twROYkgoXbV
AOVyRWtnbISDVjtVFn9c
=KcDx
-----END PGP SIGNATURE-----
Merge tag 'virtio-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux
Pull virtio updates from Rusty Russell:
"All trivial, thanks to the stuff which didn't quite make it time"
* tag 'virtio-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
virtio_console: Initialize guest_connected=true for rproc_serial
virtio: use module_virtio_driver.
virtio: Add module driver macro for virtio drivers.
virtio_console: Use virtio device index to generate port name
virtio: make pci_device_id const
virtio: make config_ops const
virtio-mmio: fix wrong comment about register offset
virtio_console: Let unconnected rproc device receive data.
Converting more ARM platforms to multiplatform support. This time, OMAP
gets converted, which is a major step since this is by far the largest
platform in terms of code size. The same thing happens to the vt8500
platform.
Conflicts include:
* Two mach/uncompress.h files are removed, the changes made to them
elsewhere can be discarded now.
* Moving the OMAP4 irq_match array has context clashes with turning
omap4_sar_ram_init into an omap_early_initcall()
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iQIVAwUAUSUyOmCrR//JCVInAQI2zRAAnDUA3ufvANykRxNIII67D0u8XAgokzx6
hwq0ywwcQknd2aetN1khs2rY3sQ+T73CcsFzOR448YHjbWg1RCZlCzL89uUH6SdR
Bir/NC2jYkB1vSVB7krWhZzpeHNsFfWW1bCzwJzJfNmAZp64js3sOR1kRKjMpA2z
RGLktrFQ1JRKF/az+xnIsrleSnS2cQguPKIs5hYxPztzN/HdvbD7ZST0ttW7wqzg
C2AA5dnWs+C++pNXyfKlN+nL1CnyLWGXbuZUejUvAxYxgtyd/gC4/aTfNi8S9RNh
eiFTmVwl8lsWqPWx7yzyHk+p19x7ypfBgydLU/z4yC3asUJoN5jyCF6GSqzetHJB
jpDqTp3lQzIlJPgLryq07Xe38vUeVIKvV4e8ySOsSBlKr6aRl5684HJSCAZR9SFa
qzHavusA5JZJKf+94UbDCPNzSqzMQYnILA039M8ekvrMZhFG89St0+NLDaxVQfO/
OrTEnwth/TJBKvOUPIuamjZzHH/RiGkumWiKrEGKOlpwHPGtdglQeziJFo8pNkwR
hjtnwn4RPPK8FIl59fERFI1hRvhUlwuhYcA2R/WTjcZw2d+jwZPzhhun37dLMVlw
fk5lhz0GBaRUmua4xFqJTkpOwHf2l/9wbzhEpmL4c/ZSrtjYwfeL/tY6aT9e8MZK
INaMr7X2QTw=
=nl4h
-----END PGP SIGNATURE-----
Merge tag 'multiplatform' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC multiplatform support from Arnd Bergmann:
"Converting more ARM platforms to multiplatform support. This time,
OMAP gets converted, which is a major step since this is by far the
largest platform in terms of code size. The same thing happens to the
vt8500 platform."
* tag 'multiplatform' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
net: cwdavinci_cpdma: export symbols for cpsw
remoteproc: omap: depend on OMAP_MBOX_FWK
[media] davinci: do not include mach/hardware.h
ARM: OMAP2+: Make sure files with omap initcalls include soc.h
ARM: OMAP2+: Include soc.h to drm.c to fix compiling
ARM: OMAP2+: Fix warning for hwspinlock omap_postcore_initcall
ARM: multi_v7_defconfig: add ARCH_ZYNQ
ARM: multi_v7_defconfig: remove unnecessary CONFIG_GPIOLIB
arm: vt8500: Remove remaining mach includes
arm: vt8500: Convert debug-macro.S to be multiplatform friendly
arm: vt8500: Remove single platform Kconfig options
ARM: OMAP2+: Remove now obsolete uncompress.h and debug-macro.S
ARM: OMAP2+: Add minimal support for booting vexpress
ARM: OMAP2+: Enable ARCH_MULTIPLATFORM support
ARM: OMAP2+: Disable code that currently does not work with multiplaform
ARM: OMAP2+: Add multiplatform debug_ll support
ARM: OMAP: Fix dmaengine init for multiplatform
ARM: OMAP: Fix i2c cmdline initcall for multiplatform
ARM: OMAP2+: Use omap initcalls
ARM: OMAP2+: Limit omap initcalls to omap only on multiplatform kernels
Patch a62a6e98 "ARM: OMAP2+: Disable code that currently does not work
with multiplaform" makes the OMAP_MBOX_FWK option depend on !MULTIPLATFORM,
which means we cannot simply select that symbol from OMAP_REMOTEPROC.
Turning the 'select' into 'depends on' ensures that all dependencies
are correct until OMAP_MBOX_FWK loses its dependency.
Without this patch, building allmodconfig results in:
drivers/remoteproc/omap_remoteproc.c:31:26: fatal error: plat/mailbox.h: No such file or directory
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Tony Lindgren <tony@atomide.com>
Acked-by: Ohad Ben-Cohen <ohad@wizery.com>
It is just a table of function pointers, make it const for cleanliness and security
reasons.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
The CONFIG_EXPERIMENTAL config item has not carried much meaning for a
while now and is almost always enabled by default. As agreed during the
Linux kernel summit, remove it from any "depends on" lines in Kconfigs.
CC: Ohad Ben-Cohen <ohad@wizery.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
CONFIG_HOTPLUG is going away as an option. As a result, the __dev*
markings need to be removed.
This change removes the use of __devinit, __devexit_p, __devinitdata,
__devinitconst, and __devexit from these drivers.
Based on patches originally written by Bill Pemberton, but redone by me
in order to handle some of the coding style issues better, by hand.
Cc: Bill Pemberton <wfp5p@virginia.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Pull trivial branch from Jiri Kosina:
"Usual stuff -- comment/printk typo fixes, documentation updates, dead
code elimination."
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (39 commits)
HOWTO: fix double words typo
x86 mtrr: fix comment typo in mtrr_bp_init
propagate name change to comments in kernel source
doc: Update the name of profiling based on sysfs
treewide: Fix typos in various drivers
treewide: Fix typos in various Kconfig
wireless: mwifiex: Fix typo in wireless/mwifiex driver
messages: i2o: Fix typo in messages/i2o
scripts/kernel-doc: check that non-void fcts describe their return value
Kernel-doc: Convention: Use a "Return" section to describe return values
radeon: Fix typo and copy/paste error in comments
doc: Remove unnecessary declarations from Documentation/accounting/getdelays.c
various: Fix spelling of "asynchronous" in comments.
Fix misspellings of "whether" in comments.
eisa: Fix spelling of "asynchronous".
various: Fix spelling of "registered" in comments.
doc: fix quite a few typos within Documentation
target: iscsi: fix comment typos in target/iscsi drivers
treewide: fix typo of "suport" in various comments and Kconfig
treewide: fix typo of "suppport" in various comments
...
Eliminate an erroneous invocation of rproc_shutdown inside
the error path of rproc_virtio_find_vqs.
Reported-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Pull virtio changes from Rusty Russell:
"New workflow: same git trees pulled by linux-next get sent straight to
Linus. Git is awkward at shuffling patches compared with quilt or mq,
but that doesn't happen often once things get into my -next branch."
* 'virtio-next' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux: (24 commits)
lguest: fix occasional crash in example launcher.
virtio-blk: Disable callback in virtblk_done()
virtio_mmio: Don't attempt to create empty virtqueues
virtio_mmio: fix off by one error allocating queue
drivers/virtio/virtio_pci.c: fix error return code
virtio: don't crash when device is buggy
virtio: remove CONFIG_VIRTIO_RING
virtio: add help to CONFIG_VIRTIO option.
virtio: support reserved vqs
virtio: introduce an API to set affinity for a virtqueue
virtio-ring: move queue_index to vring_virtqueue
virtio_balloon: not EXPERIMENTAL any more.
virtio-balloon: dependency fix
virtio-blk: fix NULL checking in virtblk_alloc_req()
virtio-blk: Add REQ_FLUSH and REQ_FUA support to bio path
virtio-blk: Add bio-based IO path for virtio-blk
virtio: console: fix error handling in init() function
tools: Fix pthread flag for Makefile of trace-agent used by virtio-trace
tools: Add guest trace agent as a user tool
virtio/console: Allocate scatterlist according to the current pipe size
...
crash is detected, this mechanism will remove all virtio children
devices, wait until their drivers let go, hard reset the remote
processor and reload the firmware (resulting in the relevant virtio
children devices re-added). Essentially the entire software stack
is reset, together with the relevant hardware, so users don't have
to reset the entire phone.
- STE Modem driver is added - by Sjur Brændeland
- OMAP DSP boot address support is added - by Juan Gutierrez
- A handful of fixes/cleanups - Sjur Brændeland, Dan Carpenter, Emil Goode
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
iQIcBAABAgAGBQJQbU3JAAoJELLolMlTRIoMJn4QANjLHhYw/BdfMF9E2DRQe0ew
HFD/siXpQKXMwJ+xDCP9RfGm88tHdn8l/q6NFCOL/hr6TywnY3RrYfijL7O8qQOQ
coIMaigOwWr9b55YBGD17ahNDsPGFdfAblWVyJBPfFf/kgVYb2NBNgTCMbGisqrK
g83t85ULZeGXeWHZxCOxGEQ1cai4HXpsPOGRxDQFeZKU7qM2fVbY+3zeQIymdZ7v
dByifhkwexjqD3n4n2TYRKQo1nC6dSBIaoF5rhRfdKk7L4rmf5J5oII66iRYIuDD
vCPblfnrLjd6nwOp/fKqEQlno8uDV8Ryjx90YyWp+IpLJO9RbQko3TDwojgjN6e/
Edg+08nmck1mfE3qKNROCmwK3Dr3j/MOkqwKfS3l7U6VMsBebwdk5me4RBTexSiH
QZzFK3Q2q5K9U+GPOgb3uBI8dHfW4/Q2rkIcM9fGEuSRUzRBPO7OwCU85KTEQxxy
PxhAYvXWzJM4lk8dUqCq0+z0Wj35RolEK/TsrwSKL/D8NxgFEgRSkAVR0TlFihEy
VOqtuGQ30OqAHByggfbtJyYVC67BIeFJPMACxKL5682cJRiZ4wCRXwMmtged/K0p
2BI3Gmz7j22mrTV2ziixNIX7fT6FoTO5KSmbJGJwbHWgctDHHFcWqSmcia6MxWzY
GxJkH+jEd3qos08kcWaZ
=cpBc
-----END PGP SIGNATURE-----
Merge tag 'remoteproc-for-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/ohad/remoteproc
Pull remoteproc update from Ohad Ben-Cohen:
- Remoteproc Recovery - by Fernando Guzman Lugo
When a remote processor crash is detected, this mechanism will remove
all virtio children devices, wait until their drivers let go, hard
reset the remote processor and reload the firmware (resulting in the
relevant virtio children devices re-added). Essentially the entire
software stack is reset, together with the relevant hardware, so
users don't have to reset the entire phone.
- STE Modem driver is added - by Sjur Brændeland
- OMAP DSP boot address support is added - by Juan Gutierrez
- A handful of fixes/cleanups - Sjur Brændeland, Dan Carpenter, Emil
Goode
* tag 'remoteproc-for-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/ohad/remoteproc:
remoteproc: Fix use of format specifyer
remoteproc: fix a potential NULL-dereference on cleanup
remoteproc: select VIRTIO to avoid build breakage
remoteproc: return -EFAULT on copy_from_user failure
remoteproc: snprintf() can return more than was printed
remoteproc: Add STE modem driver
remtoteproc: maintain max notifyid
remoteproc: create a 'recovery' debugfs entry
remoteproc: add actual recovery implementation
remoteproc: add rproc_report_crash function to notify rproc crashes
remoteproc: Add dependency to HAS_DMA
remoteproc/omap: set bootaddr support
The dma_addr_t type can be either u32 or u64 depending on
the configuration. We should use a format specifyer for the
larger type and explicitly cast to it.
Sparse warnings:
drivers/remoteproc/remoteproc_core.c:234:2: warning:
format ‘%x’ expects argument of type ‘unsigned int’,
but argument 6 has type ‘dma_addr_t’ [-Wformat]
drivers/remoteproc/remoteproc_core.c:596:2: warning:
format ‘%x’ expects argument of type ‘unsigned int’,
but argument 5 has type ‘dma_addr_t’ [-Wformat]
drivers/remoteproc/remoteproc_core.c:634:3:
warning: format ‘%x’ expects argument of type ‘unsigned int’,
but argument 5 has type ‘dma_addr_t’ [-Wformat]
Signed-off-by: Emil Goode <emilgoode@gmail.com>
[fix commit log typos]
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
We only need to allocate mapping if there is an IOMMU domain.
Otherwise, when the mappings are released, the assumption that
an IOMMU domain is there will crash and burn.
CC: stable@vger.kernel.org
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
[ohad: revise commit log]
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
drivers/built-in.o: In function `rproc_virtio_finalize_features':
remoteproc_virtio.c:(.text+0x2f9a02): undefined reference to `vring_transport_features'
drivers/built-in.o: In function `rproc_virtio_del_vqs':
remoteproc_virtio.c:(.text+0x2f9a74): undefined reference to `vring_del_virtqueue'
drivers/built-in.o: In function `rproc_virtio_find_vqs':
remoteproc_virtio.c:(.text+0x2f9c44): undefined reference to `vring_new_virtqueue'
drivers/built-in.o: In function `rproc_add_virtio_dev':
(.text+0x2f9e2c): undefined reference to `register_virtio_device'
drivers/built-in.o: In function `rproc_vq_interrupt':
(.text+0x2f9db7): undefined reference to `vring_interrupt'
drivers/built-in.o: In function `rproc_remove_virtio_dev':
(.text+0x2f9e9f): undefined reference to `unregister_virtio_device'
Cc: stable@vger.kernel.org
Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
copy_from_user() returns the number of bytes remaining to be copied, but
we want to return an error code here.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
snprintf() returns the number of characters which would have been
printed if there were enough space. For example, on the first print if
we fill up the 28 character string then it would return a number more
than 30. Use scnprintf() instead because that returns the actual number
of characters printed.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
virtio network device multiqueue support reserves
vq 3 for future use (useful both for future extensions and to make it
pretty - this way receive vqs have even and transmit - odd numbers).
Make it possible to skip initialization for
specific vq numbers by specifying NULL for name.
Document this usage as well as (existing) NULL callback.
Drivers using this not coded up yet, so I simply tested
with virtio-pci and verified that this patch does
not break existing drivers.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Instead of storing the queue index in transport-specific virtio structs,
this patch moves them to vring_virtqueue and introduces an helper to get
the value. This lets drivers simplify their management and tracing of
virtqueues.
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Add support for the STE modem shared memory driver.
This driver hooks into the remoteproc framework
in order to manage configuration and the virtio
devices.
This driver adds custom firmware handlers, because
STE modem uses a custom firmware layout.
Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
cc: Linus Walleij <linus.walleij@linaro.org>
cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
[ohad: validate mdev->ops, move setup() to probe/remove, trivial style changes]
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Platform data for device drivers should be defined in
include/linux/platform_data/*.h, not in the architecture
and platform specific directories.
This moves such data out of the omap include directories
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Nicolas Pitre <nico@linaro.org>
Acked-by: Tony Lindgren <tony@atomide.com>
Cc: Kevin Hilman <khilman@ti.com>
Cc: "Benoît Cousson" <b-cousson@ti.com>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Ohad Ben-Cohen <ohad@wizery.com>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Omar Ramirez Luna <omar.ramirez@ti.com>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
Cc: Jarkko Nikula <jarkko.nikula@bitmer.com>
Cc: Liam Girdwood <lrg@ti.com>
Cc: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Cc: Jean Pihet <j-pihet@ti.com>
Cc: J Keerthy <j-keerthy@ti.com>
Cc: linux-omap@vger.kernel.org
Some of the rproc drivers (STE modem specifically) needs to know
the range of the notification IDs used for notifying the device.
Maintain a variable in struct rproc holding the largest allocated
notification id, so low-level rproc drivers could access it.
Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
[ohad: rebase, slightly edit commit log]
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Add a 'recovery' debugfs entry to dynamically disable/enable recovery
at runtime. This is useful when one is trying to debug an rproc crash;
without it, a recovery will immediately take place, making it harder
to debug the crash.
Contributions from Subramaniam Chanderashekarapuram.
Examples:
- disabling recovery:
$ echo disabled > <debugfs>/remoteproc/remoteproc0/recovery
- in case you want to recover a crash, but keep recovery disabled
(useful in debugging sessions when you expect additional crashes
you want to debug):
$ echo recover > <debugfs>/remoteproc/remoteproc0/recovery
- enabling recovery:
$ echo enabled > <debugfs>/remoteproc/remoteproc0/recovery
Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com>
[ohad: some white space, commentary and commit log changes]
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Add rproc_trigger_recovery() which takes care of the recovery itself,
by removing, and re-adding, all of the remoteproc's virtio devices.
This resets all virtio users of the remote processor, during which
the remote processor is powered off and on again.
Signed-off-by: Fernando Guzman Lugo <fernando.lugo@ti.com>
[ohad: introduce rproc_add_virtio_devices to avoid 1.copying code 2.anomaly]
[ohad: some white space, naming and commit log changes]
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>