lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 29 Jul 2014 17:40:25 +0100
From:	Sudeep Holla <sudeep.holla@....com>
To:	Hanjun Guo <hanjun.guo@...aro.org>,
	Catalin Marinas <Catalin.Marinas@....com>,
	"Rafael J. Wysocki" <rjw@...ysocki.net>,
	Mark Rutland <Mark.Rutland@....com>
CC:	Sudeep Holla <sudeep.holla@....com>,
	"graeme.gregory@...aro.org" <graeme.gregory@...aro.org>,
	Arnd Bergmann <arnd@...db.de>,
	"grant.likely@...aro.org" <grant.likely@...aro.org>,
	Will Deacon <Will.Deacon@....com>,
	Jason Cooper <jason@...edaemon.net>,
	Marc Zyngier <Marc.Zyngier@....com>,
	Bjorn Helgaas <bhelgaas@...gle.com>,
	Daniel Lezcano <daniel.lezcano@...aro.org>,
	Mark Brown <broonie@...aro.org>,
	Robert Richter <rric@...nel.org>,
	Lv Zheng <lv.zheng@...el.com>,
	Robert Moore <robert.moore@...el.com>,
	Lorenzo Pieralisi <Lorenzo.Pieralisi@....com>,
	Liviu Dudau <Liviu.Dudau@....com>,
	Randy Dunlap <rdunlap@...radead.org>,
	Charles Garcia-Tobin <Charles.Garcia-Tobin@....com>,
	"linux-acpi@...r.kernel.org" <linux-acpi@...r.kernel.org>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 05/19] ARM64 / ACPI: Make PCI optional for ACPI on ARM64



On 24/07/14 14:00, Hanjun Guo wrote:
> As PCI for ARM64 is not ready, so introduce some stub functions
> to make PCI optional for ACPI, and make ACPI core run without
> CONFIG_PCI on ARM64.
>
> Since ACPI on X86 and IA64 depends on PCI and this patch only makes
> PCI optinal for ARM64, it will not break anything on X86 and IA64.
>
> Signed-off-by: Hanjun Guo <hanjun.guo@...aro.org>
> ---
>   arch/arm64/include/asm/pci.h |   11 +++++++++++
>   drivers/acpi/Makefile        |    2 +-
>   drivers/acpi/internal.h      |    5 +++++
>   include/linux/pci.h          |   37 +++++++++++++++++++++++++++----------
>   4 files changed, 44 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..250cd24
> --- /dev/null
> +++ b/arch/arm64/include/asm/pci.h
> @@ -0,0 +1,11 @@
> +#ifndef __ASM_PCI_H
> +#define __ASM_PCI_H
> +#ifdef __KERNEL__
> +
> +/*
> + * PCI address space differs from physical memory address space
> + */
> +#define PCI_DMA_BUS_IS_PHYS	(0)
> +
> +#endif  /* __KERNEL__ */
> +#endif  /* __ASM_PCI_H */
> diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile
> index 505d4d7..8e9bbe6 100644
> --- a/drivers/acpi/Makefile
> +++ b/drivers/acpi/Makefile
> @@ -39,7 +39,7 @@ acpi-y				+= processor_core.o
>   acpi-$(CONFIG_ARCH_MIGHT_HAVE_ACPI_PDC) += processor_pdc.o
>   acpi-y				+= ec.o
>   acpi-$(CONFIG_ACPI_DOCK)	+= dock.o
> -acpi-y				+= pci_root.o pci_link.o pci_irq.o
> +acpi-$(CONFIG_PCI)		+= pci_root.o pci_link.o pci_irq.o
>   acpi-y				+= acpi_lpss.o
>   acpi-y				+= acpi_platform.o
>   acpi-y				+= acpi_pnp.o
> diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h
> index 4c5cf77..e1e6487 100644
> --- a/drivers/acpi/internal.h
> +++ b/drivers/acpi/internal.h
> @@ -26,8 +26,13 @@
>   acpi_status acpi_os_initialize1(void);
>   int init_acpi_device_notify(void);
>   int acpi_scan_init(void);
> +#ifdef CONFIG_PCI
>   void acpi_pci_root_init(void);
>   void acpi_pci_link_init(void);
> +#else
> +static inline void acpi_pci_root_init(void) {}
> +static inline void acpi_pci_link_init(void) {}
> +#endif
>   void acpi_processor_init(void);
>   void acpi_platform_init(void);
>   void acpi_pnp_init(void);
> diff --git a/include/linux/pci.h b/include/linux/pci.h
> index 466bcd1..27d7354 100644
> --- a/include/linux/pci.h
> +++ b/include/linux/pci.h

[...]

> @@ -1394,6 +1395,23 @@ static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus,
>   						unsigned int devfn)
>   { return NULL; }
>
> +static inline struct pci_bus *pci_find_bus(int domain, int busnr)
> +{ return NULL; }
> +
> +static inline int pci_bus_write_config_byte(struct pci_bus *bus,
> +				unsigned int devfn, int where, u8 val)
> +{ return -ENODEV; }
> +
> +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; }

IMO -ENOSYS is more suitable as these functions are not implemented
for !CONFIG_PCI

Regards,
Sudeep

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ