drm/omap: DMM: Error handling
Subsystems (3)
cover drm/omap: DMM: Error handling
Hi,
the following series adds basic error handling and reporting for the dmm/tiler driver.
With the error handling in place we can catch the problems early to avoid more serious consequences.
Regards,
Peter
---
Peter Ujfalusi (4):
drm/omap: DMM: Fix DMM_IRQSTAT_ERR_MASK definition drm/omap: DMM: In case of error/timeout in wait_status() print the
reason
drm/omap: DMM: Print information if we received an error interrupt drm/omap: DMM: Check for DMM readiness after successful transaction
commit
drivers/gpu/drm/omapdrm/omap_dmm_priv.h | 12 ++++++------ drivers/gpu/drm/omapdrm/omap_dmm_tiler.c | 22 ++++++++++++++++++++-- 2 files changed, 26 insertions(+), 8 deletions(-)
Signature · 10 lines
2.14.1 Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 1/4 drm/omap: DMM: Fix DMM_IRQSTAT_ERR_MASK definition
The error bit definitions are typoed in DMM_IRQSTAT_ERR_MASK which went unnoticed since the DMM_IRQSTAT_ERR_MASK was not used.
Change the bit definitions to the correct ones.
--- drivers/gpu/drm/omapdrm/omap_dmm_priv.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/omapdrm/omap_dmm_priv.h +6 -6
@@ -59,12 +59,12 @@#define DMM_IRQSTAT_ERR_UPD_DATA (1<<6)#define DMM_IRQSTAT_ERR_LUT_MISS (1<<7) -#define DMM_IRQSTAT_ERR_MASK (DMM_IRQ_STAT_ERR_INV_DSC | \ - DMM_IRQ_STAT_ERR_INV_DATA | \ - DMM_IRQ_STAT_ERR_UPD_AREA | \ - DMM_IRQ_STAT_ERR_UPD_CTRL | \ - DMM_IRQ_STAT_ERR_UPD_DATA | \ - DMM_IRQ_STAT_ERR_LUT_MISS) +#define DMM_IRQSTAT_ERR_MASK (DMM_IRQSTAT_ERR_INV_DSC | \ + DMM_IRQSTAT_ERR_INV_DATA | \ + DMM_IRQSTAT_ERR_UPD_AREA | \ + DMM_IRQSTAT_ERR_UPD_CTRL | \ + DMM_IRQSTAT_ERR_UPD_DATA | \ + DMM_IRQSTAT_ERR_LUT_MISS)#define DMM_PATSTATUS_READY (1<<0)#define DMM_PATSTATUS_VALID (1<<1)
Signature · 10 lines
2.14.1 Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 2/4 drm/omap: DMM: In case of error/timeout in wait_status() print the reason
In reply to Peter UjfalusiIf the wait_status() fails either because of an error reported in the STATUS register or because of a timeout waiting for the wait_mask, print information which might help diagnose the reason.
--- drivers/gpu/drm/omapdrm/omap_dmm_tiler.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
drivers/gpu/drm/omapdrm/omap_dmm_tiler.c +10 -2
@@ -121,14 +121,22 @@ static int wait_status(struct refill_engine *engine, uint32_t wait_mask)while (true) { r =dmm_read (dmm, reg[PAT_STATUS ][engine->id]); err = r &DMM_PATSTATUS_ERR ; -if (err) +if (err) { +dev_err (dmm->dev, +"%s: error (engine%d). PAT_STATUS: 0x%08x\n" , + __func__, engine->id, r);return -EFAULT ; + }if ((r & wait_mask) == wait_mask)break ; -if (--i ==0 ) +if (--i ==0 ) { +dev_err (dmm->dev, +"%s: timeout (engine%d). PAT_STATUS: 0x%08x\n" , + __func__, engine->id, r);return -ETIMEDOUT ; + }udelay (1 ); }
Signature · 10 lines
2.14.1 Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 3/4 drm/omap: DMM: Print information if we received an error interrupt
In reply to Peter UjfalusiTo help diagnose DMM errors, print out information if any of the error bits are set in the interrupt status register.
--- drivers/gpu/drm/omapdrm/omap_dmm_tiler.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/omapdrm/omap_dmm_tiler.c +5 -0
@@ -166,6 +166,11 @@ static irqreturn_t omap_dmm_irq_handler(int irq, void *arg)dmm_write (dmm, status,DMM_PAT_IRQSTATUS );for (i =0 ; i < dmm->num_engines; i++) { +if (status &DMM_IRQSTAT_ERR_MASK ) +dev_err (dmm->dev, +"irq error(engine%d): IRQSTAT 0x%02x\n" , + i, status &0xff ); +if (status &DMM_IRQSTAT_LST ) {if (dmm->engines[i].async)release_engine (&dmm->engines[i]);
Signature · 10 lines
2.14.1 Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 4/4 drm/omap: DMM: Check for DMM readiness after successful transaction commit
In reply to Peter UjfalusiCheck the status of the DMM engine after it is reported that the transaction was completed as in rare cases the engine might not reached a working state.
The wait_status() will print information in case the DMM is not reached the expected state and the dmm_txn_commit() will return with an error code to make sure that we are not continuing with a broken setup.
--- drivers/gpu/drm/omapdrm/omap_dmm_tiler.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/omapdrm/omap_dmm_tiler.c +5 -0
@@ -311,7 +311,12 @@ static int dmm_txn_commit(struct dmm_txn *txn, bool wait) msecs_to_jiffies(100))) {dev_err (dmm->dev,"timed out waiting for done\n" ); ret = -ETIMEDOUT ; + goto cleanup; } + +/* Check the engine status before continue */ + ret =wait_status (engine,DMM_PATSTATUS_READY | +DMM_PATSTATUS_VALID |DMM_PATSTATUS_DONE ); } cleanup:
Signature · 10 lines
2.14.1 Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Tomi Valkeinen
Applied
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
Quoted 19 lines · Peter Ujfalusi
Hi,
the following series adds basic error handling and reporting for the dmm/tiler driver.
With the error handling in place we can catch the problems early to avoid more serious consequences.
Regards,
Peter
---
Peter Ujfalusi (4):
drm/omap: DMM: FixDMM_IRQSTAT_ERR_MASKdefinition drm/omap: DMM: In case of error/timeout inwait_status()print the
reason
drm/omap: DMM: Print information if we received an error interrupt drm/omap: DMM: Check for DMM readiness after successful transaction
commit
Quoted 4 lines
drivers/gpu/drm/omapdrm/omap_dmm_priv.h | 12 ++++++------ drivers/gpu/drm/omapdrm/omap_dmm_tiler.c | 22 ++++++++++++++++++++-- 2 files changed, 26 insertions(+), 8 deletions(-)
Thanks! Applied for v4.16.
tomi
Signature · 7 lines
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel