drm/amdgpu/irq: check if nbio funcs exist

Submitted by Alex Deucher on Sept. 1, 2019, 5:38 p.m.

Details

Message ID 20190901173854.8824-1-alexander.deucher@amd.com
State Accepted
Commit bb42eda28407f62288398b4ef846ae64c98cdc73
Headers show
Series "drm/amdgpu/irq: check if nbio funcs exist" ( rev: 1 ) in AMD X.Org drivers

Not browsing as part of any series.

Commit Message

Alex Deucher Sept. 1, 2019, 5:38 p.m.
We need to check if the nbios funcs exist before
checking the individual pointers.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
index 3e49aa1465e2..0782f9153b60 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
@@ -156,10 +156,12 @@  irqreturn_t amdgpu_irq_handler(int irq, void *arg)
 	 * register to check whether the interrupt is triggered or not, and properly
 	 * ack the interrupt if it is there
 	 */
-	if (adev->nbio.funcs->handle_ras_controller_intr_no_bifring)
+	if (adev->nbio.funcs &&
+	    adev->nbio.funcs->handle_ras_controller_intr_no_bifring)
 		adev->nbio.funcs->handle_ras_controller_intr_no_bifring(adev);
 
-	if (adev->nbio.funcs->handle_ras_err_event_athub_intr_no_bifring)
+	if (adev->nbio.funcs &&
+	    adev->nbio.funcs->handle_ras_err_event_athub_intr_no_bifring)
 		adev->nbio.funcs->handle_ras_err_event_athub_intr_no_bifring(adev);
 
 	return ret;

Comments

Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>

Sent from my iPhone

> On Sep 1, 2019, at 13:39, Alex Deucher <alexdeucher@gmail.com> wrote:
> 
> We need to check if the nbios funcs exist before
> checking the individual pointers.
> 
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
> index 3e49aa1465e2..0782f9153b60 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c
> @@ -156,10 +156,12 @@ irqreturn_t amdgpu_irq_handler(int irq, void *arg)
>     * register to check whether the interrupt is triggered or not, and properly
>     * ack the interrupt if it is there
>     */
> -    if (adev->nbio.funcs->handle_ras_controller_intr_no_bifring)
> +    if (adev->nbio.funcs &&
> +        adev->nbio.funcs->handle_ras_controller_intr_no_bifring)
>        adev->nbio.funcs->handle_ras_controller_intr_no_bifring(adev);
> 
> -    if (adev->nbio.funcs->handle_ras_err_event_athub_intr_no_bifring)
> +    if (adev->nbio.funcs &&
> +        adev->nbio.funcs->handle_ras_err_event_athub_intr_no_bifring)
>        adev->nbio.funcs->handle_ras_err_event_athub_intr_no_bifring(adev);
> 
>    return ret;
> -- 
> 2.20.1
> 
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx