Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3181268pxj; Mon, 7 Jun 2021 04:33:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZkhlQlSJE1WpYv7g/7ZtUEmVF9NhqXRZM3QejqFk7VZy1lMq49A09Eu3Mma2FSsMe7W1j X-Received: by 2002:a17:906:4089:: with SMTP id u9mr17323354ejj.478.1623065594125; Mon, 07 Jun 2021 04:33:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623065594; cv=none; d=google.com; s=arc-20160816; b=SVqIf+VceED4LtOuapH3VMNsar6SyskE1VpkreIyIZOTV5cZ2102X/2HET5dJ0Bu0l da37F697EMgtcYXPcTtscly+7B/bNF5+cDljXtyyRAz2IEtfprM65BK5cGpTnAV6ejeg /o72lebhCGVTfenMoSzb52UMNU27fmSmUFG9HfUeLl90H8kLndvCFPeocPq+nM4QGFUj Y1PXmuoa8SY22FDuMwAq9gFK6dHmq4NKdERtwfFEBpt0yFz+MrWgkTlAQBsq78W9RVwo nvg4cSGY0ZHih89377L5JHCBV/dhkEWMCyKt6olj6DqfFjtfE+mAGSQnSwopLnij4A1K PgVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=gYiHNfH1kBmlkfBbotBqPsqiGVKKUt560+1kJ7V9BBI=; b=xxCoy8bb457HZm1L/QND36+PfUiMB556Os2dXzJ8uHhJ9+9c+4honN331EnGQbcXrQ 4nA3SHDBKaVhY4pPF3xkXuVdFxuAofrDg+yHuBAN1d5QUZ1UFDTM2IaVVjkgFUP2bfJe bJHqZcJiPr7gvGfb0WRw/9QArzLTyBFfDtWPxQh5XColTmfwKh3gwWGYDrJOMVTEsQJb f0PWdfWRzISp9JU1YwIbWPXeVsQyrBtAKquJ3vHIUHV7ur0HklDrH4b87IWu6phKiRPM PyVhDQUXRYb/5Pzt+LeWLQ1MsAhisTqPtgI3sZYN2TzUMvS1iulqayjsMTnha6qTw+cg gUFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HSjMpYqb; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y28si11873434ejk.356.2021.06.07.04.32.50; Mon, 07 Jun 2021 04:33:14 -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=@gmail.com header.s=20161025 header.b=HSjMpYqb; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231506AbhFGLbU (ORCPT + 99 others); Mon, 7 Jun 2021 07:31:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230348AbhFGLbT (ORCPT ); Mon, 7 Jun 2021 07:31:19 -0400 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05828C061787; Mon, 7 Jun 2021 04:29:15 -0700 (PDT) Received: by mail-pl1-x631.google.com with SMTP id x19so1340722pln.2; Mon, 07 Jun 2021 04:29:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gYiHNfH1kBmlkfBbotBqPsqiGVKKUt560+1kJ7V9BBI=; b=HSjMpYqbSO55esGzCWNfGkoYFj4gMqtwfUfHXE29SoUjYg37Hb+SuucnnMj9G8fzbL mYA1d0dno5FmYgmBIwveBEpO4fVaS/RCuo/vWRQ1knSJvNVTEPA0Yf6k3jYgHJXcRSOE 25RXPij1VsOc6kkoWt5UV3Lw9uo7IprR5sS69pv6xAawn2N8U48H6guaaFI50W1uK2z8 PqSPeN91DfEhs5yuomAa+W8bPkj1s7gpU0EA9euZPaydazhVJt5fE5a3bOzvAAyHfKnX H86UYjnw9lPB+vgq4+CJrIsc8/p8AM18wlQY50UZ9os7FZk60dV2h9sgOEUkxi4a8Tsl ePjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gYiHNfH1kBmlkfBbotBqPsqiGVKKUt560+1kJ7V9BBI=; b=JIkd670qNHVayBBH7oIlB8Aa93Tfo0tN7tR746umUV+C9VPp+ukLeYARvZLYUZn0S0 SInL2WIapk9v5BIGwtX7tiVDDazPN3K6X9z4tL/4QC3WI6DeTOCO0oPnaieGUHDnx2oR RadtFnAiPzZAcMch90AQVa1yhyBG0Yf8PyJ5TmHiolC4GRiCLXM0NmPb4iuQrflEVJVj vYDa+m27GRRIknCwfsYUUXcoUUsbSvlFZ3VCaE5dPtyjsS13JET3m+9LrAa1GYgeIzWu gocDLnqSQEo2KUn6jo5d6tKKUb27JTb0oFXp+f7DxTFV8LsvOLxRWxAl1heE2qYbRyG0 4rFg== X-Gm-Message-State: AOAM5303dvVvlCD2h/lTEAnC+n6vk/4vR3Vtj/ukJjy1/fos45CZZgrk ZqQj2iGuUtPwFnuC4YHk8C0= X-Received: by 2002:a17:90a:f304:: with SMTP id ca4mr20846856pjb.177.1623065354552; Mon, 07 Jun 2021 04:29:14 -0700 (PDT) Received: from localhost (122x211x248x161.ap122.ftth.ucom.ne.jp. [122.211.248.161]) by smtp.gmail.com with ESMTPSA id i21sm8029078pfd.219.2021.06.07.04.29.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Jun 2021 04:29:14 -0700 (PDT) From: Punit Agrawal To: helgaas@kernel.org, robh+dt@kernel.org Cc: Punit Agrawal , linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, alexandru.elisei@arm.com, wqu@suse.com, robin.murphy@arm.com, pgwipeout@gmail.com, ardb@kernel.org, briannorris@chromium.org, shawn.lin@rock-chips.com, Vidya Sagar Subject: [PATCH v3 2/4] PCI: of: Relax the condition for warning about non-prefetchable memory aperture size Date: Mon, 7 Jun 2021 20:28:54 +0900 Message-Id: <20210607112856.3499682-3-punitagrawal@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210607112856.3499682-1-punitagrawal@gmail.com> References: <20210607112856.3499682-1-punitagrawal@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit fede8526cc48 ("PCI: of: Warn if non-prefetchable memory aperture size is > 32-bit") introduced a warning for non-prefetchable resources that need more than 32bits to resolve. It turns out that the check is too restrictive and should be applicable to only resources that are limited to host bridge windows that don't have the ability to map 64-bit address space. Relax the condition to only warn when the resource size requires > 32-bits and doesn't allow mapping to 64-bit addresses. Link: https://lore.kernel.org/r/7a1e2ebc-f7d8-8431-d844-41a9c36a8911@arm.com Signed-off-by: Punit Agrawal Tested-by: Alexandru Elisei Cc: Vidya Sagar --- drivers/pci/of.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/pci/of.c b/drivers/pci/of.c index 1e45186a5715..38fe2589beb0 100644 --- a/drivers/pci/of.c +++ b/drivers/pci/of.c @@ -581,7 +581,8 @@ static int pci_parse_request_of_pci_ranges(struct device *dev, res_valid |= !(res->flags & IORESOURCE_PREFETCH); if (!(res->flags & IORESOURCE_PREFETCH)) - if (upper_32_bits(resource_size(res))) + if (!(res->flags & IORESOURCE_MEM_64) && + upper_32_bits(resource_size(res))) dev_warn(dev, "Memory resource size exceeds max for 32 bits\n"); break; -- 2.30.2