lkml.org 
[lkml]   [2021]   [Mar]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.11 091/775] iwlwifi: mvm: send stored PPAG command instead of local
    Date
    From: Luca Coelho <luciano.coelho@intel.com>

    [ Upstream commit 659844d391826bfc5c8b4d9a06869ed51d859c76 ]

    Some change conflicts apparently cause a confusion between a local
    variable being used to send the PPAG command and the introduction of a
    union for this command. Most parts of the local command were never
    copied from the stored data, so the FW was getting garbage in the
    tables instead of getting valid values.

    Fix this by completely removing the local and using only the union
    that we have stored in fwrt.

    Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
    Fixes: f2134f66f40e ("iwlwifi: acpi: support ppag table command v2")
    Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
    Link: https://lore.kernel.org/r/iwlwifi.20210210135352.d090e0301023.I7d57f4d7da9a3297734c51cf988199323c76916d@changeid
    Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 9 +++------
    1 file changed, 3 insertions(+), 6 deletions(-)

    diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
    index 4d527409428d3..045765fa67bea 100644
    --- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
    +++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
    @@ -990,7 +990,6 @@ int iwl_mvm_ppag_send_cmd(struct iwl_mvm *mvm)
    {
    u8 cmd_ver;
    int i, j, ret, num_sub_bands, cmd_size;
    - union iwl_ppag_table_cmd ppag_table;
    s8 *gain;

    if (!fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_SET_PPAG)) {
    @@ -1003,15 +1002,13 @@ int iwl_mvm_ppag_send_cmd(struct iwl_mvm *mvm)
    return 0;
    }

    - ppag_table.v1.enabled = mvm->fwrt.ppag_table.v1.enabled;
    -
    cmd_ver = iwl_fw_lookup_cmd_ver(mvm->fw, PHY_OPS_GROUP,
    PER_PLATFORM_ANT_GAIN_CMD,
    IWL_FW_CMD_VER_UNKNOWN);
    if (cmd_ver == 1) {
    num_sub_bands = IWL_NUM_SUB_BANDS;
    gain = mvm->fwrt.ppag_table.v1.gain[0];
    - cmd_size = sizeof(ppag_table.v1);
    + cmd_size = sizeof(mvm->fwrt.ppag_table.v1);
    if (mvm->fwrt.ppag_ver == 2) {
    IWL_DEBUG_RADIO(mvm,
    "PPAG table is v2 but FW supports v1, sending truncated table\n");
    @@ -1019,7 +1016,7 @@ int iwl_mvm_ppag_send_cmd(struct iwl_mvm *mvm)
    } else if (cmd_ver == 2) {
    num_sub_bands = IWL_NUM_SUB_BANDS_V2;
    gain = mvm->fwrt.ppag_table.v2.gain[0];
    - cmd_size = sizeof(ppag_table.v2);
    + cmd_size = sizeof(mvm->fwrt.ppag_table.v2);
    if (mvm->fwrt.ppag_ver == 1) {
    IWL_DEBUG_RADIO(mvm,
    "PPAG table is v1 but FW supports v2, sending padded table\n");
    @@ -1039,7 +1036,7 @@ int iwl_mvm_ppag_send_cmd(struct iwl_mvm *mvm)
    IWL_DEBUG_RADIO(mvm, "Sending PER_PLATFORM_ANT_GAIN_CMD\n");
    ret = iwl_mvm_send_cmd_pdu(mvm, WIDE_ID(PHY_OPS_GROUP,
    PER_PLATFORM_ANT_GAIN_CMD),
    - 0, cmd_size, &ppag_table);
    + 0, cmd_size, &mvm->fwrt.ppag_table);
    if (ret < 0)
    IWL_ERR(mvm, "failed to send PER_PLATFORM_ANT_GAIN_CMD (%d)\n",
    ret);
    --
    2.27.0


    \
     
     \ /
      Last update: 2021-03-02 04:10    [W:2.305 / U:0.288 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site