1. Feb 12, 2024
    • Cristian Ciocaltea's avatar
      ASoC: SOF: amd: Fix locking in ACP IRQ handler · c4b603c6
      Cristian Ciocaltea authored
      A recent change in acp_irq_thread() was meant to address a potential race
      condition while trying to acquire the hardware semaphore responsible for
      the synchronization between firmware and host IPC interrupts.
      
      This resulted in an improper use of the IPC spinlock, causing normal
      kernel memory allocations (which may sleep) inside atomic contexts:
      
      1707255557.133976 kernel: BUG: sleeping function called from invalid context at include/linux/sched/mm.h:315
      
      ...
      
      1707255557.134757 kernel:  sof_ipc3_rx_msg+0x70/0x130 [snd_sof]
      1707255557.134793 kernel:  acp_sof_ipc_irq_thread+0x1e0/0x550 [snd_sof_amd_acp]
      1707255557.134855 kernel:  acp_irq_thread+0xa3/0x130 [snd_sof_amd_acp]
      1707255557.134904 kernel:  ? irq_thread+0xb5/0x1e0
      1707255557.134947 kernel:  ? __pfx_irq_thread_fn+0x10/0x10
      1707255557.134985 kernel:  irq_thread_fn+0x23/0x60
      
      Moreover, there are attempts to lock a mutex from the same atomic
      context:
      
      1707255557.136357 kernel: =============================
      1707255557.136393 kernel: [ BUG: Invalid wait context ]
      1707255557.136413 kernel: 6.8.0-rc3-next-20240206-audio-next #9 Tainted: G        W
      1707255557.136432 kernel: -----------------------------
      1707255557.136451 kernel: irq/66-AudioDSP/502 is trying to lock:
      1707255557.136470 kernel: ffff965152f26af8 (&sb->s_type->i_mutex_key#2){+.+.}-{3:3}, at: start_creating.part.0+0x5f/0x180
      
      ...
      
      1707255557.137429 kernel:  start_creating.part.0+0x5f/0x180
      1707255557.137457 kernel:  __debugfs_create_file+0x61/0x210
      1707255557.137475 kernel:  snd_sof_debugfs_io_item+0x75/0xc0 [snd_sof]
      1707255557.137494 kernel:  sof_ipc3_do_rx_work+0x7cf/0x9f0 [snd_sof]
      1707255557.137513 kernel:  sof_ipc3_rx_msg+0xb3/0x130 [snd_sof]
      1707255557.137532 kernel:  acp_sof_ipc_irq_thread+0x1e0/0x550 [snd_sof_amd_acp]
      1707255557.137551 kernel:  acp_irq_thread+0xa3/0x130 [snd_sof_amd_acp]
      
      Fix the issues by reducing the lock scope in acp_irq_thread(), so that
      it guards only the hardware semaphore acquiring attempt.  Additionally,
      restore the initial locking in acp_sof_ipc_irq_thread() to synchronize
      the handling of immediate replies from DSP core.
      
      Fixes: 802134c8
      
       ("ASoC: SOF: amd: Refactor spinlock_irq(&sdev->ipc_lock) sequence in irq_handler")
      Signed-off-by: default avatarCristian Ciocaltea <cristian.ciocaltea@collabora.com>
      Link: https://lore.kernel.org/r/20240208234315.2182048-1-cristian.ciocaltea@collabora.com
      
      
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      c4b603c6
    • Alexey Khoroshilov's avatar
      ASoC: rt5645: Fix deadlock in rt5645_jack_detect_work() · 6ef5d5b9
      Alexey Khoroshilov authored
      There is a path in rt5645_jack_detect_work(), where rt5645->jd_mutex
      is left locked forever. That may lead to deadlock
      when rt5645_jack_detect_work() is called for the second time.
      
      Found by Linux Verification Center (linuxtesting.org) with SVACE.
      
      Fixes: cdba4301
      
       ("ASoC: rt5650: add mutex to avoid the jack detection failure")
      Signed-off-by: default avatarAlexey Khoroshilov <khoroshilov@ispras.ru>
      Link: https://lore.kernel.org/r/1707645514-21196-1-git-send-email-khoroshilov@ispras.ru
      
      
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      6ef5d5b9
  2. Feb 09, 2024
  3. Feb 08, 2024
  4. Feb 07, 2024
  5. Feb 06, 2024
  6. Feb 05, 2024
  7. Feb 02, 2024
    • Mark Brown's avatar
      ALSA: Various fixes for Cirrus Logic CS35L56 support · e81fdba0
      Mark Brown authored
      Merge series from Richard Fitzgerald <rf@opensource.cirrus.com>:
      
      These patches fixe various things that were undocumented, unknown or
      uncertain when the original driver code was written. And also a few
      things that were just bugs.
      e81fdba0
  8. Feb 01, 2024
  9. Jan 30, 2024
  10. Jan 29, 2024
    • Linus Torvalds's avatar
      Linux 6.8-rc2 · 41bccc98
      Linus Torvalds authored
      41bccc98
    • Linus Torvalds's avatar
      Merge tag 'cxl-fixes-6.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl · 3eb5ca85
      Linus Torvalds authored
      Pull cxl fixes from Dan Williams:
       "A build regression fix, a device compatibility fix, and an original
        bug preventing creation of large (16 device) interleave sets:
      
         - Fix unit test build regression fallout from global
           "missing-prototypes" change
      
         - Fix compatibility with devices that do not support interrupts
      
         - Fix overflow when calculating the capacity of large interleave sets"
      
      * tag 'cxl-fixes-6.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/cxl/cxl:
        cxl/region:Fix overflow issue in alloc_hpa()
        cxl/pci: Skip irq features if MSI/MSI-X are not supported
        tools/testing/nvdimm: Disable "missing prototypes / declarations" warnings
        tools/testing/cxl: Disable "missing prototypes / declarations" warnings
      3eb5ca85