From patchwork Wed Nov 28 14:39:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 152293 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1170749ljp; Wed, 28 Nov 2018 06:40:20 -0800 (PST) X-Google-Smtp-Source: AFSGD/X4iFcZuyJjDD+MYVLADwYFMwBMJvP0saWHyv4Z5GKeC0AVfJHrYLlus9ApobdxgI1SDqmw X-Received: by 2002:a17:902:6a8b:: with SMTP id n11-v6mr37774667plk.311.1543416020749; Wed, 28 Nov 2018 06:40:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543416020; cv=none; d=google.com; s=arc-20160816; b=Q0gibwOwqM0jryB+i+2ivL7iZle4kHuoQjxQ12aQjrd8/ZEzcym68Xy9dqqZTPCnDG pY8EaiEtkNxn5hSFnKk/MZ3ji0poDPtNXX5W83tpR4oBEaWiadaNfz1dOFhJuOl+9KET AcO3zH2IaH7WM8yQDZaoqWmUe3Ysz3nqts5GrLUFwM14FoR/Wp/rMgAd54hmCOWeeFV1 kre9vr7hgDkVBvTTD6LWvRdjPuFKNhwbCeCUM6m+c0cbtgfF8njCGtNL7S6+ycTW7+wu kT+bCqwa7UikJDha2HCL6m1Ogt8+dvv2722vKUAKGTuyKJ1GQ1nI1p487z+UKI5QEshW oN+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=BWjym5Zw6Nhui/SH8t1ni7k/5hH6H8Cyw7dxMlo9RNI=; b=hVKHgML0UCJGVcHmImykkPNWbAPoDRWAQOx+uwNWLM7SfGmVAeSi4VBIjDllvEHozY quWuqeDb/5OkynCXedtnTFj1CqnDd/52qrbbVHd+gIQfm08xEu491H24WcSCJ03YIozZ Qo8XJg67ICOjGpmRSRJHVeNl+Py3u87gmFvU7C1Vgns9U50uY6Cx1594D/x3ixh+oBXp mbVcm64cLuBfZdx8sNOrxO8Yk30f8rHrsehWRCcmDr7bcZNmSm6owUXaRXogec2n60+J CUqayNaXdps+dJH2lziV27kLicE2HaLIJW2WwcS05eEQtrDOJPl0Fa7GwoaMFZn0UAA7 5Bwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PTvMeyJe; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i67si5274274pfc.148.2018.11.28.06.40.20; Wed, 28 Nov 2018 06:40:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-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=@linaro.org header.s=google header.b=PTvMeyJe; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728345AbeK2BmM (ORCPT + 15 others); Wed, 28 Nov 2018 20:42:12 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:36185 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728223AbeK2BmM (ORCPT ); Wed, 28 Nov 2018 20:42:12 -0500 Received: by mail-pf1-f195.google.com with SMTP id b85so10268506pfc.3 for ; Wed, 28 Nov 2018 06:40:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=BWjym5Zw6Nhui/SH8t1ni7k/5hH6H8Cyw7dxMlo9RNI=; b=PTvMeyJe8Gx/X+mw0EsK+fC1KsFerwb0+am18u9SibgV+dvFfuj7oOR8h2Tqe/lp5a qaK8pd8srE0iWETT83fML9IE/3Ub4tfoWqiMv6VLvKpTxYmFQR05ZhpB7yIZs1wznekj 2jP0jyiFUVuscfWeh7qcJWfqajwAdpo6vf4B0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=BWjym5Zw6Nhui/SH8t1ni7k/5hH6H8Cyw7dxMlo9RNI=; b=DndpUu2tRn6GHaFGcjus/TDWqsWIBYimR9VF3tcaFyiirJo6jDFHKTM0DZyiOP6DAw FJv5mlnHnyWmFIZlggInbKpNMG/xxiGFWui7dqf57ZwYIgaOWc58S74gWHuNs6kPVjHp 6fYQTvxeL6lyRHWccXrbBnQ7mpAEKcB9kSHp+ETH+zGIFXXAfH2mUnIkm/eOhhnY2WsN LbKJOfOj9CKZuJoTwvf9sh7dQkABUShqtHDcSHefBTTuGs6p2Qpc+NdEyFaUHX8M0KM3 wRzoM3383rueE5NEpMUSUvf8QhoBJu0KzP5tr0fDo/EOsyYfN9zbco+pyC3FXgdnBSN4 gToQ== X-Gm-Message-State: AA+aEWaw7YF6NmOulemcVZTXbQf6411zUmMGVhb2s99p4x0Bfx6sGd22 0OoTj48uBFy1AWVKNPNsWy3Nh4IKtQ4= X-Received: by 2002:a62:30c3:: with SMTP id w186mr5048843pfw.39.1543416018802; Wed, 28 Nov 2018 06:40:18 -0800 (PST) Received: from localhost.localdomain ([49.207.53.6]) by smtp.gmail.com with ESMTPSA id b26sm24227637pfe.91.2018.11.28.06.40.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 28 Nov 2018 06:40:17 -0800 (PST) From: Amit Pundir To: Greg KH Cc: Stable , Amitkumar Karwar , Kalle Valo Subject: [PATCH for-4.9.y 04/10] mwifiex: report error to PCIe for suspend failure Date: Wed, 28 Nov 2018 20:09:58 +0530 Message-Id: <1543416004-1547-5-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1543416004-1547-1-git-send-email-amit.pundir@linaro.org> References: <1543416004-1547-1-git-send-email-amit.pundir@linaro.org> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Amitkumar Karwar commit 5190f2e405919cd30ba2f12c58129fb2d71cd6b6 upstream. When host_sleep_config command fails, we should return an error to PCIe, instead of continuing (and possibly panicking, when we try to keep processing a timed-out ioctl after we return "successfully" from suspend). Signed-off-by: Amitkumar Karwar Reviewed-by: Brian Norris Tested-by: Brian Norris Signed-off-by: Kalle Valo Signed-off-by: Amit Pundir --- drivers/net/wireless/marvell/mwifiex/pcie.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c index 8b70c909ecbb..cb681b265b10 100644 --- a/drivers/net/wireless/marvell/mwifiex/pcie.c +++ b/drivers/net/wireless/marvell/mwifiex/pcie.c @@ -101,7 +101,6 @@ static int mwifiex_pcie_suspend(struct device *dev) { struct mwifiex_adapter *adapter; struct pcie_service_card *card; - int hs_actived; struct pci_dev *pdev = to_pci_dev(dev); if (pdev) { @@ -117,7 +116,14 @@ static int mwifiex_pcie_suspend(struct device *dev) adapter = card->adapter; - hs_actived = 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; + } + flush_workqueue(adapter->workqueue); /* Indicate device suspended */