drm/msm/a6xx: Poll for HFI responses
Subsystems (4)
PATCH 1/1 drm/msm/a6xx: Poll for HFI responses
The only HFI communication with the GMU on sdm845 happens during initialization and all commands are synchronous. A fancy interrupt tasklet and associated infrastructure is entirely not eeded and puts us at the mercy of the scheduler.
Instead poll for the message signal and handle the response immediately and go on our way.
Signed-off-by Jordan Crouse <[email protected]>
--- drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 13 +-- drivers/gpu/drm/msm/adreno/a6xx_gmu.h | 3 +- drivers/gpu/drm/msm/adreno/a6xx_hfi.c | 161 +++++++++----------------- 3 files changed, 57 insertions(+), 120 deletions(-)
drivers/gpu/drm/msm/adreno/a6xx_gmu.c +1 -12
@@ -2,7 +2,6 @@/* Copyright (c) 2017-2018 The Linux Foundation. All rights reserved. */ #include <linux/clk.h> -#include <linux/iopoll.h> #include <linux/pm_opp.h> #include <soc/qcom/cmd-db.h>
@@ -42,9 +41,6 @@ static irqreturn_t a6xx_hfi_irq(int irq, void *data) status =gmu_read (gmu,REG_A6XX_GMU_GMU2HOST_INTR_INFO );gmu_write (gmu,REG_A6XX_GMU_GMU2HOST_INTR_CLR , status); -if (status &A6XX_GMU_GMU2HOST_INTR_INFO_MSGQ ) -tasklet_schedule (&gmu->hfi_tasklet); -if (status &A6XX_GMU_GMU2HOST_INTR_INFO_CM3_FAULT ) {dev_err_ratelimited (gmu->dev,"GMU firmware fault\n" );
@@ -135,9 +131,6 @@ static int a6xx_gmu_hfi_start(struct a6xx_gmu *gmu)u32 val;int ret; -gmu_rmw (gmu,REG_A6XX_GMU_GMU2HOST_INTR_MASK , -A6XX_GMU_GMU2HOST_INTR_INFO_MSGQ ,0 ); -gmu_write (gmu,REG_A6XX_GMU_HFI_CTRL_INIT ,1 ); ret = gmu_poll_timeout(gmu, REG_A6XX_GMU_HFI_CTRL_STATUS, val,
@@ -547,8 +540,7 @@ static int a6xx_gmu_fw_start(struct a6xx_gmu *gmu, unsigned int state) }#define A6XX_HFI_IRQ_MASK \ - (A6XX_GMU_GMU2HOST_INTR_INFO_MSGQ | \ - A6XX_GMU_GMU2HOST_INTR_INFO_CM3_FAULT) + (A6XX_GMU_GMU2HOST_INTR_INFO_CM3_FAULT)#define A6XX_GMU_IRQ_MASK \ (A6XX_GMU_AO_HOST_INTERRUPT_STATUS_WDOG_BITE | \
@@ -1184,9 +1176,6 @@ int a6xx_gmu_probe(struct a6xx_gpu *a6xx_gpu, struct device_node *node)if (gmu->hfi_irq <0 || gmu->gmu_irq <0 ) goto err; -/* Set up a tasklet to handle GMU HFI responses */ -tasklet_init (&gmu->hfi_tasklet, a6xx_hfi_task, (unsigned long ) gmu); -/* Get the power levels for the GMU and GPU */ a6xx_gmu_pwrlevels_probe (gmu);
drivers/gpu/drm/msm/adreno/a6xx_gmu.h +1 -2
@@ -4,6 +4,7 @@#ifndef _A6XX_GMU_H_#define _A6XX_GMU_H_ +#include <linux/iopoll.h> #include <linux/interrupt.h> #include "msm_drv.h" #include "a6xx_hfi.h"
@@ -157,6 +158,4 @@ void a6xx_hfi_init(struct a6xx_gmu *gmu);int a6xx_hfi_start (struct a6xx_gmu *gmu,int boot_state);void a6xx_hfi_stop (struct a6xx_gmu *gmu); -void a6xx_hfi_task (unsigned long data); -#endif
drivers/gpu/drm/msm/adreno/a6xx_hfi.c +55 -106
198 lines not on this page · raw message
Signature · 6 lines
2.18.0 _______________________________________________ Freedreno mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/freedreno