linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: sunil.kovvuri@gmail.com (Sunil Goutham)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 2/5] net: thunderx: Wait for delayed work to finish before destroying it
Date: Wed,  2 Dec 2015 15:36:14 +0530	[thread overview]
Message-ID: <1449050777-37836-3-git-send-email-sunil.kovvuri@gmail.com> (raw)
In-Reply-To: <1449050777-37836-1-git-send-email-sunil.kovvuri@gmail.com>

From: Thanneeru Srinivasulu <tsrinivasulu@caviumnetworks.com>

While VNIC or BGX driver teardown, wait for already scheduled delayed work to
finish before destroying it.

Signed-off-by: Thanneeru Srinivasulu <tsrinivasulu@caviumnetworks.com>
Signed-off-by: Sunil Goutham <sgoutham@cavium.com>
---
 drivers/net/ethernet/cavium/thunder/nic_main.c    |    3 +--
 drivers/net/ethernet/cavium/thunder/thunder_bgx.c |    3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/cavium/thunder/nic_main.c b/drivers/net/ethernet/cavium/thunder/nic_main.c
index c561fdc..cfc24a1 100644
--- a/drivers/net/ethernet/cavium/thunder/nic_main.c
+++ b/drivers/net/ethernet/cavium/thunder/nic_main.c
@@ -1074,8 +1074,7 @@ static void nic_remove(struct pci_dev *pdev)
 
 	if (nic->check_link) {
 		/* Destroy work Queue */
-		cancel_delayed_work(&nic->dwork);
-		flush_workqueue(nic->check_link);
+		cancel_delayed_work_sync(&nic->dwork);
 		destroy_workqueue(nic->check_link);
 	}
 
diff --git a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
index 2574a7e..6534b73 100644
--- a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
+++ b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
@@ -695,8 +695,7 @@ static void bgx_lmac_disable(struct bgx *bgx, u8 lmacid)
 	lmac = &bgx->lmac[lmacid];
 	if (lmac->check_link) {
 		/* Destroy work queue */
-		cancel_delayed_work(&lmac->dwork);
-		flush_workqueue(lmac->check_link);
+		cancel_delayed_work_sync(&lmac->dwork);
 		destroy_workqueue(lmac->check_link);
 	}
 
-- 
1.7.1

  parent reply	other threads:[~2015-12-02 10:06 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-02 10:06 [PATCH v2 0/5] net: thunderx: Miscellaneous fixes Sunil Goutham
2015-12-02 10:06 ` [PATCH v2 1/5] net: thunderx: Force to load octeon-mdio before bgx driver Sunil Goutham
2015-12-02 10:06 ` Sunil Goutham [this message]
2015-12-02 10:06 ` [PATCH v2 3/5] net: thunderx: Set CQ timer threshold properly Sunil Goutham
2015-12-02 10:06 ` [PATCH v2 4/5] net: thunderx: Switchon carrier only upon interface link up Sunil Goutham
2015-12-02 10:42   ` Pavel Fedin
2015-12-02 11:30     ` Pavel Fedin
2015-12-02 11:34       ` Sunil Kovvuri
2015-12-02 20:56       ` David Miller
2015-12-02 10:06 ` [PATCH v2 5/5] net: thunderx: Enable BGX LMAC's RX/TX only after VF is up Sunil Goutham
2015-12-02 20:48 ` [PATCH v2 0/5] net: thunderx: Miscellaneous fixes David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1449050777-37836-3-git-send-email-sunil.kovvuri@gmail.com \
    --to=sunil.kovvuri@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).