Skip to content

Conversation

@bardliao
Copy link
Collaborator

@bardliao bardliao commented Oct 8, 2025

The bt_link_mask value is from NHLT. The BT dai link should be created if bt_link_mask is set. Besides, hda_machine_select() will look for the topology with BT BE.

return -ENOMEM;

int ret;

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: this seems like a superfluous change

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved int ret; to the beginning of the function and put all variables together. Personally, I prefer this style.

The bt_link_mask value is from NHLT. The BT dai link should be created
if bt_link_mask is set. Besides, hda_machine_select() will look for the
topology with BT BE.

Suggested-by: Mac Chiang <mac.chiang@intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
if (sof_sdw_quirk & SOF_SSP_BT_OFFLOAD_PRESENT)
port = (sof_sdw_quirk & SOF_BT_OFFLOAD_SSP_MASK) >> SOF_BT_OFFLOAD_SSP_SHIFT;
else
port = fls(mach->mach_params.bt_link_mask) - 1;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bardliao , If bt_link_mask is reset to 0 because of incorrect settings, it may result in an invalid port value.

    if (hweight_long(mach->mach_params.bt_link_mask) > 1) {
            dev_warn(sdev->dev, "invalid BT link mask %#x found, reset the mask\n",
                    mach->mach_params.bt_link_mask);
            mach->mach_params.bt_link_mask = 0;
    }

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how can it happen. create_bt_dailinks() is only called when sof_sdw_quirk & SOF_SSP_BT_OFFLOAD_PRESENT || mach_params->bt_link_mask. Shouldn't bt_link_mask always > 0 in the else case?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, in the else case. However, I see your point. The pre-condition has already excluded the 0 value. LGTM, just last question: the bt_link_mask method seems only available to modify the NHLT SSP assignment, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bt_link_mask is usually from the NHLT SSP assignment, but we can use the bt_link_mask module parameter to overwrite it.

@bardliao bardliao merged commit 75503d9 into thesofproject:topic/sof-dev Oct 30, 2025
8 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants