Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f315f077 authored by Rakesh Pillai's avatar Rakesh Pillai Committed by snandini
Browse files

qcacmn: Handle the duplicate entries in reo exception ring

We have come across scenarios where rxdma is pushing
a certain entry more than once to the reo exception
ring. In this scenario, when we try to unmap a buffer,
it can lead to multiple unmap of the same buffer.

Handle this case, by skipping the process of this
duplicate entry, if alrady unmapped, and proceed to the
next entry.

Change-Id: Iae66f27e432f795ba4730911029fa1d63a75cb06
CRs-Fixed: 2739176
parent de5bfb10
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -1683,8 +1683,7 @@ QDF_STATUS dp_rx_desc_nbuf_sanity_check(hal_ring_desc_t ring_desc,


	hal_rx_reo_buf_paddr_get(ring_desc, &hbi);
	hal_rx_reo_buf_paddr_get(ring_desc, &hbi);
	/* Sanity check for possible buffer paddr corruption */
	/* Sanity check for possible buffer paddr corruption */
	if ((&hbi)->paddr ==
	if (dp_rx_desc_paddr_sanity_check(rx_desc, (&hbi)->paddr))
			  qdf_nbuf_get_frag_paddr(rx_desc->nbuf, 0))
		return QDF_STATUS_SUCCESS;
		return QDF_STATUS_SUCCESS;


	return QDF_STATUS_E_FAILURE;
	return QDF_STATUS_E_FAILURE;
+14 −0
Original line number Original line Diff line number Diff line
@@ -687,6 +687,20 @@ void dp_rx_deliver_raw(struct dp_vdev *vdev, qdf_nbuf_t nbuf_list,
				struct dp_peer *peer);
				struct dp_peer *peer);


#ifdef RX_DESC_DEBUG_CHECK
#ifdef RX_DESC_DEBUG_CHECK
/**
 * dp_rx_desc_paddr_sanity_check() - paddr sanity for ring desc vs rx_desc
 * @rx_desc: rx descriptor
 * @ring_paddr: paddr obatined from the ring
 *
 * Returns: QDF_STATUS
 */
static inline
bool dp_rx_desc_paddr_sanity_check(struct dp_rx_desc *rx_desc,
				   uint64_t ring_paddr)
{
	return (ring_paddr == qdf_nbuf_get_frag_paddr(rx_desc->nbuf, 0));
}

/*
/*
 * dp_rx_desc_alloc_dbg_info() - Alloc memory for rx descriptor debug
 * dp_rx_desc_alloc_dbg_info() - Alloc memory for rx descriptor debug
 *  structure
 *  structure
+3 −0
Original line number Original line Diff line number Diff line
@@ -1747,6 +1747,9 @@ uint32_t dp_rx_frag_handle(struct dp_soc *soc, hal_ring_desc_t ring_desc,
	pdev = soc->pdev_list[rx_desc->pool_id];
	pdev = soc->pdev_list[rx_desc->pool_id];
	*mac_id = rx_desc->pool_id;
	*mac_id = rx_desc->pool_id;


	if (rx_desc->unmapped)
		return rx_bufs_used;

	msdu = rx_desc->nbuf;
	msdu = rx_desc->nbuf;


	qdf_nbuf_unmap_single(soc->osdev, msdu,	QDF_DMA_FROM_DEVICE);
	qdf_nbuf_unmap_single(soc->osdev, msdu,	QDF_DMA_FROM_DEVICE);
+24 −0
Original line number Original line Diff line number Diff line
@@ -1515,6 +1515,30 @@ dp_rx_err_process(struct dp_intr *int_ctx, struct dp_soc *soc,
						      msdu_list.sw_cookie[0]);
						      msdu_list.sw_cookie[0]);
		qdf_assert_always(rx_desc);
		qdf_assert_always(rx_desc);


		/*
		 * this is a unlikely scenario where the host is reaping
		 * a descriptor which it already reaped just a while ago
		 * but is yet to replenish it back to HW.
		 * In this case host will dump the last 128 descriptors
		 * including the software descriptor rx_desc and assert.
		 */

		if (qdf_unlikely(!rx_desc->in_use)) {
			DP_STATS_INC(soc, rx.err.hal_reo_dest_dup, 1);
			dp_info_rl("Reaping rx_desc not in use!");
			dp_rx_dump_info_and_assert(soc, hal_ring_hdl,
						   ring_desc, rx_desc);
			/* ignore duplicate RX desc and continue to process */
			/* Pop out the descriptor */
			goto next_entry;
		}

		if (!dp_rx_desc_paddr_sanity_check(rx_desc, msdu_list.paddr[0])) {
			DP_STATS_INC(soc, rx.err.nbuf_sanity_fail, 1);
			rx_desc->in_err_state = 1;
			goto next_entry;
		}

		mac_id = rx_desc->pool_id;
		mac_id = rx_desc->pool_id;


		/* Get the MPDU DESC info */
		/* Get the MPDU DESC info */