From: thomas.petazzoni@free-electrons.com (Thomas Petazzoni)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] bus: mvebu-mbus: Fix optional pcie-mem/io-aperture properties
Date: Tue, 17 Sep 2013 21:22:42 +0200 [thread overview]
Message-ID: <20130917212242.5c306871@skate> (raw)
In-Reply-To: <20130917191342.GA4354@obsidianresearch.com>
Dear Jason Gunthorpe,
On Tue, 17 Sep 2013 13:13:42 -0600, Jason Gunthorpe wrote:
> Well, I'm not 100% sure, but AFAICT that is how struct resources
> should be used. The start/end address are inclusive, so the resource
> (start=0,end=0) describes 1 byte at address 0.
>
> The only way to get a 0 sized resource is (start=0,end=-1)
So in the ideal world, we would have a resource_init(&res) that would
set start=0 and end=-1 or something like that.
> Before I did this I checked other user of resource_size and found
> tests to zero, so the above seems to be correct..
>
> Eg a quick grep shows:
> arch/powerpc/kernel/pci-common.c: pcibios_fixup_bridge
>
> if (pci_has_flag(PCI_REASSIGN_ALL_RSRC)) {
> res->flags |= IORESOURCE_UNSET;
> res->start = 0;
> res->end = -1;
> continue;
> }
>
> Do you see something different?
Well, apparently what you did is the commonly adopted way. Maybe just
add a comment in the code above those two lines to explain what may
seem a little strange initially?
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
prev parent reply other threads:[~2013-09-17 19:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-17 18:38 [PATCH] bus: mvebu-mbus: Fix optional pcie-mem/io-aperture properties Jason Gunthorpe
2013-09-17 19:05 ` Thomas Petazzoni
2013-09-17 19:13 ` Jason Gunthorpe
2013-09-17 19:22 ` Thomas Petazzoni [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130917212242.5c306871@skate \
--to=thomas.petazzoni@free-electrons.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.