Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp12478394rwd; Fri, 23 Jun 2023 06:44:53 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4SoOAfOlJxSxPOPeQX/dHhIsJz2oHpYz0w1jpSwvSqvhaKXW6+tYqf/WsuskIpFKq6I/Aa X-Received: by 2002:a05:6a20:1044:b0:123:7989:ba4b with SMTP id gt4-20020a056a20104400b001237989ba4bmr6337882pzc.41.1687527893358; Fri, 23 Jun 2023 06:44:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687527893; cv=none; d=google.com; s=arc-20160816; b=Y5hRi4LsYFuCH3Q5YEV4Utr6xt8vIFcc8+6kXQ+phKaRaaZqwrg1abM6AOKgm4q02h ENFTWwNfK68kmFQUX+Z874MnhIbz0CsKa03v9mfg6+F0aoGrJYaNuS3qCNonC1XI/nZ5 hk/nhzuSjxbUj2T8eg455/r3WpFzlZ5/NBqn4bMd8VImW59Th7ab3LAzewf+QAEvABAw lUz6kYmdkDA5A+E1e4046jai2iR9mswV5Fi6Y+I57V9CU/t5hKKTGS2lIrqCoQtT4Ac8 Ko9upet4zBxvQ3qWQzOpHTgpaIrBGU8HqvEJMfiIW1AK5bTmMByw3GBHUt4ZYXBFtHop Ei9w== 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=oNiPo1o0CSpCN+glQmXf92eC6WNbG0/uneLmnJ/j8/4=; b=ER03+67/UCJQeuWX70zVpYy78wmsNuNXh8XmfmbiNyuk79s8/6pM5MPM7pUh6n04Qs 81BiaTbvomrJ4QWv7+4UoU2y2WTd/kOx74NAJpC39I8E5WUyiGvTHFbKQ55ngTEz52FM 429RWo6SfDV5jUT7J3v9lHHVXsr2BQGHbVWEUaF4Xtknjj36zcnZYYQdjKrGGOAgkhB+ ldMjrDAs2dOaDTAtjzdbQv+Ypc118oXzIVLczwRI6UrEpD9rcL80U+Uv1F0AFsSypelB gBkZM3srF8n5I5S99H8QgPAk0WCfT9C2BbCyfIuQfdVdVy3mozvooCZtKEqY+hbYDlGe GGvA== 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 c7-20020a633507000000b00553b512757fsi8846393pga.169.2023.06.23.06.44.40; Fri, 23 Jun 2023 06:44:53 -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 S231305AbjFWNcd (ORCPT + 99 others); Fri, 23 Jun 2023 09:32:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229657AbjFWNcb (ORCPT ); Fri, 23 Jun 2023 09:32:31 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A45B52130; Fri, 23 Jun 2023 06:32:30 -0700 (PDT) Received: from lhrpeml500005.china.huawei.com (unknown [172.18.147.200]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4QndRp0hpJz6J66G; Fri, 23 Jun 2023 21:31:18 +0800 (CST) 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.2507.27; Fri, 23 Jun 2023 14:32:28 +0100 Date: Fri, 23 Jun 2023 14:32:27 +0100 From: Jonathan Cameron To: Terry Bowman CC: , , , , , , , , , Subject: Re: [PATCH v7 14/27] cxl/port: Store the port's Component Register mappings in struct cxl_port Message-ID: <20230623143227.00001bf6@Huawei.com> In-Reply-To: <20230622205523.85375-15-terry.bowman@amd.com> References: <20230622205523.85375-1-terry.bowman@amd.com> <20230622205523.85375-15-terry.bowman@amd.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="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.202.227.76] 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_H4,RCVD_IN_MSPIKE_WL,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 Thu, 22 Jun 2023 15:55:10 -0500 Terry Bowman wrote: > From: Robert Richter > > CXL capabilities are stored in the Component Registers. To use them, > the specific I/O ranges of the capabilities must be determined by > probing the registers. For this, the whole Component Register range > needs to be mapped temporarily to detect the offset and length of a > capability range. > > In order to use more than one capability of a component (e.g. RAS and > HDM) the Component Register are probed and its mappings created > multiple times. This also causes overlapping I/O ranges as the whole > Component Register range must be mapped again while a capability's I/O > range is already mapped. > > Different capabilities cannot be setup at the same time. E.g. the RAS > capability must be made available as soon as the PCI driver is bound, > the HDM decoder is setup later during port enumeration. Moreover, > during early setup it is still unknown if a certain capability is > needed. A central capability setup is therefore not possible, > capabilities must be individually enabled once needed during > initialization. > > To avoid a duplicate register probe and overlapping I/O mappings, only > probe the Component Registers one time and store the Component > Register mapping in struct port. The stored mappings can be used later > to iomap the capability register range when enabling the capability, > which will be implemented in a follow-on patch. > > Signed-off-by: Robert Richter > Signed-off-by: Terry Bowman Reviewed-by: Jonathan Cameron