Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5660337rwb; Tue, 22 Nov 2022 03:14:41 -0800 (PST) X-Google-Smtp-Source: AA0mqf557h4c71UlNAMazU11l9Y/I5uqvPuJbW3Ft6asnWaMEdBDHZljeggWil56k6NZMOAaB7Aa X-Received: by 2002:aa7:d408:0:b0:468:677a:877 with SMTP id z8-20020aa7d408000000b00468677a0877mr20344920edq.407.1669115681551; Tue, 22 Nov 2022 03:14:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669115681; cv=none; d=google.com; s=arc-20160816; b=09ocHzkzZXiyIzdzpB6WfkINL/YgXGU2BTO1Nu4ep8iqMF3b12ZV0nUsfnlX0WWC8q Nqg/pzn5oeI1UmFQnIneDmY/5j3zIbVNV4gGSTW14AFSwvYvb4jXmPHMN/B6Oml97Hkp 4QLK4YLKgzi6hiqkXCI16VNutJiAv9MUZW6lTdQy5GP6/jafympClRBA9FG5coQ3tqu9 bxqy/zQN4GIpYzT2UsTrXGH2VusyUy442lhEgiZX+txXkYCOtdD4E+dxaw74GBB7nwWj H2zVkHQLE/rP8l4SAfZG8gLFBeVseAybjeR/MyqJy640b0vh2kUGaZP+fSJa3F8XAUbZ 6uMw== 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=L54QDn7sb/uLijvyHBJU8g4yxcziJtVjDEvYw/AjAFo=; b=j7iTMlBBtdfODsBYN1unNU7ssbUjsvRia2vibPg9fbMXa+lHUN4XbV1NXTj/xMleD5 PoC9XOSySLOds6q9yz8jyVsZiuAnncFEbXnAizXhw+klwmTr8ZgkXMjC6JXcbIbRjoqk cxJVRrAeQkLdmEsNdpy6qbCBr5Su8qN4co8bkvBhsE3Q9tSmMcYv2kIBZnEn8AbdOD1k 1zusU8ukVS+ffrjus7CFVBY74MstsIaC03fI3xd28dWtM4uu0TMBGvAWZcb1cYHu1XAf mtrd26ztkhEP2G28r36/DEgPN5fimpl1cG/74BVi8DlHNwsQ7Ni9Fo9nyiP9WhhiGpIr gJqA== 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 lx8-20020a170906af0800b007ae814af686si85242ejb.974.2022.11.22.03.14.18; Tue, 22 Nov 2022 03:14:41 -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 S232845AbiKVJoe (ORCPT + 91 others); Tue, 22 Nov 2022 04:44:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232343AbiKVJob (ORCPT ); Tue, 22 Nov 2022 04:44:31 -0500 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BE30D2CE; Tue, 22 Nov 2022 01:44:29 -0800 (PST) Received: from fraeml705-chm.china.huawei.com (unknown [172.18.147.207]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4NGfRP5y2Bz6H7VF; Tue, 22 Nov 2022 17:41:53 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (7.191.163.240) by fraeml705-chm.china.huawei.com (10.206.15.54) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2375.31; Tue, 22 Nov 2022 10:44:26 +0100 Received: from localhost (10.45.149.88) 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; Tue, 22 Nov 2022 09:44:26 +0000 Date: Tue, 22 Nov 2022 09:44:22 +0000 From: Jonathan Cameron To: Davidlohr Bueso CC: , , , , , , , , Subject: Re: [PATCH 1/2] cxl/mbox: Add background operation handling machinery Message-ID: <20221122094422.000032f0@Huawei.com> In-Reply-To: <20221121214804.zy6i5basztlim66t@offworld> References: <20220804045029.2905056-1-dave@stgolabs.net> <20220804045029.2905056-2-dave@stgolabs.net> <20220825134152.00005244@huawei.com> <20221121214804.zy6i5basztlim66t@offworld> 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="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.45.149.88] X-ClientProxiedBy: lhrpeml500001.china.huawei.com (7.191.163.213) 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 13:48:04 -0800 Davidlohr Bueso wrote: > On Thu, 25 Aug 2022, Jonathan Cameron wrote: > > >> +/* > >> + * Ensure that ->mbox_send() can run safely when a background > >> + * command is running. If so, returns zero, otherwise -EBUSY. > > > >As above, I'm not sure this is necessary given you should get > >a sensible error code in response to any such message. > >E.g. media disabled. > > So this is necessary to prevent mischief in the polling case > where you can have windows where the driver is out of sync > with the hardware - hw finishes async command but driver > (sleeping poller) has not acknowledged this. In the irq case, > yeah this would be redundant and not needed. > Ok. A worked example might be useful for where this matters at a higher level. For example, if there is no conflict at the hardware level what goes wrong in the software as a result of dropping the protection on the one that we haven't yet detected as finished... Jonathan > Thanks, > Davidlohr