ASoC: SOF: pm: check if core is powered up before performing resume s…#473
Closed
ranj063 wants to merge 1 commit intothesofproject:topic/sof-devfrom
Closed
ASoC: SOF: pm: check if core is powered up before performing resume s…#473ranj063 wants to merge 1 commit intothesofproject:topic/sof-devfrom
ranj063 wants to merge 1 commit intothesofproject:topic/sof-devfrom
Conversation
…equence There are some corner cases that the pm suspend callback could fail and the DSP is not powered off. If this happens, we should skip performing the actions in the resume callback to avoid any DSP panic. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
plbossart
requested changes
Dec 19, 2018
Member
plbossart
left a comment
There was a problem hiding this comment.
doesn't build and not sure if this is the right place for such hacks.
| * DSP panic. So check if core 0 is powered off to make | ||
| * sure before proceeding further. | ||
| */ | ||
| if (snd_sof_dsp_core_is_enabled(sdev, BIT(0)) |
Member
There was a problem hiding this comment.
This is starting to look like a hardware-dependent work-around in the framework. Can it be moved to the hardware or abstracted away?
Collaborator
Author
There was a problem hiding this comment.
@plbossart sure. let me try to move it around. But I also feel like we are trying to hide the real issue with this hack. I am having second thoughts about it.
Collaborator
Author
|
@plbossart i'm closing this one as it not an elegant solution and this is just going allow us to sweep the dust under the carpet. |
plbossart
pushed a commit
that referenced
this pull request
Oct 30, 2019
We have a test case like block/001 in blktests, which will create a scsi device by loading scsi_debug module and then try to delete the device by sysfs interface. At the same time, it may remove the scsi_debug module. And getting a invalid paging request BUG_ON as following: [ 34.625854] BUG: unable to handle page fault for address: ffffffffa0016bb8 [ 34.629189] Oops: 0000 [#1] SMP PTI [ 34.629618] CPU: 1 PID: 450 Comm: bash Tainted: G W 5.4.0-rc3+ #473 [ 34.632524] RIP: 0010:scsi_proc_hostdir_rm+0x5/0xa0 [ 34.643555] CR2: ffffffffa0016bb8 CR3: 000000012cd88000 CR4: 00000000000006e0 [ 34.644545] Call Trace: [ 34.644907] scsi_host_dev_release+0x6b/0x1f0 [ 34.645511] device_release+0x74/0x110 [ 34.646046] kobject_put+0x116/0x390 [ 34.646559] put_device+0x17/0x30 [ 34.647041] scsi_target_dev_release+0x2b/0x40 [ 34.647652] device_release+0x74/0x110 [ 34.648186] kobject_put+0x116/0x390 [ 34.648691] put_device+0x17/0x30 [ 34.649157] scsi_device_dev_release_usercontext+0x2e8/0x360 [ 34.649953] execute_in_process_context+0x29/0x80 [ 34.650603] scsi_device_dev_release+0x20/0x30 [ 34.651221] device_release+0x74/0x110 [ 34.651732] kobject_put+0x116/0x390 [ 34.652230] sysfs_unbreak_active_protection+0x3f/0x50 [ 34.652935] sdev_store_delete.cold.4+0x71/0x8f [ 34.653579] dev_attr_store+0x1b/0x40 [ 34.654103] sysfs_kf_write+0x3d/0x60 [ 34.654603] kernfs_fop_write+0x174/0x250 [ 34.655165] __vfs_write+0x1f/0x60 [ 34.655639] vfs_write+0xc7/0x280 [ 34.656117] ksys_write+0x6d/0x140 [ 34.656591] __x64_sys_write+0x1e/0x30 [ 34.657114] do_syscall_64+0xb1/0x400 [ 34.657627] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 34.658335] RIP: 0033:0x7f156f337130 During deleting scsi target, the scsi_debug module have been removed. Then, sdebug_driver_template belonged to the module cannot be accessd, resulting in scsi_proc_hostdir_rm() BUG_ON. To fix the bug, we add scsi_device_get() in sdev_store_delete() to try to increase refcount of module, avoiding the module been removed. Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20191015130556.18061-1-yuyufen@huawei.com Signed-off-by: Yufen Yu <yuyufen@huawei.com> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…equence
There are some corner cases that the pm suspend callback could
fail and the DSP is not powered off. If this happens, we
should skip performing the actions in the resume callback
to avoid any DSP panic.
Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com