Soundwire: register intel sdw master driver with driver_register()#1607
Conversation
drivers/soundwire/intel_init.c
Outdated
| void sdw_intel_exit(struct sdw_intel_ctx *ctx) | ||
| { | ||
| sdw_intel_cleanup(ctx); | ||
| driver_register(&intel_sdw_driver.driver); |
There was a problem hiding this comment.
Thanks. Fix it now.
drivers/soundwire/master.c
Outdated
| } | ||
|
|
||
| md->dev.driver = &driver->driver; | ||
| ret = device_bind_driver(&md->dev); |
There was a problem hiding this comment.
don't we need a matching device_release_driver() ?
There was a problem hiding this comment.
@bardliao typically device_add should take care of binding the driver isnt it? I may be wrong. But is the problem simply that we should set md->dev.driver before we call device_resgiter() in sdw_md_add?
There was a problem hiding this comment.
@bardliao typically device_add should take care of binding the driver isnt it? I may be wrong. But is the problem simply that we should set md->dev.driver before we call device_resgiter() in sdw_md_add?
@ranj063 You are right. Actually, I tried it before. But we didn't call driver_register() at that time so it result in system crash. Now moving md->dev.driver before device_resgiter() work fine.
f22b344 to
fa47d1f
Compare
569f0d7 to
d0dcd74
Compare
@plbossart What I want to fix is to make sure intel_suspend() will be triggered for all links. I will update my commit message then. |
|
@bardliao see trace attached dmesg_arecord1_rtcwake_arecord4.log and yes I have the standard rt700 on all links but I haven't updated the BIOS since the original release with the SOF key |
|
@bardliao I am using only the clock_quirks 0x8, no other pm_runtime filter or link mask btw |
d0dcd74 to
0864655
Compare
dev->power.no_pm_callbacks flag is used to check if there is pm ops for the device. Pm callback function will not be invoked if there is no pm ops. Currently the flag is true for sdw-master devices which is incorrect since we do have pm ops in intel_sdw_driver. As a result, intel_suspend() which is the suspend callback function of intel-sdw driver may not be invoked in system suspend. With driver_register() and setting md->dev.driver before device_register(), dev->power.no_pm_callbacks flag will be set to the correct value (false) by device_pm_check_callbacks() which will be triggered by device_register(). Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
0864655 to
c641b5a
Compare
|
@plbossart So the reasons you don't see #1595 is
|
ok, but can you file a bug that has all the information? it's impossible to guess or reproduce otherwise. thanks! |
dev->power.no_pm_callbacks flag is used to check if there is pm ops
for the device. Pm callback function will not be invoked if there is
no pm ops. Currently the flag is true for sdw-master devices which
is incorrect since we do have pm ops in intel_sdw_driver. As a result,
intel_suspend() which is the suspend callback function of intel-sdw
driver may not be invoked in system suspend.
With driver_register() and setting md->dev.driver before
device_register(), dev->power.no_pm_callbacks flag will be set to the
correct value (false) by device_pm_check_callbacks() which will be
triggered by device_register().
Signed-off-by: Bard Liao yung-chuan.liao@linux.intel.com
Fixes #1595 #1614