Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1168286
| Path | csiph.com!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Guenter Roeck <linux@roeck-us.net> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] PCI: Only enable IO window if supported |
| Date | Thu, 18 Jun 2015 23:00:01 +0200 |
| Message-ID | <pCP4J-2Tq-5@gated-at.bofh.it> (permalink) |
| References | <pt5Xc-6re-1@gated-at.bofh.it> <puQKm-78Z-21@gated-at.bofh.it> <puVK1-61e-13@gated-at.bofh.it> <pv5q3-3FS-27@gated-at.bofh.it> <pCMqf-7Fz-43@gated-at.bofh.it> <pCO8H-1yB-15@gated-at.bofh.it> |
| X-Original-To | Bjorn Helgaas <bhelgaas@google.com> |
| Dkim-Signature | v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=roeck-us.net; s=default; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=NKKTlKSUsRpJ9l6dfkjZFqCgwb/2Nz2HTPmf4SxDK80=; b=ZQZSX88BbF2L4FR9J5GmlmQ60ndBw2fKp9B+b6+7GjtYmuyLx27GddoNP7UXmn2LoLjZv6++bPhlIHozobWu59pXQTdiLKTfZ8RPVS2Um+ZTobv5mtkdR9iIY8wiWz+lSWtEsTUPJ37/Hc9cIaYM5zAdDlc347rJ0tmRBnlUIxA=; |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Content-Disposition | inline |
| User-Agent | Mutt/1.5.23 (2014-03-12) |
| X-Authenticated_Sender | guenter@roeck-us.net |
| X-Outgoing-Spam-Status | No, score=-1.0 |
| X-Antiabuse | This header was added to track abuse, please include it with any abuse report |
| X-Antiabuse | Primary Hostname - bh-25.webhostbox.net |
| X-Antiabuse | Original Domain - vger.kernel.org |
| X-Antiabuse | Originator/Caller UID/GID - [47 12] / [47 12] |
| X-Antiabuse | Sender Address Domain - roeck-us.net |
| X-Get-Message-Sender-Via | bh-25.webhostbox.net: authenticated_id: guenter@roeck-us.net |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 43 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | "linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>, Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com>, Will Deacon <will.deacon@arm.com> |
| X-Original-Date | Thu, 18 Jun 2015 13:53:23 -0700 |
| X-Original-Message-ID | <20150618205323.GA527@roeck-us.net> |
| X-Original-References | <1432342336-25832-1-git-send-email-linux@roeck-us.net> <20150527210447.GY32152@google.com> <20150528022332.GA23724@roeck-us.net> <20150528124112.GJ10210@google.com> <20150618180103.GA23809@roeck-us.net> <CAErSpo5f4cf7cYZ1WxUQd7soEvNWCHowdNnHTbfGmKh16Vdsrg@mail.gmail.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | aioe.org linux.kernel:1168286 |
Show key headers only | View raw
On Thu, Jun 18, 2015 at 02:51:52PM -0500, Bjorn Helgaas wrote: > On Thu, Jun 18, 2015 at 1:01 PM, Guenter Roeck <linux@roeck-us.net> wrote: > > On Thu, May 28, 2015 at 07:41:12AM -0500, Bjorn Helgaas wrote: > >> > >> > > I'd like res->flags to reflect the capabilities of the hardware, not > >> > > whether the window is currently enabled. > >> > > > >> > Flag bits seem to be all taken. Could we use IORESOURCE_DISABLED for that > >> > purpose, or could that cause conflicts elsewhere ? > >> > >> Yes, I think IORESOURCE_DISABLED would be appropriate for any I/O windows > >> below a host bridge that doesn't support I/O space. > >> > > I integrated Lorenzo's patch and tried to get this working. > > > > Problem is that the use of a resource is widely checked with "!res->flags" > > throughout the code. That would have to be changed to something like > > "(!res->flags || (res->flags & IORESOURCE_DISABLED))" whereever it is used. > > > > I tried going with "!res->flags" instead, but have not been able to get it > > to work realiably; it is just very difficult to distinguish if "!res->flags" > > means that the resource has not yet been assigned or if it means that it is not > > supported. > > > > The correct approach, in my opinion, would be to go with IORESOURCE_DISABLED > > and make the necessary changes whereever needed. Effectively this means to > > replace the "!res->flags" check with something like pci_res_used() [ pick > > your preferred name ] and define it as > > > > #define pci_res_used(res) ((res)->flags && !((res)->flags & IORESOURCE_DISABLED)) > > I think that makes sense. Maybe "res_valid()"? It's not really > PCI-specific, and "used" is a little ambiguous. So is "valid", I > admit. > res_valid() sounds good to me. It is also nice and short. Guenter -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: [PATCH] PCI: Only enable IO window if supported Bjorn Helgaas <bhelgaas@google.com> - 2015-06-18 22:00 +0200 Re: [PATCH] PCI: Only enable IO window if supported Guenter Roeck <linux@roeck-us.net> - 2015-06-18 23:00 +0200
csiph-web