From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 83373C43219 for ; Mon, 21 Nov 2022 11:12:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229984AbiKULMQ (ORCPT ); Mon, 21 Nov 2022 06:12:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230340AbiKULLh (ORCPT ); Mon, 21 Nov 2022 06:11:37 -0500 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FF402250E; Mon, 21 Nov 2022 03:07:45 -0800 (PST) Received: from frapeml500003.china.huawei.com (unknown [172.18.147.207]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4NG4KS3Rplz6H7TF; Mon, 21 Nov 2022 19:04:44 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (7.191.163.240) by frapeml500003.china.huawei.com (7.182.85.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 21 Nov 2022 12:07:16 +0100 Received: from localhost (10.202.227.76) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 21 Nov 2022 11:07:15 +0000 Date: Mon, 21 Nov 2022 11:07:14 +0000 From: Jonathan Cameron To: "Zhuo, Qiuxu" CC: "Weiny, Ira" , "Williams, Dan J" , Bjorn Helgaas , "Gregory Price" , "Li, Ming4" , "Verma, Vishal L" , Lukas Wunner , "Schofield, Alison" , "linux-cxl@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-pci@vger.kernel.org" Subject: Re: [PATCH] PCI/DOE: Remove asynchronous task support Message-ID: <20221121110714.0000720a@Huawei.com> In-Reply-To: References: <20221119222527.1799836-1-ira.weiny@intel.com> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.202.227.76] X-ClientProxiedBy: lhrpeml100002.china.huawei.com (7.191.160.241) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On Mon, 21 Nov 2022 02:01:32 +0000 "Zhuo, Qiuxu" wrote: > > From: Ira Weiny > > ... > > > > @@ -423,25 +399,13 @@ struct pci_doe_mb > > *pcim_doe_create_mb(struct pci_dev *pdev, u16 cap_offset) > > doe_mb->pdev = pdev; > > doe_mb->cap_offset = cap_offset; > > init_waitqueue_head(&doe_mb->wq); > > + mutex_init(&doe_mb->exec_lock); > > In real world, not sure whether there is a case that pcim_doe_create_mb() is invoked by > multiple drivers to create multiple DOE mailbox instances? If there is such a case, we may > need to ensure there is only one DOE mailbox instance for a physical DOE of pdev @cap_offset. I think if that happened we'd have a lot of mess. The main PCI driver for a given EP, switch port etc needs to handle this part. Sub drivers can then do similar to https://elixir.bootlin.com/linux/latest/source/drivers/cxl/core/pci.c#L465 to find a DOE instance that supports what they need and use it. The DOE code 'should' work fine when doing this - the request/response pairs will be serialized. We have discussed moving that 'find' logic and the xarray into the PCI core and that will need to happen to support CMA etc. For the first submission it was easier to just do it in the CXL drivers.. Jonathan > > -Qiuxu