From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A634D1F2C22 for ; Tue, 7 Jan 2025 18:38:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736275118; cv=none; b=EI37kkEXTj7nLBQA/VDf3kRPZz5XQVBLe8SqL6PPby42ZynGKtsfdUDM3wlatZl1xiQZJqfIKCrMpN1r3rASpPZjbF17YplCyXTwN9ujRU9md0+A8tNqZvq2QgQwOOQVO9lskj3cF6XNn50lKFmONzOZCoOQrqwlunKAKc3iA+Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736275118; c=relaxed/simple; bh=9HtiWsDNzgo89i/A9DUYqCWaTCj+4yUHwJ4Hx6eU7eY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=E/UWsgvul777rBDVj5b/ihNGsDcHS4GLA9xDv7us+/h4TsOB5nrmO14hLf9uTFuKi1nKXZ/CWVusSCi9/DDh2I/A/tabdPR2IDNLQ2xc6P+mpJCKEjA1rt43vXFK0wOH+Q3wURZTgeg2t5sFydQwjv9b8iUBJvWdVI7b8nWMSgE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net; spf=pass smtp.mailfrom=gourry.net; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b=kFlii5M9; arc=none smtp.client-ip=209.85.222.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gourry.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b="kFlii5M9" Received: by mail-qk1-f169.google.com with SMTP id af79cd13be357-7b8618be68bso1202987985a.3 for ; Tue, 07 Jan 2025 10:38:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1736275115; x=1736879915; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=lxKRPAafgujkPHN/cyX+chAJbS2cosZ747BgCMk3b6Q=; b=kFlii5M9zl9IgB679U7SWTq7PLwrAeNK6GPznJ1hzuEZ/hQaftEONsZwgDrYTchkWw ZKykYkqzHm/ZMj1Qt0u6ZF8xBlriDgR0U0gKyCikXsRSxCPX5fZS3zTHk6SDTuBMG+0k Tnu1z5TI64QwixuuYJyBgHTxK1QRrXbgdwHNA4jayFPPkj0MHhEP/9VKwFmXKg1z/QUs i00ov1LoHcmyN0+XyJTlpLaPJeuanWU2ph/hSiraQy8umd4i9rqIiXntvw3KyK5fBnKW Kv9PaRWOVFjaRWGBsvPo13F8mgBXbrHybw0t3mI//abWkh0P3loLUt8cvOZJNAV/l242 doPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736275115; x=1736879915; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=lxKRPAafgujkPHN/cyX+chAJbS2cosZ747BgCMk3b6Q=; b=B/tAfqUdcOlPwLbM0n/Vtwb3WawKgA6/ZKfL9lOAgy1Bk1tY9u9eGi3lV6vLGXRKs6 fYc7XVmVLWe13MzHnRME0ahCDSgzRjcVyygEJ4eRC6IwRj0xtr8hEWOa83g+5EcnNuqs uB98BQU6gQ2JNtSSZEGP4K+CIt8T+ezWr6bOO+LzAaqUfv1ziiM2JoIXeoWYTU+J2RGb N3m+7v+R5Q4wk8juu90EC8cfJpkZIux0E0oj5l9sLzW5EBqQOObpJZn0nf+sCAFeCtqT g4EDNPXDKFjMYmsorhbbpjlzww2VAgabhxx3As+36LSE3kW/qcGVY7ZxsMitr/7uyndV PUlg== X-Forwarded-Encrypted: i=1; AJvYcCUx12AKRT60TdgeZgsDRo6YdCqFNwHZF0CQx0qkIUWFkdA1Ny7GmR+f+uKUnVsbUL9KxrSxKQ08gFrZ5Tw=@vger.kernel.org X-Gm-Message-State: AOJu0Yxo3YPZzyRnEENw+y8sh+uOcYluO0tMN7noNb/363LKVpHNbC5l bHELskKnKzMRE3CSiqahgntuqk3Y+Q3HjYDUR8p0E9rWRkfg2onmA6bu/3i0g6U= X-Gm-Gg: ASbGncv5OuDv5aoEwb7ClvnAvA/az/1PX8cFl1KNc5OJs1PglssxG1QmgsH+/B6VPKZ ZDq/lAh0wP2if5ejvRtiBtFbJmzCCnKEx/oxYTTTcwd1We1fleNLxJwJ6mfl5mPkZ/eKc1PYDji RCXEBJLC+vYV+ZkTGOWkTd19lNv0bYTDH01KhMRkkXiPNYaIMARe1Zhc5AkT5uaSGSJbiIm3FyG h/4t3xTKo2LYZMjY3dDteswj+R+C1OO2V7dEKzAXZanmkTdVBwr2GE9NrSEd+kGYEUusNC1Yu1e SBCBXu5ipcRiJdMiVhv6Py1N7Ju+KD3G7xJs7As= X-Google-Smtp-Source: AGHT+IHjK3hP31FEJs0xRiIcZ3+FrR4LQgY/O9Gvne8cgG7pm6UE0EJSJTkpkn0siX+MVS9SbnOPYQ== X-Received: by 2002:a05:620a:8005:b0:7b6:91a4:845b with SMTP id af79cd13be357-7b9ba72e2a6mr12190506585a.15.1736275115608; Tue, 07 Jan 2025 10:38:35 -0800 (PST) Received: from gourry-fedora-PF4VCD3F (pool-173-79-56-208.washdc.fios.verizon.net. [173.79.56.208]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7b9ac2df858sm1614472985a.45.2025.01.07.10.38.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jan 2025 10:38:35 -0800 (PST) Date: Tue, 7 Jan 2025 13:38:33 -0500 From: Gregory Price To: Robert Richter Cc: Alison Schofield , Vishal Verma , Ira Weiny , Dan Williams , Jonathan Cameron , Dave Jiang , Davidlohr Bueso , linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org, "Fabio M. De Francesco" , Terry Bowman Subject: Re: [PATCH v1 10/29] cxl/region: Add function to find a port's switch decoder by range Message-ID: References: <20250107141015.3367194-1-rrichter@amd.com> <20250107141015.3367194-11-rrichter@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250107141015.3367194-11-rrichter@amd.com> On Tue, Jan 07, 2025 at 03:09:56PM +0100, Robert Richter wrote: > Factor out code to find the switch decoder of a port for a specific > address range. Reuse the code to search a root decoder, create the > function cxl_port_find_switch_decoder() and rework > match_root_decoder_by_range() to be usable for switch decoders too. > > Signed-off-by: Robert Richter > --- > drivers/cxl/core/region.c | 43 +++++++++++++++++++++++---------------- > 1 file changed, 25 insertions(+), 18 deletions(-) ... snip ... > > - cxlrd_dev = device_find_child(&iter->dev, hpa, > - match_root_decoder_by_range); > - if (!cxlrd_dev) { > + cxld = cxl_port_find_switch_decoder(iter, hpa); > + if (!cxld) { Are there scenarios where this would return a different decoder than previously? For example, is there an assumption that root decoders will be search first, as opposed to intermediate decoders? The match function was changed to check is_switch_decoder from is_root_decoder, i'm just worried about the case where we might have multiple decoders in the path and the switch decoder is hit first - resulting in the wrong decoder returned. ~Gregory