From: mike@compulab.co.il (Mike Rapoport)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 2/3] [ARM] tegra: add PCI Express support
Date: Tue, 21 Sep 2010 16:35:23 +0200 [thread overview]
Message-ID: <4C98C2AB.5060409@compulab.co.il> (raw)
In-Reply-To: <201009211430.00325.arnd@arndb.de>
Arnd Bergmann wrote:
>> Signed-off-by: Mike Rapoport <mike@compulab.co.il>
>> CC: Arnd Bergmann <arnd@arndb.de>
>> CC: Russell King <linux@arm.linux.org.uk>
>> CC: Colin Cross <ccross@google.com>
>> CC: Gary King <GKing@nvidia.com>
>
> Acked-by: Arnd Bergmann <arnd@arndb.de>
>
> On Tuesday 21 September 2010, Mike Rapoport wrote:
>> /* On TEGRA, many peripherals are very closely packed in
>> * two 256MB io windows (that actually only use about 64KB
>> @@ -67,10 +67,20 @@ void tegra_iounmap(volatile void __iomem *addr);
>>
>> #define IO_ADDRESS(n) ((void __iomem *) IO_TO_VIRT(n))
>>
>> +#ifdef CONFIG_TEGRA_PCI
>> +extern void __iomem *tegra_pcie_io_base;
>> +
>> +static inline void __iomem *__io(unsigned long addr)
>> +{
>> + return tegra_pcie_io_base + (addr & IO_SPACE_LIMIT);
>> +}
>> +#else
>> static inline void __iomem *__io(unsigned long addr)
>> {
>> return (void __iomem *)addr;
>> }
>> +#endif
>> +
>> #define __io(a) __io(a)
>> #define __mem_pci(a) (a)
>
> I wonder what the #else path is for. If you don't have PCI, who would
> call __io?
No one should call __io without PCI. However, there are drivers that do not
build without __io, e.g.:
CC drivers/serial/8250.o
drivers/serial/8250.c: In function 'hub6_serial_in':
drivers/serial/8250.c:397: error: implicit declaration of function 'outb'
drivers/serial/8250.c:398: error: implicit declaration of function 'inb'
These references to inb and outb will not be called in runtime anyway, but they
are required for the 8250 driver to build.
I believe there are other drivers except 8250 that require to have __io,
although it will be never actually called on, e.g. Tegra-based platform.
> And wouldn't that result in a NULL pointer dereference?
>
> Arnd
--
Sincerely yours,
Mike.
next prev parent reply other threads:[~2010-09-21 14:35 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-21 12:17 [PATCH v2 0/3] *** SUBJECT HERE *** Mike Rapoport
2010-09-21 12:17 ` [PATCH v2 1/3] [ARM] tegra: add PCI Express clocks Mike Rapoport
2010-09-21 12:17 ` [PATCH v2 2/3] [ARM] tegra: add PCI Express support Mike Rapoport
2010-09-21 12:30 ` Arnd Bergmann
2010-09-21 13:23 ` Pawel Moll
2010-09-21 13:33 ` Arnd Bergmann
2010-09-21 14:35 ` Mike Rapoport [this message]
2010-09-21 15:03 ` Arnd Bergmann
2010-09-21 12:17 ` [PATCH v2 3/3] [ARM] tegra: harmony: enable PCI Express Mike Rapoport
2010-09-23 15:22 ` Olof Johansson
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=4C98C2AB.5060409@compulab.co.il \
--to=mike@compulab.co.il \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox