From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f171.google.com (mail-qt1-f171.google.com [209.85.160.171]) (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 ADE2719CC05 for ; Tue, 7 Jan 2025 16:57:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736269037; cv=none; b=dKk6G26diFOQW4iR+Uqem/yx8/khfpIEpdTzMbb5fZfkBLG4i0AWjadCORJhna4/89yH8Yh85vm9hlRwJcDqpuvBATIue1gzZJ/3OBIDtBwTeB8DQumGwagLfPTkNKb8Epz/LkOqwMzrLp6AEAMEic/2HnsccCsPp4gdvWtTUi8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736269037; c=relaxed/simple; bh=EZ0xTPwErZM31eXzmu3co6GihuExPFcC28LkwkhVQBs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=XThm2c1A0RM5ewyLWR+TyMWgMNga3+kPwJ5JkCaZlMJQatPmCSW7Cvk466VCWmRQLgAmwatKFSHMXVgYvr/ZkY+iLP0cujcIThpoWSpD+Bxi32XdhlibdVS+HHVboCTEC73Plx45pQPZDTYGFjHiwKbvmMEIeCAwnophMhcjONw= 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=Qhhdd7wA; arc=none smtp.client-ip=209.85.160.171 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="Qhhdd7wA" Received: by mail-qt1-f171.google.com with SMTP id d75a77b69052e-467a3c85e11so99892251cf.2 for ; Tue, 07 Jan 2025 08:57:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1736269032; x=1736873832; 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=prJc6J80vM0hXzE72AeZo5gS/5TjG7+GIkTH6dDxyUk=; b=Qhhdd7wAARYDzQqbCcRpd20pUXbPD3uzwSuqbIiPaSI/qF0WZtdLOK2yyKAXZ5f4Ee i0O8r4VlJ80o4wzZ4ydIJjnncjyHxZqcOvP9OnAU+LscChUj7Qj5UeCkMVsz95BXtyu7 +TxzgKYm7HFubScU7TAQAh6YKM0dMETlnhENxGKclBXvReui0AsdJfCPsuBYwn2bjgAR f+7WiV2Sb9VhgAU1Go22mLUehxld/7gEFrr2doY7/bSLiVyWcvgMjPlSwvV/gJEWcOab A0OPEw5avPsGEzZk0v17BJEWwVg4yWJ0m8AjvpSMTOWXW9rXfsnCT2QqvCNiyl3M2QLk zwuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736269032; x=1736873832; 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=prJc6J80vM0hXzE72AeZo5gS/5TjG7+GIkTH6dDxyUk=; b=vwze1m7mJek5egTRv95yBcCK3sWhrPAIyCG6nAC9hA4wg8kTuASFiSyjLbeoCzRPkq yuWt76b7fxFwfbh+7rFTu8gRr0tWazj3XOCKLW0tfbjuWn5MpKDVNcPGs48COG86QRUc 44qrBEfHMugwxJ7aAN+r3eHkGwYMHRzmBcxs2w5vujIwbIuT//UQiCdqlvmnv/eVoFFy qBA//BOpm186hLBhDhL+biqxVt93K+FE5b8pU8hl8J2wpFr/W7Jia5nCsFUeFYfkNYaj zd7ltrPbES57hD5skJyJ2yLaHCLN22NdWArNjluCFlIgVlF1ZQYLSF0C3yA7vzRe/VEA Ixgg== X-Forwarded-Encrypted: i=1; AJvYcCUFNoHXR+oM6fjRVSJcL2Ik70ve4vaVFsA8+4UqJ30ZwFVcTBNleA5bZe3x167d+JtQiwKiBYBMTjDfA94=@vger.kernel.org X-Gm-Message-State: AOJu0Yy+1wqsbu8H0b782HM6M2cto4uPzteZJH71WbZqrHFmaMzL95IT cdQzzSjLaULVR/dXMAkke4CwDTqmyC4+iVNcNGPK1zFM/3v469ISvzsKZZXoDvk= X-Gm-Gg: ASbGncv3wcPWyOqtNdqvy1F1tBpp4W8luPc+0yfazhmaLcc8UHz1NUJfcHkFf1PhJoq ZW4xB0dAdkWOJS6Ho7FsuWb7e/zQR3LxlykPJdkGfbetTzYdV/bEoxgXLM+q2sWEvOwOA1z12HM 1jPCbi9nWY9edVQesezYi6RLXobPJJ7acvV3OiXFlcmb3S4l+czSfuqX+mCjLDw0bUB244/x4BR 76yGTy3ZlPy/E0xDU7kaJgA7zWuWE7KsE9sy4urA0jpLE9aHzUK5klX0fJuXxo+YiKeFac3QMbZ cIqbxMIFjTSVWxGsyaTvugd2HiqsiJFGFDXphe4= X-Google-Smtp-Source: AGHT+IF3risnApxZ7Aqw/S5XLX7v+4Bv1R7ttaFTwQXzm0iH8UjfbXLcxMIC+GxXc0kMcv6uMtH89Q== X-Received: by 2002:ac8:5981:0:b0:467:5016:57fa with SMTP id d75a77b69052e-46a4a988dd7mr1008159001cf.44.1736269032685; Tue, 07 Jan 2025 08:57:12 -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 d75a77b69052e-46a3e64cf0fsm187087691cf.18.2025.01.07.08.57.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jan 2025 08:57:12 -0800 (PST) Date: Tue, 7 Jan 2025 11:57:10 -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 06/29] cxl/region: Factor out code to find the root decoder Message-ID: References: <20250107141015.3367194-1-rrichter@amd.com> <20250107141015.3367194-7-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-7-rrichter@amd.com> On Tue, Jan 07, 2025 at 03:09:52PM +0100, Robert Richter wrote: > In function cxl_add_to_region() there is code to determine the root > decoder associated to an endpoint decoder. Factor out that code for > later reuse. This also simplifies the function cxl_add_to_region() as > the change reduces its size and the number of used variables. > > The reference of cxlrd_dev can be freed earlier. Since the root > decoder exists as long as the root port exists and the endpoint > already holds a reference to the root port, this additional reference > is not needed. Though it looks obvious to use __free() for the > reference of cxlrd_dev here too, this is done in a later rework. So > just move the code. > > Signed-off-by: Robert Richter > --- > drivers/cxl/core/region.c | 55 ++++++++++++++++++++++++++------------- > 1 file changed, 37 insertions(+), 18 deletions(-) > Reviewed-by: Gregory Price