Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp4140318rwb; Mon, 21 Nov 2022 04:20:39 -0800 (PST) X-Google-Smtp-Source: AA0mqf6PzpW4sURmiZtiTnNKLNwONjcWFYmf+XBZqTwYLkyHfmHFh+4HpKnFx4aXcBWtd9K2g/YH X-Received: by 2002:a17:90b:1283:b0:218:5854:4dbd with SMTP id fw3-20020a17090b128300b0021858544dbdmr19846582pjb.59.1669033239062; Mon, 21 Nov 2022 04:20:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669033239; cv=none; d=google.com; s=arc-20160816; b=QJuxLaDOFcZ3VbEltRos9ihPKcDAutxgkLDVxpSvM5XozhanNCRwf8KbFQqpuD5z5V Ucfmao6OppwOt/1YZk8LUcN9TyM/vp2xrcTYI6dt3gs+fW8y0JkKiX/47NDwXdueCO2g 8aNigfIUC3ZIRkzp2HraePovNNDYfntoOLkTnulktyZnXAfGI/Ciwkz2uVThKX2RxtXD pxSL6c4n06Qaoy1Ju9s6I8D/eE0mzysXk2Re+HJgovkaLLKE7Vy614vq/rlb44DqYa/M 2Tn4NCfLjNzbtXm5hUV9m37HEK2KHjWLQR0g1D98/Ua21zJVtpiYXxnEqD4bwVLjK6Ue ecxQ== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=s9OO0sPKCbrjUOtr5uRkzX6fkv0gG5F4xd3qJVY5iYg=; b=IMQ8T5KB5tuEJVESQzxCIcmkAWw5QnaNqUsJ8YsEP6nsZqsQueW8jFi4FJuIcCdHW/ J8R7jQKUrvVjdKmRaHugn03V5wy1+CniZrfbWtKGKi/kYNl8XPS8wIMkHraF0+gvYT76 Z9a+JVrzMIYnETkQXy1PBc/taHt4g5sSr7dC3U+gUF3mRR+KKtdtDnh2rStfZ9u77ccB d/POApy55mWhYZE8G8lj+KHFGEHyDkj8IDv1wDfJUA2/DUnc09J5qOp6/NFlnOK1uq51 /z0VilIpb6BL710amldSFeohF7atpIxJk8Rb5kKo9G8SqWhKiwHYDvVRs9blBbebHIB7 GP9w== 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w184-20020a6230c1000000b00571d4ca44ddsi10040127pfw.333.2022.11.21.04.20.24; Mon, 21 Nov 2022 04:20:39 -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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230072AbiKULMW (ORCPT + 92 others); Mon, 21 Nov 2022 06:12:22 -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 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS 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 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