Skip to content

soundwire: properly assign ACPI_COMPANION - #2625

Closed
bardliao wants to merge 1 commit into
thesofproject:topic/sof-devfrom
bardliao:sdw-timed-out-test
Closed

bardliao wants to merge 1 commit into
thesofproject:topic/sof-devfrom
bardliao:sdw-timed-out-test

Conversation

@bardliao

@bardliao bardliao commented Dec 11, 2020 •

Copy link
Copy Markdown
Collaborator

We never used ACPI_SET_COMPANION which is used by others, e.g. I2C
adapters.

Suggested-by: Andy Shevchenko andriy.shevchenko@linux.intel.com
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com

Fixes: #2599

@bardliao

Copy link
Copy Markdown
Collaborator Author

SOFCI TEST

@bardliao
bardliao force-pushed the sdw-timed-out-test branch 3 times, most recently from 76a2a0c to ed5ab15 Compare December 14, 2020 13:27
@bardliao
bardliao requested a review from ryans-lee as a code owner December 14, 2020 13:27
@bardliao
bardliao force-pushed the sdw-timed-out-test branch 3 times, most recently from c2625f3 to 222eecc Compare December 15, 2020 01:55
Comment thread drivers/soundwire/slave.c Outdated
slave->dev.of_node = of_node_get(to_of_node(fwnode));
slave->dev.type = &sdw_slave_type;
slave->dev.groups = sdw_slave_status_attr_groups;
ACPI_COMPANION_SET(&slave->dev, to_acpi_device_node(fwnode));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is basically set_primary_fwnode(&slave->dev, fwnode);. No need to use macros.

We never used ACPI_SET_COMPANION which is used by others, e.g. I2C
adapters.

Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
@bardliao bardliao changed the title [TEST] Sdw timed out test soundwire: properly assign ACPI_COMPANION Dec 15, 2020

@plbossart plbossart left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we need to revisit the master.c change, it's not clear if it's needed and it wouldn't work for Qualcomm, and the commit message for the slave.c is too vague.


dev_set_name(&md->dev, "sdw-master-%d", bus->id);
/* make sure ACPI companion is set based on parent */
ACPI_COMPANION_SET(&md->dev, ACPI_COMPANION(parent));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't know if this is really necessary?
Do we hit any issues without this?

Also this wouldn't work for Qualcomm (not using ACPI), I think we have to use set_primary_fwnode() directly.

Comment thread drivers/soundwire/slave.c
slave->dev.groups = sdw_slave_status_attr_groups;
/* To make sure fwnode is a primary fwnode */
fwnode->secondary = NULL;
set_primary_fwnode(&slave->dev, fwnode);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The commit message needs to be updated, e.g.

Properties may be added to a codec as a secondary fwnode. When the slave device is removed, the fwnode remains tagged as secondary, which causes a side effect if the slave device is re-added in module load/unload tests. Forcing the fwnode as primary is required, otherwise the dev->fwnode will be overridden with the properties.

@bardliao

Copy link
Copy Markdown
Collaborator Author

let's discuses it on #2635

@bardliao bardliao closed this Dec 16, 2020
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.

[TGL][SDW][RT711] Initialization not complete, timed out in suspend-resume test

3 participants