From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (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 4A70333C5 for ; Tue, 16 Jul 2024 04:14:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721103268; cv=none; b=naxHoqaacEx1NCmkwlIy7rZCpyxkUuXkrBN7PY4kMUmM/F7YmMwdW7dgoRGXOzpGvZYr0Jz8Y76rbTjgpmOHTNi9q8f+bFlXyafmzXQmPkGyFuJIy3PMkktBFILjYAcRTl/1dW56Up141T/Kcmp2qzCT3TVxGgr9qreOiMZEvKg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721103268; c=relaxed/simple; bh=Q6fMXng06sCrDolMimf4y00YzugvjyxcoCS6h0VSxQ8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=X9c8OPbGhtuPp3RretkEI2Njlhf6kOhtV7reLu0hhr5ffy8uT+K3v2No58WZUecsVgubiHt4wMCzFuGgvSaE5tKwKCQ1HS8imuY1h4Bf+SCU4+UP4gWUu8rPG3BT0Tc2QPslfGJFU+agDpj2thvtbLPrDYvIA1R42rOvvl9HwO0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=gBu1KjmQ; arc=none smtp.client-ip=209.85.214.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="gBu1KjmQ" Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-1fbc09ef46aso35433765ad.3 for ; Mon, 15 Jul 2024 21:14:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1721103266; x=1721708066; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=m9fUUwB+okzBEhJbtku9Zj8uDK/lXGOdA1PyDueEIS8=; b=gBu1KjmQuB62d9UlWS/VeokmP5+zv3GsSu/mmJQOTtI4Rz+xs9Gkq57HFbDpLGKnnh NknJBaHOJ2ccXDqXtfb7uzl0hhOY5etn2rdlJup/X1UQlvw0mvvR5cSnEd0tKgTn4OAy LmBtmtMI1vJsIiwJ7O3wqikMbsNk6wR1AlCFhatndt3VxeEhaUI4pbz1UhVZY2vT2Fd3 Xf/Nu3bkWYkHCnodBxAz2Kb6qlxm9THVWcldfZnY3x9LfVLibXj3PHiWTJhJmnXhGrZq Bax7TPE8LpS0xijXvE//AAd4IVm+YvnAzJjtgxkDvWuaQiPLg+ZTr9Ud6I1MPK2pMxY6 45Tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721103266; x=1721708066; h=in-reply-to:content-transfer-encoding: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=m9fUUwB+okzBEhJbtku9Zj8uDK/lXGOdA1PyDueEIS8=; b=CqWVH1uz7H9htRAHZmR50c58txftsgYj3/xwklssar12Hq2jqNgVQp37nbCDyd4z/M nofdmrL6Emeq88tfK3jyyR2vlWW7XHNqTdN5b8+1NgF7xoR/d6z5k74ZVGBBCZBoicyp LXBOUY2m8Nhy+suG3H604AZEZLTL20uxoIM8RYPyp0It4hSxEi7OJ/yKUmvPmGAAPA6s LDJDWEOmJWry59ZJWgkaSlRW3dCiUySZhZjDa+axTEB+XVBS4GRDbWt/HeRUy1hAgdC7 91UNH+6vtvsCO+bhYFGpyLR0SmJwJb5QLZc0fAuk0sFUjXRSrr9cMmcsik5buGDAhXzO QVRQ== X-Forwarded-Encrypted: i=1; AJvYcCXbzNwm5NR/VA41p0j5KB02gZV8y1L5o9EugBZPB2dLNvB0t6LA71hLPCqUyQ6vJJbxE4FrQIWw3kaOGpiuyW0Px6rQQX3+UW5k0Q== X-Gm-Message-State: AOJu0YzF/xWMJRIEakjptPTKG3x8bR9ljW28CvTlAKsfESq2plVRnKIZ 3z7quCwKvgRpFHYFEEDESNt2SQDXk70d2I4U1qZ6IsqSZ7UNhl1EncnhBDEWVg== X-Google-Smtp-Source: AGHT+IE0ztL8RIsOftGMZThcROohqiKseTO2JDvpmlkVCP+8b8LK1YIhEgA/osbAGwBzSst2Of6iGA== X-Received: by 2002:a17:902:e54d:b0:1fb:43b5:879c with SMTP id d9443c01a7336-1fc3d9811d8mr5861235ad.33.1721103266544; Mon, 15 Jul 2024 21:14:26 -0700 (PDT) Received: from thinkpad ([220.158.156.207]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fc0bb6fdc9sm48665165ad.52.2024.07.15.21.14.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jul 2024 21:14:26 -0700 (PDT) Date: Tue, 16 Jul 2024 09:44:16 +0530 From: Manivannan Sadhasivam To: Konrad Dybcio Cc: Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , Krzysztof Kozlowski , Conor Dooley , Kishon Vijay Abraham I , Bjorn Andersson , linux-pci@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH 06/14] PCI: endpoint: Assign PCI domain number for endpoint controllers Message-ID: <20240716041416.GC3446@thinkpad> References: <20240715-pci-qcom-hotplug-v1-0-5f3765cc873a@linaro.org> <20240715-pci-qcom-hotplug-v1-6-5f3765cc873a@linaro.org> <5ea6d478-f2da-4b68-8987-79cc5dfb8c86@linaro.org> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5ea6d478-f2da-4b68-8987-79cc5dfb8c86@linaro.org> On Mon, Jul 15, 2024 at 10:02:18PM +0200, Konrad Dybcio wrote: > On 15.07.2024 7:33 PM, Manivannan Sadhasivam via B4 Relay wrote: > > From: Manivannan Sadhasivam > > > > Right now, PCI endpoint subsystem doesn't assign PCI domain number for the > > PCI endpoint controllers. But this domain number could be useful to the EPC > > drivers to uniquely identify each controller based on the hardware instance > > when there are multiple ones present in an SoC (even multiple RC/EP). > > > > So let's make use of the existing pci_bus_find_domain_nr() API to allocate > > domain numbers based on either Devicetree (linux,pci-domain) property or > > dynamic domain number allocation scheme. > > > > It should be noted that the domain number allocated by this API will be > > based on both RC and EP controllers in a SoC. If the 'linux,pci-domain' DT > > property is present, then the domain number represents the actual hardware > > instance of the PCI endpoint controller. If not, then the domain number > > will be allocated based on the PCI EP/RC controller probe order. > > > > Signed-off-by: Manivannan Sadhasivam > > --- > > The PCI counterpart does some error checking and requires > CONFIG_PCI_DOMAINS_GENERIC. Is that something that needs to be taken > care of here as well? > Good catch. I excluded the Kconfig check initially during development as it was selected by most of the architectures. But I clearly failed to revisit it later. And yes, we do need to use the guard. I also missed freeing the domain during epc_destroy() which I'll fix in next revision. Thanks! - Mani -- மணிவண்ணன் சதாசிவம்