]> git.itanic.dy.fi Git - linux-stable/commitdiff
net: ipa: generic command param fix
authorAlex Elder <elder@linaro.org>
Wed, 8 Feb 2023 20:56:45 +0000 (14:56 -0600)
committerDavid S. Miller <davem@davemloft.net>
Fri, 10 Feb 2023 08:06:31 +0000 (08:06 +0000)
Starting at IPA v4.11, the GSI_GENERIC_COMMAND GSI register got a
new PARAMS field.  The code that encodes a value into that field
sets it unconditionally, which is wrong.

We currently only provide 0 as the field's value, so this error has
no real effect.  Still, it's a bug, so let's fix it.

Fix an (unrelated) incorrect comment as well.  Fields in the
ERROR_LOG GSI register actually *are* defined for IPA versions
prior to v3.5.1.

Fixes: fe68c43ce388 ("net: ipa: support enhanced channel flow control")
Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ipa/gsi.c
drivers/net/ipa/gsi_reg.h

index bea2da1c4c51d302f0fb86c2bd247621b2ac1d6f..f1a393829486632f4338f8a5e3c3f6026a0f4b6b 100644 (file)
@@ -1666,7 +1666,8 @@ static int gsi_generic_command(struct gsi *gsi, u32 channel_id,
        val = u32_encode_bits(opcode, GENERIC_OPCODE_FMASK);
        val |= u32_encode_bits(channel_id, GENERIC_CHID_FMASK);
        val |= u32_encode_bits(GSI_EE_MODEM, GENERIC_EE_FMASK);
-       val |= u32_encode_bits(params, GENERIC_PARAMS_FMASK);
+       if (gsi->version >= IPA_VERSION_4_11)
+               val |= u32_encode_bits(params, GENERIC_PARAMS_FMASK);
 
        timeout = !gsi_command(gsi, GSI_GENERIC_CMD_OFFSET, val);
 
index 3763359f208f7cba4d33593619e7c69d123262f4..e65f2f055cffffcbbdbec26a0afd23627bb1678c 100644 (file)
@@ -372,7 +372,6 @@ enum gsi_general_id {
 #define GSI_ERROR_LOG_OFFSET \
                        (0x0001f200 + 0x4000 * GSI_EE_AP)
 
-/* Fields below are present for IPA v3.5.1 and above */
 #define ERR_ARG3_FMASK                 GENMASK(3, 0)
 #define ERR_ARG2_FMASK                 GENMASK(7, 4)
 #define ERR_ARG1_FMASK                 GENMASK(11, 8)