aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/layerscape/patches-5.4/701-net-0361-sdk_dpaa-sdk_fman-ls1034a-errata-update-number-to-A0.patch
blob: f9b0c705862f7304a24d2ed414fac97e9713c86c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
From 512bb2bd0555a8e78713dfdc109d87723a9da5c1 Mon Sep 17 00:00:00 2001
From: Camelia Groza <camelia.groza@nxp.com>
Date: Fri, 13 Dec 2019 14:49:16 +0200
Subject: [PATCH] sdk_dpaa: sdk_fman: ls1034a errata: update number to A050385

The A050385 erratum extends the A010022 erratum by defining additional
FMan lock-up conditions and suggests new w/a restrictions.

Signed-off-by: Camelia Groza <camelia.groza@nxp.com>
---
 drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth.h | 14 +++----
 .../net/ethernet/freescale/sdk_dpaa/dpaa_eth_sg.c  | 44 +++++++++++-----------
 .../inc/integrations/LS1043/dpaa_integration_ext.h |  2 +-
 .../sdk_fman/src/inc/wrapper/lnxwrp_fsl_fman.h     |  8 ++--
 .../freescale/sdk_fman/src/wrapper/lnxwrp_fm.c     | 16 ++++----
 5 files changed, 42 insertions(+), 42 deletions(-)

--- a/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth.h
+++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth.h
@@ -99,15 +99,15 @@ struct dpa_buffer_layout_s {
  * space to account for further alignments.
  */
 #define DPA_MAX_FRM_SIZE	9600
-#ifndef FM_ERRATUM_A010022
+#ifndef FM_ERRATUM_A050385
 #define DPA_BP_RAW_SIZE \
 	((DPA_MAX_FRM_SIZE + DPA_MAX_FD_OFFSET + \
 	  sizeof(struct skb_shared_info) + 128) & ~(SMP_CACHE_BYTES - 1))
-#else /* FM_ERRATUM_A010022 */
-#define DPA_BP_RAW_SIZE ((unlikely(fm_has_errata_a010022())) ? 2048 : \
+#else /* FM_ERRATUM_A050385 */
+#define DPA_BP_RAW_SIZE ((unlikely(fm_has_errata_a050385())) ? 2048 : \
 	((DPA_MAX_FRM_SIZE + DPA_MAX_FD_OFFSET + \
 	  sizeof(struct skb_shared_info) + 128) & ~(SMP_CACHE_BYTES - 1)))
-#endif /* FM_ERRATUM_A010022 */
+#endif /* FM_ERRATUM_A050385 */
 #endif /* CONFIG_FSL_DPAA_ETH_JUMBO_FRAME */
 
 /* This is what FMan is ever allowed to use.
@@ -660,14 +660,14 @@ static inline void _dpa_bp_free_pf(void
  * on egress.
  */
 
-#ifdef FM_ERRATUM_A010022
+#ifdef FM_ERRATUM_A050385
 #define CROSS_4K(start, size) \
 	(((uintptr_t)(start) + (size)) > \
 	 (((uintptr_t)(start) + 0x1000) & ~0xFFF))
 /* The headroom needs to accommodate our private data (64 bytes) but
  * we reserve 256 bytes instead to guarantee 256 data alignment.
  */
-#define DPAA_A010022_HEADROOM	256
-#endif  /* FM_ERRATUM_A010022 */
+#define DPAA_A050385_HEADROOM	256
+#endif  /* FM_ERRATUM_A050385 */
 
 #endif	/* __DPA_H */
--- a/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_sg.c
+++ b/drivers/net/ethernet/freescale/sdk_dpaa/dpaa_eth_sg.c
@@ -101,8 +101,8 @@ static int _dpa_bp_add_8_bufs(const stru
 		 * We only need enough space to store a pointer, but allocate
 		 * an entire cacheline for performance reasons.
 		 */
-#ifdef FM_ERRATUM_A010022
-		if (unlikely(fm_has_errata_a010022())) {
+#ifdef FM_ERRATUM_A050385
+		if (unlikely(fm_has_errata_a050385())) {
 			struct page *new_page = alloc_page(GFP_ATOMIC);
 			if (unlikely(!new_page))
 				goto netdev_alloc_failed;
@@ -765,15 +765,15 @@ int __hot skb_to_contig_fd(struct dpa_pr
 }
 EXPORT_SYMBOL(skb_to_contig_fd);
 
-#ifdef FM_ERRATUM_A010022
-/* Verify the conditions that trigger the A010022 errata:
+#ifdef FM_ERRATUM_A050385
+/* Verify the conditions that trigger the A050385 errata:
  * - 4K memory address boundary crossings when the data/SG fragments aren't
  *   aligned to 256 bytes
  * - data and SG fragments that aren't aligned to 16 bytes
  * - SG fragments that aren't mod 16 bytes in size (except for the last
  *   fragment)
  */
-static bool a010022_check_skb(struct sk_buff *skb, struct dpa_priv_s *priv)
+static bool a050385_check_skb(struct sk_buff *skb, struct dpa_priv_s *priv)
 {
 	skb_frag_t *frag;
 	int i, nr_frags;
@@ -840,7 +840,7 @@ static bool a010022_check_skb(struct sk_
  * page. Build a new skb around the new buffer and release the old one.
  * A performance drop should be expected.
  */
-static struct sk_buff *a010022_realign_skb(struct sk_buff *skb,
+static struct sk_buff *a050385_realign_skb(struct sk_buff *skb,
 					   struct dpa_priv_s *priv)
 {
 	int trans_offset = skb_transport_offset(skb);
@@ -850,7 +850,7 @@ static struct sk_buff *a010022_realign_s
 	struct page *npage;
 	void *npage_addr;
 
-	headroom = DPAA_A010022_HEADROOM;
+	headroom = DPAA_A050385_HEADROOM;
 
 	/* For the new skb we only need the old one's data (both non-paged and
 	 * paged). We can skip the old tailroom.
@@ -941,8 +941,8 @@ int __hot skb_to_sg_fd(struct dpa_priv_s
 	/* Get a page frag to store the SGTable, or a full page if the errata
 	 * is in place and we need to avoid crossing a 4k boundary.
 	 */
-#ifdef FM_ERRATUM_A010022
-	if (unlikely(fm_has_errata_a010022())) {
+#ifdef FM_ERRATUM_A050385
+	if (unlikely(fm_has_errata_a050385())) {
 		struct page *new_page = alloc_page(GFP_ATOMIC);
 
 		if (unlikely(!new_page))
@@ -1099,9 +1099,9 @@ int __hot dpa_tx_extended(struct sk_buff
 	int *countptr, offset = 0;
 	struct sk_buff *nskb;
 
-	/* Flags to help optimize the A010022 errata restriction checks.
+	/* Flags to help optimize the A050385 errata restriction checks.
 	 *
-	 * First flag marks if the skb changed between the first A010022 check
+	 * First flag marks if the skb changed between the first A050385 check
 	 * and the moment it's converted to an FD.
 	 *
 	 * The second flag marks if the skb needs to be realigned in order to
@@ -1121,8 +1121,8 @@ int __hot dpa_tx_extended(struct sk_buff
 
 	clear_fd(&fd);
 
-#ifdef FM_ERRATUM_A010022
-	if (unlikely(fm_has_errata_a010022()) && a010022_check_skb(skb, priv))
+#ifdef FM_ERRATUM_A050385
+	if (unlikely(fm_has_errata_a050385()) && a050385_check_skb(skb, priv))
 		skb_need_wa = true;
 #endif
 
@@ -1176,7 +1176,7 @@ int __hot dpa_tx_extended(struct sk_buff
 		/* We're going to store the skb backpointer at the beginning
 		 * of the data buffer, so we need a privately owned skb
 		 *
-		 * Under the A010022 errata, we are going to have a privately
+		 * Under the A050385 errata, we are going to have a privately
 		 * owned skb after realigning the current one, so no point in
 		 * copying it here in that case.
 		 */
@@ -1194,12 +1194,12 @@ int __hot dpa_tx_extended(struct sk_buff
 			 * more fragments than we support. In this case,
 			 * we have no choice but to linearize it ourselves.
 			 */
-#ifdef FM_ERRATUM_A010022
+#ifdef FM_ERRATUM_A050385
 			/* No point in linearizing the skb now if we are going
 			 * to realign and linearize it again further down due
-			 * to the A010022 errata
+			 * to the A050385 errata
 			 */
-			if (unlikely(fm_has_errata_a010022()))
+			if (unlikely(fm_has_errata_a050385()))
 				skb_need_wa = true;
 			else
 #endif
@@ -1209,16 +1209,16 @@ int __hot dpa_tx_extended(struct sk_buff
 			/* Common out-of-memory error path */
 			goto enomem;
 
-#ifdef FM_ERRATUM_A010022
+#ifdef FM_ERRATUM_A050385
 		/* Verify the skb a second time if it has been updated since
 		 * the previous check
 		 */
-		if (unlikely(fm_has_errata_a010022()) && skb_changed &&
-		    a010022_check_skb(skb, priv))
+		if (unlikely(fm_has_errata_a050385()) && skb_changed &&
+		    a050385_check_skb(skb, priv))
 			skb_need_wa = true;
 
-		if (unlikely(fm_has_errata_a010022()) && skb_need_wa) {
-			nskb = a010022_realign_skb(skb, priv);
+		if (unlikely(fm_has_errata_a050385()) && skb_need_wa) {
+			nskb = a050385_realign_skb(skb, priv);
 			if (!nskb)
 				goto skb_to_fd_failed;
 			dev_kfree_skb(skb);
--- a/drivers/net/ethernet/freescale/sdk_fman/inc/integrations/LS1043/dpaa_integration_ext.h
+++ b/drivers/net/ethernet/freescale/sdk_fman/inc/integrations/LS1043/dpaa_integration_ext.h
@@ -271,7 +271,7 @@ typedef enum
 #define FM_AID_MODE_NO_TNUM_SW005 /* refer to pdm TKT068794 - only support of port_id on aid */
 #define FM_ERROR_VSP_NO_MATCH_SW006 /* refer to pdm TKT174304 - no match between errorQ and VSP */
 
-#define FM_ERRATUM_A010022
+#define FM_ERRATUM_A050385
 
 /*****************************************************************************
  RMan INTEGRATION-SPECIFIC DEFINITIONS
--- a/drivers/net/ethernet/freescale/sdk_fman/src/inc/wrapper/lnxwrp_fsl_fman.h
+++ b/drivers/net/ethernet/freescale/sdk_fman/src/inc/wrapper/lnxwrp_fsl_fman.h
@@ -490,12 +490,12 @@ int fm_get_max_frm(void);
 int fm_get_rx_extra_headroom(void);
 
 /**************************************************************************//**
- @Function	fm_has_errata_a010022
+ @Function	fm_has_errata_a050385
 
- @Description   Detect if the SoC is vulnerable to the A010022 errata
+ @Description   Detect if the SoC is vulnerable to the A050385 errata
 *//***************************************************************************/
-#ifdef FM_ERRATUM_A010022
-bool fm_has_errata_a010022(void);
+#ifdef FM_ERRATUM_A050385
+bool fm_has_errata_a050385(void);
 #endif
 
 /**************************************************************************//**
--- a/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_fm.c
+++ b/drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_fm.c
@@ -156,8 +156,8 @@ static int fsl_fm_pfc_quanta[] = {
 
 static t_LnxWrpFm   lnxWrpFm;
 
-#ifdef FM_ERRATUM_A010022
-static bool fm_has_err_a010022;
+#ifdef FM_ERRATUM_A050385
+static bool fm_has_err_a050385;
 #endif
 
 int fm_get_max_frm()
@@ -172,12 +172,12 @@ int fm_get_rx_extra_headroom()
 }
 EXPORT_SYMBOL(fm_get_rx_extra_headroom);
 
-#ifdef FM_ERRATUM_A010022
-bool fm_has_errata_a010022(void)
+#ifdef FM_ERRATUM_A050385
+bool fm_has_errata_a050385(void)
 {
-	return fm_has_err_a010022;
+	return fm_has_err_a050385;
 }
-EXPORT_SYMBOL(fm_has_errata_a010022);
+EXPORT_SYMBOL(fm_has_errata_a050385);
 #endif
 
 static int __init fm_set_max_frm(char *str)
@@ -762,8 +762,8 @@ static t_LnxWrpFmDev * ReadFmDevTreeNode
             p_LnxWrpFmDev->defPcd = e_NO_PCD;
     }
 
-#ifdef FM_ERRATUM_A010022
-    fm_has_err_a010022 = of_property_read_bool(fm_node, "fsl,erratum-a010022");
+#ifdef FM_ERRATUM_A050385
+    fm_has_err_a050385 = of_property_read_bool(fm_node, "fsl,erratum-a050385");
 #endif
 
     of_node_put(fm_node);