linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hanjun Guo <hanjun.guo@linaro.org>
To: Rob Herring <robherring2@gmail.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will.deacon@arm.com>,
	Russell King - ARM Linux <linux@arm.linux.org.uk>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Matthew Garrett <mjg59@srcf.ucam.org>,
	"linaro-kernel@lists.linaro.org" <linaro-kernel@lists.linaro.org>,
	Graeme Gregory <graeme.gregory@linaro.org>,
	Al Stone <al.stone@linaro.org>,
	Linaro Patches <patches@linaro.org>,
	Olof Johansson <olof@lixom.net>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Rob Herring <rob.herring@calxeda.com>,
	linaro-acpi@lists.linaro.org, linux-acpi@vger.kernel.org,
	Grant Likely <grant.likely@linaro.org>,
	Bjorn Helgaas <bhelgaas@google.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [RFC part1 PATCH 5/7] ARM64 / ACPI: Introduce arm_core.c and its related head file
Date: Thu, 05 Dec 2013 22:27:58 +0800	[thread overview]
Message-ID: <52A08D6E.9070400@linaro.org> (raw)
In-Reply-To: <CAL_Jsq+8O13+hVKVEVGg_Mu4hkRLi6afBhoeduVAWW7g=5B8bQ@mail.gmail.com>

On 2013年12月05日 22:09, Rob Herring wrote:
> On Tue, Dec 3, 2013 at 10:36 AM, Hanjun Guo <hanjun.guo@linaro.org> wrote:
[...]
>> +
>>   #endif /*_ASM_ARM_ACPI_H*/
>> diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c
>> index bd9bbd0..8199360 100644
>> --- a/arch/arm64/kernel/setup.c
>> +++ b/arch/arm64/kernel/setup.c
>> @@ -41,6 +41,7 @@
>>   #include <linux/memblock.h>
>>   #include <linux/of_fdt.h>
>>   #include <linux/of_platform.h>
>> +#include <linux/acpi.h>
>>
>>   #include <asm/cputype.h>
>>   #include <asm/elf.h>
>> @@ -225,6 +226,13 @@ void __init setup_arch(char **cmdline_p)
>>
>>          arm64_memblock_init();
>>
>> +       /*
>> +        * Parse the ACPI tables for possible boot-time configuration
>> +        */
>> +       acpi_boot_table_init();
>> +       early_acpi_boot_init();
>> +       acpi_boot_init();
>> +
> How about a single function here. Perhaps called acpi_early_init. That
> would save checking acpi_disabled 3 times.

It is separated for some reasons on intel platforms, one of them
is ACPI based memory hot-plug, SRAT (NUMA related ACPI table)
and its related memory initialization should be finished between
early_acpi_boot_init() and acpi_boot_init().

I keep this code unchanged for future use (memory hotplug)
on ARM, is this make sense to you?

>>          paging_init();
>>          request_standard_resources();
>>
[...]
>> lic License for more details.
>> + *
>> + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> + */
>> +
>> +#include <linux/init.h>
>> +#include <linux/acpi.h>
>> +#include <linux/acpi_pmtmr.h>
>> +#include <linux/efi.h>
>> +#include <linux/cpumask.h>
>> +#include <linux/memblock.h>
>> +#include <linux/module.h>
>> +#include <linux/irq.h>
>> +#include <linux/irqdomain.h>
>> +#include <linux/slab.h>
>> +#include <linux/bootmem.h>
>> +#include <linux/ioport.h>
>> +#include <linux/pci.h>
>> +
>> +#include <asm/pgtable.h>
>> +#include <asm/io.h>
> linux/io.h although I can't see where it is even needed.
>
>> +#include <asm/smp.h>
> linux/smp.h ...
>
> Seems like you have a lot of unnecessary headers here. efi.h, slab.h,
> pci.h, etc.

Thanks for the reminding, will update and clean them up.

>> +
>> +/*
>> + * We never plan to use RSDT on arm/arm64 as its deprecated in spec but this
>> + * variable is still required by the ACPI core
>> + */
>> +u32 acpi_rsdt_forced;
>> +
>> +int acpi_noirq;                        /* skip ACPI IRQ initialization */
>> +int acpi_strict;
>> +int acpi_disabled;
>> +EXPORT_SYMBOL(acpi_disabled);
>> +
>> +int acpi_pci_disabled;         /* skip ACPI PCI scan and IRQ initialization */
>> +EXPORT_SYMBOL(acpi_pci_disabled);
>> +
>> +#define PREFIX                 "ACPI: "
>> +
>> +/* FIXME: this function should be moved to topology.c when it is ready */
>> +void arch_fix_phys_package_id(int num, u32 slot)
>> +{
>> +       return;
>> +}
>> +EXPORT_SYMBOL_GPL(arch_fix_phys_package_id);
>> +
>> +/*
>> + * Boot-time Configuration
>> + */
>> +
> It is not really clear what this comment applies to.

Yes, only leading some confusion, will remove it.

>> +enum acpi_irq_model_id acpi_irq_model = ACPI_IRQ_MODEL_PLATFORM;
>> +
>> +static unsigned int gsi_to_irq(unsigned int gsi)
>> +{
>> +       int irq = irq_create_mapping(NULL, gsi);
>> +
>> +       return irq;
>> +}
>> +
>> +/*
>> + * __acpi_map_table() will be called before page_init(), so early_ioremap()
>> + * or early_memremap() should be called here.
>> + *
>> + * FIXME: early_io/memremap()/early_iounmap() are not upstream yet on ARM64,
>> + * just wait for Mark Salter's patchset accepted by mainline
>> + */
>> +char *__init __acpi_map_table(unsigned long phys, unsigned long size)
>> +{
>> +       if (!phys || !size)
>> +               return NULL;
>> +
>> +       /*
>> +        * temporarily use phys_to_virt(),
>> +        * should be early_memremap(phys, size) here
>> +        */
>> +       return phys_to_virt(phys);
>> +}
>> +
>> +void __init __acpi_unmap_table(char *map, unsigned long size)
>> +{
>> +       if (!map || !size)
>> +               return;
>> +
>> +       /* should be early_iounmap(map, size); */
>> +       return;
>> +}
>> +
>> +int acpi_gsi_to_irq(u32 gsi, unsigned int *irq)
>> +{
>> +       *irq = gsi_to_irq(gsi);
>> +
>> +       return 0;
>> +}
>> +EXPORT_SYMBOL_GPL(acpi_gsi_to_irq);
>> +
>> +/*
>> + * success: return IRQ number (>=0)
> '> 0' for interrupts is what normally means success in the kernel. 0
> is for no irq.

Will update :)

>> + * failure: return < 0
>> + */
>> +int acpi_register_gsi(struct device *dev, u32 gsi, int trigger, int polarity)
>> +{
>> +       return -1;
>> +}
>> +EXPORT_SYMBOL_GPL(acpi_register_gsi);
[...]
>> +
>> +static int __init parse_acpi(char *arg)
>> +{
>> +       if (!arg)
>> +               return -EINVAL;
>> +
>> +       /* "acpi=off" disables both ACPI table parsing and interpreter */
>> +       if (strcmp(arg, "off") == 0) {
>> +               disable_acpi();
>> +       }
>> +       /* acpi=strict disables out-of-spec workarounds */
>> +       else if (strcmp(arg, "strict") == 0) {
>> +               acpi_strict = 1;
>> +       }
>> +       return 0;
>> +}
>> +early_param("acpi", parse_acpi);
> These aren't common options across architectures?

Different architectures have different options,
such as x86, it has more options which ARM is not needed.

Thanks
Hanjun
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2013-12-05 14:28 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-03 16:36 [RFC part1 PATCH 0/7] Make ACPI core running on ARM64 Hanjun Guo
2013-12-03 16:36 ` [RFC part1 PATCH 1/7] ACPI: Make ACPI core running without PCI " Hanjun Guo
2013-12-03 16:41   ` Matthew Garrett
2013-12-04 14:08     ` Hanjun Guo
2013-12-05 22:04       ` Arnd Bergmann
2013-12-06 15:04         ` [Linaro-acpi] " Tomasz Nowicki
2013-12-06 17:23           ` Arnd Bergmann
2013-12-09  4:12             ` Hanjun Guo
2013-12-09 11:50               ` Catalin Marinas
2013-12-09 13:05                 ` Hanjun Guo
2013-12-09 16:35                   ` Arnd Bergmann
2013-12-09 16:55                     ` Catalin Marinas
2013-12-09 17:20                       ` Arnd Bergmann
2013-12-09 18:01                         ` Catalin Marinas
2013-12-16 20:51                           ` Graeme Gregory
2013-12-17 11:29                             ` Catalin Marinas
2013-12-19 11:30                               ` Graeme Gregory
2013-12-19 14:01                                 ` Arnd Bergmann
2013-12-19 15:43                                   ` Catalin Marinas
2013-12-20 19:55                               ` Mark Brown
2013-12-10  2:53                       ` Hanjun Guo
2013-12-09 17:06                     ` Matthew Garrett
2013-12-10  1:52                       ` Hanjun Guo
2013-12-10  3:28                       ` Arnd Bergmann
2013-12-10 19:22                         ` Mark Brown
2013-12-10 20:00                           ` Arnd Bergmann
2013-12-10 20:23                             ` Mark Brown
2013-12-11  3:07                               ` Arnd Bergmann
2013-12-11 11:02                                 ` Mark Brown
2013-12-10  9:56                       ` Linus Walleij
2013-12-09 23:34         ` Rob Herring
2013-12-03 16:47   ` One Thousand Gnomes
2013-12-04 14:15     ` Hanjun Guo
2013-12-03 16:36 ` [RFC part1 PATCH 2/7] ARM64 : Add dummy asm/cpu.h Hanjun Guo
2013-12-03 17:13   ` Mark Rutland
2013-12-04 15:00     ` Hanjun Guo
2013-12-03 17:59   ` Mark Brown
2013-12-03 16:36 ` [RFC part1 PATCH 3/7] ACPI / processor_core: Rework _PDC related stuff to make it more arch-independent Hanjun Guo
2013-12-03 16:46   ` Matthew Garrett
2013-12-04 14:11     ` Hanjun Guo
2013-12-03 16:51   ` One Thousand Gnomes
2013-12-03 17:02     ` Matthew Garrett
2013-12-04 14:16     ` Hanjun Guo
2013-12-03 16:36 ` [RFC part1 PATCH 4/7] ARM64 / ACPI: Introduce the skeleton of _PDC related for ARM64 Hanjun Guo
2013-12-03 16:53   ` One Thousand Gnomes
2013-12-04 14:17     ` Hanjun Guo
2013-12-03 17:12   ` Rob Herring
2013-12-04 14:30     ` Hanjun Guo
2013-12-03 16:36 ` [RFC part1 PATCH 5/7] ARM64 / ACPI: Introduce arm_core.c and its related head file Hanjun Guo
2013-12-03 18:03   ` Mark Rutland
2013-12-04 15:48     ` Hanjun Guo
2013-12-04  5:46   ` Zheng, Lv
2013-12-04 15:53     ` Hanjun Guo
2013-12-04 19:47       ` Al Stone
2013-12-05  3:38   ` Arnd Bergmann
2013-12-05 13:51     ` Hanjun Guo
2013-12-05 20:40       ` Arnd Bergmann
2013-12-05 14:09   ` Rob Herring
2013-12-05 14:27     ` Hanjun Guo [this message]
2013-12-03 16:36 ` [RFC part1 PATCH 6/7] ARM64 / ACPI: Introduce lowlevel suspend function Hanjun Guo
2013-12-03 16:36 ` [RFC part1 PATCH 7/7] ARM64 / ACPI: Enable ARM64 in Kconfig Hanjun Guo
2013-12-04 10:10   ` Graeme Gregory
2013-12-04 15:55     ` Hanjun Guo
2013-12-05 22:25 ` [RFC part1 PATCH 0/7] Make ACPI core running on ARM64 Arnd Bergmann
2013-12-06 13:58   ` Mark Brown
2013-12-08  2:44     ` Arnd Bergmann
2013-12-08 19:40       ` Mark Brown
2013-12-10  9:45       ` Linus Walleij

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=52A08D6E.9070400@linaro.org \
    --to=hanjun.guo@linaro.org \
    --cc=al.stone@linaro.org \
    --cc=bhelgaas@google.com \
    --cc=catalin.marinas@arm.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=graeme.gregory@linaro.org \
    --cc=grant.likely@linaro.org \
    --cc=linaro-acpi@lists.linaro.org \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=mjg59@srcf.ucam.org \
    --cc=olof@lixom.net \
    --cc=patches@linaro.org \
    --cc=rjw@rjwysocki.net \
    --cc=rob.herring@calxeda.com \
    --cc=robherring2@gmail.com \
    --cc=will.deacon@arm.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;
as well as URLs for NNTP newsgroup(s).