Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp1820744iol; Fri, 10 Jun 2022 16:06:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGETLh8cH5T0ZUDa81KLgGrcbtdCMFXlVeA8LMNVwTgByBA3BPl+pI9q4vVYfClHoHcKpL X-Received: by 2002:a62:be14:0:b0:505:a43b:cf6e with SMTP id l20-20020a62be14000000b00505a43bcf6emr115423360pff.33.1654902407494; Fri, 10 Jun 2022 16:06:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654902407; cv=none; d=google.com; s=arc-20160816; b=CIjKlEmiFWjVaPCXrHWqXEXVyVdODKua6ahDr/faPqZrrEoIjVE7nzyR8iZBbuNioK iCPWLd/inC90wnKhweQCd/AQE/D4XGbereDFQBujHd0WSfahn0epdWRUS6475Ae9t03x MIbGgKxrAcRbyq338FG+3CahIj3XcgVnZergnrSlA2H/PhJueSC9m1qr4D7V9Qrmn4/C 9vzPfV52ITwHA1x76dND73M+AjIuKKjjfG72Bp8rzZtIxPh6vez5II4RVv1XUQJbhzjk 29ZdB0atkxaDQKQOax8G8wDk/qk53RoOC+3R9u1i6RI9UcmMphSO8jVYBbnTAzUEcUnR FQOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=fHjCfBd3ED40/IEL9Th7a6S26f3aE9h3dZR6QwTtztg=; b=FegqvgDPvyUuJVihzpO9H92QcWFV2rPP89u34s0QINNL36jdAPgpHjLgj8n9AaU1Cv yoC/5Xv2GdoRKFyFBvzU7sBl07EMIz/VTIBjODiFlb5iTc5FB1c2frlYu29eR8rO93BT XQQZ8+B/gpR1hDEEsIkffI+SULVGh1cqtaF1+MuKHQDWhynp5w64+xVAP1vlZZ7uOK5g BS0Xl0sMg9jjZkD7pTt7K6CVfiNrP9ODGVDN9H6xl5jKDCjrWeGqOb4rMhXJwMTlVw3f FTX3y1Lh2YZwikIha2X7rQBNnI2ArDpSj/WgyZVrXH8sHV8zGC7tfw/yzsTkiHaKIyuf gqnw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p14-20020a170902b08e00b001616652f769si711864plr.240.2022.06.10.16.06.32; Fri, 10 Jun 2022 16:06:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-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; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235334AbiFJWwC (ORCPT + 65 others); Fri, 10 Jun 2022 18:52:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232323AbiFJWv7 (ORCPT ); Fri, 10 Jun 2022 18:51:59 -0400 Received: from www262.sakura.ne.jp (www262.sakura.ne.jp [202.181.97.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6C5613D6E for ; Fri, 10 Jun 2022 15:51:57 -0700 (PDT) Received: from fsav117.sakura.ne.jp (fsav117.sakura.ne.jp [27.133.134.244]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id 25AMpjra090332; Sat, 11 Jun 2022 07:51:45 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav117.sakura.ne.jp (F-Secure/fsigk_smtp/550/fsav117.sakura.ne.jp); Sat, 11 Jun 2022 07:51:45 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/fsav117.sakura.ne.jp) Received: from [192.168.1.9] (M106072142033.v4.enabler.ne.jp [106.72.142.33]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id 25AMpjqo090329 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NO); Sat, 11 Jun 2022 07:51:45 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Message-ID: <886f1a69-5688-196c-90f1-e1324e941e77@I-love.SAKURA.ne.jp> Date: Sat, 11 Jun 2022 07:51:42 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH] ath6kl: avoid flush_scheduled_work() usage Content-Language: en-US To: Jeff Johnson , Kalle Valo Cc: linux-wireless References: <8de85fd9-50a1-aad7-86f7-24834be8bbc0@I-love.SAKURA.ne.jp> <376b3413-c584-192c-756d-609f7c55d742@quicinc.com> From: Tetsuo Handa In-Reply-To: <376b3413-c584-192c-756d-609f7c55d742@quicinc.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,NICE_REPLY_A, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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-wireless@vger.kernel.org On 2022/06/11 4:10, Jeff Johnson wrote: > On 6/10/2022 12:05 PM, Jeff Johnson wrote: >>> +static int __init ath6kl_init(void) >>> +{ >>> + int ret; >>> + >>> + ath6kl_wq = alloc_workqueue("ath6kl_wq", 0, 0); >>> + if (!ath6kl_wq) >>> + return -ENOMEM; >> >> this approach means the driver will always allocate a workqueue even if the associated hardware is never present. Creating a WQ without WQ_MEM_RECLAIM flag consumes little resource. >> >> did you consider instead having the allocation take place within the processing of ath6kl_usb_probe() and the destroy take place within the processing of ath6kl_usb_pm_remove()? > > typo: ath6kl_usb_pm_remove() => ath6kl_usb_remove() Technically possible to use ath6kl_usb_create()/ath6kl_usb_destroy() if you prefer it. Do you want ath6kl_wq be shared within this module (using a refcount), or be local to each "struct ath6kl_usb" (adding a member and accessing via usb_get_intfdata()) ?