Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp2732780imb; Mon, 4 Mar 2019 12:41:02 -0800 (PST) X-Google-Smtp-Source: AHgI3IYIeuu2OCF8DNswrIWddoFi7Ib8zsRkZETy4cHtS8/Mw5j7w3LIdNmDCRlJihu1OLced5+t X-Received: by 2002:a62:bd17:: with SMTP id a23mr21459501pff.233.1551732062902; Mon, 04 Mar 2019 12:41:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551732062; cv=none; d=google.com; s=arc-20160816; b=RlKg9vOzvNuWlT2Phq5z/KFPjPOERSpw+NF3+4RWvaKXpuqRHTHaPUWW3OcKPFzPB4 3matm0nB7EBBwJ4jphltO/z28B2eKPDJ/puw8tuQ9yJguU936vnMJ+UX7sFFhA08IvVC vnQqwmZmuqrLl7UQK334DSh906W2RGYFv3MspXlWalzcY7n8porY67tBw6iJdqARioe0 OFpKmJpwS9mLElppGHr0TPW8uYaiNVDi5WvuP3rM0RZDnH9Ipx/XkQAzY/z0UMKcvZpS y7JZrqFxN0EcXFy6bjxdHicMQuIxacEoOWkwm/l3bUyoZhFroltgr9z0EjCX9gS/3G9t +bmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to; bh=okiwb35UmPr90YKlQivQT1X8SjaVvegKcuLe+EJQGKk=; b=Iw5v/0wY0lchFD3e0iFqWstfPqY8r5BX+6u1Fx63ZBqOmKGovdQobUloQJpYbSpp8V LVxjT4farlwhdOBReUu6GNXkPT/QmnBnH8LgpkLg7+2bBOjjOM4NcT2jcVYdLNS5Wxwh reAr00NL3mwTA2SaRzOLyssd1Mp0dpxNYQaXZrRa6MEu95Tdk1HL5pfusUG897AKK/Xi YFnhDoXNaKA4MPWal+5alOaFZi3gnM8ByXTWME8ewvCl8TEBYp+tUixue9LRNEPI6+Eq kBQ/hyDBvacYz9OnEGDjV25r/T2UJ+hdaaGZKG2Zezl2fi3+rRa/qpIPhiYsG8vuE/GE SNFA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r21si5965138pfd.169.2019.03.04.12.40.47; Mon, 04 Mar 2019 12:41:02 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726744AbfCDUjD (ORCPT + 99 others); Mon, 4 Mar 2019 15:39:03 -0500 Received: from ale.deltatee.com ([207.54.116.67]:49652 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726294AbfCDUjC (ORCPT ); Mon, 4 Mar 2019 15:39:02 -0500 Received: from guinness.priv.deltatee.com ([172.16.1.162]) by ale.deltatee.com with esmtp (Exim 4.89) (envelope-from ) id 1h0uMX-0003up-AL; Mon, 04 Mar 2019 13:39:02 -0700 To: Bjorn Helgaas Cc: Bjorn Helgaas , Linux Kernel Mailing List , Linux PCI , Kit Chow , Yinghai Lu References: <20190214170028.27862-1-logang@deltatee.com> <20190304002351.GA26569@google.com> <3e45b4ab-e848-cf3b-624f-121ad58b0250@deltatee.com> From: Logan Gunthorpe Message-ID: Date: Mon, 4 Mar 2019 13:39:01 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-CA Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 172.16.1.162 X-SA-Exim-Rcpt-To: yinghai@kernel.org, kchow@gigaio.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, helgaas@kernel.org, bhelgaas@google.com X-SA-Exim-Mail-From: logang@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-8.7 required=5.0 tests=ALL_TRUSTED,BAYES_00, GREYLIST_ISWHITE,MYRULES_FREE autolearn=ham autolearn_force=no version=3.4.2 Subject: Re: [PATCH 1/2] PCI: Prevent 64-bit resources from being counted in 32-bit bridge region X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019-03-04 1:29 p.m., Bjorn Helgaas wrote: >> I agree, but reworking this code scares me and I suspect it was designed >> this way for a reason. I'm guessing there are a lot of corner cases and >> unusual bios issues this stuff works around. We might end up fixing a >> some cases and breaking a bunch of other cases. > > Scares me too, which is one reason I haven't done anything about it. > > I didn't mean to suggest that you should rework it for *this* issue. > I just keep hoping that we can chip away at teensy pieces and in ten > or twenty years maybe make some headway. Sure. Just trying to brainstorm some ideas. Another idea to chip away at things might be that instead of pbus_size_mem() trying to find an appropriate bridge resources by looping, we simply pass the resource it's supposed to use (which I suspect __pci_bus_size_bridges should be able to figure out ahead of time. So instead of guessing and testing for a bunch of different resource window types we might have, just loop through the actually available windows and group the resources in what we have. Once we've sorted out these patches, when I have some free time, I might try working out a cleanup patch in this direction that we could test and merge slowly. Logan