Received: by 10.213.65.68 with SMTP id h4csp481493imn; Fri, 16 Mar 2018 09:04:26 -0700 (PDT) X-Google-Smtp-Source: AG47ELtc0toZPvRwgk6dfgFE5iosFLfsuUqgu8Zp9Kyvvob+d3oLwW1ZzuRQp/2zLruGLml/da1q X-Received: by 2002:a17:902:ab84:: with SMTP id f4-v6mr2760925plr.239.1521216266146; Fri, 16 Mar 2018 09:04:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521216266; cv=none; d=google.com; s=arc-20160816; b=rYFv6+7sLShq7zOjFg2OfxIPVsi0v95MeKEZjEfHEIrsLj6Wdz1hJRFjG49OjZiG0O zrSGsZRnf6kYFj5e9V71FCeTr1qq8M/8FGwBocXCUBoUp0q5+xEGnJAO8zJYGATkxHYm NoaQXJ8g5+3LiVn993Nr27o0wPi6EPAcK+E7+mBLJ3W/ej/c0J1STIxM7SNe1UPdnFmp DJaFchVxhQJ2k2bz632gOQ9zZNB07GxmfDaVeKIBS1mzsvoRXY/L94J+ra/uiiUFB7Fs vvBGvSkTlnoiQeU+YeGO7JStF8sYPbKP8YT4E9jZjB/OHuh10aIzuulf4dK/jvxzVQT6 IffQ== 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=XE5fxlOMUT/e3RwWL2Kl4waJALACxSkT7AM+C6HEcE0=; b=xUY21b0oQ+PNb3xIB74x8nhmo3eHhn+9hklLAGG34jmtbFUnKZVdbVHLhJaZ6E9mAX n4uCpdCAlnig4pX7wk+tnkbXrXDapoOY9coB3d19bW5H0jvygEUaaTxlVVE0B/ybIIpY HKvQ2oWEizAXuL7bu08j6Ob9arJKv4O3B9AnDC5MPxXnJsVLrGUCoH6+/0+sIG9POUXT TRgC9aTPPrr54sYqm3QQ1AqigYchDIXfaAMhu1i9LdLyyXn2nwyE6nxpm4DNRW9UdATa RcSNangjZZMfHmrB4Zl242ZADasemvvA7fT+dCrsohIHt00L8xGWqprKGmbAUoMCBRoU 3+jQ== 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 f13si5019403pgo.250.2018.03.16.09.04.09; Fri, 16 Mar 2018 09:04:26 -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 S934550AbeCPQBB (ORCPT + 99 others); Fri, 16 Mar 2018 12:01:01 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:44630 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965058AbeCPPmy (ORCPT ); Fri, 16 Mar 2018 11:42:54 -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 66B5710B0; Fri, 16 Mar 2018 15:42:53 +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.15 037/128] iwlwifi: mvm: rs: dont override the rate history in the search cycle Date: Fri, 16 Mar 2018 16:22:58 +0100 Message-Id: <20180316152338.528397221@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180316152336.199007505@linuxfoundation.org> References: <20180316152336.199007505@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.15-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 @@ -1877,12 +1877,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;