Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp4094227rwb; Tue, 6 Sep 2022 02:22:28 -0700 (PDT) X-Google-Smtp-Source: AA6agR4yvsJwU0y5mP2oYt5QUQZnlMJux5aN2xdVA+xWCoVcZqffg6iB9XkTimHokP2/ezXnZyuB X-Received: by 2002:a17:907:2bd5:b0:76f:591c:466b with SMTP id gv21-20020a1709072bd500b0076f591c466bmr709495ejc.504.1662456148003; Tue, 06 Sep 2022 02:22:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662456147; cv=none; d=google.com; s=arc-20160816; b=dOVoZrgWjHv7uAceLKUQKoMnCTxXcJbVBdtE48iYPF1VJ7oCs8nQZGRaYwPDOZp/z8 xD3KAcdsU2RcbHHBcPR//cDgcriwo4Ph8O5Fa8jpVM4C2nUOkH89PQ8RztrnaJhUpnW5 nLk6EC50t1Oxny37264ZGETWhsxxZ5bHzTdCV1eJxOtK9cZPl8vXamng0zPufRO0mtwZ Sxmny7uaPLDAjrQ8RCgSiRomGZPJCBN8WFXgxGmXgoLK5XZ2jY3qfwS0Uv9jQUHl/MjE bppAN8Chc6KFUHu7QSid5mpFmck7Xa3fjEDDkGNe856h4RyS/PIT1wL5GHOAemSwqYbA FsQg== 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 :references:in-reply-to:message-id:subject:cc:to:from:date; bh=89gHAfQF+poqv/KSlbIamL9Y2+QM48RHD2CnHsrQegY=; b=iflI5BsUbwxiHV3IT3mMGqWUmRsqrcIYOXHw5zpztSiJEzhLXASRdpbXSJmXt6qTgy 7qAM3omNXhgzaEC616Ksxf6kStQcTJJc1n6cWq4EggA0v+qsXmqjYBe45Zjmzqh+sI8p ZV8Yh7mzJCi4edJ/gyErGu4zYUmc63djRWS/+QxASLhHwxsAIzplbTbUbKJ/OA2R4QcM GktEqIImF0DcF24vViV8U7fdcy/T5gqiGLbND7Yl2QnKXJa6sj2vD2i34SYYxn2EikTz UtQhGQUEXcubsHxDHYRfYF44dwhBKwWzsifpV5PRYMjwPjo4fqsS/RQhRZ9+PtWqURtu og/A== 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 y6-20020a056402358600b0043d604a5bf7si11279061edc.93.2022.09.06.02.22.03; Tue, 06 Sep 2022 02:22:27 -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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232179AbiIFIyG (ORCPT + 99 others); Tue, 6 Sep 2022 04:54:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239027AbiIFIxc (ORCPT ); Tue, 6 Sep 2022 04:53:32 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDDF221B6; Tue, 6 Sep 2022 01:53:30 -0700 (PDT) Received: from fraeml713-chm.china.huawei.com (unknown [172.18.147.201]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4MMK0G5sQNz687YW; Tue, 6 Sep 2022 16:52:46 +0800 (CST) Received: from lhrpeml500005.china.huawei.com (7.191.163.240) by fraeml713-chm.china.huawei.com (10.206.15.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 6 Sep 2022 10:53:29 +0200 Received: from localhost (10.202.226.42) 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, 6 Sep 2022 09:53:28 +0100 Date: Tue, 6 Sep 2022 09:53:27 +0100 From: Jonathan Cameron To: Robert Richter CC: Alison Schofield , Vishal Verma , Ira Weiny , Ben Widawsky , Dan Williams , , , Bjorn Helgaas , "Rafael J. Wysocki" , Len Brown Subject: Re: [PATCH 05/15] cxl/acpi: Add probe function to detect restricted CXL hosts in RCD mode Message-ID: <20220906095327.0000405b@huawei.com> In-Reply-To: References: <20220831081603.3415-1-rrichter@amd.com> <20220831081603.3415-6-rrichter@amd.com> <20220831110804.00003812@huawei.com> <20220901111038.00002e00@huawei.com> X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.29; i686-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.202.226.42] X-ClientProxiedBy: lhrpeml100005.china.huawei.com (7.191.160.25) 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,T_SCC_BODY_TEXT_LINE 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, 6 Sep 2022 09:19:49 +0200 Robert Richter wrote: > On 01.09.22 11:10:38, Jonathan Cameron wrote: > > On Thu, 1 Sep 2022 08:01:05 +0200 > > Robert Richter wrote: > > > On 31.08.22 11:08:04, Jonathan Cameron wrote: > > > > On Wed, 31 Aug 2022 10:15:53 +0200 > > > > Robert Richter wrote: > > > > > > The probe function is triggered by adding an own root device for RCHs. > > > > > This is different to CXL VH where an ACPI "ACPI0017" root device > > > > > exists. Its detection starts the CXL host detection. In RCD mode such > > > > > a device does not necessarily exists, so solve this by creating a > > > > > plain platform device that is not an ACPI device and is root only for > > > > > RCHs. > > > > > > > > If I read this correctly that platform device is created whether or not > > > > there are any cxl devices in the system? > > > > > > > > Can we create it only if we find some devices that will be placed > > > > under it later? > > > > > > This would move the host detection from probe to init which I wanted > > > to avoid to better control driver init order dependencies. > > > > It's a bit nasty either way. I can see your reasoning, but > > definitely not keen on it if there is a plausible way to avoid. > > > > > > I could add a put_device() at the end of a probe so that it will be > > > released in case no other references use it. This implies the refcount > > > is maintained for parent devices. Or this needs to be added to. So if > > > there are no children (hosts) attached to the root device after probe, > > > it will disappear. > > > > Unless there is precedence for that, it'll be weird enough to be > > hard to maintain. I guess I can live with the ugliness if we can't > > add something new to ACPI to base this off. > > Let's stay with a put_device() for now. Then, we wont have a stale cxl > root device in the system in case there are no RCD children. > > -Robert Kind of obvious, but... Make sure to call that out as an unusual thing to do via cover letter / patch description so we hopefully get more eyes on this detail.. Jonathan