1. 10 May, 2020 4 commits
    • Tyler Hicks's avatar
      selftests/ipc: Fix test failure seen after initial test run · bca8fdc1
      Tyler Hicks authored
      [ Upstream commit b87080ea ]
      
      After successfully running the IPC msgque test once, subsequent runs
      result in a test failure:
      
        $ sudo ./run_kselftest.sh
        TAP version 13
        1..1
        # selftests: ipc: msgque
        # Failed to get stats for IPC queue with id 0
        # Failed to dump queue: -22
        # Bail out!
        # # Pass 0 Fail 0 Xfail 0 Xpass 0 Skip 0 Error 0
        not ok 1 selftests: ipc: msgque # exit=1
      
      The dump_queue() function loops through the possible message queue index
      values using calls to msgctl(kern_id, MSG_STAT, ...) where kern_id
      represents the index value. The first time the test is ran, the initial
      index value of 0 is valid and the test is able to complete. The index
      value of 0 is not valid in subsequent test runs and the loop attempts to
      try index values of 1, 2, 3, and so on until a valid index value is
      found that corresponds to the message queue created earlier in the test.
      
      The msgctl() syscall returns -1 and sets errno to EINVAL when invalid
      index values are used. The test failure is caused by incorrectly
      comparing errno to -EINVAL when cycling through possible index values.
      
      Fix invalid test failures on subsequent runs of the msgque test by
      correctly comparing errno values to a non-negated EINVAL.
      
      Fixes: 3a665531 ("selftests: IPC message queue copy feature test")
      Signed-off-by: default avatarTyler Hicks <tyhicks@linux.microsoft.com>
      Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      bca8fdc1
    • YueHaibing's avatar
      iio:ad7797: Use correct attribute_group · 855341a4
      YueHaibing authored
      [ Upstream commit 28535877 ]
      
      It should use ad7797_attribute_group in ad7797_info,
      according to commit ("iio:ad7793: Add support for the ad7796 and ad7797").
      
      Scale is fixed for the ad7796 and not programmable, hence
      should not have the scale_available attribute.
      
      Fixes: fd1a8b91 ("iio:ad7793: Add support for the ad7796 and ad7797")
      Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
      Reviewed-by: default avatarLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      855341a4
    • Alexey Kardashevskiy's avatar
      powerpc/pci/of: Parse unassigned resources · f4432845
      Alexey Kardashevskiy authored
      commit dead1c84 upstream.
      
      The pseries platform uses the PCI_PROBE_DEVTREE method of PCI probing
      which reads "assigned-addresses" of every PCI device and initializes
      the device resources. However if the property is missing or zero sized,
      then there is no fallback of any kind and the PCI resources remain
      undiscovered, i.e. pdev->resource[] array remains empty.
      
      This adds a fallback which parses the "reg" property in pretty much same
      way except it marks resources as "unset" which later make Linux assign
      those resources proper addresses.
      
      This has an effect when:
      1. a hypervisor failed to assign any resource for a device;
      2. /chosen/linux,pci-probe-only=0 is in the DT so the system may try
      assigning a resource.
      Neither is likely to happen under PowerVM.
      Signed-off-by: default avatarAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Cc: Guenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f4432845
    • Jia He's avatar
      vhost: vsock: kick send_pkt worker once device is started · 61945371
      Jia He authored
      commit 0b841030 upstream.
      
      Ning Bo reported an abnormal 2-second gap when booting Kata container [1].
      The unconditional timeout was caused by VSOCK_DEFAULT_CONNECT_TIMEOUT of
      connecting from the client side. The vhost vsock client tries to connect
      an initializing virtio vsock server.
      
      The abnormal flow looks like:
      host-userspace           vhost vsock                       guest vsock
      ==============           ===========                       ============
      connect()     -------->  vhost_transport_send_pkt_work()   initializing
         |                     vq->private_data==NULL
         |                     will not be queued
         V
      schedule_timeout(2s)
                               vhost_vsock_start()  <---------   device ready
                               set vq->private_data
      
      wait for 2s and failed
      connect() again          vq->private_data!=NULL         recv connecting pkt
      
      Details:
      1. Host userspace sends a connect pkt, at that time, guest vsock is under
         initializing, hence the vhost_vsock_start has not been called. So
         vq->private_data==NULL, and the pkt is not been queued to send to guest
      2. Then it sleeps for 2s
      3. After guest vsock finishes initializing, vq->private_data is set
      4. When host userspace wakes up after 2s, send connecting pkt again,
         everything is fine.
      
      As suggested by Stefano Garzarella, this fixes it by additional kicking the
      send_pkt worker in vhost_vsock_start once the virtio device is started. This
      makes the pending pkt sent again.
      
      After this patch, kata-runtime (with vsock enabled) boot time is reduced
      from 3s to 1s on a ThunderX2 arm64 server.
      
      [1] https://github.com/kata-containers/runtime/issues/1917Reported-by: default avatarNing Bo <n.b@live.com>
      Suggested-by: default avatarStefano Garzarella <sgarzare@redhat.com>
      Signed-off-by: default avatarJia He <justin.he@arm.com>
      Link: https://lore.kernel.org/r/20200501043840.186557-1-justin.he@arm.comSigned-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Reviewed-by: default avatarStefano Garzarella <sgarzare@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      61945371
  2. 05 May, 2020 19 commits
  3. 02 May, 2020 17 commits