Re: [PATCH v9 07/21] ACPI / sleep: Introduce arm64 specific acpi_sleep.c
On Wed, 25 Feb 2015 16:39:47 +0800 , Hanjun Guo wrote: > From: Graeme Gregory > > ACPI 5.1 does not currently support S states for ARM64 hardware but > ACPI code will call acpi_target_system_state() for device power > management, so introduce acpi_sleep.c to allow other drivers to function > until S states are defined. > > Since it is arm64 specific stub holder, so let acpi_sleep.c to ARM64 > specific. > > TODO: merge this with drivers/acpi/sleep.c once we fix the specification. > > CC: Rafael J. Wysocki > Tested-by: Suravee Suthikulpanit > Tested-by: Yijing Wang > Tested-by: Mark Langsdorf > Tested-by: Jon Masters > Tested-by: Timur Tabi > Tested-by: Robert Richter > Acked-by: Robert Richter > Signed-off-by: Graeme Gregory > Signed-off-by: Tomasz Nowicki > Signed-off-by: Hanjun Guo > --- > arch/arm64/kernel/Makefile | 2 +- > arch/arm64/kernel/acpi_sleep.c | 28 > drivers/acpi/Makefile | 2 ++ > 3 files changed, 31 insertions(+), 1 deletion(-) > create mode 100644 arch/arm64/kernel/acpi_sleep.c > > diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile > index 218eb7e..4435943 100644 > --- a/arch/arm64/kernel/Makefile > +++ b/arch/arm64/kernel/Makefile > @@ -34,7 +34,7 @@ arm64-obj-$(CONFIG_KGDB)+= kgdb.o > arm64-obj-$(CONFIG_EFI) += efi.o efi-stub.o efi-entry.o > arm64-obj-$(CONFIG_PCI) += pci.o > arm64-obj-$(CONFIG_ARMV8_DEPRECATED) += armv8_deprecated.o > -arm64-obj-$(CONFIG_ACPI) += acpi.o > +arm64-obj-$(CONFIG_ACPI) += acpi.o acpi_sleep.o > > obj-y+= $(arm64-obj-y) vdso/ > obj-m+= $(arm64-obj-m) > diff --git a/arch/arm64/kernel/acpi_sleep.c b/arch/arm64/kernel/acpi_sleep.c > new file mode 100644 > index 000..54578ef > --- /dev/null > +++ b/arch/arm64/kernel/acpi_sleep.c > @@ -0,0 +1,28 @@ > +/* > + * ARM64 Specific Sleep Functionality > + * > + * Copyright (C) 2013-2014, Linaro Ltd. > + * Author: Graeme Gregory > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License version 2 as > + * published by the Free Software Foundation. > + */ > + > +#include > + > +/* > + * Currently the ACPI 5.1 standard does not define S states in a > + * manner which is usable for ARM64. These two stubs are sufficient > + * that system initialises and device PM works. > + */ > +u32 acpi_target_system_state(void) > +{ > + return ACPI_STATE_S0; > +} > +EXPORT_SYMBOL_GPL(acpi_target_system_state); > + > +int __init acpi_sleep_init(void) > +{ > + return -ENOSYS; > +} > diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile > index 623b117..c32edf5 100644 > --- a/drivers/acpi/Makefile > +++ b/drivers/acpi/Makefile > @@ -23,7 +23,9 @@ acpi-y += nvs.o > > # Power management related files > acpi-y += wakeup.o > +ifneq (,$(findstring $(ARCH),x86 ia64)) > acpi-y += sleep.o > +endif I think this is the typical way of doing the above in kernel makefiles: +ifeq ($(CONFIG_X86),y) acpi-y += sleep.o +endif g. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v9 07/21] ACPI / sleep: Introduce arm64 specific acpi_sleep.c
On Thu, Mar 05, 2015 at 12:16:29AM +, Rafael J. Wysocki wrote: > On Thursday, March 05, 2015 12:25:54 AM Rafael J. Wysocki wrote: > > On Wednesday, March 04, 2015 10:49:25 PM G Gregory wrote: > > > On 4 March 2015 at 22:38, Rafael J. Wysocki wrote: > > > > On Wednesday, February 25, 2015 04:39:47 PM Hanjun Guo wrote: > > > >> From: Graeme Gregory > > > >> > > > >> ACPI 5.1 does not currently support S states for ARM64 hardware but > > > >> ACPI code will call acpi_target_system_state() for device power > > > >> management, so introduce acpi_sleep.c to allow other drivers to > > > >> function > > > >> until S states are defined. > > > >> > > > >> Since it is arm64 specific stub holder, so let acpi_sleep.c to ARM64 > > > >> specific. > > > >> > > > >> TODO: merge this with drivers/acpi/sleep.c once we fix the > > > >> specification. > > > >> > > > >> CC: Rafael J. Wysocki > > > >> Tested-by: Suravee Suthikulpanit > > > >> Tested-by: Yijing Wang > > > >> Tested-by: Mark Langsdorf > > > >> Tested-by: Jon Masters > > > >> Tested-by: Timur Tabi > > > >> Tested-by: Robert Richter > > > >> Acked-by: Robert Richter > > > >> Signed-off-by: Graeme Gregory > > > >> Signed-off-by: Tomasz Nowicki > > > >> Signed-off-by: Hanjun Guo > > > >> --- > > > >> arch/arm64/kernel/Makefile | 2 +- > > > >> arch/arm64/kernel/acpi_sleep.c | 28 > > > >> drivers/acpi/Makefile | 2 ++ > > > >> 3 files changed, 31 insertions(+), 1 deletion(-) > > > >> create mode 100644 arch/arm64/kernel/acpi_sleep.c > > > >> > > > >> diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile > > > >> index 218eb7e..4435943 100644 > > > >> --- a/arch/arm64/kernel/Makefile > > > >> +++ b/arch/arm64/kernel/Makefile > > > >> @@ -34,7 +34,7 @@ arm64-obj-$(CONFIG_KGDB)+= kgdb.o > > > >> arm64-obj-$(CONFIG_EFI) += efi.o efi-stub.o > > > >> efi-entry.o > > > >> arm64-obj-$(CONFIG_PCI) += pci.o > > > >> arm64-obj-$(CONFIG_ARMV8_DEPRECATED) += armv8_deprecated.o > > > >> -arm64-obj-$(CONFIG_ACPI) += acpi.o > > > >> +arm64-obj-$(CONFIG_ACPI) += acpi.o acpi_sleep.o > > > >> > > > >> obj-y+= $(arm64-obj-y) vdso/ > > > >> obj-m+= $(arm64-obj-m) > > > >> diff --git a/arch/arm64/kernel/acpi_sleep.c > > > >> b/arch/arm64/kernel/acpi_sleep.c > > > >> new file mode 100644 > > > >> index 000..54578ef > > > >> --- /dev/null > > > >> +++ b/arch/arm64/kernel/acpi_sleep.c > > > >> @@ -0,0 +1,28 @@ > > > >> +/* > > > >> + * ARM64 Specific Sleep Functionality > > > >> + * > > > >> + * Copyright (C) 2013-2014, Linaro Ltd. > > > >> + * Author: Graeme Gregory > > > >> + * > > > >> + * This program is free software; you can redistribute it and/or > > > >> modify > > > >> + * it under the terms of the GNU General Public License version 2 as > > > >> + * published by the Free Software Foundation. > > > >> + */ > > > >> + > > > >> +#include > > > >> + > > > >> +/* > > > >> + * Currently the ACPI 5.1 standard does not define S states in a > > > >> + * manner which is usable for ARM64. These two stubs are sufficient > > > >> + * that system initialises and device PM works. > > > >> + */ > > > >> +u32 acpi_target_system_state(void) > > > >> +{ > > > >> + return ACPI_STATE_S0; > > > >> +} > > > >> +EXPORT_SYMBOL_GPL(acpi_target_system_state); > > > >> + > > > >> +int __init acpi_sleep_init(void) > > > >> +{ > > > >> + return -ENOSYS; > > > >> +} > > > >> diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile > > > >> index 623b117..c32edf5 100644 > > > >> --- a/drivers/acpi/Makefile > > > >> +++ b/drivers/acpi/Makefile > > > >> @@ -23,7 +23,9 @@ acpi-y += nvs.o > > > >> > > > >> # Power management related files > > > >> acpi-y += wakeup.o > > > >> +ifneq (,$(findstring $(ARCH),x86 ia64)) > > > > > > > > This is super-ugly. Isn't there a better way to do that? > > > > > > > Its the standard example in the GNU Make manual, > > > > It is never used in the kernel this way, though, and I'm not going to let > > that slip through. > > > > > I would certainly love if someone had a batter suggestion. > > > > Define ACPI_GENERIC_SLEEP in drivers/acpi/Kconfig as > > > > config ACPI_GENERIC_SLEEP > > bool > > depends on IA64 || X86 > > > > and build the file conditional on that. > > Or define > > config ACPI_GENERIC_SLEEP > bool > > and then make both x86 and ia64 do > > select ACPI_GENERIC_SLEEP if ACPI > > which kind of will make it clear where the choice takes place. While at it, use the newly defined config entry to add the required static inline in the respective headers and get rid of acpi_sleep.c from arm64. Thanks, Lorenzo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Re: [PATCH v9 07/21] ACPI / sleep: Introduce arm64 specific acpi_sleep.c
On Thu, Mar 05, 2015 at 12:16:29AM +, Rafael J. Wysocki wrote: On Thursday, March 05, 2015 12:25:54 AM Rafael J. Wysocki wrote: On Wednesday, March 04, 2015 10:49:25 PM G Gregory wrote: On 4 March 2015 at 22:38, Rafael J. Wysocki r...@rjwysocki.net wrote: On Wednesday, February 25, 2015 04:39:47 PM Hanjun Guo wrote: From: Graeme Gregory graeme.greg...@linaro.org ACPI 5.1 does not currently support S states for ARM64 hardware but ACPI code will call acpi_target_system_state() for device power management, so introduce acpi_sleep.c to allow other drivers to function until S states are defined. Since it is arm64 specific stub holder, so let acpi_sleep.c to ARM64 specific. TODO: merge this with drivers/acpi/sleep.c once we fix the specification. CC: Rafael J. Wysocki r...@rjwysocki.net Tested-by: Suravee Suthikulpanit suravee.suthikulpa...@amd.com Tested-by: Yijing Wang wangyij...@huawei.com Tested-by: Mark Langsdorf mlang...@redhat.com Tested-by: Jon Masters j...@redhat.com Tested-by: Timur Tabi ti...@codeaurora.org Tested-by: Robert Richter rrich...@cavium.com Acked-by: Robert Richter rrich...@cavium.com Signed-off-by: Graeme Gregory graeme.greg...@linaro.org Signed-off-by: Tomasz Nowicki tomasz.nowi...@linaro.org Signed-off-by: Hanjun Guo hanjun@linaro.org --- arch/arm64/kernel/Makefile | 2 +- arch/arm64/kernel/acpi_sleep.c | 28 drivers/acpi/Makefile | 2 ++ 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 arch/arm64/kernel/acpi_sleep.c diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile index 218eb7e..4435943 100644 --- a/arch/arm64/kernel/Makefile +++ b/arch/arm64/kernel/Makefile @@ -34,7 +34,7 @@ arm64-obj-$(CONFIG_KGDB)+= kgdb.o arm64-obj-$(CONFIG_EFI) += efi.o efi-stub.o efi-entry.o arm64-obj-$(CONFIG_PCI) += pci.o arm64-obj-$(CONFIG_ARMV8_DEPRECATED) += armv8_deprecated.o -arm64-obj-$(CONFIG_ACPI) += acpi.o +arm64-obj-$(CONFIG_ACPI) += acpi.o acpi_sleep.o obj-y+= $(arm64-obj-y) vdso/ obj-m+= $(arm64-obj-m) diff --git a/arch/arm64/kernel/acpi_sleep.c b/arch/arm64/kernel/acpi_sleep.c new file mode 100644 index 000..54578ef --- /dev/null +++ b/arch/arm64/kernel/acpi_sleep.c @@ -0,0 +1,28 @@ +/* + * ARM64 Specific Sleep Functionality + * + * Copyright (C) 2013-2014, Linaro Ltd. + * Author: Graeme Gregory graeme.greg...@linaro.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include linux/acpi.h + +/* + * Currently the ACPI 5.1 standard does not define S states in a + * manner which is usable for ARM64. These two stubs are sufficient + * that system initialises and device PM works. + */ +u32 acpi_target_system_state(void) +{ + return ACPI_STATE_S0; +} +EXPORT_SYMBOL_GPL(acpi_target_system_state); + +int __init acpi_sleep_init(void) +{ + return -ENOSYS; +} diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile index 623b117..c32edf5 100644 --- a/drivers/acpi/Makefile +++ b/drivers/acpi/Makefile @@ -23,7 +23,9 @@ acpi-y += nvs.o # Power management related files acpi-y += wakeup.o +ifneq (,$(findstring $(ARCH),x86 ia64)) This is super-ugly. Isn't there a better way to do that? Its the standard example in the GNU Make manual, It is never used in the kernel this way, though, and I'm not going to let that slip through. I would certainly love if someone had a batter suggestion. Define ACPI_GENERIC_SLEEP in drivers/acpi/Kconfig as config ACPI_GENERIC_SLEEP bool depends on IA64 || X86 and build the file conditional on that. Or define config ACPI_GENERIC_SLEEP bool and then make both x86 and ia64 do select ACPI_GENERIC_SLEEP if ACPI which kind of will make it clear where the choice takes place. While at it, use the newly defined config entry to add the required static inline in the respective headers and get rid of acpi_sleep.c from arm64. Thanks, Lorenzo -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v9 07/21] ACPI / sleep: Introduce arm64 specific acpi_sleep.c
On Wed, 25 Feb 2015 16:39:47 +0800 , Hanjun Guo hanjun@linaro.org wrote: From: Graeme Gregory graeme.greg...@linaro.org ACPI 5.1 does not currently support S states for ARM64 hardware but ACPI code will call acpi_target_system_state() for device power management, so introduce acpi_sleep.c to allow other drivers to function until S states are defined. Since it is arm64 specific stub holder, so let acpi_sleep.c to ARM64 specific. TODO: merge this with drivers/acpi/sleep.c once we fix the specification. CC: Rafael J. Wysocki r...@rjwysocki.net Tested-by: Suravee Suthikulpanit suravee.suthikulpa...@amd.com Tested-by: Yijing Wang wangyij...@huawei.com Tested-by: Mark Langsdorf mlang...@redhat.com Tested-by: Jon Masters j...@redhat.com Tested-by: Timur Tabi ti...@codeaurora.org Tested-by: Robert Richter rrich...@cavium.com Acked-by: Robert Richter rrich...@cavium.com Signed-off-by: Graeme Gregory graeme.greg...@linaro.org Signed-off-by: Tomasz Nowicki tomasz.nowi...@linaro.org Signed-off-by: Hanjun Guo hanjun@linaro.org --- arch/arm64/kernel/Makefile | 2 +- arch/arm64/kernel/acpi_sleep.c | 28 drivers/acpi/Makefile | 2 ++ 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 arch/arm64/kernel/acpi_sleep.c diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile index 218eb7e..4435943 100644 --- a/arch/arm64/kernel/Makefile +++ b/arch/arm64/kernel/Makefile @@ -34,7 +34,7 @@ arm64-obj-$(CONFIG_KGDB)+= kgdb.o arm64-obj-$(CONFIG_EFI) += efi.o efi-stub.o efi-entry.o arm64-obj-$(CONFIG_PCI) += pci.o arm64-obj-$(CONFIG_ARMV8_DEPRECATED) += armv8_deprecated.o -arm64-obj-$(CONFIG_ACPI) += acpi.o +arm64-obj-$(CONFIG_ACPI) += acpi.o acpi_sleep.o obj-y+= $(arm64-obj-y) vdso/ obj-m+= $(arm64-obj-m) diff --git a/arch/arm64/kernel/acpi_sleep.c b/arch/arm64/kernel/acpi_sleep.c new file mode 100644 index 000..54578ef --- /dev/null +++ b/arch/arm64/kernel/acpi_sleep.c @@ -0,0 +1,28 @@ +/* + * ARM64 Specific Sleep Functionality + * + * Copyright (C) 2013-2014, Linaro Ltd. + * Author: Graeme Gregory graeme.greg...@linaro.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include linux/acpi.h + +/* + * Currently the ACPI 5.1 standard does not define S states in a + * manner which is usable for ARM64. These two stubs are sufficient + * that system initialises and device PM works. + */ +u32 acpi_target_system_state(void) +{ + return ACPI_STATE_S0; +} +EXPORT_SYMBOL_GPL(acpi_target_system_state); + +int __init acpi_sleep_init(void) +{ + return -ENOSYS; +} diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile index 623b117..c32edf5 100644 --- a/drivers/acpi/Makefile +++ b/drivers/acpi/Makefile @@ -23,7 +23,9 @@ acpi-y += nvs.o # Power management related files acpi-y += wakeup.o +ifneq (,$(findstring $(ARCH),x86 ia64)) acpi-y += sleep.o +endif I think this is the typical way of doing the above in kernel makefiles: +ifeq ($(CONFIG_X86),y) acpi-y += sleep.o +endif g. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v9 07/21] ACPI / sleep: Introduce arm64 specific acpi_sleep.c
On Thursday, March 05, 2015 12:25:54 AM Rafael J. Wysocki wrote: > On Wednesday, March 04, 2015 10:49:25 PM G Gregory wrote: > > On 4 March 2015 at 22:38, Rafael J. Wysocki wrote: > > > On Wednesday, February 25, 2015 04:39:47 PM Hanjun Guo wrote: > > >> From: Graeme Gregory > > >> > > >> ACPI 5.1 does not currently support S states for ARM64 hardware but > > >> ACPI code will call acpi_target_system_state() for device power > > >> management, so introduce acpi_sleep.c to allow other drivers to function > > >> until S states are defined. > > >> > > >> Since it is arm64 specific stub holder, so let acpi_sleep.c to ARM64 > > >> specific. > > >> > > >> TODO: merge this with drivers/acpi/sleep.c once we fix the specification. > > >> > > >> CC: Rafael J. Wysocki > > >> Tested-by: Suravee Suthikulpanit > > >> Tested-by: Yijing Wang > > >> Tested-by: Mark Langsdorf > > >> Tested-by: Jon Masters > > >> Tested-by: Timur Tabi > > >> Tested-by: Robert Richter > > >> Acked-by: Robert Richter > > >> Signed-off-by: Graeme Gregory > > >> Signed-off-by: Tomasz Nowicki > > >> Signed-off-by: Hanjun Guo > > >> --- > > >> arch/arm64/kernel/Makefile | 2 +- > > >> arch/arm64/kernel/acpi_sleep.c | 28 > > >> drivers/acpi/Makefile | 2 ++ > > >> 3 files changed, 31 insertions(+), 1 deletion(-) > > >> create mode 100644 arch/arm64/kernel/acpi_sleep.c > > >> > > >> diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile > > >> index 218eb7e..4435943 100644 > > >> --- a/arch/arm64/kernel/Makefile > > >> +++ b/arch/arm64/kernel/Makefile > > >> @@ -34,7 +34,7 @@ arm64-obj-$(CONFIG_KGDB)+= kgdb.o > > >> arm64-obj-$(CONFIG_EFI) += efi.o efi-stub.o > > >> efi-entry.o > > >> arm64-obj-$(CONFIG_PCI) += pci.o > > >> arm64-obj-$(CONFIG_ARMV8_DEPRECATED) += armv8_deprecated.o > > >> -arm64-obj-$(CONFIG_ACPI) += acpi.o > > >> +arm64-obj-$(CONFIG_ACPI) += acpi.o acpi_sleep.o > > >> > > >> obj-y+= $(arm64-obj-y) vdso/ > > >> obj-m+= $(arm64-obj-m) > > >> diff --git a/arch/arm64/kernel/acpi_sleep.c > > >> b/arch/arm64/kernel/acpi_sleep.c > > >> new file mode 100644 > > >> index 000..54578ef > > >> --- /dev/null > > >> +++ b/arch/arm64/kernel/acpi_sleep.c > > >> @@ -0,0 +1,28 @@ > > >> +/* > > >> + * ARM64 Specific Sleep Functionality > > >> + * > > >> + * Copyright (C) 2013-2014, Linaro Ltd. > > >> + * Author: Graeme Gregory > > >> + * > > >> + * This program is free software; you can redistribute it and/or modify > > >> + * it under the terms of the GNU General Public License version 2 as > > >> + * published by the Free Software Foundation. > > >> + */ > > >> + > > >> +#include > > >> + > > >> +/* > > >> + * Currently the ACPI 5.1 standard does not define S states in a > > >> + * manner which is usable for ARM64. These two stubs are sufficient > > >> + * that system initialises and device PM works. > > >> + */ > > >> +u32 acpi_target_system_state(void) > > >> +{ > > >> + return ACPI_STATE_S0; > > >> +} > > >> +EXPORT_SYMBOL_GPL(acpi_target_system_state); > > >> + > > >> +int __init acpi_sleep_init(void) > > >> +{ > > >> + return -ENOSYS; > > >> +} > > >> diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile > > >> index 623b117..c32edf5 100644 > > >> --- a/drivers/acpi/Makefile > > >> +++ b/drivers/acpi/Makefile > > >> @@ -23,7 +23,9 @@ acpi-y += nvs.o > > >> > > >> # Power management related files > > >> acpi-y += wakeup.o > > >> +ifneq (,$(findstring $(ARCH),x86 ia64)) > > > > > > This is super-ugly. Isn't there a better way to do that? > > > > > Its the standard example in the GNU Make manual, > > It is never used in the kernel this way, though, and I'm not going to let > that slip through. > > > I would certainly love if someone had a batter suggestion. > > Define ACPI_GENERIC_SLEEP in drivers/acpi/Kconfig as > > config ACPI_GENERIC_SLEEP > bool > depends on IA64 || X86 > > and build the file conditional on that. Or define config ACPI_GENERIC_SLEEP bool and then make both x86 and ia64 do select ACPI_GENERIC_SLEEP if ACPI which kind of will make it clear where the choice takes place. -- I speak only for myself. Rafael J. Wysocki, Intel Open Source Technology Center. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v9 07/21] ACPI / sleep: Introduce arm64 specific acpi_sleep.c
On Wednesday, March 04, 2015 10:49:25 PM G Gregory wrote: > On 4 March 2015 at 22:38, Rafael J. Wysocki wrote: > > On Wednesday, February 25, 2015 04:39:47 PM Hanjun Guo wrote: > >> From: Graeme Gregory > >> > >> ACPI 5.1 does not currently support S states for ARM64 hardware but > >> ACPI code will call acpi_target_system_state() for device power > >> management, so introduce acpi_sleep.c to allow other drivers to function > >> until S states are defined. > >> > >> Since it is arm64 specific stub holder, so let acpi_sleep.c to ARM64 > >> specific. > >> > >> TODO: merge this with drivers/acpi/sleep.c once we fix the specification. > >> > >> CC: Rafael J. Wysocki > >> Tested-by: Suravee Suthikulpanit > >> Tested-by: Yijing Wang > >> Tested-by: Mark Langsdorf > >> Tested-by: Jon Masters > >> Tested-by: Timur Tabi > >> Tested-by: Robert Richter > >> Acked-by: Robert Richter > >> Signed-off-by: Graeme Gregory > >> Signed-off-by: Tomasz Nowicki > >> Signed-off-by: Hanjun Guo > >> --- > >> arch/arm64/kernel/Makefile | 2 +- > >> arch/arm64/kernel/acpi_sleep.c | 28 > >> drivers/acpi/Makefile | 2 ++ > >> 3 files changed, 31 insertions(+), 1 deletion(-) > >> create mode 100644 arch/arm64/kernel/acpi_sleep.c > >> > >> diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile > >> index 218eb7e..4435943 100644 > >> --- a/arch/arm64/kernel/Makefile > >> +++ b/arch/arm64/kernel/Makefile > >> @@ -34,7 +34,7 @@ arm64-obj-$(CONFIG_KGDB)+= kgdb.o > >> arm64-obj-$(CONFIG_EFI) += efi.o efi-stub.o > >> efi-entry.o > >> arm64-obj-$(CONFIG_PCI) += pci.o > >> arm64-obj-$(CONFIG_ARMV8_DEPRECATED) += armv8_deprecated.o > >> -arm64-obj-$(CONFIG_ACPI) += acpi.o > >> +arm64-obj-$(CONFIG_ACPI) += acpi.o acpi_sleep.o > >> > >> obj-y+= $(arm64-obj-y) vdso/ > >> obj-m+= $(arm64-obj-m) > >> diff --git a/arch/arm64/kernel/acpi_sleep.c > >> b/arch/arm64/kernel/acpi_sleep.c > >> new file mode 100644 > >> index 000..54578ef > >> --- /dev/null > >> +++ b/arch/arm64/kernel/acpi_sleep.c > >> @@ -0,0 +1,28 @@ > >> +/* > >> + * ARM64 Specific Sleep Functionality > >> + * > >> + * Copyright (C) 2013-2014, Linaro Ltd. > >> + * Author: Graeme Gregory > >> + * > >> + * This program is free software; you can redistribute it and/or modify > >> + * it under the terms of the GNU General Public License version 2 as > >> + * published by the Free Software Foundation. > >> + */ > >> + > >> +#include > >> + > >> +/* > >> + * Currently the ACPI 5.1 standard does not define S states in a > >> + * manner which is usable for ARM64. These two stubs are sufficient > >> + * that system initialises and device PM works. > >> + */ > >> +u32 acpi_target_system_state(void) > >> +{ > >> + return ACPI_STATE_S0; > >> +} > >> +EXPORT_SYMBOL_GPL(acpi_target_system_state); > >> + > >> +int __init acpi_sleep_init(void) > >> +{ > >> + return -ENOSYS; > >> +} > >> diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile > >> index 623b117..c32edf5 100644 > >> --- a/drivers/acpi/Makefile > >> +++ b/drivers/acpi/Makefile > >> @@ -23,7 +23,9 @@ acpi-y += nvs.o > >> > >> # Power management related files > >> acpi-y += wakeup.o > >> +ifneq (,$(findstring $(ARCH),x86 ia64)) > > > > This is super-ugly. Isn't there a better way to do that? > > > Its the standard example in the GNU Make manual, It is never used in the kernel this way, though, and I'm not going to let that slip through. > I would certainly love if someone had a batter suggestion. Define ACPI_GENERIC_SLEEP in drivers/acpi/Kconfig as config ACPI_GENERIC_SLEEP bool depends on IA64 || X86 and build the file conditional on that. -- I speak only for myself. Rafael J. Wysocki, Intel Open Source Technology Center. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v9 07/21] ACPI / sleep: Introduce arm64 specific acpi_sleep.c
On 4 March 2015 at 22:38, Rafael J. Wysocki wrote: > On Wednesday, February 25, 2015 04:39:47 PM Hanjun Guo wrote: >> From: Graeme Gregory >> >> ACPI 5.1 does not currently support S states for ARM64 hardware but >> ACPI code will call acpi_target_system_state() for device power >> management, so introduce acpi_sleep.c to allow other drivers to function >> until S states are defined. >> >> Since it is arm64 specific stub holder, so let acpi_sleep.c to ARM64 >> specific. >> >> TODO: merge this with drivers/acpi/sleep.c once we fix the specification. >> >> CC: Rafael J. Wysocki >> Tested-by: Suravee Suthikulpanit >> Tested-by: Yijing Wang >> Tested-by: Mark Langsdorf >> Tested-by: Jon Masters >> Tested-by: Timur Tabi >> Tested-by: Robert Richter >> Acked-by: Robert Richter >> Signed-off-by: Graeme Gregory >> Signed-off-by: Tomasz Nowicki >> Signed-off-by: Hanjun Guo >> --- >> arch/arm64/kernel/Makefile | 2 +- >> arch/arm64/kernel/acpi_sleep.c | 28 >> drivers/acpi/Makefile | 2 ++ >> 3 files changed, 31 insertions(+), 1 deletion(-) >> create mode 100644 arch/arm64/kernel/acpi_sleep.c >> >> diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile >> index 218eb7e..4435943 100644 >> --- a/arch/arm64/kernel/Makefile >> +++ b/arch/arm64/kernel/Makefile >> @@ -34,7 +34,7 @@ arm64-obj-$(CONFIG_KGDB)+= kgdb.o >> arm64-obj-$(CONFIG_EFI) += efi.o efi-stub.o efi-entry.o >> arm64-obj-$(CONFIG_PCI) += pci.o >> arm64-obj-$(CONFIG_ARMV8_DEPRECATED) += armv8_deprecated.o >> -arm64-obj-$(CONFIG_ACPI) += acpi.o >> +arm64-obj-$(CONFIG_ACPI) += acpi.o acpi_sleep.o >> >> obj-y+= $(arm64-obj-y) vdso/ >> obj-m+= $(arm64-obj-m) >> diff --git a/arch/arm64/kernel/acpi_sleep.c b/arch/arm64/kernel/acpi_sleep.c >> new file mode 100644 >> index 000..54578ef >> --- /dev/null >> +++ b/arch/arm64/kernel/acpi_sleep.c >> @@ -0,0 +1,28 @@ >> +/* >> + * ARM64 Specific Sleep Functionality >> + * >> + * Copyright (C) 2013-2014, Linaro Ltd. >> + * Author: Graeme Gregory >> + * >> + * This program is free software; you can redistribute it and/or modify >> + * it under the terms of the GNU General Public License version 2 as >> + * published by the Free Software Foundation. >> + */ >> + >> +#include >> + >> +/* >> + * Currently the ACPI 5.1 standard does not define S states in a >> + * manner which is usable for ARM64. These two stubs are sufficient >> + * that system initialises and device PM works. >> + */ >> +u32 acpi_target_system_state(void) >> +{ >> + return ACPI_STATE_S0; >> +} >> +EXPORT_SYMBOL_GPL(acpi_target_system_state); >> + >> +int __init acpi_sleep_init(void) >> +{ >> + return -ENOSYS; >> +} >> diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile >> index 623b117..c32edf5 100644 >> --- a/drivers/acpi/Makefile >> +++ b/drivers/acpi/Makefile >> @@ -23,7 +23,9 @@ acpi-y += nvs.o >> >> # Power management related files >> acpi-y += wakeup.o >> +ifneq (,$(findstring $(ARCH),x86 ia64)) > > This is super-ugly. Isn't there a better way to do that? > Its the standard example in the GNU Make manual, I would certainly love if someone had a batter suggestion. Graeme -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v9 07/21] ACPI / sleep: Introduce arm64 specific acpi_sleep.c
On Wednesday, February 25, 2015 04:39:47 PM Hanjun Guo wrote: > From: Graeme Gregory > > ACPI 5.1 does not currently support S states for ARM64 hardware but > ACPI code will call acpi_target_system_state() for device power > management, so introduce acpi_sleep.c to allow other drivers to function > until S states are defined. > > Since it is arm64 specific stub holder, so let acpi_sleep.c to ARM64 > specific. > > TODO: merge this with drivers/acpi/sleep.c once we fix the specification. > > CC: Rafael J. Wysocki > Tested-by: Suravee Suthikulpanit > Tested-by: Yijing Wang > Tested-by: Mark Langsdorf > Tested-by: Jon Masters > Tested-by: Timur Tabi > Tested-by: Robert Richter > Acked-by: Robert Richter > Signed-off-by: Graeme Gregory > Signed-off-by: Tomasz Nowicki > Signed-off-by: Hanjun Guo > --- > arch/arm64/kernel/Makefile | 2 +- > arch/arm64/kernel/acpi_sleep.c | 28 > drivers/acpi/Makefile | 2 ++ > 3 files changed, 31 insertions(+), 1 deletion(-) > create mode 100644 arch/arm64/kernel/acpi_sleep.c > > diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile > index 218eb7e..4435943 100644 > --- a/arch/arm64/kernel/Makefile > +++ b/arch/arm64/kernel/Makefile > @@ -34,7 +34,7 @@ arm64-obj-$(CONFIG_KGDB)+= kgdb.o > arm64-obj-$(CONFIG_EFI) += efi.o efi-stub.o efi-entry.o > arm64-obj-$(CONFIG_PCI) += pci.o > arm64-obj-$(CONFIG_ARMV8_DEPRECATED) += armv8_deprecated.o > -arm64-obj-$(CONFIG_ACPI) += acpi.o > +arm64-obj-$(CONFIG_ACPI) += acpi.o acpi_sleep.o > > obj-y+= $(arm64-obj-y) vdso/ > obj-m+= $(arm64-obj-m) > diff --git a/arch/arm64/kernel/acpi_sleep.c b/arch/arm64/kernel/acpi_sleep.c > new file mode 100644 > index 000..54578ef > --- /dev/null > +++ b/arch/arm64/kernel/acpi_sleep.c > @@ -0,0 +1,28 @@ > +/* > + * ARM64 Specific Sleep Functionality > + * > + * Copyright (C) 2013-2014, Linaro Ltd. > + * Author: Graeme Gregory > + * > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Public License version 2 as > + * published by the Free Software Foundation. > + */ > + > +#include > + > +/* > + * Currently the ACPI 5.1 standard does not define S states in a > + * manner which is usable for ARM64. These two stubs are sufficient > + * that system initialises and device PM works. > + */ > +u32 acpi_target_system_state(void) > +{ > + return ACPI_STATE_S0; > +} > +EXPORT_SYMBOL_GPL(acpi_target_system_state); > + > +int __init acpi_sleep_init(void) > +{ > + return -ENOSYS; > +} > diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile > index 623b117..c32edf5 100644 > --- a/drivers/acpi/Makefile > +++ b/drivers/acpi/Makefile > @@ -23,7 +23,9 @@ acpi-y += nvs.o > > # Power management related files > acpi-y += wakeup.o > +ifneq (,$(findstring $(ARCH),x86 ia64)) This is super-ugly. Isn't there a better way to do that? > acpi-y += sleep.o > +endif > acpi-y += device_pm.o > acpi-$(CONFIG_ACPI_SLEEP)+= proc.o > > -- I speak only for myself. Rafael J. Wysocki, Intel Open Source Technology Center. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v9 07/21] ACPI / sleep: Introduce arm64 specific acpi_sleep.c
On Wednesday, February 25, 2015 04:39:47 PM Hanjun Guo wrote: From: Graeme Gregory graeme.greg...@linaro.org ACPI 5.1 does not currently support S states for ARM64 hardware but ACPI code will call acpi_target_system_state() for device power management, so introduce acpi_sleep.c to allow other drivers to function until S states are defined. Since it is arm64 specific stub holder, so let acpi_sleep.c to ARM64 specific. TODO: merge this with drivers/acpi/sleep.c once we fix the specification. CC: Rafael J. Wysocki r...@rjwysocki.net Tested-by: Suravee Suthikulpanit suravee.suthikulpa...@amd.com Tested-by: Yijing Wang wangyij...@huawei.com Tested-by: Mark Langsdorf mlang...@redhat.com Tested-by: Jon Masters j...@redhat.com Tested-by: Timur Tabi ti...@codeaurora.org Tested-by: Robert Richter rrich...@cavium.com Acked-by: Robert Richter rrich...@cavium.com Signed-off-by: Graeme Gregory graeme.greg...@linaro.org Signed-off-by: Tomasz Nowicki tomasz.nowi...@linaro.org Signed-off-by: Hanjun Guo hanjun@linaro.org --- arch/arm64/kernel/Makefile | 2 +- arch/arm64/kernel/acpi_sleep.c | 28 drivers/acpi/Makefile | 2 ++ 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 arch/arm64/kernel/acpi_sleep.c diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile index 218eb7e..4435943 100644 --- a/arch/arm64/kernel/Makefile +++ b/arch/arm64/kernel/Makefile @@ -34,7 +34,7 @@ arm64-obj-$(CONFIG_KGDB)+= kgdb.o arm64-obj-$(CONFIG_EFI) += efi.o efi-stub.o efi-entry.o arm64-obj-$(CONFIG_PCI) += pci.o arm64-obj-$(CONFIG_ARMV8_DEPRECATED) += armv8_deprecated.o -arm64-obj-$(CONFIG_ACPI) += acpi.o +arm64-obj-$(CONFIG_ACPI) += acpi.o acpi_sleep.o obj-y+= $(arm64-obj-y) vdso/ obj-m+= $(arm64-obj-m) diff --git a/arch/arm64/kernel/acpi_sleep.c b/arch/arm64/kernel/acpi_sleep.c new file mode 100644 index 000..54578ef --- /dev/null +++ b/arch/arm64/kernel/acpi_sleep.c @@ -0,0 +1,28 @@ +/* + * ARM64 Specific Sleep Functionality + * + * Copyright (C) 2013-2014, Linaro Ltd. + * Author: Graeme Gregory graeme.greg...@linaro.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include linux/acpi.h + +/* + * Currently the ACPI 5.1 standard does not define S states in a + * manner which is usable for ARM64. These two stubs are sufficient + * that system initialises and device PM works. + */ +u32 acpi_target_system_state(void) +{ + return ACPI_STATE_S0; +} +EXPORT_SYMBOL_GPL(acpi_target_system_state); + +int __init acpi_sleep_init(void) +{ + return -ENOSYS; +} diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile index 623b117..c32edf5 100644 --- a/drivers/acpi/Makefile +++ b/drivers/acpi/Makefile @@ -23,7 +23,9 @@ acpi-y += nvs.o # Power management related files acpi-y += wakeup.o +ifneq (,$(findstring $(ARCH),x86 ia64)) This is super-ugly. Isn't there a better way to do that? acpi-y += sleep.o +endif acpi-y += device_pm.o acpi-$(CONFIG_ACPI_SLEEP)+= proc.o -- I speak only for myself. Rafael J. Wysocki, Intel Open Source Technology Center. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v9 07/21] ACPI / sleep: Introduce arm64 specific acpi_sleep.c
On 4 March 2015 at 22:38, Rafael J. Wysocki r...@rjwysocki.net wrote: On Wednesday, February 25, 2015 04:39:47 PM Hanjun Guo wrote: From: Graeme Gregory graeme.greg...@linaro.org ACPI 5.1 does not currently support S states for ARM64 hardware but ACPI code will call acpi_target_system_state() for device power management, so introduce acpi_sleep.c to allow other drivers to function until S states are defined. Since it is arm64 specific stub holder, so let acpi_sleep.c to ARM64 specific. TODO: merge this with drivers/acpi/sleep.c once we fix the specification. CC: Rafael J. Wysocki r...@rjwysocki.net Tested-by: Suravee Suthikulpanit suravee.suthikulpa...@amd.com Tested-by: Yijing Wang wangyij...@huawei.com Tested-by: Mark Langsdorf mlang...@redhat.com Tested-by: Jon Masters j...@redhat.com Tested-by: Timur Tabi ti...@codeaurora.org Tested-by: Robert Richter rrich...@cavium.com Acked-by: Robert Richter rrich...@cavium.com Signed-off-by: Graeme Gregory graeme.greg...@linaro.org Signed-off-by: Tomasz Nowicki tomasz.nowi...@linaro.org Signed-off-by: Hanjun Guo hanjun@linaro.org --- arch/arm64/kernel/Makefile | 2 +- arch/arm64/kernel/acpi_sleep.c | 28 drivers/acpi/Makefile | 2 ++ 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 arch/arm64/kernel/acpi_sleep.c diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile index 218eb7e..4435943 100644 --- a/arch/arm64/kernel/Makefile +++ b/arch/arm64/kernel/Makefile @@ -34,7 +34,7 @@ arm64-obj-$(CONFIG_KGDB)+= kgdb.o arm64-obj-$(CONFIG_EFI) += efi.o efi-stub.o efi-entry.o arm64-obj-$(CONFIG_PCI) += pci.o arm64-obj-$(CONFIG_ARMV8_DEPRECATED) += armv8_deprecated.o -arm64-obj-$(CONFIG_ACPI) += acpi.o +arm64-obj-$(CONFIG_ACPI) += acpi.o acpi_sleep.o obj-y+= $(arm64-obj-y) vdso/ obj-m+= $(arm64-obj-m) diff --git a/arch/arm64/kernel/acpi_sleep.c b/arch/arm64/kernel/acpi_sleep.c new file mode 100644 index 000..54578ef --- /dev/null +++ b/arch/arm64/kernel/acpi_sleep.c @@ -0,0 +1,28 @@ +/* + * ARM64 Specific Sleep Functionality + * + * Copyright (C) 2013-2014, Linaro Ltd. + * Author: Graeme Gregory graeme.greg...@linaro.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include linux/acpi.h + +/* + * Currently the ACPI 5.1 standard does not define S states in a + * manner which is usable for ARM64. These two stubs are sufficient + * that system initialises and device PM works. + */ +u32 acpi_target_system_state(void) +{ + return ACPI_STATE_S0; +} +EXPORT_SYMBOL_GPL(acpi_target_system_state); + +int __init acpi_sleep_init(void) +{ + return -ENOSYS; +} diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile index 623b117..c32edf5 100644 --- a/drivers/acpi/Makefile +++ b/drivers/acpi/Makefile @@ -23,7 +23,9 @@ acpi-y += nvs.o # Power management related files acpi-y += wakeup.o +ifneq (,$(findstring $(ARCH),x86 ia64)) This is super-ugly. Isn't there a better way to do that? Its the standard example in the GNU Make manual, I would certainly love if someone had a batter suggestion. Graeme -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v9 07/21] ACPI / sleep: Introduce arm64 specific acpi_sleep.c
On Thursday, March 05, 2015 12:25:54 AM Rafael J. Wysocki wrote: On Wednesday, March 04, 2015 10:49:25 PM G Gregory wrote: On 4 March 2015 at 22:38, Rafael J. Wysocki r...@rjwysocki.net wrote: On Wednesday, February 25, 2015 04:39:47 PM Hanjun Guo wrote: From: Graeme Gregory graeme.greg...@linaro.org ACPI 5.1 does not currently support S states for ARM64 hardware but ACPI code will call acpi_target_system_state() for device power management, so introduce acpi_sleep.c to allow other drivers to function until S states are defined. Since it is arm64 specific stub holder, so let acpi_sleep.c to ARM64 specific. TODO: merge this with drivers/acpi/sleep.c once we fix the specification. CC: Rafael J. Wysocki r...@rjwysocki.net Tested-by: Suravee Suthikulpanit suravee.suthikulpa...@amd.com Tested-by: Yijing Wang wangyij...@huawei.com Tested-by: Mark Langsdorf mlang...@redhat.com Tested-by: Jon Masters j...@redhat.com Tested-by: Timur Tabi ti...@codeaurora.org Tested-by: Robert Richter rrich...@cavium.com Acked-by: Robert Richter rrich...@cavium.com Signed-off-by: Graeme Gregory graeme.greg...@linaro.org Signed-off-by: Tomasz Nowicki tomasz.nowi...@linaro.org Signed-off-by: Hanjun Guo hanjun@linaro.org --- arch/arm64/kernel/Makefile | 2 +- arch/arm64/kernel/acpi_sleep.c | 28 drivers/acpi/Makefile | 2 ++ 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 arch/arm64/kernel/acpi_sleep.c diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile index 218eb7e..4435943 100644 --- a/arch/arm64/kernel/Makefile +++ b/arch/arm64/kernel/Makefile @@ -34,7 +34,7 @@ arm64-obj-$(CONFIG_KGDB)+= kgdb.o arm64-obj-$(CONFIG_EFI) += efi.o efi-stub.o efi-entry.o arm64-obj-$(CONFIG_PCI) += pci.o arm64-obj-$(CONFIG_ARMV8_DEPRECATED) += armv8_deprecated.o -arm64-obj-$(CONFIG_ACPI) += acpi.o +arm64-obj-$(CONFIG_ACPI) += acpi.o acpi_sleep.o obj-y+= $(arm64-obj-y) vdso/ obj-m+= $(arm64-obj-m) diff --git a/arch/arm64/kernel/acpi_sleep.c b/arch/arm64/kernel/acpi_sleep.c new file mode 100644 index 000..54578ef --- /dev/null +++ b/arch/arm64/kernel/acpi_sleep.c @@ -0,0 +1,28 @@ +/* + * ARM64 Specific Sleep Functionality + * + * Copyright (C) 2013-2014, Linaro Ltd. + * Author: Graeme Gregory graeme.greg...@linaro.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include linux/acpi.h + +/* + * Currently the ACPI 5.1 standard does not define S states in a + * manner which is usable for ARM64. These two stubs are sufficient + * that system initialises and device PM works. + */ +u32 acpi_target_system_state(void) +{ + return ACPI_STATE_S0; +} +EXPORT_SYMBOL_GPL(acpi_target_system_state); + +int __init acpi_sleep_init(void) +{ + return -ENOSYS; +} diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile index 623b117..c32edf5 100644 --- a/drivers/acpi/Makefile +++ b/drivers/acpi/Makefile @@ -23,7 +23,9 @@ acpi-y += nvs.o # Power management related files acpi-y += wakeup.o +ifneq (,$(findstring $(ARCH),x86 ia64)) This is super-ugly. Isn't there a better way to do that? Its the standard example in the GNU Make manual, It is never used in the kernel this way, though, and I'm not going to let that slip through. I would certainly love if someone had a batter suggestion. Define ACPI_GENERIC_SLEEP in drivers/acpi/Kconfig as config ACPI_GENERIC_SLEEP bool depends on IA64 || X86 and build the file conditional on that. Or define config ACPI_GENERIC_SLEEP bool and then make both x86 and ia64 do select ACPI_GENERIC_SLEEP if ACPI which kind of will make it clear where the choice takes place. -- I speak only for myself. Rafael J. Wysocki, Intel Open Source Technology Center. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH v9 07/21] ACPI / sleep: Introduce arm64 specific acpi_sleep.c
On Wednesday, March 04, 2015 10:49:25 PM G Gregory wrote: On 4 March 2015 at 22:38, Rafael J. Wysocki r...@rjwysocki.net wrote: On Wednesday, February 25, 2015 04:39:47 PM Hanjun Guo wrote: From: Graeme Gregory graeme.greg...@linaro.org ACPI 5.1 does not currently support S states for ARM64 hardware but ACPI code will call acpi_target_system_state() for device power management, so introduce acpi_sleep.c to allow other drivers to function until S states are defined. Since it is arm64 specific stub holder, so let acpi_sleep.c to ARM64 specific. TODO: merge this with drivers/acpi/sleep.c once we fix the specification. CC: Rafael J. Wysocki r...@rjwysocki.net Tested-by: Suravee Suthikulpanit suravee.suthikulpa...@amd.com Tested-by: Yijing Wang wangyij...@huawei.com Tested-by: Mark Langsdorf mlang...@redhat.com Tested-by: Jon Masters j...@redhat.com Tested-by: Timur Tabi ti...@codeaurora.org Tested-by: Robert Richter rrich...@cavium.com Acked-by: Robert Richter rrich...@cavium.com Signed-off-by: Graeme Gregory graeme.greg...@linaro.org Signed-off-by: Tomasz Nowicki tomasz.nowi...@linaro.org Signed-off-by: Hanjun Guo hanjun@linaro.org --- arch/arm64/kernel/Makefile | 2 +- arch/arm64/kernel/acpi_sleep.c | 28 drivers/acpi/Makefile | 2 ++ 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 arch/arm64/kernel/acpi_sleep.c diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile index 218eb7e..4435943 100644 --- a/arch/arm64/kernel/Makefile +++ b/arch/arm64/kernel/Makefile @@ -34,7 +34,7 @@ arm64-obj-$(CONFIG_KGDB)+= kgdb.o arm64-obj-$(CONFIG_EFI) += efi.o efi-stub.o efi-entry.o arm64-obj-$(CONFIG_PCI) += pci.o arm64-obj-$(CONFIG_ARMV8_DEPRECATED) += armv8_deprecated.o -arm64-obj-$(CONFIG_ACPI) += acpi.o +arm64-obj-$(CONFIG_ACPI) += acpi.o acpi_sleep.o obj-y+= $(arm64-obj-y) vdso/ obj-m+= $(arm64-obj-m) diff --git a/arch/arm64/kernel/acpi_sleep.c b/arch/arm64/kernel/acpi_sleep.c new file mode 100644 index 000..54578ef --- /dev/null +++ b/arch/arm64/kernel/acpi_sleep.c @@ -0,0 +1,28 @@ +/* + * ARM64 Specific Sleep Functionality + * + * Copyright (C) 2013-2014, Linaro Ltd. + * Author: Graeme Gregory graeme.greg...@linaro.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include linux/acpi.h + +/* + * Currently the ACPI 5.1 standard does not define S states in a + * manner which is usable for ARM64. These two stubs are sufficient + * that system initialises and device PM works. + */ +u32 acpi_target_system_state(void) +{ + return ACPI_STATE_S0; +} +EXPORT_SYMBOL_GPL(acpi_target_system_state); + +int __init acpi_sleep_init(void) +{ + return -ENOSYS; +} diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile index 623b117..c32edf5 100644 --- a/drivers/acpi/Makefile +++ b/drivers/acpi/Makefile @@ -23,7 +23,9 @@ acpi-y += nvs.o # Power management related files acpi-y += wakeup.o +ifneq (,$(findstring $(ARCH),x86 ia64)) This is super-ugly. Isn't there a better way to do that? Its the standard example in the GNU Make manual, It is never used in the kernel this way, though, and I'm not going to let that slip through. I would certainly love if someone had a batter suggestion. Define ACPI_GENERIC_SLEEP in drivers/acpi/Kconfig as config ACPI_GENERIC_SLEEP bool depends on IA64 || X86 and build the file conditional on that. -- I speak only for myself. Rafael J. Wysocki, Intel Open Source Technology Center. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v9 07/21] ACPI / sleep: Introduce arm64 specific acpi_sleep.c
From: Graeme Gregory ACPI 5.1 does not currently support S states for ARM64 hardware but ACPI code will call acpi_target_system_state() for device power management, so introduce acpi_sleep.c to allow other drivers to function until S states are defined. Since it is arm64 specific stub holder, so let acpi_sleep.c to ARM64 specific. TODO: merge this with drivers/acpi/sleep.c once we fix the specification. CC: Rafael J. Wysocki Tested-by: Suravee Suthikulpanit Tested-by: Yijing Wang Tested-by: Mark Langsdorf Tested-by: Jon Masters Tested-by: Timur Tabi Tested-by: Robert Richter Acked-by: Robert Richter Signed-off-by: Graeme Gregory Signed-off-by: Tomasz Nowicki Signed-off-by: Hanjun Guo --- arch/arm64/kernel/Makefile | 2 +- arch/arm64/kernel/acpi_sleep.c | 28 drivers/acpi/Makefile | 2 ++ 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 arch/arm64/kernel/acpi_sleep.c diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile index 218eb7e..4435943 100644 --- a/arch/arm64/kernel/Makefile +++ b/arch/arm64/kernel/Makefile @@ -34,7 +34,7 @@ arm64-obj-$(CONFIG_KGDB) += kgdb.o arm64-obj-$(CONFIG_EFI)+= efi.o efi-stub.o efi-entry.o arm64-obj-$(CONFIG_PCI)+= pci.o arm64-obj-$(CONFIG_ARMV8_DEPRECATED) += armv8_deprecated.o -arm64-obj-$(CONFIG_ACPI) += acpi.o +arm64-obj-$(CONFIG_ACPI) += acpi.o acpi_sleep.o obj-y += $(arm64-obj-y) vdso/ obj-m += $(arm64-obj-m) diff --git a/arch/arm64/kernel/acpi_sleep.c b/arch/arm64/kernel/acpi_sleep.c new file mode 100644 index 000..54578ef --- /dev/null +++ b/arch/arm64/kernel/acpi_sleep.c @@ -0,0 +1,28 @@ +/* + * ARM64 Specific Sleep Functionality + * + * Copyright (C) 2013-2014, Linaro Ltd. + * Author: Graeme Gregory + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include + +/* + * Currently the ACPI 5.1 standard does not define S states in a + * manner which is usable for ARM64. These two stubs are sufficient + * that system initialises and device PM works. + */ +u32 acpi_target_system_state(void) +{ + return ACPI_STATE_S0; +} +EXPORT_SYMBOL_GPL(acpi_target_system_state); + +int __init acpi_sleep_init(void) +{ + return -ENOSYS; +} diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile index 623b117..c32edf5 100644 --- a/drivers/acpi/Makefile +++ b/drivers/acpi/Makefile @@ -23,7 +23,9 @@ acpi-y+= nvs.o # Power management related files acpi-y += wakeup.o +ifneq (,$(findstring $(ARCH),x86 ia64)) acpi-y += sleep.o +endif acpi-y += device_pm.o acpi-$(CONFIG_ACPI_SLEEP) += proc.o -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v9 07/21] ACPI / sleep: Introduce arm64 specific acpi_sleep.c
From: Graeme Gregory graeme.greg...@linaro.org ACPI 5.1 does not currently support S states for ARM64 hardware but ACPI code will call acpi_target_system_state() for device power management, so introduce acpi_sleep.c to allow other drivers to function until S states are defined. Since it is arm64 specific stub holder, so let acpi_sleep.c to ARM64 specific. TODO: merge this with drivers/acpi/sleep.c once we fix the specification. CC: Rafael J. Wysocki r...@rjwysocki.net Tested-by: Suravee Suthikulpanit suravee.suthikulpa...@amd.com Tested-by: Yijing Wang wangyij...@huawei.com Tested-by: Mark Langsdorf mlang...@redhat.com Tested-by: Jon Masters j...@redhat.com Tested-by: Timur Tabi ti...@codeaurora.org Tested-by: Robert Richter rrich...@cavium.com Acked-by: Robert Richter rrich...@cavium.com Signed-off-by: Graeme Gregory graeme.greg...@linaro.org Signed-off-by: Tomasz Nowicki tomasz.nowi...@linaro.org Signed-off-by: Hanjun Guo hanjun@linaro.org --- arch/arm64/kernel/Makefile | 2 +- arch/arm64/kernel/acpi_sleep.c | 28 drivers/acpi/Makefile | 2 ++ 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 arch/arm64/kernel/acpi_sleep.c diff --git a/arch/arm64/kernel/Makefile b/arch/arm64/kernel/Makefile index 218eb7e..4435943 100644 --- a/arch/arm64/kernel/Makefile +++ b/arch/arm64/kernel/Makefile @@ -34,7 +34,7 @@ arm64-obj-$(CONFIG_KGDB) += kgdb.o arm64-obj-$(CONFIG_EFI)+= efi.o efi-stub.o efi-entry.o arm64-obj-$(CONFIG_PCI)+= pci.o arm64-obj-$(CONFIG_ARMV8_DEPRECATED) += armv8_deprecated.o -arm64-obj-$(CONFIG_ACPI) += acpi.o +arm64-obj-$(CONFIG_ACPI) += acpi.o acpi_sleep.o obj-y += $(arm64-obj-y) vdso/ obj-m += $(arm64-obj-m) diff --git a/arch/arm64/kernel/acpi_sleep.c b/arch/arm64/kernel/acpi_sleep.c new file mode 100644 index 000..54578ef --- /dev/null +++ b/arch/arm64/kernel/acpi_sleep.c @@ -0,0 +1,28 @@ +/* + * ARM64 Specific Sleep Functionality + * + * Copyright (C) 2013-2014, Linaro Ltd. + * Author: Graeme Gregory graeme.greg...@linaro.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include linux/acpi.h + +/* + * Currently the ACPI 5.1 standard does not define S states in a + * manner which is usable for ARM64. These two stubs are sufficient + * that system initialises and device PM works. + */ +u32 acpi_target_system_state(void) +{ + return ACPI_STATE_S0; +} +EXPORT_SYMBOL_GPL(acpi_target_system_state); + +int __init acpi_sleep_init(void) +{ + return -ENOSYS; +} diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile index 623b117..c32edf5 100644 --- a/drivers/acpi/Makefile +++ b/drivers/acpi/Makefile @@ -23,7 +23,9 @@ acpi-y+= nvs.o # Power management related files acpi-y += wakeup.o +ifneq (,$(findstring $(ARCH),x86 ia64)) acpi-y += sleep.o +endif acpi-y += device_pm.o acpi-$(CONFIG_ACPI_SLEEP) += proc.o -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/