From patchwork Mon Feb 6 01:03:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 13129235 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3E609C636CC for ; Mon, 6 Feb 2023 01:03:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 413746B0080; Sun, 5 Feb 2023 20:03:28 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3E8CE6B0082; Sun, 5 Feb 2023 20:03:28 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 150D06B0085; Sun, 5 Feb 2023 20:03:28 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id F3D3B6B0080 for ; Sun, 5 Feb 2023 20:03:27 -0500 (EST) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id CC08616090A for ; Mon, 6 Feb 2023 01:03:27 +0000 (UTC) X-FDA: 80435068854.02.B64310F Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by imf11.hostedemail.com (Postfix) with ESMTP id CA91240007 for ; Mon, 6 Feb 2023 01:03:25 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=X5XV5SF7; spf=pass (imf11.hostedemail.com: domain of dan.j.williams@intel.com designates 134.134.136.126 as permitted sender) smtp.mailfrom=dan.j.williams@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1675645406; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=D/bJOO1mS1zFW+X1GhlTLkQPeNBZ6+P3WTqVqsv2v7g=; b=OW+ljQzc34drVxKKMxq42nLvXzakySro6wJ40Y3dEngfPNEsxw64X3esoqtPET4rOt+CA4 jK2KYM6oT5IvcOWznoXpYevZTiJS8rPTS8GKQYVGpIpE+SF+zC0aUZBoR+kDbFmqCCA8QY Km+mX+0XBTutjWk8grA2/mgQBv/utlo= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=X5XV5SF7; spf=pass (imf11.hostedemail.com: domain of dan.j.williams@intel.com designates 134.134.136.126 as permitted sender) smtp.mailfrom=dan.j.williams@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1675645406; a=rsa-sha256; cv=none; b=JEsTVjP7fD2H43tm4le0cqMQG+DRkkpJdynBIAbk46gM8aYVLi8+H63SrZq+sbgSbvpmgh jFE8UGiVh5t/UOemriaXEt164Hh/aeym/L6YdumXzzoYooyXG3vGBmNEi2jNW9taesvi+9 AVgXfwMlbbzTXZMRyxsxNmkLyjQanbk= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675645405; x=1707181405; h=subject:from:to:cc:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=p3cJbdfBQzbXgLwCpMurOEl3oekEj08Qxoo3cX7rCec=; b=X5XV5SF7dVYfv53QwVVGbEhdhn4OT71WXRkFOX8nhVyBJ2+Ja407c0Bs TFKgzn6X1Aiw0yC4T3+vxvVIYnymDbCjHNVXEaCuiLZQTseU+f7nx0+wr V8G0r1jiorHVAWHcEeVVvAPXjmN/nafADqKP+Rbqp6EVY5hj1FciAP1Z7 ViP6u/gWCxZuNH8IdaOxDR0NPI/lOOuQoQ5Hn0w8vtQ8LwTzf+40w3wZv Dn+an039/64w6HArMtcFMxi5ifEC9lQiw16tG1/7gX4Yu2o+6yBuJTKGb lP0ZIhtaLU7jfCBAzDGK1bHjtEAu9U7MXOSQa6/ZjMziR+i73UwfnDBHz g==; X-IronPort-AV: E=McAfee;i="6500,9779,10612"; a="312763216" X-IronPort-AV: E=Sophos;i="5.97,276,1669104000"; d="scan'208";a="312763216" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Feb 2023 17:03:24 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10612"; a="616291328" X-IronPort-AV: E=Sophos;i="5.97,276,1669104000"; d="scan'208";a="616291328" Received: from mkrysak-mobl.amr.corp.intel.com (HELO dwillia2-xfh.jf.intel.com) ([10.212.255.187]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Feb 2023 17:03:24 -0800 Subject: [PATCH 10/18] cxl/region: Fix passthrough-decoder detection From: Dan Williams To: linux-cxl@vger.kernel.org Cc: stable@vger.kernel.org, dave.hansen@linux.intel.com, linux-mm@kvack.org, linux-acpi@vger.kernel.org Date: Sun, 05 Feb 2023 17:03:24 -0800 Message-ID: <167564540422.847146.13816934143225777888.stgit@dwillia2-xfh.jf.intel.com> In-Reply-To: <167564534874.847146.5222419648551436750.stgit@dwillia2-xfh.jf.intel.com> References: <167564534874.847146.5222419648551436750.stgit@dwillia2-xfh.jf.intel.com> User-Agent: StGit/0.18-3-g996c MIME-Version: 1.0 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: CA91240007 X-Rspam-User: X-Stat-Signature: ke8jrx7k9esapnq4sf5n65i3x4ruw893 X-HE-Tag: 1675645405-536569 X-HE-Meta: U2FsdGVkX1+rmNcdKMDqYDrUd5H9BAnS86ljFzDMbkM0Pv6/J1r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HPMDKqi7Sph78GFRFqsoprJ5fnTVfyfg7k8KEfgitmbw0MQiVSJPK5gs27wbKAnwFNf8QVdDv+APf7I6vSo1a9jBGA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: A passthrough decoder is a decoder that maps only 1 target. It is a special case because it does not impose any constraints on the interleave-math as compared to a decoder with multiple targets. Extend the passthrough case to multi-target-capable decoders that only have one target selected. I.e. the current code was only considering passthrough *ports* which are only a subset of the potential passthrough decoder scenarios. Fixes: e4f6dfa9ef75 ("cxl/region: Fix 'distance' calculation with passthrough ports") Cc: Signed-off-by: Dan Williams Reviewed-by: Dave Jiang Reviewed-by: Vishal Verma --- drivers/cxl/core/region.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/cxl/core/region.c b/drivers/cxl/core/region.c index c82d3b6f3d1f..34cf95217901 100644 --- a/drivers/cxl/core/region.c +++ b/drivers/cxl/core/region.c @@ -1019,10 +1019,10 @@ static int cxl_port_setup_targets(struct cxl_port *port, int i, distance; /* - * Passthrough ports impose no distance requirements between + * Passthrough decoders impose no distance requirements between * peers */ - if (port->nr_dports == 1) + if (cxl_rr->nr_targets == 1) distance = 0; else distance = p->nr_targets / cxl_rr->nr_targets;