From patchwork Sat Jun 4 13:59:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bhaktipriya Shridhar X-Patchwork-Id: 9154703 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 0A07B60467 for ; Sat, 4 Jun 2016 13:59:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E0AD528304 for ; Sat, 4 Jun 2016 13:59:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D50B028332; Sat, 4 Jun 2016 13:59:31 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 728C328304 for ; Sat, 4 Jun 2016 13:59:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750933AbcFDN7J (ORCPT ); Sat, 4 Jun 2016 09:59:09 -0400 Received: from mail-pa0-f66.google.com ([209.85.220.66]:34125 "EHLO mail-pa0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750862AbcFDN7H (ORCPT ); Sat, 4 Jun 2016 09:59:07 -0400 Received: by mail-pa0-f66.google.com with SMTP id x1so8151877pav.1; Sat, 04 Jun 2016 06:59:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=JHn362zZQZygP9s08Xk4GgJJdcgbyFKEbZB76cF8LdQ=; b=ekGoLOlOrxflNcWy88+NTGVoWVeh9qFU5g+arBBCtQC4gf0D6Fjlo3oYJPplMiLvrn xQQDmAcRmfvBCBe0ztrTEAzZkEn3pmeUHTp9afch2Gwmmp6ryoX3d8rb0KScsZGrzw0k 48r3umfJK7+gILPfZZk2gV0DisyDZnNJst5W/3Dgx5HKkaOCxZySVQMxxmm2kXqTKFR+ ib73zjRP8oqzme/EDRqfazMH8P1Cm0iVylKF1KJavQVieJnZlgyT2YKbREfrcTCAon9y F1SHofx2iGhjZjDwaGCMsxR9naVOttIFKeqyMMkOUc+m6y30j+bSfcoC9sS/ft1Beyt4 sSBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=JHn362zZQZygP9s08Xk4GgJJdcgbyFKEbZB76cF8LdQ=; b=WzSxUVmw9ApJHA9N9zWEL87YCnxXsUMBtwq8kuNiT0p2CxCrMQgb43pk0STfy39NeN sZf+OoMwjf6DMGMS1d/z0jRBA4jJWyPomEJlXMNay0t9WkxJX+TNnxFr+yjMGszl6s19 mJ6oO53U/Ub7lWzN1LW2AzOEHXiUgE4GHnn9ezOJu633LCL+RGjuLXiQHVV2BAPzklpO 7J+ucvoQ9EUzAKf4FUNl8IVuoGoxlcHFa6hUcW3ToGJlnHuB3Y6QfmzKdwj71LsdffKs U8zBqtsiMK4gScZD7uyd3JpuOCvqunRrHQnlLleIAT4YxA0NftdJ+yGNksW66nVhQIVB rcLA== X-Gm-Message-State: ALyK8tLKoGk1VYr+07D58ngGrblfKl9Vebm2NWwgnWmRUmsZS0N6dAicEyLY91zCKAWR3g== X-Received: by 10.66.89.228 with SMTP id br4mr11924530pab.110.1465048745372; Sat, 04 Jun 2016 06:59:05 -0700 (PDT) Received: from Karyakshetra ([1.23.6.66]) by smtp.gmail.com with ESMTPSA id 66sm15674428pfb.64.2016.06.04.06.59.04 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 04 Jun 2016 06:59:04 -0700 (PDT) Date: Sat, 4 Jun 2016 19:29:01 +0530 From: Bhaktipriya Shridhar To: Kalle Valo , Andreas Kemnade , Dan Carpenter , Bhaktipriya Shridhar , "Andrew F. Davis" , Jonathan Cameron , Mark Brown Cc: Tejun Heo , libertas-dev@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] net: wireless: marvell: libertas: Remove create_workqueue Message-ID: <20160604135901.GA29897@Karyakshetra> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) 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 alloc_workqueue replaces deprecated create_workqueue(). In if_sdio.c, the workqueue card->workqueue has workitem &card->packet_worker, which is mapped to if_sdio_host_to_card_worker. The workitem is involved in sending packets to firmware. Forward progress under memory pressure is a requirement here. In if_spi.c, the workqueue card->workqueue has workitem &card->packet_worker, which is mapped to if_spi_host_to_card_worker. The workitem is involved in sending command packets from the host. Forward progress under memory pressure is a requirement here. Dedicated workqueues have been used in both cases since the workitems on the workqueues are involved in normal device operation with WQ_MEM_RECLAIM set to gurantee forward progress under memory pressure. Since there are only a fixed number of work items, explicit concurrency limit is unnecessary. flush_workqueue is unnecessary since destroy_workqueue() itself calls drain_workqueue() which flushes repeatedly till the workqueue becomes empty. Hence the calls to flush_workqueue() before destroy_workqueue() have been dropped. Signed-off-by: Bhaktipriya Shridhar Acked-by: Tejun Heo --- drivers/net/wireless/marvell/libertas/if_sdio.c | 3 +-- drivers/net/wireless/marvell/libertas/if_spi.c | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/wireless/marvell/libertas/if_sdio.c b/drivers/net/wireless/marvell/libertas/if_sdio.c index 13eae9f..47f4a14 100644 --- a/drivers/net/wireless/marvell/libertas/if_sdio.c +++ b/drivers/net/wireless/marvell/libertas/if_sdio.c @@ -1228,7 +1228,7 @@ static int if_sdio_probe(struct sdio_func *func, } spin_lock_init(&card->lock); - card->workqueue = create_workqueue("libertas_sdio"); + card->workqueue = alloc_workqueue("libertas_sdio", WQ_MEM_RECLAIM, 0); INIT_WORK(&card->packet_worker, if_sdio_host_to_card_worker); init_waitqueue_head(&card->pwron_waitq); @@ -1326,7 +1326,6 @@ static void if_sdio_remove(struct sdio_func *func) lbs_stop_card(card->priv); lbs_remove_card(card->priv); - flush_workqueue(card->workqueue); destroy_workqueue(card->workqueue); while (card->packets) { diff --git a/drivers/net/wireless/marvell/libertas/if_spi.c b/drivers/net/wireless/marvell/libertas/if_spi.c index 82c0796..c3a53cd 100644 --- a/drivers/net/wireless/marvell/libertas/if_spi.c +++ b/drivers/net/wireless/marvell/libertas/if_spi.c @@ -1180,7 +1180,7 @@ static int if_spi_probe(struct spi_device *spi) priv->fw_ready = 1; /* Initialize interrupt handling stuff. */ - card->workqueue = create_workqueue("libertas_spi"); + card->workqueue = alloc_workqueue("libertas_spi", WQ_MEM_RECLAIM, 0); INIT_WORK(&card->packet_work, if_spi_host_to_card_worker); INIT_WORK(&card->resume_work, if_spi_resume_worker); @@ -1208,7 +1208,6 @@ static int if_spi_probe(struct spi_device *spi) release_irq: free_irq(spi->irq, card); terminate_workqueue: - flush_workqueue(card->workqueue); destroy_workqueue(card->workqueue); lbs_remove_card(priv); /* will call free_netdev */ free_card: @@ -1235,7 +1234,6 @@ static int libertas_spi_remove(struct spi_device *spi) lbs_remove_card(priv); /* will call free_netdev */ free_irq(spi->irq, card); - flush_workqueue(card->workqueue); destroy_workqueue(card->workqueue); if (card->pdata->teardown) card->pdata->teardown(spi);