Received: by 2002:a05:7412:bc1a:b0:d7:7d3a:4fe2 with SMTP id ki26csp115202rdb; Fri, 18 Aug 2023 16:40:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF/5Lf/JXq1gKT95I/OlkaiACZTWVdG2xjg6Fgi4ogjXa6jAL3Rqd1BqwpCqDETeQKbzHg1 X-Received: by 2002:a17:902:c404:b0:1b5:64a4:be8b with SMTP id k4-20020a170902c40400b001b564a4be8bmr932738plk.35.1692402055273; Fri, 18 Aug 2023 16:40:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692402055; cv=none; d=google.com; s=arc-20160816; b=envjzhe8sQ2vP/MxE4R3UCUKQDpQ7+8KpcqzATJOgzGBfDkvDxbV9LUnL1/8w2Oeeh iWxdxCv8txZl+A5TJZNiwxLVTPiwPFVl6/nsKs9PlCnTOcz3+AW8uksxTcNRrkkpfxRq /AiF+K9iwy49e64SWJffUTIftuEautrW+M2EWF6ZMyMSLnHDe7P5AeRwDQn01LZVnztb OL4nnzWDH6nlwgrs0v86O922TI/6ykrKtiqFwLcGiBmtL3AWseH7Dl0NPRQKDSTym7Ih 4oJi0Bn/0TX6w6leiRt08YnP8mSTXPNh3D8jDKwdIo6a20TOWkBGgNWb7hqyy2sKJoBc W8wQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=vWGEOQC1AiBgTgtKHnjBOkfGnmTrCPVBxmphmV8W6GE=; fh=DwwsYajehdG+ObXRR/cr63M6JRXEsWjWs1WcWx7u45o=; b=NQCnh7YqFktlZMn0r/kgTtT2kwb9PmcSoGhKKSpn6LKCgRleVl4KM4XzWnex+WtCNb YC/X4QBnZwB4ZqNVPjGW9AYRjE+JdQIACIPQG5lvlSLWz4C7zljtuVSPpg5o0UqZPAfJ 6hEW9zfDImZko53nnMQd1cuTtZjmmpJkCS5J0cbJqXzCND9Z9qLe2QgX5nXOrPeKHNbT 5pfFREhV6mXj6VrMvp+Fr1htu1yj7YSCnNCnZyAY5m7CKiOM+JZODNCvQpOtCTit2J1V cA6auZxD7V41EbDOtqImml+LPZhYR0toiA8a6pB7yCUZq9uKrN/5BSn/YbgnKYndfUcO VbDw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j11-20020a170902da8b00b001b8c689060bsi2419192plx.344.2023.08.18.16.40.42; Fri, 18 Aug 2023 16:40:55 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345882AbjHPTwi (ORCPT + 99 others); Wed, 16 Aug 2023 15:52:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345883AbjHPTwi (ORCPT ); Wed, 16 Aug 2023 15:52:38 -0400 Received: from bmailout3.hostsharing.net (bmailout3.hostsharing.net [176.9.242.62]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C015912C for ; Wed, 16 Aug 2023 12:52:36 -0700 (PDT) Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "*.hostsharing.net", Issuer "RapidSSL Global TLS RSA4096 SHA256 2022 CA1" (verified OK)) by bmailout3.hostsharing.net (Postfix) with ESMTPS id 5EFED100D943F; Wed, 16 Aug 2023 21:52:35 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 3278675F34; Wed, 16 Aug 2023 21:52:35 +0200 (CEST) Date: Wed, 16 Aug 2023 21:52:35 +0200 From: Lukas Wunner To: stuart hayes Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , "Rafael J . Wysocki" , Tanjore Suresh , Martin Belanger , Oliver O'Halloran , Daniel Wagner , Keith Busch Subject: Re: [PATCH] driver core: shut down devices asynchronously Message-ID: <20230816195235.GA15421@wunner.de> References: <20230816154518.3487-1-stuart.w.hayes@gmail.com> <20230816155435.GA18922@wunner.de> <653f62d4-277b-7cdb-39ba-03e0e7dfc1c0@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <653f62d4-277b-7cdb-39ba-03e0e7dfc1c0@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE, SPF_NONE autolearn=no 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 On Wed, Aug 16, 2023 at 02:42:26PM -0500, stuart hayes wrote: > On 8/16/2023 10:54 AM, Lukas Wunner wrote: > > Is there a particular reason why you're not using the infrastructure > > provided by kernel/async.c and , such as async_schedule()? > > It wraps all the work_struct plumbing and also has helpers to await > > completion. I imagine using that might reduce LoC in this patch. > > Not a good one. Let me look into this, thank you. A word of caution on async_synchronize_cookie(), it awaits the cookies *before* the one you're passing into the function, so depending on the use case it may be necessary to add + 1 to the cookie: https://lore.kernel.org/intel-gfx/20160621075704.GB1821@nuc-i3427.alporthouse.com/ It's a nasty gotcha. Just so you're aware of it. :) Thanks, Lukas