From: Arnd Bergmann <arnd@arndb.de>
To: Will Deacon <will.deacon@arm.com>
Cc: "linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"bhelgaas@google.com" <bhelgaas@google.com>,
"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
Liviu Dudau <Liviu.Dudau@arm.com>,
"mohit.kumar@st.com" <mohit.kumar@st.com>,
Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Subject: Re: [PATCH 2/3] PCI: ARM: add support for virtual PCI host controller
Date: Sun, 9 Feb 2014 21:30:25 +0100 [thread overview]
Message-ID: <201402092130.25615.arnd@arndb.de> (raw)
In-Reply-To: <20140207114607.GE5976@mudshark.cambridge.arm.com>
On Friday 07 February 2014, Will Deacon wrote:
> On Wed, Feb 05, 2014 at 08:26:17PM +0000, Arnd Bergmann wrote:
> > On Wednesday 05 February 2014 19:09:47 Will Deacon wrote:
> > > On Tue, Feb 04, 2014 at 07:13:49PM +0000, Arnd Bergmann wrote:
> > If you mandate that, your code is actually correct and you do not
> > require an io_offset or mem_offset.
>
> Right, so that's what I've currently been relying on. If I mandate that,
> will I be making this driver significantly less useful?
After thinking about it some more, I think we should really try to
keep that logic completely out of the host controller driver and instead
make it generic enough to cover all possible cases.
Let's make sure that nobody ever has to call the range parser from
a PCI host driver again, no matter how weird their hardware setup is,
and put the necessary code in a common location. This will make your
driver even simpler.
> > * You might have multiple sections of the PCI bus space mapped
> > into CPU physical space. If you want to support legacy VGA
> > console, you probably want to map the first 16MB of the bus
> > space at an arbitrary location (with the mem_offset as above),
> > plus a second, larger section of the bus space with an identity
> > mapping (mem_offset_= 0) for all devices other than VGA.
> > You'd also need to copy some VGA specific code from arm32 to
> > arm64 to actually make this work.
>
> Again, I'd rather cross that bridge (no pun intended) when we decide we want
> legacy VGA.
Fair enough.
>
> > > > This shows once more that the range parser code is suboptimal. So far
> > > > every single driver got the I/O space wrong here, because the obvious
> > > > way to write this function is also completely wrong.
> > >
> > > I see you mentioned to Liviu that you should register a logical resource,
> > > rather than physical resource returned from the parser. It seems odd that
> > > I/O space appears to work with this code as-is (I've tested it on arm using
> > > kvmtool by removing the memory bars).
> >
> > what do you see in /proc/ioports and /proc/iomem then?
>
> bash-4.2# cat /proc/ioports
> 00006200-000065ff : virtio-pci
> 00006600-000069ff : virtio-pci
> 00006a00-00006dff : virtio-pci
> 00006e00-000071ff : virtio-pci
>
> bash-4.2# cat /proc/iomem
> 40000000-40ffffff : /pci
> 41000400-410005ff : virtio-pci
> 41000c00-41000dff : virtio-pci
> 41001400-410015ff : virtio-pci
> 41001c00-41001dff : virtio-pci
> 80000000-93ffffff : System RAM
> 80008000-8053df0b : Kernel code
> 80570000-805c07fb : Kernel data
You should normally see a parent resource for the PCI bus and the virtio-pci
resources under that. For some reason, neither of the two appears to have
been registered correctly.
Arnd
WARNING: multiple messages have this Message-ID (diff)
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/3] PCI: ARM: add support for virtual PCI host controller
Date: Sun, 9 Feb 2014 21:30:25 +0100 [thread overview]
Message-ID: <201402092130.25615.arnd@arndb.de> (raw)
In-Reply-To: <20140207114607.GE5976@mudshark.cambridge.arm.com>
On Friday 07 February 2014, Will Deacon wrote:
> On Wed, Feb 05, 2014 at 08:26:17PM +0000, Arnd Bergmann wrote:
> > On Wednesday 05 February 2014 19:09:47 Will Deacon wrote:
> > > On Tue, Feb 04, 2014 at 07:13:49PM +0000, Arnd Bergmann wrote:
> > If you mandate that, your code is actually correct and you do not
> > require an io_offset or mem_offset.
>
> Right, so that's what I've currently been relying on. If I mandate that,
> will I be making this driver significantly less useful?
After thinking about it some more, I think we should really try to
keep that logic completely out of the host controller driver and instead
make it generic enough to cover all possible cases.
Let's make sure that nobody ever has to call the range parser from
a PCI host driver again, no matter how weird their hardware setup is,
and put the necessary code in a common location. This will make your
driver even simpler.
> > * You might have multiple sections of the PCI bus space mapped
> > into CPU physical space. If you want to support legacy VGA
> > console, you probably want to map the first 16MB of the bus
> > space at an arbitrary location (with the mem_offset as above),
> > plus a second, larger section of the bus space with an identity
> > mapping (mem_offset_= 0) for all devices other than VGA.
> > You'd also need to copy some VGA specific code from arm32 to
> > arm64 to actually make this work.
>
> Again, I'd rather cross that bridge (no pun intended) when we decide we want
> legacy VGA.
Fair enough.
>
> > > > This shows once more that the range parser code is suboptimal. So far
> > > > every single driver got the I/O space wrong here, because the obvious
> > > > way to write this function is also completely wrong.
> > >
> > > I see you mentioned to Liviu that you should register a logical resource,
> > > rather than physical resource returned from the parser. It seems odd that
> > > I/O space appears to work with this code as-is (I've tested it on arm using
> > > kvmtool by removing the memory bars).
> >
> > what do you see in /proc/ioports and /proc/iomem then?
>
> bash-4.2# cat /proc/ioports
> 00006200-000065ff : virtio-pci
> 00006600-000069ff : virtio-pci
> 00006a00-00006dff : virtio-pci
> 00006e00-000071ff : virtio-pci
>
> bash-4.2# cat /proc/iomem
> 40000000-40ffffff : /pci
> 41000400-410005ff : virtio-pci
> 41000c00-41000dff : virtio-pci
> 41001400-410015ff : virtio-pci
> 41001c00-41001dff : virtio-pci
> 80000000-93ffffff : System RAM
> 80008000-8053df0b : Kernel code
> 80570000-805c07fb : Kernel data
You should normally see a parent resource for the PCI bus and the virtio-pci
resources under that. For some reason, neither of the two appears to have
been registered correctly.
Arnd
next prev parent reply other threads:[~2014-02-09 20:30 UTC|newest]
Thread overview: 86+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-04 16:53 [PATCH 0/3] ARM: PCI: implement virtual PCI host controller Will Deacon
2014-02-04 16:53 ` Will Deacon
2014-02-04 16:53 ` [PATCH 1/3] ARM: bios32: use pci_enable_resource to enable PCI resources Will Deacon
2014-02-04 16:53 ` Will Deacon
2014-02-12 1:06 ` Bjorn Helgaas
2014-02-12 1:06 ` Bjorn Helgaas
2014-02-12 16:18 ` Will Deacon
2014-02-12 16:18 ` Will Deacon
2014-02-04 16:53 ` [PATCH 2/3] PCI: ARM: add support for virtual PCI host controller Will Deacon
2014-02-04 16:53 ` Will Deacon
2014-02-04 19:13 ` Arnd Bergmann
2014-02-04 19:13 ` Arnd Bergmann
2014-02-05 19:09 ` Will Deacon
2014-02-05 19:09 ` Will Deacon
2014-02-05 19:27 ` Jason Gunthorpe
2014-02-05 19:27 ` Jason Gunthorpe
2014-02-05 19:41 ` Peter Maydell
2014-02-05 19:41 ` Peter Maydell
2014-02-05 20:26 ` Arnd Bergmann
2014-02-05 20:26 ` Arnd Bergmann
2014-02-05 20:53 ` Jason Gunthorpe
2014-02-05 20:53 ` Jason Gunthorpe
2014-02-06 8:28 ` Arnd Bergmann
2014-02-06 8:28 ` Arnd Bergmann
2014-02-06 20:31 ` Russell King - ARM Linux
2014-02-06 20:31 ` Russell King - ARM Linux
2014-02-09 20:18 ` Arnd Bergmann
2014-02-09 20:18 ` Arnd Bergmann
2014-02-09 20:34 ` Russell King - ARM Linux
2014-02-09 20:34 ` Russell King - ARM Linux
2014-02-11 19:15 ` Arnd Bergmann
2014-02-11 19:15 ` Arnd Bergmann
2014-02-07 11:46 ` Will Deacon
2014-02-07 11:46 ` Will Deacon
2014-02-07 17:54 ` Jason Gunthorpe
2014-02-07 17:54 ` Jason Gunthorpe
2014-02-12 18:10 ` Will Deacon
2014-02-12 18:10 ` Will Deacon
2014-02-12 18:19 ` Jason Gunthorpe
2014-02-12 18:19 ` Jason Gunthorpe
2014-02-12 18:21 ` Will Deacon
2014-02-12 18:21 ` Will Deacon
2014-02-09 20:30 ` Arnd Bergmann [this message]
2014-02-09 20:30 ` Arnd Bergmann
2014-02-10 17:34 ` Jason Gunthorpe
2014-02-10 17:34 ` Jason Gunthorpe
2014-02-11 10:42 ` Arnd Bergmann
2014-02-11 10:42 ` Arnd Bergmann
2014-02-12 19:43 ` Jason Gunthorpe
2014-02-12 19:43 ` Jason Gunthorpe
2014-02-12 20:07 ` Arnd Bergmann
2014-02-12 20:07 ` Arnd Bergmann
2014-02-12 20:33 ` Bjorn Helgaas
2014-02-12 20:33 ` Bjorn Helgaas
2014-02-12 21:15 ` Thomas Petazzoni
2014-02-12 21:15 ` Thomas Petazzoni
2014-02-12 22:24 ` Jason Gunthorpe
2014-02-12 22:24 ` Jason Gunthorpe
2014-02-12 19:49 ` Will Deacon
2014-02-12 19:49 ` Will Deacon
2014-02-06 8:54 ` Anup Patel
2014-02-06 8:54 ` Anup Patel
2014-02-06 10:26 ` Arnd Bergmann
2014-02-06 10:26 ` Arnd Bergmann
2014-02-06 10:52 ` Anup Patel
2014-02-06 10:52 ` Anup Patel
2014-02-06 10:54 ` Liviu Dudau
2014-02-06 10:54 ` Liviu Dudau
2014-02-06 11:00 ` Will Deacon
2014-02-06 11:00 ` Will Deacon
2014-02-06 11:28 ` Arnd Bergmann
2014-02-06 11:28 ` Arnd Bergmann
2014-02-04 16:53 ` [PATCH 3/3] ARM: mach-virt: allow PCI support to be selected Will Deacon
2014-02-04 16:53 ` Will Deacon
2014-04-03 22:07 ` [PATCH 0/3] ARM: PCI: implement virtual PCI host controller Bjorn Helgaas
2014-04-03 22:07 ` Bjorn Helgaas
2014-04-14 17:13 ` Will Deacon
2014-04-14 17:13 ` Will Deacon
2014-04-14 18:48 ` Arnd Bergmann
2014-04-14 18:48 ` Arnd Bergmann
2014-04-15 14:47 ` Will Deacon
2014-04-15 14:47 ` Will Deacon
2014-04-15 15:26 ` Arnd Bergmann
2014-04-15 15:26 ` Arnd Bergmann
2014-04-16 13:58 ` Will Deacon
2014-04-16 13:58 ` Will Deacon
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=201402092130.25615.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=Liviu.Dudau@arm.com \
--cc=bhelgaas@google.com \
--cc=jgunthorpe@obsidianresearch.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-pci@vger.kernel.org \
--cc=mohit.kumar@st.com \
--cc=will.deacon@arm.com \
/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.