11 May, 2017

1 commit

  • Pull virtio updates from Michael Tsirkin:
    "Fixes, cleanups, performance

    A bunch of changes to virtio, most affecting virtio net. Also ptr_ring
    batched zeroing - first of batching enhancements that seems ready."

    * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
    s390/virtio: change maintainership
    tools/virtio: fix spelling mistake: "wakeus" -> "wakeups"
    virtio_net: tidy a couple debug statements
    ptr_ring: support testing different batching sizes
    ringtest: support test specific parameters
    ptr_ring: batch ring zeroing
    virtio: virtio_driver doc
    virtio_net: don't reset twice on XDP on/off
    virtio_net: fix support for small rings
    virtio_net: reduce alignment for buffers
    virtio_net: rework mergeable buffer handling
    virtio_net: allow specifying context for rx
    virtio: allow extra context per descriptor
    tools/virtio: fix build breakage
    virtio: add context flag to find vqs
    virtio: wrap find_vqs
    ringtest: fix an assert statement

    Linus Torvalds
     

03 May, 2017

1 commit

  • Allows maintaining extra context per vq. For ease of use, passing in
    NULL is legal and disables the feature for all vqs.

    Includes fixes by Christian for s390, acked by Cornelia.

    Signed-off-by: Christian Borntraeger
    Acked-by: Cornelia Huck
    Signed-off-by: Michael S. Tsirkin

    Michael S. Tsirkin
     

29 Mar, 2017

1 commit

  • Remove the standalone SMD implementation as we have transitioned the
    client drivers to use the RPMSG based one.

    Also remove all dependencies on QCOM_SMD from Kconfig files, in order to
    keep them selectable in the absence of the removed symbol.

    Acked-by: Andy Gross
    Signed-off-by: Bjorn Andersson
    Signed-off-by: David S. Miller

    Bjorn Andersson
     

21 Mar, 2017

1 commit

  • qcom_smd_register_edge() is provided by either QCOM_SMD or RPMSG_QCOM_SMD,
    and if both of them are disabled, it does nothing.

    The check for the PIL drivers however only checks for QCOM_SMD, so it breaks
    with QCOM_SMD=n && RPMSG_QCOM_SMD=m:

    drivers/remoteproc/built-in.o: In function `smd_subdev_remove':
    qcom_wcnss_iris.c:(.text+0x231c): undefined reference to `qcom_smd_unregister_edge'
    drivers/remoteproc/built-in.o: In function `smd_subdev_probe':
    qcom_wcnss_iris.c:(.text+0x2344): undefined reference to `qcom_smd_register_edge'
    drivers/remoteproc/built-in.o: In function `smd_subdev_probe':
    qcom_q6v5_pil.c:(.text+0x3538): undefined reference to `qcom_smd_register_edge'
    qcom_q6v5_pil.c:(.text+0x3538): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `qcom_smd_register_edge'

    This clarifies the Kconfig dependency.

    Fixes: 4b48921a8f74 ("remoteproc: qcom: Use common SMD edge handler")
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Bjorn Andersson

    Arnd Bergmann
     

03 Mar, 2017

1 commit

  • Pull vhost updates from Michael Tsirkin:
    "virtio, vhost: optimizations, fixes

    Looks like a quiet cycle for vhost/virtio, just a couple of minor
    tweaks. Most notable is automatic interrupt affinity for blk and scsi.
    Hopefully other devices are not far behind"

    * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
    virtio-console: avoid DMA from stack
    vhost: introduce O(1) vq metadata cache
    virtio_scsi: use virtio IRQ affinity
    virtio_blk: use virtio IRQ affinity
    blk-mq: provide a default queue mapping for virtio device
    virtio: provide a method to get the IRQ affinity mask for a virtqueue
    virtio: allow drivers to request IRQ affinity when creating VQs
    virtio_pci: simplify MSI-X setup
    virtio_pci: don't duplicate the msix_enable flag in struct pci_dev
    virtio_pci: use shared interrupts for virtqueues
    virtio_pci: remove struct virtio_pci_vq_info
    vhost: try avoiding avail index access when getting descriptor
    virtio_mmio: expose header to userspace

    Linus Torvalds
     

28 Feb, 2017

1 commit

  • Add a struct irq_affinity pointer to the find_vqs methods, which if set
    is used to tell the PCI layer to create the MSI-X vectors for our I/O
    virtqueues with the proper affinity from the start. Compared to after
    the fact affinity hints this gives us an instantly working setup and
    allows to allocate the irq descritors node-local and avoid interconnect
    traffic. Last but not least this will allow blk-mq queues are created
    based on the interrupt affinity for storage drivers.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Jason Wang
    Signed-off-by: Michael S. Tsirkin

    Christoph Hellwig
     

22 Feb, 2017

1 commit

  • In the transition from using rproc_da_to_va(), the type of the load
    offset became unsigned. This causes the subsequent check to let negative
    values less than p_memsz + mem_size through and we write outside of the
    buffer.

    Change the type back to a signed value to catch this.

    Fixes: 7f0dd07a9b29 ("remoteproc: qcom: mdt_loader: Refactor MDT loader")
    Fixes: e7fd25226295 ("remoteproc: qcom: q6v5: Decouple driver from MDT loader")
    Reported-by: Dan Carpenter
    Reported-by: Stanimir Varbanov
    Acked-by: Andy Gross
    Signed-off-by: Bjorn Andersson

    Bjorn Andersson
     

07 Feb, 2017

13 commits


01 Feb, 2017

1 commit

  • The recently added initialization is rather unusual because it uses a constructor for
    a variable-length array to assign a constant structure to a member that uses a fixed-length
    array. This confuses clang and breaks the build.

    drivers/remoteproc/qcom_q6v5_pil.c:1024:18: error: incompatible pointer types initializing 'const char *' with an expression of type
    :%s 'struct qcom_mss_reg_res [4]' [-Werror,-Wincompatible-pointer-types]
    .proxy_supply = (struct qcom_mss_reg_res[]) {
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    drivers/remoteproc/qcom_q6v5_pil.c:1024:18: warning: suggest braces around initialization of subobject [-Wmissing-braces]
    .proxy_supply = (struct qcom_mss_reg_res[]) {
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    We can either turn this constructor into a regular initializer by removing
    the 'struct qcom_mss_reg_res[])', or we can make the array variable length.

    The latter approach is used for the arrays of strings in the same structure,
    so let's use that here too.

    Fixes: 19f902b53b47 ("remoteproc: qcom: Initialize and enable proxy and active regulators.")
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Bjorn Andersson

    Arnd Bergmann
     

31 Jan, 2017

6 commits

  • firmware_loading_complete is used to synchronize operations
    on rproc while asynchronous firmware loading is in progress.
    However, rproc_boot() no longer waits on
    firmware_loading_complete. Hence drop this completion
    variable altogether and handle the race between rproc_del()
    and rproc_boot() using new state RPROC_DELETED.

    The request_firmware_nowait() will hold the reference to
    rproc device by using a get_device()/put_device(), so the
    rproc struct will remain valid even when we return from
    rproc_del() before the asynchronous call to
    rproc_fw_config_virtio() completes.

    CC: Loic Pallardy
    CC: Bjorn Andersson
    Signed-off-by: Sarangdhar Joshi
    Signed-off-by: Bjorn Andersson

    Sarangdhar Joshi
     
  • Add new state RPROC_DELETED to handle synchronization
    between rproc_del() and other operations on rproc. This
    state represents the rproc device that has been "deleted".

    CC: Loic Pallardy
    CC: Bjorn Andersson
    Signed-off-by: Sarangdhar Joshi
    Signed-off-by: Bjorn Andersson

    Sarangdhar Joshi
     
  • The "remoteproc{0,1...}" sysfs entries are added in
    rproc_add() and deleted in rproc_type_release() instead of
    in rproc_del(). That leaves these lingering entries sticking
    around after we return from rproc_del(). Move the
    rproc_delete_debug_dir() to rproc_del() to fix this.

    Signed-off-by: Sarangdhar Joshi
    Signed-off-by: Bjorn Andersson

    Sarangdhar Joshi
     
  • This patch add slpi remoteproc support in existing adsp rproc driver.

    Signed-off-by: Avaneesh Kumar Dwivedi
    [bjorn: documented aggre2 and px-supply]
    Signed-off-by: Bjorn Andersson

    Avaneesh Kumar Dwivedi
     
  • This patch add additional clock and regulator resource which are
    initialized based on compatible and has no impact on existing driver
    working. This resourse addition enable the existing driver to handle.
    low pass sensor processor device also.

    Signed-off-by: Avaneesh Kumar Dwivedi
    Signed-off-by: Bjorn Andersson

    Avaneesh Kumar Dwivedi
     
  • This patch initialize certain driver related data based on compatible
    string. This enable driver to handle more than one similar device in
    by differentiating in probe their private data.

    Signed-off-by: Avaneesh Kumar Dwivedi
    Signed-off-by: Bjorn Andersson

    Avaneesh Kumar Dwivedi
     

19 Jan, 2017

5 commits

  • Declare rproc_ops structures as const as they are only passed as an
    argument to the function rproc_alloc. This argument is of type const, so
    rproc_ops structures having this property can be declared const too.
    Done using Coccinelle:

    @r1 disable optional_qualifier @
    identifier i;
    position p;
    @@
    static struct rproc_ops i@p = {...};

    @ok1@
    identifier r1.i;
    position p;
    @@
    rproc_alloc(...,&i@p,...)

    @bad@
    position p!={r1.p,ok1.p};
    identifier r1.i;
    @@
    i@p

    @depends on !bad disable optional_qualifier@
    identifier r1.i;
    @@
    +const
    struct rproc_ops i;

    File size details:

    Size of the file remoteproc/da8xx_remoteproc.o remains the same before and
    after applying the changes.

    text data bss dec hex filename
    1312 100 4 1416 588 remoteproc/da8xx_remoteproc.o
    1312 100 4 1416 588 remoteproc/da8xx_remoteproc.o

    970 240 0 1210 4ba remoteproc/omap_remoteproc.o
    1002 192 0 1194 4aa remoteproc/omap_remoteproc.o

    1901 240 0 2141 85d remoteproc/st_remoteproc.o
    1933 192 0 2125 84d remoteproc/st_remoteproc.o

    1288 96 0 1384 568 remoteproc/st_slim_rproc.o
    1320 64 0 1384 568 remoteproc/st_slim_rproc.o

    2121 240 0 2361 939 remoteproc/wkup_m3_rproc.o
    2161 192 0 2353 931 remoteproc/wkup_m3_rproc.o

    Signed-off-by: Bhumika Goyal
    Signed-off-by: Bjorn Andersson

    Bhumika Goyal
     
  • Certain regulators need voting by rproc on behalf of hexagon only during
    restart operation but certain regulator need to be voted till hexagon
    is up, these regulators are identified as proxy and active regulators
    respectively. This patch provide interface to initialize, enable and
    disable proxy and active regulators separately.

    Signed-off-by: Avaneesh Kumar Dwivedi
    [bjorn: dropped disable of proxy regulators from stop]
    Signed-off-by: Bjorn Andersson

    Avaneesh Kumar Dwivedi
     
  • Certain clocks need voting by rproc on behalf of hexagon only during
    restart operation but certain clocks need to be voted till hexagon is
    up, these clocks are identified as proxy and active clocks respectively.
    This patch provide interface to initialize, enable and disable proxy and
    active clocks separately.

    Signed-off-by: Avaneesh Kumar Dwivedi
    [bjorn: dropped disable of proxy clocks on stop]
    Signed-off-by: Bjorn Andersson

    Avaneesh Kumar Dwivedi
     
  • MSS rproc loader need chip specific resources initialization during probe
    to load and boot modem firmware, this need compatible string based
    differentiation in resources to be initialized. This patch add and provide
    a template struct whose fields represent all those resources which are
    needed to load and boot modem fw and which may differ from chip to chip.
    This patch also add new compatible string for msm8916, msm8974 platform.

    Signed-off-by: Avaneesh Kumar Dwivedi
    Signed-off-by: Bjorn Andersson

    Avaneesh Kumar Dwivedi
     
  • Top level config option without any kind of help... is kind of
    strange. Remote processors could also mean some kind of distributed
    computing...

    Signed-off-by: Pavel Machek
    Signed-off-by: Bjorn Andersson

    Pavel Machek
     

30 Dec, 2016

2 commits

  • Following any fw_rsc_vdev entries in the resource table are two variable
    length arrays, the first one reference vring resources and the second
    one is the virtio config space. The virtio config space is used by
    virtio to communicate status and configuration changes and must as such
    be shared with the remote.

    The reverted commit incorrectly made any changes to the virtio config
    space only affect the local copy, in an attempt to allowing memory
    protection of the shared resource table.

    This reverts commit cda8529346935fc86f476999ac4fbfe4e17abf11.
    Signed-off-by: Bjorn Andersson

    Bjorn Andersson
     
  • Commit 2b45cef5868a ("remoteproc: Further extend the vdev life cycle")
    extends kref support for vdev management.
    It introduces a regression when following sequence is executed:
    rproc_boot --> rproc_shutdown --> rproc_boot
    Second rproc_boot call crashes on register_virtio_device as device
    is already existing.
    Issue is previous vdev is never released when rproc is stop because
    associated refcount is too high.

    kref_get introduces is not needed as kref_init already initializes
    krefcount to 1 because it considers associated variable as used.
    This introduces a misalignment between kref_get and kref_put calls.

    Fixes: 2b45cef5868a ("remoteproc: Further extend the vdev life cycle")
    Signed-off-by: Loic Pallardy
    Signed-off-by: Bjorn Andersson

    Loic Pallardy
     

10 Dec, 2016

5 commits

  • The adsp-pil driver relies on SCM and causes a build error without it:

    ERROR: "qcom_scm_pas_supported" [drivers/remoteproc/qcom_adsp_pil.ko] undefined!
    ERROR: "qcom_scm_is_available" [drivers/remoteproc/qcom_adsp_pil.ko] undefined!
    ERROR: "qcom_scm_pas_auth_and_reset" [drivers/remoteproc/qcom_adsp_pil.ko] undefined!
    ERROR: "qcom_scm_pas_shutdown" [drivers/remoteproc/qcom_adsp_pil.ko] undefined!
    ERROR: "qcom_scm_pas_mem_setup" [drivers/remoteproc/qcom_adsp_pil.ko] undefined!
    ERROR: "qcom_scm_pas_init_image" [drivers/remoteproc/qcom_adsp_pil.ko] undefined!

    This adds a 'select', as SCM is a silent Kconfig symbol that gets
    enabled implicitly by all its users.

    Fixes: b9e718e950c3 ("remoteproc: Introduce Qualcomm ADSP PIL")
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Bjorn Andersson

    Arnd Bergmann
     
  • In the event that rproc_boot() is called before the firmware loaded
    completion has been flagged it will wait with the mutex held,
    obstructing the request_firmware_nowait() callback from completing the
    wait.

    As rproc_fw_config_virtio() has been reduced to only triggering
    auto-boot there is no longer a reason for waiting in rproc_boot(), so
    drop this.

    Cc: Sarangdhar Joshi
    Signed-off-by: Bjorn Andersson

    Bjorn Andersson
     
  • Back in July 2014 I asked around what was the intended target
    platform for the STE Modem remoteproc driver, so that I could add the
    proper hardware dependency to its config option. The answer I got was
    that there was no known publicly available hardware needing it and it
    was unlikely that there ever would.

    So I think it's time to delete this driver to lower the maintenance
    burden.

    Signed-off-by: Jean Delvare
    Cc: Linus Walleij
    Cc: Ohad Ben-Cohen
    Cc: Bjorn Andersson
    Cc: Suman Anna
    Acked-by: Linus Walleij
    Acked-by: Loic Pallardy
    Signed-off-by: Bjorn Andersson

    Jean Delvare
     
  • Warning users that remoteproc and it's binary format are under
    development doesn't serve much of a purpose. Different drivers support
    different image formats and the resource table has a version field that
    would need to be bumped when incompatible changes are introduced.

    So lets drop this warning to clean up the kernel log.

    Signed-off-by: Bjorn Andersson

    Bjorn Andersson
     
  • The adsp-pil driver relies on SCM and causes a build error without it:

    ERROR: "qcom_scm_pas_supported" [drivers/remoteproc/qcom_adsp_pil.ko] undefined!
    ERROR: "qcom_scm_is_available" [drivers/remoteproc/qcom_adsp_pil.ko] undefined!
    ERROR: "qcom_scm_pas_auth_and_reset" [drivers/remoteproc/qcom_adsp_pil.ko] undefined!
    ERROR: "qcom_scm_pas_shutdown" [drivers/remoteproc/qcom_adsp_pil.ko] undefined!
    ERROR: "qcom_scm_pas_mem_setup" [drivers/remoteproc/qcom_adsp_pil.ko] undefined!
    ERROR: "qcom_scm_pas_init_image" [drivers/remoteproc/qcom_adsp_pil.ko] undefined!

    This adds a 'select', as SCM is a silent Kconfig symbol that gets
    enabled implicitly by all its users.

    Fixes: b9e718e950c3 ("remoteproc: Introduce Qualcomm ADSP PIL")
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Bjorn Andersson

    Arnd Bergmann
     

03 Dec, 2016

1 commit

  • Add linux/sizes.h to prevent build failure on non ARM architectures
    as:

    CC [M] drivers/remoteproc/qcom_mdt_loader.o
    In file included from include/linux/cache.h:4:0,
    from include/linux/printk.h:8,
    from include/linux/kernel.h:13,
    from include/asm-generic/bug.h:13,
    from arch/x86/include/asm/bug.h:35,
    from include/linux/bug.h:4,
    from include/linux/thread_info.h:11,
    from arch/x86/include/asm/elf.h:7,
    from include/linux/elf.h:4,
    from drivers/remoteproc/qcom_mdt_loader.c:18:
    drivers/remoteproc/qcom_mdt_loader.c: In function ‘qcom_mdt_parse’:
    drivers/remoteproc/qcom_mdt_loader.c:90:52: error: ‘SZ_4K’ undeclared
    (first use in this function)

    Reviewed-by: Stephen Boyd
    Signed-off-by: Stanimir Varbanov
    Signed-off-by: Bjorn Andersson

    Stanimir Varbanov