From patchwork Mon Oct 31 08:02:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xinming Hu X-Patchwork-Id: 9405133 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 EEDD46022E for ; Mon, 31 Oct 2016 08:03:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E06E629217 for ; Mon, 31 Oct 2016 08:03:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D51E929230; Mon, 31 Oct 2016 08:03:05 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, 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 8E50C29217 for ; Mon, 31 Oct 2016 08:03:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762002AbcJaIDE (ORCPT ); Mon, 31 Oct 2016 04:03:04 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:34879 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761936AbcJaIC6 (ORCPT ); Mon, 31 Oct 2016 04:02:58 -0400 Received: by mail-pf0-f195.google.com with SMTP id s8so8097819pfj.2 for ; Mon, 31 Oct 2016 01:02:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=r0Ci791aEwEdtMkUGvb2HAFG4nUnugamAPKaHAb3CQ8=; b=T2+/GU0ppEmvpcau8ltotk1OHLj75LWoPBS5hzRluR2aQ6wyoHdDZ6YIoMmGP9jPN+ MpX7yNkxV1yimqOKZg5bRJbPF1KtBcFQEhZPWnoIt4yZAgbbuTOSEPfY2BxRFbhrpn0c O976WJQrPlpjJ0tnabdYOENTqTtvusIN5EQOiQtwGh0E8DW3y+YRFKbyBTwVkbNgCxhr 5/kZfd3m+KtDnFU7SyDKt13UoqX7F42lgXPPRY9W0j84J/KZSF78RtaE7pkWSkmnfIKI vXoap5eRGgle9QEMOya21eW17/0Bvw1AyvwIGlK5qvIDUhq63Equk9WJe0600nmtCciR iLEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=r0Ci791aEwEdtMkUGvb2HAFG4nUnugamAPKaHAb3CQ8=; b=Asfh2vRTEy6LpzuwMlgud36xDdjY948S9gOuKs/8FHq6VGzGPWDj3TPkN/5xFwPQgz gNEi3rcWLYls8quKVpZ/o8LY/PhrL7S/4vzwWWsSV6KaWg6Ln4DpKVupvCCToEGjesw4 u53Nr9PsPjHGAiaWTUK5rvw7MoB/lC1ujFxtaAUo/Vykcp969GvMXX+3lrlG/MgQ3zZ/ OyEab9uIiElIeonQf9G26fp8DuspkAwQxmrUBL45T7S039vyBPOy80U1MJ3y/yly1F34 d61dsN5ZMSbnb7As0LniEA1/buFAmcIBlodTWxm4KhhV530D1gVqAuMuOQezTitTNxV6 p+IQ== X-Gm-Message-State: ABUngvfwHDye52/dcU0dbX3BfizVTojuw1LmPHkxKfTrhvlA/iGxaqI+Q1ppzY3RwmJSoQ== X-Received: by 10.99.104.195 with SMTP id d186mr39139944pgc.26.1477900977184; Mon, 31 Oct 2016 01:02:57 -0700 (PDT) Received: from localhost.localdomain ([216.207.47.6]) by smtp.gmail.com with ESMTPSA id k7sm34121196pan.8.2016.10.31.01.02.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 31 Oct 2016 01:02:56 -0700 (PDT) From: Xinming Hu X-Google-Original-From: Xinming Hu To: Linux Wireless Cc: Kalle Valo , Brian Norris , Dmitry Torokhov , Amitkumar Karwar , Cathy Luo , Brian Norris Subject: [PATCH 09/12] mwifiex: usb: handle HS failures Date: Mon, 31 Oct 2016 16:02:17 +0800 Message-Id: <1477900940-10549-9-git-send-email-huxinming820@marvell.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1477900940-10549-1-git-send-email-huxinming820@marvell.com> References: <1477900940-10549-1-git-send-email-huxinming820@marvell.com> 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 From: Brian Norris SDIO and PCIe drivers handle this. Let's imitate it. Not tested. Signed-off-by: Brian Norris --- drivers/net/wireless/marvell/mwifiex/usb.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/marvell/mwifiex/usb.c b/drivers/net/wireless/marvell/mwifiex/usb.c index 70126c3..c26daf4 100644 --- a/drivers/net/wireless/marvell/mwifiex/usb.c +++ b/drivers/net/wireless/marvell/mwifiex/usb.c @@ -521,7 +521,14 @@ static int mwifiex_usb_suspend(struct usb_interface *intf, pm_message_t message) mwifiex_dbg(adapter, WARN, "Device already suspended\n"); - mwifiex_enable_hs(adapter); + /* Enable the Host Sleep */ + if (!mwifiex_enable_hs(adapter)) { + mwifiex_dbg(adapter, ERROR, + "cmd: failed to suspend\n"); + adapter->hs_enabling = false; + return -EFAULT; + } + /* 'is_suspended' flag indicates device is suspended. * It must be set here before the usb_kill_urb() calls. Reason