Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: ipa: generic command param fix

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>

authored by

Alex Elder and committed by
David S. Miller
2df181f0 47400aae

+2 -2
+2 -1
drivers/net/ipa/gsi.c
··· 1666 1666 val = u32_encode_bits(opcode, GENERIC_OPCODE_FMASK); 1667 1667 val |= u32_encode_bits(channel_id, GENERIC_CHID_FMASK); 1668 1668 val |= u32_encode_bits(GSI_EE_MODEM, GENERIC_EE_FMASK); 1669 - val |= u32_encode_bits(params, GENERIC_PARAMS_FMASK); 1669 + if (gsi->version >= IPA_VERSION_4_11) 1670 + val |= u32_encode_bits(params, GENERIC_PARAMS_FMASK); 1670 1671 1671 1672 timeout = !gsi_command(gsi, GSI_GENERIC_CMD_OFFSET, val); 1672 1673
-1
drivers/net/ipa/gsi_reg.h
··· 372 372 #define GSI_ERROR_LOG_OFFSET \ 373 373 (0x0001f200 + 0x4000 * GSI_EE_AP) 374 374 375 - /* Fields below are present for IPA v3.5.1 and above */ 376 375 #define ERR_ARG3_FMASK GENMASK(3, 0) 377 376 #define ERR_ARG2_FMASK GENMASK(7, 4) 378 377 #define ERR_ARG1_FMASK GENMASK(11, 8)