Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1226315

Re: [PATCH v2 3/5] irqchip/gic: Convert the GIC driver to ACPI probing

From Marc Zyngier <marc.zyngier@arm.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 3/5] irqchip/gic: Convert the GIC driver to ACPI probing
Date 2015-09-16 19:30 +0200
Message-ID <q9oGT-2DH-21@gated-at.bofh.it> (permalink)
References <q8g8F-1qp-1@gated-at.bofh.it> <q8g8G-1qp-19@gated-at.bofh.it> <q9mvo-821-27@gated-at.bofh.it>
Organization ARM Ltd

Show all headers | View raw


On 16/09/15 16:05, Hanjun Guo wrote:
> 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?

Please keep it self-contained so far. We can "optimize" later.

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny...
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/5] ACPI probing infrastructure Marc Zyngier <marc.zyngier@arm.com> - 2015-09-13 16:10 +0200
  [PATCH v2 4/5] clocksource/acpi: Add probing infrastructure for ACPI-based clocksources Marc Zyngier <marc.zyngier@arm.com> - 2015-09-13 16:10 +0200
  [PATCH v2 2/5] irqchip/acpi: Add probing infrastructure for ACPI-based irqchips Marc Zyngier <marc.zyngier@arm.com> - 2015-09-13 16:10 +0200
  [PATCH v2 1/5] acpi: Add basic device probing infrastructure Marc Zyngier <marc.zyngier@arm.com> - 2015-09-13 16:10 +0200
  [PATCH v2 5/5] clocksource/arm_arch_timer: Convert to ACPI probing Marc Zyngier <marc.zyngier@arm.com> - 2015-09-13 16:10 +0200
  [PATCH v2 3/5] irqchip/gic: Convert the GIC driver to ACPI probing Marc Zyngier <marc.zyngier@arm.com> - 2015-09-13 16:10 +0200
    Re: [PATCH v2 3/5] irqchip/gic: Convert the GIC driver to ACPI probing Hanjun Guo <hanjun.guo@linaro.org> - 2015-09-16 17:10 +0200
      Re: [PATCH v2 3/5] irqchip/gic: Convert the GIC driver to ACPI probing Marc Zyngier <marc.zyngier@arm.com> - 2015-09-16 19:30 +0200
    Re: [PATCH v2 3/5] irqchip/gic: Convert the GIC driver to ACPI probing Hanjun Guo <hanjun.guo@linaro.org> - 2015-09-16 17:20 +0200

csiph-web