From patchwork Wed Oct 3 10:52:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 10624565 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-2.web.codeaurora.org (Postfix) with ESMTP id 0E39E14BD for ; Wed, 3 Oct 2018 10:52:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F0BCC2877F for ; Wed, 3 Oct 2018 10:52:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E542028783; Wed, 3 Oct 2018 10:52:49 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 8E2E02877F for ; Wed, 3 Oct 2018 10:52:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726747AbeJCRkj (ORCPT ); Wed, 3 Oct 2018 13:40:39 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:37678 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726544AbeJCRkj (ORCPT ); Wed, 3 Oct 2018 13:40:39 -0400 Received: by mail-wm1-f66.google.com with SMTP id 185-v6so5168569wmt.2 for ; Wed, 03 Oct 2018 03:52:47 -0700 (PDT) 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=wll6P2h9sxl8LMKiwvb5DQelkbRPuFgjlIQkJ2BrnGc=; b=WRJz58ECIZs2aHVzQCBp+zwZS6Y9+XOSi8f7VVKEh9fMi3SguyxJlSO7vlWTs+CWTj 578tDr66wpVcFQ8koiRXQ5KDiUVRN/olgE5aK67IsPBShpSg1w9H7kgthitOGxtEoNx+ 5hB1p6GjGenfqFqHNyx4rOmunJlsuIT061MTlhk6p0VsjakE5VhSDq7ou41eq7TiPqW8 F7dccQD6XeoeYEWLb8dI5g1PilLltX09uyPRBrwt5S8lnf8BDgv8qwao1ktoXugKq1e2 gicqBtyBmr/cEF++ImXVLHLx8GuAu9RBa0brQn4Dy1Zny3dxZgeFmjD6RqJPkJUG4nh1 ZLkg== X-Gm-Message-State: ABuFfojA2tl8t511YuYPuzP65iM90l2/ohFcItaGQnictz3BGQdhnqh/ +Ku5o+/s0p4TMWheobgiP5olxUgi9vA= X-Google-Smtp-Source: ACcGV60Du+wKLtaTzJElFGifXyEeHHq62My1sSHM2sFzh+0kybnV4CB2YyNToyg8zoYzoAZDzlbZiQ== X-Received: by 2002:a7b:c017:: with SMTP id c23-v6mr1094435wmb.136.1538563966692; Wed, 03 Oct 2018 03:52:46 -0700 (PDT) Received: from localhost.localdomain.com (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id e67-v6sm1782486wmd.41.2018.10.03.03.52.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Oct 2018 03:52:46 -0700 (PDT) From: Lorenzo Bianconi To: nbd@nbd.name Cc: sgruszka@redhat.com, linux-wireless@vger.kernel.org Subject: [PATCH 3/3] mt76x0: usb: stop cal/mac workqueues at hw stop Date: Wed, 3 Oct 2018 12:52:26 +0200 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: 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 Stop mac and calibration work stopping the hw even if the device has been removed Fixes: b11e19694dc9 ("mt76x0: add ieee80211_ops ops pointer to mt76x0_alloc_device signature") Signed-off-by: Lorenzo Bianconi --- drivers/net/wireless/mediatek/mt76/mt76x0/usb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/usb.c b/drivers/net/wireless/mediatek/mt76/mt76x0/usb.c index dd437e77009f..57862cacf22a 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x0/usb.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x0/usb.c @@ -86,14 +86,14 @@ static void mt76x0u_cleanup(struct mt76x0_dev *dev) static void mt76x0u_mac_stop(struct mt76x0_dev *dev) { - if (test_bit(MT76_REMOVED, &dev->mt76.state)) - return; - clear_bit(MT76_STATE_RUNNING, &dev->mt76.state); cancel_delayed_work_sync(&dev->cal_work); cancel_delayed_work_sync(&dev->mac_work); mt76u_stop_stat_wk(&dev->mt76); + if (test_bit(MT76_REMOVED, &dev->mt76.state)) + return; + mt76_clear(dev, MT_BEACON_TIME_CFG, MT_BEACON_TIME_CFG_TIMER_EN | MT_BEACON_TIME_CFG_SYNC_MODE | MT_BEACON_TIME_CFG_TBTT_EN | MT_BEACON_TIME_CFG_BEACON_TX);