summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 20bd54a)
raw | patch | inline | side by side (parent: 20bd54a)
author | Don Dominic <a0486429@ti.com> | |
Tue, 8 Feb 2022 14:03:08 +0000 (19:33 +0530) | ||
committer | Rishabh Garg <rishabh@ti.com> | |
Wed, 9 Feb 2022 07:16:27 +0000 (01:16 -0600) |
Signed-off-by: Don Dominic <a0486429@ti.com>
packages/ti/drv/mcasp/src/dma/V1/mcasp_dma.c | patch | blob | history | |
packages/ti/drv/mcasp/src/mcasp_drv.c | patch | blob | history |
diff --git a/packages/ti/drv/mcasp/src/dma/V1/mcasp_dma.c b/packages/ti/drv/mcasp/src/dma/V1/mcasp_dma.c
index abff452dc5d71f31be516ddc6c4f696815462fde..2e74584fdb5ea7c9be862e3924b04ea22db191ad 100755 (executable)
Mcasp_descQueueEntry_t *descQueueEntry=NULL;
descQueueEntry = (Mcasp_descQueueEntry_t *) QueueP_get(chanHandle->queueFreeDesc);
assert((QueueP_Handle) descQueueEntry != chanHandle->queueFreeDesc);
- assert(descQueueEntry != NULL);
-
- pHpdMem = (uint8_t *) descQueueEntry->descMem;
- assert(QueueP_FAILURE != QueueP_put(chanHandle->queueTransitDesc,
- (void *) descQueueEntry));
- if(pHpdMem!=NULL) {
-
- if(pDmaInfo->descType == CSL_UDMAP_CPPI5_PD_DESCINFO_DTYPE_VAL_TR) {
- Mcasp_udmaTrpdInit(chanHandle, udmaChanHandle, pHpdMem, buffer, size);
- } else {
- Mcasp_udmaHpdInit(udmaChanHandle, pHpdMem, buffer, size);
- }
- } else {
- MCASP_DEBUG_ERR_TRAP
- }
- /* Submit TRPD to channel */
- retVal = Udma_ringQueueRaw(Udma_chGetFqRingHandle(udmaChanHandle), (uint64_t)pHpdMem);
- } else {
+ if(descQueueEntry != NULL)
+ {
+ pHpdMem = (uint8_t *) descQueueEntry->descMem;
+ assert(QueueP_FAILURE != QueueP_put(chanHandle->queueTransitDesc,
+ (void *) descQueueEntry));
+ if(pHpdMem!=NULL)
+ {
+ if(pDmaInfo->descType == CSL_UDMAP_CPPI5_PD_DESCINFO_DTYPE_VAL_TR)
+ {
+ Mcasp_udmaTrpdInit(chanHandle, udmaChanHandle, pHpdMem, buffer, size);
+ }
+ else
+ {
+ Mcasp_udmaHpdInit(udmaChanHandle, pHpdMem, buffer, size);
+ }
+ }
+ else
+ {
+ MCASP_DEBUG_ERR_TRAP
+ }
+ /* Submit TRPD to channel */
+ retVal = Udma_ringQueueRaw(Udma_chGetFqRingHandle(udmaChanHandle), (uint64_t)pHpdMem);
+ }
+ else
+ {
+ MCASP_DEBUG_ERR_TRAP
+ }
+ }
+ else
+ {
MCASP_DEBUG_ERR_TRAP
}
descQueueEntry = (Mcasp_descQueueEntry_t *)
QueueP_get(chanHandle->queueTransitDesc);
assert((QueueP_Handle) descQueueEntry != chanHandle->queueTransitDesc);
- assert(descQueueEntry != NULL);
-
- descQueueEntry->descMem = (void *)(uintptr_t )pDesc;
- assert(QueueP_FAILURE != QueueP_put(chanHandle->queueFreeDesc,
+ if (descQueueEntry != NULL);
+ {
+ descQueueEntry->descMem = (void *)(uintptr_t )pDesc;
+ assert(QueueP_FAILURE != QueueP_put(chanHandle->queueFreeDesc,
(void *) descQueueEntry));
-
+ }
}
if ((UDMA_SOK == status) && (eventType == UDMA_EVENT_TYPE_DMA_COMPLETION))
index b1a0ce51b63f858e927f282bade838a288650cda..52bb13f7dad4bb8895ae93536f26ba3d427b7e03 100755 (executable)
ioPacket = (MCASP_Packet *) \
QueueP_get(chanHandle->queueFloatingList);
- if (chanHandle->queueFloatingList == (QueueP_Handle) ioPacket)
+ if ((chanHandle->queueFloatingList == (QueueP_Handle) ioPacket) ||
+ (NULL == ioPacket))
{
status = MCASP_EBADIO;
/* Ideally control should not come here */
/* end the critical section */
HwiP_restore(hwiKey);
+ if (chanHandle->tempPacket == NULL)
+ {
+ break;
+ }
+
instHandle = (Mcasp_Object *)chanHandle->devHandle;
if(NULL != instHandle)
{
chanHandle->dataPacket = (MCASP_Packet*)QueueP_get(chanHandle->queueReqList);
if ((chanHandle->queueReqList != (QueueP_Handle) chanHandle->dataPacket) &&
- (NULL != chanHandle->dataPacket));
+ (NULL != chanHandle->dataPacket))
{
/* we have a valid packet to process next */
/* complete the IOP now and call the callback to the stream */
chanHandle->tempPacket = (MCASP_Packet *) QueueP_get(chanHandle->queueFloatingList);
- assert(chanHandle->tempPacket != NULL);
-
- /* Decrement the submit count for the IOpackets */
- chanHandle->submitCount--;
+ if(chanHandle->tempPacket != NULL);
+ {
+ /* Decrement the submit count for the IOpackets */
+ chanHandle->submitCount--;
- chanHandle->isTempPacketValid = (Bool)TRUE;
- chanHandle->tempPacket->status = chanHandle->currentPacketErrorStatus;
+ chanHandle->isTempPacketValid = (Bool)TRUE;
+ chanHandle->tempPacket->status = chanHandle->currentPacketErrorStatus;
- Mcasp_localCompleteCurrentIo(chanHandle);
+ Mcasp_localCompleteCurrentIo(chanHandle);
-#if defined (BIOS_PWRM_ENABLE) && !defined (Mcasp_LOOPJOB_ENABLED)
- /* check if the driver is waiting to go to sleep or process DVFS event *
- * (only if the application has requested PWRM support) */
- if (TRUE == instHandle->pscPwrmEnable)
- {
- Mcasp_localHandlePwrmEvent(instHandle,chanHandle);
+ #if defined (BIOS_PWRM_ENABLE) && !defined (Mcasp_LOOPJOB_ENABLED)
+ /* check if the driver is waiting to go to sleep or process DVFS event *
+ * (only if the application has requested PWRM support) */
+ if (TRUE == instHandle->pscPwrmEnable)
+ {
+ Mcasp_localHandlePwrmEvent(instHandle,chanHandle);
+ }
+ #endif /* #ifdef BIOS_PWRM_ENABLE */
}
-#endif /* #ifdef BIOS_PWRM_ENABLE */
}
}
* active Queue */
ioPacket = (MCASP_Packet *) QueueP_get(chanHandle->queueReqList);
assert(chanHandle->queueReqList != (QueueP_Handle) ioPacket);
+ if (NULL == ioPacket)
+ {
+ status = MCASP_EBADIO;
+ break;
+ }
/* put the packet in to the active queue */
assert(QueueP_FAILURE !=