Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2488634rwb; Mon, 7 Nov 2022 14:02:21 -0800 (PST) X-Google-Smtp-Source: AMsMyM4yRcXgljt97P5Tma+y0+s210A0cTn6N/keA1beYaJKVyeh4eiLcAP8udh1tnZyEI8O2G5V X-Received: by 2002:aa7:8c59:0:b0:56e:aa67:4fc1 with SMTP id e25-20020aa78c59000000b0056eaa674fc1mr17692736pfd.56.1667858541089; Mon, 07 Nov 2022 14:02:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667858541; cv=none; d=google.com; s=arc-20160816; b=TG5QPjZ5Tb0dqu0S1QYGAsAXpmFwQ2hN5R7QWyxxInfNxYlqgGLpAZsZLiVSBpGUe/ NmNaQ1+3gPhtXTLdmlGM/UYCLl+8svgHRWfXSGap/qt2oY2mzq60oxkoBUIo7APjvf3T PyLqDeunpLKaqgvuONDgrwx+9b86shX/Lkdm2o5PuamNxwNAJKeTXMYlYwA3cUai1QeW xGJeoIa15pH/N4t3D4V3wPQ44uGAVO1L/vnkWA5EzYPOsbFP99wc9o3t3lN7c5PL6Tjh Ff5+WkT5yjIcMZmSDVCwWZOJO8ETFF7y44oeapjXJWQKS6ua0Kd+uiKtdX1PLbojhAaX WliA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:cms-type:mime-version :content-transfer-encoding:content-language:accept-language :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature:dkim-filter; bh=9EeahBanuO7auZquaY2S5pI/4JEI5KFyntys4he8T7M=; b=S7U5XcOegNznStq5qeNueEuk1CTfPhCex0uPRKnuxkpAG0wKrgjHvhDMgyJ3/BqyUs EuVosqrNVgryC1fq6fj/5ixCPyx9lD7cjkTJ++jLeVS7fAcJMfcc0UytkuDrusGIoim5 3Xoyai7bV+GUPLNy98JS+Kn4jDkd8vAEbFNPrcJO8EdGIVh0Dtg4ur/V3tj8vp4MXH/Q UnpM7O5g5KCDs1ek1bzffMbVJIr+uNGgUCMzWJ3KXGLJxS+lGNftDBjy/x2gDQEezxkx h+kQkW5ezXYTQdfSOKdKc7a2T9cNclQc9OCma9QUjhtmXZjLe5809BVjWlkyDQSkXxDX m7uA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=Lf8geb5Q; 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=samsung.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k19-20020aa788d3000000b0056ae8f6df38si12435674pff.180.2022.11.07.14.02.08; Mon, 07 Nov 2022 14:02:21 -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; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=Lf8geb5Q; 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=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232707AbiKGVXO (ORCPT + 91 others); Mon, 7 Nov 2022 16:23:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233252AbiKGVWp (ORCPT ); Mon, 7 Nov 2022 16:22:45 -0500 Received: from mailout2.w2.samsung.com (mailout2.w2.samsung.com [211.189.100.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9C382610; Mon, 7 Nov 2022 13:22:36 -0800 (PST) Received: from uscas1p2.samsung.com (unknown [182.198.245.207]) by mailout2.w2.samsung.com (KnoxPortal) with ESMTP id 20221107212232usoutp0230a4c1ecdcc8d724e5ac70ca4593cd72~lalWYYFLo1004310043usoutp02I; Mon, 7 Nov 2022 21:22:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w2.samsung.com 20221107212232usoutp0230a4c1ecdcc8d724e5ac70ca4593cd72~lalWYYFLo1004310043usoutp02I DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1667856152; bh=9EeahBanuO7auZquaY2S5pI/4JEI5KFyntys4he8T7M=; h=From:To:CC:Subject:Date:References:From; b=Lf8geb5QVoOsTsmja69wOdKjLpKdpUl5QJfXt9Tr16MylzXvbJeFQ1ge0czIkZ2cJ kBiJ7xFE5FjXA57/DKKm2d9yJlW4pwjMt83CLc302pALLRgQIbBTV92hxz2MfRYENd d/P90jBvThclZOvCsSVEHJW4CiGpIOrPxCSGBchU= Received: from ussmges3new.samsung.com (u112.gpu85.samsung.co.kr [203.254.195.112]) by uscas1p2.samsung.com (KnoxPortal) with ESMTP id 20221107212232uscas1p2aa035c51136c44599d44a9c53a9930a3~lalWLIWw-2792327923uscas1p2E; Mon, 7 Nov 2022 21:22:32 +0000 (GMT) Received: from uscas1p2.samsung.com ( [182.198.245.207]) by ussmges3new.samsung.com (USCPEMTA) with SMTP id B4.75.35398.81779636; Mon, 7 Nov 2022 16:22:32 -0500 (EST) Received: from ussmgxs3new.samsung.com (u92.gpu85.samsung.co.kr [203.254.195.92]) by uscas1p2.samsung.com (KnoxPortal) with ESMTP id 20221107212232uscas1p20a000834b76db7a7e459708b06638120~lalVwk97R2792327923uscas1p2D; Mon, 7 Nov 2022 21:22:32 +0000 (GMT) X-AuditID: cbfec370-817ff70000028a46-88-6369771836bd Received: from SSI-EX3.ssi.samsung.com ( [105.128.2.146]) by ussmgxs3new.samsung.com (USCPEXMTA) with SMTP id 16.C5.32876.71779636; Mon, 7 Nov 2022 16:22:32 -0500 (EST) Received: from SSI-EX2.ssi.samsung.com (105.128.2.227) by SSI-EX3.ssi.samsung.com (105.128.2.228) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.1.2375.24; Mon, 7 Nov 2022 13:22:31 -0800 Received: from SSI-EX2.ssi.samsung.com ([105.128.2.227]) by SSI-EX2.ssi.samsung.com ([105.128.2.227]) with mapi id 15.01.2375.024; Mon, 7 Nov 2022 13:22:31 -0800 From: Fan Ni To: "alison.schofield@intel.com" , "vishal.l.verma@intel.com" , "ira.weiny@intel.com" , "bwidawsk@kernel.org" , "dan.j.williams@intel.com" , "Jonathan.Cameron@huawei.com" , "dan.carpenter@oracle.com" CC: "linux-cxl@vger.kernel.org" , Adam Manzanares , "dave@stgolabs.net" , "linux-kernel@vger.kernel.org" , Fan Ni Subject: [PATCH] cxl/region: Fix memdev reuse check Thread-Topic: [PATCH] cxl/region: Fix memdev reuse check Thread-Index: AQHY8u8LeWViEa6a3k+/w2cfyy70nQ== Date: Mon, 7 Nov 2022 21:22:31 +0000 Message-ID: <20221107212153.745993-1-fan.ni@samsung.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [105.128.2.176] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-CFilter-Loop: Reflected X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrEKsWRmVeSWpSXmKPExsWy7djX87oS5ZnJBmu+KFrcfXyBzaJ58mJG i9f/prNYTJ96gdFi9c01jBb7nz5nsVi18BqbxflZp1gsLu+aw2Zxa8IxJgcuj5Yjb1k9Fu95 yeSxaVUnm8fHp7dYPKbOrvf4vEkugC2KyyYlNSezLLVI3y6BK6Np0lrGgm1sFbe2fGBuYNzE 2sXIySEhYCLRdfICexcjF4eQwEpGiQmTnjJCOK1MEhv+bWCEqep89gesQ0hgLaPEgiYVCPsj o8Sb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VwZTRNWstYsI2t4taWD8wNjJtY uxg5OSQETCQ6n/0Bsrk4hARWM0pMePkYyvnIKPHjyCVGCGcpo0THjP3MIC1sAooS+7q2s4Ek RASamSXe7pwMVsUs8IlR4lnnJiaQKmEBY4kr166BLRERsJA4feQxUAcHkK0ncaktDyTMIqAi caZzOguIzQtUMunUSTCbUUBM4vupNWBjmAXEJW49mc8EcauAxJI955khbFGJl4//Qf2gKHH/ +0t2iHo9iRtTp7BB2NoSyxa+ZoaYLyhxcuYTFoh6SYmDK26wTGAUnYVkxSwk7bOQtM9C0r6A kWUVo3hpcXFuekWxcV5quV5xYm5xaV66XnJ+7iZGYJSe/nc4ZgfjvVsf9Q4xMnEwHmKU4GBW EuG94ZaWLMSbklhZlVqUH19UmpNafIhRmoNFSZzXI3ZivJBAemJJanZqakFqEUyWiYNTqoEp 5xfbw1WfAnZeZLp/dR0f26xCk6B6jRs/5z+o2XrXt1OH46Xmx9v79vzu+Dcv9cqnqA8//ydw ZZ0WO6NbqT2TJ96KL0jhKvsat9NzXylYebvuS92iurwr/POP59fT3m6yP1T1k7lE3PqA04xI zfQDXOYXbtgZ3dqx/Ij2L5EcPd1/0gHiBuU2609eV2VhuNu/Yo3PtMsVj/gPi/H/2sv1re6D +65vvYtnBXc/2lYqZm+fVhS8dFu3ZM4cplOrdPTCrO+tWlGtvfCctOLvmcZx0wWYeb0f/n6r ynZ0BpNnQR9fSl/hI+na9LvPP128L3nwXypn8IffS6v/2cmVrOuYsdEjfOIXu/kPVrYu+ubF qsRSnJFoqMVcVJwIAMlK5HVBAwAA X-CMS-MailID: 20221107212232uscas1p20a000834b76db7a7e459708b06638120 CMS-TYPE: 301P X-CMS-RootMailID: 20221107212232uscas1p20a000834b76db7a7e459708b06638120 References: 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, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,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 Memdev reuse in a region currently does not iterate over all of the interleave targets. Fix this by using existing iterator for memdev reuse check. Fixes: 384e624bb211 ("cxl/region: Attach endpoint decoders") Signed-off-by: Fan Ni --- drivers/cxl/core/region.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c index f9ae5ad284ff..c7152b4bd9eb 100644 --- a/drivers/cxl/core/region.c +++ b/drivers/cxl/core/region.c @@ -1226,7 +1226,7 @@ static int cxl_region_attach(struct cxl_region *cxlr, struct cxl_endpoint_decoder *cxled_target; struct cxl_memdev *cxlmd_target; =20 - cxled_target =3D p->targets[pos]; + cxled_target =3D p->targets[i]; if (!cxled_target) continue; =20 --=20 2.25.1