1. 13 6月, 2021 8 次提交
  2. 12 6月, 2021 12 次提交
  3. 11 6月, 2021 11 次提交
  4. 10 6月, 2021 9 次提交
    • R
      hwmon: (tps23861) correct shunt LSB values · e13d1127
      Robert Marko 提交于
      Current shunt LSB values got reversed during in the
      original driver commit.
      
      So, correct the current shunt LSB values according to
      the datasheet.
      
      This caused reading slightly skewed current values.
      
      Fixes: fff7b8ab ("hwmon: add Texas Instruments TPS23861 driver")
      Signed-off-by: NRobert Marko <robert.marko@sartura.hr>
      Link: https://lore.kernel.org/r/20210609220728.499879-3-robert.marko@sartura.hrSigned-off-by: NGuenter Roeck <linux@roeck-us.net>
      e13d1127
    • R
      hwmon: (tps23861) set current shunt value · b325d352
      Robert Marko 提交于
      TPS23861 has a configuration bit for setting of the
      current shunt value used on the board.
      Its bit 0 of the General Mask 1 register.
      
      According to the datasheet bit values are:
      0 for 255 mOhm (Default)
      1 for 250 mOhm
      
      So, configure the bit before registering the hwmon
      device according to the value passed in the DTS or
      default one if none is passed.
      
      This caused potentially reading slightly skewed values
      due to max current value being 1.02A when 250mOhm shunt
      is used instead of 1.0A when 255mOhm is used.
      
      Fixes: fff7b8ab ("hwmon: add Texas Instruments TPS23861 driver")
      Signed-off-by: NRobert Marko <robert.marko@sartura.hr>
      Link: https://lore.kernel.org/r/20210609220728.499879-2-robert.marko@sartura.hrSigned-off-by: NGuenter Roeck <linux@roeck-us.net>
      b325d352
    • R
      hwmon: (tps23861) define regmap max register · fb8543fb
      Robert Marko 提交于
      Define the max register address the device supports.
      This allows reading the whole register space via
      regmap debugfs, without it only register 0x0 is visible.
      
      This was forgotten in the original driver commit.
      
      Fixes: fff7b8ab ("hwmon: add Texas Instruments TPS23861 driver")
      Signed-off-by: NRobert Marko <robert.marko@sartura.hr>
      Link: https://lore.kernel.org/r/20210609220728.499879-1-robert.marko@sartura.hrSigned-off-by: NGuenter Roeck <linux@roeck-us.net>
      fb8543fb
    • T
      ALSA: seq: Fix race of snd_seq_timer_open() · 83e197a8
      Takashi Iwai 提交于
      The timer instance per queue is exclusive, and snd_seq_timer_open()
      should have managed the concurrent accesses.  It looks as if it's
      checking the already existing timer instance at the beginning, but
      it's not right, because there is no protection, hence any later
      concurrent call of snd_seq_timer_open() may override the timer
      instance easily.  This may result in UAF, as the leftover timer
      instance can keep running while the queue itself gets closed, as
      spotted by syzkaller recently.
      
      For avoiding the race, add a proper check at the assignment of
      tmr->timeri again, and return -EBUSY if it's been already registered.
      
      Reported-by: syzbot+ddc1260a83ed1cbf6fb5@syzkaller.appspotmail.com
      Cc: <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/000000000000dce34f05c42f110c@google.com
      Link: https://lore.kernel.org/r/20210610152059.24633-1-tiwai@suse.deSigned-off-by: NTakashi Iwai <tiwai@suse.de>
      83e197a8
    • S
      drm/msm/dsi: Stash away calculated vco frequency on recalc · 170b7635
      Stephen Boyd 提交于
      A problem was reported on CoachZ devices where the display wouldn't come
      up, or it would be distorted. It turns out that the PLL code here wasn't
      getting called once dsi_pll_10nm_vco_recalc_rate() started returning the
      same exact frequency, down to the Hz, that the bootloader was setting
      instead of 0 when the clk was registered with the clk framework.
      
      After commit 001d8dc3 ("drm/msm/dsi: remove temp data from global
      pll structure") we use a hardcoded value for the parent clk frequency,
      i.e.  VCO_REF_CLK_RATE, and we also hardcode the value for FRAC_BITS,
      instead of getting it from the config structure. This combination of
      changes to the recalc function allows us to properly calculate the
      frequency of the PLL regardless of whether or not the PLL has been
      clk_prepare()d or clk_set_rate()d. That's a good improvement.
      
      Unfortunately, this means that now we won't call down into the PLL clk
      driver when we call clk_set_rate() because the frequency calculated in
      the framework matches the frequency that is set in hardware. If the rate
      is the same as what we want it should be OK to not call the set_rate PLL
      op. The real problem is that the prepare op in this driver uses a
      private struct member to stash away the vco frequency so that it can
      call the set_rate op directly during prepare. Once the set_rate op is
      never called because recalc_rate told us the rate is the same, we don't
      set this private struct member before the prepare op runs, so we try to
      call the set_rate function directly with a frequency of 0. This
      effectively kills the PLL and configures it for a rate that won't work.
      Calling set_rate from prepare is really quite bad and will confuse any
      downstream clks about what the rate actually is of their parent. Fixing
      that will be a rather large change though so we leave that to later.
      
      For now, let's stash away the rate we calculate during recalc so that
      the prepare op knows what frequency to set, instead of 0. This way
      things keep working and the display can enable the PLL properly. In the
      future, we should remove that code from the prepare op so that it
      doesn't even try to call the set rate function.
      
      Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
      Cc: Abhinav Kumar <abhinavk@codeaurora.org>
      Fixes: 001d8dc3 ("drm/msm/dsi: remove temp data from global pll structure")
      Signed-off-by: NStephen Boyd <swboyd@chromium.org>
      Link: https://lore.kernel.org/r/20210608195519.125561-1-swboyd@chromium.orgSigned-off-by: NRob Clark <robdclark@chromium.org>
      170b7635
    • A
      cgroup1: don't allow '\n' in renaming · b7e24eb1
      Alexander Kuznetsov 提交于
      cgroup_mkdir() have restriction on newline usage in names:
      $ mkdir $'/sys/fs/cgroup/cpu/test\ntest2'
      mkdir: cannot create directory
      '/sys/fs/cgroup/cpu/test\ntest2': Invalid argument
      
      But in cgroup1_rename() such check is missed.
      This allows us to make /proc/<pid>/cgroup unparsable:
      $ mkdir /sys/fs/cgroup/cpu/test
      $ mv /sys/fs/cgroup/cpu/test $'/sys/fs/cgroup/cpu/test\ntest2'
      $ echo $$ > $'/sys/fs/cgroup/cpu/test\ntest2'
      $ cat /proc/self/cgroup
      11:pids:/
      10:freezer:/
      9:hugetlb:/
      8:cpuset:/
      7:blkio:/user.slice
      6:memory:/user.slice
      5:net_cls,net_prio:/
      4:perf_event:/
      3:devices:/user.slice
      2:cpu,cpuacct:/test
      test2
      1:name=systemd:/
      0::/
      Signed-off-by: NAlexander Kuznetsov <wwfq@yandex-team.ru>
      Reported-by: NAndrey Krasichkov <buglloc@yandex-team.ru>
      Acked-by: NDmitry Yakunin <zeil@yandex-team.ru>
      Cc: stable@vger.kernel.org
      Signed-off-by: NTejun Heo <tj@kernel.org>
      b7e24eb1
    • A
      IB/mlx5: Fix initializing CQ fragments buffer · 2ba0aa2f
      Alaa Hleihel 提交于
      The function init_cq_frag_buf() can be called to initialize the current CQ
      fragments buffer cq->buf, or the temporary cq->resize_buf that is filled
      during CQ resize operation.
      
      However, the offending commit started to use function get_cqe() for
      getting the CQEs, the issue with this change is that get_cqe() always
      returns CQEs from cq->buf, which leads us to initialize the wrong buffer,
      and in case of enlarging the CQ we try to access elements beyond the size
      of the current cq->buf and eventually hit a kernel panic.
      
       [exception RIP: init_cq_frag_buf+103]
        [ffff9f799ddcbcd8] mlx5_ib_resize_cq at ffffffffc0835d60 [mlx5_ib]
        [ffff9f799ddcbdb0] ib_resize_cq at ffffffffc05270df [ib_core]
        [ffff9f799ddcbdc0] llt_rdma_setup_qp at ffffffffc0a6a712 [llt]
        [ffff9f799ddcbe10] llt_rdma_cc_event_action at ffffffffc0a6b411 [llt]
        [ffff9f799ddcbe98] llt_rdma_client_conn_thread at ffffffffc0a6bb75 [llt]
        [ffff9f799ddcbec8] kthread at ffffffffa66c5da1
        [ffff9f799ddcbf50] ret_from_fork_nospec_begin at ffffffffa6d95ddd
      
      Fix it by getting the needed CQE by calling mlx5_frag_buf_get_wqe() that
      takes the correct source buffer as a parameter.
      
      Fixes: 388ca8be ("IB/mlx5: Implement fragmented completion queue (CQ)")
      Link: https://lore.kernel.org/r/90a0e8c924093cfa50a482880ad7e7edb73dc19a.1623309971.git.leonro@nvidia.comSigned-off-by: NAlaa Hleihel <alaa@nvidia.com>
      Signed-off-by: NLeon Romanovsky <leonro@nvidia.com>
      Signed-off-by: NJason Gunthorpe <jgg@nvidia.com>
      2ba0aa2f
    • A
      RDMA/mlx5: Delete right entry from MR signature database · 6466f03f
      Aharon Landau 提交于
      The value mr->sig is stored in the entry upon mr allocation, however, ibmr
      is wrongly entered here as "old", therefore, xa_cmpxchg() does not replace
      the entry with NULL, which leads to the following trace:
      
       WARNING: CPU: 28 PID: 2078 at drivers/infiniband/hw/mlx5/main.c:3643 mlx5_ib_stage_init_cleanup+0x4d/0x60 [mlx5_ib]
       Modules linked in: nvme_rdma nvme_fabrics nvme_core 8021q garp mrp bonding bridge stp llc rfkill rpcrdma sunrpc rdma_ucm ib_srpt ib_isert iscsi_tad
       CPU: 28 PID: 2078 Comm: reboot Tainted: G               X --------- ---  5.13.0-0.rc2.19.el9.x86_64 #1
       Hardware name: Dell Inc. PowerEdge R430/03XKDV, BIOS 2.9.1 12/07/2018
       RIP: 0010:mlx5_ib_stage_init_cleanup+0x4d/0x60 [mlx5_ib]
       Code: 8d bb 70 1f 00 00 be 00 01 00 00 e8 9d 94 ce da 48 3d 00 01 00 00 75 02 5b c3 0f 0b 5b c3 0f 0b 48 83 bb b0 20 00 00 00 74 d5 <0f> 0b eb d1 4
       RSP: 0018:ffffa8db06d33c90 EFLAGS: 00010282
       RAX: 0000000000000000 RBX: ffff97f890a44000 RCX: ffff97f900ec0160
       RDX: 0000000000000000 RSI: 0000000080080001 RDI: ffff97f890a44000
       RBP: ffffffffc0c189b8 R08: 0000000000000001 R09: 0000000000000000
       R10: 0000000000000001 R11: 0000000000000300 R12: ffff97f890a44000
       R13: ffffffffc0c36030 R14: 00000000fee1dead R15: 0000000000000000
       FS:  00007f0d5a8a3b40(0000) GS:ffff98077fb80000(0000) knlGS:0000000000000000
       CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
       CR2: 0000555acbf4f450 CR3: 00000002a6f56002 CR4: 00000000001706e0
       Call Trace:
        mlx5r_remove+0x39/0x60 [mlx5_ib]
        auxiliary_bus_remove+0x1b/0x30
        __device_release_driver+0x17a/0x230
        device_release_driver+0x24/0x30
        bus_remove_device+0xdb/0x140
        device_del+0x18b/0x3e0
        mlx5_detach_device+0x59/0x90 [mlx5_core]
        mlx5_unload_one+0x22/0x60 [mlx5_core]
        shutdown+0x31/0x3a [mlx5_core]
        pci_device_shutdown+0x34/0x60
        device_shutdown+0x15b/0x1c0
        __do_sys_reboot.cold+0x2f/0x5b
        ? vfs_writev+0xc7/0x140
        ? handle_mm_fault+0xc5/0x290
        ? do_writev+0x6b/0x110
        do_syscall_64+0x40/0x80
        entry_SYSCALL_64_after_hwframe+0x44/0xae
      
      Fixes: e6fb246c ("RDMA/mlx5: Consolidate MR destruction to mlx5_ib_dereg_mr()")
      Link: https://lore.kernel.org/r/f3f585ea0db59c2a78f94f65eedeafc5a2374993.1623309971.git.leonro@nvidia.comSigned-off-by: NAharon Landau <aharonl@nvidia.com>
      Signed-off-by: NLeon Romanovsky <leonro@nvidia.com>
      Signed-off-by: NJason Gunthorpe <jgg@nvidia.com>
      6466f03f
    • M
      RDMA: Verify port when creating flow rule · 2adcb4c5
      Maor Gottlieb 提交于
      Validate port value provided by the user and with that remove no longer
      needed validation by the driver.  The missing check in the mlx5_ib driver
      could cause to the below oops.
      
      Call trace:
        _create_flow_rule+0x2d4/0xf28 [mlx5_ib]
        mlx5_ib_create_flow+0x2d0/0x5b0 [mlx5_ib]
        ib_uverbs_ex_create_flow+0x4cc/0x624 [ib_uverbs]
        ib_uverbs_handler_UVERBS_METHOD_INVOKE_WRITE+0xd4/0x150 [ib_uverbs]
        ib_uverbs_cmd_verbs.isra.7+0xb28/0xc50 [ib_uverbs]
        ib_uverbs_ioctl+0x158/0x1d0 [ib_uverbs]
        do_vfs_ioctl+0xd0/0xaf0
        ksys_ioctl+0x84/0xb4
        __arm64_sys_ioctl+0x28/0xc4
        el0_svc_common.constprop.3+0xa4/0x254
        el0_svc_handler+0x84/0xa0
        el0_svc+0x10/0x26c
       Code: b9401260 f9615681 51000400 8b001c20 (f9403c1a)
      
      Fixes: 436f2ad0 ("IB/core: Export ib_create/destroy_flow through uverbs")
      Link: https://lore.kernel.org/r/faad30dc5219a01727f47db3dc2f029d07c82c00.1623309971.git.leonro@nvidia.comReviewed-by: NMark Bloch <markb@mellanox.com>
      Signed-off-by: NMaor Gottlieb <maorg@nvidia.com>
      Signed-off-by: NLeon Romanovsky <leonro@nvidia.com>
      Signed-off-by: NJason Gunthorpe <jgg@nvidia.com>
      2adcb4c5