]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - ti-linux-kernel/ti-linux-kernel-next.git/commitdiff
soc: ti: cppi5: Rename cppi5_desc_is_epib_present to cppi5_hdesc_epib_present
authorPeter Ujfalusi <peter.ujfalusi@ti.com>
Fri, 12 Oct 2018 09:56:16 +0000 (12:56 +0300)
committerTero Kristo <t-kristo@ti.com>
Tue, 16 Oct 2018 09:10:41 +0000 (12:10 +0300)
EPIB is only supported in packet mode.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
drivers/dma/ti/k3-udma.c
include/linux/soc/ti/cppi5.h

index 9095e547eef31f30da9b9abe5ed3361ae4faa0aa..2cb1475b12b0d02d085d1bf59a8c15506674c20f 100644 (file)
@@ -2328,7 +2328,7 @@ static int udma_attach_metadata(struct dma_async_tx_descriptor *desc,
        if (!data || len > uc->metadata_size)
                return -EINVAL;
 
-       if (uc->needs_epib && len < 16)
+       if (uc->needs_epib && len < CPPI5_INFO0_HDESC_EPIB_SIZE)
                return -EINVAL;
 
        h_desc = d->hwdesc[0].cppi5_desc_vaddr;
@@ -2336,7 +2336,7 @@ static int udma_attach_metadata(struct dma_async_tx_descriptor *desc,
                memcpy(h_desc->epib, data, len);
 
        if (uc->needs_epib)
-               psd_size -= 16;
+               psd_size -= CPPI5_INFO0_HDESC_EPIB_SIZE;
 
        d->metadata = data;
        d->metadata_size = len;
@@ -2363,7 +2363,8 @@ static void *udma_get_metadata_ptr(struct dma_async_tx_descriptor *desc,
 
        *max_len = uc->metadata_size;
 
-       *payload_len = cppi5_desc_is_epib_present(&h_desc->hdr) ? 16 : 0;
+       *payload_len = cppi5_hdesc_epib_present(&h_desc->hdr) ?
+                      CPPI5_INFO0_HDESC_EPIB_SIZE : 0;
        *payload_len += cppi5_hdesc_get_psdata_size(h_desc);
 
        return h_desc->epib;
@@ -2384,13 +2385,13 @@ static int udma_set_metadata_len(struct dma_async_tx_descriptor *desc,
        if (payload_len > uc->metadata_size)
                return -EINVAL;
 
-       if (uc->needs_epib && payload_len < 16)
+       if (uc->needs_epib && payload_len < CPPI5_INFO0_HDESC_EPIB_SIZE)
                return -EINVAL;
 
        h_desc = d->hwdesc[0].cppi5_desc_vaddr;
 
        if (uc->needs_epib) {
-               psd_size -= 16;
+               psd_size -= CPPI5_INFO0_HDESC_EPIB_SIZE;
                flags |= CPPI5_INFO0_HDESC_EPIB_PRESENT;
        }
 
@@ -3180,7 +3181,8 @@ static bool udma_dma_filter_fn(struct dma_chan *chan, void *param)
        uc->needs_epib = of_property_read_bool(chconf_node, "ti,needs-epib");
        if (!of_property_read_u32(chconf_node, "ti,psd-size", &val))
                uc->psd_size = val;
-       uc->metadata_size = (uc->needs_epib ? 16 : 0) + uc->psd_size;
+       uc->metadata_size = (uc->needs_epib ? CPPI5_INFO0_HDESC_EPIB_SIZE : 0) +
+                           uc->psd_size;
 
        uc->desc_align = 64;
        if (uc->desc_align < dma_get_cache_alignment())
index 2b51e85ed75e6cd317a99b1e50446a1df5ed4921..f116430ef7cf8d82f4cc8d797045c2cf9421ff14 100644 (file)
@@ -551,13 +551,12 @@ cppi5_hdesc_reset_hbdesc(struct cppi5_host_desc_t *desc)
 }
 
 /**
- * cppi5_desc_is_epib_present -  check if EPIB present
+ * cppi5_hdesc_epib_present -  check if EPIB present
  * @desc_hdr: packet descriptor/TR header
  *
  * Returns true if EPIB present in the packet
  */
-static inline bool
-cppi5_desc_is_epib_present(struct cppi5_desc_hdr_t *desc_hdr)
+static inline bool cppi5_hdesc_epib_present(struct cppi5_desc_hdr_t *desc_hdr)
 {
        WARN_ON(!desc_hdr);
        return !!(desc_hdr->pkt_info0 & CPPI5_INFO0_HDESC_EPIB_PRESENT);
@@ -590,7 +589,7 @@ static inline void *cppi5_hdesc_get_psdata(
 
        psdata = &desc->epib;
 
-       if (cppi5_desc_is_epib_present(&desc->hdr))
+       if (cppi5_hdesc_epib_present(&desc->hdr))
                psdata += CPPI5_INFO0_HDESC_EPIB_SIZE;
 
        return psdata;
@@ -624,7 +623,7 @@ static inline void *cppi5_hdesc_get_swdata(
 
        swdata = &desc->epib;
 
-       if (cppi5_desc_is_epib_present(&desc->hdr))
+       if (cppi5_hdesc_epib_present(&desc->hdr))
                swdata += CPPI5_INFO0_HDESC_EPIB_SIZE;
 
        swdata += (psdata_size << 2);