1. 15 6月, 2020 2 次提交
  2. 12 6月, 2020 1 次提交
  3. 09 6月, 2020 1 次提交
  4. 08 6月, 2020 2 次提交
  5. 04 6月, 2020 1 次提交
    • T
      ALSA: usb-audio: Fix inconsistent card PM state after resume · 862b2509
      Takashi Iwai 提交于
      When a USB-audio interface gets runtime-suspended via auto-pm feature,
      the driver suspends all functionality and increment
      chip->num_suspended_intf.  Later on, when the system gets suspended to
      S3, the driver increments chip->num_suspended_intf again, skips the
      device changes, and sets the card power state to
      SNDRV_CTL_POWER_D3hot.  In return, when the system gets resumed from
      S3, the resume callback decrements chip->num_suspended_intf.  Since
      this refcount is still not zero (it's been runtime-suspended), the
      whole resume is skipped.  But there is a small pitfall here.
      
      The problem is that the driver doesn't restore the card power state
      after this resume call, leaving it as SNDRV_CTL_POWER_D3hot.  So,
      even after the system resume finishes, the card instance still appears
      as if it were system-suspended, and this confuses many ioctl accesses
      that are blocked unexpectedly.
      
      In details, we have two issues behind the scene: one is that the card
      power state is changed only when the refcount becomes zero, and
      another is that the prior auto-suspend check is kept in a boolean
      flag.  Although the latter problem is almost negligible since the
      auto-pm feature is imposed only on the primary interface, but this can
      be a potential problem on the devices with multiple interfaces.
      
      This patch addresses those issues by the following:
      
      - Replace chip->autosuspended boolean flag with chip->system_suspend
        counter
      
      - At the first system-suspend, chip->num_suspended_intf is recorded to
        chip->system_suspend
      
      - At system-resume, the card power state is restored when the
        chip->num_suspended_intf refcount reaches to chip->system_suspend,
        i.e. the state returns to the auto-suspended
      
      Also, the patch fixes yet another hidden problem by the code
      refactoring along with the fixes above: namely, when some resume
      procedure failed, the driver left chip->num_suspended_intf that was
      already decreased, and it might lead to the refcount unbalance.
      In the new code, the refcount decrement is done after the whole resume
      procedure, and the problem is avoided as well.
      
      Fixes: 0662292a ("ALSA: usb-audio: Handle normal and auto-suspend equally")
      Reported-and-tested-by: NMacpaul Lin <macpaul.lin@mediatek.com>
      Cc: <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20200603153709.6293-1-tiwai@suse.deSigned-off-by: NTakashi Iwai <tiwai@suse.de>
      862b2509
  6. 02 6月, 2020 1 次提交
  7. 30 5月, 2020 1 次提交
  8. 28 5月, 2020 1 次提交
  9. 27 5月, 2020 1 次提交
    • T
      ALSA: usb-audio: Quirks for Gigabyte TRX40 Aorus Master onboard audio · 7f5ad9c9
      Takashi Iwai 提交于
      Gigabyte TRX40 Aorus Master is equipped with two USB-audio devices,
      a Realtek ALC1220-VB codec (USB ID 0414:a001) and an ESS SABRE9218 DAC
      (USB ID 0414:a000).  The latter serves solely for the headphone output
      on the front panel while the former serves for the rest I/Os (mostly
      for the I/Os in the rear panel but also including the front mic).
      
      Both chips do work more or less with the unmodified USB-audio driver,
      but there are a few glitches.  The ALC1220-VB returns an error for an
      inquiry to some jacks, as already seen on other TRX40-based mobos.
      However this machine has a slightly incompatible configuration, hence
      the existing mapping cannot be used as is.
      
      Meanwhile the ESS chip seems working without any quirk.  But since
      both audio devices don't provide any specific names, both cards appear
      as "USB-Audio", and it's quite confusing for users.
      
      This patch is an attempt to overcome those issues:
      
      - The specific mapping table for ALC1220-VB is provided, reducing the
        non-working nodes and renaming the badly chosen controls.
        The connector map isn't needed here unlike other TRX40 quirks.
      
      - For both USB IDs (0414:a000 and 0414:a001), provide specific card
        name strings, so that user-space can identify more easily; and more
        importantly, UCM profile can be applied to each.
      Reported-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Cc: <stable@vger.kernel.org>
      Link: https://lore.kernel.org/r/20200526082810.29506-1-tiwai@suse.deSigned-off-by: NTakashi Iwai <tiwai@suse.de>
      7f5ad9c9
  10. 26 5月, 2020 1 次提交
  11. 16 5月, 2020 1 次提交
  12. 15 5月, 2020 1 次提交
  13. 08 5月, 2020 1 次提交
    • G
      ALSA: Replace zero-length array with flexible-array · 9ad06ebb
      Gustavo A. R. Silva 提交于
      The current codebase makes use of the zero-length array language
      extension to the C90 standard, but the preferred mechanism to declare
      variable-length types such as these ones is a flexible array member[1][2],
      introduced in C99:
      
      struct foo {
              int stuff;
              struct boo array[];
      };
      
      By making use of the mechanism above, we will get a compiler warning
      in case the flexible array does not occur last in the structure, which
      will help us prevent some kind of undefined behavior bugs from being
      inadvertently introduced[3] to the codebase from now on.
      
      Also, notice that, dynamic memory allocations won't be affected by
      this change:
      
      "Flexible array members have incomplete type, and so the sizeof operator
      may not be applied. As a quirk of the original implementation of
      zero-length arrays, sizeof evaluates to zero."[1]
      
      sizeof(flexible-array-member) triggers a warning because flexible array
      members have incomplete type[1]. There are some instances of code in
      which the sizeof operator is being incorrectly/erroneously applied to
      zero-length arrays and the result is zero. Such instances may be hiding
      some bugs. So, this work (flexible-array member conversions) will also
      help to get completely rid of those sorts of issues.
      
      This issue was found with the help of Coccinelle.
      
      [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
      [2] https://github.com/KSPP/linux/issues/21
      [3] commit 76497732 ("cxgb3/l2t: Fix undefined behaviour")
      Signed-off-by: NGustavo A. R. Silva <gustavoars@kernel.org>
      Link: https://lore.kernel.org/r/20200507192223.GA16335@embeddedorSigned-off-by: NTakashi Iwai <tiwai@suse.de>
      9ad06ebb
  14. 04 5月, 2020 1 次提交
  15. 03 5月, 2020 2 次提交
  16. 01 5月, 2020 1 次提交
  17. 30 4月, 2020 1 次提交
  18. 26 4月, 2020 1 次提交
  19. 24 4月, 2020 3 次提交
  20. 23 4月, 2020 1 次提交
  21. 22 4月, 2020 3 次提交
  22. 21 4月, 2020 2 次提交
  23. 20 4月, 2020 2 次提交
  24. 19 4月, 2020 1 次提交
  25. 15 4月, 2020 1 次提交
  26. 12 4月, 2020 4 次提交
  27. 08 4月, 2020 1 次提交
  28. 05 4月, 2020 1 次提交