Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp3672214ybk; Tue, 19 May 2020 10:10:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzZgfzr8OoBfTBGCbFrlhZGUecHSSJk7hEls7kzkl5197WSFstGKY90gq5kefsm9RJiIqA X-Received: by 2002:a05:6402:1d98:: with SMTP id dk24mr14597edb.206.1589908244614; Tue, 19 May 2020 10:10:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589908244; cv=none; d=google.com; s=arc-20160816; b=JZ1HJ/wFLMKSSNiYODCrYnfowGM56y+XnQAyoyf8j70FZc5/muzCDS14+5LInU1qzH 1QBbhLcugJ+DBQV6lf3tsg4ZSJGdmkO2sL3XrzUsNW1SclcATJ+LBz+A8ku3UFCD9p5H eLnsHsvb5OGZ/IVU1Y5tG/wZaeB6NsawwYeuGnZn6HVBZ94ZmXeY8H0e6gx39YjVl6z2 LxyPRVIm1nVpwMZ89Lvzg4RPwlwlNRTSqR8A0lCpyyIcsitXLOq3uCzziN8qUIvNi3Kz vTfI+b+BH+MtbxeIcT4x1wfBqQSa/gUkXOGWnlgBuDM9m8yjgFYPB1tdDC2IFKE0XXNC yBmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=1rQXPA2oIArWGngeEsdBJMTOxHrSPSleJraforWbcuQ=; b=AuuImJxLSbPBAoaD6ApAixIR5IIeQhaW8xB+vsLAiXWSwia5eHit7WMldeVl1TzTTj /YDpCwNT6jtf8vDil7VAZ0J9jd0nnvLemewRE1Wz4zJSsyMKQ+Ay8w+skPXZmjvugDJR mbl5LRaeBg6CHYp+KkTPoG1+3AOOgLu9faYadOquMZHz6PB0Y/kQjN3bTpz3rZiQ4P9f h8r8fgfklEJ2rCEKOGIaBQiDqZAfedQJSxjIIsnkHHp9vqQh2cL/66ea2x4QdgPRHyq0 ZR5KKiIpaWv0Xgq2cBAQNOaZoCPmWNmfGLm7nonjau0KzSr5kwJBm+s38sCFEBj8hWvw cQDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=FtKf2DlT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id pj21si248089ejb.713.2020.05.19.10.10.20; Tue, 19 May 2020 10:10:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=FtKf2DlT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729352AbgESRIr (ORCPT + 99 others); Tue, 19 May 2020 13:08:47 -0400 Received: from hqnvemgate25.nvidia.com ([216.228.121.64]:17145 "EHLO hqnvemgate25.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729001AbgESRIr (ORCPT ); Tue, 19 May 2020 13:08:47 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Tue, 19 May 2020 10:07:28 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Tue, 19 May 2020 10:08:47 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Tue, 19 May 2020 10:08:47 -0700 Received: from [10.25.75.192] (172.20.13.39) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 19 May 2020 17:08:42 +0000 Subject: Re: [PATCH] PCI: dwc: Warn only for non-prefetchable memory resource size >4GB To: Lorenzo Pieralisi CC: Bjorn Helgaas , , , Andrew Murray , , , , , , , , , "Alan Mikhak" References: <20200513190855.23318-1-vidyas@nvidia.com> <20200513223508.GA352288@bjorn-Precision-5520> <20200518155435.GA2299@e121166-lin.cambridge.arm.com> <20200519145816.GB21261@e121166-lin.cambridge.arm.com> X-Nvconfidentiality: public From: Vidya Sagar Message-ID: <59c32bed-3a6a-70ba-0052-65d9466a0790@nvidia.com> Date: Tue, 19 May 2020 22:38:39 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200519145816.GB21261@e121166-lin.cambridge.arm.com> X-Originating-IP: [172.20.13.39] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To HQMAIL107.nvidia.com (172.20.187.13) Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1589908048; bh=1rQXPA2oIArWGngeEsdBJMTOxHrSPSleJraforWbcuQ=; h=X-PGP-Universal:Subject:To:CC:References:X-Nvconfidentiality:From: Message-ID:Date:User-Agent:MIME-Version:In-Reply-To: X-Originating-IP:X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=FtKf2DlTg2eG/uj3U/HEi0z+HTvs9Hi0pteXkU9kl9DlFxnV2OezCsGy8yZuGZLQQ xgBxpAjR1lXlIupxRsEX5ZsNEaxuKkHO+7c81P+IFQzhZvgqIG98feDXT9a9C3mBkr jkfh8gBU9D6eB2sdME3SEZdmQPnwdejLGH2oUvEg1YaeeLbRSfJu0mP9Zj/1uTHi3z b7yY0fZ/qplPiV9ZvPRJMisS4NeZsZzpy+6/9zoK7ryMnHkCHsN1V2m4vUDkcIpKzu 17aaGJ5g6/u3BtJIV18dIQvwD7FTgWlfgEViQ8DJDStewYrgonTfgjxllTbXmpFOWx +6Kb+RYAkGtTg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19-May-20 8:28 PM, Lorenzo Pieralisi wrote: > External email: Use caution opening links or attachments > > > On Tue, May 19, 2020 at 07:25:02PM +0530, Vidya Sagar wrote: >> >> >> On 18-May-20 9:24 PM, Lorenzo Pieralisi wrote: >>> External email: Use caution opening links or attachments >>> >>> >>> On Wed, May 13, 2020 at 05:35:08PM -0500, Bjorn Helgaas wrote: >>>> [+cc Alan; please cc authors of relevant commits, >>>> updated Andrew's email address] >>>> >>>> On Thu, May 14, 2020 at 12:38:55AM +0530, Vidya Sagar wrote: >>>>> commit 9e73fa02aa009 ("PCI: dwc: Warn if MEM resource size exceeds max for >>>>> 32-bits") enables warning for MEM resources of size >4GB but prefetchable >>>>> memory resources also come under this category where sizes can go beyond >>>>> 4GB. Avoid logging a warning for prefetchable memory resources. >>>>> >>>>> Signed-off-by: Vidya Sagar >>>>> --- >>>>> drivers/pci/controller/dwc/pcie-designware-host.c | 3 ++- >>>>> 1 file changed, 2 insertions(+), 1 deletion(-) >>>>> >>>>> diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c >>>>> index 42fbfe2a1b8f..a29396529ea4 100644 >>>>> --- a/drivers/pci/controller/dwc/pcie-designware-host.c >>>>> +++ b/drivers/pci/controller/dwc/pcie-designware-host.c >>>>> @@ -366,7 +366,8 @@ int dw_pcie_host_init(struct pcie_port *pp) >>>>> pp->mem = win->res; >>>>> pp->mem->name = "MEM"; >>>>> mem_size = resource_size(pp->mem); >>>>> - if (upper_32_bits(mem_size)) >>>>> + if (upper_32_bits(mem_size) && >>>>> + !(win->res->flags & IORESOURCE_PREFETCH)) >>>>> dev_warn(dev, "MEM resource size exceeds max for 32 bits\n"); >>>>> pp->mem_size = mem_size; >>>>> pp->mem_bus_addr = pp->mem->start - win->offset; >>> >>> That warning was added for a reason - why should not we log legitimate >>> warnings ? AFAIU having resources larger than 4GB can lead to undefined >>> behaviour given the current ATU programming API. >> Yeah. I'm all for a warning if the size is larger than 4GB in case of >> non-prefetchable window as one of the ATU outbound translation >> channels is being used, > > Is it true for all DWC host controllers ? Or there may be another > exception whereby we would be forced to disable this warning altogether > ?I think so. As I see from the code, ATU's Region-0 is used for config space translation Region-1 is used for non-prefetchable memory translation Region-2 is used for I/O translation So, there is no region reserved for translating prefetchable memory regions. > >> but, we are not employing any ATU outbound translation channel for > > What does this mean ? "we are not employing any ATU outbound...", is > this the tegra driver ? And what guarantees that this warning is not > legitimate on DWC host controllers that do use the ATU outbound > translation for prefetchable windows ? Not Tegra driver but Tegra HW. Tegra HW doesn't need any ATU outbound translation for prefetchable (for that matter any 1-to-1 mapping to generate memory transactions on the PCIe bus). The Warning is still valid for both Tegra and other DWC based controllers for non-prefetchable memory translation. > > Can DWC maintainers chime in and clarify please ? > >> prefetchable window and they can be greater than 4GB in size for all >> right reasons. So, logging a warning for prefetchable region doesn't >> seem correct to me. Please let me know if my understanding is wrong. > > I think your patch is wrong and it is applied on top of a patch that > is wrong too, so I won't apply yours and it is likely I will revert > Alan's because it seems to solve nothing (and warn spuriously). > > It is time for people who maintain DWC please to speak up because I > don't have the HW details required to make a judgment. > > Lorenzo > >> - Vidya Sagar >>> >>> Alan ? I want to understand what's the best course of action before >>> merging these patches. >>> >>> Lorenzo >>>