linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hanjun Guo <hanjun.guo@linaro.org>
To: Marc Zyngier <marc.zyngier@arm.com>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Len Brown <lenb@kernel.org>, Tomasz Nowicki <tn@semihalf.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Jason Cooper <jason@lakedaemon.net>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Sudeep Holla <sudeep.holla@arm.com>,
	Will Deacon <will.deacon@arm.com>,
	Catalin Marinas <catalin.marinas@arm.com>
Cc: linaro-acpi@lists.linaro.org, linux-acpi@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 3/5] irqchip/gic: Convert the GIC driver to ACPI probing
Date: Wed, 16 Sep 2015 23:09:21 +0800	[thread overview]
Message-ID: <55F98621.1030201@linaro.org> (raw)
In-Reply-To: <1442152943-24493-4-git-send-email-marc.zyngier@arm.com>

Hi Marc,

On 09/13/2015 10:02 PM, Marc Zyngier wrote:
[...]
> diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
> index e6b7ed5..8a0b9c3 100644
> --- a/drivers/irqchip/irq-gic.c
> +++ b/drivers/irqchip/irq-gic.c
> @@ -41,7 +41,6 @@
>   #include <linux/irqchip.h>
>   #include <linux/irqchip/chained_irq.h>
>   #include <linux/irqchip/arm-gic.h>
> -#include <linux/irqchip/arm-gic-acpi.h>
>
>   #include <asm/cputype.h>
>   #include <asm/irq.h>
> @@ -1177,7 +1176,7 @@ IRQCHIP_DECLARE(msm_qgic2, "qcom,msm-qgic2", gic_of_init);
>   #endif
>
>   #ifdef CONFIG_ACPI
> -static phys_addr_t dist_phy_base, cpu_phy_base __initdata;
> +static phys_addr_t cpu_phy_base __initdata;
>
>   static int __init
>   gic_acpi_parse_madt_cpu(struct acpi_subtable_header *header,
> @@ -1205,60 +1204,56 @@ gic_acpi_parse_madt_cpu(struct acpi_subtable_header *header,
>   	return 0;
>   }
>
> -static int __init
> -gic_acpi_parse_madt_distributor(struct acpi_subtable_header *header,
> -				const unsigned long end)
> +/* The things you have to do to just *count* something... */
> +static int __init acpi_dummy_func(struct acpi_subtable_header *header,
> +				  const unsigned long end)
>   {
> -	struct acpi_madt_generic_distributor *dist;
> +	return 0;
> +}
>
> -	dist = (struct acpi_madt_generic_distributor *)header;
> +static bool __init acpi_gic_redist_is_present(void)
> +{
> +	return acpi_table_parse_madt(ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR,
> +				     acpi_dummy_func, 0) > 0;
> +}
>
> -	if (BAD_MADT_ENTRY(dist, end))
> -		return -EINVAL;
> +static bool __init gic_validate_dist(struct acpi_subtable_header *header,
> +				     struct acpi_probe_entry *ape)
> +{
> +	struct acpi_madt_generic_distributor *dist;
> +	dist = (struct acpi_madt_generic_distributor *)header;
>
> -	dist_phy_base = dist->base_address;
> -	return 0;
> +	return (dist->version == ape->driver_data &&
> +		(dist->version != ACPI_MADT_GIC_VERSION_NONE ||
> +		 !acpi_gic_redist_is_present()));
>

When I was rebasing the GICv3 patches on top of yours, I noticed
that GICv3 will also needs to check the acpi_gic_redist_is_present(),
can we move the code above to some common place, or just leave
the code duplicate but self-contained?

Thanks
Hanjun

  parent reply	other threads:[~2015-09-16 15:10 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-13 14:02 [PATCH v2 0/5] ACPI probing infrastructure Marc Zyngier
2015-09-13 14:02 ` [PATCH v2 1/5] acpi: Add basic device " Marc Zyngier
2015-09-25 23:54   ` Rafael J. Wysocki
2015-09-13 14:02 ` [PATCH v2 2/5] irqchip/acpi: Add probing infrastructure for ACPI-based irqchips Marc Zyngier
2015-09-13 14:02 ` [PATCH v2 3/5] irqchip/gic: Convert the GIC driver to ACPI probing Marc Zyngier
2015-09-16 15:05   ` Hanjun Guo
2015-09-16 17:28     ` Marc Zyngier
2015-09-16 15:09   ` Hanjun Guo [this message]
2015-09-13 14:02 ` [PATCH v2 4/5] clocksource/acpi: Add probing infrastructure for ACPI-based clocksources Marc Zyngier
2015-09-13 14:02 ` [PATCH v2 5/5] clocksource/arm_arch_timer: Convert to ACPI probing Marc Zyngier
2015-09-25 23:45 ` [PATCH v2 0/5] ACPI probing infrastructure Rafael J. Wysocki
2015-09-28 12:59   ` Marc Zyngier
2015-09-28 13:53     ` Rafael J. Wysocki
2015-09-28 13:50       ` Marc Zyngier
2015-09-28 19:43         ` [Linaro-acpi] " Al Stone
2015-09-28 19:49           ` Rafael J. Wysocki

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=55F98621.1030201@linaro.org \
    --to=hanjun.guo@linaro.org \
    --cc=catalin.marinas@arm.com \
    --cc=jason@lakedaemon.net \
    --cc=lenb@kernel.org \
    --cc=linaro-acpi@lists.linaro.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=marc.zyngier@arm.com \
    --cc=rjw@rjwysocki.net \
    --cc=sudeep.holla@arm.com \
    --cc=tglx@linutronix.de \
    --cc=tn@semihalf.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).