Received: by 10.223.185.116 with SMTP id b49csp5966470wrg; Wed, 7 Mar 2018 22:50:42 -0800 (PST) X-Google-Smtp-Source: AG47ELtyQwhlvB6TmPKIxSAlw7U+RL37UfTt5RHXLrmRzfcv5pxPUxha+j1dj0veKU1gQWchxjDW X-Received: by 2002:a17:902:b212:: with SMTP id t18-v6mr22119893plr.17.1520491841949; Wed, 07 Mar 2018 22:50:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520491841; cv=none; d=google.com; s=arc-20160816; b=cnAenFO6KiwEmGS4oyjhBMD4HzkM41zTZMiPq4m83Gj9R4vQ9WHppo1ZkqDJQ3ELp4 18W8uhxJvPvAR39yU0KU+wYSJcrm+Of7XaeLmmrvLWCAqskPpIIzXhLeaOO6jDd4ZQWo X4PLyGkee3E1aky4crG+prBdAYNHO82UnrgtpAoXh3YUv9wU5YckASjxwEIsbtz7Wlr9 ffo9ogW5N1VEj537NSCcYmNBgkK0pz9o4CWG/pKybmxDa0Kc0YVfNMw2NxIOpGOMQTtR dzP5SFipN46Lj+VNs8vipvlGS1RoNldCmry2HCGYzbzcv7+Th50TICTiJXpdO1DgbKeI gyoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=4XyhLIRy9Q7rwJkEU3/7sb3exSf9cM8mDZXNFdRpwD4=; b=Zc69d18EF88zItJHHhAU1wvbdINh0dvLVLVRkPN9X4TpHdPHPf0uCP0rYQth5L9DUq BLceaBzi6htPR6smVRTEbcuq71unHZIO+A4TUBs/ut8muVaE+LP35Qnih9YL9sodTUhO 5FkDLIG2oCN1lq2i7ksVHSepzUHIsihqG6xWDiN33ScUpq+XmoNvXXVakU61rhyeHMAu koa3S3JRMy926HHqRAEgKUaiebTu1u9ilVBDpxGIuTdVLHzseW4t/jHflmqYgFoT/LQM klxbGOCZn28avGQnFAdrG1jQJ8TkiPAAltFhlpWLl+mvOarnXKj3kyaAeE4+Q5gtfIKs gr8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=B18d5SYz; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 4-v6si14332154plb.646.2018.03.07.22.50.27; Wed, 07 Mar 2018 22:50:41 -0800 (PST) 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; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=B18d5SYz; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965273AbeCHGtX (ORCPT + 99 others); Thu, 8 Mar 2018 01:49:23 -0500 Received: from mail-sn1nam01on0120.outbound.protection.outlook.com ([104.47.32.120]:33969 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965075AbeCHE6P (ORCPT ); Wed, 7 Mar 2018 23:58:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=4XyhLIRy9Q7rwJkEU3/7sb3exSf9cM8mDZXNFdRpwD4=; b=B18d5SYzxi8ZvibFYEUCZ8EI0OiIlhuo9NUrOKrBDjmnNNSB325KxQNtCctADJf9WgvnneV1goHCpf9BclmvvC/j8RNIF5MrBtlW5LncDb5v4n2fDIaBa29Ydi0uHyFHQAQ2NoUDKRqvRNHgh/cyc4EycPW5HNIAvrfLjorQQlI= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0888.namprd21.prod.outlook.com (52.132.132.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.588.3; Thu, 8 Mar 2018 04:58:10 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8063:c68a:b210:7446]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8063:c68a:b210:7446%2]) with mapi id 15.20.0588.008; Thu, 8 Mar 2018 04:58:10 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Tsang-Shian Lin , Ping-Ke Shih , Larry Finger , Yan-Hsuan Chuang , Birming Chiu , Shaofu , Steven Ting , Kalle Valo , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 14/67] rtlwifi: rtl_pci: Fix the bug when inactiveps is enabled. Thread-Topic: [PATCH AUTOSEL for 4.14 14/67] rtlwifi: rtl_pci: Fix the bug when inactiveps is enabled. Thread-Index: AQHTtpn60EU5v5Tz8UWACyiHGylgeA== Date: Thu, 8 Mar 2018 04:57:37 +0000 Message-ID: <20180308045641.7814-14-alexander.levin@microsoft.com> References: <20180308045641.7814-1-alexander.levin@microsoft.com> In-Reply-To: <20180308045641.7814-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB0888;7:QsPppAPq2YnLP9wx6Wk3f58+mNqUwlPEVglbJwY+CBXwbaWQF/3GV1Y8m+Y46TtvEjeHkIxRULLV7vKjLbQR0siBTdOIKrjKbqaAPy0SB5XERFjKAPY12gcR8fPJCc1uRyT7dvZtQWivKsE0831Pkh3zvlvzDl6koL6M0MXkPrtFt+tXmF+5KsAzaojtZcW6bqN+31do0xejjvIjfHkmkiw+A++ej1lC5yHay7i7IUuNiXtJcsSrCbtharPLXvDp;20:SOMcA4/97K2YYC8vMXf4mBXfuUJwkRGNLe82vkjBgAzUJ6zR+Mt3WqoFXGezjFDunzGoDaexUNhvaCHqajpgO/MS6pdppq29bcN8LS8oo+h5As3YZK+Vo7FvfNgF6INRLUc31ND8rR3ZGY5Eo7tMkc6YyXkSmuTDdqsPg8z4JLs= x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 4bf6461d-04ac-43d9-9b4e-08d584b130fe x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB0888; x-ms-traffictypediagnostic: DM5PR2101MB0888: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040501)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231220)(944501244)(52105095)(10201501046)(3002001)(6055026)(61426038)(61427038)(6041288)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(6072148)(201708071742011);SRVR:DM5PR2101MB0888;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0888; x-forefront-prvs: 060503E79B x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39860400002)(366004)(346002)(376002)(39380400002)(396003)(189003)(199004)(6116002)(99286004)(2950100002)(6512007)(6666003)(10290500003)(7416002)(36756003)(5660300001)(106356001)(1076002)(22452003)(3846002)(97736004)(316002)(53936002)(68736007)(105586002)(4326008)(25786009)(54906003)(478600001)(2501003)(186003)(66066001)(76176011)(3280700002)(86362001)(575784001)(14454004)(2900100001)(5250100002)(110136005)(305945005)(7736002)(72206003)(3660700001)(6436002)(2906002)(26005)(6486002)(10090500001)(8676002)(81156014)(107886003)(81166006)(86612001)(6506007)(59450400001)(8936002)(102836004)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0888;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 68gBqouG02TocGiKdj3eEH8rDXiewW3QsYKbU7JNEP+sKf3WmAuVRD5TplpUYPcF8f5C+kR+eneya5Q8kY3RiukbUjJ0gTIFan6p7O+MmHgJ1lN1O+2/rAzJ3IL+43yxr9/yucQy+9REpTmMiykKL/eA44LBMbbY1mFIXau6ScX8NJF7CIvV/OaykGXqexuBBB4hEwyc0kt37u9i6YblquYpqwdUeJqyxecu0b7oa2GBCtJa618RRcsJ9grx6+U1EaKCFUpPzcoMDxtuNulYOnfMwn/X33F0IaeO8lM+C16YzUU4cRhLUs670ca0syHqeW0pGELbFVB8vaELTGzOAQ== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4bf6461d-04ac-43d9-9b4e-08d584b130fe X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Mar 2018 04:57:37.6741 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0888 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tsang-Shian Lin [ Upstream commit b7573a0a27bfa8270dea9b145448f6884b7cacc1 ] Reset the driver current tx read/write index to zero when inactiveps nic out of sync with HW state. Wrong driver tx read/write index will cause Tx fail. Signed-off-by: Tsang-Shian Lin Signed-off-by: Ping-Ke Shih Signed-off-by: Larry Finger Cc: Yan-Hsuan Chuang Cc: Birming Chiu Cc: Shaofu Cc: Steven Ting Signed-off-by: Kalle Valo Signed-off-by: Sasha Levin --- drivers/net/wireless/realtek/rtlwifi/pci.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/wireless/realtek/rtlwifi/pci.c b/drivers/net/wirel= ess/realtek/rtlwifi/pci.c index 08dc8919ef60..d7331225c5f3 100644 --- a/drivers/net/wireless/realtek/rtlwifi/pci.c +++ b/drivers/net/wireless/realtek/rtlwifi/pci.c @@ -1568,7 +1568,14 @@ int rtl_pci_reset_trx_ring(struct ieee80211_hw *hw) dev_kfree_skb_irq(skb); ring->idx =3D (ring->idx + 1) % ring->entries; } + + if (rtlpriv->use_new_trx_flow) { + rtlpci->tx_ring[i].cur_tx_rp =3D 0; + rtlpci->tx_ring[i].cur_tx_wp =3D 0; + } + ring->idx =3D 0; + ring->entries =3D rtlpci->txringcount[i]; } } spin_unlock_irqrestore(&rtlpriv->locks.irq_th_lock, flags); --=20 2.14.1