From: Liviu Dudau <Liviu.Dudau@arm.com>
To: Rob Herring <robherring2@gmail.com>
Cc: linux-pci <linux-pci@vger.kernel.org>,
Bjorn Helgaas <bhelgaas@google.com>,
Catalin Marinas <Catalin.Marinas@arm.com>,
Will Deacon <Will.Deacon@arm.com>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
linaro-kernel <linaro-kernel@lists.linaro.org>,
Arnd Bergmann <arnd@arndb.de>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
LAKML <linux-arm-kernel@lists.infradead.org>,
Tanmay Inamdar <tinamdar@apm.com>
Subject: Re: [PATCH v7 3/3] arm64: Add architecture support for PCI
Date: Mon, 17 Mar 2014 16:22:11 +0000 [thread overview]
Message-ID: <20140317162211.GH6457@e106497-lin.cambridge.arm.com> (raw)
In-Reply-To: <CAL_Jsq+9X-9VahsP79mtHN0RC64vRA_2R3ucjX0LefO6q2YN3Q@mail.gmail.com>
On Mon, Mar 17, 2014 at 04:05:38PM +0000, Rob Herring wrote:
> On Fri, Mar 14, 2014 at 10:34 AM, Liviu Dudau <Liviu.Dudau@arm.com> wrote:
> > Use the generic host bridge functions to provide support for
> > PCI Express on arm64. There is no support for ISA memory.
> >
> > Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
> > Tested-by: Tanmay Inamdar <tinamdar@apm.com>
> > ---
> > arch/arm64/Kconfig | 19 +++-
> > arch/arm64/include/asm/Kbuild | 1 +
> > arch/arm64/include/asm/io.h | 3 +-
> > arch/arm64/include/asm/pci.h | 51 ++++++++++
> > arch/arm64/kernel/Makefile | 1 +
> > arch/arm64/kernel/pci.c | 173 ++++++++++++++++++++++++++++++++
> > 6 files changed, 246 insertions(+), 2 deletions(-)
> > create mode 100644 arch/arm64/include/asm/pci.h
> > create mode 100644 arch/arm64/kernel/pci.c
>
> [snip]
>
> > +#endif
> > +
> > +extern unsigned long pci_ioremap_io(const struct resource *res, phys_addr_t phys_addr);
>
> Can we at least align the function definition across architectures if
> not the implementation.
The choice of names is unfortunate. We are trying to follow the spirit of the
arch/arm function, not the implementation, and for RFC that served the purpose.
I'll come up with a better name as I don't intend to share the implementation
with arch/arm here.
Best regards,
Liviu
>
>
> > +int pci_register_io_range(phys_addr_t address, resource_size_t size)
> > +{
> > + struct ioresource *res;
> > + resource_size_t allocated_size = 0;
> > +
> > + /* find if the range has not been already allocated */
> > + list_for_each_entry(res, &io_list, list) {
> > + if (address >= res->start &&
> > + address + size <= res->start + size)
> > + return 0;
> > + allocated_size += res->size;
> > + }
> > +
> > + /* range not already registered, check for space */
> > + if (allocated_size + size > IO_SPACE_LIMIT)
>
> I believe this needs to be "allocated_size + size - 1".
>
> > + return -E2BIG;
> > +
>
--
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯
next prev parent reply other threads:[~2014-03-17 16:22 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-14 15:34 [PATCH v7 0/3] Add support for PCI in AArch64 Liviu Dudau
2014-03-14 15:34 ` [PATCH v7 1/3] Fix ioport_map() for !CONFIG_GENERIC_IOMAP cases Liviu Dudau
2014-03-14 15:34 ` [PATCH v7 2/3] arm64: Extend the PCI I/O space to 16MB Liviu Dudau
2014-03-14 15:34 ` [PATCH v7 3/3] arm64: Add architecture support for PCI Liviu Dudau
2014-03-14 17:14 ` Catalin Marinas
2014-03-14 17:38 ` Arnd Bergmann
2014-03-14 18:05 ` Liviu Dudau
2014-03-14 19:10 ` Arnd Bergmann
2014-03-16 6:22 ` Benjamin Herrenschmidt
2014-03-17 17:38 ` Catalin Marinas
2014-03-17 18:05 ` Liviu Dudau
2014-03-19 13:56 ` Catalin Marinas
2014-03-19 17:21 ` Liviu Dudau
2014-03-19 17:53 ` Rob Herring
2014-03-19 18:36 ` Arnd Bergmann
2014-03-19 18:37 ` Arnd Bergmann
2014-03-20 9:46 ` Liviu Dudau
2014-03-20 11:17 ` Arnd Bergmann
2014-03-20 11:38 ` Liviu Dudau
2014-03-20 12:26 ` Arnd Bergmann
2014-03-20 12:50 ` Liviu Dudau
2014-03-17 16:05 ` Rob Herring
2014-03-17 16:22 ` Liviu Dudau [this message]
2014-04-07 23:58 ` Bjorn Helgaas
2014-04-08 9:52 ` Liviu Dudau
2014-04-22 8:58 ` [PATCH v7 0/3] Add support for PCI in AArch64 Sandeepa Prabhu
2014-04-22 10:11 ` Liviu Dudau
2014-04-22 11:50 ` Sandeepa Prabhu
2014-04-22 12:34 ` Liviu Dudau
2014-04-23 20:32 ` Tanmay Inamdar
2014-04-24 3:08 ` Sandeepa Prabhu
2014-05-16 10:33 ` Sunil Kovvuri
2014-05-16 13:24 ` Liviu Dudau
2014-05-16 17:42 ` Sunil Kovvuri
2014-05-21 11:15 ` Sunil Kovvuri
2014-05-21 11:34 ` Liviu Dudau
2014-05-21 17:06 ` Jason Gunthorpe
2014-05-19 13:01 ` Arnd Bergmann
2014-05-20 4:22 ` Sunil Kovvuri
2014-05-20 8:44 ` Arnd Bergmann
2014-05-20 8:55 ` Sunil Kovvuri
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=20140317162211.GH6457@e106497-lin.cambridge.arm.com \
--to=liviu.dudau@arm.com \
--cc=Catalin.Marinas@arm.com \
--cc=Will.Deacon@arm.com \
--cc=arnd@arndb.de \
--cc=benh@kernel.crashing.org \
--cc=bhelgaas@google.com \
--cc=devicetree@vger.kernel.org \
--cc=linaro-kernel@lists.linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=robherring2@gmail.com \
--cc=tinamdar@apm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®