diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2016-11-03 17:47:51 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-11-07 12:40:52 -0500 |
commit | 757124d95c42bb579d67df51e51789849929ee31 (patch) | |
tree | 3283d886ac3afb641909c4fde83b1de51da37ec2 | |
parent | 020a0bbc0d89c15693e69ed2063584ef7ec2d811 (diff) |
drm/amdgpu: fix crash in acp_hw_fini
On CZ/ST systems with AZ rather than ACP audio, we need to bail
early in hw_fini since there is nothing to do.
bug: https://bugs.freedesktop.org/show_bug.cgi?id=98276
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c index 892d60fb225b..2057683f7b59 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | |||
@@ -395,9 +395,12 @@ static int acp_hw_fini(void *handle) | |||
395 | { | 395 | { |
396 | int i, ret; | 396 | int i, ret; |
397 | struct device *dev; | 397 | struct device *dev; |
398 | |||
399 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; | 398 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; |
400 | 399 | ||
400 | /* return early if no ACP */ | ||
401 | if (!adev->acp.acp_genpd) | ||
402 | return 0; | ||
403 | |||
401 | for (i = 0; i < ACP_DEVS ; i++) { | 404 | for (i = 0; i < ACP_DEVS ; i++) { |
402 | dev = get_mfd_cell_dev(adev->acp.acp_cell[i].name, i); | 405 | dev = get_mfd_cell_dev(adev->acp.acp_cell[i].name, i); |
403 | ret = pm_genpd_remove_device(&adev->acp.acp_genpd->gpd, dev); | 406 | ret = pm_genpd_remove_device(&adev->acp.acp_genpd->gpd, dev); |