Received: by 10.223.164.202 with SMTP id h10csp4433983wrb; Wed, 29 Nov 2017 06:22:33 -0800 (PST) X-Google-Smtp-Source: AGs4zMa+EovFeXx6IG5AWoKYPSbyhjGyzcyfen4Xlv9RB4iGMvJVud85Do9hohvLLXkwFy16JQIG X-Received: by 10.99.154.17 with SMTP id o17mr3059842pge.238.1511965353366; Wed, 29 Nov 2017 06:22:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511965353; cv=none; d=google.com; s=arc-20160816; b=qdzlIDbpL6NYVfLY5M1GrW7CxxxwKrQAXCtmMH7k5WfpColYHAMx4GECD+D25BfXQM 0w1AFPN6Vg6ojICkMn0INlfvF8ZpxbNYg0DdazxRzBSwNwJvhOxxPIZSwSM6NNtW6JG5 s/9s0duAkMiaOAW/rSUK2ggNMjMN30mSYNibuHO7DtU/qKUKpCiB+ujWMP4AaGi0ne5z 3ueYnofO1vDFS9vEpZLy3WPDJ5uiM87rO2nwBF6wGjOIouTxxUTvmHYkUAOrB61PRYaN 6/5hX3G+oi5Fifku0cooWsT3mKSjCSqsBHEHm80XnaJ48f+hiawiat49qyvUxS5LHzJT vCUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature:arc-authentication-results; bh=GTkE7y71MCuhz9/aGVPdkn3KJIvnVkmKK+q+PVLpIqo=; b=ZLyAlbfphGwhjEDiClXmJjStm5RitVaEvBcP6ayfc/7I++8aWD+z0DxNX7RjdTPdEJ 80WFPIWxG5QaJWFSYW7jbsyG0YBJK5pDaAkGXrA+9cUzt8fYvzBnhkD/TbGYGomjieQZ OBLw26wVaOt0n49IVNJlrRP+lf+VRSZlDqEjjpQf86lhTzPlfjSn3rREWQPdU/EEtqro oPDvR112tA8GZwfBNDx8UYF9vGDgphcF9EP1vVkEfGwT9KnU9hsdIX+snOWNS40XQgLJ C+pOYGoAuea53YVy6t3kTsLyet6JIeEux4fxP1yTYEF+e85ciPOqWhmxsZMEEOZhacVs OUuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CUYkwuYj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l3si1303091pgr.804.2017.11.29.06.22.23; Wed, 29 Nov 2017 06:22:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CUYkwuYj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755191AbdK2OMj (ORCPT + 70 others); Wed, 29 Nov 2017 09:12:39 -0500 Received: from mail-wr0-f193.google.com ([209.85.128.193]:45672 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755176AbdK2OMg (ORCPT ); Wed, 29 Nov 2017 09:12:36 -0500 Received: by mail-wr0-f193.google.com with SMTP id h1so3495511wre.12; Wed, 29 Nov 2017 06:12:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=GTkE7y71MCuhz9/aGVPdkn3KJIvnVkmKK+q+PVLpIqo=; b=CUYkwuYjjixa1i2+41vYnnzZhb5pQCRKonaL+qf5Y2rbHf6/pVtzzd6fjy+2K/Ucz0 xgCSKLIv/6h7fmILKNSqzUFs86pCz9U+V5qNJ7C7wY1mA+bS3nNfEMlFHhEGWhvlXt1O Djl1Q7Wl/ux51jLRGYSVlWXdO0S+siqYNlyi0VHmEN20jXg5ezmgWKq14KJn+RYDiYZJ B8ebZY2b7Z4A+4pLF5Y2Tgdeg+689+xviybkCGx56gdnCyTI/9FsurO0VfRnGTx0YjcL itZg29RRXE66dSGniBtjvtNHhFlK8+SKfvDXHoDUN5TSNky9iBH5L67yb5E55DbDX66+ CZPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GTkE7y71MCuhz9/aGVPdkn3KJIvnVkmKK+q+PVLpIqo=; b=EEOKddT4c3/dvmP29jHJS/t/aFGlLt2PoSESMPRFOMPQcyK8w/I0R8CruOOPAL2qfv LUBrRvVlSc8uHoLonLJZ1Bp032VLgAdAPlyEV8kEWPM9UrzsGX8aUy6wmt+yLWjhKrnr Jpfxa3xptLxH9H1S7PA1hsrw8IWQhPSOi2LCMqigjhRatO0c5F2QLE8BpWhEtT50ujxY 6N4I61Z3jluixSwUEOsfui4DZeACw4uTSHIBrA2bG4k49MPJTk7nTs5WMb6jFADD2MSp gs1GNc/WHCfRte5+ohSAGzcx1QIkON+kZGvzJA2azX3a6Mq97i6NTtHwj41CCyX1uraZ XDEQ== X-Gm-Message-State: AJaThX6e7XTQ4pHV+By4pIrOl8JfgqPu7ZI7pdrdoS6HTmOKOdUuzoiq TR3MHH1+qUWAmLQEtHmLDtBQKA== X-Received: by 10.223.176.121 with SMTP id g54mr2513865wra.165.1511964755535; Wed, 29 Nov 2017 06:12:35 -0800 (PST) Received: from localhost.localdomain ([2a02:908:1251:7981:a0f4:e653:80fe:4e7d]) by smtp.gmail.com with ESMTPSA id n12sm2533445wrn.76.2017.11.29.06.12.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Nov 2017 06:12:34 -0800 (PST) From: "=?UTF-8?q?Christian=20K=C3=B6nig?=" X-Google-Original-From: =?UTF-8?q?Christian=20K=C3=B6nig?= To: helgaas@kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] x86/PCI: fix infinity loop in search for 64bit BAR placement Date: Wed, 29 Nov 2017 15:12:27 +0100 Message-Id: <20171129141229.6107-2-christian.koenig@amd.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171129141229.6107-1-christian.koenig@amd.com> References: <20171129141229.6107-1-christian.koenig@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Break the loop if we can't find some address space for a 64bit BAR. Signed-off-by: Christian König --- arch/x86/pci/fixup.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/x86/pci/fixup.c b/arch/x86/pci/fixup.c index e59378bf37d9..e857b3ac5755 100644 --- a/arch/x86/pci/fixup.c +++ b/arch/x86/pci/fixup.c @@ -695,8 +695,13 @@ static void pci_amd_enable_64bit_bar(struct pci_dev *dev) res->end = 0xfd00000000ull - 1; /* Just grab the free area behind system memory for this */ - while ((conflict = request_resource_conflict(&iomem_resource, res))) + while ((conflict = request_resource_conflict(&iomem_resource, res))) { + if (conflict->end >= res->end) { + kfree(res); + return; + } res->start = conflict->end + 1; + } dev_info(&dev->dev, "adding root bus resource %pR\n", res); -- 2.11.0 From 1585611631611785471@xxx Fri Dec 01 19:38:08 +0000 2017 X-GM-THRID: 1585611631611785471 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread