From patchwork Wed May 10 16:04:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 92198 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3740380vqo; Wed, 10 May 2023 09:08:53 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4ZZfyhMKPY5DLVIYX957wI1SzqlxiurmOffV9IUiSDADoyr+8muXjciey2ri0qu8/44MPr X-Received: by 2002:a92:db03:0:b0:335:7c2e:10d0 with SMTP id b3-20020a92db03000000b003357c2e10d0mr5817038iln.12.1683734933362; Wed, 10 May 2023 09:08:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683734933; cv=none; d=google.com; s=arc-20160816; b=XhBbRdcjJoji7R53hfNTD+CUGJxd6IRsyOsHKegu3Sge6QYeBmtQpDAc6HZng4TSpW 1IFIhfoGwwNc5MjJadMiJO2NrEycm/gaJlUDl5OXeWijrf40cXexGzp5Pit99DkJnfiJ SDWE+Cp8QTgD4HXv6VeOJ6vYApqvcBzL1GP1gvK3Uhb8IXYDn2WCKOxSj/vQo7cqyfXP DS9VuzfGEZ45UxcUa/I3BOqIxBeikN1vXKTOKo1OYPuCt4E/21NSvhoUqRd7nDmNz4un vqlG7A5eCx5a5BC1oH6z5jCGXUk2ssDCqpc1k8E+/9ATpmT1KW+S77U7yLprI5TcUqp2 HSyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=KDPa8btsl2NOG9VQc/thfEj5XH4yR+8CNCHayydE5dw=; b=BBkK2NXBlwfsG8PELN39Yuwv02WeUsAEP+b0ySmq5bunTch6waXcHzQPSMOAqvFclx ZifUzepDPEuKZv/KKbfHWkMS5kLbgWmc8grqvr+JbH5873zUiPx1f2oeJ64qjKXTJkDw 6EayWBmyK9tGTi9o5sTBFt3e9w+Ss9dL9ohrxuzVBVnBYgg0ViAiJRgVHQiAjjDG/APh 1e7DFLdJSOF4D1bMqqZwFtLbnlcd5A/WxrOluycRoda3mRndyme9wDLuSdh0COQgGpZX 27gyFdYnTLPqAlWMrw//sJw6RDcSa7rzRTHNC34CWAXRGA4caNj0AdoCgCBHHt1ysHGl /1Vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=vzvuPsdK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z6-20020a92bf06000000b00310e889c53asi7298546ilh.155.2023.05.10.09.08.39; Wed, 10 May 2023 09:08:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=vzvuPsdK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230165AbjEJQEq (ORCPT + 99 others); Wed, 10 May 2023 12:04:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229745AbjEJQEh (ORCPT ); Wed, 10 May 2023 12:04:37 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E64CD2716; Wed, 10 May 2023 09:04:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Content-Type:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=KDPa8btsl2NOG9VQc/thfEj5XH4yR+8CNCHayydE5dw=; t=1683734677; x=1684944277; b=vzvuPsdKd71KZQYeElVzaApivw2Kfpl5RaWrEZFPRODjOM0 2p7cV95+yg89ZmSRdOL/N7C6y/MejksEm4OkwROs6j7D3PIWQjUqXF4rC4+DUpfL0WJl8fN0iDzTk sx+oPxdR+YXEqH9uz3P9i9SXwCB5cnZ7YUHPhtuSNI3IbsV4wMSX78wQd2DvDNytHZehb3mqgxsyk 2rjeke0gd7JG1peXDzOoc+QXBW00Ne0jAonqfxnttmOiYaRUWt0PhwIkTUpF5MvzpoGTMU3DmSQhV J5wekvOixoQjtr1TK8M8qag1zdZ5Eaf10+5SpGm8UvHocYwoGEovCkimCC6nwHVw==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1pwmIs-005Uq9-0e; Wed, 10 May 2023 18:04:34 +0200 From: Johannes Berg To: linux-kernel@vger.kernel.org Cc: linux-wireless@vger.kernel.org, Tejun Heo , Lai Jiangshan , Johannes Berg Subject: [RFC PATCH 4/4] wifi: cfg80211: move scan done work to cfg80211 workqueue Date: Wed, 10 May 2023 18:04:28 +0200 Message-Id: <20230510175846.d92b96f05f12.I0490b5768769e62db2448e3f439cdf8a3c2df892@changeid> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230510160428.175409-1-johannes@sipsolutions.net> References: <20230510160428.175409-1-johannes@sipsolutions.net> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765524041247443081?= X-GMAIL-MSGID: =?utf-8?q?1765524041247443081?= From: Johannes Berg Now that we have the cfg80211 workqueue, move the scan_done work to it as an example. Signed-off-by: Johannes Berg --- net/wireless/core.c | 1 - net/wireless/scan.c | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/net/wireless/core.c b/net/wireless/core.c index 11e600c71fb6..2908cc4f102e 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c @@ -1082,7 +1082,6 @@ void wiphy_unregister(struct wiphy *wiphy) */ flush_workqueue(rdev->wq); - flush_work(&rdev->scan_done_wk); cancel_work_sync(&rdev->conn_work); flush_work(&rdev->event_work); cancel_delayed_work_sync(&rdev->dfs_update_channels_wk); diff --git a/net/wireless/scan.c b/net/wireless/scan.c index 790bc31cf82e..6bd919352f55 100644 --- a/net/wireless/scan.c +++ b/net/wireless/scan.c @@ -1007,9 +1007,7 @@ void __cfg80211_scan_done(struct work_struct *wk) rdev = container_of(wk, struct cfg80211_registered_device, scan_done_wk); - wiphy_lock(&rdev->wiphy); ___cfg80211_scan_done(rdev, true); - wiphy_unlock(&rdev->wiphy); } void cfg80211_scan_done(struct cfg80211_scan_request *request, @@ -1035,7 +1033,8 @@ void cfg80211_scan_done(struct cfg80211_scan_request *request, } request->notified = true; - queue_work(cfg80211_wq, &wiphy_to_rdev(request->wiphy)->scan_done_wk); + wiphy_queue_work(request->wiphy, + &wiphy_to_rdev(request->wiphy)->scan_done_wk); } EXPORT_SYMBOL(cfg80211_scan_done);