1. 11 Mar, 2024 8 commits
  2. 08 Mar, 2024 4 commits
  3. 07 Mar, 2024 2 commits
  4. 06 Mar, 2024 3 commits
  5. 05 Mar, 2024 2 commits
  6. 04 Mar, 2024 13 commits
  7. 01 Mar, 2024 3 commits
    • Nathan Chancellor's avatar
      ALSA: hwdep: Move put_user() call out of scoped_guard() in snd_hwdep_control_ioctl() · 72165c86
      Nathan Chancellor authored
      Clang prior to 17.0.0 has a bug in its asm goto jump scope analysis to
      determine that no variables with the cleanup attribute are skipped by an
      indirect jump. Instead of only checking the scope of each label that is
      a possible target of each asm goto statement, it checks the scope of
      every label, which can cause an error when a variable with the cleanup
      attribute is used between two asm goto statements with different scopes,
      even if they have completely different label targets:
      
        sound/core/hwdep.c:273:8: error: cannot jump from this asm goto statement to one of its possible targets
                                if (get_user(device, (int __user *)arg))
                                    ^
        arch/powerpc/include/asm/uaccess.h:295:5: note: expanded from macro 'get_user'
                          __get_user(x, _gu_addr) :                             \
                          ^
        arch/powerpc/include/asm/uaccess.h:283:2: note: expanded from macro '__get_user'
                __get_user_size_allowed(__gu_val, __gu_addr, __gu_size, __gu_err);      \
                ^
        arch/powerpc/include/asm/uaccess.h:199:3: note: expanded from macro '__get_user_size_allowed'
                        __get_user_size_goto(x, ptr, size, __gus_failed);       \
                        ^
        arch/powerpc/include/asm/uaccess.h:187:10: note: expanded from macro '__get_user_size_goto'
                case 1: __get_user_asm_goto(x, (u8 __user *)ptr, label, "lbz"); break;  \
                        ^
        arch/powerpc/include/asm/uaccess.h:158:2: note: expanded from macro '__get_user_asm_goto'
                asm_volatile_goto(                                      \
                ^
        include/linux/compiler_types.h:366:33: note: expanded from macro 'asm_volatile_goto'
        #define asm_volatile_goto(x...) asm goto(x)
                                        ^
        sound/core/hwdep.c:291:9: note: possible target of asm goto statement
                                        if (put_user(device, (int __user *)arg))
                                            ^
        arch/powerpc/include/asm/uaccess.h:66:5: note: expanded from macro 'put_user'
                          __put_user(x, _pu_addr) : -EFAULT;                    \
                          ^
        arch/powerpc/include/asm/uaccess.h:52:9: note: expanded from macro '__put_user'
                                                                        \
                                                                        ^
        sound/core/hwdep.c:276:4: note: jump bypasses initialization of variable with __attribute__((cleanup))
                                scoped_guard(mutex, &register_mutex) {
                                ^
        include/linux/cleanup.h:169:20: note: expanded from macro 'scoped_guard'
                for (CLASS(_name, scope)(args),                                 \
      
      To avoid this issue, move the put_user() call out of the scoped_guard()
      scope, which allows the asm goto scope analysis to see that the variable
      with the cleanup attribute will never be skipped by the asm goto
      statements.
      
      There should be no functional change because prior to the refactoring,
      put_user() was not called under register_mutex, so this call does not
      even need to be in the scoped_guard() in the first place.
      
      Fixes: e6684d08 ("ALSA: hwdep: Use guard() for locking")
      Closes: https://github.com/ClangBuiltLinux/linux/issues/2003Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
      Link: https://lore.kernel.org/r/20240301-fix-snd-hwdep-guard-v1-1-6aab033f3f83@kernel.orgSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      72165c86
    • songxiebing's avatar
      ALSA: hda: optimize the probe codec process · 642b02b4
      songxiebing authored
      In azx_probe_codecs function, when bus->codec_mask is becomes to 0(no codecs),
      execute azx_init_chip, bus->codec_mask will be initialized to a value again,
      this causes snd_hda_codec_new function to run, the process is as follows:
      -->snd_hda_codec_new
      -->snd_hda_codec_device_init
      -->snd_hdac_device_init---snd_hdac_read_parm(...AC_PAR_VENDOR_ID) 2s
      		       ---snd_hdac_read_parm(...AC_PAR_VENDOR_ID) 2s
      		       ---snd_hdac_read_parm(...AC_PAR_SUBSYSTEM_ID) 2s
      		       ---snd_hdac_read_parm(...AC_PAR_REV_ID) 2s
      		       ---snd_hdac_read_parm(...AC_PAR_NODE_COUNT) 2s
      when no codecs, read communication is error, each command will be polled for
      2 second, a total of 10s, it is easy to some problem.
      like this:
        2 [   14.833404][ 6] [  T164] hda 0006:00: Codec #0 probe error; disabling it...
        3 [   14.844178][ 6] [  T164] hda 0006:00: codec_mask = 0x1
        4 [   14.880532][ 6] [  T164] hda 0006:00: too slow response, last cmd=0x0f0000
        5 [   15.891988][ 6] [  T164] hda 0006:00: too slow response, last cmd=0x0f0000
        6 [   16.978090][ 6] [  T164] hda 0006:00: too slow response, last cmd=0x0f0001
        7 [   18.140895][ 6] [  T164] hda 0006:00: too slow response, last cmd=0x0f0002
        8 [   19.135516][ 6] [  T164] hda 0006:00: too slow response, last cmd=0x0f0004
       10 [   19.900086][ 6] [  T164] hda 0006:00: no codecs initialized
       11 [   45.573398][ 2] [    C2] watchdog: BUG: soft lockup - CPU#2 stuck for 22s! [kworker/2:0:25]
      
      Here, when bus->codec_mask is 0, use a direct break to avoid execute snd_hda_codec_new function.
      Signed-off-by: default avatarsongxiebing <songxiebing@kylinos.cn>
      Link: https://lore.kernel.org/r/20240301011841.7247-1-soxiebing@163.comSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      642b02b4
    • Kailang Yang's avatar
      ALSA: hda/realtek - Fix headset Mic no show at resume back for Lenovo ALC897 platform · d397b6e5
      Kailang Yang authored
      Headset Mic will no show at resume back.
      This patch will fix this issue.
      
      Fixes: d7f32791 ("ALSA: hda/realtek - Add headset Mic support for Lenovo ALC897 platform")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarKailang Yang <kailang@realtek.com>
      Link: https://lore.kernel.org/r/4713d48a372e47f98bba0c6120fd8254@realtek.comSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      d397b6e5
  8. 29 Feb, 2024 3 commits
  9. 28 Feb, 2024 2 commits