From patchwork Thu Apr 4 04:01:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 10884885 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C374717EE for ; Thu, 4 Apr 2019 04:01:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A7902288BC for ; Thu, 4 Apr 2019 04:01:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9BDB72886A; Thu, 4 Apr 2019 04:01:39 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 454DB28868 for ; Thu, 4 Apr 2019 04:01:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=HzCc/XJByNraAC+1CBXSNbife/Luzf8jRF/8NpUh7Jk=; b=p9p9ZUDLEfJzui foDlFtZsp2MqTXRrOXbrQu6OoK70lmz0XHPUCWItzQoLBDecyOQnmeqwkiJIUnbz/RwD4d9fylBL2 U8n523sTJ5MycIliDiSMnEdYQSDRWOyxq9EXCR3xsqgpxUBItZMX8LYvyLA2OI4tFbh8YH3j9oP2U ZfA5RVmZL8ESStH+NeI93x0Zkt2qtWUuFop3ufYNGZjE/xfuiNYtLMw9lYp96HDVt1GIDSDHjqNQj PlmteVoy1kS71w3hYcaM/Pb0EDO+EEoIXBECqy2aL0v03AjiGEWVWwtWkrgKrNCJind0TbYluBrZ2 e/vkMAeRYt07SVli9qmw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBtZJ-0000Eu-Hx; Thu, 04 Apr 2019 04:01:37 +0000 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBtZG-0000EZ-0W for linux-rockchip@lists.infradead.org; Thu, 04 Apr 2019 04:01:35 +0000 Received: by mail-pg1-x544.google.com with SMTP id i2so519375pgj.11 for ; Wed, 03 Apr 2019 21:01:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=wBdWnyJ80XlwOcK+67cANMr9xP/H3nCIWrNH+V/VDSg=; b=ej7jDSVGJ7ktRxej/aB9sBwU8ImWS81Q1fjb+O9nxZP6vUjTL0HmP4y5b+SEgI2Z2n PZojXxG+FotPQkMujlVL5JsYFFiKQq6XDHvziA1fDKvU6nJM10TTWA8uzkYhNr+mBKJy d5T1H2cFdaGp72pye7X5u+5H04nMlSIuIBCUA= 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:mime-version :content-transfer-encoding; bh=wBdWnyJ80XlwOcK+67cANMr9xP/H3nCIWrNH+V/VDSg=; b=qhgL/tXigccb4MflWCFgFT6LXaLsak5e6vDfT9yutdRzxfJcS3m9oU8yhrn6t6Zsb/ DRcRcmo7edoh4yTx92E2AesNnh6Ng0vhiSvTonef3BhYMv2rKLWzwMjpKU6ET7mQF+go dHjk3VmZlryiSbVlMcTPa8do4MmF90mejfNyyE0C23ObBVJfFkMoMv/veAPt+5M8Lcu3 WobgiLaRUc73ePvmW0DN8WNbEQ68vSLvtz/yXo5wJX22CBck81VLiSSlSQuxdb6mnmqB UuHaS5Zfr2K65zC607kSd9S2cFV8wdmQ+qru6Wxv+acC8rD0ETVzHsvbUnCt3u1DRYS7 Z6eg== X-Gm-Message-State: APjAAAWBSilZVjh0jE8VwWLEHyZQQJM9Yx6+OYwmju4n23Y0lh3eta7a Sl2oiMQD358F9ognBySAicKHAQ== X-Google-Smtp-Source: APXvYqxMunYRB8wRWGeUy8YgBn6+zIC8XeTwPFCjwS/xQwMGGkfukhYjw8BpBMfsQOxKBopCoiR5ig== X-Received: by 2002:a63:614c:: with SMTP id v73mr3436250pgb.395.1554350492893; Wed, 03 Apr 2019 21:01:32 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:24fa:e766:52c9:e3b2]) by smtp.gmail.com with ESMTPSA id u7sm17717581pgp.26.2019.04.03.21.01.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Apr 2019 21:01:32 -0700 (PDT) From: Douglas Anderson To: Kalle Valo Subject: [PATCH] mwifiex: Make resume actually do something useful again on SDIO cards Date: Wed, 3 Apr 2019 21:01:06 -0700 Message-Id: <20190404040106.40519-1-dianders@chromium.org> X-Mailer: git-send-email 2.21.0.392.gf8f6787159e-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190403_210134_071721_9649F5AB X-CRM114-Status: GOOD ( 13.15 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ganapathi Bhat , heiko@sntech.de, Xinming Hu , netdev@vger.kernel.org, briannorris@chromium.org, linux-wireless@vger.kernel.org, Douglas Anderson , Amitkumar Karwar , linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, Nishant Sarmukadam , mka@chromium.org, ryandcase@chromium.org, "David S. Miller" Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The commit fc3a2fcaa1ba ("mwifiex: use atomic bitops to represent adapter status variables") had a fairly straightforward bug in it. It contained this bit of diff: - if (!adapter->is_suspended) { + if (test_bit(MWIFIEX_IS_SUSPENDED, &adapter->work_flags)) { As you can see the patch missed the "!" when converting to the atomic bitops. This meant that the resume hasn't done anything at all since that commit landed and suspend/resume for mwifiex SDIO cards has been totally broken. After fixing this mwifiex suspend/resume appears to work again, at least with the simple testing I've done. Fixes: fc3a2fcaa1ba ("mwifiex: use atomic bitops to represent adapter status variables") Signed-off-by: Douglas Anderson Reviewed-by: Brian Norris --- drivers/net/wireless/marvell/mwifiex/sdio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/marvell/mwifiex/sdio.c b/drivers/net/wireless/marvell/mwifiex/sdio.c index a85648342d15..d5a70340a945 100644 --- a/drivers/net/wireless/marvell/mwifiex/sdio.c +++ b/drivers/net/wireless/marvell/mwifiex/sdio.c @@ -181,7 +181,7 @@ static int mwifiex_sdio_resume(struct device *dev) adapter = card->adapter; - if (test_bit(MWIFIEX_IS_SUSPENDED, &adapter->work_flags)) { + if (!test_bit(MWIFIEX_IS_SUSPENDED, &adapter->work_flags)) { mwifiex_dbg(adapter, WARN, "device already resumed\n"); return 0;