From patchwork Wed Aug 30 19:51:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ganapathi Bhat X-Patchwork-Id: 9930711 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6B7B06032A for ; Wed, 30 Aug 2017 19:57:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5DA8828700 for ; Wed, 30 Aug 2017 19:57:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 509B02875F; Wed, 30 Aug 2017 19:57:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D03F828700 for ; Wed, 30 Aug 2017 19:57:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751358AbdH3T5B (ORCPT ); Wed, 30 Aug 2017 15:57:01 -0400 Received: from mx0a-0016f401.pphosted.com ([67.231.148.174]:53938 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750860AbdH3T5A (ORCPT ); Wed, 30 Aug 2017 15:57:00 -0400 Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v7UJt8rG008298 for ; Wed, 30 Aug 2017 12:57:00 -0700 Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0a-0016f401.pphosted.com with ESMTP id 2cnty0kt1f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Wed, 30 Aug 2017 12:57:00 -0700 Received: from SC-EXCH02.marvell.com (10.93.176.82) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Wed, 30 Aug 2017 12:56:58 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server id 15.0.1210.3 via Frontend Transport; Wed, 30 Aug 2017 12:56:58 -0700 Received: from localhost (unknown [10.31.130.81]) by maili.marvell.com (Postfix) with ESMTP id 8EFC53F703F; Wed, 30 Aug 2017 12:56:58 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by localhost (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id v7UJsO1N003431; Thu, 31 Aug 2017 01:24:24 +0530 Received: (from root@localhost) by localhost (8.14.4/8.14.4/Submit) id v7UJsOFT003429; Thu, 31 Aug 2017 01:24:24 +0530 From: Ganapathi Bhat To: CC: Cathy Luo , Xinming Hu , Zhiyuan Yang , James Cao , Mangesh Malusare , Ganapathi Bhat Subject: [PATCH 2/2] mwifiex: print URB submit failure error after threshold attemtps Date: Thu, 31 Aug 2017 01:21:14 +0530 Message-ID: <1504122674-3379-3-git-send-email-gbhat@marvell.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1504122674-3379-1-git-send-email-gbhat@marvell.com> References: <1504122674-3379-1-git-send-email-gbhat@marvell.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-08-30_08:, , signatures=0 X-Proofpoint-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1708300303 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Current driver prints dev_alloc_skb failures everytime while submitting RX URBs. This failure might be frequent in some low resource platforms. So, wait for a threshold failure count before start priting the error. This change is a follow up for the 'commit 7b368e3d15c3 ("mwifiex: resubmit failed to submit RX URBs in main thread")' Signed-off-by: Cathy Luo Signed-off-by: Ganapathi Bhat --- drivers/net/wireless/marvell/mwifiex/usb.c | 11 +++++++++-- drivers/net/wireless/marvell/mwifiex/usb.h | 2 ++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/marvell/mwifiex/usb.c b/drivers/net/wireless/marvell/mwifiex/usb.c index f4f2b9b..98f6973 100644 --- a/drivers/net/wireless/marvell/mwifiex/usb.c +++ b/drivers/net/wireless/marvell/mwifiex/usb.c @@ -300,9 +300,16 @@ static int mwifiex_usb_submit_rx_urb(struct urb_context *ctx, int size) if (card->rx_cmd_ep != ctx->ep) { ctx->skb = dev_alloc_skb(size); if (!ctx->skb) { - mwifiex_dbg(adapter, ERROR, - "%s: dev_alloc_skb failed\n", __func__); + if (++card->rx_urb_failure_count > + MWIFIEX_RX_URB_FAILURE_THRESHOLD) { + mwifiex_dbg(adapter, ERROR, + "%s: dev_alloc_skb failed, failure count = %u\n", + __func__, + card->rx_urb_failure_count); + } return -ENOMEM; + } else { + card->rx_urb_failure_count = 0; } } diff --git a/drivers/net/wireless/marvell/mwifiex/usb.h b/drivers/net/wireless/marvell/mwifiex/usb.h index 37abd22..dc4750b 100644 --- a/drivers/net/wireless/marvell/mwifiex/usb.h +++ b/drivers/net/wireless/marvell/mwifiex/usb.h @@ -43,6 +43,7 @@ #define MWIFIEX_TX_DATA_URB 6 #define MWIFIEX_RX_DATA_URB 6 #define MWIFIEX_USB_TIMEOUT 100 +#define MWIFIEX_RX_URB_FAILURE_THRESHOLD 20 #define USB8766_DEFAULT_FW_NAME "mrvl/usb8766_uapsta.bin" #define USB8797_DEFAULT_FW_NAME "mrvl/usb8797_uapsta.bin" @@ -117,6 +118,7 @@ struct usb_card_rec { u8 rx_cmd_interval; int tx_cmd_ep_type; u8 tx_cmd_interval; + u32 rx_urb_failure_count; }; struct fw_header {