From patchwork Thu Nov 10 11:57:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xinming Hu X-Patchwork-Id: 9420973 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 DE4A460720 for ; Thu, 10 Nov 2016 11:58:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CB3052957A for ; Thu, 10 Nov 2016 11:58:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C0340296A3; Thu, 10 Nov 2016 11:58:14 +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.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 6CEFA2957A for ; Thu, 10 Nov 2016 11:58:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755716AbcKJL6H (ORCPT ); Thu, 10 Nov 2016 06:58:07 -0500 Received: from mail-pf0-f194.google.com ([209.85.192.194]:36062 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755708AbcKJL6A (ORCPT ); Thu, 10 Nov 2016 06:58:00 -0500 Received: by mail-pf0-f194.google.com with SMTP id n85so3971901pfi.3 for ; Thu, 10 Nov 2016 03:58:00 -0800 (PST) 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=E2eKgV4S1dgnSbxsXcmp1uPAafmtajiP7RB+9i08fis=; b=kk8B2XvfQCe+K+TiAeiBswJJAsS7d9wdiDFA0rxBN1wypVyeY5TGFdSD61FhdTGTmg lFwPXnDMyKyi9oNI+ROVg5uDJvG0vhqooU8/ZfF85it0bFxMrNf5ZTsCFezOxDKdnxS0 mkHBkPT3VtqxTXTqSYMl2DKsxtuoyDciWnaS+y7W1BRaEVRH3AsEji2vmjcnoVf01Qhy TGAw+W29jFcw6VmgJpaTSckhD13rP2/Pg1TJkTZ5VXaxpyzq+Dx/0oS9iitm3zENXJXs XanII9okZZJK6OlaW3s0HR84oY4dYhQs+pXV9+D8R1A3vx58bxFFQmJNpF46CWBQNLBJ 6a0Q== 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=E2eKgV4S1dgnSbxsXcmp1uPAafmtajiP7RB+9i08fis=; b=NaNzWTXcKfV8W82gsaqOJRWO4pn/0I6Tutjxt+lYOsRRi8ma1HYDIPvFbAfbGSONTK EJNo+5kk0DUd+g/1P3SnT7K39X0dzORMgCssQ7mbHVHuQTEfiAQ+LjEm2pB0i/EZpxVT JyaEqDmobboAhHug2CqhTIpFdD7/gzn4VkABldAQZwFAhdh5FKCP3bhKe0ZhsAMkKCS6 9O8jdDsd8DGCKHV7lgTEFltfPCHbNNcCU+K4LL1jvmlpBsmIw4EQzixE7cciJkRsrSU3 v/SP8KutblG33tUM3pGowD7qE27RtsrfbtztPyCa0M7EsNmjDU1ECmucC2Ud7ik1OgQi ig2A== X-Gm-Message-State: ABUngvefg8hgebkhzwSr+/sePzoJBFobyS8Ni63R5yAN8iJv647PuGxcIiw0O6PD8IyVVw== X-Received: by 10.99.198.6 with SMTP id w6mr35160777pgg.35.1478779079748; Thu, 10 Nov 2016 03:57:59 -0800 (PST) Received: from localhost.localdomain ([216.207.47.6]) by smtp.gmail.com with ESMTPSA id v10sm6740890pag.44.2016.11.10.03.57.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 10 Nov 2016 03:57:59 -0800 (PST) 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 RESEND v2 08/11] mwifiex: usb: handle HS failures Date: Thu, 10 Nov 2016 19:57:09 +0800 Message-Id: <1478779032-5165-8-git-send-email-huxinming820@marvell.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1478779032-5165-1-git-send-email-huxinming820@marvell.com> References: <1478779032-5165-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 --- v2: Same as v1 --- 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 671702c..8bcfd92 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