diff options
author | Sivaraj R | 2019-09-23 02:59:32 -0500 |
---|---|---|
committer | Ankur | 2019-09-23 04:36:00 -0500 |
commit | 8d2ba45e0a7672b1ad3429a2ad7f2d2be39c62ae (patch) | |
tree | 0ebbf25750bbf443ee143238a21bb9193b12386c | |
parent | 10cfe7d8d342dc31174d5002e32f2d1b7a382d65 (diff) | |
download | udma-lld-8d2ba45e0a7672b1ad3429a2ad7f2d2be39c62ae.tar.gz udma-lld-8d2ba45e0a7672b1ad3429a2ad7f2d2be39c62ae.tar.xz udma-lld-8d2ba45e0a7672b1ad3429a2ad7f2d2be39c62ae.zip |
PDK-3652: RINGACC and UDMA ring state interoperability issue after channel teardown - Patch 2
- Fixes after testing
- For read access, RM API should be called with dummy config
- Otherwise this ring RT region is firewalled and CPU will crash
Signed-off-by: Sivaraj R <sivaraj@ti.com>
-rw-r--r-- | src/udma_ring.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/src/udma_ring.c b/src/udma_ring.c index 341c0b7..b54d839 100644 --- a/src/udma_ring.c +++ b/src/udma_ring.c | |||
@@ -930,6 +930,29 @@ static int32_t Udma_ringReset(Udma_DrvHandle drvHandle, | |||
930 | 930 | ||
931 | if(1U == applyWorkaround) | 931 | if(1U == applyWorkaround) |
932 | { | 932 | { |
933 | /* Call SCICLIENT with dummy cfg to get read access to the ring RT | ||
934 | * By default this is is firewalled even for read access */ | ||
935 | rmRingReq.valid_params = 0U; | ||
936 | rmRingReq.nav_id = drvHandle->devIdRing; | ||
937 | rmRingReq.index = ringHandle->ringNum; | ||
938 | /* Not used */ | ||
939 | rmRingReq.mode = 0U; | ||
940 | rmRingReq.size = 0U; | ||
941 | rmRingReq.addr_lo = 0U; | ||
942 | rmRingReq.addr_hi = 0U; | ||
943 | rmRingReq.count = 0U; | ||
944 | rmRingReq.order_id = UDMA_DEFAULT_RING_ORDER_ID; | ||
945 | retVal = Sciclient_rmRingCfg( | ||
946 | &rmRingReq, &rmRingResp, UDMA_SCICLIENT_TIMEOUT); | ||
947 | if(CSL_PASS != retVal) | ||
948 | { | ||
949 | Udma_printf(drvHandle, | ||
950 | "[Error] Ring config for read access failed!!!\n"); | ||
951 | } | ||
952 | } | ||
953 | |||
954 | if((1U == applyWorkaround) && (UDMA_SOK == retVal)) | ||
955 | { | ||
933 | /*------------------------------------------------------------------------- | 956 | /*------------------------------------------------------------------------- |
934 | * 1. Read the ring occupancy. | 957 | * 1. Read the ring occupancy. |
935 | * | 958 | * |
@@ -954,8 +977,7 @@ static int32_t Udma_ringReset(Udma_DrvHandle drvHandle, | |||
954 | { | 977 | { |
955 | /*--------------------------------------------------------------------- | 978 | /*--------------------------------------------------------------------- |
956 | * 2. Reset the ring by writing to size register | 979 | * 2. Reset the ring by writing to size register |
957 | * 3. Setup the ring in ring/doorbell mode (if not already in this | 980 | * 3. At the same time setup the ring in ring/doorbell mode |
958 | * mode) | ||
959 | *-------------------------------------------------------------------*/ | 981 | *-------------------------------------------------------------------*/ |
960 | rmRingReq.valid_params = TISCI_MSG_VALUE_RM_RING_MODE_VALID | | 982 | rmRingReq.valid_params = TISCI_MSG_VALUE_RM_RING_MODE_VALID | |
961 | TISCI_MSG_VALUE_RM_RING_SIZE_VALID; | 983 | TISCI_MSG_VALUE_RM_RING_SIZE_VALID; |