Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp849710lqs; Fri, 14 Jun 2024 07:27:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWvwcssVr8X4NsJHvETviyWJd+NWY5jMbl4auLQ/EU3gp7skcqEDeog/kKtTeKcHK2ZK0C9tuzFfZSal6dUznRIuKM3+FvCC04Jegh4cQ== X-Google-Smtp-Source: AGHT+IG0oUWk7whL/u+S0OXYrY22afNd9gmVbGj3CvFDS40trIFj5aNYd9kOaJC2s0PjUOAgN/DY X-Received: by 2002:a17:90a:2e06:b0:2c3:3002:98b2 with SMTP id 98e67ed59e1d1-2c4da5676d1mr4913516a91.11.1718375239753; Fri, 14 Jun 2024 07:27:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718375239; cv=pass; d=google.com; s=arc-20160816; b=vbgl4t72ViwzTL3bTtX+g8O7GXb/AntQX/HWWUrSMNgCQNzKDEyNEa1HPl5wLR0IuF L3EKOmr/Nbkqe+wEFHE5sZisgWF8tEzCybMcQwkkrqgRCtmg2lDnNVEbwi4TrgYrGdz0 dEpxamb7Hu8ZtJxetdr/luvdCdK9jrx68mLd4M1GTml+Q8WzrPP2wCT+45UR5jNTzhdS xs5oH3WT6nLz9oh8Ay+ldOxK7+3PgGbhOoTcKeEKC1vxrieK9P0Xdl3sdu15kmhqJ5Q4 u7+jUe7tEiR0uhRhg2xIpxNqQuuxZ2orVP0u1mzs0pSFROpuJVVdEaMITBESZTryWHIJ CYNQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:in-reply-to:subject:cc:to:date:from :dkim-signature; bh=Rrc3C8d7uDUG/Lb1p4R1lf7UWBhJrT4h66fUjsw+toY=; fh=eo6wksqhegBUSfmE5Qocj9Cx1R2i5xj2Ehhvud+X8Ec=; b=B0XGeT/xDCb8StrmpxfL1L+QX+2J4lHZXVik1oOlCVkAg646pEwgfO8HjoFfCQ3iMe chwlh2EbW1td0MCbgzjkgejW5xvAyENVShtabFKLcrJmb5tEtb92+cie279dPugviQL5 PujvzehL6FDefk4cJyTJGUd9+wQihxdt681oh7T+5JL+ZjILvQtwtvbb23+w1J4dqyZx /txo3FBk6on3VZD9L+kMPoXGDQaDv3w2zKMFh9m+jtEifTT1QYMDh0Hk18bHNPMPiVDe r7ib9soZMowONnTycZPUavLwlc9ipzwHgH+V2qQebpPHKZLPJDI2pFwDiv8mFsxw/j2r wrzQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=KIbnr90p; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-214934-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214934-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2c4c475fe03si3190423a91.126.2024.06.14.07.27.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 07:27:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-214934-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=KIbnr90p; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-214934-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214934-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id C07F0B240F4 for ; Fri, 14 Jun 2024 13:18:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8F86E19AA61; Fri, 14 Jun 2024 13:18:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="KIbnr90p" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E175519D88D; Fri, 14 Jun 2024 13:18:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.20 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718371082; cv=none; b=hEMabb6ueXd74WVkU4HrpkRyvbi5+w/AmgMrlCwp8nrPfjfOW/Iqbh6jBhKbpkHsPUDIZPsO9Wy7fXSJYwaEj657pEcZNZMEB+fJ92mVOeZXcAlmiXTrl3Qkj2ZS/fPJfJrIPkwNJlSeLOEfcs4nWbmvuHr2gZC9c9gJe62DN/0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718371082; c=relaxed/simple; bh=B/szTGuEIXbe/8epPrqiJ3Kbj5OfTgwv1AwgTjgi5WY=; h=From:Date:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=ld8kbXmBeZinCWqfum3uV7i/hD1oQxWIddOzHHMPwHLsbzsGIK7UXHNaqWQbRDmP4Rpy1pdtm7wpZvhTI7o3koLKaFCZ0wq1fJA0gnkxrBVGNLVgGcQbbnQCVF2bKTXxlyS9k8vTwu+4QptPxD1p70lb9eAivk78VBQYMam+Qy4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=KIbnr90p; arc=none smtp.client-ip=198.175.65.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718371082; x=1749907082; h=from:date:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=B/szTGuEIXbe/8epPrqiJ3Kbj5OfTgwv1AwgTjgi5WY=; b=KIbnr90pXHH3k63WmBjPLa6N0+MSU+GtFkpqHeHX4TrO0lISO6188GH3 3MCVfrVqG6fM4acwFiTKKsfJw5Q1y7PWRXt3b2MGpAhZ1hbvuMhIPLw21 pHVKGJeH+Osby2C+YaRzuNTVNEnh8nmtEXZiOYWM9R2GdY8BiX038KkTR wMs/ecJ3vqjqEFYjW0k079LQNX7Lk2cZ3B+1XyKKSRawEV0f5fZB47E2S vxAYDYg2UeN8mqNKYuWqWeH8GW9wfOmQjoQ9J5vf6mbonlzYhBirSel8v /2vhzrSeh+PvooBiNQodGB9pBIH+yenwG+gNeiyEDawUA+pde6sbM4jrl g==; X-CSE-ConnectionGUID: lg+bqW4uQr24rC74n29CqQ== X-CSE-MsgGUID: cXzSQavTQPKOlXoMTSZ7/Q== X-IronPort-AV: E=McAfee;i="6700,10204,11103"; a="15089936" X-IronPort-AV: E=Sophos;i="6.08,237,1712646000"; d="scan'208";a="15089936" Received: from fmviesa005.fm.intel.com ([10.60.135.145]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jun 2024 06:18:01 -0700 X-CSE-ConnectionGUID: 2MiM/vp9TiOzq8Zrdxi7qQ== X-CSE-MsgGUID: R1elhJSqTf6qenCl6V9I7A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,237,1712646000"; d="scan'208";a="44911915" Received: from ijarvine-desk1.ger.corp.intel.com (HELO localhost) ([10.245.247.222]) by fmviesa005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jun 2024 06:17:56 -0700 From: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Date: Fri, 14 Jun 2024 16:17:53 +0300 (EEST) To: daire.mcnamara@microchip.com cc: linux-pci@vger.kernel.org, devicetree@vger.kernel.org, conor.dooley@microchip.com, lpieralisi@kernel.org, kw@linux.com, robh@kernel.org, bhelgaas@google.com, LKML , linux-riscv@lists.infradead.org, krzk+dt@kernel.org, conor+dt@kernel.org Subject: Re: [PATCH v3 1/3] PCI: microchip: Fix outbound address translation tables In-Reply-To: <20240612112213.2734748-2-daire.mcnamara@microchip.com> Message-ID: <77415307-f80c-a34b-b84f-a0febe6f2641@linux.intel.com> References: <20240612112213.2734748-1-daire.mcnamara@microchip.com> <20240612112213.2734748-2-daire.mcnamara@microchip.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 On Wed, 12 Jun 2024, daire.mcnamara@microchip.com wrote: > From: Daire McNamara > > On Microchip PolarFire SoC (MPFS) the PCIe Root Port can be behind one of > three general-purpose Fabric Interface Controller (FIC) buses that > encapsulate an AXI-M interface. That FIC is responsible for managing > the translations of the upper 32-bits of the AXI-M address. On MPFS, > the Root Port driver needs to take account of that outbound address > translation done by the parent FIC bus before setting up its own > outbound address translation tables. In all cases on MPFS, > the remaining outbound address translation tables are 32-bit only. > > Limit the outbound address translation tables to 32-bit only. > > Fixes: 6f15a9c9f941 ("PCI: microchip: Add Microchip Polarfire PCIe controller driver") > > Signed-off-by: Daire McNamara Don't leave spaces between tag lines. > --- > drivers/pci/controller/pcie-microchip-host.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/pci/controller/pcie-microchip-host.c b/drivers/pci/controller/pcie-microchip-host.c > index 137fb8570ba2..853adce24492 100644 > --- a/drivers/pci/controller/pcie-microchip-host.c > +++ b/drivers/pci/controller/pcie-microchip-host.c > @@ -933,7 +933,7 @@ static int mc_pcie_init_irq_domains(struct mc_pcie *port) > > static void mc_pcie_setup_window(void __iomem *bridge_base_addr, u32 index, > phys_addr_t axi_addr, phys_addr_t pci_addr, > - size_t size) > + u64 size) I don't see how this is related to what is described by the commit message. If there's need for this change it should be justified properly and it looks to me that resource_size_t would be more appropriate here given the callers use resource_size() to determine this parameter? > { > u32 atr_sz = ilog2(size) - 1; > u32 val; > @@ -983,7 +983,8 @@ static int mc_pcie_setup_windows(struct platform_device *pdev, > if (resource_type(entry->res) == IORESOURCE_MEM) { > pci_addr = entry->res->start - entry->offset; > mc_pcie_setup_window(bridge_base_addr, index, > - entry->res->start, pci_addr, > + entry->res->start & 0xffffffff, > + pci_addr, > resource_size(entry->res)); > index++; > } > @@ -1117,9 +1118,8 @@ static int mc_platform_init(struct pci_config_window *cfg) > int ret; > > /* Configure address translation table 0 for PCIe config space */ > - mc_pcie_setup_window(bridge_base_addr, 0, cfg->res.start, > - cfg->res.start, > - resource_size(&cfg->res)); > + mc_pcie_setup_window(bridge_base_addr, 0, cfg->res.start & 0xffffffff, > + 0, resource_size(&cfg->res)); Given your commit message, it would be more obvious to the code reader if the literal is replaced with something like RP_OUTBOUND_TRANS_TBL_MASK (that is GENMASK(31, 0)). Feel free to come up better name if I didn't understand all the details right based on your commit message. -- i.