[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <52DCED55.1080903@linaro.org>
Date: Mon, 20 Jan 2014 17:33:09 +0800
From: Hanjun Guo <hanjun.guo@...aro.org>
To: Bjorn Helgaas <bhelgaas@...gle.com>
CC: "Rafael J. Wysocki" <rjw@...ysocki.net>,
Catalin Marinas <catalin.marinas@....com>,
Will Deacon <will.deacon@....com>,
Russell King - ARM Linux <linux@....linux.org.uk>,
"linux-acpi@...r.kernel.org" <linux-acpi@...r.kernel.org>,
linux-arm <linux-arm-kernel@...ts.infradead.org>,
Grant Likely <grant.likely@...aro.org>,
Matthew Garrett <mjg59@...f.ucam.org>,
Olof Johansson <olof@...om.net>,
Linus Walleij <linus.walleij@...aro.org>,
Rob Herring <robh@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Arnd Bergmann <arnd@...db.de>, patches@...aro.org,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
linaro-kernel@...ts.linaro.org, linaro-acpi@...ts.linaro.org,
Charles.Garcia-Tobin@....com,
Graeme Gregory <graeme.gregory@...aro.org>,
Al Stone <al.stone@...aro.org>, Jens Axboe <axboe@...nel.dk>,
Jej B <James.Bottomley@...senpartnership.com>,
Benjamin Herrenschmidt <benh@...nel.crashing.org>,
FUJITA Tomonori <fujita.tomonori@....ntt.co.jp>
Subject: Re: [PATCH 01/20] ARM64 / ACPI: Make PCI optional for ACPI on ARM64
On 2014-1-18 0:00, Bjorn Helgaas wrote:
> [+cc Jens, James, Ben, Fujita (authors of PCI_DMA_BUS_IS_PHYS usage)]
>
> On Fri, Jan 17, 2014 at 5:24 AM, Hanjun Guo <hanjun.guo@...aro.org> wrote:
>> Not all the ARM64 targets that are using ACPI have PCI, so introduce
>> some stub functions to make PCI optional for ACPI, and make ACPI core
>> run without CONFIG_PCI on ARM64.
>>
>> pcibios_penalize_isa_irq() is arch dependent, introduce asm/pci.h to
>> include it.
>>
>> Since ACPI on X86 and IA64 depends on PCI, it will not break X86 and
>> IA64 with this patch.
>>
>> Signed-off-by: Graeme Gregory <graeme.gregory@...aro.org>
>> Signed-off-by: Al Stone <al.stone@...aro.org>
>> Signed-off-by: Hanjun Guo <hanjun.guo@...aro.org>
>> ---
>> arch/arm64/include/asm/pci.h | 20 ++++++++++++++++++++
>> drivers/acpi/Makefile | 2 +-
>> drivers/acpi/internal.h | 7 +++++++
>> drivers/acpi/osl.c | 3 ++-
>> include/linux/pci.h | 33 ++++++++++++++++++++++++---------
>> 5 files changed, 54 insertions(+), 11 deletions(-)
>> create mode 100644 arch/arm64/include/asm/pci.h
>>
>> diff --git a/arch/arm64/include/asm/pci.h b/arch/arm64/include/asm/pci.h
>> new file mode 100644
>> index 0000000..455909d
>> --- /dev/null
>> +++ b/arch/arm64/include/asm/pci.h
>> @@ -0,0 +1,20 @@
>> +#ifndef __ASMARM64_PCI_H
>> +#define __ASMARM64_PCI_H
>> +
>> +#ifdef __KERNEL__
>> +
>> +static inline void pcibios_penalize_isa_irq(int irq, int active)
>> +{
>> + /* We don't do dynamic PCI IRQ allocation */
>> +}
>> +
>> +/*
>> + * The PCI address space does equal the physical memory address space.
>> + * The networking and block device layers use this boolean for bounce
>> + * buffer decisions.
>> + */
>> +#define PCI_DMA_BUS_IS_PHYS (1)
>
> I'm not sure this is accurate. The arm code uses
> pci_add_resource_offset() with non-zero offsets, which means a
> physical memory address is not the same as a PCI bus address. I don't
> know what arm64 does for PCI, but I suspect it is similar.
I'm not sure either. I copied this code from arm/asm/pci.h and I
thought it will be the same for ARM64.
>
> I think PCI_DMA_BUS_IS_PHYS is due for some overhaul. I'm dubious
> that it is working as intended anymore. At the very least, it seems
> like something that is dependent on the device in question.
>
>> diff --git a/include/linux/pci.h b/include/linux/pci.h
>> index a13d682..726cf2a 100644
>> --- a/include/linux/pci.h
>> +++ b/include/linux/pci.h
>> ...
>> +static inline int raw_pci_read(unsigned int domain, unsigned int bus,
>> + unsigned int devfn, int reg, int len, u32 *val)
>> +{ return -EINVAL; }
>> +
>> +static inline int raw_pci_write(unsigned int domain, unsigned int bus,
>> + unsigned int devfn, int reg, int len, u32 val)
>> +{return -EINVAL; }
>
> Fix the spacing here (missing a space before "return").
>
> With that, this include/linux/pci.h change is:
>
> Acked-by: Bjorn Helgaas <bhelgaas@...gle.com>
Thanks!
Hanjun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists