1 From f44630f1e12462921245feb91fe94d225ba90f9c Mon Sep 17 00:00:00 2001
2 From: Calvin Johnson <calvin.johnson@nxp.com>
3 Date: Wed, 18 Oct 2017 18:34:41 +0530
4 Subject: [PATCH] staging: fsl_ppfe/eth: fix read/write/ack idx issue
6 While fixing checkpatch errors some of the index increments
7 were commented out. They are enabled.
9 Signed-off-by: Calvin Johnson <calvin.johnson@nxp.com>
11 drivers/staging/fsl_ppfe/pfe_hif.c | 8 ++++----
12 drivers/staging/fsl_ppfe/pfe_hif_lib.c | 9 +++------
13 2 files changed, 7 insertions(+), 10 deletions(-)
15 --- a/drivers/staging/fsl_ppfe/pfe_hif.c
16 +++ b/drivers/staging/fsl_ppfe/pfe_hif.c
17 @@ -511,9 +511,9 @@ static void *client_put_rxpacket(struct
20 writel(CL_DESC_BUF_LEN(len) | flags, &desc->ctrl);
21 - /* queue->write_idx = (queue->write_idx + 1)
22 - * & (queue->size - 1);
24 + queue->write_idx = (queue->write_idx + 1)
25 + & (queue->size - 1);
27 free_pkt += pfe_pkt_headroom;
30 @@ -703,7 +703,7 @@ static int client_ack_txpacket(struct pf
32 if (readl(&desc->ctrl) & CL_DESC_OWN) {
33 writel((readl(&desc->ctrl) & ~CL_DESC_OWN), &desc->ctrl);
34 - /* queue->ack_idx = (queue->ack_idx + 1) & (queue->size - 1); */
35 + queue->ack_idx = (queue->ack_idx + 1) & (queue->size - 1);
39 --- a/drivers/staging/fsl_ppfe/pfe_hif_lib.c
40 +++ b/drivers/staging/fsl_ppfe/pfe_hif_lib.c
41 @@ -211,9 +211,6 @@ err:
45 -#define inc_cl_idx(idxname) \
46 - ({ typeof(idxname) idxname_ = (idxname); \
47 - ((idxname_) = (idxname_ + 1) & (queue->size - 1)); })
49 static void hif_lib_client_cleanup_tx_queue(struct hif_client_tx_queue *queue)
51 @@ -465,7 +462,7 @@ void *hif_lib_receive_pkt(struct hif_cli
54 desc->ctrl = CL_DESC_BUF_LEN(pfe_pkt_size) | CL_DESC_OWN;
55 - inc_cl_idx(queue->read_idx);
56 + queue->read_idx = (queue->read_idx + 1) & (queue->size - 1);
59 /*spin_unlock_irqrestore(&client->rx_lock, flags); */
60 @@ -507,7 +504,7 @@ void __hif_lib_xmit_pkt(struct hif_clien
62 __hif_xmit_pkt(&pfe->hif, client->id, qno, data, len, flags);
64 - inc_cl_idx(queue->write_idx);
65 + queue->write_idx = (queue->write_idx + 1) & (queue->size - 1);
67 queue->jiffies_last_packet = jiffies;
69 @@ -544,7 +541,7 @@ void *hif_lib_tx_get_next_complete(struc
70 if (desc->ctrl & CL_DESC_OWN)
73 - inc_cl_idx(queue->read_idx);
74 + queue->read_idx = (queue->read_idx + 1) & (queue->size - 1);
77 *flags = CL_DESC_GET_FLAGS(desc->ctrl);