Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp10926883rwd; Thu, 22 Jun 2023 06:44:06 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7Ih7rgyYtBnzOkR8NALbbjbh3ANXYzjqmGbPWiCZrhTjP4mIYFEEcVe/3H8OCdWjBFPN8c X-Received: by 2002:a17:902:8203:b0:1a6:4b60:3195 with SMTP id x3-20020a170902820300b001a64b603195mr11272510pln.66.1687441445902; Thu, 22 Jun 2023 06:44:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687441445; cv=none; d=google.com; s=arc-20160816; b=fkQEfB1mpKPCbZqKhjKa/nFuBuakkOVgOerZJ6Xt+A5dUV2Y34+LHoNLvYigNMwU+1 tZN+xHxJztir3mKTe2m+anyKhKpbL//kZj8PBTKA+fyOz52hftgDnlHKPRa44riSMC6d XsynD0xT1eQnsuMMuwY5m4E2/s4kPvuA5uNZAUCrKV+uRVBNMQjSryMxuu1PQSOMO9er MO76Fl69v2w07wnFwxlnhyJGstPjhwa3CLLV+9r+3qFRaY9pyQyp8UKx7nN34QPygwqb 1+noZSpQx832DTzNbPQj0P2X/cxY1R1nRGWFAMdMAGFhSVskNOTfANafdYuc6NCa6Ae2 3FUA== 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=ig7TA//tsJC9dAmssw6LNQpChJ5C0cOXgL886CpiZ7o=; b=l8lUNgtL6oB5xBPfDun4bmwPPYOIvY6BluCN3GwAOz32Q0766sNIb2E+8aa3Toa3CC +39vLtGUknZ3m1aSSBKSz+LmA3O0Rr9OQWGrDxWroLt6ROp1ceZA5l9Xw8uy13LGN4Tj Ezf6/Qcy3vr4AqGSdAUz1F2YQLrQAXpP4lvzXOpXk0+90x18UQIboEL+HU/b0hnK3LEf XI75C9M5Xa5h5RoX3xZIG8d+eczro+im9rcdrSsTncI755szWG7zcUN7oCcwucwdfgw4 fvWvgVUlAIz7BVV+X1ZQrAtOG8Oo9JdOknZlGO6FGXr2Se6owQe7yb+BEUETsH2jvQ77 o3JQ== 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 e10-20020a170902e0ca00b001adb857fc79si316382pla.105.2023.06.22.06.43.53; Thu, 22 Jun 2023 06:44:05 -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 S231189AbjFVNUI (ORCPT + 99 others); Thu, 22 Jun 2023 09:20:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230506AbjFVNUG (ORCPT ); Thu, 22 Jun 2023 09:20:06 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53C86E7E; Thu, 22 Jun 2023 06:20:04 -0700 (PDT) Received: from lhrpeml500005.china.huawei.com (unknown [172.18.147.226]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Qn1Cy6fyTz6J6Bn; Thu, 22 Jun 2023 21:18:54 +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; Thu, 22 Jun 2023 14:20:02 +0100 Date: Thu, 22 Jun 2023 14:20:01 +0100 From: Jonathan Cameron To: Terry Bowman CC: , , , , , , , , , Subject: Re: [PATCH v6 15/27] cxl/port: Store the port's Component Register mappings in struct cxl_port Message-ID: <20230622142001.000016ac@Huawei.com> In-Reply-To: <20230622035126.4130151-16-terry.bowman@amd.com> References: <20230622035126.4130151-1-terry.bowman@amd.com> <20230622035126.4130151-16-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 Wed, 21 Jun 2023 22:51:14 -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