Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp11431rwn; Wed, 7 Sep 2022 11:37:47 -0700 (PDT) X-Google-Smtp-Source: AA6agR5UoZIN1v+aU14oVVXBo8BLePzrWIEqf/ONfPwLxjD622lSdru/rKaYZC2pscTMLyexhKcl X-Received: by 2002:a17:907:6da1:b0:73d:877d:c56c with SMTP id sb33-20020a1709076da100b0073d877dc56cmr3318714ejc.342.1662575867419; Wed, 07 Sep 2022 11:37:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662575867; cv=none; d=google.com; s=arc-20160816; b=tDZW80mwdzXJp5Ff4PR096BAzlqDimrUsaBSUZ/q13HFRzg+AX+xYTPD794v8lJq0w lTTzYPHX7kKU3Z9mfM2ljOoe/YJpAebcgom0QfYRcvDfms2hrw5PTmIjpgkuPVmlLO2V korxlcAhZQWhUE5mE9eeFMQbBJvHkeG2EUyq9CRVgB/6e0fZsJkgG8pdnRyuYMYrOiH/ xuAVufDic/74NGBVBKhwqk0Zy0PoXeWiUcaGF88YKtsUcb0LyR7Oagu8RXsfmFQ+dDWF suZmfDcf8siTZ9lKawMowErxpT0YZi02ssBd/dbXdDASijxZhOwykg3VeFB95F7tOyvx CR5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=3I33dzfyR5ARYxGb/oZhYP2Vo0j+R0aC7VIDprnswEM=; b=SiOndZ94ryrLWOnhBL4hec6J/skuOFr93npDv7a9qTZvQqjv/ZnjJbpiQFDB+wP12T twfEx/RA21ky2JXNLfvovQjOL/KTcE9sJaykZezN7tKzSi8ZwvrO95AtKKLVJDuQo3W1 j8ejEQOWEoK30jSvcrP295zom9akrRC1y7gZXgJFLqH7996Cs6Lt1j0iq2fCGWTJBng0 K/XH8pWq0MMq37vGueANqJEPa7pAugV9lNk1lFQ+G8ONID5ZDBFcDBFLCaNc4eRXkZAS 1ZEXtuqohakv8mD7aoIUIQwxZ1vp70OEkKkPAxd2IkUdoSN/9aZcJPIKKKBcJihhusmO Lpdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Pf0ROvV8; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ek10-20020a056402370a00b0044d7a93e44dsi8870938edb.579.2022.09.07.11.37.22; Wed, 07 Sep 2022 11:37:47 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Pf0ROvV8; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229963AbiIGSWo (ORCPT + 99 others); Wed, 7 Sep 2022 14:22:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229495AbiIGSWm (ORCPT ); Wed, 7 Sep 2022 14:22:42 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8F8CB6D3C; Wed, 7 Sep 2022 11:22:41 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E85CA619FC; Wed, 7 Sep 2022 18:22:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 21840C433D6; Wed, 7 Sep 2022 18:22:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662574960; bh=Pkr1VvhGYTg8QJDpcdOK6Hab6jKDX9QoWXLoxDwLXps=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=Pf0ROvV8VgS0K2jblECNPhnHxkA09Cg+w+nZrcEdk+FC7o03qj7YRfJLQqvCvJ0jl i9q/JgljJ3sXgmcEPVdZbjtOaYPoGHoHi5Qpc3hVh/+k298XtQmsAjlRhTPp6/0eAG PLFejE8hcJ3JRmqNkBC0zr7ipdCXuEfkOadpl34rkgmrEV8w5PoLaO46ZFeuofMOHR ATEAY9IrQWdIp+kS6VQBIKMUsBaVZVmDmjN5MKEtwwOsr/bISzBkb94DNKNCFvqRkY ocdkTM1mKQPBqUXA+p5RLNvaJ9PmSnzi/WnyhSs6ViGJDLl0Gzh8pEZE6ibe7Ri7HF wgm/YE4yFUmtw== Date: Wed, 7 Sep 2022 13:22:38 -0500 From: Bjorn Helgaas To: Robert Richter Cc: Alison Schofield , Vishal Verma , Ira Weiny , Ben Widawsky , Dan Williams , linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org, 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: <20220907182238.GA134795@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220831081603.3415-6-rrichter@amd.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 Wed, Aug 31, 2022 at 10:15:53AM +0200, Robert Richter wrote: > Restricted CXL device (RCD) mode (formerly CXL 1.1) uses a different > enumeration scheme other than CXL VH (formerly CXL 2.0). In RCD mode a > host/device (RCH-RCD) pair shows up as a legal PCIe hierarchy with an > ACPI host bridge ("PNP0A08" or "ACPI0016" HID) and RCiEP connected to > it with a description of the CXL device. > > Add function cxl_restricted_host_probe() to probe RCD enumerated > devices. The function implements a loop that detects all CXL capable > ACPI PCI root bridges in the system (RCD mode only). The iterator > function cxl_find_next_rch() is introduced to walk through all of the > CXL hosts. The loop will then enable all CXL devices connected to the > host. For now, only implement an empty loop with an iterator that > returns all pci host bridges in the system. > > 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. Drive-by nitpicks: s/PCI root bridges/PCI host bridges/ to match other uses s/pci host bridges/PCI host bridges/ to match other "PCI" uses s/does not necessarily exists/does not necessarily exist/