]> git.itanic.dy.fi Git - linux-stable/commitdiff
net: ipa: avoid setting an undefined field
authorAlex Elder <elder@linaro.org>
Wed, 15 Feb 2023 19:53:50 +0000 (13:53 -0600)
committerPaolo Abeni <pabeni@redhat.com>
Mon, 20 Feb 2023 07:14:20 +0000 (08:14 +0100)
The GSI channel protocol field in the CH_C_CNTXT_0 GSI register is
widened starting IPA v5.0, making the CHTYPE_PROTOCOL_MSB field
added in IPA v4.5 unnecessary.  Update the code to reflect this.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ipa/gsi.c
drivers/net/ipa/gsi_reg.h

index 0e6f679f71a8c80ca1f686b03f993d292973590c..88279956194a98e1e639cc5911ccafb86b585bdf 100644 (file)
@@ -185,7 +185,7 @@ static u32 ch_c_cntxt_0_type_encode(enum ipa_version version,
        u32 val;
 
        val = reg_encode(reg, CHTYPE_PROTOCOL, type);
-       if (version < IPA_VERSION_4_5)
+       if (version < IPA_VERSION_4_5 || version >= IPA_VERSION_5_0)
                return val;
 
        type >>= hweight32(reg_fmask(reg, CHTYPE_PROTOCOL));
index a0b7ff0dcdfda409140d4058c0183af53a7e929c..52520cd44c3e17b719481edbf16bcd4ccd0e35d6 100644 (file)
@@ -101,7 +101,7 @@ enum gsi_reg_ch_c_cntxt_0_field_id {
        CHTYPE_DIR,
        CH_EE,
        CHID,
-       CHTYPE_PROTOCOL_MSB,                            /* IPA v4.9+ */
+       CHTYPE_PROTOCOL_MSB,                            /* IPA v4.5-4.11 */
        ERINDEX,
        CHSTATE,
        ELEMENT_SIZE,