1. 22 9月, 2022 1 次提交
    • A
      remoteproc: virtio: Create platform device for the remoteproc_virtio · 1d7b61c0
      Arnaud Pouliquen 提交于
      Define a platform driver to manage the remoteproc virtio device as
      a platform devices.
      
      The platform device allows to pass rproc_vdev_data platform data to
      specify properties that are stored in the rproc_vdev structure.
      
      Such approach will allow to preserve legacy remoteproc virtio device
      creation but also to probe the device using device tree mechanism.
      
      remoteproc_virtio.c update:
        - Add rproc_virtio_driver platform driver. The probe ops replaces
          the rproc_rvdev_add_device function.
        - All reference to the rvdev->dev has been updated to rvdev-pdev->dev.
        - rproc_rvdev_release is removed as associated to the rvdev device.
        - The use of rvdev->kref counter is replaced by get/put_device on the
          remoteproc virtio platform device.
        - The vdev device no longer increments rproc device counter.
          increment/decrement is done in rproc_virtio_probe/rproc_virtio_remove
          function in charge of the vrings allocation/free.
      
      remoteproc_core.c update:
        Migrate from the rvdev device to the rvdev platform device.
        From this patch, when a vdev resource is found in the resource table
        the remoteproc core register a platform device.
      Signed-off-by: NArnaud Pouliquen <arnaud.pouliquen@foss.st.com>
      Link: https://lore.kernel.org/r/20220921135044.917140-5-arnaud.pouliquen@foss.st.comSigned-off-by: NMathieu Poirier <mathieu.poirier@linaro.org>
      1d7b61c0
  2. 11 8月, 2022 1 次提交
  3. 12 3月, 2022 2 次提交
  4. 05 3月, 2022 1 次提交
    • P
      remoteproc: Introduce sysfs_read_only flag · 26c9da51
      Puranjay Mohan 提交于
      The remoteproc framework provides sysfs interfaces for changing
      the firmware name and for starting/stopping a remote processor
      through the sysfs files 'state' and 'firmware'. The 'coredump'
      file is used to set the coredump configuration. The 'recovery'
      sysfs file can also be used similarly to control the error recovery
      state machine of a remoteproc. These interfaces are currently
      allowed irrespective of how the remoteprocs were booted (like
      remoteproc self auto-boot, remoteproc client-driven boot etc).
      These interfaces can adversely affect a remoteproc and its clients
      especially when a remoteproc is being controlled by a remoteproc
      client driver(s). Also, not all remoteproc drivers may want to
      support the sysfs interfaces by default.
      
      Add support to make the remoteproc sysfs files read only by
      introducing a state flag 'sysfs_read_only' that the individual
      remoteproc drivers can set based on their usage needs. The default
      behavior is to allow the sysfs operations as before.
      
      Implement attribute_group->is_visible() to make the sysfs
      entries read only when 'sysfs_read_only' flag is set.
      Signed-off-by: NPuranjay Mohan <p-mohan@ti.com>
      Link: https://lore.kernel.org/r/20220216081224.9956-2-p-mohan@ti.comSigned-off-by: NMathieu Poirier <mathieu.poirier@linaro.org>
      26c9da51
  5. 15 10月, 2021 1 次提交
  6. 29 7月, 2021 1 次提交
  7. 28 5月, 2021 1 次提交
  8. 18 3月, 2021 6 次提交
  9. 12 3月, 2021 2 次提交
  10. 11 12月, 2020 2 次提交
  11. 26 11月, 2020 1 次提交
    • S
      remoteproc: Add a rproc_set_firmware() API · 4c1ad562
      Suman Anna 提交于
      A new API, rproc_set_firmware() is added to allow the remoteproc platform
      drivers and remoteproc client drivers to be able to configure a custom
      firmware name that is different from the default name used during
      remoteproc registration. This function is being introduced to provide
      a kernel-level equivalent of the current sysfs interface to remoteproc
      client drivers, and can only change firmwares when the remoteproc is
      offline. This allows some remoteproc drivers to choose different firmwares
      at runtime based on the functionality the remote processor is providing.
      The TI PRU Ethernet driver will be an example of such usage as it
      requires to use different firmwares for different supported protocols.
      
      Also, update the firmware_store() function used by the sysfs interface
      to reuse this function to avoid code duplication.
      Reviewed-by: NRishabh Bhatnagar <rishabhb@codeaurora.org>
      Signed-off-by: NSuman Anna <s-anna@ti.com>
      Link: https://lore.kernel.org/r/20201121032042.6195-1-s-anna@ti.comSigned-off-by: NBjorn Andersson <bjorn.andersson@linaro.org>
      4c1ad562
  12. 14 10月, 2020 1 次提交
  13. 05 8月, 2020 1 次提交
  14. 22 7月, 2020 2 次提交
  15. 18 7月, 2020 1 次提交
  16. 17 7月, 2020 3 次提交
  17. 13 5月, 2020 1 次提交
    • G
      remoteproc: Replace zero-length array with flexible-array · 529798ba
      Gustavo A. R. Silva 提交于
      The current codebase makes use of the zero-length array language
      extension to the C90 standard, but the preferred mechanism to declare
      variable-length types such as these ones is a flexible array member[1][2],
      introduced in C99:
      
      struct foo {
              int stuff;
              struct boo array[];
      };
      
      By making use of the mechanism above, we will get a compiler warning
      in case the flexible array does not occur last in the structure, which
      will help us prevent some kind of undefined behavior bugs from being
      inadvertently introduced[3] to the codebase from now on.
      
      Also, notice that, dynamic memory allocations won't be affected by
      this change:
      
      "Flexible array members have incomplete type, and so the sizeof operator
      may not be applied. As a quirk of the original implementation of
      zero-length arrays, sizeof evaluates to zero."[1]
      
      sizeof(flexible-array-member) triggers a warning because flexible array
      members have incomplete type[1]. There are some instances of code in
      which the sizeof operator is being incorrectly/erroneously applied to
      zero-length arrays and the result is zero. Such instances may be hiding
      some bugs. So, this work (flexible-array member conversions) will also
      help to get completely rid of those sorts of issues.
      
      This issue was found with the help of Coccinelle.
      
      [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
      [2] https://github.com/KSPP/linux/issues/21
      [3] commit 76497732 ("cxgb3/l2t: Fix undefined behaviour")
      Signed-off-by: NGustavo A. R. Silva <gustavoars@kernel.org>
      Link: https://lore.kernel.org/r/20200507191943.GA16033@embeddedorSigned-off-by: NBjorn Andersson <bjorn.andersson@linaro.org>
      529798ba
  18. 23 4月, 2020 1 次提交
  19. 21 4月, 2020 2 次提交
  20. 20 4月, 2020 1 次提交
  21. 26 3月, 2020 5 次提交
  22. 30 6月, 2019 1 次提交
  23. 21 2月, 2019 2 次提交
    • L
      remoteproc: fix recovery procedure · d4c036fe
      Loic Pallardy 提交于
      Commit 7e83cab824a87e83cab824a8 ("remoteproc: Modify recovery path
      to use rproc_{start,stop}()") replaces rproc_{shutdown,boot}() with
      rproc_{stop,start}(), which skips destroy the virtio device at stop
      but re-initializes it again at start.
      
      Issue is that struct virtio_dev is not correctly reinitialized like done
      at initial allocation thanks to kzalloc() and kobject is considered as
      already initialized by kernel. That is due to the fact struct virtio_dev
      is allocated and released at vdev resource handling level managed and
      virtio device is registered and unregistered at rproc subdevices level.
      
      Moreover kernel documentation mentions that device struct must be
      zero initialized before calling device_initialize().
      
      This patch disentangles struct virtio_dev from struct rproc_vdev as
      the two struct don't have the same life-cycle.
      
      struct virtio_dev is now allocated on rproc_start() and released
      on rproc_stop().
      
      This patch applies on top of patch
      remoteproc: create vdev subdevice with specific dma memory pool [1]
      
      [1]: https://patchwork.kernel.org/patch/10755781/
      
      Fixes: 7e83cab8 ("remoteproc: Modify recovery path to use rproc_{start,stop}()")
      Reported-by: NXiang Xiao <xiaoxiang781216@gmail.com>
      Signed-off-by: NLoic Pallardy <loic.pallardy@st.com>
      Signed-off-by: NBjorn Andersson <bjorn.andersson@linaro.org>
      d4c036fe
    • L
      remoteproc: create vdev subdevice with specific dma memory pool · 086d0872
      Loic Pallardy 提交于
      This patch creates a dedicated vdev subdevice for each vdev declared
      in firmware resource table and associates carveout named "vdev%dbuffer"
      (with %d vdev index in resource table) if any as dma coherent memory pool.
      
      Then vdev subdevice is used as parent for virtio device.
      Signed-off-by: NLoic Pallardy <loic.pallardy@st.com>
      Signed-off-by: NBjorn Andersson <bjorn.andersson@linaro.org>
      086d0872