From patchwork Wed Mar 16 14:46:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitkumar Karwar X-Patchwork-Id: 8601421 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 69B2CC0553 for ; Wed, 16 Mar 2016 14:51:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7CF542034B for ; Wed, 16 Mar 2016 14:51:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8B66120212 for ; Wed, 16 Mar 2016 14:51:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966779AbcCPOvZ (ORCPT ); Wed, 16 Mar 2016 10:51:25 -0400 Received: from mx0b-0016f401.pphosted.com ([67.231.156.173]:59906 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964900AbcCPOvY (ORCPT ); Wed, 16 Mar 2016 10:51:24 -0400 Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u2GEg2CN026333 for ; Wed, 16 Mar 2016 07:51:23 -0700 Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0b-0016f401.pphosted.com with ESMTP id 21mkgn4xde-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Wed, 16 Mar 2016 07:51:22 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1104.5; Wed, 16 Mar 2016 07:51:21 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1104.5 via Frontend Transport; Wed, 16 Mar 2016 07:51:21 -0700 Received: from pe-lt101 (unknown [10.31.130.27]) by maili.marvell.com (Postfix) with ESMTP id 25F7F3F703F; Wed, 16 Mar 2016 07:51:20 -0700 (PDT) Received: from pe-lt101 (pe-lt077 [127.0.0.1]) by pe-lt101 (8.14.4/8.14.4) with ESMTP id u2GEkMWH004732; Wed, 16 Mar 2016 07:46:23 -0700 Received: (from root@localhost) by pe-lt101 (8.14.4/8.14.4/Submit) id u2GEkJmr004730; Wed, 16 Mar 2016 07:46:19 -0700 From: Amitkumar Karwar To: CC: Nishant Sarmukadam , Amitkumar Karwar Subject: [PATCH] mwifiex: fix Tx timeout issue during suspend test Date: Wed, 16 Mar 2016 07:46:16 -0700 Message-ID: <1458139576-4702-1-git-send-email-akarwar@marvell.com> X-Mailer: git-send-email 1.7.3.4 MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-03-16_04:, , signatures=0 X-Proofpoint-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1601100000 definitions=main-1603160203 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Call netif_carrier_off/on while stoping/starting netdev queues. This fixes netdev watchdog warning and ->ndo_tx_timeout() invocation during suspend resume stress test. Signed-off-by: Amitkumar Karwar Fixes: 54f008497b9f09f ('mwifiex: Empty Tx queue during suspend') Tested-by: Wei-Ning Huang --- drivers/net/wireless/marvell/mwifiex/cfg80211.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/marvell/mwifiex/cfg80211.c b/drivers/net/wireless/marvell/mwifiex/cfg80211.c index bb7235e..b0663bd 100644 --- a/drivers/net/wireless/marvell/mwifiex/cfg80211.c +++ b/drivers/net/wireless/marvell/mwifiex/cfg80211.c @@ -3272,8 +3272,11 @@ static int mwifiex_cfg80211_suspend(struct wiphy *wiphy, for (i = 0; i < adapter->priv_num; i++) { priv = adapter->priv[i]; - if (priv && priv->netdev) + if (priv && priv->netdev) { mwifiex_stop_net_dev_queue(priv->netdev, adapter); + if (netif_carrier_ok(priv->netdev)) + netif_carrier_off(priv->netdev); + } } for (i = 0; i < retry_num; i++) { @@ -3344,8 +3347,11 @@ static int mwifiex_cfg80211_resume(struct wiphy *wiphy) for (i = 0; i < adapter->priv_num; i++) { priv = adapter->priv[i]; - if (priv && priv->netdev) + if (priv && priv->netdev) { + if (!netif_carrier_ok(priv->netdev)) + netif_carrier_on(priv->netdev); mwifiex_wake_up_net_dev_queue(priv->netdev, adapter); + } } priv = mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_STA);