Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'rproc-v4.7' of git://github.com/andersson/remoteproc

Pull remoteproc updates from Bjorn Andersson:
"Introduce a synchronization point between the async firmware loading
and clients requesting the remote processor to boot, as well as
support for remote processors that are not interested in the resource
table information"

* tag 'rproc-v4.7' of git://github.com/andersson/remoteproc:
remoteproc: Add additional crash reasons
remoteproc: core: Make the loaded resource table optional
remoteproc: core: Task sync during rproc_fw_boot()

+37 -9
+31 -8
drivers/remoteproc/remoteproc_core.c
··· 57 57 58 58 static const char * const rproc_crash_names[] = { 59 59 [RPROC_MMUFAULT] = "mmufault", 60 + [RPROC_WATCHDOG] = "watchdog", 61 + [RPROC_FATAL_ERROR] = "fatal error", 60 62 }; 61 63 62 64 /* translate rproc_crash_type to string */ ··· 858 856 * copy this information to device memory. 859 857 */ 860 858 loaded_table = rproc_find_loaded_rsc_table(rproc, fw); 861 - if (!loaded_table) { 862 - ret = -EINVAL; 863 - goto clean_up; 864 - } 865 - 866 - memcpy(loaded_table, rproc->cached_table, tablesz); 859 + if (loaded_table) 860 + memcpy(loaded_table, rproc->cached_table, tablesz); 867 861 868 862 /* power up the remote processor */ 869 863 ret = rproc->ops->start(rproc); ··· 1028 1030 } 1029 1031 1030 1032 /** 1031 - * rproc_boot() - boot a remote processor 1033 + * __rproc_boot() - boot a remote processor 1032 1034 * @rproc: handle of a remote processor 1035 + * @wait: wait for rproc registration completion 1033 1036 * 1034 1037 * Boot a remote processor (i.e. load its firmware, power it on, ...). 1035 1038 * ··· 1039 1040 * 1040 1041 * Returns 0 on success, and an appropriate error value otherwise. 1041 1042 */ 1042 - int rproc_boot(struct rproc *rproc) 1043 + static int __rproc_boot(struct rproc *rproc, bool wait) 1043 1044 { 1044 1045 const struct firmware *firmware_p; 1045 1046 struct device *dev; ··· 1087 1088 goto downref_rproc; 1088 1089 } 1089 1090 1091 + /* if rproc virtio is not yet configured, wait */ 1092 + if (wait) 1093 + wait_for_completion(&rproc->firmware_loading_complete); 1094 + 1090 1095 ret = rproc_fw_boot(rproc, firmware_p); 1091 1096 1092 1097 release_firmware(firmware_p); ··· 1104 1101 mutex_unlock(&rproc->lock); 1105 1102 return ret; 1106 1103 } 1104 + 1105 + /** 1106 + * rproc_boot() - boot a remote processor 1107 + * @rproc: handle of a remote processor 1108 + */ 1109 + int rproc_boot(struct rproc *rproc) 1110 + { 1111 + return __rproc_boot(rproc, true); 1112 + } 1107 1113 EXPORT_SYMBOL(rproc_boot); 1114 + 1115 + /** 1116 + * rproc_boot_nowait() - boot a remote processor 1117 + * @rproc: handle of a remote processor 1118 + * 1119 + * Same as rproc_boot() but don't wait for rproc registration completion 1120 + */ 1121 + int rproc_boot_nowait(struct rproc *rproc) 1122 + { 1123 + return __rproc_boot(rproc, false); 1124 + } 1108 1125 1109 1126 /** 1110 1127 * rproc_shutdown() - power off the remote processor
+1
drivers/remoteproc/remoteproc_internal.h
··· 48 48 /* from remoteproc_core.c */ 49 49 void rproc_release(struct kref *kref); 50 50 irqreturn_t rproc_vq_interrupt(struct rproc *rproc, int vq_id); 51 + int rproc_boot_nowait(struct rproc *rproc); 51 52 52 53 /* from remoteproc_virtio.c */ 53 54 int rproc_add_virtio_dev(struct rproc_vdev *rvdev, int id);
+1 -1
drivers/remoteproc/remoteproc_virtio.c
··· 161 161 } 162 162 163 163 /* now that the vqs are all set, boot the remote processor */ 164 - ret = rproc_boot(rproc); 164 + ret = rproc_boot_nowait(rproc); 165 165 if (ret) { 166 166 dev_err(&rproc->dev, "rproc_boot() failed %d\n", ret); 167 167 goto error;
+4
include/linux/remoteproc.h
··· 365 365 /** 366 366 * enum rproc_crash_type - remote processor crash types 367 367 * @RPROC_MMUFAULT: iommu fault 368 + * @RPROC_WATCHDOG: watchdog bite 369 + * @RPROC_FATAL_ERROR fatal error 368 370 * 369 371 * Each element of the enum is used as an array index. So that, the value of 370 372 * the elements should be always something sane. ··· 375 373 */ 376 374 enum rproc_crash_type { 377 375 RPROC_MMUFAULT, 376 + RPROC_WATCHDOG, 377 + RPROC_FATAL_ERROR, 378 378 }; 379 379 380 380 /**