Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6339076rwb; Tue, 22 Nov 2022 11:56:38 -0800 (PST) X-Google-Smtp-Source: AA0mqf70FH9pO7K47Nj6jBtyJuwnt+2kp31w2XX3j1crGt+vGsqo+PbhfdAb2wMwzldapHORhuxa X-Received: by 2002:a17:902:a703:b0:187:137c:b2ea with SMTP id w3-20020a170902a70300b00187137cb2eamr5463023plq.52.1669146998553; Tue, 22 Nov 2022 11:56:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669146998; cv=none; d=google.com; s=arc-20160816; b=xSwOYjdDubUA+9bu5Z2Ew/U22TlcHoSun6ENG/bFGd2icw3OaOZPp54wCUGH3RRrd1 xYvfo4CKJZsJn5h0uHURplgbaa9TXqH3jAybYrfvUt/tlHkXGWciuS2vWZBjH8mDHn5T iCBwoWbXfw3eCbYs4sBnZxuCoo+AQzSJL+0FvmWpqlAmvHTcVsf0IEmFWdzr6/4xIkWW Wi8JqLrF4sREQrP5TQg732/i8udC5kWtV03GuZcB68SG//FnBZXaWPKDrTtGIkmORs85 faV5WgENWaOQURFPI2KAjMdzSKVg6cYTUM+Rj6yZadOkJCvbkZvpti9gxBWLnfvMTNVz 545Q== 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=MSHzH9hRofPetAvCAeC0kFHkH71duuBge092hnweC7o=; b=xTH6OzPW4Gd/LaddkHskTgGQ7HP69iQJBn/FNrwKslUXG9lbFJhPJlL0E0J+lmKtUn hMSExofve+0/aJ5T9uN1n8SoTmRvefqdpihBFgGHyVC91vb5YzLciAmlDQg+3Xg4FKKd jq9EqlbAw1iujpvHcMTMoI8qC4c78wCGQgMOEda6uzIEuu3drR9ZyMpaMRGzlIzcgZim DHObOTKNKFJZa3t3Rnf+UNmfdh7y8BaojQqi8HctauFDvqJWfdN6CHptWCLHznZvivia BXEXWnFt7oT1dzS4WguSZUB/Kr3mseBTv2aHRUTQoKiPkPNsCiswiJuOI4X9Q89PqUkc lvfg== 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 cq23-20020a056a00331700b00569a7731a99si14043242pfb.326.2022.11.22.11.56.26; Tue, 22 Nov 2022 11:56:38 -0800 (PST) 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 S234338AbiKVTxl (ORCPT + 91 others); Tue, 22 Nov 2022 14:53:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234477AbiKVTx2 (ORCPT ); Tue, 22 Nov 2022 14:53:28 -0500 Received: from bmailout1.hostsharing.net (bmailout1.hostsharing.net [IPv6:2a01:37:1000::53df:5f64:0]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 480E57EBFD; Tue, 22 Nov 2022 11:53:24 -0800 (PST) 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 TLS DV RSA Mixed SHA256 2020 CA-1" (verified OK)) by bmailout1.hostsharing.net (Postfix) with ESMTPS id D3435300002A0; Tue, 22 Nov 2022 20:53:16 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id C7CEAA2390; Tue, 22 Nov 2022 20:53:16 +0100 (CET) Date: Tue, 22 Nov 2022 20:53:16 +0100 From: Lukas Wunner To: ira.weiny@intel.com Cc: Dan Williams , Bjorn Helgaas , Alison Schofield , Vishal Verma , Jonathan Cameron , Gregory Price , "Li, Ming" , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-cxl@vger.kernel.org Subject: Re: [PATCH V2 1/2] PCI/DOE: Remove the pci_doe_flush_mb() call Message-ID: <20221122195316.GC20515@wunner.de> References: <20221122155324.1878416-1-ira.weiny@intel.com> <20221122155324.1878416-2-ira.weiny@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221122155324.1878416-2-ira.weiny@intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE 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 On Tue, Nov 22, 2022 at 07:53:23AM -0800, ira.weiny@intel.com wrote: > Each struct doe_mb is managed as part of the PCI device. They can't go > away as long as the PCI device exists. pci_doe_flush_mb() was set up to > flush the workqueue and prevent any further submissions to the mailboxes > when the PCI device goes away. Unfortunately, this was fundamentally > flawed. There was no guarantee that a struct doe_mb remained after > pci_doe_flush_mb() returned. Therefore, the doe_mb state could be > invalid when those threads waiting on the workqueue were flushed. > > Fortunately the current code is safe because all callers make a > synchronous call to pci_doe_submit_task() and maintain a reference on the > PCI device. > > For these reasons, pci_doe_flush_mb() will never be called while tasks > are being processed and there is no use for it. Going forward my plan is to allocate all existing DOE mailboxes of a device upon enumeration. That will allow concurrent use of a mailbox by multiple drivers. When a pci_dev goes away, say, because it's been hot-removed, we need a way to abort all ongoing DOE exchanges. pci_doe_flush_mb() seems to do just that so I'm not sure why it's being removed? Thanks, Lukas