Skip to content

[BUG] Soundwire Regression introduced for WARN ON check for codec conf #5620

Closed

Description

@vijendarmukunda

Hello,

We are testing on our CRB connecting TI codecs(4 AMPS) on SW0 instance & RT712-VB codec is connected on SW1 instance.
Using recent kernel version V6.18-rc7 version, we hit with WARN_ON codec check for codec conf as mentioned below.
'WARN_ON(codec_conf != card->codec_conf + card->num_configs);'

Further checking dmesg logs, we got below findings.

It appears that the RT712 SDCA advertises multiple functions: UAJ type 0, SmartMic type 2, and HID type 10. The legacy AMD SoundWire machine driver explicitly skips DAI type 1 for SDCA devices.

According to the dmesg logs, we observe that two RT712 endpoints are retained while one is skipped and four TAS2783 smart-amps being present. This leads to a total of six actual codec_conf entries, whereas we initially expected seven based on the endpoints. Consequently, the post-build pointer check triggers the WARN_ON for codec_conf mismatch.

As per our analysis, below patch is missing the case where endpoint doesn't exist in the DisCo table

https://lore.kernel.org/all/20251127163426.2500633-4-ckeepax@opensource.cirrus.com/

Fail_logs_RTK_1112.txt

As per @shumingfan , this issue is reproducible on Intel platforms too.

@charleskeepax : Could you please help to comment?

Activity

  1. bardliao commented on Dec 11, 2025

    @bardliao
    Collaborator

    @charleskeepax It seems we should check is_sdca_endpoint_present() in asoc_sdw_count_sdw_endpoints(), too.

  2. bardliao commented on Dec 11, 2025

    @bardliao
    Collaborator

    Or simply subtract the endpoint that is not present. Like:

    diff --git a/sound/soc/sdw_utils/soc_sdw_utils.c b/sound/soc/sdw_utils/soc_sdw_utils.c
    index 6c656b2f7f3a..f169d95895ea 100644
    --- a/sound/soc/sdw_utils/soc_sdw_utils.c
    +++ b/sound/soc/sdw_utils/soc_sdw_utils.c
    @@ -1534,8 +1534,10 @@ int asoc_sdw_parse_sdw_endpoints(struct snd_soc_card *card,
                                             * endpoint check is not necessary
                                             */
                                            if (dai_info->quirk &&
    -                                           !(dai_info->quirk_exclude ^ !!(dai_info->quirk & ctx->mc_quirk)))
    +                                           !(dai_info->quirk_exclude ^ !!(dai_info->quirk & ctx->mc_quirk))) {
    +                                               (*num_devs)--;
                                                    continue;
    +                                       }
                                    } else {
                                            /* Check SDCA codec endpoint if there is no matching quirk */
                                            ret = is_sdca_endpoint_present(dev, codec_info, adr_link, i, j);
    @@ -1543,8 +1545,10 @@ int asoc_sdw_parse_sdw_endpoints(struct snd_soc_card *card,
                                                    return ret;
    
                                            /* The endpoint is not present, skip */
    -                                       if (!ret)
    +                                       if (!ret) {
    +                                               (*num_devs)--;
                                                    continue;
    +                                       }
                                    }
    
                                    dev_dbg(dev,
  3. vijendarmukunda commented on Dec 11, 2025

    @vijendarmukunda
    Author

    @bardliao : Issue got fixed after applying above mentioned changes.

  4. vijendarmukunda commented on Dec 12, 2025

    @vijendarmukunda
    Author

    @bardliao: Could you please push the changes for upstream review?

  5. bardliao commented on Dec 12, 2025

    @bardliao
    Collaborator

    @bardliao: Could you please push the changes for upstream review?

    #5622 I prefer reviewing here first. :) I need @charleskeepax's feedback before submitting it upstream.

  6. vijendarmukunda commented on Dec 12, 2025

    @vijendarmukunda
    Author

    @bardliao: Could you please push the changes for upstream review?

    #5622 I prefer reviewing here first. :) I need @charleskeepax's feedback before submitting it upstream.

    I do agree.

  7. charleskeepax commented on Dec 12, 2025

    @charleskeepax

    Apologies for the delay having a look now.

  8. 15 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions