Skip to content

Commit 0c98b8b

Browse files
committed
Merge branch 'net-ipa-minor-bug-fixes'
Alex Elder says: ==================== net: ipa: minor bug fixes The four patches in this series fix some errors, though none of them cause any compile or runtime problems. The first changes the files included by "drivers/net/ipa/reg.h" to ensure everything it requires is included with the file. It also stops unnecessarily including another file. The prerequisites are apparently satisfied other ways, currently. The second adds two struct declarations to "gsi_reg.h", to ensure they're declared before they're used later in the file. Again, it seems these declarations are currently resolved wherever this file is included. The third removes register definitions that were added for IPA v5.0 that are not needed. And the last updates some validity checks for IPA v5.0 registers. No IPA v5.0 platforms are yet supported, so the issues resolved here were never harmful. Versions 2 and 3 of this series change the "Fixes" tags in patches so they supply legitimate commit hashes. ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 769639c + 21e8aac commit 0c98b8b

File tree

5 files changed

+38
-27
lines changed

5 files changed

+38
-27
lines changed

drivers/net/ipa/gsi_reg.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ static bool gsi_reg_id_valid(struct gsi *gsi, enum gsi_reg_id reg_id)
1515
switch (reg_id) {
1616
case INTER_EE_SRC_CH_IRQ_MSK:
1717
case INTER_EE_SRC_EV_CH_IRQ_MSK:
18+
return gsi->version >= IPA_VERSION_3_5;
19+
20+
case HW_PARAM_2:
21+
return gsi->version >= IPA_VERSION_3_5_1;
22+
23+
case HW_PARAM_4:
24+
return gsi->version >= IPA_VERSION_5_0;
25+
1826
case CH_C_CNTXT_0:
1927
case CH_C_CNTXT_1:
2028
case CH_C_CNTXT_2:
@@ -43,7 +51,6 @@ static bool gsi_reg_id_valid(struct gsi *gsi, enum gsi_reg_id reg_id)
4351
case CH_CMD:
4452
case EV_CH_CMD:
4553
case GENERIC_CMD:
46-
case HW_PARAM_2:
4754
case CNTXT_TYPE_IRQ:
4855
case CNTXT_TYPE_IRQ_MSK:
4956
case CNTXT_SRC_CH_IRQ:

drivers/net/ipa/gsi_reg.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010

1111
#include <linux/bits.h>
1212

13+
struct platform_device;
14+
15+
struct gsi;
16+
1317
/**
1418
* DOC: GSI Registers
1519
*

drivers/net/ipa/ipa_reg.c

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: GPL-2.0
22

33
/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
4-
* Copyright (C) 2019-2022 Linaro Ltd.
4+
* Copyright (C) 2019-2023 Linaro Ltd.
55
*/
66

77
#include <linux/io.h>
@@ -15,6 +15,17 @@ static bool ipa_reg_id_valid(struct ipa *ipa, enum ipa_reg_id reg_id)
1515
enum ipa_version version = ipa->version;
1616

1717
switch (reg_id) {
18+
case FILT_ROUT_HASH_EN:
19+
return version == IPA_VERSION_4_2;
20+
21+
case FILT_ROUT_HASH_FLUSH:
22+
return version < IPA_VERSION_5_0 && version != IPA_VERSION_4_2;
23+
24+
case FILT_ROUT_CACHE_FLUSH:
25+
case ENDP_FILTER_CACHE_CFG:
26+
case ENDP_ROUTER_CACHE_CFG:
27+
return version >= IPA_VERSION_5_0;
28+
1829
case IPA_BCR:
1930
case COUNTER_CFG:
2031
return version < IPA_VERSION_4_5;
@@ -32,14 +43,17 @@ static bool ipa_reg_id_valid(struct ipa *ipa, enum ipa_reg_id reg_id)
3243
case SRC_RSRC_GRP_45_RSRC_TYPE:
3344
case DST_RSRC_GRP_45_RSRC_TYPE:
3445
return version <= IPA_VERSION_3_1 ||
35-
version == IPA_VERSION_4_5;
46+
version == IPA_VERSION_4_5 ||
47+
version == IPA_VERSION_5_0;
3648

3749
case SRC_RSRC_GRP_67_RSRC_TYPE:
3850
case DST_RSRC_GRP_67_RSRC_TYPE:
39-
return version <= IPA_VERSION_3_1;
51+
return version <= IPA_VERSION_3_1 ||
52+
version == IPA_VERSION_5_0;
4053

4154
case ENDP_FILTER_ROUTER_HSH_CFG:
42-
return version != IPA_VERSION_4_2;
55+
return version < IPA_VERSION_5_0 &&
56+
version != IPA_VERSION_4_2;
4357

4458
case IRQ_SUSPEND_EN:
4559
case IRQ_SUSPEND_CLR:
@@ -51,10 +65,6 @@ static bool ipa_reg_id_valid(struct ipa *ipa, enum ipa_reg_id reg_id)
5165
case SHARED_MEM_SIZE:
5266
case QSB_MAX_WRITES:
5367
case QSB_MAX_READS:
54-
case FILT_ROUT_HASH_EN:
55-
case FILT_ROUT_CACHE_CFG:
56-
case FILT_ROUT_HASH_FLUSH:
57-
case FILT_ROUT_CACHE_FLUSH:
5868
case STATE_AGGR_ACTIVE:
5969
case LOCAL_PKT_PROC_CNTXT:
6070
case AGGR_FORCE_CLOSE:
@@ -76,8 +86,6 @@ static bool ipa_reg_id_valid(struct ipa *ipa, enum ipa_reg_id reg_id)
7686
case ENDP_INIT_RSRC_GRP:
7787
case ENDP_INIT_SEQ:
7888
case ENDP_STATUS:
79-
case ENDP_FILTER_CACHE_CFG:
80-
case ENDP_ROUTER_CACHE_CFG:
8189
case IPA_IRQ_STTS:
8290
case IPA_IRQ_EN:
8391
case IPA_IRQ_CLR:

drivers/net/ipa/ipa_reg.h

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,8 @@ enum ipa_reg_id {
6060
SHARED_MEM_SIZE,
6161
QSB_MAX_WRITES,
6262
QSB_MAX_READS,
63-
FILT_ROUT_HASH_EN, /* Not IPA v5.0+ */
64-
FILT_ROUT_CACHE_CFG, /* IPA v5.0+ */
65-
FILT_ROUT_HASH_FLUSH, /* Not IPA v5.0+ */
63+
FILT_ROUT_HASH_EN, /* IPA v4.2 */
64+
FILT_ROUT_HASH_FLUSH, /* Not IPA v4.2 nor IPA v5.0+ */
6665
FILT_ROUT_CACHE_FLUSH, /* IPA v5.0+ */
6766
STATE_AGGR_ACTIVE,
6867
IPA_BCR, /* Not IPA v4.5+ */
@@ -77,12 +76,12 @@ enum ipa_reg_id {
7776
TIMERS_PULSE_GRAN_CFG, /* IPA v4.5+ */
7877
SRC_RSRC_GRP_01_RSRC_TYPE,
7978
SRC_RSRC_GRP_23_RSRC_TYPE,
80-
SRC_RSRC_GRP_45_RSRC_TYPE, /* Not IPA v3.5+, IPA v4.5 */
81-
SRC_RSRC_GRP_67_RSRC_TYPE, /* Not IPA v3.5+ */
79+
SRC_RSRC_GRP_45_RSRC_TYPE, /* Not IPA v3.5+; IPA v4.5, IPA v5.0 */
80+
SRC_RSRC_GRP_67_RSRC_TYPE, /* Not IPA v3.5+; IPA v5.0 */
8281
DST_RSRC_GRP_01_RSRC_TYPE,
8382
DST_RSRC_GRP_23_RSRC_TYPE,
84-
DST_RSRC_GRP_45_RSRC_TYPE, /* Not IPA v3.5+, IPA v4.5 */
85-
DST_RSRC_GRP_67_RSRC_TYPE, /* Not IPA v3.5+ */
83+
DST_RSRC_GRP_45_RSRC_TYPE, /* Not IPA v3.5+; IPA v4.5, IPA v5.0 */
84+
DST_RSRC_GRP_67_RSRC_TYPE, /* Not IPA v3.5+; IPA v5.0 */
8685
ENDP_INIT_CTRL, /* Not IPA v4.2+ for TX, not IPA v4.0+ for RX */
8786
ENDP_INIT_CFG,
8887
ENDP_INIT_NAT, /* TX only */
@@ -206,14 +205,6 @@ enum ipa_reg_qsb_max_reads_field_id {
206205
GEN_QMB_1_MAX_READS_BEATS, /* IPA v4.0+ */
207206
};
208207

209-
/* FILT_ROUT_CACHE_CFG register */
210-
enum ipa_reg_filt_rout_cache_cfg_field_id {
211-
ROUTER_CACHE_EN,
212-
FILTER_CACHE_EN,
213-
LOW_PRI_HASH_HIT_DISABLE,
214-
LRU_EVICTION_THRESHOLD,
215-
};
216-
217208
/* FILT_ROUT_HASH_EN and FILT_ROUT_HASH_FLUSH registers */
218209
enum ipa_reg_filt_rout_hash_field_id {
219210
IPV6_ROUTER_HASH,

drivers/net/ipa/reg.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
#define _REG_H_
77

88
#include <linux/types.h>
9-
#include <linux/bits.h>
9+
#include <linux/log2.h>
10+
#include <linux/bug.h>
1011

1112
/**
1213
* struct reg - A register descriptor

0 commit comments

Comments
 (0)