1. 29 Jun, 2023 3 commits
    • Sameer Pujar's avatar
      ASoC: rt5640: Fix sleep in atomic context · 70a6404f
      Sameer Pujar authored
      Following prints are observed while testing audio on Jetson AGX Orin which
      has onboard RT5640 audio codec:
      
        BUG: sleeping function called from invalid context at kernel/workqueue.c:3027
        in_atomic(): 1, irqs_disabled(): 128, non_block: 0, pid: 0, name: swapper/0
        preempt_count: 10001, expected: 0
        RCU nest depth: 0, expected: 0
        ------------[ cut here ]------------
        WARNING: CPU: 0 PID: 0 at kernel/irq/handle.c:159 __handle_irq_event_percpu+0x1e0/0x270
        ---[ end trace ad1c64905aac14a6 ]-
      
      The IRQ handler rt5640_irq() runs in interrupt context and can sleep
      during cancel_delayed_work_sync().
      
      Fix this by running IRQ handler, rt5640_irq(), in thread context.
      Hence replace request_irq() calls with devm_request_threaded_irq().
      
      Fixes: 051dade3 ("ASoC: rt5640: Fix the wrong state of JD1 and JD2")
      Cc: stable@vger.kernel.org
      Cc: Oder Chiou <oder_chiou@realtek.com>
      Signed-off-by: default avatarSameer Pujar <spujar@nvidia.com>
      Link: https://lore.kernel.org/r/1688015537-31682-4-git-send-email-spujar@nvidia.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      70a6404f
    • Sheetal's avatar
      ASoC: tegra: Fix ADX byte map · 6dfe70be
      Sheetal authored
      Byte mask for channel-1 of stream-1 is not getting enabled and this
      causes failures during ADX use cases. This happens because the byte
      map value 0 matches the byte map array and put() callback returns
      without enabling the corresponding bits in the byte mask.
      
      ADX supports 4 output streams and each stream can have a maximum of
      16 channels. Each byte in the input frame is uniquely mapped to a
      byte in one of these 4 outputs. This mapping is done with the help of
      byte map array via user space control setting. The byte map array
      size in the driver is 16 and each array element is of size 4 bytes.
      This corresponds to 64 byte map values.
      
      Each byte in the byte map array can have any value between 0 to 255
      to enable the corresponding bits in the byte mask. The value 256 is
      used as a way to disable the byte map. However the byte map array
      element cannot store this value. The put() callback disables the byte
      mask for 256 value and byte map value is reset to 0 for this case.
      This causes problems during subsequent runs since put() callback,
      for value of 0, just returns without enabling the byte mask. In short,
      the problem is coming because 0 and 256 control values are stored as
      0 in the byte map array.
      
      Right now fix the put() callback by actually looking at the byte mask
      array state to identify if any change is needed and update the fields
      accordingly. The get() callback needs an update as well to return the
      correct control value that user has set before. Note that when user
      set 256, the value is stored as 0 and byte mask is disabled. So byte
      mask state is used to either return 256 or the value from byte map
      array.
      
      Given above, this looks bit complicated and all this happens because
      the byte map array is tightly packed and cannot actually store the 256
      value. Right now the priority is to fix the existing failure and a TODO
      item is put to improve this logic.
      
      Fixes: 3c97881b ("ASoC: tegra: Fix kcontrol put callback in ADX")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarSheetal <sheetal@nvidia.com>
      Reviewed-by: default avatarMohan Kumar D <mkumard@nvidia.com>
      Reviewed-by: default avatarSameer Pujar <spujar@nvidia.com>
      Link: https://lore.kernel.org/r/1688015537-31682-3-git-send-email-spujar@nvidia.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      6dfe70be
    • Sheetal's avatar
      ASoC: tegra: Fix AMX byte map · 49bd7b08
      Sheetal authored
      Byte mask for channel-1 of stream-1 is not getting enabled and this
      causes failures during AMX use cases. This happens because the byte
      map value 0 matches the byte map array and put() callback returns
      without enabling the corresponding bits in the byte mask.
      
      AMX supports 4 input streams and each stream can take a maximum of
      16 channels. Each byte in the output frame is uniquely mapped to a
      byte in one of these 4 inputs. This mapping is done with the help of
      byte map array via user space control setting. The byte map array
      size in the driver is 16 and each array element is of size 4 bytes.
      This corresponds to 64 byte map values.
      
      Each byte in the byte map array can have any value between 0 to 255
      to enable the corresponding bits in the byte mask. The value 256 is
      used as a way to disable the byte map. However the byte map array
      element cannot store this value. The put() callback disables the byte
      mask for 256 value and byte map value is reset to 0 for this case.
      This causes problems during subsequent runs since put() callback,
      for value of 0, just returns without enabling the byte mask. In short,
      the problem is coming because 0 and 256 control values are stored as
      0 in the byte map array.
      
      Right now fix the put() callback by actually looking at the byte mask
      array state to identify if any change is needed and update the fields
      accordingly. The get() callback needs an update as well to return the
      correct control value that user has set before. Note that when user
      sets 256, the value is stored as 0 and byte mask is disabled. So byte
      mask state is used to either return 256 or the value from byte map
      array.
      
      Given above, this looks bit complicated and all this happens because
      the byte map array is tightly packed and cannot actually store the 256
      value. Right now the priority is to fix the existing failure and a TODO
      item is put to improve this logic.
      
      Fixes: 8db78ace ("ASoC: tegra: Fix kcontrol put callback in AMX")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarSheetal <sheetal@nvidia.com>
      Reviewed-by: default avatarMohan Kumar D <mkumard@nvidia.com>
      Reviewed-by: default avatarSameer Pujar <spujar@nvidia.com>
      Link: https://lore.kernel.org/r/1688015537-31682-2-git-send-email-spujar@nvidia.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      49bd7b08
  2. 26 Jun, 2023 7 commits
  3. 23 Jun, 2023 3 commits
  4. 22 Jun, 2023 9 commits
  5. 21 Jun, 2023 6 commits
  6. 20 Jun, 2023 12 commits