Skip to content
  1. Feb 20, 2020
    • Sean Christopherson's avatar
      KVM: nVMX: Use correct root level for nested EPT shadow page tables · 740d876b
      Sean Christopherson authored
      commit 148d735e upstream.
      
      Hardcode the EPT page-walk level for L2 to be 4 levels, as KVM's MMU
      currently also hardcodes the page walk level for nested EPT to be 4
      levels.  The L2 guest is all but guaranteed to soft hang on its first
      instruction when L1 is using EPT, as KVM will construct 4-level page
      tables and then tell hardware to use 5-level page tables.
      
      Fixes: 855feb67
      
       ("KVM: MMU: Add 5 level EPT & Shadow page table support.")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarSean Christopherson <sean.j.christopherson@intel.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      740d876b
    • Will Deacon's avatar
      arm64: ssbs: Fix context-switch when SSBS is present on all CPUs · 7a89674c
      Will Deacon authored
      commit fca3d33d upstream.
      
      When all CPUs in the system implement the SSBS extension, the SSBS field
      in PSTATE is the definitive indication of the mitigation state. Further,
      when the CPUs implement the SSBS manipulation instructions (advertised
      to userspace via an HWCAP), EL0 can toggle the SSBS field directly and
      so we cannot rely on any shadow state such as TIF_SSBD at all.
      
      Avoid forcing the SSBS field in context-switch on such a system, and
      simply rely on the PSTATE register instead.
      
      Cc: <stable@vger.kernel.org>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Srinivas Ramana <sramana@codeaurora.org>
      Fixes: cbdf8a18
      
       ("arm64: Force SSBS on context switch")
      Reviewed-by: default avatarMarc Zyngier <maz@kernel.org>
      Signed-off-by: default avatarWill Deacon <will@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7a89674c
    • Krzysztof Kozlowski's avatar
      ARM: npcm: Bring back GPIOLIB support · 04b2cbc1
      Krzysztof Kozlowski authored
      commit e383e871 upstream.
      
      The CONFIG_ARCH_REQUIRE_GPIOLIB is gone since commit 65053e1a
      ("gpio: delete ARCH_[WANTS_OPTIONAL|REQUIRE]_GPIOLIB") and all platforms
      should explicitly select GPIOLIB to have it.
      
      Link: https://lore.kernel.org/r/20200130195525.4525-1-krzk@kernel.org
      Cc: <stable@vger.kernel.org>
      Fixes: 65053e1a
      
       ("gpio: delete ARCH_[WANTS_OPTIONAL|REQUIRE]_GPIOLIB")
      Signed-off-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
      Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      04b2cbc1
    • David Sterba's avatar
      btrfs: log message when rw remount is attempted with unclean tree-log · a3eccdff
      David Sterba authored
      commit 10a3a3ed
      
       upstream.
      
      A remount to a read-write filesystem is not safe when there's tree-log
      to be replayed. Files that could be opened until now might be affected
      by the changes in the tree-log.
      
      A regular mount is needed to replay the log so the filesystem presents
      the consistent view with the pending changes included.
      
      CC: stable@vger.kernel.org # 4.4+
      Reviewed-by: default avatarAnand Jain <anand.jain@oracle.com>
      Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a3eccdff
    • David Sterba's avatar
      btrfs: print message when tree-log replay starts · 2a902b48
      David Sterba authored
      commit e8294f2f
      
       upstream.
      
      There's no logged information about tree-log replay although this is
      something that points to previous unclean unmount. Other filesystems
      report that as well.
      
      Suggested-by: default avatarChris Murphy <lists@colorremedies.com>
      CC: stable@vger.kernel.org # 4.4+
      Reviewed-by: default avatarAnand Jain <anand.jain@oracle.com>
      Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2a902b48
    • Wenwen Wang's avatar
      btrfs: ref-verify: fix memory leaks · 67d9c9e4
      Wenwen Wang authored
      commit f311ade3
      
       upstream.
      
      In btrfs_ref_tree_mod(), 'ref' and 'ra' are allocated through kzalloc() and
      kmalloc(), respectively. In the following code, if an error occurs, the
      execution will be redirected to 'out' or 'out_unlock' and the function will
      be exited. However, on some of the paths, 'ref' and 'ra' are not
      deallocated, leading to memory leaks. For example, if 'action' is
      BTRFS_ADD_DELAYED_EXTENT, add_block_entry() will be invoked. If the return
      value indicates an error, the execution will be redirected to 'out'. But,
      'ref' is not deallocated on this path, causing a memory leak.
      
      To fix the above issues, deallocate both 'ref' and 'ra' before exiting from
      the function when an error is encountered.
      
      CC: stable@vger.kernel.org # 4.15+
      Signed-off-by: default avatarWenwen Wang <wenwen@cs.uga.edu>
      Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      67d9c9e4
    • Filipe Manana's avatar
      Btrfs: fix race between using extent maps and merging them · 4a4257c7
      Filipe Manana authored
      commit ac05ca91
      
       upstream.
      
      We have a few cases where we allow an extent map that is in an extent map
      tree to be merged with other extents in the tree. Such cases include the
      unpinning of an extent after the respective ordered extent completed or
      after logging an extent during a fast fsync. This can lead to subtle and
      dangerous problems because when doing the merge some other task might be
      using the same extent map and as consequence see an inconsistent state of
      the extent map - for example sees the new length but has seen the old start
      offset.
      
      With luck this triggers a BUG_ON(), and not some silent bug, such as the
      following one in __do_readpage():
      
        $ cat -n fs/btrfs/extent_io.c
        3061  static int __do_readpage(struct extent_io_tree *tree,
        3062                           struct page *page,
        (...)
        3127                  em = __get_extent_map(inode, page, pg_offset, cur,
        3128                                        end - cur + 1, get_extent, em_cached);
        3129                  if (IS_ERR_OR_NULL(em)) {
        3130                          SetPageError(page);
        3131                          unlock_extent(tree, cur, end);
        3132                          break;
        3133                  }
        3134                  extent_offset = cur - em->start;
        3135                  BUG_ON(extent_map_end(em) <= cur);
        (...)
      
      Consider the following example scenario, where we end up hitting the
      BUG_ON() in __do_readpage().
      
      We have an inode with a size of 8KiB and 2 extent maps:
      
        extent A: file offset 0, length 4KiB, disk_bytenr = X, persisted on disk by
                  a previous transaction
      
        extent B: file offset 4KiB, length 4KiB, disk_bytenr = X + 4KiB, not yet
                  persisted but writeback started for it already. The extent map
      	    is pinned since there's writeback and an ordered extent in
      	    progress, so it can not be merged with extent map A yet
      
      The following sequence of steps leads to the BUG_ON():
      
      1) The ordered extent for extent B completes, the respective page gets its
         writeback bit cleared and the extent map is unpinned, at that point it
         is not yet merged with extent map A because it's in the list of modified
         extents;
      
      2) Due to memory pressure, or some other reason, the MM subsystem releases
         the page corresponding to extent B - btrfs_releasepage() is called and
         returns 1, meaning the page can be released as it's not dirty, not under
         writeback anymore and the extent range is not locked in the inode's
         iotree. However the extent map is not released, either because we are
         not in a context that allows memory allocations to block or because the
         inode's size is smaller than 16MiB - in this case our inode has a size
         of 8KiB;
      
      3) Task B needs to read extent B and ends up __do_readpage() through the
         btrfs_readpage() callback. At __do_readpage() it gets a reference to
         extent map B;
      
      4) Task A, doing a fast fsync, calls clear_em_loggin() against extent map B
         while holding the write lock on the inode's extent map tree - this
         results in try_merge_map() being called and since it's possible to merge
         extent map B with extent map A now (the extent map B was removed from
         the list of modified extents), the merging begins - it sets extent map
         B's start offset to 0 (was 4KiB), but before it increments the map's
         length to 8KiB (4kb + 4KiB), task A is at:
      
         BUG_ON(extent_map_end(em) <= cur);
      
         The call to extent_map_end() sees the extent map has a start of 0
         and a length still at 4KiB, so it returns 4KiB and 'cur' is 4KiB, so
         the BUG_ON() is triggered.
      
      So it's dangerous to modify an extent map that is in the tree, because some
      other task might have got a reference to it before and still using it, and
      needs to see a consistent map while using it. Generally this is very rare
      since most paths that lookup and use extent maps also have the file range
      locked in the inode's iotree. The fsync path is pretty much the only
      exception where we don't do it to avoid serialization with concurrent
      reads.
      
      Fix this by not allowing an extent map do be merged if if it's being used
      by tasks other then the one attempting to merge the extent map (when the
      reference count of the extent map is greater than 2).
      
      Reported-by: default avatarryusuke1925 <st13s20@gm.ibaraki-ct.ac.jp>
      Reported-by: default avatarKoki Mitani <koki.mitani.xg@hco.ntt.co.jp>
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=206211
      CC: stable@vger.kernel.org # 4.4+
      Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
      Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
      Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4a4257c7
    • Theodore Ts'o's avatar
      ext4: improve explanation of a mount failure caused by a misconfigured kernel · c48bf2fc
      Theodore Ts'o authored
      commit d65d87a0 upstream.
      
      If CONFIG_QFMT_V2 is not enabled, but CONFIG_QUOTA is enabled, when a
      user tries to mount a file system with the quota or project quota
      enabled, the kernel will emit a very confusing messsage:
      
          EXT4-fs warning (device vdc): ext4_enable_quotas:5914: Failed to enable quota tracking (type=0, err=-3). Please run e2fsck to fix.
          EXT4-fs (vdc): mount failed
      
      We will now report an explanatory message indicating which kernel
      configuration options have to be enabled, to avoid customer/sysadmin
      confusion.
      
      Link: https://lore.kernel.org/r/20200215012738.565735-1-tytso@mit.edu
      Google-Bug-Id: 149093531
      Fixes: 7c319d32
      
       ("ext4: make quota as first class supported feature")
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Cc: stable@kernel.org
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c48bf2fc
    • Shijie Luo's avatar
      ext4: add cond_resched() to ext4_protect_reserved_inode · a5c03b93
      Shijie Luo authored
      commit af133ade
      
       upstream.
      
      When journal size is set too big by "mkfs.ext4 -J size=", or when
      we mount a crafted image to make journal inode->i_size too big,
      the loop, "while (i < num)", holds cpu too long. This could cause
      soft lockup.
      
      [  529.357541] Call trace:
      [  529.357551]  dump_backtrace+0x0/0x198
      [  529.357555]  show_stack+0x24/0x30
      [  529.357562]  dump_stack+0xa4/0xcc
      [  529.357568]  watchdog_timer_fn+0x300/0x3e8
      [  529.357574]  __hrtimer_run_queues+0x114/0x358
      [  529.357576]  hrtimer_interrupt+0x104/0x2d8
      [  529.357580]  arch_timer_handler_virt+0x38/0x58
      [  529.357584]  handle_percpu_devid_irq+0x90/0x248
      [  529.357588]  generic_handle_irq+0x34/0x50
      [  529.357590]  __handle_domain_irq+0x68/0xc0
      [  529.357593]  gic_handle_irq+0x6c/0x150
      [  529.357595]  el1_irq+0xb8/0x140
      [  529.357599]  __ll_sc_atomic_add_return_acquire+0x14/0x20
      [  529.357668]  ext4_map_blocks+0x64/0x5c0 [ext4]
      [  529.357693]  ext4_setup_system_zone+0x330/0x458 [ext4]
      [  529.357717]  ext4_fill_super+0x2170/0x2ba8 [ext4]
      [  529.357722]  mount_bdev+0x1a8/0x1e8
      [  529.357746]  ext4_mount+0x44/0x58 [ext4]
      [  529.357748]  mount_fs+0x50/0x170
      [  529.357752]  vfs_kern_mount.part.9+0x54/0x188
      [  529.357755]  do_mount+0x5ac/0xd78
      [  529.357758]  ksys_mount+0x9c/0x118
      [  529.357760]  __arm64_sys_mount+0x28/0x38
      [  529.357764]  el0_svc_common+0x78/0x130
      [  529.357766]  el0_svc_handler+0x38/0x78
      [  529.357769]  el0_svc+0x8/0xc
      [  541.356516] watchdog: BUG: soft lockup - CPU#0 stuck for 23s! [mount:18674]
      
      Link: https://lore.kernel.org/r/20200211011752.29242-1-luoshijie1@huawei.com
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarShijie Luo <luoshijie1@huawei.com>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Cc: stable@kernel.org
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a5c03b93
    • Jan Kara's avatar
      ext4: fix checksum errors with indexed dirs · bda71c14
      Jan Kara authored
      commit 48a34311 upstream.
      
      DIR_INDEX has been introduced as a compat ext4 feature. That means that
      even kernels / tools that don't understand the feature may modify the
      filesystem. This works because for kernels not understanding indexed dir
      format, internal htree nodes appear just as empty directory entries.
      Index dir aware kernels then check the htree structure is still
      consistent before using the data. This all worked reasonably well until
      metadata checksums were introduced. The problem is that these
      effectively made DIR_INDEX only ro-compatible because internal htree
      nodes store checksums in a different place than normal directory blocks.
      Thus any modification ignorant to DIR_INDEX (or just clearing
      EXT4_INDEX_FL from the inode) will effectively cause checksum mismatch
      and trigger kernel errors. So we have to be more careful when dealing
      with indexed directories on filesystems with checksumming enabled.
      
      1) We just disallow loading any directory inodes with EXT4_INDEX_FL when
      DIR_INDEX is not enabled. This is harsh but it should be very rare (it
      means someone disabled DIR_INDEX on existing filesystem and didn't run
      e2fsck), e2fsck can fix the problem, and we don't want to answer the
      difficult question: "Should we rather corrupt the directory more or
      should we ignore that DIR_INDEX feature is not set?"
      
      2) When we find out htree structure is corrupted (but the filesystem and
      the directory should in support htrees), we continue just ignoring htree
      information for reading but we refuse to add new entries to the
      directory to avoid corrupting it more.
      
      Link: https://lore.kernel.org/r/20200210144316.22081-1-jack@suse.cz
      Fixes: dbe89444
      
       ("ext4: Calculate and verify checksums for htree nodes")
      Reviewed-by: default avatarAndreas Dilger <adilger@dilger.ca>
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Cc: stable@kernel.org
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      bda71c14
    • Theodore Ts'o's avatar
      ext4: fix support for inode sizes > 1024 bytes · 5ad597ec
      Theodore Ts'o authored
      commit 4f97a681 upstream.
      
      A recent commit, 9803387c ("ext4: validate the
      debug_want_extra_isize mount option at parse time"), moved mount-time
      checks around.  One of those changes moved the inode size check before
      the blocksize variable was set to the blocksize of the file system.
      After 9803387c was set to the minimum allowable blocksize, which
      in practice on most systems would be 1024 bytes.  This cuased file
      systems with inode sizes larger than 1024 bytes to be rejected with a
      message:
      
      EXT4-fs (sdXX): unsupported inode size: 4096
      
      Fixes: 9803387c
      
       ("ext4: validate the debug_want_extra_isize mount option at parse time")
      Link: https://lore.kernel.org/r/20200206225252.GA3673@mit.edu
      Reported-by: default avatarHerbert Poetzl <herbert@13thfloor.at>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Cc: stable@kernel.org
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5ad597ec
    • Andreas Dilger's avatar
      ext4: don't assume that mmp_nodename/bdevname have NUL · ca0d1707
      Andreas Dilger authored
      commit 14c9ca05
      
       upstream.
      
      Don't assume that the mmp_nodename and mmp_bdevname strings are NUL
      terminated, since they are filled in by snprintf(), which is not
      guaranteed to do so.
      
      Link: https://lore.kernel.org/r/1580076215-1048-1-git-send-email-adilger@dilger.ca
      Signed-off-by: default avatarAndreas Dilger <adilger@dilger.ca>
      Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Cc: stable@kernel.org
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ca0d1707
    • Alexander Tsoy's avatar
      ALSA: usb-audio: Add clock validity quirk for Denon MC7000/MCX8000 · 8e57f6a6
      Alexander Tsoy authored
      commit 9f35a312
      
       upstream.
      
      It should be safe to ignore clock validity check result if the following
      conditions are met:
       - only one single sample rate is supported;
       - the terminal is directly connected to the clock source;
       - the clock type is internal.
      
      This is to deal with some Denon DJ controllers that always reports that
      clock is invalid.
      
      Tested-by: default avatarTobias Oszlanyi <toszlanyi@yahoo.de>
      Signed-off-by: default avatarAlexander Tsoy <alexander@tsoy.me>
      Cc: <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20200212235450.697348-1-alexander@tsoy.me
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8e57f6a6
    • Saurav Girepunje's avatar
      ALSA: usb-audio: sound: usb: usb true/false for bool return type · 59ed2b7a
      Saurav Girepunje authored
      commit 1d4961d9
      
       upstream.
      
      Use true/false for bool type return in uac_clock_source_is_valid().
      
      Signed-off-by: default avatarSaurav Girepunje <saurav.girepunje@gmail.com>
      Link: https://lore.kernel.org/r/20191029175200.GA7320@saurav
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      59ed2b7a
    • Suzuki K Poulose's avatar
      arm64: nofpsmid: Handle TIF_FOREIGN_FPSTATE flag cleanly · e074c64a
      Suzuki K Poulose authored
      commit 52f73c38
      
       upstream
      
      We detect the absence of FP/SIMD after an incapable CPU is brought up,
      and by then we have kernel threads running already with TIF_FOREIGN_FPSTATE set
      which could be set for early userspace applications (e.g, modprobe triggered
      from initramfs) and init. This could cause the applications to loop forever in
      do_nofity_resume() as we never clear the TIF flag, once we now know that
      we don't support FP.
      
      Fix this by making sure that we clear the TIF_FOREIGN_FPSTATE flag
      for tasks which may have them set, as we would have done in the normal
      case, but avoiding touching the hardware state (since we don't support any).
      
      Also to make sure we handle the cases seemlessly we categorise the
      helper functions to two :
       1) Helpers for common core code, which calls into take appropriate
          actions without knowing the current FPSIMD state of the CPU/task.
      
          e.g fpsimd_restore_current_state(), fpsimd_flush_task_state(),
              fpsimd_save_and_flush_cpu_state().
      
          We bail out early for these functions, taking any appropriate actions
          (e.g, clearing the TIF flag) where necessary to hide the handling
          from core code.
      
       2) Helpers used when the presence of FP/SIMD is apparent.
          i.e, save/restore the FP/SIMD register state, modify the CPU/task
          FP/SIMD state.
          e.g,
      
          fpsimd_save(), task_fpsimd_load() - save/restore task FP/SIMD registers
      
          fpsimd_bind_task_to_cpu()  \
                                      - Update the "state" metadata for CPU/task.
          fpsimd_bind_state_to_cpu() /
      
          fpsimd_update_current_state() - Update the fp/simd state for the current
                                          task from memory.
      
          These must not be called in the absence of FP/SIMD. Put in a WARNING
          to make sure they are not invoked in the absence of FP/SIMD.
      
      KVM also uses the TIF_FOREIGN_FPSTATE flag to manage the FP/SIMD state
      on the CPU. However, without FP/SIMD support we trap all accesses and
      inject undefined instruction. Thus we should never "load" guest state.
      Add a sanity check to make sure this is valid.
      
      Cc: stable@vger.kernel.org # v4.19
      Cc: Will Deacon <will@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Reviewed-by: default avatarArd Biesheuvel <ardb@kernel.org>
      Reviewed-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Acked-by: default avatarMarc Zyngier <maz@kernel.org>
      Signed-off-by: default avatarSuzuki K Poulose <suzuki.poulose@arm.com>
      Signed-off-by: default avatarWill Deacon <will@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      e074c64a
    • Suzuki K Poulose's avatar
      arm64: cpufeature: Set the FP/SIMD compat HWCAP bits properly · b7230b62
      Suzuki K Poulose authored
      commit 7559950a
      
       upstream
      
      We set the compat_elf_hwcap bits unconditionally on arm64 to
      include the VFP and NEON support. However, the FP/SIMD unit
      is optional on Arm v8 and thus could be missing. We already
      handle this properly in the kernel, but still advertise to
      the COMPAT applications that the VFP is available. Fix this
      to make sure we only advertise when we really have them.
      
      Cc: stable@vger.kernel.org # v4.19
      Cc: Will Deacon <will@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Reviewed-by: default avatarArd Biesheuvel <ardb@kernel.org>
      Reviewed-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Signed-off-by: default avatarSuzuki K Poulose <suzuki.poulose@arm.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      b7230b62
    • Arvind Sankar's avatar
      ALSA: usb-audio: Apply sample rate quirk for Audioengine D1 · 9c8cd851
      Arvind Sankar authored
      commit 93f9d1a4
      
       upstream.
      
      The Audioengine D1 (0x2912:0x30c8) does support reading the sample rate,
      but it returns the rate in byte-reversed order.
      
      When setting sampling rate, the driver produces these warning messages:
      [168840.944226] usb 3-2.2: current rate 4500480 is different from the runtime rate 44100
      [168854.930414] usb 3-2.2: current rate 8436480 is different from the runtime rate 48000
      [168905.185825] usb 3-2.1.2: current rate 30465 is different from the runtime rate 96000
      
      As can be seen from the hexadecimal conversion, the current rate read
      back is byte-reversed from the rate that was set.
      
      44100 == 0x00ac44, 4500480 == 0x44ac00
      48000 == 0x00bb80, 8436480 == 0x80bb00
      96000 == 0x017700,   30465 == 0x007701
      
      Rather than implementing a new quirk to reverse the order, just skip
      checking the rate to avoid spamming the log.
      
      Signed-off-by: default avatarArvind Sankar <nivedita@alum.mit.edu>
      Cc: <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20200211162235.1639889-1-nivedita@alum.mit.edu
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9c8cd851
    • Takashi Iwai's avatar
      ALSA: hda/realtek - Fix silent output on MSI-GL73 · 0bef6d5c
      Takashi Iwai authored
      commit 7dafba37
      
       upstream.
      
      MSI-GL73 laptop with ALC1220 codec requires a similar workaround for
      Clevo laptops to enforce the DAC/mixer connection path.  Set up a
      quirk entry for that.
      
      BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=204159
      Cc: <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20200212081047.27727-1-tiwai@suse.de
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0bef6d5c
    • Takashi Iwai's avatar
      ALSA: usb-audio: Fix UAC2/3 effect unit parsing · f09e9a45
      Takashi Iwai authored
      commit d75a170f upstream.
      
      We've got a regression report about M-Audio Fast Track C400 device,
      and the git bisection resulted in the commit e0ccdef9 ("ALSA:
      usb-audio: Clean up check_input_term()").  This commit was about the
      rewrite of the input terminal parser, and it's not too obvious from
      the change what really broke.  The answer is: it's the interpretation
      of UAC2/3 effect units.
      
      In the original code, UAC2 effect unit is as if through UAC1
      processing unit because both UAC1 PU and UAC2/3 EU share the same
      number (0x07).  The old code went through a complex switch-case
      fallthrough, finally bailing out in the middle:
      
        if (protocol == UAC_VERSION_2 &&
            hdr[2] == UAC2_EFFECT_UNIT) {
               /* UAC2/UAC1 unit IDs overlap here in an
                * uncompatible way. Ignore this unit for now.
                */
               return 0;
         }
      
      ... and this special handling was missing in the new code; the new
      code treats UAC2/3 effect unit as if it were equivalent with the
      processing unit.
      
      Actually, the old code was too confusing.  The effect unit has an
      incompatible unit description with the processing unit, so we
      shouldn't have dealt with EU in the same way.
      
      This patch addresses the regression by changing the effect unit
      handling to the own parser function.  The own parser function makes
      the clear distinct with PU, so it improves the readability, too.
      
      The EU parser just sets the type and the id like the old kernels.
      Once when the proper effect unit support is added, we can revisit this
      parser function, but for now, let's keep this simple setup as is.
      
      Fixes: e0ccdef9
      
       ("ALSA: usb-audio: Clean up check_input_term()")
      Cc: <stable@vger.kernel.org>
      BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=206147
      Link: https://lore.kernel.org/r/20200211160521.31990-1-tiwai@suse.de
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f09e9a45
    • Benjamin Tissoires's avatar
      Input: synaptics - remove the LEN0049 dmi id from topbuttonpad list · a2827b00
      Benjamin Tissoires authored
      commit 5179a9df
      
       upstream.
      
      The Yoga 11e is using LEN0049, but it doesn't have a trackstick.
      
      Thus, there is no need to create a software top buttons row.
      
      However, it seems that the device works under SMBus, so keep it as part
      of the smbus_pnp_ids.
      
      Signed-off-by: default avatarBenjamin Tissoires <benjamin.tissoires@redhat.com>
      Cc: stable@vger.kernel.org
      Link: https://lore.kernel.org/r/20200115013023.9710-1-benjamin.tissoires@redhat.com
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a2827b00
    • Gaurav Agrawal's avatar
      Input: synaptics - enable SMBus on ThinkPad L470 · be21aa41
      Gaurav Agrawal authored
      commit b8a3d819
      
       upstream.
      
      Add touchpad LEN2044 to the list, as it is capable of working with
      psmouse.synaptics_intertouch=1
      
      Signed-off-by: default avatarGaurav Agrawal <agrawalgaurav@gnome.org>
      Cc: stable@vger.kernel.org
      Link: https://lore.kernel.org/r/CADdtggVzVJq5gGNmFhKSz2MBwjTpdN5YVOdr4D3Hkkv=KZRc9g@mail.gmail.com
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      be21aa41
    • Lyude Paul's avatar
      Input: synaptics - switch T470s to RMI4 by default · b436680b
      Lyude Paul authored
      commit bf502391
      
       upstream.
      
      This supports RMI4 and everything seems to work, including the touchpad
      buttons. So, let's enable this by default.
      
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Cc: stable@vger.kernel.org
      Link: https://lore.kernel.org/r/20200204194322.112638-1-lyude@redhat.com
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b436680b
  2. Feb 15, 2020