Received: by 10.213.65.68 with SMTP id h4csp501893imn; Fri, 16 Mar 2018 09:41:21 -0700 (PDT) X-Google-Smtp-Source: AG47ELtvvfBga+K40SVbjppeVm9ZavfTQypNnSa1ZVMpIyEheHJT6AYNCyhUO3QstU2lAXa2jx2W X-Received: by 10.99.180.2 with SMTP id s2mr1932605pgf.26.1521218481382; Fri, 16 Mar 2018 09:41:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521218481; cv=none; d=google.com; s=arc-20160816; b=aLJR5yGXvWUQKnlSmnXhNnzO+PthEWDvyBbuQeAx0WIPoA6UHHu1YUjeHDou2mnzDr wWEePUrY+GsGxFQ4FLOMQyK6TikOBXuiIUdOAN7j3qN2ArPyLJeM3RE3BtvjixUWcjhA qwHoNOXcrWo/LgSOjD9cc5QQ0oa6ovdc2EZ65vOEHbY5ky4s5WU9e99HjOnuI3+Xs+2Z uY8Bp0Qwm/IAfAoZJI2sR27f9NyU2i0agF+/8FNZxAjyRbNpirl0VJ/hVlo6z8n+qa2Y y3rIzfLy8x2AGeQgrtcURLeR+sgm3WNaq8CzM+tzR+wiVoLhV9tJCJLIAB8ojwE4yJM0 6xBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=3Myu2gSD5cxX7eigYUm6cw8pEM7KAVLsGyseoAoj8VY=; b=mOh5L3NC13EIgZLmlTUQIKByo8hSDxU1Vy76UVDLl2jydvHBWEcdkBcpeQaZM7lFTm yiDZN26Nv2iMl2/0o9toO6vgEL3JH3I17HGFKiCN13OV3pjE4nk/+LZdxUBB5Yb2Zptb qR3tVgQDf/XdVJL0wDVrd+w3itAuX9wdwdqpfy80uTjRakbpF+87kzjIUAgOY/zPBQ5C l439B303ouLU+Y2aIp2vKnvRSzYdmt5ooD/ZBx2BzlxCVc7yK/hD3qcLpMa0HPBSKNcd 7xH89UwvDihnllF3Bxa1Fy9qTaA9OTUevIzznkuNjAHVR9vfC3Ucqq1W0kvh0+oYY18z XeHA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x32-v6si6566357pld.591.2018.03.16.09.41.07; Fri, 16 Mar 2018 09:41:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964790AbeCPPgw (ORCPT + 99 others); Fri, 16 Mar 2018 11:36:52 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:40426 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933422AbeCPPgs (ORCPT ); Fri, 16 Mar 2018 11:36:48 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 0723A114D; Fri, 16 Mar 2018 15:36:47 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Emmanuel Grumbach , Luca Coelho , Sasha Levin Subject: [PATCH 4.14 032/109] iwlwifi: mvm: rs: dont override the rate history in the search cycle Date: Fri, 16 Mar 2018 16:23:01 +0100 Message-Id: <20180316152331.715396855@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180316152329.844663293@linuxfoundation.org> References: <20180316152329.844663293@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Emmanuel Grumbach [ Upstream commit 992172e3aec19e5b0ea5b757ba40a146b9282d1e ] When we are in a search cycle, we try different combinations of parameters. Those combinations are called 'columns'. When we switch to a new column, we first need to check if this column has a suitable rate, if not, we can't try it. This means we must not erase the statistics we gathered for the previous column until we are sure that we are indeed switching column. The code that tries to switch to a new column first sets a whole bunch of things for the new column, and only then checks that we can find suitable rates in that column. While doing that, the code mistakenly erased the rate statistics. This code was right until struct iwl_scale_tbl_info grew up for TPC. Fix this to make sure we don't erase the rate statistics until we are sure that we can indeed switch to the new column. Note that this bug is really harmless since it causes a change in the behavior only when we can't find any rate in the new column which should really not happen. In the case we do find a suitable we reset the rate statistics a few lines later anyway. Signed-off-by: Emmanuel Grumbach Signed-off-by: Luca Coelho Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/intel/iwlwifi/mvm/rs.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) --- a/drivers/net/wireless/intel/iwlwifi/mvm/rs.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/rs.c @@ -1881,12 +1881,10 @@ static int rs_switch_to_column(struct iw struct rs_rate *rate = &search_tbl->rate; const struct rs_tx_column *column = &rs_tx_columns[col_id]; const struct rs_tx_column *curr_column = &rs_tx_columns[tbl->column]; - u32 sz = (sizeof(struct iwl_scale_tbl_info) - - (sizeof(struct iwl_rate_scale_data) * IWL_RATE_COUNT)); unsigned long rate_mask = 0; u32 rate_idx = 0; - memcpy(search_tbl, tbl, sz); + memcpy(search_tbl, tbl, offsetof(struct iwl_scale_tbl_info, win)); rate->sgi = column->sgi; rate->ant = column->ant;