1. 10 May, 2020 9 commits
    • Jeremie Francois (on alpha)'s avatar
      scripts/config: allow colons in option strings for sed · 4323eedd
      Jeremie Francois (on alpha) authored
      [ Upstream commit e461bc9f ]
      
      Sed broke on some strings as it used colon as a separator.
      I made it more robust by using \001, which is legit POSIX AFAIK.
      
      E.g. ./config --set-str CONFIG_USBNET_DEVADDR "de:ad:be:ef:00:01"
      failed with: sed: -e expression #1, char 55: unknown option to `s'
      Signed-off-by: default avatarJeremie Francois (on alpha) <jeremie.francois@gmail.com>
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      4323eedd
    • Ronnie Sahlberg's avatar
      cifs: protect updating server->dstaddr with a spinlock · 3f9b0d0f
      Ronnie Sahlberg authored
      [ Upstream commit fada37f6 ]
      
      We use a spinlock while we are reading and accessing the destination address for a server.
      We need to also use this spinlock to protect when we are modifying this address from
      reconn_set_ipaddr().
      Signed-off-by: default avatarRonnie Sahlberg <lsahlber@redhat.com>
      Reviewed-by: default avatarJeff Layton <jlayton@kernel.org>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      3f9b0d0f
    • Julien Beraud's avatar
      net: stmmac: Fix sub-second increment · 8256b97f
      Julien Beraud authored
      [ Upstream commit 91a2559c ]
      
      In fine adjustement mode, which is the current default, the sub-second
          increment register is the number of nanoseconds that will be added to
          the clock when the accumulator overflows. At each clock cycle, the
          value of the addend register is added to the accumulator.
          Currently, we use 20ns = 1e09ns / 50MHz as this value whatever the
          frequency of the ptp clock actually is.
          The adjustment is then done on the addend register, only incrementing
          every X clock cycles X being the ratio between 50MHz and ptp_clock_rate
          (addend = 2^32 * 50MHz/ptp_clock_rate).
          This causes the following issues :
          - In case the frequency of the ptp clock is inferior or equal to 50MHz,
            the addend value calculation will overflow and the default
            addend value will be set to 0, causing the clock to not work at
            all. (For instance, for ptp_clock_rate = 50MHz, addend = 2^32).
          - The resolution of the timestamping clock is limited to 20ns while it
            is not needed, thus limiting the accuracy of the timestamping to
            20ns.
      
          Fix this by setting sub-second increment to 2e09ns / ptp_clock_rate.
          It will allow to reach the minimum possible frequency for
          ptp_clk_ref, which is 5MHz for GMII 1000Mps Full-Duplex by setting the
          sub-second-increment to a higher value. For instance, for 25MHz, it
          gives ssinc = 80ns and default_addend = 2^31.
          It will also allow to use a lower value for sub-second-increment, thus
          improving the timestamping accuracy with frequencies higher than
          100MHz, for instance, for 200MHz, ssinc = 10ns and default_addend =
          2^31.
      
      v1->v2:
       - Remove modifications to the calculation of default addend, which broke
       compatibility with clock frequencies for which 2000000000 / ptp_clk_freq
       is not an integer.
       - Modify description according to discussions.
      Signed-off-by: default avatarJulien Beraud <julien.beraud@orolia.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      8256b97f
    • Xiyu Yang's avatar
      wimax/i2400m: Fix potential urb refcnt leak · 5e76d93e
      Xiyu Yang authored
      [ Upstream commit 7717cbec ]
      
      i2400mu_bus_bm_wait_for_ack() invokes usb_get_urb(), which increases the
      refcount of the "notif_urb".
      
      When i2400mu_bus_bm_wait_for_ack() returns, local variable "notif_urb"
      becomes invalid, so the refcount should be decreased to keep refcount
      balanced.
      
      The issue happens in all paths of i2400mu_bus_bm_wait_for_ack(), which
      forget to decrease the refcnt increased by usb_get_urb(), causing a
      refcnt leak.
      
      Fix this issue by calling usb_put_urb() before the
      i2400mu_bus_bm_wait_for_ack() returns.
      Signed-off-by: default avatarXiyu Yang <xiyuyang19@fudan.edu.cn>
      Signed-off-by: default avatarXin Tan <tanxin.ctf@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      5e76d93e
    • Sebastian Reichel's avatar
      ASoC: sgtl5000: Fix VAG power-on handling · de37cb96
      Sebastian Reichel authored
      [ Upstream commit aa781273 ]
      
      As mentioned slightly out of patch context in the code, there
      is no reset routine for the chip. On boards where the chip is
      supplied by a fixed regulator, it might not even be resetted
      during (e.g. watchdog) reboot and can be in any state.
      
      If the device is probed with VAG enabled, the driver's probe
      routine will generate a loud pop sound when ANA_POWER is
      being programmed. Avoid this by properly disabling just the
      VAG bit and waiting the required power down time.
      Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
      Reviewed-by: default avatarFabio Estevam <festivem@gmail.com>
      Link: https://lore.kernel.org/r/20200414181140.145825-1-sebastian.reichel@collabora.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      de37cb96
    • 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 12 commits