From patchwork Wed Dec 2 10:06:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sunil Kovvuri X-Patchwork-Id: 7744101 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9234C9F350 for ; Wed, 2 Dec 2015 10:07:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A173220638 for ; Wed, 2 Dec 2015 10:07:11 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C59B720631 for ; Wed, 2 Dec 2015 10:07:10 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1a44Hh-0006Yr-6I; Wed, 02 Dec 2015 10:05:13 +0000 Received: from mail-pa0-x241.google.com ([2607:f8b0:400e:c03::241]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a44HB-0005XA-4I for linux-arm-kernel@lists.infradead.org; Wed, 02 Dec 2015 10:04:44 +0000 Received: by pagj16 with SMTP id j16so4608529pag.0 for ; Wed, 02 Dec 2015 02:04:20 -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=DWh8nuA8Y4OYdgk65f7KT1vqpGzmF83yh+7uIcdl8xo=; b=f6kSjoPbmcCDBN0VZTK1ZOxQeBbnanT5AipWUwGaKM0v5HFlpCSXxFpXLi7sYmwZWn QyLdA7TuHtQZmIKLeFAXZP0nK5ZYIsaTMvFXNUU0N0fEfXsamZ7r6qgLZ8mYmmpZcL+9 sSXSMicDRLXz9gNIluzOi23LtAvVux9NSnwuzMIwB/mTuJYTfpv/kw/ZuSBhGgNitSMx ahkWtzGfRKZ86qfyIzDolrv7c/1byPix8JWPrEiLMdtsfGfbjvA8hRMXEaHmOKjy2Bl8 jyv31wYmswwHgxytSyLpb01mUeShgyimK00j1Zf5HA+s3S8rGufWHlDSEfkv0MlQD0ez YOSA== X-Received: by 10.67.7.101 with SMTP id db5mr3254962pad.53.1449050660316; Wed, 02 Dec 2015 02:04:20 -0800 (PST) Received: from localhost.localdomain ([14.140.2.178]) by smtp.googlemail.com with ESMTPSA id 9sm3249600pfn.51.2015.12.02.02.04.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Dec 2015 02:04:19 -0800 (PST) From: Sunil Goutham To: netdev@vger.kernel.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 Message-Id: <1449050777-37836-3-git-send-email-sunil.kovvuri@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1449050777-37836-1-git-send-email-sunil.kovvuri@gmail.com> References: <1449050777-37836-1-git-send-email-sunil.kovvuri@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151202_020441_331637_29CFB14E X-CRM114-Status: GOOD ( 11.04 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sunil Goutham , Sunil.Goutham@caviumnetworks.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Thanneeru Srinivasulu MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Thanneeru Srinivasulu While VNIC or BGX driver teardown, wait for already scheduled delayed work to finish before destroying it. Signed-off-by: Thanneeru Srinivasulu Signed-off-by: Sunil Goutham --- 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); }